Browse Source

* new x11 package

peter 26 years ago
parent
commit
823c58dfc9
6 changed files with 4991 additions and 0 deletions
  1. 966 0
      packages/x11/Makefile
  2. 9 0
      packages/x11/Makefile.fpc
  3. 568 0
      packages/x11/x.pp
  4. 2098 0
      packages/x11/xlib.pp
  5. 457 0
      packages/x11/xresource.pp
  6. 893 0
      packages/x11/xutil.pp

+ 966 - 0
packages/x11/Makefile

@@ -0,0 +1,966 @@
+#
+# Makefile generated by fpcmake v0.99.13 on 1999-12-23 20:20
+#
+
+defaultrule: all
+
+#####################################################################
+# Autodetect OS (Linux or Dos or Windows NT)
+# define inlinux when running under linux
+# define inWinNT when running under WinNT
+#####################################################################
+
+# We need only / in the path
+override PATH:=$(subst \,/,$(PATH))
+
+# Search for PWD and determine also if we are under linux
+PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(subst ;, ,$(PATH)))))
+ifeq ($(PWD),)
+PWD:=$(strip $(wildcard $(addsuffix /pwd,$(subst :, ,$(PATH)))))
+ifeq ($(PWD),)
+nopwd:
+	@echo You need the GNU utils package to use this Makefile!
+	@echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
+	@exit
+else
+inlinux=1
+endif
+else
+PWD:=$(firstword $(PWD))
+endif
+
+# Detect NT - NT sets OS to Windows_NT
+ifndef inlinux
+ifeq ($(OS),Windows_NT)
+inWinNT=1
+endif
+endif
+
+# Detect OS/2 - OS/2 has OS2_SHELL defined
+ifndef inlinux
+ifndef inWinNT
+ifdef OS2_SHELL
+inOS2=1
+endif
+endif
+endif
+
+# The extension of executables
+ifdef inlinux
+EXEEXT=
+else
+EXEEXT=.exe
+endif
+
+# The path which is search separated by spaces
+ifdef inlinux
+SEARCHPATH=$(subst :, ,$(PATH))
+else
+SEARCHPATH=$(subst ;, ,$(PATH))
+endif
+
+#####################################################################
+# FPC version/target Detection
+#####################################################################
+
+# What compiler to use ?
+ifndef FPC
+# Compatibility with old makefiles
+ifdef PP
+export FPC=$(PP)
+else
+ifdef inOS2
+export FPC=ppos2$(EXEEXT)
+else
+export FPC=ppc386$(EXEEXT)
+endif
+endif
+endif
+
+# Target OS
+ifndef OS_TARGET
+export OS_TARGET:=$(shell $(FPC) -iTO)
+endif
+
+# Source OS
+ifndef OS_SOURCE
+export OS_SOURCE:=$(shell $(FPC) -iSO)
+endif
+
+# Target CPU
+ifndef CPU_TARGET
+export CPU_TARGET:=$(shell $(FPC) -iTP)
+endif
+
+# Source CPU
+ifndef CPU_SOURCE
+export CPU_SOURCE:=$(shell $(FPC) -iSP)
+endif
+
+# FPC version
+ifndef FPC_VERSION
+export FPC_VERSION:=$(shell $(FPC) -iV)
+endif
+
+#####################################################################
+# Default Settings
+#####################################################################
+
+# Release ? Then force OPT and don't use extra opts via commandline
+ifndef REDIRFILE
+REDIRFILE=log
+endif
+
+ifdef RELEASE
+override OPT:=-Xs -OG2p3 -n
+endif
+
+# Verbose settings (warning,note,info)
+ifdef VERBOSE
+override OPT+=-vwni
+endif
+
+ifdef REDIR
+ifndef inlinux
+override FPC=redir -eo $(FPC)
+endif
+# set the verbosity to max
+override OPT+=-va
+override REDIR:= >> $(REDIRFILE)
+endif
+
+#####################################################################
+# User Settings
+#####################################################################
+
+
+# Targets
+
+override UNITOBJECTS+=x xresource xlib xutil
+
+# Clean
+
+
+# Install
+
+ZIPTARGET=install
+
+# Defaults
+
+
+# Directories
+
+ifndef FPCDIR
+FPCDIR=../..
+endif
+ifndef PACKAGEDIR
+PACKAGEDIR=$(FPCDIR)/packages
+endif
+ifndef COMPONENTDIR
+COMPONENTDIR=$(FPCDIR)/components
+endif
+
+# Packages
+
+
+# Libraries
+
+
+# Info
+
+INFOTARGET=fpc_infocfg fpc_infoobjects fpc_infoinstall 
+
+#####################################################################
+# Default Directories
+#####################################################################
+
+# Base dir
+ifdef PWD
+BASEDIR:=$(shell $(PWD))
+else
+BASEDIR=.
+endif
+
+# this can be set to 'rtl' when the RTL units are installed
+ifndef UNITPREFIX
+UNITPREFIX=units
+endif
+
+# set the prefix directory where to install everything
+ifndef PREFIXINSTALLDIR
+ifdef inlinux
+export PREFIXINSTALLDIR=/usr
+else
+export PREFIXINSTALLDIR=/pp
+endif
+endif
+
+# create fcldir,rtldir,unitdir
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifneq ($(FPCDIR),.)
+override RTLDIR=$(FPCDIR)/rtl/$(OS_TARGET)
+override FCLDIR=$(FPCDIR)/fcl/$(OS_TARGET)
+override UNITSDIR=$(FPCDIR)/units/$(OS_TARGET)
+endif
+endif
+
+#####################################################################
+# Install Directories
+#####################################################################
+
+# set the base directory where to install everything
+ifndef BASEINSTALLDIR
+ifdef inlinux
+BASEINSTALLDIR=$(PREFIXINSTALLDIR)/lib/fpc/$(FPC_VERSION)
+else
+BASEINSTALLDIR=$(PREFIXINSTALLDIR)
+endif
+endif
+
+# set the directory where to install the binaries
+ifndef BININSTALLDIR
+ifdef inlinux
+BININSTALLDIR=$(PREFIXINSTALLDIR)/bin
+else
+BININSTALLDIR=$(BASEINSTALLDIR)/bin/$(OS_TARGET)
+endif
+endif
+
+# set the directory where to install the units.
+ifndef UNITINSTALLDIR
+UNITINSTALLDIR=$(BASEINSTALLDIR)/$(UNITPREFIX)/$(OS_TARGET)
+endif
+
+# Where to install shared libraries
+ifndef LIBINSTALLDIR
+ifdef inlinux
+LIBINSTALLDIR=$(PREFIXINSTALLDIR)/lib
+else
+LIBINSTALLDIR=$(UNITINSTALLDIR)
+endif
+endif
+
+# Where the source files will be stored
+ifndef SOURCEINSTALLDIR
+ifdef inlinux
+SOURCEINSTALLDIR=$(PREFIXINSTALLDIR)/src/fpc-$(FPC_VERSION)
+else
+SOURCEINSTALLDIR=$(BASEINSTALLDIR)/source
+endif
+endif
+
+# Where the doc files will be stored
+ifndef DOCINSTALLDIR
+ifdef inlinux
+DOCINSTALLDIR=$(PREFIXINSTALLDIR)/doc/fpc/$(FPC_VERSION)
+else
+DOCINSTALLDIR=$(BASEINSTALLDIR)/doc
+endif
+endif
+
+# Where the some extra (data)files will be stored
+ifndef EXTRAINSTALLDIR
+EXTRAINSTALLDIR=$(BASEINSTALLDIR)
+endif
+
+
+#####################################################################
+# Compiler Command Line
+#####################################################################
+
+# Load commandline OPTDEF and add FPC_CPU define
+override FPCOPTDEF:=-d$(CPU_TARGET)
+
+# Load commandline OPT and add target and unit dir to be sure
+ifneq ($(OS_TARGET),$(OS_SOURCE))
+override FPCOPT+=-T$(OS_TARGET)
+endif
+
+ifdef RTLDIR
+override FPCOPT+=-Fu$(RTLDIR)
+endif
+
+ifdef UNITSDIR
+override FPCOPT+=-Fu$(UNITSDIR)
+endif
+
+# Smartlinking
+ifdef SMARTLINK
+override FPCOPT+=-CX
+endif
+
+# Debug
+ifdef DEBUG
+override FPCOPT+=-g
+endif
+
+# Add commandline options
+ifdef OPT
+override FPCOPT+=$(OPT)
+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
+
+# Add defines from FPCOPTDEF to FPCOPT
+ifdef FPCOPTDEF
+override FPCOPT+=$(FPCOPTDEF)
+endif
+
+# Error file ?
+ifdef ERRORFILE
+override FPCOPT+=-Fr$(ERRORFILE)
+endif
+
+# Was a config file specified ?
+ifdef CFGFILE
+override FPCOPT+=@$(CFGFILE)
+endif
+
+# For win32 the options are passed using the environment variable FPCEXTCMD
+ifeq ($(OS_SOURCE),win32)
+override FPCEXTCMD:=$(FPCOPT)
+override FPCOPT:=!FPCEXTCMD
+export FPCEXTCMD
+endif
+
+# Compiler commandline
+override COMPILER:=$(FPC) $(FPCOPT)
+
+#####################################################################
+# Shell tools
+#####################################################################
+
+# To copy pograms
+ifndef COPY
+export COPY:=cp -fp
+endif
+
+# Copy a whole tree
+ifndef COPYTREE
+export COPYTREE:=cp -rfp
+endif
+
+# To move pograms
+ifndef MOVE
+export MOVE:=mv -f
+endif
+
+# Check delete program
+ifndef DEL
+export DEL:=rm -f
+endif
+
+# Check deltree program
+ifndef DELTREE
+export DELTREE:=rm -rf
+endif
+
+# To install files
+ifndef INSTALL
+ifdef inlinux
+export INSTALL:=install -m 644
+else
+export INSTALL:=$(COPY)
+endif
+endif
+
+# To install programs
+ifndef INSTALLEXE
+ifdef inlinux
+export INSTALLEXE:=install -m 755
+else
+export INSTALLEXE:=$(COPY)
+endif
+endif
+
+# To make a directory.
+ifndef MKDIR
+ifdef inlinux
+export MKDIR:=install -m 755 -d
+else
+export MKDIR:=ginstall -m 755 -d
+endif
+endif
+
+#####################################################################
+# Default Tools
+#####################################################################
+
+# assembler, redefine it if cross compiling
+ifndef AS
+AS=as
+endif
+
+# linker, but probably not used
+ifndef LD
+LD=ld
+endif
+
+# ppas.bat / ppas.sh
+ifdef inlinux
+PPAS=ppas.sh
+else
+ifdef inOS2
+PPAS=ppas.cmd
+else
+PPAS=ppas.bat
+endif
+endif
+
+# also call ppas if with command option -s
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+EXECPPAS:=@$(PPAS)
+endif
+
+# ldconfig to rebuild .so cache
+ifdef inlinux
+LDCONFIG=ldconfig
+else
+LDCONFIG=
+endif
+
+# echo
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+export ECHO:=echo
+else
+export ECHO:=$(firstword $(ECHO))
+endif
+endif
+
+# ppdep
+ifndef PPDEP
+PPDEP:=$(strip $(wildcard $(addsuffix /ppdep$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPDEP),)
+PPDEP=
+else
+export PPDEP:=$(firstword $(PPDEP))
+endif
+endif
+
+# ppumove
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE=
+else
+export PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+
+# ppufiles
+ifndef PPUFILES
+PPUFILES:=$(strip $(wildcard $(addsuffix /ppufiles$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUFILES),)
+PPUFILES=
+else
+export PPUFILES:=$(firstword $(PPUFILES))
+endif
+endif
+
+# Look if UPX is found for go32v2 and win32. We can't use $UPX becuase
+# upx uses that one itself (PFV)
+ifndef UPXPROG
+ifeq ($(OS_TARGET),go32v2)
+UPXPROG:=1
+endif
+ifeq ($(OS_TARGET),win32)
+UPXPROG:=1
+endif
+ifdef UPXPROG
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(UPXPROG),)
+UPXPROG=
+else
+export UPXPROG:=$(firstword $(UPXPROG))
+endif
+else
+UPXPROG=
+endif
+endif
+
+# gdate/date
+ifndef DATE
+DATE:=$(strip $(wildcard $(addsuffix /date$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE:=$(strip $(wildcard $(addsuffix /gdate$(EXEEXT),$(SEACHPATH))))
+ifeq ($(DATE),)
+DATE=
+else
+export DATE:=$(firstword $(DATE))
+endif
+else
+export DATE:=$(firstword $(DATE))
+endif
+endif
+
+ifdef DATE
+DATESTR:=$(shell $(DATE) +%Y%m%d)
+else
+DATESTR=
+endif
+
+# ZipProg, you can't use Zip as the var name (PFV)
+ifndef ZIPPROG
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(EXEEXT),$(SEARCHPATH))))
+ifeq ($(ZIPPROG),)
+ZIPPROG=
+else
+export ZIPPROG:=$(firstword $(ZIPPROG)) -D9 -r
+endif
+endif
+
+ifndef ZIPEXT
+ZIPEXT=.zip
+endif
+
+#####################################################################
+# Default extensions
+#####################################################################
+
+# Default needed extensions (Go32v2,Linux)
+LOADEREXT=.as
+PPLEXT=.ppl
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.so
+PACKAGESUFFIX=
+FPCMADE=fpcmade
+
+# Go32v1
+ifeq ($(OS_TARGET),go32v1)
+PPUEXT=.pp1
+OEXT=.o1
+ASMEXT=.s1
+SMARTEXT=.sl1
+STATICLIBEXT=.a1
+SHAREDLIBEXT=.so1
+PACKAGESUFFIX=v1
+FPCMADE=fpcmade.v1
+endif
+
+# Go32v2
+ifeq ($(OS_TARGET),go32v2)
+PACKAGESUFFIX=go32
+FPCMADE=fpcmade.dos
+endif
+
+# Linux
+ifeq ($(OS_TARGET),linux)
+PACKAGESUFFIX=linux
+FPCMADE=fpcmade.lnx
+endif
+
+# Win32
+ifeq ($(OS_TARGET),win32)
+PPUEXT=.ppw
+OEXT=.ow
+ASMEXT=.sw
+SMARTEXT=.slw
+STATICLIBEXT=.aw
+SHAREDLIBEXT=.dll
+PACKAGESUFFIX=win32
+FPCMADE=fpcmade.w32
+endif
+
+# OS/2
+ifeq ($(OS_TARGET),os2)
+PPUEXT=.ppo
+ASMEXT=.so2
+OEXT=.oo2
+SMARTEXT=.so
+STATICLIBEXT=.ao2
+SHAREDLIBEXT=.dll
+PACKAGESUFFIX=os2
+FPCMADE=fpcmade.os2
+endif
+
+# library prefix
+LIBPREFIX=lib
+ifeq ($(OS_TARGET),go32v2)
+LIBPREFIX=
+endif
+ifeq ($(OS_TARGET),go32v1)
+LIBPREFIX=
+endif
+
+# determine which .pas extension is used
+ifndef PASEXT
+ifdef EXEOBJECTS
+override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(EXEOBJECTS)))))
+else
+override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(UNITOBJECTS)))))
+endif
+ifeq ($(TESTPAS),)
+PASEXT=.pp
+else
+PASEXT=.pas
+endif
+endif
+
+#####################################################################
+# Standard rules
+#####################################################################
+
+all: fpc_all
+
+debug: fpc_debug
+
+smart: fpc_smart
+
+shared: fpc_shared
+
+showinstall: fpc_showinstall
+
+install: fpc_install
+
+sourceinstall: fpc_sourceinstall
+
+zipinstall: fpc_zipinstall
+
+zipinstalladd: fpc_zipinstalladd
+
+clean: fpc_clean
+
+cleanall: fpc_cleanall
+
+info: fpc_info
+
+.PHONY:  all debug smart shared showinstall install sourceinstall zipinstall zipinstalladd clean cleanall info
+
+#####################################################################
+# Package depends
+#####################################################################
+
+ifneq ($(wildcard $(RTLDIR)),)
+ifeq ($(wildcard $(RTLDIR)/$(FPCMADE)),)
+override COMPILEPACKAGES+=rtl
+rtl_package:
+	$(MAKE) -C $(RTLDIR) all
+endif
+endif
+
+.PHONY:  rtl_package
+
+#####################################################################
+# Units
+#####################################################################
+
+.PHONY: fpc_units
+
+override ALLTARGET+=fpc_units
+
+override UNITPPUFILES=$(addsuffix $(PPUEXT),$(UNITOBJECTS))
+override INSTALLPPUFILES+=$(UNITPPUFILES)
+override CLEANPPUFILES+=$(UNITPPUFILES)
+
+fpc_units: $(UNITPPUFILES)
+
+#####################################################################
+# General compile rules
+#####################################################################
+
+.PHONY: fpc_all fpc_debug
+
+$(FPCMADE):
+	@$(ECHO) Compiled > $(FPCMADE)
+
+fpc_all: $(addsuffix _package,$(COMPILEPACKAGES)) \
+	 $(addsuffix _component,$(COMPILECOMPONENTS)) \
+	 $(ALLTARGET) $(FPCMADE)
+
+fpc_debug:
+	$(MAKE) all DEBUG=1
+
+# General compile rules, available for both possible PASEXT
+
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .pp
+
+%$(PPUEXT): %.pp
+	$(COMPILER) $< $(REDIR)
+	$(EXECPASS)
+
+%$(PPUEXT): %.pas
+	$(COMPILER) $< $(REDIR)
+	$(EXECPASS)
+
+%$(EXEEXT): %.pp
+	$(COMPILER) $< $(REDIR)
+	$(EXECPASS)
+
+%$(EXEEXT): %.pas
+	$(COMPILER) $< $(REDIR)
+	$(EXECPASS)
+
+#####################################################################
+# Library
+#####################################################################
+
+.PHONY: fpc_smart fpc_shared
+
+# Default sharedlib units are all unit objects
+ifndef SHAREDLIBUNITOBJECTS
+SHAREDLIBUNITOBJECTS:=$(UNITOBJECTS)
+endif
+
+fpc_smart:
+	$(MAKE) all SMARTLINK=1
+
+fpc_shared: all
+ifdef inlinux
+ifndef LIBNAME
+	@$(ECHO) "LIBNAME not set"
+else
+	$(PPUMOVE) $(SHAREDLIBUNITOBJECTS) -o$(LIBNAME)
+endif
+else
+	@$(ECHO) "Shared Libraries not supported"
+endif
+
+#####################################################################
+# Install rules
+#####################################################################
+
+.PHONY: fpc_showinstall fpc_install
+
+ifdef EXTRAINSTALLUNITS
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRAINSTALLUNITS))
+endif
+
+ifdef INSTALLPPUFILES
+ifdef PPUFILES
+ifdef inlinux
+INSTALLPPULINKFILES:=$(shell $(PPUFILES) -S -O $(INSTALLPPUFILES))
+INSTALLPPULIBFILES:=$(shell $(PPUFILES) -L $(INSTALLPPUFILES))
+else
+INSTALLPPULINKFILES:=$(shell $(PPUFILES) $(INSTALLPPUFILES))
+endif
+else
+INSTALLPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)))
+endif
+endif
+
+fpc_showinstall: $(SHOWINSTALLTARGET)
+ifdef INSTALLEXEFILES
+	@$(ECHO) -e $(addprefix "\n"$(BININSTALLDIR)/,$(INSTALLEXEFILES))
+endif
+ifdef INSTALLPPUFILES
+	@$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPUFILES))
+ifneq ($(INSTALLPPULINKFILES),)
+	@$(ECHO) -e $(addprefix "\n"$(UNITINSTALLDIR)/,$(INSTALLPPULINKFILES))
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	@$(ECHO) -e $(addprefix "\n"$(LIBINSTALLDIR)/,$(INSTALLPPULIBFILES))
+endif
+endif
+ifdef EXTRAINSTALLFILES
+	@$(ECHO) -e $(addprefix "\n"$(EXTRAINSTALLDIR)/,$(EXTRAINSTALLFILES))
+endif
+
+fpc_install: $(INSTALLTARGET)
+# Create UnitInstallFiles
+ifdef INSTALLEXEFILES
+	$(MKDIR) $(BININSTALLDIR)
+# Compress the exes if upx is defined
+ifdef UPXPROG
+	-$(UPXPROG) $(INSTALLEXEFILES)
+endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(BININSTALLDIR)
+endif
+ifdef INSTALLPPUFILES
+	$(MKDIR) $(UNITINSTALLDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(UNITINSTALLDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(UNITINSTALLDIR)
+endif
+ifneq ($(INSTALLPPULIBFILES),)
+	$(MKDIR) $(LIBINSTALLDIR)
+	$(INSTALL) $(INSTALLPPULIBFILES) $(LIBINSTALLDIR)
+endif
+endif
+ifdef EXTRAINSTALLFILES
+	$(MKDIR) $(EXTRAINSTALLDIR)
+	$(INSTALL) $(EXTRAINSTALLFILES) $(EXTRAINSTALLDIR)
+endif
+
+#####################################################################
+# Source install rules
+#####################################################################
+
+.PHONY: fpc_sourceinstall
+
+fpc_sourceinstall: clean
+	$(MKDIR) $(SOURCEINSTALLDIR)
+	$(COPYTREE) $(BASEDIR) $(SOURCEINSTALLDIR)
+
+#####################################################################
+# Zip
+#####################################################################
+
+.PHONY: fpc_zipinstall fpc_zipinstalladd
+
+# Temporary path to pack a file
+ifndef PACKDIR
+ifndef inlinux
+PACKDIR=pack_tmp
+else
+PACKDIR=/tmp/fpc-pack
+endif
+endif
+
+# Test dir if none specified
+ifndef DESTZIPDIR
+DESTZIPDIR:=$(BASEDIR)
+endif
+
+# Add .zip/.tar.gz extension
+ifdef ZIPNAME
+ifndef inlinux
+override ZIPNAME:=$(ZIPNAME)$(ZIPEXT)
+endif
+endif
+
+# Note: This will not remove the zipfile first
+fpc_zipinstalladd:
+ifndef ZIPNAME
+	@$(ECHO) "Please specify ZIPNAME!"
+	@exit 1
+else
+	$(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
+ifdef inlinux
+	gzip -d $(DESTZIPDIR)/$(ZIPNAME).tar.gz
+	cd $(PACKDIR) ; tar rv --file $(DESTZIPDIR)/$(ZIPNAME).tar * ; cd $(BASEDIR)
+	gzip $(DESTZIPDIR)/$(ZIPNAME).tar
+else
+	cd $(PACKDIR) ; $(ZIPPROG) $(DESTZIPDIR)/$(ZIPNAME) * ; cd $(BASEDIR)
+endif
+	$(DELTREE) $(PACKDIR)
+endif
+
+# First remove the zip and then install
+fpc_zipinstall:
+ifndef ZIPNAME
+	@$(ECHO) "Please specify ZIPNAME!"
+	@exit 1
+else
+	$(DEL) $(DESTZIPDIR)/$(ZIPNAME)
+	$(MAKE) $(ZIPTARGET) PREFIXINSTALLDIR=$(PACKDIR)
+ifdef inlinux
+	cd $(PACKDIR) ; tar cvz --file $(DESTZIPDIR)/$(ZIPNAME).tar.gz * ; cd $(BASEDIR)
+else
+	cd $(PACKDIR) ; $(ZIPPROG) $(DESTZIPDIR)/$(ZIPNAME) * ; cd $(BASEDIR)
+endif
+	$(DELTREE) $(PACKDIR)
+endif
+
+#####################################################################
+# Clean rules
+#####################################################################
+
+.PHONY: fpc_clean fpc_cleanall
+
+ifdef EXTRACLEANUNITS
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(EXTRACLEANUNITS))
+endif
+
+ifdef CLEANPPUFILES
+ifdef PPUFILES
+CLEANPPULINKFILES:=$(shell $(PPUFILES) $(CLEANPPUFILES))
+else
+CLEANPPULINKFILES:=$(wildcard $(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)))
+endif
+endif
+
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef EXTRACLEANFILES
+	-$(DEL) $(EXTRACLEANFILES)
+endif
+	-$(DEL) $(FPCMADE) $(PPAS) link.res $(REDIRFILE)
+
+fpc_cleanall: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+	-$(DEL) *$(OEXT) *$(PPUEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+	-$(DELTREE) *$(SMARTEXT)
+	-$(DEL) $(FPCMADE) $(PPAS) link.res $(REDIRFILE)
+
+#####################################################################
+# Info rules
+#####################################################################
+
+.PHONY: fpc_info fpc_cfginfo fpc_objectinfo fpc_toolsinfo fpc_installinfo \
+	fpc_dirinfo
+
+fpc_info: $(INFOTARGET)
+
+fpc_infocfg:
+	@$(ECHO)
+	@$(ECHO)  == Configuration info ==
+	@$(ECHO)
+	@$(ECHO)  FPC....... $(FPC)
+	@$(ECHO)  Version... $(FPC_VERSION)
+	@$(ECHO)  CPU....... $(CPU_TARGET)
+	@$(ECHO)  Source.... $(OS_SOURCE)
+	@$(ECHO)  Target.... $(OS_TARGET)
+	@$(ECHO)
+
+fpc_infoobjects:
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  LoaderObjects..... $(LOADEROBJECTS)
+	@$(ECHO)  UnitObjects....... $(UNITOBJECTS)
+	@$(ECHO)  ExeObjects........ $(EXEOBJECTS)
+	@$(ECHO)
+	@$(ECHO)  ExtraCleanUnits... $(EXTRACLEANUNITS)
+	@$(ECHO)  ExtraCleanFiles... $(EXTRACLEANFILES)
+	@$(ECHO)
+	@$(ECHO)  ExtraInstallUnits. $(EXTRAINSTALLUNITS)
+	@$(ECHO)  ExtraInstallFiles. $(EXTRAINSTALLFILES)
+	@$(ECHO)
+
+fpc_infoinstall:
+	@$(ECHO)
+	@$(ECHO)  == Install info ==
+	@$(ECHO)
+ifdef DATE
+	@$(ECHO)  DateStr.............. $(DATESTR)
+endif
+	@$(ECHO)  PackageSuffix........ $(PACKAGESUFFIX)
+	@$(ECHO)
+	@$(ECHO)  BaseInstallDir....... $(BASEINSTALLDIR)
+	@$(ECHO)  BinInstallDir........ $(BININSTALLDIR)
+	@$(ECHO)  LibInstallDir........ $(LIBINSTALLDIR)
+	@$(ECHO)  UnitInstallDir....... $(UNITINSTALLDIR)
+	@$(ECHO)  SourceInstallDir..... $(SOURCEINSTALLDIR)
+	@$(ECHO)  DocInstallDir........ $(DOCINSTALLDIR)
+	@$(ECHO)  ExtraInstallDir...... $(EXTRAINSTALLDIR)
+	@$(ECHO)
+

+ 9 - 0
packages/x11/Makefile.fpc

@@ -0,0 +1,9 @@
+#
+#   Makefile.fpc for X11 Bindings
+#
+
+[targets]
+units=x xresource xlib xutil
+
+[dirs]
+fpcdir=../..

+ 568 - 0
packages/x11/x.pp

@@ -0,0 +1,568 @@
+unit x;
+
+   { Changes to the original conversion marked MVC - Michael Van Canneyt}
+
+{$LinkLib X11}
+
+  interface
+
+    const
+       X_PROTOCOL = 11;
+
+       X_PROTOCOL_REVISION = 0;
+    
+
+    type
+    { Inserted the following by hand. It was under a ifndef _XSERVER64. All
+      were unsigned longs originally
+      -- MVC. } 
+	TXID = cardinal ;
+	TMask = cardinal ;
+	TAtom = cardinal ;
+	TVisualID = cardinal ;
+	TTime = cardinal ;
+	{ End of insert }
+       TWindow = TXID;
+       TDrawable = TXID;
+       TFont = TXID;
+       TPixmap = TXID;
+       TCursor = TXID;
+       TColormap = TXID;
+       TGContext = TXID;
+       TKeySym = TXID;
+       TKeyCode = char;
+       PKeyCode = ^TKeyCode;
+       { Pointers to all these things. Needed for C calls. MVC }
+       PAtom = ^TAtom; 
+       PPAtom = ^PAtom;
+       PWindow = ^TWindow;
+       PColormap = ^TColormap;
+       PKeySym = ^TKeysym;
+       PPixmap = ^TPixmap;
+       
+    {*****************************************************************
+     * RESERVED RESOURCE AND CONSTANT DEFINITIONS
+     *****************************************************************}
+    {* universal null resource or null atom *}
+
+    const
+       None = 0;
+    {* background pixmap in CreateWindow
+    				    and ChangeWindowAttributes *}
+       ParentRelative = 1;
+    {* border pixmap in CreateWindow
+    				       and ChangeWindowAttributes
+    				   special VisualID and special window
+    				       class passed to CreateWindow *}
+       CopyFromParent = 0;
+    {* destination window in SendEvent *}
+       PointerWindow = 0;
+    {* destination window in SendEvent *}
+       InputFocus = 1;
+    {* focus window in SetInputFocus *}
+       PointerRoot = 1;
+    {* special Atom, passed to GetProperty *}
+       AnyPropertyType = 0;
+    {* special Key Code, passed to GrabKey *}
+       AnyKey = 0;
+    {* special Button Code, passed to GrabButton *}
+       AnyButton = 0;
+    {* special Resource ID passed to KillClient *}
+       AllTemporary = 0;
+    {* special Time *}
+       CurrentTime = 0;
+    {* special KeySym *}
+    {***************************************************************** 
+     * EVENT DEFINITIONS 
+     *****************************************************************}
+    {* Input Event Masks. Used as event-mask window attribute and as arguments
+       to Grab requests.  Not to be confused with event names.  *}
+       NoSymbol = 0;
+       NoEventMask = 0;
+       KeyPressMask = (1) shl (0);
+       KeyReleaseMask = (1) shl (1);
+       ButtonPressMask = (1) shl (2);
+       ButtonReleaseMask = (1) shl (3);
+       EnterWindowMask = (1) shl (4);
+       LeaveWindowMask = (1) shl (5);
+       PointerMotionMask = (1) shl (6);
+       PointerMotionHintMask = (1) shl (7);
+       Button1MotionMask = (1) shl (8);
+       Button2MotionMask = (1) shl (9);
+       Button3MotionMask = (1) shl (10);
+       Button4MotionMask = (1) shl (11);
+       Button5MotionMask = (1) shl (12);
+       ButtonMotionMask = (1) shl (13);
+       KeymapStateMask = (1) shl (14);
+       ExposureMask = (1) shl (15);
+       VisibilityChangeMask = (1) shl (16);
+       StructureNotifyMask = (1) shl (17);
+       ResizeRedirectMask = (1) shl (18);
+       SubstructureNotifyMask = (1) shl (19);
+       SubstructureRedirectMask = (1) shl (20);
+       FocusChangeMask = (1) shl (21);
+       PropertyChangeMask = (1) shl (22);
+       ColormapChangeMask = (1) shl (23);
+    {* Event names.  Used in "type" field in XEvent structures.  Not to be
+    confused with event masks above.  They start from 2 because 0 and 1
+    are reserved in the protocol for errors and replies. *}
+       OwnerGrabButtonMask = (1) shl (24);
+       KeyPress = 2;
+       KeyRelease = 3;
+       ButtonPress = 4;
+       ButtonRelease = 5;
+       MotionNotify = 6;
+       EnterNotify = 7;
+       LeaveNotify = 8;
+       FocusIn = 9;
+       FocusOut = 10;
+       KeymapNotify = 11;
+       Expose = 12;
+       GraphicsExpose = 13;
+       NoExpose = 14;
+       VisibilityNotify = 15;
+       CreateNotify = 16;
+       DestroyNotify = 17;
+       UnmapNotify = 18;
+       MapNotify = 19;
+       MapRequest = 20;
+       ReparentNotify = 21;
+       ConfigureNotify = 22;
+       ConfigureRequest = 23;
+       GravityNotify = 24;
+       ResizeRequest = 25;
+       CirculateNotify = 26;
+       CirculateRequest = 27;
+       PropertyNotify = 28;
+       SelectionClear = 29;
+       SelectionRequest = 30;
+       SelectionNotify = 31;
+       ColormapNotify = 32;
+       ClientMessage = 33;
+       MappingNotify = 34;
+    {* must be bigger than any event # *}
+    {* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
+       state in various key-, mouse-, and button-related events. *}
+       LASTEvent = 35;
+       ShiftMask = (1) shl (0);
+       LockMask = (1) shl (1);
+       ControlMask = (1) shl (2);
+       Mod1Mask = (1) shl (3);
+       Mod2Mask = (1) shl (4);
+       Mod3Mask = (1) shl (5);
+       Mod4Mask = (1) shl (6);
+    {* modifier names.  Used to build a SetModifierMapping request or
+       to read a GetModifierMapping request.  These correspond to the
+       masks defined above. *}
+       Mod5Mask = (1) shl (7);
+       ShiftMapIndex = 0;
+       LockMapIndex = 1;
+       ControlMapIndex = 2;
+       Mod1MapIndex = 3;
+       Mod2MapIndex = 4;
+       Mod3MapIndex = 5;
+       Mod4MapIndex = 6;
+    {* button masks.  Used in same manner as Key masks above. Not to be confused
+       with button names below. *}
+       Mod5MapIndex = 7;
+       Button1Mask = (1) shl (8);
+       Button2Mask = (1) shl (9);
+       Button3Mask = (1) shl (10);
+       Button4Mask = (1) shl (11);
+       Button5Mask = (1) shl (12);
+    {* used in GrabButton, GrabKey *}
+    {* button names. Used as arguments to GrabButton and as detail in ButtonPress
+       and ButtonRelease events.  Not to be confused with button masks above.
+       Note that 0 is already defined above as "AnyButton".  *}
+       AnyModifier = (1) shl (15);
+       Button1 = 1;
+       Button2 = 2;
+       Button3 = 3;
+       Button4 = 4;
+    {* Notify modes *}
+       Button5 = 5;
+       NotifyNormal = 0;
+       NotifyGrab = 1;
+       NotifyUngrab = 2;
+       NotifyWhileGrabbed = 3;
+    {* for MotionNotify events *}
+    {* Notify detail *}
+       NotifyHint = 1;
+       NotifyAncestor = 0;
+       NotifyVirtual = 1;
+       NotifyInferior = 2;
+       NotifyNonlinear = 3;
+       NotifyNonlinearVirtual = 4;
+       NotifyPointer = 5;
+       NotifyPointerRoot = 6;
+    {* Visibility notify *}
+       NotifyDetailNone = 7;
+       VisibilityUnobscured = 0;
+       VisibilityPartiallyObscured = 1;
+    {* Circulation request *}
+       VisibilityFullyObscured = 2;
+       PlaceOnTop = 0;
+    {* protocol families *}
+       PlaceOnBottom = 1;
+       FamilyInternet = 0;
+       FamilyDECnet = 1;
+    {* Property notification *}
+       FamilyChaos = 2;
+       PropertyNewValue = 0;
+    {* Color Map notification *}
+       PropertyDelete = 1;
+       ColormapUninstalled = 0;
+    {* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes *}
+       ColormapInstalled = 1;
+       GrabModeSync = 0;
+    {* GrabPointer, GrabKeyboard reply status *}
+       GrabModeAsync = 1;
+       GrabSuccess = 0;
+       AlreadyGrabbed = 1;
+       GrabInvalidTime = 2;
+       GrabNotViewable = 3;
+    {* AllowEvents modes *}
+       GrabFrozen = 4;
+       AsyncPointer = 0;
+       SyncPointer = 1;
+       ReplayPointer = 2;
+       AsyncKeyboard = 3;
+       SyncKeyboard = 4;
+       ReplayKeyboard = 5;
+       AsyncBoth = 6;
+    {* Used in SetInputFocus, GetInputFocus *}
+       SyncBoth = 7;
+    {*****************************************************************
+     * ERROR CODES 
+     *****************************************************************}
+       RevertToParent = 2;
+    {* everything's okay *}
+       Success = 0;
+    {* bad request code *}
+       BadRequest = 1;
+    {* int parameter out of range *}
+       BadValue = 2;
+    {* parameter not a Window *}
+       BadWindow = 3;
+    {* parameter not a Pixmap *}
+       BadPixmap = 4;
+    {* parameter not an Atom *}
+       BadAtom = 5;
+    {* parameter not a Cursor *}
+       BadCursor = 6;
+    {* parameter not a Font *}
+       BadFont = 7;
+    {* parameter mismatch *}
+       BadMatch = 8;
+    {* parameter not a Pixmap or Window *}
+       BadDrawable = 9;
+    {* depending on context:
+    				 - key/button already grabbed
+    				 - attempt to free an illegal 
+    				   cmap entry 
+    				- attempt to store into a read-only 
+    				   color map entry.
+     				- attempt to modify the access control
+    				   list from other than the local host.
+    				*}
+       BadAccess = 10;
+    {* insufficient resources *}
+       BadAlloc = 11;
+    {* no such colormap *}
+       BadColor = 12;
+    {* parameter not a GC *}
+       BadGC = 13;
+    {* choice not in range or already used *}
+       BadIDChoice = 14;
+    {* font or color name doesn't exist *}
+       BadName = 15;
+    {* Request length incorrect *}
+       BadLength = 16;
+    {* server is defective *}
+       BadImplementation = 17;
+       FirstExtensionError = 128;
+    {*****************************************************************
+     * WINDOW DEFINITIONS 
+     *****************************************************************}
+    {* Window classes used by CreateWindow *}
+    {* Note that CopyFromParent is already defined as 0 above *}
+       LastExtensionError = 255;
+       InputOutput = 1;
+    {* Window attributes for CreateWindow and ChangeWindowAttributes *}
+       InputOnly = 2;
+       CWBackPixmap = (1) shl (0);
+       CWBackPixel = (1) shl (1);
+       CWBorderPixmap = (1) shl (2);
+       CWBorderPixel = (1) shl (3);
+       CWBitGravity = (1) shl (4);
+       CWWinGravity = (1) shl (5);
+       CWBackingStore = (1) shl (6);
+       CWBackingPlanes = (1) shl (7);
+       CWBackingPixel = (1) shl (8);
+       CWOverrideRedirect = (1) shl (9);
+       CWSaveUnder = (1) shl (10);
+       CWEventMask = (1) shl (11);
+       CWDontPropagate = (1) shl (12);
+       CWColormap = (1) shl (13);
+    {* ConfigureWindow structure *}
+       CWCursor = (1) shl (14);
+       CWX = (1) shl (0);
+       CWY = (1) shl (1);
+       CWWidth = (1) shl (2);
+       CWHeight = (1) shl (3);
+       CWBorderWidth = (1) shl (4);
+       CWSibling = (1) shl (5);
+    {* Bit Gravity *}
+       CWStackMode = (1) shl (6);
+       ForgetGravity = 0;
+       NorthWestGravity = 1;
+       NorthGravity = 2;
+       NorthEastGravity = 3;
+       WestGravity = 4;
+       CenterGravity = 5;
+       EastGravity = 6;
+       SouthWestGravity = 7;
+       SouthGravity = 8;
+       SouthEastGravity = 9;
+    {* Window gravity + bit gravity above *}
+       StaticGravity = 10;
+    {* Used in CreateWindow for backing-store hint *}
+       UnmapGravity = 0;
+       NotUseful = 0;
+       WhenMapped = 1;
+    {* Used in GetWindowAttributes reply *}
+       Always = 2;
+       IsUnmapped = 0;
+       IsUnviewable = 1;
+    {* Used in ChangeSaveSet *}
+       IsViewable = 2;
+       SetModeInsert = 0;
+    {* Used in ChangeCloseDownMode *}
+       SetModeDelete = 1;
+       DestroyAll = 0;
+       RetainPermanent = 1;
+    {* Window stacking method (in configureWindow) *}
+       RetainTemporary = 2;
+       Above = 0;
+       Below = 1;
+       TopIf = 2;
+       BottomIf = 3;
+    {* Circulation direction *}
+       Opposite = 4;
+       RaiseLowest = 0;
+    {* Property modes *}
+       LowerHighest = 1;
+       PropModeReplace = 0;
+       PropModePrepend = 1;
+    {*****************************************************************
+     * GRAPHICS DEFINITIONS
+     *****************************************************************}
+    {* graphics functions, as in GC.alu *}
+       PropModeAppend = 2;
+    {* 0 *}
+       GXclear = $0;
+    {* src AND dst *}
+       GXand = $1;
+    {* src AND NOT dst *}
+       GXandReverse = $2;
+    {* src *}
+       GXcopy = $3;
+    {* NOT src AND dst *}
+       GXandInverted = $4;
+    {* dst *}
+       GXnoop = $5;
+    {* src XOR dst *}
+       GXxor = $6;
+    {* src OR dst *}
+       GXor = $7;
+    {* NOT src AND NOT dst *}
+       GXnor = $8;
+    {* NOT src XOR dst *}
+       GXequiv = $9;
+    {* NOT dst *}
+       GXinvert = $a;
+    {* src OR NOT dst *}
+       GXorReverse = $b;
+    {* NOT src *}
+       GXcopyInverted = $c;
+    {* NOT src OR dst *}
+       GXorInverted = $d;
+    {* NOT src OR NOT dst *}
+       GXnand = $e;
+    {* 1 *}
+    {* LineStyle *}
+       GXset = $f;
+       LineSolid = 0;
+       LineOnOffDash = 1;
+    {* capStyle *}
+       LineDoubleDash = 2;
+       CapNotLast = 0;
+       CapButt = 1;
+       CapRound = 2;
+    {* joinStyle *}
+       CapProjecting = 3;
+       JoinMiter = 0;
+       JoinRound = 1;
+    {* fillStyle *}
+       JoinBevel = 2;
+       FillSolid = 0;
+       FillTiled = 1;
+       FillStippled = 2;
+    {* fillRule *}
+       FillOpaqueStippled = 3;
+       EvenOddRule = 0;
+    {* subwindow mode *}
+       WindingRule = 1;
+       ClipByChildren = 0;
+    {* SetClipRectangles ordering *}
+       IncludeInferiors = 1;
+       Unsorted = 0;
+       YSorted = 1;
+       YXSorted = 2;
+    {* CoordinateMode for drawing routines *}
+       YXBanded = 3;
+    {* relative to the origin *}
+       CoordModeOrigin = 0;
+    {* relative to previous point *}
+    {* Polygon shapes *}
+       CoordModePrevious = 1;
+    {* paths may intersect *}
+       Complex = 0;
+    {* no paths intersect, but not convex *}
+       Nonconvex = 1;
+    {* wholly convex *}
+    {* Arc modes for PolyFillArc *}
+       Convex = 2;
+    {* join endpoints of arc *}
+       ArcChord = 0;
+    {* join endpoints to center of arc *}
+    {* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
+       GC.stateChanges *}
+       ArcPieSlice = 1;
+       GCFunction = (1) shl (0);
+       GCPlaneMask = (1) shl (1);
+       GCForeground = (1) shl (2);
+       GCBackground = (1) shl (3);
+       GCLineWidth = (1) shl (4);
+       GCLineStyle = (1) shl (5);
+       GCCapStyle = (1) shl (6);
+       GCJoinStyle = (1) shl (7);
+       GCFillStyle = (1) shl (8);
+       GCFillRule = (1) shl (9);
+       GCTile = (1) shl (10);
+       GCStipple = (1) shl (11);
+       GCTileStipXOrigin = (1) shl (12);
+       GCTileStipYOrigin = (1) shl (13);
+       GCFont = (1) shl (14);
+       GCSubwindowMode = (1) shl (15);
+       GCGraphicsExposures = (1) shl (16);
+       GCClipXOrigin = (1) shl (17);
+       GCClipYOrigin = (1) shl (18);
+       GCClipMask = (1) shl (19);
+       GCDashOffset = (1) shl (20);
+       GCDashList = (1) shl (21);
+       GCArcMode = (1) shl (22);
+    {*****************************************************************
+     * FONTS 
+     *****************************************************************}
+    {* used in QueryFont -- draw direction *}
+       GCLastBit = 22;
+       FontLeftToRight = 0;
+       FontRightToLeft = 1;
+    {*****************************************************************
+     *  IMAGING 
+     *****************************************************************}
+    {* ImageFormat -- PutImage, GetImage *}
+       FontChange = 255;
+    {* depth 1, XYFormat *}
+       XYBitmap = 0;
+    {* depth == drawable depth *}
+       XYPixmap = 1;
+    {* depth == drawable depth *}
+    {*****************************************************************
+     *  COLOR MAP STUFF 
+     *****************************************************************}
+    {* For CreateColormap *}
+       ZPixmap = 2;
+    {* create map with no entries *}
+       AllocNone = 0;
+    {* allocate entire map writeable *}
+    {* Flags used in StoreNamedColor, StoreColors *}
+       AllocAll = 1;
+       DoRed = (1) shl (0);
+       DoGreen = (1) shl (1);
+    {*****************************************************************
+     * CURSOR STUFF
+     *****************************************************************}
+    {* QueryBestSize Class *}
+       DoBlue = (1) shl (2);
+    {* largest size that can be displayed *}
+       CursorShape = 0;
+    {* size tiled fastest *}
+       TileShape = 1;
+    {* size stippled fastest *}
+    {***************************************************************** 
+     * KEYBOARD/POINTER STUFF
+     *****************************************************************}
+       StippleShape = 2;
+       AutoRepeatModeOff = 0;
+       AutoRepeatModeOn = 1;
+       AutoRepeatModeDefault = 2;
+       LedModeOff = 0;
+    {* masks for ChangeKeyboardControl *}
+       LedModeOn = 1;
+       KBKeyClickPercent = (1) shl (0);
+       KBBellPercent = (1) shl (1);
+       KBBellPitch = (1) shl (2);
+       KBBellDuration = (1) shl (3);
+       KBLed = (1) shl (4);
+       KBLedMode = (1) shl (5);
+       KBKey = (1) shl (6);
+       KBAutoRepeatMode = (1) shl (7);
+       MappingSuccess = 0;
+       MappingBusy = 1;
+       MappingFailed = 2;
+       MappingModifier = 0;
+       MappingKeyboard = 1;
+    {*****************************************************************
+     * SCREEN SAVER STUFF 
+     *****************************************************************}
+       MappingPointer = 2;
+       DontPreferBlanking = 0;
+       PreferBlanking = 1;
+       DefaultBlanking = 2;
+       DisableScreenSaver = 0;
+       DisableScreenInterval = 0;
+       DontAllowExposures = 0;
+       AllowExposures = 1;
+    {* for ForceScreenSaver *}
+       DefaultExposures = 2;
+       ScreenSaverReset = 0;
+    {*****************************************************************
+     * HOSTS AND CONNECTIONS
+     *****************************************************************}
+    {* for ChangeHosts *}
+       ScreenSaverActive = 1;
+       HostInsert = 0;
+    {* for ChangeAccessControl *}
+       HostDelete = 1;
+       EnableAccess = 1;
+    {* Display classes  used in opening the connection 
+     * Note that the statically allocated ones are even numbered and the
+     * dynamically changeable ones are odd numbered *}
+       DisableAccess = 0;
+       StaticGray = 0;
+       GrayScale = 1;
+       StaticColor = 2;
+       PseudoColor = 3;
+       TrueColor = 4;
+    {* Byte order  used in imageByteOrder and bitmapBitOrder *}
+       DirectColor = 5;
+       LSBFirst = 0;
+       MSBFirst = 1;
+
+    { Pointer Declarations }
+
+  implementation
+
+end.

+ 2098 - 0
packages/x11/xlib.pp

@@ -0,0 +1,2098 @@
+
+unit xlib;
+  { Changes after conversion from Xlib.h marked MVC -- Michael Van Canneyt
+    Removed many many comments. 
+    Including copyright. should be pasted in again. MVC }
+
+  interface
+
+uses X; { This is needed MVC.}
+
+    type
+       TXPointer = ^char;
+       TBool = Longint; 
+       PBool = ^TBool;
+       TStatus = Longint; { Also a choice. MVC }
+       { Some pointers : }
+       pppchar = ^ppchar;
+       ppwindow = ^pwindow;
+       Twchar_t = cardinal;
+       Pwchar_t = ^Twchar_t;
+       Pstatus = ^TStatus;
+       PXPointer = ^TXPointer;
+       Plongint = ^Longint;
+       PPLOngint = ^Plongint;
+
+    const
+
+{
+ Removed, standard in Pascal - MVC 
+       True = 1;
+       False = 0;
+}       
+	QueuedAlready = 0;
+	QueuedAfterReading = 1;
+
+    {* !!!!!
+    #define ConnectionNumber(dpy) 	(((_XPrivDisplay)dpy)->fd)
+    #define RootWindow(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->root)
+    #define DefaultScreen(dpy) 	(((_XPrivDisplay)dpy)->default_screen)
+    #define DefaultRootWindow(dpy) 	(ScreenOfDisplay(dpy,DefaultScreen(dpy))->root)
+    #define DefaultVisual(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_visual)
+    #define DefaultGC(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->default_gc)
+    #define BlackPixel(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->black_pixel)
+    #define WhitePixel(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->white_pixel)
+    #define AllPlanes 		((unsigned long)~0L)
+    #define QLength(dpy) 		(((_XPrivDisplay)dpy)->qlen)
+    #define DisplayWidth(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->width)
+    #define DisplayHeight(dpy, scr) (ScreenOfDisplay(dpy,scr)->height)
+    #define DisplayWidthMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mwidth)
+    #define DisplayHeightMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mheight)
+    #define DisplayPlanes(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth)
+    #define DisplayCells(dpy, scr) 	(DefaultVisual(dpy,scr)->map_entries)
+    #define ScreenCount(dpy) 	(((_XPrivDisplay)dpy)->nscreens)
+    #define ServerVendor(dpy) 	(((_XPrivDisplay)dpy)->vendor)
+    #define ProtocolVersion(dpy) 	(((_XPrivDisplay)dpy)->proto_major_version)
+    #define ProtocolRevision(dpy) 	(((_XPrivDisplay)dpy)->proto_minor_version)
+    #define VendorRelease(dpy) 	(((_XPrivDisplay)dpy)->release)
+    #define DisplayString(dpy) 	(((_XPrivDisplay)dpy)->display_name)
+    #define DefaultDepth(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->root_depth)
+    #define DefaultColormap(dpy, scr)(ScreenOfDisplay(dpy,scr)->cmap)
+    #define BitmapUnit(dpy) 	(((_XPrivDisplay)dpy)->bitmap_unit)
+    #define BitmapBitOrder(dpy) 	(((_XPrivDisplay)dpy)->bitmap_bit_order)
+    #define BitmapPad(dpy) 		(((_XPrivDisplay)dpy)->bitmap_pad)
+    #define ImageByteOrder(dpy) 	(((_XPrivDisplay)dpy)->byte_order)
+    
+    #ifdef CRAY /* unable to get WORD64 without pulling in other symbols
+    #define NextRequest(dpy)	XNextRequest(dpy)
+    #else
+    #define NextRequest(dpy)	(((_XPrivDisplay)dpy)->request + 1)
+    #endif
+    #define LastKnownRequestProcessed(dpy)	(((_XPrivDisplay)dpy)->last_request_read)
+    
+    /* macros for screen oriented applications (toolkit)
+    
+    #define ScreenOfDisplay(dpy, scr)(&((_XPrivDisplay)dpy)->screens[scr])
+    #define DefaultScreenOfDisplay(dpy) ScreenOfDisplay(dpy,DefaultScreen(dpy))
+    #define DisplayOfScreen(s)	((s)->display)
+    #define RootWindowOfScreen(s)	((s)->root)
+    #define BlackPixelOfScreen(s)	((s)->black_pixel)
+    #define WhitePixelOfScreen(s)	((s)->white_pixel)
+    #define DefaultColormapOfScreen(s)((s)->cmap)
+    #define DefaultDepthOfScreen(s)	((s)->root_depth)
+    #define DefaultGCOfScreen(s)	((s)->default_gc)
+    #define DefaultVisualOfScreen(s)((s)->root_visual)
+    #define WidthOfScreen(s)	((s)->width)
+    #define HeightOfScreen(s)	((s)->height)
+    #define WidthMMOfScreen(s)	((s)->mwidth)
+    #define HeightMMOfScreen(s)	((s)->mheight)
+    #define PlanesOfScreen(s)	((s)->root_depth)
+    #define CellsOfScreen(s)	(DefaultVisualOfScreen((s))->map_entries)
+    #define MinCmapsOfScreen(s)	((s)->min_maps)
+    #define MaxCmapsOfScreen(s)	((s)->max_maps)
+    #define DoesSaveUnders(s)	((s)->save_unders)
+    #define DoesBackingStore(s)	((s)->backing_store)
+    #define EventMaskOfScreen(s)	((s)->root_input_mask)
+    *}
+    {*
+     * Extensions need a way to hang private data on some structures.
+     *}
+       QueuedAfterFlush = 2;
+    {* number returned by XRegisterExtension *}
+    {* next item on list of data for structure *}
+    {*!!!!!
+    	int (*free_private)();	/* called to free private storage *}
+    {* data private to this extension. *}
+
+    type
+       { Added this for functions at the end. }
+       PCardinal = ^Cardinal;
+                 
+       PXExtData = ^TXExtData ;
+       PPXExtData = ^PXExtData ; 
+       { Put this in to accomodate for the next in the following record. MVC}
+       TXExtData = record
+            number : longint;
+            next : PXExtData; { incorrectly converted. MVC }
+            private_data : TXPointer;
+         end;
+       TXExtCodes = record
+            extension : longint;
+            major_opcode : longint;
+            first_event : longint;
+            first_error : longint;
+         end;
+       PXExtCodes = ^TXExtCodes;
+    {*
+     * Data structure for retrieving info about pixmap formats.
+     *}
+       TXPixmapFormatValues = record
+            depth : longint;
+            bits_per_pixel : longint;
+            scanline_pad : longint;
+         end;
+       PXPixmapFormatValues = ^TXPixmapFormatValues;
+       TXGCValues = record
+            Xfunction : longint; { Renamed function to Xfunction }
+            plane_mask : cardinal;
+            foreground : cardinal;
+            background : cardinal;
+            line_width : longint;
+            line_style : longint;
+            cap_style : longint;
+            join_style : longint;
+            fill_style : longint;
+            fill_rule : longint;
+            arc_mode : longint;
+            tile : TPixmap;
+            stipple : TPixmap;
+            ts_x_origin : longint;
+            ts_y_origin : longint;
+            font : TFont;
+            subwindow_mode : longint;
+            graphics_exposures : TBool;  
+                                 { This was Bool - error in converter ? MVC}
+            clip_x_origin : longint;
+            clip_y_origin : longint;
+            clip_mask : TPixmap;
+            dash_offset : longint;
+            dashes : char;
+         end;
+       PXGCValues = ^TXGCValues;
+    { The GC got defined as GC = ^record - probably from *struct, so I
+      defined a GCrecord. MVC. }
+       TGC = ^TGCrecord;   
+       TGCrecord = record
+            ext_data : PXExtData;
+            gid : TGContext;
+         end;
+    {*
+     * Visual structure; contains information about colormapping possible.
+     *}
+       TVisual = record
+            ext_data : PXExtData;
+            visualid : TVisualID;
+            c_class : longint;
+            classes : longint; { Renamed class to classes. MVC}
+            red_mask : cardinal;
+            green_mask : cardinal;
+            blue_mask : cardinal;
+            bits_per_rgb : longint;
+            map_entries : longint;
+         end;
+       PVisual = ^TVisual;
+    {*
+     * Depth structure; contains information for each possible depth.
+     *}
+       TDepth = record
+            depth : longint;
+            nvisuals : longint;
+            visuals : PVisual;
+         end;
+       PDepth=^TDepth;
+    {*
+     * Information about the screen.  The contents of this structure are
+     * implementation dependent.  A Screen should be treated as opaque
+     * by application code.
+     *}
+    {*
+      struct _XDisplay;  Forward declare before use for C++ 
+    *}
+    { Defined this, needed for the display field in the following. 
+      Should be a pointer to the previous _Xdisplay... MVC}
+      p_XDisplay = pointer; 
+       TScreen = record
+            ext_data : PXExtData;
+            display : p_XDisplay;
+            root : TWindow;
+            width : longint;
+            height : longint;
+            mwidth : longint;
+            mheight : longint;
+            ndepths : longint;
+            depths : PDepth;
+            root_depth : longint;
+            root_visual : PVisual;
+            default_gc : TGC;
+            cmap : TColormap;
+            white_pixel : cardinal;
+            black_pixel : cardinal;
+            max_maps : longint;
+            min_maps : longint;
+            backing_store : longint;
+            save_unders : TBool;
+            root_input_mask : longint;
+         end;
+         PScreen = ^TScreen;
+    {*
+     * Format structure; describes ZFormat data the screen will understand.
+     *}
+       TScreenFormat = record
+            ext_data : PXExtData;
+            depth : longint;
+            bits_per_pixel : longint;
+            scanline_pad : longint;
+         end;
+       PScreenFormat=^TScreenFormat;
+    {*
+     * Data structure for setting window attributes.
+     *}
+       TXSetWindowAttributes = record
+            background_pixmap : TPixmap;
+            background_pixel : cardinal;
+            border_pixmap : TPixmap;
+            border_pixel : cardinal;
+            bit_gravity : longint;
+            win_gravity : longint;
+            backing_store : longint;
+            backing_planes : cardinal;
+            backing_pixel : cardinal;
+            save_under : TBool;
+            event_mask : longint;
+            do_not_propagate_mask : longint;
+            override_redirect : TBool;
+            colormap : TColormap;
+            cursor : TCursor;
+         end;
+       PXSetWindowAttributes = ^TXSetWindowAttributes;
+       TXWindowAttributes = record
+            x : longint;
+            y : longint;
+            width : longint;
+            height : longint;
+            border_width : longint;
+            depth : longint;
+            visual : PVisual;
+            root : TWindow;
+            c_class : longint;
+            classes : longint; { Renamed from class. MVC}
+            bit_gravity : longint;
+            win_gravity : longint;
+            backing_store : longint;
+            backing_planes : cardinal;
+            backing_pixel : cardinal;
+            save_under : TBool;
+            colormap : TColormap;
+            map_installed : TBool;
+            map_state : longint;
+            all_event_masks : longint;
+            your_event_mask : longint;
+            do_not_propagate_mask : longint;
+            override_redirect : TBool;
+            screen : PScreen;
+         end;
+       PXWindowAttributes = ^TXWindowAttributes;
+    {*
+     * Data structure for host setting; getting routines.
+     *
+     *}
+       TXHostAddress = record
+            family : longint;
+            length : longint;
+            address : pchar;
+         end;
+       PXHostAddress = ^TXHostAddress ;
+    {*
+     * Data structure for "image" data, used by image manipulation routines.
+     *}
+     { Added the following empty record - needed in Ximage. 
+       Fill in later. MVC }
+       Funcsrecord = record
+          dummy : integer; { Just something stupid }
+          end;
+       TXImage = record
+            width : longint;
+            height : longint;
+            xoffset : longint;
+            format : longint;
+            data : pchar;
+            byte_order : longint;
+            bitmap_unit : longint;
+            bitmap_bit_order : longint;
+            bitmap_pad : longint;
+            depth : longint;
+            bytes_per_line : longint;
+            bits_per_pixel : longint;
+            red_mask : cardinal;
+            green_mask : cardinal;
+            blue_mask : cardinal;
+            obdata : TXPointer;
+            funcs : funcsrecord {Added this. Incorrectly converted}
+         end;
+      PXImage = ^TXImage;
+    {* 
+     * Data structure for XReconfigureWindow
+     *}
+       TXWindowChanges = record
+            x : longint;
+            y : longint;
+            width : longint;
+            height : longint;
+            border_width : longint;
+            sibling : TWindow;
+            stack_mode : longint;
+         end;
+        PXWindowChanges =  ^TXWindowChanges;
+    {*
+     * Data structure used by color operations
+     *}
+    {* do_red, do_green, do_blue *}
+       TXColor = record
+            pixel : cardinal;
+            red : word;
+            green : word;
+            blue : word;
+            flags : char;
+            pad : char;
+         end;
+       PXColor = ^TXColor;
+    {*
+     * Data structures for graphics operations.  On most machines, these are
+     * congruent with the wire protocol structures, so reformatting the data
+     * can be avoided on these architectures.
+     *}
+       TXSegment = record
+            x1 : integer;
+            y1 : integer;
+            x2 : integer;
+            y2 : integer;
+         end;
+       PXSegment = ^TXSegment;
+       TXPoint = record
+            x : integer;
+            y : integer;
+         end;
+       PXPoint = ^TXPoint;
+       TXRectangle = record
+            x : integer;
+            y : integer;
+            width : word;
+            height : word;
+         end;
+       PXRectangle = ^TXRectangle;
+       TXArc = record
+            x : integer;
+            y : integer;
+            width : word;
+            height : word;
+            angle1 : integer;
+            angle2 : integer;
+         end;
+       PXarc = ^TXarc;
+    {* Data structure for XChangeKeyboardControl *}
+    {* On, Off, Default *}
+       TXKeyboardControl = record
+            key_click_percent : longint;
+            bell_percent : longint;
+            bell_pitch : longint;
+            bell_duration : longint;
+            led : longint;
+            led_mode : longint;
+            key : longint;
+            auto_repeat_mode : longint;
+         end;
+        PXKeyboardControl = ^TXKeyboardControl;
+    {* Data structure for XGetKeyboardControl *}
+       TXKeyboardState = record
+            key_click_percent : longint;
+            bell_percent : longint;
+            bell_pitch : cardinal;
+            bell_duration : cardinal;
+            led_mask : cardinal;
+            global_auto_repeat : longint;
+            auto_repeats : array[0..(32)-1] of char;
+         end;
+       PXKeyboardState = ^TXKeyboardState;
+    {* Data structure for XGetMotionEvents.  *}
+       TXTimeCoord = record
+            time : TTime;
+            x : integer;
+            y : integer;
+         end;
+       PXTimeCoord = ^TXTimeCoord;
+    {* Data structure for X{Set,Get}ModifierMapping *}
+    {* The server's max # of keys per modifier *}
+    {* An 8 by max_keypermod array of modifiers *}
+       TXModifierKeymap = record
+            max_keypermod : longint;
+            modifiermap : PKeyCode;
+         end;
+       PXModifierKeymap = ^TXModifierKeymap;
+    {*
+     * Display datatype maintaining display specific data.
+     * The contents of this structure are implementation dependent.
+     * A Display should be treated as opaque by application code.
+     *}
+    { I commented the following. It is a complete mess in the XLib.h !!
+      MVC
+           Display = Display;
+     }
+    {*
+    struct _XPrivate;		/* Forward declare before use for C++
+    struct _XrmHashBucketRec;
+    *}
+       TDisplay = record
+            ext_data : PXExtData;
+            private1 : pointer ; { Should be to a _Xprivate struct. MVC }
+            fd : longint;
+            private2 : longint;
+            proto_major_version : longint;
+            proto_minor_version : longint;
+            vendor : pchar;
+            private3 : TXID;
+            private4 : TXID;
+            private5 : TXID;
+            private6 : longint;
+            resource_alloc : Function : TXID; cdecl;
+            byte_order : longint;
+            bitmap_unit : longint;
+            bitmap_pad : longint;
+            bitmap_bit_order : longint;
+            nformats : longint;
+            pixmap_format : PScreenFormat;
+            private8 : longint;
+            release : longint;
+            private9 : pointer ; { Both of them to a _XPRivate struct. MVC}
+            private10 : pointer ;
+            qlen : longint;
+            last_request_read : cardinal;
+            request : cardinal;
+            private11 : TXPointer;
+            private12 : TXPointer;
+            private13 : TXPointer;
+            private14 : TXPointer;
+            max_request_size : cardinal;
+            db : pointer; { To a _XrmHashBucketRec struct. MVC }
+            private15 : Function : longint; cdecl;
+            display_name : pchar;
+            default_screen : longint;
+            nscreens : longint;
+            screens : PScreen;
+            motion_buffer : cardinal;
+            private16 : cardinal;
+            min_keycode : longint;
+            max_keycode : longint;
+            private17 : TXPointer;
+            private18 : TXPointer;
+            private19 : longint;
+            xdefaults : pchar;
+         end;
+         PDisplay=^TDisplay;
+    {*
+     * Definitions of specific events.
+     *}
+    { !! Changed all 'type' definitions to 'eventttype' MVC } 
+    { !! Changed al display definitions to 'whatdisplay' MVC }
+    { !! Idem dito for window,time,property !!}
+       TXKeyEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            window : TWindow;
+            root : TWindow;
+            subwindow : TWindow;
+            time : TTime;
+            x : longint;
+            y : longint;
+            x_root : longint;
+            y_root : longint;
+            state : cardinal;
+            keycode : cardinal;
+            same_screen : TBool;
+         end;
+       PXKeyEvent =^TXKeyEvent;
+       TXKeyPressedEvent = TXKeyEvent;
+       PXKeyPressedEvent= ^TXKeyPressedEvent;
+       XKeyReleasedEvent = TXKeyEvent;
+       TXButtonEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            window : TWindow;
+            root : TWindow;
+            subwindow : TWindow;
+            time : TTime;
+            x : longint;
+            y : longint;
+            x_root : longint;
+            y_root : longint;
+            state : cardinal;
+            button : cardinal;
+            same_screen : TBool;
+         end;
+       TXButtonPressedEvent = TXButtonEvent;
+       TXButtonReleasedEvent = TXButtonEvent;
+       TXMotionEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            window : TWindow;
+            root : TWindow;
+            subwindow : TWindow;
+            time : TTime;
+            x : longint;
+            y : longint;
+            x_root : longint;
+            y_root : longint;
+            state : cardinal;
+            is_hint : char;
+            same_screen : TBool;
+         end;
+       TXPointerMovedEvent = TXMotionEvent;
+    {*
+    	 * NotifyAncestor, NotifyVirtual, NotifyInferior, 
+    	 * NotifyNonlinear,NotifyNonlinearVirtual
+    	 *}
+       TXCrossingEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            window : TWindow;
+            root : TWindow;
+            subwindow : TWindow;
+            time : TTime;
+            x : longint;
+            y : longint;
+            x_root : longint;
+            y_root : longint;
+            mode : longint;
+            detail : longint;
+            same_screen : TBool;
+            focus : TBool;
+            state : cardinal;
+         end;
+       TXEnterWindowEvent = TXCrossingEvent;
+       TXLeaveWindowEvent = TXCrossingEvent;
+       TXFocusChangeEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            window : TWindow;
+            mode : longint;
+            detail : longint;
+         end;
+       TXFocusInEvent = TXFocusChangeEvent;
+       TXFocusOutEvent = TXFocusChangeEvent;
+       TXKeymapEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            window : TWindow;
+            key_vector : array[0..(32)-1] of char;
+         end;
+       TXExposeEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            window : TWindow;
+            x : longint;
+            y : longint;
+            width : longint;
+            height : longint;
+            count : longint;
+         end;
+       TXGraphicsExposeEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            drawable : TDrawable;
+            x : longint;
+            y : longint;
+            width : longint;
+            height : longint;
+            count : longint;
+            major_code : longint;
+            minor_code : longint;
+         end;
+       TXNoExposeEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            drawable : TDrawable;
+            major_code : longint;
+            minor_code : longint;
+         end;
+       TXVisibilityEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            window : TWindow;
+            state : longint;
+         end;
+       TXCreateWindowEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            parent : TWindow;
+            window : TWindow;
+            x : longint;
+            y : longint;
+            width : longint;
+            height : longint;
+            border_width : longint;
+            override_redirect : TBool;
+         end;
+       TXDestroyWindowEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            event : TWindow;
+            window : TWindow;
+         end;
+       TXUnmapEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            event : TWindow;
+            window : TWindow;
+            from_configure : TBool;
+         end;
+       TXMapEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            event : TWindow;
+            window : TWindow;
+            override_redirect : TBool;
+         end;
+       TXMapRequestEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            parent : TWindow;
+            window : TWindow;
+         end;
+       TXReparentEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            event : TWindow;
+            window : TWindow;
+            parent : TWindow;
+            x : longint;
+            y : longint;
+            override_redirect : TBool;
+         end;
+       TXConfigureEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            event : TWindow;
+            window : TWindow;
+            x : longint;
+            y : longint;
+            width : longint;
+            height : longint;
+            border_width : longint;
+            above : TWindow;
+            override_redirect : TBool;
+         end;
+       TXGravityEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            event : TWindow;
+            window : TWindow;
+            x : longint;
+            y : longint;
+         end;
+       TXResizeRequestEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            window : TWindow;
+            width : longint;
+            height : longint;
+         end;
+       TXConfigureRequestEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            parent : TWindow;
+            window : TWindow;
+            x : longint;
+            y : longint;
+            width : longint;
+            height : longint;
+            border_width : longint;
+            above : TWindow;
+            detail : longint;
+            value_mask : cardinal;
+         end;
+       TXCirculateEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            event : TWindow;
+            window : TWindow;
+            place : longint;
+         end;
+       TXCirculateRequestEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            parent : TWindow;
+            window : TWindow;
+            place : longint;
+         end;
+       TXPropertyEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            window : TWindow;
+            atom : TAtom;
+            time : TTime;
+            state : longint;
+         end;
+       TXSelectionClearEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            window : TWindow;
+            selection : TAtom;
+            time : TTime;
+         end;
+       TXSelectionRequestEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            owner : TWindow;
+            requestor : TWindow;
+            selection : TAtom;
+            target : TAtom;
+            {whatproperty : TAtom;}
+            time : TTime;
+         end;
+       TXSelectionEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            requestor : TWindow;
+            selection : TAtom;
+            target : TAtom;
+            whatproperty : TAtom;
+            whattime : TTime;
+         end;
+       TXColormapEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            window : TWindow;
+            colormap : TColormap;
+            c_new : TBool;
+            news : TBool; { Was new. MVC }
+            state : longint;
+         end;
+       TXClientMessageEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            window : TWindow;
+            message_eventtype : TAtom;
+            format : longint;
+            data : record
+                case longint of
+                   0 : (b : array[0..(20)-1] of char);
+                   1 : (s : array[0..(10)-1] of integer);
+                   2 : (l : array[0..(5)-1] of longint);
+              end;
+         end;
+       TXMappingEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            window : TWindow;
+            request : longint;
+            first_keycode : longint;
+            count : longint;
+         end;
+       PXMappingEvent = ^TXMappingEvent;
+       TXErrorEvent = record
+            eventtype : longint;
+            Whatdisplay : PDisplay;
+            resourceid : TXID;
+            serial : cardinal;
+            error_code : char;
+            request_code : char;
+            minor_code : char;
+         end;
+       PXErrorEvent = ^TXErrorEvent;
+       TXAnyEvent = record
+            eventtype : longint;
+            serial : cardinal;
+            send_event : TBool;
+            display : PDisplay;
+            window : TWindow;
+         end;
+       TXEvent = record
+           case longint of
+              0 : (eventtype : longint);
+              1 : (xany : TXAnyEvent);
+              2 : (xkey : TXKeyEvent);
+              3 : (xbutton : TXButtonEvent);
+              4 : (xmotion : TXMotionEvent);
+              5 : (xcrossing : TXCrossingEvent);
+              6 : (xfocus : TXFocusChangeEvent);
+              7 : (xexpose : TXExposeEvent);
+              8 : (xgraphicsexpose : TXGraphicsExposeEvent);
+              9 : (xnoexpose : TXNoExposeEvent);
+              10 : (xvisibility : TXVisibilityEvent);
+              11 : (xcreatewindow : TXCreateWindowEvent);
+              12 : (xdestroywindow : TXDestroyWindowEvent);
+              13 : (xunmap : TXUnmapEvent);
+              14 : (xmap : TXMapEvent);
+              15 : (xmaprequest : TXMapRequestEvent);
+              16 : (xreparent : TXReparentEvent);
+              17 : (xconfigure : TXConfigureEvent);
+              18 : (xgravity : TXGravityEvent);
+              19 : (xresizerequest : TXResizeRequestEvent);
+              20 : (xconfigurerequest : TXConfigureRequestEvent);
+              21 : (xcirculate : TXCirculateEvent);
+              22 : (xcirculaterequest : TXCirculateRequestEvent);
+              23 : (xproperty : TXPropertyEvent);
+              24 : (xselectionclear : TXSelectionClearEvent);
+              25 : (xselectionrequest : TXSelectionRequestEvent);
+              26 : (xselection : TXSelectionEvent);
+              27 : (xcolormap : TXColormapEvent);
+              28 : (xclient : TXClientMessageEvent);
+              29 : (xmapping : TXMappingEvent);
+              30 : (xerror : TXErrorEvent);
+              31 : (xkeymap : TXKeymapEvent);
+              32 : (pad : array[0..(24)-1] of longint);
+         end;
+     PXEvent = ^TXEvent;
+    {*!!!!!!
+    #define XAllocID(dpy) ((*((_XPrivDisplay)dpy)->resource_alloc)((dpy)))
+    *}
+    {*
+     * per character font metric information.
+     *}
+       TXCharStruct = record
+            lbearing : integer;
+            rbearing : integer;
+            width : integer;
+            ascent : integer;
+            descent : integer;
+            attributes : word;
+         end;
+       PXCharStruct = ^TXCharStruct;
+       TXFontProp = record
+            name : TAtom;
+            card32 : cardinal;
+         end;
+       PXFontProp = ^TXFontProp;
+       PXFontstruct = ^TXFontStruct;
+       PPXFontstruct = ^PXFontStruct;
+       PPPXFontstruct = ^PPXFontStruct;
+       TXFontStruct = record
+            ext_data : PXExtData;
+            fid : TFont;
+            direction : cardinal;
+            min_char_or_byte2 : cardinal;
+            max_char_or_byte2 : cardinal;
+            min_byte1 : cardinal;
+            max_byte1 : cardinal;
+            all_chars_exist : TBool;
+            default_char : cardinal;
+            n_properties : longint;
+            properties : PXFontProp;
+            min_bounds : TXCharStruct;
+            max_bounds : TXCharStruct;
+            per_char : PXCharStruct;
+            ascent : longint;
+            descent : longint;
+         end;
+       TXTextItem = record
+            chars : pchar;
+            nchars : longint;
+            delta : longint;
+            font : TFont;
+         end;
+       PXTextItem = ^TXTextItem;
+    {* normal 16 bit characters are two bytes *}
+       TXChar2b = record
+            byte1 : char;
+            byte2 : char;
+         end;
+       PXChar2b = ^TXChar2b;
+       TXTextItem16 = record
+            chars : PXChar2b;
+            nchars : longint;
+            delta : longint;
+            font : TFont;
+         end;
+       PXTextItem16 = ^TXTextItem16;
+       TXEDataObject = record
+           case longint of
+              0 : (display : PDisplay);
+              1 : (gc : TGC);
+              2 : (visual : PVisual);
+              3 : (screen : PScreen);
+              4 : (pixmap_format : PScreenFormat);
+              5 : (font : PXFontStruct);
+         end;
+       TXFontSetExtents = record
+            max_ink_extent : TXRectangle;
+            max_logical_extent : TXRectangle;
+         end;
+       PXFontSetExtents = ^TXFontSetExtents;
+       TXOMProc = Procedure; cdecl;
+       
+       TXOMrec = record
+         dummy : integer;
+       end;
+       TXOCrec = record
+         dummy : integer;
+       end;
+       TXOM = ^TXOMrec;
+       TXOC = ^TXOCrec;
+       { Again an accomodation. MVC }
+       TXfontSetRecord = record
+         dummy : integer;
+         end;
+       TXFontSet = ^TXFontsetRecord;
+       TXmbTextItem = record
+            chars : pchar;
+            nchars : longint;
+            delta : longint;
+            font_set : TXFontSet;
+         end;
+       PXmbTextItem = ^TXmbTextItem;
+       TXwcTextItem = record
+            chars : Pwchar_t;
+            nchars : longint;
+            delta : longint;
+            font_set : TXFontSet;
+         end;
+       PXwcTextItem = ^TXwcTextItem;
+
+    const
+       XNRequiredCharSet = 'requiredCharSet';
+       XNQueryOrientation = 'queryOrientation';
+       XNBaseFontName = 'baseFontName';
+       XNOMAutomatic = 'omAutomatic';
+       XNMissingCharSet = 'missingCharSet';
+       XNDefaultString = 'defaultString';
+       XNOrientation = 'orientation';
+       XNDirectionalDependentDrawing = 'directionalDependentDrawing';
+       XNContextualDrawing = 'contextualDrawing';
+       XNFontInfo = 'fontInfo';
+
+   type
+       TXOMCharSetList = record
+            charset_count : longint;
+            charset_list : ^pchar;
+         end;
+       TXOrientation = (
+         XOMOrientation_LTR_TTB,
+         XOMOrientation_RTL_TTB,
+         XOMOrientation_TTB_LTR,
+         XOMOrientation_TTB_RTL,
+         XOMOrientation_Context
+         );
+    {* Input Text description *}
+       TXOMOrientation = record
+            num_orient : longint;
+            orient : ^TXOrientation;
+         end;
+       TXOMFontInfo = record
+            num_font : longint;
+            font_struct_list : ^PXFontStruct;
+            font_name_list : ^pchar;
+         end;
+       TXIMProc = Procedure; cdecl;
+       { Defined the following to accomodate XIM. MVC}
+       TXIMrecord = record
+         field : integer
+         end;
+       TXIM = ^TXIMrecord;
+       { Defined the following to accomodate XIC. MVC}
+       TXICrecord = record
+         field : integer
+         end;
+       TXIC = ^TXICrecord;
+       TXIMStyle = cardinal;
+       TXIMStyles = record
+            count_styles : word;
+            supported_styles : ^TXIMStyle;
+         end;
+
+    const
+       XIMPreeditArea = $0001;
+       XIMPreeditCallbacks = $0002;
+       XIMPreeditPosition = $0004;
+       XIMPreeditNothing = $0008;
+       XIMPreeditNone = $0010;
+       XIMStatusArea = $0100;
+       XIMStatusCallbacks = $0200;
+       XIMStatusNothing = $0400;
+       XIMStatusNone = $0800;
+       XNVaNestedList = 'XNVaNestedList';
+       XNQueryInputStyle = 'queryInputStyle';
+       XNClientWindow = 'clientWindow';
+       XNInputStyle = 'inputStyle';
+       XNFocusWindow = 'focusWindow';
+       XNResourceName = 'resourceName';
+       XNResourceClass = 'resourceClass';
+       XNGeometryCallback = 'geometryCallback';
+       XNDestroyCallback = 'destroyCallback';
+       XNFilterEvents = 'filterEvents';
+       XNPreeditStartCallback = 'preeditStartCallback';
+       XNPreeditDoneCallback = 'preeditDoneCallback';
+       XNPreeditDrawCallback = 'preeditDrawCallback';
+       XNPreeditCaretCallback = 'preeditCaretCallback';
+       XNPreeditStateNotifyCallback = 'preeditStateNotifyCallback';
+       XNPreeditAttributes = 'preeditAttributes';
+       XNStatusStartCallback = 'statusStartCallback';
+       XNStatusDoneCallback = 'statusDoneCallback';
+       XNStatusDrawCallback = 'statusDrawCallback';
+       XNStatusAttributes = 'statusAttributes';
+       XNArea = 'area';
+       XNAreaNeeded = 'areaNeeded';
+       XNSpotLocation = 'spotLocation';
+       XNColormap = 'colorMap';
+       XNStdColormap = 'stdColorMap';
+       XNForeground = 'foreground';
+       XNBackground = 'background';
+       XNBackgroundPixmap = 'backgroundPixmap';
+       XNFontSet = 'fontSet';
+       XNLineSpace = 'lineSpace';
+       XNCursor = 'cursor';
+       XNQueryIMValuesList = 'queryIMValuesList';
+       XNQueryICValuesList = 'queryICValuesList';
+       XNVisiblePosition = 'visiblePosition';
+       XNR6PreeditCallback = 'r6PreeditCallback';
+       XNStringConversionCallback = 'stringConversionCallback';
+       XNStringConversion = 'stringConversion';
+       XNResetState = 'resetState';
+       XNHotKey = 'hotKey';
+       XNHotKeyState = 'hotKeyState';
+       XNPreeditState = 'preeditState';
+       XNSeparatorofNestedList = 'separatorofNestedList';
+       XBufferOverflow = -(1);
+       XLookupNone = 1;
+       XLookupChars = 2;
+       XLookupKeySym = 3;
+       XLookupBoth = 4;
+
+    type
+       TXVaNestedList = TXPointer;
+       TXIMCallback = record
+            client_data : TXPointer;
+            callback : TXIMProc;
+         end;
+       TXIMFeedback = cardinal;
+
+    const
+       XIMReverse = 1;
+       XIMUnderline = (1) shl (1);
+       XIMHighlight = (1) shl (2);
+       XIMPrimary = (1) shl (5);
+       XIMSecondary = (1) shl (6);
+       XIMTertiary = (1) shl (7);
+       XIMVisibleToForward = (1) shl (8);
+       XIMVisibleToBackword = (1) shl (9);
+       XIMVisibleToCenter = (1) shl (10);
+
+    type
+       TXIMText = record
+            length : word;
+            feedback : ^TXIMFeedback;
+            encoding_is_wchar : TBool;
+            thestring : record { This was string. MVC}
+                 case longint of
+                   0 : (multi_byte : ^char);
+                   1 : (wide_char : Pwchar_t);
+              end;
+         end;
+       PXIMText=^TXIMText;
+       TXIMPreeditState = cardinal;
+
+    const
+       XIMPreeditUnKnown = 0;
+       XIMPreeditEnable = 1;
+       XIMPreeditDisable = (1) shl (1);
+
+    type
+       TXIMPreeditStateNotifyCallbackStruct = record
+            state : TXIMPreeditState;
+         end;
+       TXIMResetState = cardinal;
+
+    const
+       XIMInitialState = 1;
+       XIMPreserveState = (1) shl (1);
+
+    type
+       TXIMStringConversionFeedback = cardinal;
+
+    const
+       XIMStringConversionLeftEdge = $00000001;
+       XIMStringConversionRightEdge = $00000002;
+       XIMStringConversionTopEdge = $00000004;
+       XIMStringConversionBottomEdge = $00000008;
+       XIMStringConversionConcealed = $00000010;
+       XIMStringConversionWrapped = $00000020;
+
+    type
+       TXIMStringConversionText = record
+            length : word;
+            feedback : ^TXIMStringConversionFeedback;
+            encoding_is_wchar : TBool;
+            thestring : record { This was string. MVC}
+                case longint of
+                   0 : (mbs : pchar);
+                   1 : (wcs : pwchar_t);
+              end;
+         end;
+       TXIMStringConversionPosition = word;
+       TXIMStringConversionType = word;
+
+    const
+       XIMStringConversionBuffer = $0001;
+       XIMStringConversionLine = $0002;
+       XIMStringConversionWord = $0003;
+       XIMStringConversionChar = $0004;
+
+    type
+       TXIMStringConversionOperation = word;
+
+    const
+       TXIMStringConversionSubstitution = $0001;
+       TXIMStringConversionRetrival = $0002;
+
+    type
+       TXIMStringConversionCallbackStruct = record
+            position : TXIMStringConversionPosition;
+            thetype : TXIMStringConversionType; { This wsa type. MVC}
+            operation : TXIMStringConversionOperation;
+            factor : word;
+            thetext : ^TXIMStringConversionText; { This was text. MVC}
+         end;
+       TXIMPreeditDrawCallbackStruct = record
+            caret : longint;
+            chg_first : longint;
+            chg_length : longint;
+            text : ^TXIMText;
+         end;
+       TXIMCaretDirection = (
+         XIMForwardChar,
+         XIMBackwardChar,
+         XIMForwardWord,
+         XIMBackwardWord,
+         XIMCaretUp,
+         XIMCaretDown,
+         XIMNextLine,
+         XIMPreviousLine,
+         XIMLineStart,
+         XIMLineEnd,
+         XIMAbsolutePosition,
+         XIMDontChange
+         );
+       TXIMCaretStyle = (
+         XIMIsInvisible,
+         XIMIsPrimary,
+         XIMIsSecondary
+         );
+       TXIMPreeditCaretCallbackStruct = record
+            position : longint;
+            direction : TXIMCaretDirection;
+            style : TXIMCaretStyle;
+         end;
+       TXIMStatusDataType = (
+         XIMTextType,
+         XIMBitmapType
+         );
+       TXIMStatusDrawCallbackStruct = record
+            thetype : TXIMStatusDataType; { Was Type. MVC }
+            data : record
+                case longint of
+                   0 : (text : PXIMText);
+                   1 : (bitmap : TPixmap);
+              end;
+         end;
+       TXIMHotKeyTrigger = record
+            keysym : TKeySym;
+            modifier : longint;
+            modifier_mask : longint;
+         end;
+       TXIMHotKeyTriggers = record
+            num_hot_key : longint;
+            key : ^TXIMHotKeyTrigger;
+         end;
+       TXIMHotKeyState = cardinal;
+
+    const
+       XIMHotKeyStateON = $0001;
+       XIMHotKeyStateOFF = $0002;
+
+    type
+       XIMValuesList = record
+            count_values : word;
+            supported_values : ^pchar;
+         end;
+
+type
+  TXErrorHandler = Function(_para1 : PDisplay;_para2 : PXErrorEvent) : longint; cdecl;
+  TXIOErrorHandler = Function(_para1 : PDisplay) : longint; cdecl;
+  TXConnectionWatchProc = Procedure(_para1 : PDisplay;_para2 : TXPointer;_para3 : longint;_para4 : TBool;_para5 : PXPointer); cdecl;
+
+
+{ Here start the Function definitions in the C header file. MVC } cdecl;
+
+Function XLoadQueryFont (para1 : PDisplay; para2 : pchar) : PXFontStruct; cdecl;
+Function XQueryFont(_para1 : PDisplay;_para2 : TXID) : PXFontStruct; cdecl;
+Function XGetMotionEvents(_para1 : PDisplay;_para2 : TWindow;_para3 : TTime;_para4 : TTime;_para5 : Plongint) : PXTimeCoord; cdecl;
+Function XDeleteModifiermapEntry(_para1 : PXModifierKeymap;_para2 : cardinal;_para3 : TKeyCode;_para4 : longint) : PXModifierKeymap; cdecl;
+Function XGetModifierMapping(_para1 : PDisplay) : PXModifierKeymap; cdecl;
+Function XInsertModifiermapEntry(_para1 : PXModifierKeymap;_para2 : cardinal;_para3 : TKeyCode;_para4 : longint) : PXModifierKeymap; cdecl;
+Function XNewModifiermap(_para1 : longint) : PXModifierKeymap; cdecl;
+Function XCreateImage(_para1 : PDisplay;_para2 : PVisual;_para3 : cardinal;_para4 : longint;_para5 : longint;_para6 : pchar;_para7 : cardinal;_para8 : cardinal;_para9 : longint;_para10 : longint) : PXImage; cdecl;
+Function XInitImage(_para1 : PXImage) : TStatus; cdecl;
+Function XGetImage(_para1 : PDisplay;_para2 : TDrawable;_para3 : longint;_para4 : longint;_para5 : cardinal;_para6 : cardinal;_para7 : cardinal;_para8 : longint) : PXImage; cdecl;
+Function XGetSubImage(_para1 : PDisplay;_para2 : TDrawable;_para3 : longint;_para4 : longint;_para5 : cardinal;_para6 : cardinal;_para7 : cardinal;_para8 : longint;_para9 : PXImage;_para10 : longint;_para11 : longint) : PXImage; cdecl;
+Function XOpenDisplay(_para1 : pchar) : PDisplay; cdecl;
+Procedure XrmInitialize; cdecl;
+Function XFetchBytes(_para1 : PDisplay;_para2 : Plongint) : pchar; cdecl;
+Function XFetchBuffer(_para1 : PDisplay;_para2 : Plongint;_para3 : longint) : pchar; cdecl;
+Function XGetAtomName(_para1 : PDisplay;_para2 : TAtom) : pchar; cdecl;
+Function XGetAtomNames(_para1 : PDisplay;_para2 : PAtom;_para3 : longint;_para4 : PPChar) : TStatus; cdecl;
+Function XGetDefault(_para1 : PDisplay;_para2 : pchar;_para3 : pchar) : pchar; cdecl;
+Function XDisplayName(_para1 : pchar) : pchar; cdecl;
+Function XKeysymToString(_para1 : TKeySym) : pchar; cdecl;
+Function XSynchronize(_para1 : PDisplay;_para2 : TBool) : longint; cdecl;
+{ WHat to do with this ??? MVC
+Function XSetAfterFunction(_para1 : PDisplay;_para2 : function(_para1 : PDisplay) : longint) : function : longint; cdecl;
+}
+Function XInternAtom(_para1 : PDisplay;_para2 : pchar;_para3 : TBool) : TAtom; cdecl;
+Function XInternAtoms(_para1 : PDisplay;_para2 : PPChar;_para3 : longint;_para4 : TBool;_para5 : PAtom) : TStatus; cdecl;
+Function XCopyColormapAndFree(_para1 : PDisplay;_para2 : TColormap) : TColormap; cdecl;
+Function XCreateColormap(_para1 : PDisplay;_para2 : TWindow;_para3 : PVisual;_para4 : longint) : TColormap; cdecl;
+Function XCreatePixmapCursor(_para1 : PDisplay;_para2 : TPixmap;_para3 : TPixmap;_para4 : PXColor;_para5 : PXColor;_para6 : cardinal;_para7 : cardinal) : TCursor; cdecl;
+Function XCreateGlyphCursor(_para1 : PDisplay;_para2 : TFont;_para3 : TFont;_para4 : cardinal;_para5 : cardinal;_para6 : PXColor;_para7 : PXColor) : TCursor; cdecl;
+Function XCreateFontCursor(_para1 : PDisplay;_para2 : cardinal) : TCursor; cdecl;
+Function XLoadFont(_para1 : PDisplay;_para2 : pchar) : TFont; cdecl;
+Function XCreateGC(_para1 : PDisplay;_para2 : TDrawable;_para3 : cardinal;_para4 : PXGCValues) : TGC; cdecl;
+Function XGContextFromGC(_para1 : TGC) : TGContext; cdecl;
+Procedure XFlushGC(_para1 : PDisplay;_para2 : TGC); cdecl;
+Function XCreatePixmap(_para1 : PDisplay;_para2 : TDrawable;_para3 : cardinal;_para4 : cardinal;_para5 : cardinal) : TPixmap; cdecl;
+Function XCreateBitmapFromData(_para1 : PDisplay;_para2 : TDrawable;_para3 : pchar;_para4 : cardinal;_para5 : cardinal) : TPixmap; cdecl;
+Function XCreatePixmapFromBitmapData(_para1 : PDisplay;_para2 : TDrawable;_para3 : pchar;_para4 : cardinal;_para5 : cardinal;_para6 : cardinal;_para7 : cardinal;_para8 : cardinal) : TPixmap; cdecl;
+Function XCreateSimpleWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : longint;_para5 : cardinal;_para6 : cardinal;_para7 : cardinal;_para8 : cardinal;_para9 : cardinal) : TWindow; cdecl;
+Function XGetSelectionOwner(_para1 : PDisplay;_para2 : TAtom) : TWindow; cdecl;
+Function XCreateWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : longint;_para5 : cardinal;_para6 : cardinal;_para7 : cardinal;_para8 : longint;_para9 : cardinal;_para10 : PVisual;_para11 : cardinal;_para12 : PXSetWindowAttributes) : TWindow; cdecl;
+Function XListInstalledColormaps(_para1 : PDisplay;_para2 : TWindow;_para3 : Plongint) : PColormap; cdecl;
+Function XListFonts(_para1 : PDisplay;_para2 : pchar;_para3 : longint;_para4 : Plongint) : PPChar; cdecl;
+Function XListFontsWithInfo(_para1 : PDisplay;_para2 : pchar;_para3 : longint;_para4 : Plongint;_para5 : PPXFontStruct) : PPChar; cdecl;
+Function XGetFontPath(_para1 : PDisplay;_para2 : Plongint) : PPChar; cdecl;
+Function XListExtensions(_para1 : PDisplay;_para2 : Plongint) : PPChar; cdecl;
+Function XListProperties(_para1 : PDisplay;_para2 : TWindow;_para3 : Plongint) : PAtom; cdecl;
+Function XListHosts(_para1 : PDisplay;_para2 : Plongint;_para3 : PBool) : PXHostAddress; cdecl;
+Function XKeycodeToKeysym(_para1 : PDisplay;_para3 : TKeyCode;_para4 : longint) : TKeySym; cdecl;
+{ Doesn't want ? MVC 
+Function XLookupKeysym(_para1 : PXKeyEvent;_para2 : longint) : TKeySym; cdecl;
+}
+Function XGetKeyboardMapping(_para1 : PDisplay;_para2 : cardinal;_para3 : TKeyCode;_para4 : longint;_para5 : Plongint) : PKeySym; cdecl;
+Function XStringToKeysym(_para1 : pchar) : TKeySym; cdecl;
+Function XMaxRequestSize(_para1 : PDisplay) : longint; cdecl;
+Function XExtendedMaxRequestSize(_para1 : PDisplay) : longint; cdecl;
+Function XResourceManagerString(_para1 : PDisplay) : pchar; cdecl;
+Function XScreenResourceString(_para1 : PScreen) : pchar; cdecl;
+Function XDisplayMotionBufferSize(_para1 : PDisplay) : cardinal; cdecl;
+Function XVisualIDFromVisual(_para1 : PVisual) : TVisualID; cdecl;
+Function XInitThreads : TStatus; cdecl;
+Procedure XLockDisplay(_para1 : PDisplay); cdecl;
+Procedure XUnlockDisplay(_para1 : PDisplay); cdecl;
+Function XInitExtension(_para1 : PDisplay;_para2 : pchar) : PXExtCodes; cdecl;
+Function XAddExtension(_para1 : PDisplay) : PXExtCodes; cdecl;
+Function XFindOnExtensionList(_para1 : PPXExtData;_para2 : longint) : PXExtData; cdecl;
+Function XEHeadOfExtensionList(_para1 : TXEDataObject) : PPXExtData; cdecl;
+Function XRootWindow(_para1 : PDisplay;_para2 : longint) : TWindow; cdecl;
+Function XDefaultRootWindow(_para1 : PDisplay) : TWindow; cdecl;
+Function XRootWindowOfScreen(_para1 : PScreen) : TWindow; cdecl;
+Function XDefaultVisual(_para1 : PDisplay;_para2 : longint) : PVisual; cdecl;
+Function XDefaultVisualOfScreen(_para1 : PScreen) : PVisual; cdecl;
+Function XDefaultGC(_para1 : PDisplay;_para2 : longint) : TGC; cdecl;
+Function XDefaultGCOfScreen(_para1 : PScreen) : TGC; cdecl;
+Function XBlackPixel(_para1 : PDisplay;_para2 : longint) : cardinal; cdecl;
+Function XWhitePixel(_para1 : PDisplay;_para2 : longint) : cardinal; cdecl;
+Function XAllPlanes : cardinal; cdecl;
+Function XBlackPixelOfScreen(_para1 : PScreen) : cardinal; cdecl;
+Function XWhitePixelOfScreen(_para1 : PScreen) : cardinal; cdecl;
+Function XNextRequest(_para1 : PDisplay) : cardinal; cdecl;
+{
+Function XLastKnownRequestProcessed(_para1 : PDisplay) : cardinal; cdecl;
+}
+Function XServerVendor(_para1 : PDisplay) : pchar; cdecl;
+Function XDisplayString(_para1 : PDisplay) : pchar; cdecl;
+Function XDefaultColormap(_para1 : PDisplay;_para2 : longint) : TColormap; cdecl;
+Function XDefaultColormapOfScreen(_para1 : PScreen) : TColormap; cdecl;
+Function XDisplayOfScreen(_para1 : PScreen) : PDisplay; cdecl;
+Function XScreenOfDisplay(_para1 : PDisplay;_para2 : longint) : PScreen; cdecl;
+Function XDefaultScreenOfDisplay(_para1 : PDisplay) : PScreen; cdecl;
+Function XEventMaskOfScreen(_para1 : PScreen) : longint; cdecl;
+Function XScreenNumberOfScreen(_para1 : PScreen) : longint; cdecl;
+Function XSetErrorHandler(_para1 : TXErrorHandler) : TXErrorHandler; cdecl;
+Function XSetIOErrorHandler(_para1 : TXIOErrorHandler) : TXIOErrorHandler; cdecl;
+Function XListPixmapFormats(_para1 : PDisplay;_para2 : Plongint) : PXPixmapFormatValues; cdecl;
+Function XListDepths(_para1 : PDisplay;_para2 : longint;_para3 : Plongint) : Plongint; cdecl;
+Function XReconfigureWMWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : cardinal;_para5 : PXWindowChanges) : TStatus; cdecl;
+Function XGetWMProtocols(_para1 : PDisplay;_para2 : TWindow;_para3 : PPAtom;_para4 : Plongint) : TStatus; cdecl;
+Function XSetWMProtocols(_para1 : PDisplay;_para2 : TWindow;_para3 : PAtom;_para4 : longint) : TStatus; cdecl;
+Function XIconifyWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : longint) : TStatus; cdecl;
+Function XWithdrawWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : longint) : TStatus; cdecl;
+Function XGetCommand(_para1 : PDisplay;_para2 : TWindow;_para3 : PPPChar;_para4 : Plongint) : TStatus; cdecl;
+Function XGetWMColormapWindows(_para1 : PDisplay;_para2 : TWindow;_para3 : PPWindow;_para4 : Plongint) : TStatus; cdecl;
+Function XSetWMColormapWindows(_para1 : PDisplay;_para2 : TWindow;_para3 : PWindow;_para4 : longint) : TStatus; cdecl;
+Procedure XFreeStringList(_para1 : PPChar); cdecl;
+Function XSetTransientForHint(_para1 : PDisplay;_para2 : TWindow;_para3 : TWindow) : longint; cdecl;
+Function XActivateScreenSaver(_para1 : PDisplay) : longint; cdecl;
+Function XAddHost(_para1 : PDisplay;_para2 : PXHostAddress) : longint; cdecl;
+Function XAddHosts(_para1 : PDisplay;_para2 : PXHostAddress;_para3 : longint) : longint; cdecl;
+{
+Function XAddToExtensionList(_para1 : ^^*;_para2 : PXExtData) : longint; cdecl;
+}
+Function XAddToSaveSet(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;
+Function XAllocColor(_para1 : PDisplay;_para2 : TColormap;_para3 : PXColor) : TStatus; cdecl;
+Function XAllocColorCells(_para1 : PDisplay;_para2 : TColormap;_para3 : TBool;_para4 : PCardinal;_para5 : cardinal;_para6 : PCardinal;_para7 : cardinal) : TStatus; cdecl;
+Function XAllocColorPlanes(_para1 : PDisplay;_para2 : TColormap;_para3 : TBool;_para4 : PCardinal;_para5 : longint;_para6 : longint;_para7 : longint;_para8 : longint;_para9 : PCardinal;_para10 : PCardinal;_para11 : PCardinal) : TStatus; cdecl;
+Function XAllocNamedColor(_para1 : PDisplay;_para2 : TColormap;_para3 : pchar;_para4 : PXColor;_para5 : PXColor) : TStatus; cdecl;
+Function XAllowEvents(_para1 : PDisplay;_para2 : longint;_para3 : TTime) : longint; cdecl;
+Function XAutoRepeatOff(_para1 : PDisplay) : longint; cdecl;
+Function XAutoRepeatOn(_para1 : PDisplay) : longint; cdecl;
+Function XBell(_para1 : PDisplay;_para2 : longint) : longint; cdecl;
+Function XBitmapBitOrder(_para1 : PDisplay) : longint; cdecl;
+Function XBitmapPad(_para1 : PDisplay) : longint; cdecl;
+Function XBitmapUnit(_para1 : PDisplay) : longint; cdecl;
+Function XCellsOfScreen(_para1 : PScreen) : longint; cdecl;
+Function XChangeActivePointerGrab(_para1 : PDisplay;_para2 : cardinal;_para3 : TCursor;_para4 : TTime) : longint; cdecl;
+Function XChangeGC(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal;_para4 : PXGCValues) : longint; cdecl;
+Function XChangeKeyboardControl(_para1 : PDisplay;_para2 : cardinal;_para3 : PXKeyboardControl) : longint; cdecl;
+Function XChangeKeyboardMapping(_para1 : PDisplay;_para2 : longint;_para3 : longint;_para4 : PKeySym;_para5 : longint) : longint; cdecl;
+Function XChangePointerControl(_para1 : PDisplay;_para2 : TBool;_para3 : TBool;_para4 : longint;_para5 : longint;_para6 : longint) : longint; cdecl;
+Function XChangeProperty(_para1 : PDisplay;_para2 : TWindow;_para3 : TAtom;_para4 : TAtom;_para5 : longint;_para6 : longint;_para7 : pchar;_para8 : longint) : longint; cdecl;
+Function XChangeSaveSet(_para1 : PDisplay;_para2 : TWindow;_para3 : longint) : longint; cdecl;
+Function XChangeWindowAttributes(_para1 : PDisplay;_para2 : TWindow;_para3 : cardinal;_para4 : PXSetWindowAttributes) : longint; cdecl;
+{
+Function XCheckIfEvent(_para1 : PDisplay;_para2 : PXEvent;_para3 : function(_para1 : PDisplay;_para2 : PXEvent;_para3 : XPointer) : TBool;_para4 : XPointer) : TBool; cdecl;
+}
+Function XCheckMaskEvent(_para1 : PDisplay;_para2 : longint;_para3 : PXEvent) : TBool; cdecl;
+Function XCheckTypedEvent(_para1 : PDisplay;_para2 : longint;_para3 : PXEvent) : TBool; cdecl;
+Function XCheckTypedWindowEvent(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : PXEvent) : TBool; cdecl;
+Function XCheckWindowEvent(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : PXEvent) : TBool; cdecl;
+Function XCirculateSubwindows(_para1 : PDisplay;_para2 : TWindow;_para3 : longint) : longint; cdecl;
+Function XCirculateSubwindowsDown(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;
+Function XCirculateSubwindowsUp(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;
+Function XClearArea(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : longint;_para5 : cardinal;_para6 : cardinal;_para7 : TBool) : longint; cdecl;
+Function XClearWindow(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;
+Function XCloseDisplay(_para1 : PDisplay) : longint; cdecl;
+Function XConfigureWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : cardinal;_para4 : PXWindowChanges) : longint; cdecl;
+Function XConnectionNumber(_para1 : PDisplay) : longint; cdecl;
+Function XConvertSelection(_para1 : PDisplay;_para2 : TAtom;_para3 : TAtom;_para4 : TAtom;_para5 : TWindow;_para6 : TTime) : longint; cdecl;
+Function XCopyArea(_para1 : PDisplay;_para2 : TDrawable;_para3 : TDrawable;_para4 : TGC;_para5 : longint;_para6 : longint;_para7 : cardinal;_para8 : cardinal;_para9 : longint;_para10 : longint) : longint; cdecl;
+Function XCopyGC(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal;_para4 : TGC) : longint; cdecl;
+Function XCopyPlane(_para1 : PDisplay;_para2 : TDrawable;_para3 : TDrawable;_para4 : TGC;_para5 : longint;_para6 : longint;_para7 : cardinal;_para8 : cardinal;_para9 : longint;_para10 : longint;_para11 : cardinal) : longint; cdecl;
+Function XDefaultDepth(_para1 : PDisplay;_para2 : longint) : longint; cdecl;
+Function XDefaultDepthOfScreen(_para1 : PScreen) : longint; cdecl;
+Function XDefaultScreen(_para1 : PDisplay) : longint; cdecl;
+Function XDefineCursor(_para1 : PDisplay;_para2 : TWindow;_para3 : TCursor) : longint; cdecl;
+Function XDeleteProperty(_para1 : PDisplay;_para2 : TWindow;_para3 : TAtom) : longint; cdecl;
+Function XDestroyWindow(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;
+Function XDestroySubwindows(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;
+Function XDoesBackingStore(_para1 : PScreen) : longint; cdecl;
+Function XDoesSaveUnders(_para1 : PScreen) : TBool; cdecl;
+Function XDisableAccessControl(_para1 : PDisplay) : longint; cdecl;
+Function XDisplayCells(_para1 : PDisplay;_para2 : longint) : longint; cdecl;
+Function XDisplayHeight(_para1 : PDisplay;_para2 : longint) : longint; cdecl;
+Function XDisplayHeightMM(_para1 : PDisplay;_para2 : longint) : longint; cdecl;
+Function XDisplayKeycodes(_para1 : PDisplay;_para2 : Plongint;_para3 : Plongint) : longint; cdecl;
+Function XDisplayPlanes(_para1 : PDisplay;_para2 : longint) : longint; cdecl;
+Function XDisplayWidth(_para1 : PDisplay;_para2 : longint) : longint; cdecl;
+Function XDisplayWidthMM(_para1 : PDisplay;_para2 : longint) : longint; cdecl;
+Function XDrawArc(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : cardinal;_para7 : cardinal;_para8 : longint;_para9 : longint) : longint; cdecl;
+Function XDrawArcs(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXArc;_para5 : longint) : longint; cdecl;
+Function XDrawImageString(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : pchar;_para7 : longint) : longint; cdecl;
+Function XDrawImageString16(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : PXChar2b;_para7 : longint) : longint; cdecl;
+Function XDrawLine(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : longint;_para7 : longint) : longint; cdecl;
+Function XDrawLines(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXPoint;_para5 : longint;_para6 : longint) : longint; cdecl;
+Function XDrawPoint(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint) : longint; cdecl;
+Function XDrawPoints(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXPoint;_para5 : longint;_para6 : longint) : longint; cdecl;
+Function XDrawRectangle(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : cardinal;_para7 : cardinal) : longint; cdecl;
+Function XDrawRectangles(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXRectangle;_para5 : longint) : longint; cdecl;
+Function XDrawSegments(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXSegment;_para5 : longint) : longint; cdecl;
+Function XDrawString(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : pchar;_para7 : longint) : longint; cdecl;
+Function XDrawString16(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : PXChar2b;_para7 : longint) : longint; cdecl;
+Function XDrawText(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : PXTextItem;_para7 : longint) : longint; cdecl;
+Function XDrawText16(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : PXTextItem16;_para7 : longint) : longint; cdecl;
+Function XEnableAccessControl(_para1 : PDisplay) : longint; cdecl;
+Function XEventsQueued(_para1 : PDisplay;_para2 : longint) : longint; cdecl;
+Function XFetchName(_para1 : PDisplay;_para2 : TWindow;_para3 : PPChar) : TStatus; cdecl;
+Function XFillArc(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : cardinal;_para7 : cardinal;_para8 : longint;_para9 : longint) : longint; cdecl;
+Function XFillArcs(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXArc;_para5 : longint) : longint; cdecl;
+Function XFillPolygon(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXPoint;_para5 : longint;_para6 : longint;_para7 : longint) : longint; cdecl;
+Function XFillRectangle(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : cardinal;_para7 : cardinal) : longint; cdecl;
+Function XFillRectangles(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXRectangle;_para5 : longint) : longint; cdecl;
+Function XFlush(_para1 : PDisplay) : longint; cdecl;
+Function XForceScreenSaver(_para1 : PDisplay;_para2 : longint) : longint; cdecl;
+Function XFree(_para1 : pointer) : longint; cdecl;
+Function XFreeColormap(_para1 : PDisplay;_para2 : TColormap) : longint; cdecl;
+Function XFreeColors(_para1 : PDisplay;_para2 : TColormap;_para3 : PCardinal;_para4 : longint;_para5 : cardinal) : longint; cdecl;
+Function XFreeCursor(_para1 : PDisplay;_para2 : TCursor) : longint; cdecl;
+Function XFreeExtensionList(_para1 : PPChar) : longint; cdecl;
+Function XFreeFont(_para1 : PDisplay;_para2 : PXFontStruct) : longint; cdecl;
+Function XFreeFontInfo(_para1 : PPChar;_para2 : PXFontStruct;_para3 : longint) : longint; cdecl;
+Function XFreeFontNames(_para1 : PPChar) : longint; cdecl;
+Function XFreeFontPath(_para1 : PPChar) : longint; cdecl;
+Function XFreeGC(_para1 : PDisplay;_para2 : TGC) : longint; cdecl;
+Function XFreeModifiermap(_para1 : PXModifierKeymap) : longint; cdecl;
+Function XFreePixmap(_para1 : PDisplay;_para2 : TPixmap) : longint; cdecl;
+Function XGeometry(_para1 : PDisplay;_para2 : longint;_para3 : pchar;_para4 : pchar;_para5 : cardinal;_para6 : cardinal;_para7 : cardinal;_para8 : longint;_para9 : longint;_para10 : Plongint;_para11 : Plongint;_para12 : Plongint;_para13 : Plongint) : longint; cdecl;
+Function XGetErrorDatabaseText(_para1 : PDisplay;_para2 : pchar;_para3 : pchar;_para4 : pchar;_para5 : pchar;_para6 : longint) : longint; cdecl;
+Function XGetErrorText(_para1 : PDisplay;_para2 : longint;_para3 : pchar;_para4 : longint) : longint; cdecl;
+Function XGetFontProperty(_para1 : PXFontStruct;_para2 : TAtom;_para3 : PCardinal) : TBool; cdecl;
+Function XGetGCValues(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal;_para4 : PXGCValues) : TStatus; cdecl;
+Function XGetGeometry(_para1 : PDisplay;_para2 : TDrawable;_para3 : PWindow;_para4 : Plongint;_para5 : Plongint;_para6 : PCardinal;_para7 : PCardinal;_para8 : PCardinal;_para9 : PCardinal) : TStatus; cdecl;
+Function XGetIconName(_para1 : PDisplay;_para2 : TWindow;_para3 : PPChar) : TStatus; cdecl;
+Function XGetInputFocus(_para1 : PDisplay;_para2 : PWindow;_para3 : Plongint) : longint; cdecl;
+Function XGetKeyboardControl(_para1 : PDisplay;_para2 : PXKeyboardState) : longint; cdecl;
+Function XGetPointerControl(_para1 : PDisplay;_para2 : Plongint;_para3 : Plongint;_para4 : Plongint) : longint; cdecl;
+Function XGetPointerMapping(_para1 : PDisplay;_para2 : pchar;_para3 : longint) : longint; cdecl;
+Function XGetScreenSaver(_para1 : PDisplay;_para2 : Plongint;_para3 : Plongint;_para4 : Plongint;_para5 : Plongint) : longint; cdecl;
+Function XGetTransientForHint(_para1 : PDisplay;_para2 : TWindow;_para3 : PWindow) : TStatus; cdecl;
+Function XGetWindowProperty(_para1 : PDisplay;_para2 : TWindow;_para3 : TAtom;_para4 : longint;_para5 : longint;_para6 : TBool;_para7 : TAtom;_para8 : PAtom;_para9 : Plongint;_para10 : PCardinal;_para11 : PCardinal;_para12 : PPChar) : longint; cdecl;
+Function XGetWindowAttributes(_para1 : PDisplay;_para2 : TWindow;_para3 : PXWindowAttributes) : TStatus; cdecl;
+Function XGrabButton(_para1 : PDisplay;_para2 : cardinal;_para3 : cardinal;_para4 : TWindow;_para5 : TBool;_para6 : cardinal;_para7 : longint;_para8 : longint;_para9 : TWindow;_para10 : TCursor) : longint; cdecl;
+Function XGrabKey(_para1 : PDisplay;_para2 : longint;_para3 : cardinal;_para4 : TWindow;_para5 : TBool;_para6 : longint;_para7 : longint) : longint; cdecl;
+Function XGrabKeyboard(_para1 : PDisplay;_para2 : TWindow;_para3 : TBool;_para4 : longint;_para5 : longint;_para6 : TTime) : longint; cdecl;
+Function XGrabPointer(_para1 : PDisplay;_para2 : TWindow;_para3 : TBool;_para4 : cardinal;_para5 : longint;_para6 : longint;_para7 : TWindow;_para8 : TCursor;_para9 : TTime) : longint; cdecl;
+Function XGrabServer(_para1 : PDisplay) : longint; cdecl;
+Function XHeightMMOfScreen(_para1 : PScreen) : longint; cdecl;
+Function XHeightOfScreen(_para1 : PScreen) : longint; cdecl;
+{
+Function XIfEvent(_para1 : PDisplay;_para2 : PXEvent;_para3 : function(_para1 : PDisplay;_para2 : PXEvent;_para3 : XPointer) : TBool;_para4 : XPointer) : longint; cdecl;
+}
+Function XImageByteOrder(_para1 : PDisplay) : longint; cdecl;
+Function XInstallColormap(_para1 : PDisplay;_para2 : TColormap) : longint; cdecl;
+Function XKeysymToKeycode(_para1 : PDisplay;_para2 : TKeySym) : TKeyCode; cdecl;
+Function XKillClient(_para1 : PDisplay;_para2 : TXID) : longint; cdecl;
+Function XLastKnownRequestProcessed(_para1 : PDisplay) : cardinal; cdecl;
+Function XLookupColor(_para1 : PDisplay;_para2 : TColormap;_para3 : pchar;_para4 : PXColor;_para5 : PXColor) : TStatus; cdecl;
+Function XLowerWindow(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;
+Function XMapRaised(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;
+Function XMapSubwindows(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;
+Function XMapWindow(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;
+Function XMaskEvent(_para1 : PDisplay;_para2 : longint;_para3 : PXEvent) : longint; cdecl;
+Function XMaxCmapsOfScreen(_para1 : PScreen) : longint; cdecl;
+Function XMinCmapsOfScreen(_para1 : PScreen) : longint; cdecl;
+Function XMoveResizeWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : longint;_para5 : cardinal;_para6 : cardinal) : longint; cdecl;
+Function XMoveWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : longint) : longint; cdecl;
+Function XNextEvent(_para1 : PDisplay;_para2 : PXEvent) : longint; cdecl;
+Function XNoOp(_para1 : PDisplay) : longint; cdecl;
+Function XParseColor(_para1 : PDisplay;_para2 : TColormap;_para3 : pchar;_para4 : PXColor) : TStatus; cdecl;
+Function XParseGeometry(_para1 : pchar;_para2 : Plongint;_para3 : Plongint;_para4 : PCardinal;_para5 : PCardinal) : longint; cdecl;
+Function XPeekEvent(_para1 : PDisplay;_para2 : PXEvent) : longint; cdecl;
+{
+Function XPeekIfEvent(_para1 : PDisplay;_para2 : PXEvent;_para3 : function(_para1 : PDisplay;_para2 : PXEvent;_para3 : XPointer) : TBool;_para4 : XPointer) : longint; cdecl;
+}
+Function XPending(_para1 : PDisplay) : longint; cdecl;
+Function XPlanesOfScreen(_para1 : PScreen) : longint; cdecl;
+Function XProtocolRevision(_para1 : PDisplay) : longint; cdecl;
+Function XProtocolVersion(_para1 : PDisplay) : longint; cdecl;
+Function XPutBackEvent(_para1 : PDisplay;_para2 : PXEvent) : longint; cdecl;
+Function XPutImage(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXImage;_para5 : longint;_para6 : longint;_para7 : longint;_para8 : longint;_para9 : cardinal;_para10 : cardinal) : longint; cdecl;
+Function XQLength(_para1 : PDisplay) : longint; cdecl;
+Function XQueryBestCursor(_para1 : PDisplay;_para2 : TDrawable;_para3 : cardinal;_para4 : cardinal;_para5 : PCardinal;_para6 : PCardinal) : TStatus; cdecl;
+Function XQueryBestSize(_para1 : PDisplay;_para2 : longint;_para3 : TDrawable;_para4 : cardinal;_para5 : cardinal;_para6 : PCardinal;_para7 : PCardinal) : TStatus; cdecl;
+Function XQueryBestStipple(_para1 : PDisplay;_para2 : TDrawable;_para3 : cardinal;_para4 : cardinal;_para5 : PCardinal;_para6 : PCardinal) : TStatus; cdecl;
+Function XQueryBestTile(_para1 : PDisplay;_para2 : TDrawable;_para3 : cardinal;_para4 : cardinal;_para5 : PCardinal;_para6 : PCardinal) : TStatus; cdecl;
+Function XQueryColor(_para1 : PDisplay;_para2 : TColormap;_para3 : PXColor) : longint; cdecl;
+Function XQueryColors(_para1 : PDisplay;_para2 : TColormap;_para3 : PXColor;_para4 : longint) : longint; cdecl;
+Function XQueryExtension(_para1 : PDisplay;_para2 : pchar;_para3 : Plongint;_para4 : Plongint;_para5 : Plongint) : TBool; cdecl;
+{
+Function XQueryKeymap(_para1 : PDisplay;_para2 : array[0..(32)-1] of char) : longint; cdecl;
+}
+Function XQueryPointer(_para1 : PDisplay;_para2 : TWindow;_para3 : PWindow;_para4 : PWindow;_para5 : Plongint;_para6 : Plongint;_para7 : Plongint;_para8 : Plongint;_para9 : PCardinal) : TBool; cdecl;
+Function XQueryTextExtents(_para1 : PDisplay;_para2 : TXID;_para3 : pchar;_para4 : longint;_para5 : Plongint;_para6 : Plongint;_para7 : Plongint;_para8 : PXCharStruct) : longint; cdecl;
+Function XQueryTextExtents16(_para1 : PDisplay;_para2 : TXID;_para3 : PXChar2b;_para4 : longint;_para5 : Plongint;_para6 : Plongint;_para7 : Plongint;_para8 : PXCharStruct) : longint; cdecl;
+Function XQueryTree(_para1 : PDisplay;_para2 : TWindow;_para3 : PWindow;_para4 : PWindow;_para5 : PPWindow;_para6 : PCardinal) : TStatus; cdecl;
+Function XRaiseWindow(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;
+Function XReadBitmapFile(_para1 : PDisplay;_para2 : TDrawable;_para3 : pchar;_para4 : PCardinal;_para5 : PCardinal;_para6 : PPixmap;_para7 : Plongint;_para8 : Plongint) : longint; cdecl;
+Function XReadBitmapFileData(_para1 : pchar;_para2 : PCardinal;_para3 : PCardinal;_para4 : PPChar;_para5 : Plongint;_para6 : Plongint) : longint; cdecl;
+Function XRebindKeysym(_para1 : PDisplay;_para2 : TKeySym;_para3 : PKeySym;_para4 : longint;_para5 : pchar;_para6 : longint) : longint; cdecl;
+Function XRecolorCursor(_para1 : PDisplay;_para2 : TCursor;_para3 : PXColor;_para4 : PXColor) : longint; cdecl;
+Function XRefreshKeyboardMapping(_para1 : PXMappingEvent) : longint; cdecl;
+Function XRemoveFromSaveSet(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;
+Function XRemoveHost(_para1 : PDisplay;_para2 : PXHostAddress) : longint; cdecl;
+Function XRemoveHosts(_para1 : PDisplay;_para2 : PXHostAddress;_para3 : longint) : longint; cdecl;
+Function XReparentWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : TWindow;_para4 : longint;_para5 : longint) : longint; cdecl;
+Function XResetScreenSaver(_para1 : PDisplay) : longint; cdecl;
+Function XResizeWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : cardinal;_para4 : cardinal) : longint; cdecl;
+Function XRestackWindows(_para1 : PDisplay;_para2 : PWindow;_para3 : longint) : longint; cdecl;
+Function XRotateBuffers(_para1 : PDisplay;_para2 : longint) : longint; cdecl;
+Function XRotateWindowProperties(_para1 : PDisplay;_para2 : TWindow;_para3 : PAtom;_para4 : longint;_para5 : longint) : longint; cdecl;
+Function XScreenCount(_para1 : PDisplay) : longint; cdecl;
+Function XSelectInput(_para1 : PDisplay;_para2 : TWindow;_para3 : longint) : longint; cdecl;
+Function XSendEvent(_para1 : PDisplay;_para2 : TWindow;_para3 : TBool;_para4 : longint;_para5 : PXEvent) : TStatus; cdecl;
+Function XSetAccessControl(_para1 : PDisplay;_para2 : longint) : longint; cdecl;
+Function XSetArcMode(_para1 : PDisplay;_para2 : TGC;_para3 : longint) : longint; cdecl;
+Function XSetBackground(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal) : longint; cdecl;
+Function XSetClipMask(_para1 : PDisplay;_para2 : TGC;_para3 : TPixmap) : longint; cdecl;
+Function XSetClipOrigin(_para1 : PDisplay;_para2 : TGC;_para3 : longint;_para4 : longint) : longint; cdecl;
+Function XSetClipRectangles(_para1 : PDisplay;_para2 : TGC;_para3 : longint;_para4 : longint;_para5 : PXRectangle;_para6 : longint;_para7 : longint) : longint; cdecl;
+Function XSetCloseDownMode(_para1 : PDisplay;_para2 : longint) : longint; cdecl;
+Function XSetCommand(_para1 : PDisplay;_para2 : TWindow;_para3 : PPChar;_para4 : longint) : longint; cdecl;
+Function XSetDashes(_para1 : PDisplay;_para2 : TGC;_para3 : longint;_para4 : pchar;_para5 : longint) : longint; cdecl;
+Function XSetFillRule(_para1 : PDisplay;_para2 : TGC;_para3 : longint) : longint; cdecl;
+Function XSetFillStyle(_para1 : PDisplay;_para2 : TGC;_para3 : longint) : longint; cdecl;
+Function XSetFont(_para1 : PDisplay;_para2 : TGC;_para3 : TFont) : longint; cdecl;
+Function XSetFontPath(_para1 : PDisplay;_para2 : PPChar;_para3 : longint) : longint; cdecl;
+Function XSetForeground(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal) : longint; cdecl;
+Function XSetFunction(_para1 : PDisplay;_para2 : TGC;_para3 : longint) : longint; cdecl;
+Function XSetGraphicsExposures(_para1 : PDisplay;_para2 : TGC;_para3 : TBool) : longint; cdecl;
+Function XSetIconName(_para1 : PDisplay;_para2 : TWindow;_para3 : pchar) : longint; cdecl;
+Function XSetInputFocus(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : TTime) : longint; cdecl;
+Function XSetLineAttributes(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal;_para4 : longint;_para5 : longint;_para6 : longint) : longint; cdecl;
+Function XSetModifierMapping(_para1 : PDisplay;_para2 : PXModifierKeymap) : longint; cdecl;
+Function XSetPlaneMask(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal) : longint; cdecl;
+Function XSetPointerMapping(_para1 : PDisplay;_para2 : pchar;_para3 : longint) : longint; cdecl;
+Function XSetScreenSaver(_para1 : PDisplay;_para2 : longint;_para3 : longint;_para4 : longint;_para5 : longint) : longint; cdecl;
+Function XSetSelectionOwner(_para1 : PDisplay;_para2 : TAtom;_para3 : TWindow;_para4 : TTime) : longint; cdecl;
+Function XSetState(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal;_para4 : cardinal;_para5 : longint;_para6 : cardinal) : longint; cdecl;
+Function XSetStipple(_para1 : PDisplay;_para2 : TGC;_para3 : TPixmap) : longint; cdecl;
+Function XSetSubwindowMode(_para1 : PDisplay;_para2 : TGC;_para3 : longint) : longint; cdecl;
+Function XSetTSOrigin(_para1 : PDisplay;_para2 : TGC;_para3 : longint;_para4 : longint) : longint; cdecl;
+Function XSetTile(_para1 : PDisplay;_para2 : TGC;_para3 : TPixmap) : longint; cdecl;
+Function XSetWindowBackground(_para1 : PDisplay;_para2 : TWindow;_para3 : cardinal) : longint; cdecl;
+Function XSetWindowBackgroundPixmap(_para1 : PDisplay;_para2 : TWindow;_para3 : TPixmap) : longint; cdecl;
+Function XSetWindowBorder(_para1 : PDisplay;_para2 : TWindow;_para3 : cardinal) : longint; cdecl;
+Function XSetWindowBorderPixmap(_para1 : PDisplay;_para2 : TWindow;_para3 : TPixmap) : longint; cdecl;
+Function XSetWindowBorderWidth(_para1 : PDisplay;_para2 : TWindow;_para3 : cardinal) : longint; cdecl;
+Function XSetWindowColormap(_para1 : PDisplay;_para2 : TWindow;_para3 : TColormap) : longint; cdecl;
+Function XStoreBuffer(_para1 : PDisplay;_para2 : pchar;_para3 : longint;_para4 : longint) : longint; cdecl;
+Function XStoreBytes(_para1 : PDisplay;_para2 : pchar;_para3 : longint) : longint; cdecl;
+Function XStoreColor(_para1 : PDisplay;_para2 : TColormap;_para3 : PXColor) : longint; cdecl;
+Function XStoreColors(_para1 : PDisplay;_para2 : TColormap;_para3 : PXColor;_para4 : longint) : longint; cdecl;
+Function XStoreName(_para1 : PDisplay;_para2 : TWindow;_para3 : pchar) : longint; cdecl;
+Function XStoreNamedColor(_para1 : PDisplay;_para2 : TColormap;_para3 : pchar;_para4 : cardinal;_para5 : longint) : longint; cdecl;
+Function XSync(_para1 : PDisplay;_para2 : TBool) : longint; cdecl;
+Function XTextExtents(_para1 : PXFontStruct;_para2 : pchar;_para3 : longint;_para4 : Plongint;_para5 : Plongint;_para6 : Plongint;_para7 : PXCharStruct) : longint; cdecl;
+Function XTextExtents16(_para1 : PXFontStruct;_para2 : PXChar2b;_para3 : longint;_para4 : Plongint;_para5 : Plongint;_para6 : Plongint;_para7 : PXCharStruct) : longint; cdecl;
+Function XTextWidth(_para1 : PXFontStruct;_para2 : pchar;_para3 : longint) : longint; cdecl;
+Function XTextWidth16(_para1 : PXFontStruct;_para2 : PXChar2b;_para3 : longint) : longint; cdecl;
+Function XTranslateCoordinates(_para1 : PDisplay;_para2 : TWindow;_para3 : TWindow;_para4 : longint;_para5 : longint;_para6 : Plongint;_para7 : Plongint;_para8 : PWindow) : TBool; cdecl;
+Function XUndefineCursor(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;
+Function XUngrabButton(_para1 : PDisplay;_para2 : cardinal;_para3 : cardinal;_para4 : TWindow) : longint; cdecl;
+Function XUngrabKey(_para1 : PDisplay;_para2 : longint;_para3 : cardinal;_para4 : TWindow) : longint; cdecl;
+Function XUngrabKeyboard(_para1 : PDisplay;_para2 : TTime) : longint; cdecl;
+Function XUngrabPointer(_para1 : PDisplay;_para2 : TTime) : longint; cdecl;
+Function XUngrabServer(_para1 : PDisplay) : longint; cdecl;
+Function XUninstallColormap(_para1 : PDisplay;_para2 : TColormap) : longint; cdecl;
+Function XUnloadFont(_para1 : PDisplay;_para2 : TFont) : longint; cdecl;
+Function XUnmapSubwindows(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;
+Function XUnmapWindow(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;
+Function XVendorRelease(_para1 : PDisplay) : longint; cdecl;
+Function XWarpPointer(_para1 : PDisplay;_para2 : TWindow;_para3 : TWindow;_para4 : longint;_para5 : longint;_para6 : cardinal;_para7 : cardinal;_para8 : longint;_para9 : longint) : longint; cdecl;
+Function XWidthMMOfScreen(_para1 : PScreen) : longint; cdecl;
+Function XWidthOfScreen(_para1 : PScreen) : longint; cdecl;
+Function XWindowEvent(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : PXEvent) : longint; cdecl;
+Function XWriteBitmapFile(_para1 : PDisplay;_para2 : pchar;_para3 : TPixmap;_para4 : cardinal;_para5 : cardinal;_para6 : longint;_para7 : longint) : longint; cdecl;
+Function XSupportsLocale : TBool; cdecl;
+Function XSetLocaleModifiers(_para1 : pchar) : pchar; cdecl;
+{
+Function XOpenOM(_para1 : PDisplay;_para2 : ^*;_para3 : pchar;_para4 : pchar) : TXOM; cdecl;
+}
+Function XCloseOM(_para1 : TXOM) : TStatus; cdecl;
+Function XDisplayOfOM(_para1 : TXOM) : PDisplay; cdecl;
+Function XLocaleOfOM(_para1 : TXOM) : pchar; cdecl;
+Procedure XDestroyOC(_para1 : TXOC); cdecl;
+Function TXOMOfOC(_para1 : TXOC) : TXOM; cdecl;
+Function XCreateFontSet(_para1 : PDisplay;_para2 : pchar;_para3 : PPPChar;_para4 : Plongint;_para5 : PPChar) : TXFontSet; cdecl;
+Procedure XFreeFontSet(_para1 : PDisplay;_para2 : TXFontSet); cdecl;
+Function XFontsOfFontSet(_para1 : TXFontSet;_para2 : PPPXFontStruct;_para3 : PPPChar) : longint; cdecl;
+Function XBaseFontNameListOfFontSet(_para1 : TXFontSet) : pchar; cdecl;
+Function XLocaleOfFontSet(_para1 : TXFontSet) : pchar; cdecl;
+Function XContextDependentDrawing(_para1 : TXFontSet) : TBool; cdecl;
+Function XDirectionalDependentDrawing(_para1 : TXFontSet) : TBool; cdecl;
+Function XContextualDrawing(_para1 : TXFontSet) : TBool; cdecl;
+Function XExtentsOfFontSet(_para1 : TXFontSet) : PXFontSetExtents; cdecl;
+Function XmbTextEscapement(_para1 : TXFontSet;_para2 : pchar;_para3 : longint) : longint; cdecl;
+Function XwcTextEscapement(_para1 : TXFontSet;_para2 : Pwchar_t;_para3 : longint) : longint; cdecl;
+Function XmbTextExtents(_para1 : TXFontSet;_para2 : pchar;_para3 : longint;_para4 : PXRectangle;_para5 : PXRectangle) : longint; cdecl;
+Function XwcTextExtents(_para1 : TXFontSet;_para2 : Pwchar_t;_para3 : longint;_para4 : PXRectangle;_para5 : PXRectangle) : longint; cdecl;
+Function XmbTextPerCharExtents(_para1 : TXFontSet;_para2 : pchar;_para3 : longint;_para4 : PXRectangle;_para5 : PXRectangle;_para6 : longint;_para7 : Plongint;_para8 : PXRectangle;_para9 : PXRectangle) : TStatus; cdecl;
+Function XwcTextPerCharExtents(_para1 : TXFontSet;_para2 : Pwchar_t;_para3 : longint;_para4 : PXRectangle;_para5 : PXRectangle;_para6 : longint;_para7 : Plongint;_para8 : PXRectangle;_para9 : PXRectangle) : TStatus; cdecl;
+Procedure XmbDrawText(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : PXmbTextItem;_para7 : longint); cdecl;
+Procedure XwcDrawText(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : PXwcTextItem;_para7 : longint); cdecl;
+Procedure XmbDrawString(_para1 : PDisplay;_para2 : TDrawable;_para3 : TXFontSet;_para4 : TGC;_para5 : longint;_para6 : longint;_para7 : pchar;_para8 : longint); cdecl;
+Procedure XwcDrawString(_para1 : PDisplay;_para2 : TDrawable;_para3 : TXFontSet;_para4 : TGC;_para5 : longint;_para6 : longint;_para7 : Pwchar_t;_para8 : longint); cdecl;
+Procedure XmbDrawImageString(_para1 : PDisplay;_para2 : TDrawable;_para3 : TXFontSet;_para4 : TGC;_para5 : longint;_para6 : longint;_para7 : pchar;_para8 : longint); cdecl;
+Procedure XwcDrawImageString(_para1 : PDisplay;_para2 : TDrawable;_para3 : TXFontSet;_para4 : TGC;_para5 : longint;_para6 : longint;_para7 : Pwchar_t;_para8 : longint); cdecl;
+{
+Function XOpenIM(_para1 : PDisplay;_para2 : P*;_para3 : pchar;_para4 : pchar) : TXIM; cdecl;
+}
+Function XCloseIM(_para1 : TXIM) : TStatus; cdecl;
+Function XDisplayOfIM(_para1 : TXIM) : PDisplay; cdecl;
+Function XLocaleOfIM(_para1 : TXIM) : pchar; cdecl;
+Procedure XDestroyIC(_para1 : TXIC); cdecl;
+Procedure XSetICFocus(_para1 : TXIC); cdecl;
+Procedure XUnsetICFocus(_para1 : TXIC); cdecl;
+Function XwcResetIC(_para1 : TXIC) : Pwchar_t; cdecl;
+Function XmbResetIC(_para1 : TXIC) : pchar; cdecl;
+Function TXIMOfIC(_para1 : TXIC) : TXIM; cdecl;
+Function XFilterEvent(_para1 : PXEvent;_para2 : TWindow) : TBool; cdecl;
+Function XmbLookupString(_para1 : TXIC;_para2 : PXKeyPressedEvent;_para3 : pchar;_para4 : longint;_para5 : PKeySym;_para6 : PStatus) : longint; cdecl;
+Function XwcLookupString(_para1 : TXIC;_para2 : PXKeyPressedEvent;_para3 : Pwchar_t;_para4 : longint;_para5 : PKeySym;_para6 : PStatus) : longint; cdecl;
+{
+Function XRegisterIMInstantiateCallback(_para1 : PDisplay;_para2 : P*;_para3 : pchar;_para4 : pchar;_para5 : TXIMProc;_para6 : PXPointer) : TBool; cdecl;
+Function XUnregisterIMInstantiateCallback(_para1 : PDisplay;_para2 : P*;_para3 : pchar;_para4 : pchar;_para5 : TXIMProc;_para6 : PXPointer) : TBool; cdecl;
+}
+Function XInternalConnectionNumbers(_para1 : PDisplay;_para2 : PPlongint;_para3 : Plongint) : TStatus; cdecl;
+Procedure XProcessInternalConnection(_para1 : PDisplay;_para2 : longint); cdecl;
+Function XAddConnectionWatch(_para1 : PDisplay;_para2 : TXConnectionWatchProc;_para3 : TXPointer) : TStatus; cdecl;
+Procedure XRemoveConnectionWatch(_para1 : PDisplay;_para2 : TXConnectionWatchProc;_para3 : TXPointer); cdecl;
+
+implementation
+
+function XLoadQueryFont (para1 : PDisplay; para2 : pchar) : PXFontStruct; cdecl;external ;
+function XQueryFont(_para1 : PDisplay;_para2 : TXID) : PXFontStruct; cdecl;external ;
+function XGetMotionEvents(_para1 : PDisplay;_para2 : TWindow;_para3 : TTime;_para4 : TTime;_para5 : Plongint) : PXTimeCoord; cdecl;external ;
+function XDeleteModifiermapEntry(_para1 : PXModifierKeymap;_para2 : cardinal;_para3 : TKeyCode;_para4 : longint) : PXModifierKeymap; cdecl;external ;
+function XGetModifierMapping(_para1 : PDisplay) : PXModifierKeymap; cdecl;external ;
+function XInsertModifiermapEntry(_para1 : PXModifierKeymap;_para2 : cardinal;_para3 : TKeyCode;_para4 : longint) : PXModifierKeymap; cdecl;external ;
+function XNewModifiermap(_para1 : longint) : PXModifierKeymap; cdecl;external ;
+function XCreateImage(_para1 : PDisplay;_para2 : PVisual;_para3 : cardinal;_para4 : longint;_para5 : longint;_para6 : pchar;_para7 : cardinal;_para8 : cardinal;_para9 : longint;_para10 : longint) : PXImage; cdecl;external ;
+function XInitImage(_para1 : PXImage) : TStatus; cdecl;external ;
+function XGetImage(_para1 : PDisplay;_para2 : TDrawable;_para3 : longint;_para4 : longint;_para5 : cardinal;_para6 : cardinal;_para7 : cardinal;_para8 : longint) : PXImage; cdecl;external ;
+function XGetSubImage(_para1 : PDisplay;_para2 : TDrawable;_para3 : longint;_para4 : longint;_para5 : cardinal;_para6 : cardinal;_para7 : cardinal;_para8 : longint;_para9 : PXImage;_para10 : longint;_para11 : longint) : PXImage; cdecl;external ;
+function XOpenDisplay(_para1 : pchar) : PDisplay; cdecl;external ;
+procedure XrmInitialize; cdecl;external ;
+function XFetchBytes(_para1 : PDisplay;_para2 : Plongint) : pchar; cdecl;external ;
+function XFetchBuffer(_para1 : PDisplay;_para2 : Plongint;_para3 : longint) : pchar; cdecl;external ;
+function XGetAtomName(_para1 : PDisplay;_para2 : TAtom) : pchar; cdecl;external ;
+function XGetAtomNames(_para1 : PDisplay;_para2 : PAtom;_para3 : longint;_para4 : PPChar) : TStatus; cdecl;external ;
+function XGetDefault(_para1 : PDisplay;_para2 : pchar;_para3 : pchar) : pchar; cdecl;external ;
+function XDisplayName(_para1 : pchar) : pchar; cdecl;external ;
+function XKeysymToString(_para1 : TKeySym) : pchar; cdecl;external ;
+function XSynchronize(_para1 : PDisplay;_para2 : TBool) : longint; cdecl;external ;
+{ WHat to do with this ??? MVC
+function XSetAfterFunction(_para1 : PDisplay;_para2 : function(_para1 : PDisplay) : longint) : function : longint; cdecl;external ;
+}
+function XInternAtom(_para1 : PDisplay;_para2 : pchar;_para3 : TBool) : TAtom; cdecl;external ;
+function XInternAtoms(_para1 : PDisplay;_para2 : PPChar;_para3 : longint;_para4 : TBool;_para5 : PAtom) : TStatus; cdecl;external ;
+function XCopyColormapAndFree(_para1 : PDisplay;_para2 : TColormap) : TColormap; cdecl;external ;
+function XCreateColormap(_para1 : PDisplay;_para2 : TWindow;_para3 : PVisual;_para4 : longint) : TColormap; cdecl;external ;
+function XCreatePixmapCursor(_para1 : PDisplay;_para2 : TPixmap;_para3 : TPixmap;_para4 : PXColor;_para5 : PXColor;_para6 : cardinal;_para7 : cardinal) : TCursor; cdecl;external ;
+function XCreateGlyphCursor(_para1 : PDisplay;_para2 : TFont;_para3 : TFont;_para4 : cardinal;_para5 : cardinal;_para6 : PXColor;_para7 : PXColor) : TCursor; cdecl;external ;
+function XCreateFontCursor(_para1 : PDisplay;_para2 : cardinal) : TCursor; cdecl;external ;
+function XLoadFont(_para1 : PDisplay;_para2 : pchar) : TFont; cdecl;external ;
+function XCreateGC(_para1 : PDisplay;_para2 : TDrawable;_para3 : cardinal;_para4 : PXGCValues) : TGC; cdecl;external ;
+function XGContextFromGC(_para1 : TGC) : TGContext; cdecl;external ;
+procedure XFlushGC(_para1 : PDisplay;_para2 : TGC); cdecl;external ;
+function XCreatePixmap(_para1 : PDisplay;_para2 : TDrawable;_para3 : cardinal;_para4 : cardinal;_para5 : cardinal) : TPixmap; cdecl;external ;
+function XCreateBitmapFromData(_para1 : PDisplay;_para2 : TDrawable;_para3 : pchar;_para4 : cardinal;_para5 : cardinal) : TPixmap; cdecl;external ;
+function XCreatePixmapFromBitmapData(_para1 : PDisplay;_para2 : TDrawable;_para3 : pchar;_para4 : cardinal;_para5 : cardinal;_para6 : cardinal;_para7 : cardinal;_para8 : cardinal) : TPixmap; cdecl;external ;
+function XCreateSimpleWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : longint;_para5 : cardinal;_para6 : cardinal;_para7 : cardinal;_para8 : cardinal;_para9 : cardinal) : TWindow; cdecl;external ;
+function XGetSelectionOwner(_para1 : PDisplay;_para2 : TAtom) : TWindow; cdecl;external ;
+function XCreateWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : longint;_para5 : cardinal;_para6 : cardinal;_para7 : cardinal;_para8 : longint;_para9 : cardinal;_para10 : PVisual;_para11 : cardinal;_para12 : PXSetWindowAttributes) : TWindow; cdecl;external ;
+function XListInstalledColormaps(_para1 : PDisplay;_para2 : TWindow;_para3 : Plongint) : PColormap; cdecl;external ;
+function XListFonts(_para1 : PDisplay;_para2 : pchar;_para3 : longint;_para4 : Plongint) : PPChar; cdecl;external ;
+function XListFontsWithInfo(_para1 : PDisplay;_para2 : pchar;_para3 : longint;_para4 : Plongint;_para5 : PPXFontStruct) : PPChar; cdecl;external ;
+function XGetFontPath(_para1 : PDisplay;_para2 : Plongint) : PPChar; cdecl;external ;
+function XListExtensions(_para1 : PDisplay;_para2 : Plongint) : PPChar; cdecl;external ;
+function XListProperties(_para1 : PDisplay;_para2 : TWindow;_para3 : Plongint) : PAtom; cdecl;external ;
+function XListHosts(_para1 : PDisplay;_para2 : Plongint;_para3 : PBool) : PXHostAddress; cdecl;external ;
+function XKeycodeToKeysym(_para1 : PDisplay;_para3 : TKeyCode;_para4 : longint) : TKeySym; cdecl;external ;
+{ Doesn't want ? MVC 
+function XLookupKeysym(_para1 : PXKeyEvent;_para2 : longint) : TKeySym; cdecl;external ;
+}
+function XGetKeyboardMapping(_para1 : PDisplay;_para2 : cardinal;_para3 : TKeyCode;_para4 : longint;_para5 : Plongint) : PKeySym; cdecl;external ;
+function XStringToKeysym(_para1 : pchar) : TKeySym; cdecl;external ;
+function XMaxRequestSize(_para1 : PDisplay) : longint; cdecl;external ;
+function XExtendedMaxRequestSize(_para1 : PDisplay) : longint; cdecl;external ;
+function XResourceManagerString(_para1 : PDisplay) : pchar; cdecl;external ;
+function XScreenResourceString(_para1 : PScreen) : pchar; cdecl;external ;
+function XDisplayMotionBufferSize(_para1 : PDisplay) : cardinal; cdecl;external ;
+function XVisualIDFromVisual(_para1 : PVisual) : TVisualID; cdecl;external ;
+function XInitThreads : TStatus; cdecl;external ;
+procedure XLockDisplay(_para1 : PDisplay); cdecl;external ;
+procedure XUnlockDisplay(_para1 : PDisplay); cdecl;external ;
+function XInitExtension(_para1 : PDisplay;_para2 : pchar) : PXExtCodes; cdecl;external ;
+function XAddExtension(_para1 : PDisplay) : PXExtCodes; cdecl;external ;
+function XFindOnExtensionList(_para1 : PPXExtData;_para2 : longint) : PXExtData; cdecl;external ;
+function XEHeadOfExtensionList(_para1 : TXEDataObject) : PPXExtData; cdecl;external ;
+function XRootWindow(_para1 : PDisplay;_para2 : longint) : TWindow; cdecl;external ;
+function XDefaultRootWindow(_para1 : PDisplay) : TWindow; cdecl;external ;
+function XRootWindowOfScreen(_para1 : PScreen) : TWindow; cdecl;external ;
+function XDefaultVisual(_para1 : PDisplay;_para2 : longint) : PVisual; cdecl;external ;
+function XDefaultVisualOfScreen(_para1 : PScreen) : PVisual; cdecl;external ;
+function XDefaultGC(_para1 : PDisplay;_para2 : longint) : TGC; cdecl;external ;
+function XDefaultGCOfScreen(_para1 : PScreen) : TGC; cdecl;external ;
+function XBlackPixel(_para1 : PDisplay;_para2 : longint) : cardinal; cdecl;external ;
+function XWhitePixel(_para1 : PDisplay;_para2 : longint) : cardinal; cdecl;external ;
+function XAllPlanes : cardinal; cdecl;external ;
+function XBlackPixelOfScreen(_para1 : PScreen) : cardinal; cdecl;external ;
+function XWhitePixelOfScreen(_para1 : PScreen) : cardinal; cdecl;external ;
+function XNextRequest(_para1 : PDisplay) : cardinal; cdecl;external ;
+function XLastKnownRequestProcessed(_para1 : PDisplay) : cardinal; cdecl;external ;
+function XServerVendor(_para1 : PDisplay) : pchar; cdecl;external ;
+function XDisplayString(_para1 : PDisplay) : pchar; cdecl;external ;
+function XDefaultColormap(_para1 : PDisplay;_para2 : longint) : TColormap; cdecl;external ;
+function XDefaultColormapOfScreen(_para1 : PScreen) : TColormap; cdecl;external ;
+function XDisplayOfScreen(_para1 : PScreen) : PDisplay; cdecl;external ;
+function XScreenOfDisplay(_para1 : PDisplay;_para2 : longint) : PScreen; cdecl;external ;
+function XDefaultScreenOfDisplay(_para1 : PDisplay) : PScreen; cdecl;external ;
+function XEventMaskOfScreen(_para1 : PScreen) : longint; cdecl;external ;
+function XScreenNumberOfScreen(_para1 : PScreen) : longint; cdecl;external ;
+function XSetErrorHandler(_para1 : TXErrorHandler) : TXErrorHandler; cdecl;external ;
+function XSetIOErrorHandler(_para1 : TXIOErrorHandler) : TXIOErrorHandler; cdecl;external ;
+function XListPixmapFormats(_para1 : PDisplay;_para2 : Plongint) : PXPixmapFormatValues; cdecl;external ;
+function XListDepths(_para1 : PDisplay;_para2 : longint;_para3 : Plongint) : Plongint; cdecl;external ;
+function XReconfigureWMWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : cardinal;_para5 : PXWindowChanges) : TStatus; cdecl;external ;
+function XGetWMProtocols(_para1 : PDisplay;_para2 : TWindow;_para3 : PPAtom;_para4 : Plongint) : TStatus; cdecl;external ;
+function XSetWMProtocols(_para1 : PDisplay;_para2 : TWindow;_para3 : PAtom;_para4 : longint) : TStatus; cdecl;external ;
+function XIconifyWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : longint) : TStatus; cdecl;external ;
+function XWithdrawWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : longint) : TStatus; cdecl;external ;
+function XGetCommand(_para1 : PDisplay;_para2 : TWindow;_para3 : PPPChar;_para4 : Plongint) : TStatus; cdecl;external ;
+function XGetWMColormapWindows(_para1 : PDisplay;_para2 : TWindow;_para3 : PPWindow;_para4 : Plongint) : TStatus; cdecl;external ;
+function XSetWMColormapWindows(_para1 : PDisplay;_para2 : TWindow;_para3 : PWindow;_para4 : longint) : TStatus; cdecl;external ;
+procedure XFreeStringList(_para1 : PPChar); cdecl;external ;
+function XSetTransientForHint(_para1 : PDisplay;_para2 : TWindow;_para3 : TWindow) : longint; cdecl;external ;
+function XActivateScreenSaver(_para1 : PDisplay) : longint; cdecl;external ;
+function XAddHost(_para1 : PDisplay;_para2 : PXHostAddress) : longint; cdecl;external ;
+function XAddHosts(_para1 : PDisplay;_para2 : PXHostAddress;_para3 : longint) : longint; cdecl;external ;
+{
+function XAddToExtensionList(_para1 : ^^*;_para2 : PXExtData) : longint; cdecl;external ;
+}
+function XAddToSaveSet(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;external ;
+function XAllocColor(_para1 : PDisplay;_para2 : TColormap;_para3 : PXColor) : TStatus; cdecl;external ;
+function XAllocColorCells(_para1 : PDisplay;_para2 : TColormap;_para3 : TBool;_para4 : PCardinal;_para5 : cardinal;_para6 : PCardinal;_para7 : cardinal) : TStatus; cdecl;external ;
+function XAllocColorPlanes(_para1 : PDisplay;_para2 : TColormap;_para3 : TBool;_para4 : PCardinal;_para5 : longint;_para6 : longint;_para7 : longint;_para8 : longint;_para9 : PCardinal;_para10 : PCardinal;_para11 : PCardinal) : TStatus; cdecl;external ;
+function XAllocNamedColor(_para1 : PDisplay;_para2 : TColormap;_para3 : pchar;_para4 : PXColor;_para5 : PXColor) : TStatus; cdecl;external ;
+function XAllowEvents(_para1 : PDisplay;_para2 : longint;_para3 : TTime) : longint; cdecl;external ;
+function XAutoRepeatOff(_para1 : PDisplay) : longint; cdecl;external ;
+function XAutoRepeatOn(_para1 : PDisplay) : longint; cdecl;external ;
+function XBell(_para1 : PDisplay;_para2 : longint) : longint; cdecl;external ;
+function XBitmapBitOrder(_para1 : PDisplay) : longint; cdecl;external ;
+function XBitmapPad(_para1 : PDisplay) : longint; cdecl;external ;
+function XBitmapUnit(_para1 : PDisplay) : longint; cdecl;external ;
+function XCellsOfScreen(_para1 : PScreen) : longint; cdecl;external ;
+function XChangeActivePointerGrab(_para1 : PDisplay;_para2 : cardinal;_para3 : TCursor;_para4 : TTime) : longint; cdecl;external ;
+function XChangeGC(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal;_para4 : PXGCValues) : longint; cdecl;external ;
+function XChangeKeyboardControl(_para1 : PDisplay;_para2 : cardinal;_para3 : PXKeyboardControl) : longint; cdecl;external ;
+function XChangeKeyboardMapping(_para1 : PDisplay;_para2 : longint;_para3 : longint;_para4 : PKeySym;_para5 : longint) : longint; cdecl;external ;
+function XChangePointerControl(_para1 : PDisplay;_para2 : TBool;_para3 : TBool;_para4 : longint;_para5 : longint;_para6 : longint) : longint; cdecl;external ;
+function XChangeProperty(_para1 : PDisplay;_para2 : TWindow;_para3 : TAtom;_para4 : TAtom;_para5 : longint;_para6 : longint;_para7 : pchar;_para8 : longint) : longint; cdecl;external ;
+function XChangeSaveSet(_para1 : PDisplay;_para2 : TWindow;_para3 : longint) : longint; cdecl;external ;
+function XChangeWindowAttributes(_para1 : PDisplay;_para2 : TWindow;_para3 : cardinal;_para4 : PXSetWindowAttributes) : longint; cdecl;external ;
+{
+function XCheckIfEvent(_para1 : PDisplay;_para2 : PXEvent;_para3 : function(_para1 : PDisplay;_para2 : PXEvent;_para3 : XPointer) : TBool;_para4 : XPointer) : TBool; cdecl;external ;
+}
+function XCheckMaskEvent(_para1 : PDisplay;_para2 : longint;_para3 : PXEvent) : TBool; cdecl;external ;
+function XCheckTypedEvent(_para1 : PDisplay;_para2 : longint;_para3 : PXEvent) : TBool; cdecl;external ;
+function XCheckTypedWindowEvent(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : PXEvent) : TBool; cdecl;external ;
+function XCheckWindowEvent(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : PXEvent) : TBool; cdecl;external ;
+function XCirculateSubwindows(_para1 : PDisplay;_para2 : TWindow;_para3 : longint) : longint; cdecl;external ;
+function XCirculateSubwindowsDown(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;external ;
+function XCirculateSubwindowsUp(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;external ;
+function XClearArea(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : longint;_para5 : cardinal;_para6 : cardinal;_para7 : TBool) : longint; cdecl;external ;
+function XClearWindow(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;external ;
+function XCloseDisplay(_para1 : PDisplay) : longint; cdecl;external ;
+function XConfigureWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : cardinal;_para4 : PXWindowChanges) : longint; cdecl;external ;
+function XConnectionNumber(_para1 : PDisplay) : longint; cdecl;external ;
+function XConvertSelection(_para1 : PDisplay;_para2 : TAtom;_para3 : TAtom;_para4 : TAtom;_para5 : TWindow;_para6 : TTime) : longint; cdecl;external ;
+function XCopyArea(_para1 : PDisplay;_para2 : TDrawable;_para3 : TDrawable;_para4 : TGC;_para5 : longint;_para6 : longint;_para7 : cardinal;_para8 : cardinal;_para9 : longint;_para10 : longint) : longint; cdecl;external ;
+function XCopyGC(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal;_para4 : TGC) : longint; cdecl;external ;
+function XCopyPlane(_para1 : PDisplay;_para2 : TDrawable;_para3 : TDrawable;_para4 : TGC;_para5 : longint;_para6 : longint;_para7 : cardinal;_para8 : cardinal;_para9 : longint;_para10 : longint;_para11 : cardinal) : longint; cdecl;external ;
+function XDefaultDepth(_para1 : PDisplay;_para2 : longint) : longint; cdecl;external ;
+function XDefaultDepthOfScreen(_para1 : PScreen) : longint; cdecl;external ;
+function XDefaultScreen(_para1 : PDisplay) : longint; cdecl;external ;
+function XDefineCursor(_para1 : PDisplay;_para2 : TWindow;_para3 : TCursor) : longint; cdecl;external ;
+function XDeleteProperty(_para1 : PDisplay;_para2 : TWindow;_para3 : TAtom) : longint; cdecl;external ;
+function XDestroyWindow(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;external ;
+function XDestroySubwindows(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;external ;
+function XDoesBackingStore(_para1 : PScreen) : longint; cdecl;external ;
+function XDoesSaveUnders(_para1 : PScreen) : TBool; cdecl;external ;
+function XDisableAccessControl(_para1 : PDisplay) : longint; cdecl;external ;
+function XDisplayCells(_para1 : PDisplay;_para2 : longint) : longint; cdecl;external ;
+function XDisplayHeight(_para1 : PDisplay;_para2 : longint) : longint; cdecl;external ;
+function XDisplayHeightMM(_para1 : PDisplay;_para2 : longint) : longint; cdecl;external ;
+function XDisplayKeycodes(_para1 : PDisplay;_para2 : Plongint;_para3 : Plongint) : longint; cdecl;external ;
+function XDisplayPlanes(_para1 : PDisplay;_para2 : longint) : longint; cdecl;external ;
+function XDisplayWidth(_para1 : PDisplay;_para2 : longint) : longint; cdecl;external ;
+function XDisplayWidthMM(_para1 : PDisplay;_para2 : longint) : longint; cdecl;external ;
+function XDrawArc(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : cardinal;_para7 : cardinal;_para8 : longint;_para9 : longint) : longint; cdecl;external ;
+function XDrawArcs(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXArc;_para5 : longint) : longint; cdecl;external ;
+function XDrawImageString(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : pchar;_para7 : longint) : longint; cdecl;external ;
+function XDrawImageString16(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : PXChar2b;_para7 : longint) : longint; cdecl;external ;
+function XDrawLine(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : longint;_para7 : longint) : longint; cdecl;external ;
+function XDrawLines(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXPoint;_para5 : longint;_para6 : longint) : longint; cdecl;external ;
+function XDrawPoint(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint) : longint; cdecl;external ;
+function XDrawPoints(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXPoint;_para5 : longint;_para6 : longint) : longint; cdecl;external ;
+function XDrawRectangle(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : cardinal;_para7 : cardinal) : longint; cdecl;external ;
+function XDrawRectangles(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXRectangle;_para5 : longint) : longint; cdecl;external ;
+function XDrawSegments(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXSegment;_para5 : longint) : longint; cdecl;external ;
+function XDrawString(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : pchar;_para7 : longint) : longint; cdecl;external ;
+function XDrawString16(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : PXChar2b;_para7 : longint) : longint; cdecl;external ;
+function XDrawText(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : PXTextItem;_para7 : longint) : longint; cdecl;external ;
+function XDrawText16(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : PXTextItem16;_para7 : longint) : longint; cdecl;external ;
+function XEnableAccessControl(_para1 : PDisplay) : longint; cdecl;external ;
+function XEventsQueued(_para1 : PDisplay;_para2 : longint) : longint; cdecl;external ;
+function XFetchName(_para1 : PDisplay;_para2 : TWindow;_para3 : PPChar) : TStatus; cdecl;external ;
+function XFillArc(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : cardinal;_para7 : cardinal;_para8 : longint;_para9 : longint) : longint; cdecl;external ;
+function XFillArcs(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXArc;_para5 : longint) : longint; cdecl;external ;
+function XFillPolygon(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXPoint;_para5 : longint;_para6 : longint;_para7 : longint) : longint; cdecl;external ;
+function XFillRectangle(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : cardinal;_para7 : cardinal) : longint; cdecl;external ;
+function XFillRectangles(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXRectangle;_para5 : longint) : longint; cdecl;external ;
+function XFlush(_para1 : PDisplay) : longint; cdecl;external ;
+function XForceScreenSaver(_para1 : PDisplay;_para2 : longint) : longint; cdecl;external ;
+function XFree(_para1 : pointer) : longint; cdecl;external ;
+function XFreeColormap(_para1 : PDisplay;_para2 : TColormap) : longint; cdecl;external ;
+function XFreeColors(_para1 : PDisplay;_para2 : TColormap;_para3 : PCardinal;_para4 : longint;_para5 : cardinal) : longint; cdecl;external ;
+function XFreeCursor(_para1 : PDisplay;_para2 : TCursor) : longint; cdecl;external ;
+function XFreeExtensionList(_para1 : PPChar) : longint; cdecl;external ;
+function XFreeFont(_para1 : PDisplay;_para2 : PXFontStruct) : longint; cdecl;external ;
+function XFreeFontInfo(_para1 : PPChar;_para2 : PXFontStruct;_para3 : longint) : longint; cdecl;external ;
+function XFreeFontNames(_para1 : PPChar) : longint; cdecl;external ;
+function XFreeFontPath(_para1 : PPChar) : longint; cdecl;external ;
+function XFreeGC(_para1 : PDisplay;_para2 : TGC) : longint; cdecl;external ;
+function XFreeModifiermap(_para1 : PXModifierKeymap) : longint; cdecl;external ;
+function XFreePixmap(_para1 : PDisplay;_para2 : TPixmap) : longint; cdecl;external ;
+function XGeometry(_para1 : PDisplay;_para2 : longint;_para3 : pchar;_para4 : pchar;_para5 : cardinal;_para6 : cardinal;_para7 : cardinal;_para8 : longint;_para9 : longint;_para10 : Plongint;_para11 : Plongint;_para12 : Plongint;_para13 : Plongint) : longint; cdecl;external ;
+function XGetErrorDatabaseText(_para1 : PDisplay;_para2 : pchar;_para3 : pchar;_para4 : pchar;_para5 : pchar;_para6 : longint) : longint; cdecl;external ;
+function XGetErrorText(_para1 : PDisplay;_para2 : longint;_para3 : pchar;_para4 : longint) : longint; cdecl;external ;
+function XGetFontProperty(_para1 : PXFontStruct;_para2 : TAtom;_para3 : PCardinal) : TBool; cdecl;external ;
+function XGetGCValues(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal;_para4 : PXGCValues) : TStatus; cdecl;external ;
+function XGetGeometry(_para1 : PDisplay;_para2 : TDrawable;_para3 : PWindow;_para4 : Plongint;_para5 : Plongint;_para6 : PCardinal;_para7 : PCardinal;_para8 : PCardinal;_para9 : PCardinal) : TStatus; cdecl;external ;
+function XGetIconName(_para1 : PDisplay;_para2 : TWindow;_para3 : PPChar) : TStatus; cdecl;external ;
+function XGetInputFocus(_para1 : PDisplay;_para2 : PWindow;_para3 : Plongint) : longint; cdecl;external ;
+function XGetKeyboardControl(_para1 : PDisplay;_para2 : PXKeyboardState) : longint; cdecl;external ;
+function XGetPointerControl(_para1 : PDisplay;_para2 : Plongint;_para3 : Plongint;_para4 : Plongint) : longint; cdecl;external ;
+function XGetPointerMapping(_para1 : PDisplay;_para2 : pchar;_para3 : longint) : longint; cdecl;external ;
+function XGetScreenSaver(_para1 : PDisplay;_para2 : Plongint;_para3 : Plongint;_para4 : Plongint;_para5 : Plongint) : longint; cdecl;external ;
+function XGetTransientForHint(_para1 : PDisplay;_para2 : TWindow;_para3 : PWindow) : TStatus; cdecl;external ;
+function XGetWindowProperty(_para1 : PDisplay;_para2 : TWindow;_para3 : TAtom;_para4 : longint;_para5 : longint;_para6 : TBool;_para7 : TAtom;_para8 : PAtom;_para9 : Plongint;_para10 : PCardinal;_para11 : PCardinal;_para12 : PPChar) : longint; cdecl;external ;
+function XGetWindowAttributes(_para1 : PDisplay;_para2 : TWindow;_para3 : PXWindowAttributes) : TStatus; cdecl;external ;
+function XGrabButton(_para1 : PDisplay;_para2 : cardinal;_para3 : cardinal;_para4 : TWindow;_para5 : TBool;_para6 : cardinal;_para7 : longint;_para8 : longint;_para9 : TWindow;_para10 : TCursor) : longint; cdecl;external ;
+function XGrabKey(_para1 : PDisplay;_para2 : longint;_para3 : cardinal;_para4 : TWindow;_para5 : TBool;_para6 : longint;_para7 : longint) : longint; cdecl;external ;
+function XGrabKeyboard(_para1 : PDisplay;_para2 : TWindow;_para3 : TBool;_para4 : longint;_para5 : longint;_para6 : TTime) : longint; cdecl;external ;
+function XGrabPointer(_para1 : PDisplay;_para2 : TWindow;_para3 : TBool;_para4 : cardinal;_para5 : longint;_para6 : longint;_para7 : TWindow;_para8 : TCursor;_para9 : TTime) : longint; cdecl;external ;
+function XGrabServer(_para1 : PDisplay) : longint; cdecl;external ;
+function XHeightMMOfScreen(_para1 : PScreen) : longint; cdecl;external ;
+function XHeightOfScreen(_para1 : PScreen) : longint; cdecl;external ;
+{
+function XIfEvent(_para1 : PDisplay;_para2 : PXEvent;_para3 : function(_para1 : PDisplay;_para2 : PXEvent;_para3 : XPointer) : TBool;_para4 : XPointer) : longint; cdecl;external ;
+}
+function XImageByteOrder(_para1 : PDisplay) : longint; cdecl;external ;
+function XInstallColormap(_para1 : PDisplay;_para2 : TColormap) : longint; cdecl;external ;
+function XKeysymToKeycode(_para1 : PDisplay;_para2 : TKeySym) : TKeyCode; cdecl;external ;
+function XKillClient(_para1 : PDisplay;_para2 : TXID) : longint; cdecl;external ;
+{
+function XLastKnownRequestProcessed(_para1 : PDisplay) : cardinal; cdecl;external ;
+}
+function XLookupColor(_para1 : PDisplay;_para2 : TColormap;_para3 : pchar;_para4 : PXColor;_para5 : PXColor) : TStatus; cdecl;external ;
+function XLowerWindow(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;external ;
+function XMapRaised(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;external ;
+function XMapSubwindows(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;external ;
+function XMapWindow(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;external ;
+function XMaskEvent(_para1 : PDisplay;_para2 : longint;_para3 : PXEvent) : longint; cdecl;external ;
+function XMaxCmapsOfScreen(_para1 : PScreen) : longint; cdecl;external ;
+function XMinCmapsOfScreen(_para1 : PScreen) : longint; cdecl;external ;
+function XMoveResizeWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : longint;_para5 : cardinal;_para6 : cardinal) : longint; cdecl;external ;
+function XMoveWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : longint) : longint; cdecl;external ;
+function XNextEvent(_para1 : PDisplay;_para2 : PXEvent) : longint; cdecl;external ;
+function XNoOp(_para1 : PDisplay) : longint; cdecl;external ;
+function XParseColor(_para1 : PDisplay;_para2 : TColormap;_para3 : pchar;_para4 : PXColor) : TStatus; cdecl;external ;
+function XParseGeometry(_para1 : pchar;_para2 : Plongint;_para3 : Plongint;_para4 : PCardinal;_para5 : PCardinal) : longint; cdecl;external ;
+function XPeekEvent(_para1 : PDisplay;_para2 : PXEvent) : longint; cdecl;external ;
+{
+function XPeekIfEvent(_para1 : PDisplay;_para2 : PXEvent;_para3 : function(_para1 : PDisplay;_para2 : PXEvent;_para3 : XPointer) : TBool;_para4 : XPointer) : longint; cdecl;external ;
+}
+function XPending(_para1 : PDisplay) : longint; cdecl;external ;
+function XPlanesOfScreen(_para1 : PScreen) : longint; cdecl;external ;
+function XProtocolRevision(_para1 : PDisplay) : longint; cdecl;external ;
+function XProtocolVersion(_para1 : PDisplay) : longint; cdecl;external ;
+function XPutBackEvent(_para1 : PDisplay;_para2 : PXEvent) : longint; cdecl;external ;
+function XPutImage(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : PXImage;_para5 : longint;_para6 : longint;_para7 : longint;_para8 : longint;_para9 : cardinal;_para10 : cardinal) : longint; cdecl;external ;
+function XQLength(_para1 : PDisplay) : longint; cdecl;external ;
+function XQueryBestCursor(_para1 : PDisplay;_para2 : TDrawable;_para3 : cardinal;_para4 : cardinal;_para5 : PCardinal;_para6 : PCardinal) : TStatus; cdecl;external ;
+function XQueryBestSize(_para1 : PDisplay;_para2 : longint;_para3 : TDrawable;_para4 : cardinal;_para5 : cardinal;_para6 : PCardinal;_para7 : PCardinal) : TStatus; cdecl;external ;
+function XQueryBestStipple(_para1 : PDisplay;_para2 : TDrawable;_para3 : cardinal;_para4 : cardinal;_para5 : PCardinal;_para6 : PCardinal) : TStatus; cdecl;external ;
+function XQueryBestTile(_para1 : PDisplay;_para2 : TDrawable;_para3 : cardinal;_para4 : cardinal;_para5 : PCardinal;_para6 : PCardinal) : TStatus; cdecl;external ;
+function XQueryColor(_para1 : PDisplay;_para2 : TColormap;_para3 : PXColor) : longint; cdecl;external ;
+function XQueryColors(_para1 : PDisplay;_para2 : TColormap;_para3 : PXColor;_para4 : longint) : longint; cdecl;external ;
+function XQueryExtension(_para1 : PDisplay;_para2 : pchar;_para3 : Plongint;_para4 : Plongint;_para5 : Plongint) : TBool; cdecl;external ;
+{
+function XQueryKeymap(_para1 : PDisplay;_para2 : arraycdecl;external ;
+}
+function XQueryPointer(_para1 : PDisplay;_para2 : TWindow;_para3 : PWindow;_para4 : PWindow;_para5 : Plongint;_para6 : Plongint;_para7 : Plongint;_para8 : Plongint;_para9 : PCardinal) : TBool; cdecl;external ;
+function XQueryTextExtents(_para1 : PDisplay;_para2 : TXID;_para3 : pchar;_para4 : longint;_para5 : Plongint;_para6 : Plongint;_para7 : Plongint;_para8 : PXCharStruct) : longint; cdecl;external ;
+function XQueryTextExtents16(_para1 : PDisplay;_para2 : TXID;_para3 : PXChar2b;_para4 : longint;_para5 : Plongint;_para6 : Plongint;_para7 : Plongint;_para8 : PXCharStruct) : longint; cdecl;external ;
+function XQueryTree(_para1 : PDisplay;_para2 : TWindow;_para3 : PWindow;_para4 : PWindow;_para5 : PPWindow;_para6 : PCardinal) : TStatus; cdecl;external ;
+function XRaiseWindow(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;external ;
+function XReadBitmapFile(_para1 : PDisplay;_para2 : TDrawable;_para3 : pchar;_para4 : PCardinal;_para5 : PCardinal;_para6 : PPixmap;_para7 : Plongint;_para8 : Plongint) : longint; cdecl;external ;
+function XReadBitmapFileData(_para1 : pchar;_para2 : PCardinal;_para3 : PCardinal;_para4 : PPChar;_para5 : Plongint;_para6 : Plongint) : longint; cdecl;external ;
+function XRebindKeysym(_para1 : PDisplay;_para2 : TKeySym;_para3 : PKeySym;_para4 : longint;_para5 : pchar;_para6 : longint) : longint; cdecl;external ;
+function XRecolorCursor(_para1 : PDisplay;_para2 : TCursor;_para3 : PXColor;_para4 : PXColor) : longint; cdecl;external ;
+function XRefreshKeyboardMapping(_para1 : PXMappingEvent) : longint; cdecl;external ;
+function XRemoveFromSaveSet(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;external ;
+function XRemoveHost(_para1 : PDisplay;_para2 : PXHostAddress) : longint; cdecl;external ;
+function XRemoveHosts(_para1 : PDisplay;_para2 : PXHostAddress;_para3 : longint) : longint; cdecl;external ;
+function XReparentWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : TWindow;_para4 : longint;_para5 : longint) : longint; cdecl;external ;
+function XResetScreenSaver(_para1 : PDisplay) : longint; cdecl;external ;
+function XResizeWindow(_para1 : PDisplay;_para2 : TWindow;_para3 : cardinal;_para4 : cardinal) : longint; cdecl;external ;
+function XRestackWindows(_para1 : PDisplay;_para2 : PWindow;_para3 : longint) : longint; cdecl;external ;
+function XRotateBuffers(_para1 : PDisplay;_para2 : longint) : longint; cdecl;external ;
+function XRotateWindowProperties(_para1 : PDisplay;_para2 : TWindow;_para3 : PAtom;_para4 : longint;_para5 : longint) : longint; cdecl;external ;
+function XScreenCount(_para1 : PDisplay) : longint; cdecl;external ;
+function XSelectInput(_para1 : PDisplay;_para2 : TWindow;_para3 : longint) : longint; cdecl;external ;
+function XSendEvent(_para1 : PDisplay;_para2 : TWindow;_para3 : TBool;_para4 : longint;_para5 : PXEvent) : TStatus; cdecl;external ;
+function XSetAccessControl(_para1 : PDisplay;_para2 : longint) : longint; cdecl;external ;
+function XSetArcMode(_para1 : PDisplay;_para2 : TGC;_para3 : longint) : longint; cdecl;external ;
+function XSetBackground(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal) : longint; cdecl;external ;
+function XSetClipMask(_para1 : PDisplay;_para2 : TGC;_para3 : TPixmap) : longint; cdecl;external ;
+function XSetClipOrigin(_para1 : PDisplay;_para2 : TGC;_para3 : longint;_para4 : longint) : longint; cdecl;external ;
+function XSetClipRectangles(_para1 : PDisplay;_para2 : TGC;_para3 : longint;_para4 : longint;_para5 : PXRectangle;_para6 : longint;_para7 : longint) : longint; cdecl;external ;
+function XSetCloseDownMode(_para1 : PDisplay;_para2 : longint) : longint; cdecl;external ;
+function XSetCommand(_para1 : PDisplay;_para2 : TWindow;_para3 : PPChar;_para4 : longint) : longint; cdecl;external ;
+function XSetDashes(_para1 : PDisplay;_para2 : TGC;_para3 : longint;_para4 : pchar;_para5 : longint) : longint; cdecl;external ;
+function XSetFillRule(_para1 : PDisplay;_para2 : TGC;_para3 : longint) : longint; cdecl;external ;
+function XSetFillStyle(_para1 : PDisplay;_para2 : TGC;_para3 : longint) : longint; cdecl;external ;
+function XSetFont(_para1 : PDisplay;_para2 : TGC;_para3 : TFont) : longint; cdecl;external ;
+function XSetFontPath(_para1 : PDisplay;_para2 : PPChar;_para3 : longint) : longint; cdecl;external ;
+function XSetForeground(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal) : longint; cdecl;external ;
+function XSetFunction(_para1 : PDisplay;_para2 : TGC;_para3 : longint) : longint; cdecl;external ;
+function XSetGraphicsExposures(_para1 : PDisplay;_para2 : TGC;_para3 : TBool) : longint; cdecl;external ;
+function XSetIconName(_para1 : PDisplay;_para2 : TWindow;_para3 : pchar) : longint; cdecl;external ;
+function XSetInputFocus(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : TTime) : longint; cdecl;external ;
+function XSetLineAttributes(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal;_para4 : longint;_para5 : longint;_para6 : longint) : longint; cdecl;external ;
+function XSetModifierMapping(_para1 : PDisplay;_para2 : PXModifierKeymap) : longint; cdecl;external ;
+function XSetPlaneMask(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal) : longint; cdecl;external ;
+function XSetPointerMapping(_para1 : PDisplay;_para2 : pchar;_para3 : longint) : longint; cdecl;external ;
+function XSetScreenSaver(_para1 : PDisplay;_para2 : longint;_para3 : longint;_para4 : longint;_para5 : longint) : longint; cdecl;external ;
+function XSetSelectionOwner(_para1 : PDisplay;_para2 : TAtom;_para3 : TWindow;_para4 : TTime) : longint; cdecl;external ;
+function XSetState(_para1 : PDisplay;_para2 : TGC;_para3 : cardinal;_para4 : cardinal;_para5 : longint;_para6 : cardinal) : longint; cdecl;external ;
+function XSetStipple(_para1 : PDisplay;_para2 : TGC;_para3 : TPixmap) : longint; cdecl;external ;
+function XSetSubwindowMode(_para1 : PDisplay;_para2 : TGC;_para3 : longint) : longint; cdecl;external ;
+function XSetTSOrigin(_para1 : PDisplay;_para2 : TGC;_para3 : longint;_para4 : longint) : longint; cdecl;external ;
+function XSetTile(_para1 : PDisplay;_para2 : TGC;_para3 : TPixmap) : longint; cdecl;external ;
+function XSetWindowBackground(_para1 : PDisplay;_para2 : TWindow;_para3 : cardinal) : longint; cdecl;external ;
+function XSetWindowBackgroundPixmap(_para1 : PDisplay;_para2 : TWindow;_para3 : TPixmap) : longint; cdecl;external ;
+function XSetWindowBorder(_para1 : PDisplay;_para2 : TWindow;_para3 : cardinal) : longint; cdecl;external ;
+function XSetWindowBorderPixmap(_para1 : PDisplay;_para2 : TWindow;_para3 : TPixmap) : longint; cdecl;external ;
+function XSetWindowBorderWidth(_para1 : PDisplay;_para2 : TWindow;_para3 : cardinal) : longint; cdecl;external ;
+function XSetWindowColormap(_para1 : PDisplay;_para2 : TWindow;_para3 : TColormap) : longint; cdecl;external ;
+function XStoreBuffer(_para1 : PDisplay;_para2 : pchar;_para3 : longint;_para4 : longint) : longint; cdecl;external ;
+function XStoreBytes(_para1 : PDisplay;_para2 : pchar;_para3 : longint) : longint; cdecl;external ;
+function XStoreColor(_para1 : PDisplay;_para2 : TColormap;_para3 : PXColor) : longint; cdecl;external ;
+function XStoreColors(_para1 : PDisplay;_para2 : TColormap;_para3 : PXColor;_para4 : longint) : longint; cdecl;external ;
+function XStoreName(_para1 : PDisplay;_para2 : TWindow;_para3 : pchar) : longint; cdecl;external ;
+function XStoreNamedColor(_para1 : PDisplay;_para2 : TColormap;_para3 : pchar;_para4 : cardinal;_para5 : longint) : longint; cdecl;external ;
+function XSync(_para1 : PDisplay;_para2 : TBool) : longint; cdecl;external ;
+function XTextExtents(_para1 : PXFontStruct;_para2 : pchar;_para3 : longint;_para4 : Plongint;_para5 : Plongint;_para6 : Plongint;_para7 : PXCharStruct) : longint; cdecl;external ;
+function XTextExtents16(_para1 : PXFontStruct;_para2 : PXChar2b;_para3 : longint;_para4 : Plongint;_para5 : Plongint;_para6 : Plongint;_para7 : PXCharStruct) : longint; cdecl;external ;
+function XTextWidth(_para1 : PXFontStruct;_para2 : pchar;_para3 : longint) : longint; cdecl;external ;
+function XTextWidth16(_para1 : PXFontStruct;_para2 : PXChar2b;_para3 : longint) : longint; cdecl;external ;
+function XTranslateCoordinates(_para1 : PDisplay;_para2 : TWindow;_para3 : TWindow;_para4 : longint;_para5 : longint;_para6 : Plongint;_para7 : Plongint;_para8 : PWindow) : TBool; cdecl;external ;
+function XUndefineCursor(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;external ;
+function XUngrabButton(_para1 : PDisplay;_para2 : cardinal;_para3 : cardinal;_para4 : TWindow) : longint; cdecl;external ;
+function XUngrabKey(_para1 : PDisplay;_para2 : longint;_para3 : cardinal;_para4 : TWindow) : longint; cdecl;external ;
+function XUngrabKeyboard(_para1 : PDisplay;_para2 : TTime) : longint; cdecl;external ;
+function XUngrabPointer(_para1 : PDisplay;_para2 : TTime) : longint; cdecl;external ;
+function XUngrabServer(_para1 : PDisplay) : longint; cdecl;external ;
+function XUninstallColormap(_para1 : PDisplay;_para2 : TColormap) : longint; cdecl;external ;
+function XUnloadFont(_para1 : PDisplay;_para2 : TFont) : longint; cdecl;external ;
+function XUnmapSubwindows(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;external ;
+function XUnmapWindow(_para1 : PDisplay;_para2 : TWindow) : longint; cdecl;external ;
+function XVendorRelease(_para1 : PDisplay) : longint; cdecl;external ;
+function XWarpPointer(_para1 : PDisplay;_para2 : TWindow;_para3 : TWindow;_para4 : longint;_para5 : longint;_para6 : cardinal;_para7 : cardinal;_para8 : longint;_para9 : longint) : longint; cdecl;external ;
+function XWidthMMOfScreen(_para1 : PScreen) : longint; cdecl;external ;
+function XWidthOfScreen(_para1 : PScreen) : longint; cdecl;external ;
+function XWindowEvent(_para1 : PDisplay;_para2 : TWindow;_para3 : longint;_para4 : PXEvent) : longint; cdecl;external ;
+function XWriteBitmapFile(_para1 : PDisplay;_para2 : pchar;_para3 : TPixmap;_para4 : cardinal;_para5 : cardinal;_para6 : longint;_para7 : longint) : longint; cdecl;external ;
+function XSupportsLocale : TBool; cdecl;external ;
+function XSetLocaleModifiers(_para1 : pchar) : pchar; cdecl;external ;
+{
+function XOpenOM(_para1 : PDisplay;_para2 : ^*;_para3 : pchar;_para4 : pchar) : TXOM; cdecl;external ;
+}
+function XCloseOM(_para1 : TXOM) : TStatus; cdecl;external ;
+function XDisplayOfOM(_para1 : TXOM) : PDisplay; cdecl;external ;
+function XLocaleOfOM(_para1 : TXOM) : pchar; cdecl;external ;
+procedure XDestroyOC(_para1 : TXOC); cdecl;external ;
+function TXOMOfOC(_para1 : TXOC) : TXOM; cdecl;external ;
+function XCreateFontSet(_para1 : PDisplay;_para2 : pchar;_para3 : PPPChar;_para4 : Plongint;_para5 : PPChar) : TXFontSet; cdecl;external ;
+procedure XFreeFontSet(_para1 : PDisplay;_para2 : TXFontSet); cdecl;external ;
+function XFontsOfFontSet(_para1 : TXFontSet;_para2 : PPPXFontStruct;_para3 : PPPChar) : longint; cdecl;external ;
+function XBaseFontNameListOfFontSet(_para1 : TXFontSet) : pchar; cdecl;external ;
+function XLocaleOfFontSet(_para1 : TXFontSet) : pchar; cdecl;external ;
+function XContextDependentDrawing(_para1 : TXFontSet) : TBool; cdecl;external ;
+function XDirectionalDependentDrawing(_para1 : TXFontSet) : TBool; cdecl;external ;
+function XContextualDrawing(_para1 : TXFontSet) : TBool; cdecl;external ;
+function XExtentsOfFontSet(_para1 : TXFontSet) : PXFontSetExtents; cdecl;external ;
+function XmbTextEscapement(_para1 : TXFontSet;_para2 : pchar;_para3 : longint) : longint; cdecl;external ;
+function XwcTextEscapement(_para1 : TXFontSet;_para2 : Pwchar_t;_para3 : longint) : longint; cdecl;external ;
+function XmbTextExtents(_para1 : TXFontSet;_para2 : pchar;_para3 : longint;_para4 : PXRectangle;_para5 : PXRectangle) : longint; cdecl;external ;
+function XwcTextExtents(_para1 : TXFontSet;_para2 : Pwchar_t;_para3 : longint;_para4 : PXRectangle;_para5 : PXRectangle) : longint; cdecl;external ;
+function XmbTextPerCharExtents(_para1 : TXFontSet;_para2 : pchar;_para3 : longint;_para4 : PXRectangle;_para5 : PXRectangle;_para6 : longint;_para7 : Plongint;_para8 : PXRectangle;_para9 : PXRectangle) : TStatus; cdecl;external ;
+function XwcTextPerCharExtents(_para1 : TXFontSet;_para2 : Pwchar_t;_para3 : longint;_para4 : PXRectangle;_para5 : PXRectangle;_para6 : longint;_para7 : Plongint;_para8 : PXRectangle;_para9 : PXRectangle) : TStatus; cdecl;external ;
+procedure XmbDrawText(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : PXmbTextItem;_para7 : longint); cdecl;external ;
+procedure XwcDrawText(_para1 : PDisplay;_para2 : TDrawable;_para3 : TGC;_para4 : longint;_para5 : longint;_para6 : PXwcTextItem;_para7 : longint); cdecl;external ;
+procedure XmbDrawString(_para1 : PDisplay;_para2 : TDrawable;_para3 : TXFontSet;_para4 : TGC;_para5 : longint;_para6 : longint;_para7 : pchar;_para8 : longint); cdecl;external ;
+procedure XwcDrawString(_para1 : PDisplay;_para2 : TDrawable;_para3 : TXFontSet;_para4 : TGC;_para5 : longint;_para6 : longint;_para7 : Pwchar_t;_para8 : longint); cdecl;external ;
+procedure XmbDrawImageString(_para1 : PDisplay;_para2 : TDrawable;_para3 : TXFontSet;_para4 : TGC;_para5 : longint;_para6 : longint;_para7 : pchar;_para8 : longint); cdecl;external ;
+procedure XwcDrawImageString(_para1 : PDisplay;_para2 : TDrawable;_para3 : TXFontSet;_para4 : TGC;_para5 : longint;_para6 : longint;_para7 : Pwchar_t;_para8 : longint); cdecl;external ;
+{
+function XOpenIM(_para1 : PDisplay;_para2 : P*;_para3 : pchar;_para4 : pchar) : TXIM; cdecl;external ;
+}
+function XCloseIM(_para1 : TXIM) : TStatus; cdecl;external ;
+function XDisplayOfIM(_para1 : TXIM) : PDisplay; cdecl;external ;
+function XLocaleOfIM(_para1 : TXIM) : pchar; cdecl;external ;
+procedure XDestroyIC(_para1 : TXIC); cdecl;external ;
+procedure XSetICFocus(_para1 : TXIC); cdecl;external ;
+procedure XUnsetICFocus(_para1 : TXIC); cdecl;external ;
+function XwcResetIC(_para1 : TXIC) : Pwchar_t; cdecl;external ;
+function XmbResetIC(_para1 : TXIC) : pchar; cdecl;external ;
+function TXIMOfIC(_para1 : TXIC) : TXIM; cdecl;external ;
+function XFilterEvent(_para1 : PXEvent;_para2 : TWindow) : TBool; cdecl;external ;
+function XmbLookupString(_para1 : TXIC;_para2 : PXKeyPressedEvent;_para3 : pchar;_para4 : longint;_para5 : PKeySym;_para6 : PStatus) : longint; cdecl;external ;
+function XwcLookupString(_para1 : TXIC;_para2 : PXKeyPressedEvent;_para3 : Pwchar_t;_para4 : longint;_para5 : PKeySym;_para6 : PStatus) : longint; cdecl;external ;
+{
+function XRegisterIMInstantiateCallback(_para1 : PDisplay;_para2 : P*;_para3 : pchar;_para4 : pchar;_para5 : TXIMProc;_para6 : PXPointer) : TBool; cdecl;external ;
+function XUnregisterIMInstantiateCallback(_para1 : PDisplay;_para2 : P*;_para3 : pchar;_para4 : pchar;_para5 : TXIMProc;_para6 : PXPointer) : TBool; cdecl;external ;
+}
+function XInternalConnectionNumbers(_para1 : PDisplay;_para2 : PPlongint;_para3 : Plongint) : TStatus; cdecl;external ;
+procedure XProcessInternalConnection(_para1 : PDisplay;_para2 : longint); cdecl;external ;
+function XAddConnectionWatch(_para1 : PDisplay;_para2 : TXConnectionWatchProc;_para3 : TXPointer) : TStatus; cdecl;external ;
+procedure XRemoveConnectionWatch(_para1 : PDisplay;_para2 : TXConnectionWatchProc;_para3 : TXPointer); cdecl;external ;
+
+
+begin
+end.

+ 457 - 0
packages/x11/xresource.pp

@@ -0,0 +1,457 @@
+unit xresource;
+
+interface
+
+uses xlib;
+
+
+{***************************************************************
+ *
+ * Quark Management
+ *
+ ***************************************************************}
+
+type 
+ TXrmQuark     = Integer;
+ PXrmQuark     = ^TXrmQuark;
+ TXrmQuarkList = PXrmQuark;
+  
+  
+ Const NULLQUARK = 0 ;
+
+type  TXrmString = Pchar;
+
+const NULLSTRING = 0;
+
+{ find quark for string, create new quark if none already exists }
+Function XrmStringToQuark( p1 : pchar ) : TXrmQuark;cdecl;
+
+Function  XrmPermStringToQuark( p1 : pchar ) : TXrmQuark;cdecl;
+
+{ find string for quark }
+Function XrmQuarkToString( p1 : TXrmQuark) : TXrmString;cdecl;
+
+
+Function  XrmUniqueQuark : TXrmQuark;cdecl;
+
+{
+#define XrmStringsEqual(a1, a2) (strcmp(a1, a2) == 0)
+}
+
+{***************************************************************
+ *
+ * Conversion of Strings to Lists
+ *
+ ***************************************************************}
+
+type
+ TXrmBinding = integer;
+ TXrmBindingList = ^Integer;
+  Const XrmBindTightly = 0;
+        XrmBindLoosely = 1;
+
+procedure XrmStringToQuarkList(
+    p1 : pchar	{ string };
+    p2 : TXrmQuarkList	{ quarks_return }
+);cdecl;
+
+procedure XrmStringToBindingQuarkList(
+    p1 : pchar	{ string };
+    p2 : TXrmBindingList	{ bindings_return };
+    p3 : TXrmQuarkList	{ quarks_return }
+);cdecl;
+
+{***************************************************************
+ *
+ * Name and Class lists.
+ *
+ ***************************************************************}
+
+type TXrmName = TXrmQuark;
+    TXrmNameList = TXrmQuarkList ;
+ {
+#define XrmNameToString(name)		XrmQuarkToString(name)
+#define XrmStringToName(string)		XrmStringToQuark(string)
+#define XrmStringToNameList(str, name)	XrmStringToQuarkList(str, name)
+}
+ TXrmClass = TXrmQuark;
+ TXrmClassList = TXrmQuarkList;
+{
+#define XrmClassToString(c_class)	XrmQuarkToString(c_class)
+#define XrmStringToClass(c_class)	XrmStringToQuark(c_class)
+#define XrmStringToClassList(str,c_class) XrmStringToQuarkList(str, c_class)
+}
+
+
+{***************************************************************
+ *
+ * Resource Representation Types and Values
+ *
+ ***************************************************************}
+
+type  TXrmRepresentation = TXrmQuark    ;
+      PXrmRepresentation = ^TXrmRepresentation;
+{
+#define XrmStringToRepresentation(string)   XrmStringToQuark(string)
+#define	XrmRepresentationToString(type)   XrmQuarkToString(type)
+}
+
+type TXrmValue = record
+    size : word;
+    theaddr : TXPointer;
+end;
+  PXrmValue = ^TXrmValue;
+  TXrmValuePtr = PXrmValue;
+
+
+{***************************************************************
+ *
+ * Resource Manager Functions
+ *
+ ***************************************************************}
+{
+typedef struct _XrmHashBucketRec *XrmHashBucket;
+typedef XrmHashBucket *XrmHashTable;
+typedef XrmHashTable XrmSearchList[];
+typedef struct _XrmHashBucketRec *XrmDatabase;
+}
+Type TXrmHashBucket = pointer;
+     TXrmHashTable = ^TXrmHashBucket;
+     TXrmSearchList = ^TXrmHashTable;
+     TXrmDatabase = pointer;
+     PXrmDatabase = ^TXrmDatabase;
+     
+procedure XrmDestroyDatabase(
+    p1 : TXrmDatabase		{ database }    
+);cdecl;
+
+Procedure XrmQPutResource(
+    p1 :  PXrmDatabase	{ database };
+    p2 : TXrmBindingList	{ bindings };
+    p3 : TXrmQuarkList	{ quarks };
+    p4 : TXrmRepresentation	{ type };
+    p5 : PXrmValue		{ value }
+);cdecl;
+
+Procedure  XrmPutResource(
+    p1 : PXrmDatabase	{ database };
+    p2 : pchar	{ specifier };
+    p3 : pchar	{ type };
+    p4 : PXrmValue		{ value }
+);cdecl;
+
+Procedure  XrmQPutStringResource(
+    p1 : PXrmDatabase	{ database };
+    p2 : TXrmBindingList      { bindings };
+    p3 : TXrmQuarkList	{ quarks };
+    p4 : Pchar	{ value }
+);cdecl;
+
+Procedure XrmPutStringResource(
+    P1 : PXrmDatabase	{ database };
+    p2,p3 : pchar
+);cdecl;
+
+Procedure XrmPutLineResource(
+    p1 : PXrmDatabase	{ database };
+    p2 : pchar	{ line }
+);cdecl;
+
+Function XrmQGetResource(
+    p1 : PXrmDatabase		{ database };
+    p2 : TXrmNameList		{ quark_name };
+    p3 : TXrmClassList	{ quark_class };
+    p4 : PXrmRepresentation	{ quark_type_return };
+    p5 : PXrmValue		{ value_return }
+) : Integer;cdecl;
+
+Function XrmGetResource(
+    p1 : TXrmDatabase		{ database };
+    p2 : pchar	{ str_name };
+    p3 : pchar	{ str_class };
+    p4 : ppchar		{ str_type_return };
+    p5 : PXrmValue		{ value_return }
+) : Tbool;cdecl;
+
+Function XrmQGetSearchList(
+    p1 : TXrmDatabase		{ database };
+    p2 : TXrmNameList		{ names };
+    p3 : TXrmClassList	{ classes };
+    p4 : TXrmSearchList	{ list_return };
+    p5 : integer			{ list_length }
+) : Tbool;cdecl;
+
+Function XrmQGetSearchResource(
+    P1 : TXrmSearchList	{ list };
+    p2 : TXrmName		{ name };
+    p3 : TXrmClass		{ class };
+    p4 : PXrmRepresentation	{ type_return };
+    p5 : PXrmValue		{ value_return }
+) : TBool;cdecl;
+
+{***************************************************************
+ *
+ * Resource Database Management
+ *
+ ***************************************************************}
+
+procedure XrmSetDatabase(
+    p1 : PDisplay		{ display };
+    p2 : TXrmDatabase		{ database }
+);cdecl;
+
+Function  XrmGetDatabase(
+    p1 : PDisplay		{ display }
+) : TXrmDatabase;cdecl;
+
+Function XrmGetFileDatabase(
+    p1 : pchar	{ filename }
+) : TXrmDatabase ;cdecl;
+
+Function XrmCombineFileDatabase(
+    p1 : pchar 	{ filename };
+    p2 : PXrmDatabase	{ target };
+    p3 : TBool		{ override }
+) : TStatus ;cdecl;
+
+function XrmGetStringDatabase(
+    p1 : pchar	{ data }  {  null terminated string }
+) : TXrmDatabase ;cdecl;
+
+Procedure XrmPutFileDatabase(
+    p1 : TXrmDatabase		{ database };
+    p2: pchar	{ filename }
+);cdecl;
+
+Procedure XrmMergeDatabases(
+    p1 : TXrmDatabase		{ source_db };
+    p2 : PXrmDatabase	{ target_db }
+);cdecl;
+
+procedure XrmCombineDatabase(
+    p1 : TXrmDatabase		{ source_db };
+    p2 : PXrmDatabase	{ target_db };
+    p3 : TBool		{ override }
+);cdecl;
+
+const
+ XrmEnumAllLevels = 0;
+ XrmEnumOneLevel  = 1;
+{
+Function XrmEnumerateDatabase(
+    XrmDatabase		{ db };
+    XrmNameList		{ name_prefix };
+    XrmClassList	{ class_prefix };
+    int			{ mode };
+    Bool (*)(#if NeedNestedPrototypes
+	     XrmDatabase*	{ db };
+	     XrmBindingList	{ bindings };
+	     XrmQuarkList	{ quarks };
+	     XrmRepresentation*	{ type };
+	     XrmValue*		{ value };
+	     XPointer		{ closure }
+
+	     )		{ proc };
+    XPointer		{ closure }
+) : TBool;
+}
+
+Function XrmLocaleOfDatabase(
+    P1 : TXrmDatabase 	{ database }
+) : Pchar;cdecl;
+
+
+{***************************************************************
+ *
+ * Command line option mapping to resource entries
+ *
+ ***************************************************************}
+
+Const
+    XrmoptionNoArg = 0;	{ Value is specified in OptionDescRec.value	    }
+    XrmoptionIsArg = 1;     { Value is the option string itself		    }
+    XrmoptionStickyArg = 2; { Value is characters immediately following option }
+    XrmoptionSepArg = 3;    { Value is next argument in argv		    }
+    XrmoptionResArg = 4;	{ Resource and value in next argument in argv      }
+    XrmoptionSkipArg = 5;   { Ignore this option and the next argument in argv }
+    XrmoptionSkipLine = 6;  { Ignore this option and the rest of argv	    }
+    XrmoptionSkipNArgs = 7;	{ Ignore this option and the next 
+			   OptionDescRes.value arguments in argv }
+Type TXrmOptionKind = Integer;
+
+TXrmOptionDescRec = record
+    option : pchar;	    { Option abbreviation in argv	    }
+    specifier : pchar;     { Resource specifier		    }
+    argKind : TXrmOptionKind;	    { Which style of option it is	    }
+    value : TXpointer;	    { Value to provide if XrmoptionNoArg   }
+end;
+PXrmOptionDescRec= ^TXrmOptionDescRec; 
+TXrmOptionDescList = PXrmOptionDescRec;
+
+
+Procedure XrmParseCommand(
+    p1 : TXrmDatabase	{ database };
+    p2 : TXrmOptionDescList	{ table };
+    p3 : integer			{ table_count };
+    p4 : pchar	{ name };
+    p5 : Pointer		{ argc_in_out };
+    p6 : ppchar		{ argv_in_out }		     
+);cdecl;
+
+Implementation
+
+Function XrmStringToQuark( p1 : pchar ) : TXrmQuark; cdecl; external;
+Function XrmPermStringToQuark( p1 : pchar ) : TXrmQuark; cdecl; external;
+Function XrmQuarkToString( p1 : TXrmQuark) : TXrmString; cdecl; external;
+
+Function  XrmUniqueQuark : TXrmQuark; cdecl; external;
+procedure XrmStringToQuarkList(
+    p1 : pchar	{ string };
+    p2 : TXrmQuarkList	{ quarks_return }
+); cdecl; external;
+
+procedure XrmStringToBindingQuarkList(
+    p1 : pchar	{ string };
+    p2 : TXrmBindingList	{ bindings_return };
+    p3 : TXrmQuarkList	{ quarks_return }
+); cdecl; external;
+procedure XrmDestroyDatabase(
+    p1 : TXrmDatabase		{ database }    
+); cdecl; external;
+
+Procedure XrmQPutResource(
+    p1 :  PXrmDatabase	{ database };
+    p2 : TXrmBindingList	{ bindings };
+    p3 : TXrmQuarkList	{ quarks };
+    p4 : TXrmRepresentation	{ type };
+    p5 : PXrmValue		{ value }
+); cdecl; external;
+
+Procedure  XrmPutResource(
+    p1 : PXrmDatabase	{ database };
+    p2 : pchar	{ specifier };
+    p3 : pchar	{ type };
+    p4 : PXrmValue		{ value }
+); cdecl; external;
+
+Procedure  XrmQPutStringResource(
+    p1 : PXrmDatabase	{ database };
+    p2 : TXrmBindingList      { bindings };
+    p3 : TXrmQuarkList	{ quarks };
+    p4 : Pchar	{ value }
+); cdecl; external;
+
+procedure XrmPutStringResource(
+    P1 : PXrmDatabase	{ database };
+    p2,p3 : pchar
+); cdecl; external;
+
+Procedure XrmPutLineResource(
+    p1 : PXrmDatabase	{ database };
+    p2 : pchar	{ line }
+); cdecl; external;
+
+Function XrmQGetResource(
+    p1 : PXrmDatabase		{ database };
+    p2 : TXrmNameList		{ quark_name };
+    p3 : TXrmClassList	{ quark_class };
+    p4 : PXrmRepresentation	{ quark_type_return };
+    p5 : PXrmValue		{ value_return }
+) : Integer;  cdecl; external;
+
+Function XrmGetResource(
+    p1 : TXrmDatabase		{ database };
+    p2 : pchar	{ str_name };
+    p3 : pchar	{ str_class };
+    p4 : ppchar		{ str_type_return };
+    p5 : PXrmValue		{ value_return }
+) : Tbool; cdecl; external;
+
+Function XrmQGetSearchList(
+    p1 : TXrmDatabase		{ database };
+    p2 : TXrmNameList		{ names };
+    p3 : TXrmClassList	{ classes };
+    p4 : TXrmSearchList	{ list_return };
+    p5 : integer			{ list_length }
+) : Tbool; cdecl; external;
+
+Function XrmQGetSearchResource(
+    P1 : TXrmSearchList	{ list };
+    p2 : TXrmName		{ name };
+    p3 : TXrmClass		{ class };
+    p4 : PXrmRepresentation	{ type_return };
+    p5 : PXrmValue		{ value_return }
+) : TBool; cdecl; external;
+
+procedure XrmSetDatabase(
+    p1 : PDisplay		{ display };
+    p2 : TXrmDatabase		{ database }
+);  cdecl; external;
+
+Function  XrmGetDatabase(
+    p1 : PDisplay		{ display }
+) : TXrmDatabase; cdecl; external;
+
+Function XrmGetFileDatabase(
+    p1 : pchar	{ filename }
+) : TXrmDatabase ;  cdecl; external;
+
+Function XrmCombineFileDatabase(
+    p1 : pchar 	{ filename };
+    p2 : PXrmDatabase	{ target };
+    p3 : TBool		{ override }
+) : TStatus ;  cdecl; external;
+
+function XrmGetStringDatabase(
+    p1 : pchar	{ data }  {  null terminated string }
+) : TXrmDatabase ;  cdecl; external;
+
+Procedure XrmPutFileDatabase(
+    p1 : TXrmDatabase		{ database };
+    p2: pchar	{ filename }
+); cdecl; external;
+
+Procedure XrmMergeDatabases(
+    p1 : TXrmDatabase		{ source_db };
+    p2 : PXrmDatabase	{ target_db }
+); cdecl; external;
+
+procedure XrmCombineDatabase(
+    p1 : TXrmDatabase		{ source_db };
+    p2 : PXrmDatabase	{ target_db };
+    p3 : TBool		{ override }
+);  cdecl; external;
+
+{
+Function XrmEnumerateDatabase(
+    XrmDatabase		{ db };
+    XrmNameList		{ name_prefix };
+    XrmClassList	{ class_prefix };
+    int			{ mode };
+    Bool (*)(#if NeedNestedPrototypes
+	     XrmDatabase*	{ db };
+	     XrmBindingList	{ bindings };
+	     XrmQuarkList	{ quarks };
+	     XrmRepresentation*	{ type };
+	     XrmValue*		{ value };
+	     XPointer		{ closure }
+
+	     )		{ proc };
+    XPointer		{ closure }
+) : TBool; cdecl; external;
+}
+
+Function XrmLocaleOfDatabase(
+    P1 : TXrmDatabase 	{ database }
+) : Pchar; cdecl; external;
+
+Procedure XrmParseCommand(
+    p1 : TXrmDatabase	{ database };
+    p2 : TXrmOptionDescList	{ table };
+    p3 : integer			{ table_count };
+    p4 : pchar	{ name };
+    p5 : Pointer		{ argc_in_out };
+    p6 : ppchar		{ argv_in_out }		     
+); cdecl; external;
+
+end.

+ 893 - 0
packages/x11/xutil.pp

@@ -0,0 +1,893 @@
+Unit XUtil;
+
+interface
+
+uses x,xlib;
+
+{ You must include <X11/Xlib.h> before including this file }
+
+{ 
+ * Bitmask returned by XParseGeometry().  Each bit tells if the corresponding
+ * value (x, y, width, height) was found in the parsed string.
+ }
+Const
+ NoValue	=$0000;
+ XValue  	=$0001;
+ YValue		=$0002;
+ WidthValue  	=$0004;
+ HeightValue  	=$0008;
+ AllValues 	=$000F;
+ XNegative 	=$0010;
+ YNegative 	=$0020;
+
+{
+ * new version containing base_width, base_height, and win_gravity fields;
+ * used with WM_NORMAL_HINTS.
+ }
+Type
+ long = Cardinal; { Untill we know better. M.}
+
+Type 
+TAspectRecord = record
+    x,y : integer;
+    end;
+
+TXSizeHints = record
+    	flags : Long;	{ marks which fields in this structure are defined }
+	x, y : Integer ;		{ obsolete for new window mgrs, but clients }
+	width, height: Integer ;	{ should set so old wm's don't mess up }
+	min_width, min_height : Integer ;
+	max_width, max_height : Integer ;
+    	width_inc, height_inc : Integer ;
+	min_aspect, max_aspect : TAspectRecord;
+	base_width, base_height : Integer ;		{ added by ICCCM version 1 }
+	win_gravity : Integer ;			{ added by ICCCM version 1 }
+end;
+PXSizeHints=^TXSizeHints;
+
+{
+ * The next block of definitions are for window manager properties that
+ * clients and applications use for communication.
+ }
+
+{ flags argument in size hints }
+Const
+ USPosition	= 1 shl 0; { user specified x, y }
+ USSize		= 1 shl 1; { user specified width, height }
+
+ PPosition	= 1 shl 2; { program specified position }
+ PSize		= 1 shl 3; { program specified size }
+ PMinSize	= 1 shl 4; { program specified minimum size }
+ PMaxSize	= 1 shl 5; { program specified maximum size }
+ PResizeInc	= 1 shl 6; { program specified resize increments }
+ PAspect	= 1 shl 7; { program specified min and max aspect ratios }
+ PBaseSize	= 1 shl 8; { program specified base for incrementing }
+ PWinGravity	= 1 shl 9; { program specified window gravity }
+
+{ obsolete }
+ PAllHints = PPosition or PSize or PMinSize or PMaxSize or PResizeInc or PAspect;
+
+Type
+
+ TXWMHints = record
+	flags : long;	{ marks which fields in this structure are defined }
+	input : TBool ;	{ does this application rely on the window manager to
+			get keyboard input? }
+	initial_state : Integer ;	{ see below }
+	icon_pixmap : TPixmap ;	{ pixmap to be used as icon }
+	icon_window : TWindow ; 	{ window to be used as icon }
+	icon_x, icon_y : Integer ; 	{ initial position of icon }
+	icon_mask : TPixmap ;	{ icon mask bitmap }
+	window_group : TXID ;	{ id of related window group }
+	{ this structure may be extended in the future }
+end;
+{ definition for flags of XWMHints }
+
+Const
+ InputHint 		= 1 shl 0;
+ StateHint 		= 1 shl 1;
+ IconPixmapHint		= 1 shl 2;
+ IconWindowHint		= 1 shl 3;
+ IconPositionHint 	= 1 shl 4;
+ IconMaskHint		= 1 shl 5;
+ AllHints = InputHint or StateHint or IconPixmapHint or IconWindowHint or 
+            IconPositionHint or IconMaskHint {or WindowGroupHint};
+ XUrgencyHint		= 1 shl 8;
+
+{ definitions for initial window state }
+ WithdrawnState = 0;	{ for windows that are not mapped }
+ NormalState 	= 1;	{ most applications want to start this way }
+ IconicState 	= 3;	{ application wants to start as an icon }
+
+{
+ * Obsolete states no longer defined by ICCCM
+ }
+ DontCareState	= 0;	{ don't know or care }
+ ZoomState 	= 2;	{ application wants to start zoomed }
+ InactiveState	= 4;	{ application believes it is seldom used; }
+			{ some wm's may put it on inactive menu }
+
+
+{
+ * new structure for manipulating TEXT properties; used with WM_NAME, 
+ * WM_ICON_NAME, WM_CLIENT_MACHINE, and WM_COMMAND.
+ }
+type
+TXTextProperty = record
+    value : pchar;		{ same as Property routines }
+    encoding : TAtom;			{ prop type }
+    format : Integer ;				{ prop data format: 8, 16, or 32 }
+    nitems : Cardinal;		{ number of data items in value }
+end;
+PXTextProperty = ^TXTextProperty;
+
+Const
+
+ XNoMemory 		=-1;
+ XLocaleNotSupported	=-2;
+ XConverterNotFound	=-3;
+
+Type
+  TXICCEncodingStyle = Integer;
+
+Const
+    XStringStyle 	= 0;		{ STRING }
+    XCompoundTextStyle	= 1;		{ COMPOUND_TEXT }
+    XTextStyle		= 2;		{ text in owner's encoding (current locale)}
+    XStdICCTextStyle	= 3;		{ STRING, else COMPOUND_TEXT }
+
+Type
+TXIconSize = record
+	min_width, min_height,
+	max_width, max_height,
+	width_inc, height_inc : Integer;
+end;
+PXIconSize = ^TXIconSize;
+
+type
+TXClassHint = record
+	res_name,
+	res_class : pchar;
+end;
+PXClassHint = ^TXClassHint;
+
+{
+ * These macros are used to give some sugar to the image routines so that
+ * naive people are more comfortable with them.
+ }
+ 
+{
+ XDestroyImage(ximage) \
+	((*((ximage)->f.destroy_image))((ximage)))
+ XGetPixel(ximage, x, y) \
+	((*((ximage)->f.get_pixel))((ximage), (x), (y)))
+ XPutPixel(ximage, x, y, pixel) \
+	((*((ximage)->f.put_pixel))((ximage), (x), (y), (pixel)))
+ XSubImage(ximage, x, y, width, height)  \
+	((*((ximage)->f.sub_image))((ximage), (x), (y), (width), (height)))
+ XAddPixel(ximage, value) \
+	((*((ximage)->f.add_pixel))((ximage), (value)))
+}
+{
+ * Compose sequence status structure, used in calling XLookupString.
+ }
+
+TXComposeStatus = record
+    compose_ptr : TXPointer ;	{ state table pointer }
+    chars_matched : Integer ;		{ match state }
+end;
+PTXComposeStatus = ^TXComposeStatus;
+
+{
+ * Keysym macros, used on Keysyms to test for classes of symbols
+ }
+{
+ IsKeypadKey(keysym) \
+  (((KeySym)(keysym) >= XK_KP_Space) && ((KeySym)(keysym) <= XK_KP_Equal))
+
+ IsPrivateKeypadKey(keysym) \
+  (((KeySym)(keysym) >= 0x11000000) && ((KeySym)(keysym) <= 0x1100FFFF))
+
+ IsCursorKey(keysym) \
+  (((KeySym)(keysym) >= XK_Home)     && ((KeySym)(keysym) <  XK_Select))
+
+ IsPFKey(keysym) \
+  (((KeySym)(keysym) >= XK_KP_F1)     && ((KeySym)(keysym) <= XK_KP_F4))
+
+ IsFunctionKey(keysym) \
+  (((KeySym)(keysym) >= XK_F1)       && ((KeySym)(keysym) <= XK_F35))
+
+ IsMiscFunctionKey(keysym) \
+  (((KeySym)(keysym) >= XK_Select)   && ((KeySym)(keysym) <= XK_Break))
+
+ IsModifierKey(keysym) \
+  ((((KeySym)(keysym) >= XK_Shift_L) && ((KeySym)(keysym) <= XK_Hyper_R)) \
+    or  or  ((KeySym)(keysym) == XK_Mode_switch) \
+    or  or  ((KeySym)(keysym) == XK_Num_Lock))
+}
+{
+ * opaque reference to Region data type 
+ }
+{
+typedef struct _XRegion *Region; 
+}
+
+{ Return values from XRectInRegion() }
+Const
+ RectangleOut =0;
+ RectangleIn  =1;
+ RectanglePart=2;
+ 
+
+{
+ * Information used by the visual utility routines to find desired visual
+ * type from the many visuals a display may support.
+ }
+
+Type
+TXVisualInfo = record
+  visual : PVisual;
+  visualid : TVisualID ;
+  screen : Integer;
+  depth : Integer;
+  c_class : Integer;
+  red_mask : cardinal;
+  green_mask : cardinal;
+  blue_mask : Cardinal;
+  colormap_size : Integer;
+  bits_per_rgb : Integer;
+end;
+PXVisualInfo = ^TXVisualInfo;
+
+Const
+ VisualNoMask		= $0;
+ VisualIDMask 		= $1;
+ VisualScreenMask	= $2;
+ VisualDepthMask	= $4;
+ VisualClassMask	= $8;
+ VisualRedMaskMask	= $10;
+ VisualGreenMaskMask	= $20;
+ VisualBlueMaskMask	= $40;
+ VisualColormapSizeMask	= $80;
+ VisualBitsPerRGBMask	= $100;
+ VisualAllMask		= $1FF;
+
+{
+ * This defines a window manager property that clients may use to
+ * share standard color maps of type RGB_COLOR_MAP:
+ }
+Type
+TXStandardColormap = record
+	colormap : TColormap ;
+	red_max : Cardinal;
+	red_mult : Cardinal;
+	green_max : Cardinal;
+	green_mult : Cardinal;
+	blue_max : Cardinal;
+	blue_mult : Cardinal;
+	base_pixel : Cardinal;
+	visualid : TVisualID;		{ added by ICCCM version 1 }
+	killid : TXID ;			{ added by ICCCM version 1 }
+end;
+PXStandardColormap= ^TXStandardColormap;
+
+Const  
+ ReleaseByFreeingColormap = 1;  { for killid field above }
+
+
+{
+ * return codes for XReadBitmapFile and XWriteBitmapFile
+ }
+ BitmapSuccess		=0;
+ BitmapOpenFailed 	=1;
+ BitmapFileInvalid 	=2;
+ BitmapNoMemory		=3;
+
+{***************************************************************
+ *
+ * Context Management
+ *
+ ***************************************************************}
+
+
+{ Associative lookup table return codes }
+
+ XCSUCCESS =0;	{ No error. }
+ XCNOMEM   =1;    { Out of memory }
+ XCNOENT   =2;    { No entry in table }
+
+type TXContext = Integer;
+{
+ XUniqueContext()       ((XContext) XrmUniqueQuark())
+ XStringToContext(string)   ((XContext) XrmStringToQuark(string))
+}
+
+Implementation
+
+end.
+{
+_XFUNCPROTOBEGIN
+
+{ The following declarations are alphabetized. }
+
+extern XClassHInteger *XAllocClassHInteger (
+#if NeedFunctionPrototypes
+    void
+#endif
+);
+
+extern XIconSize *XAllocIconSize (
+#if NeedFunctionPrototypes
+    void
+#endif
+);
+
+extern XSizeHints *XAllocSizeHints (
+#if NeedFunctionPrototypes
+    void
+#endif
+);
+
+extern XStandardColormap *XAllocStandardColormap (
+#if NeedFunctionPrototypes
+    void
+#endif
+);
+
+extern XWMHints *XAllocWMHints (
+#if NeedFunctionPrototypes
+    void
+#endif
+);
+
+extern XClipBox(
+#if NeedFunctionPrototypes
+    Region		{ r },
+    XRectangle*		{ rect_return }
+#endif
+);
+
+extern Region XCreateRegion(
+#if NeedFunctionPrototypes
+    void
+#endif
+);
+
+extern char *XDefaultString(
+#if NeedFunctionPrototypes
+    void
+#endif
+);
+
+extern Integer XDeleteContext(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    XID			{ rid },
+    XContext		{ context }
+#endif
+);
+
+extern XDestroyRegion(
+#if NeedFunctionPrototypes
+    Region		{ r }
+#endif
+);
+
+extern XEmptyRegion(
+#if NeedFunctionPrototypes
+    Region		{ r }
+#endif
+);
+
+extern XEqualRegion(
+#if NeedFunctionPrototypes
+    Region		{ r1 },
+    Region		{ r2 }
+#endif
+);
+
+extern Integer XFindContext(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    XID			{ rid },
+    XContext		{ context },
+    XPointer*		{ data_return }
+#endif
+);
+
+extern Status XGetClassHint(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XClassHint*		{ class_hints_return }
+#endif
+);
+
+extern Status XGetIconSizes(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XIconSize**		{ size_list_return },
+    int*		{ count_return }
+#endif
+);
+
+extern Status XGetNormalHints(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XSizeHints*		{ hints_return }
+#endif
+);
+
+extern Status XGetRGBColormaps(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XStandardColormap** { stdcmap_return },
+    int*		{ count_return },
+    Atom		{ property }
+#endif
+);
+
+extern Status XGetSizeHints(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XSizeHints*		{ hints_return },
+    Atom		{ property }
+#endif
+);
+
+extern Status XGetStandardColormap(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XStandardColormap*	{ colormap_return },
+    Atom		{ property }			    
+#endif
+);
+
+extern Status XGetTextProperty(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ window },
+    XTextProperty*	{ text_prop_return },
+    Atom		{ property }
+#endif
+);
+
+extern XVisualInfo *XGetVisualInfo(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    long		{ vinfo_mask },
+    XVisualInfo*	{ vinfo_template },
+    int*		{ nitems_return }
+#endif
+);
+
+extern Status XGetWMClientMachine(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XTextProperty*	{ text_prop_return }
+#endif
+);
+
+extern XWMHints *XGetWMHints(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w }		      
+#endif
+);
+
+extern Status XGetWMIconName(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XTextProperty*	{ text_prop_return }
+#endif
+);
+
+extern Status XGetWMName(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XTextProperty*	{ text_prop_return }
+#endif
+);
+
+extern Status XGetWMNormalHints(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XSizeHints*		{ hints_return },
+    long*		{ supplied_return } 
+#endif
+);
+
+extern Status XGetWMSizeHints(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XSizeHints*		{ hints_return },
+    long*		{ supplied_return },
+    Atom		{ property }
+#endif
+);
+
+extern Status XGetZoomHints(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XSizeHints*		{ zhints_return }
+#endif
+);
+
+extern XIntersectRegion(
+#if NeedFunctionPrototypes
+    Region		{ sra },
+    Region		{ srb },
+    Region		{ dr_return }
+#endif
+);
+
+extern void XConvertCase(
+#if NeedFunctionPrototypes
+    KeySym		{ sym },
+    KeySym*		{ lower },
+    KeySym*		{ upper }
+#endif
+);
+
+extern Integer XLookupString(
+#if NeedFunctionPrototypes
+    XKeyEvent*		{ event_struct },
+    char*		{ buffer_return },
+    int			{ bytes_buffer },
+    KeySym*		{ keysym_return },
+    XComposeStatus*	{ status_in_out }
+#endif
+);
+
+extern Status XMatchVisualInfo(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    int			{ screen },
+    int			{ depth },
+    int			{ class },
+    XVisualInfo*	{ vinfo_return }
+#endif
+);
+
+extern XOffsetRegion(
+#if NeedFunctionPrototypes
+    Region		{ r },
+    int			{ dx },
+    int			{ dy }
+#endif
+);
+
+extern Bool XPointInRegion(
+#if NeedFunctionPrototypes
+    Region		{ r },
+    int			{ x },
+    int			{ y }
+#endif
+);
+
+extern Region XPolygonRegion(
+#if NeedFunctionPrototypes
+    XPoint*		{ points },
+    int			{ n },
+    int			{ fill_rule }
+#endif
+);
+
+extern Integer XRectInRegion(
+#if NeedFunctionPrototypes
+    Region		{ r },
+    int			{ x },
+    int			{ y },
+    unsigned int	{ width },
+    unsigned int	{ height }
+#endif
+);
+
+extern Integer XSaveContext(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    XID			{ rid },
+    XContext		{ context },
+    _Xconst char*	{ data }
+#endif
+);
+
+extern XSetClassHint(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XClassHint*		{ class_hints }
+#endif
+);
+
+extern XSetIconSizes(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XIconSize*		{ size_list },
+    int			{ count }    
+#endif
+);
+
+extern XSetNormalHints(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XSizeHints*		{ hints }
+#endif
+);
+
+extern void XSetRGBColormaps(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XStandardColormap*	{ stdcmaps },
+    int			{ count },
+    Atom		{ property }
+#endif
+);
+
+extern XSetSizeHints(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XSizeHints*		{ hints },
+    Atom		{ property }
+#endif
+);
+
+extern XSetStandardProperties(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    _Xconst char*	{ window_name },
+    _Xconst char*	{ icon_name },
+    Pixmap		{ icon_pixmap },
+    char**		{ argv },
+    int			{ argc },
+    XSizeHints*		{ hints }
+#endif
+);
+
+extern void XSetTextProperty(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XTextProperty*	{ text_prop },
+    Atom		{ property }
+#endif
+);
+
+extern void XSetWMClientMachine(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XTextProperty*	{ text_prop }
+#endif
+);
+
+extern XSetWMHints(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XWMHints*		{ wm_hints }
+#endif
+);
+
+extern void XSetWMIconName(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XTextProperty*	{ text_prop }
+#endif
+);
+
+extern void XSetWMName(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XTextProperty*	{ text_prop }
+#endif
+);
+
+extern void XSetWMNormalHints(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XSizeHints*		{ hints }
+#endif
+);
+
+extern void XSetWMProperties(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XTextProperty*	{ window_name },
+    XTextProperty*	{ icon_name },
+    char**		{ argv },
+    int			{ argc },
+    XSizeHints*		{ normal_hints },
+    XWMHints*		{ wm_hints },
+    XClassHint*		{ class_hints }
+#endif
+);
+
+extern void XmbSetWMProperties(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    _Xconst char*	{ window_name },
+    _Xconst char*	{ icon_name },
+    char**		{ argv },
+    int			{ argc },
+    XSizeHints*		{ normal_hints },
+    XWMHints*		{ wm_hints },
+    XClassHint*		{ class_hints }
+#endif
+);
+
+extern void XSetWMSizeHints(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XSizeHints*		{ hints },
+    Atom		{ property }
+#endif
+);
+
+extern XSetRegion(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    GC			{ gc },
+    Region		{ r }
+#endif
+);
+
+extern void XSetStandardColormap(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XStandardColormap*	{ colormap },
+    Atom		{ property }
+#endif
+);
+
+extern XSetZoomHints(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    Window		{ w },
+    XSizeHints*		{ zhints }
+#endif
+);
+
+extern XShrinkRegion(
+#if NeedFunctionPrototypes
+    Region		{ r },
+    int			{ dx },
+    int			{ dy }
+#endif
+);
+
+extern Status XStringListToTextProperty(
+#if NeedFunctionPrototypes
+    char**		{ list },
+    int			{ count },
+    XTextProperty*	{ text_prop_return }
+#endif
+);
+
+extern XSubtractRegion(
+#if NeedFunctionPrototypes
+    Region		{ sra },
+    Region		{ srb },
+    Region		{ dr_return }
+#endif
+);
+
+extern Integer XmbTextListToTextProperty(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    char**		{ list },
+    int			{ count },
+    XICCEncodingStyle	{ style },
+    XTextProperty*	{ text_prop_return }
+#endif
+);
+
+extern Integer XwcTextListToTextProperty(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    wchar_t**		{ list },
+    int			{ count },
+    XICCEncodingStyle	{ style },
+    XTextProperty*	{ text_prop_return }
+#endif
+);
+
+extern void XwcFreeStringList(
+#if NeedFunctionPrototypes
+    wchar_t**		{ list }
+#endif
+);
+
+extern Status XTextPropertyToStringList(
+#if NeedFunctionPrototypes
+    XTextProperty*	{ text_prop },
+    char***		{ list_return },
+    int*		{ count_return }
+#endif
+);
+
+extern Integer XmbTextPropertyToTextList(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    XTextProperty*	{ text_prop },
+    char***		{ list_return },
+    int*		{ count_return }
+#endif
+);
+
+extern Integer XwcTextPropertyToTextList(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    XTextProperty*	{ text_prop },
+    wchar_t***		{ list_return },
+    int*		{ count_return }
+#endif
+);
+
+extern XUnionRectWithRegion(
+#if NeedFunctionPrototypes
+    XRectangle*		{ rectangle },
+    Region		{ src_region },
+    Region		{ dest_region_return }
+#endif
+);
+
+extern XUnionRegion(
+#if NeedFunctionPrototypes
+    Region		{ sra },
+    Region		{ srb },
+    Region		{ dr_return }
+#endif
+);
+
+extern Integer XWMGeometry(
+#if NeedFunctionPrototypes
+    Display*		{ display },
+    int			{ screen_number },
+    _Xconst char*	{ user_geometry },
+    _Xconst char*	{ default_geometry },
+    unsigned int	{ border_width },
+    XSizeHints*		{ hints },
+    int*		{ x_return },
+    int*		{ y_return },
+    int*		{ width_return },
+    int*		{ height_return },
+    int*		{ gravity_return }
+#endif
+);
+
+extern XXorRegion(
+#if NeedFunctionPrototypes
+    Region		{ sra },
+    Region		{ srb },
+    Region		{ dr_return }
+#endif
+);
+
+_XFUNCPROTOEND
+
+#endif { _XUTIL_H_ }
+}