aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xquartz
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xquartz')
-rw-r--r--xorg-server/hw/xquartz/GL/Makefile.am13
-rw-r--r--xorg-server/hw/xquartz/GL/Makefile.in653
-rw-r--r--xorg-server/hw/xquartz/GL/indirect.c1938
-rw-r--r--xorg-server/hw/xquartz/Makefile.am57
-rw-r--r--xorg-server/hw/xquartz/Makefile.in877
-rw-r--r--xorg-server/hw/xquartz/X11Application.h103
-rw-r--r--xorg-server/hw/xquartz/X11Application.m922
-rw-r--r--xorg-server/hw/xquartz/X11Controller.h103
-rw-r--r--xorg-server/hw/xquartz/X11Controller.m749
-rw-r--r--xorg-server/hw/xquartz/applewm.c707
-rw-r--r--xorg-server/hw/xquartz/applewmExt.h84
-rw-r--r--xorg-server/hw/xquartz/bundle/Dutch.lproj/InfoPlist.stringsbin0 -> 274 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/Dutch.lproj/Localizable.stringsbin0 -> 1084 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/Dutch.lproj/main.nib/keyedobjects.nibbin0 -> 32654 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/English.lproj/InfoPlist.stringsbin0 -> 276 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/English.lproj/Localizable.stringsbin0 -> 1094 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/English.lproj/main.nib/designable.nib3482
-rw-r--r--xorg-server/hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nibbin0 -> 35571 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/French.lproj/InfoPlist.stringsbin0 -> 276 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/French.lproj/Localizable.stringsbin0 -> 1168 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/French.lproj/main.nib/keyedobjects.nibbin0 -> 36404 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/German.lproj/InfoPlist.stringsbin0 -> 276 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/German.lproj/Localizable.stringsbin0 -> 1096 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/German.lproj/main.nib/keyedobjects.nibbin0 -> 34995 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/Info.plist39
-rw-r--r--xorg-server/hw/xquartz/bundle/Italian.lproj/InfoPlist.stringsbin0 -> 278 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/Italian.lproj/Localizable.stringsbin0 -> 1146 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/Italian.lproj/main.nib/keyedobjects.nibbin0 -> 33677 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/Japanese.lproj/InfoPlist.stringsbin0 -> 272 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/Japanese.lproj/Localizable.stringsbin0 -> 916 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/Japanese.lproj/main.nib/keyedobjects.nibbin0 -> 33095 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/Makefile.am77
-rw-r--r--xorg-server/hw/xquartz/bundle/Makefile.in663
-rw-r--r--xorg-server/hw/xquartz/bundle/Spanish.lproj/InfoPlist.stringsbin0 -> 276 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/Spanish.lproj/Localizable.stringsbin0 -> 1134 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/Spanish.lproj/main.nib/keyedobjects.nibbin0 -> 35294 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/X11.icnsbin0 -> 65908 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/X11.xcodeproj/project.pbxproj458
-rw-r--r--xorg-server/hw/xquartz/bundle/Xquartz.plist27
-rw-r--r--xorg-server/hw/xquartz/bundle/bundle-main.c136
-rw-r--r--xorg-server/hw/xquartz/bundle/da.lproj/InfoPlist.stringsbin0 -> 276 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/da.lproj/Localizable.stringsbin0 -> 1090 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/da.lproj/main.nib/keyedobjects.nibbin0 -> 34164 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/fi.lproj/InfoPlist.stringsbin0 -> 274 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/fi.lproj/Localizable.stringsbin0 -> 1102 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/fi.lproj/main.nib/keyedobjects.nibbin0 -> 34765 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/ko.lproj/InfoPlist.stringsbin0 -> 266 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/ko.lproj/Localizable.stringsbin0 -> 916 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/ko.lproj/main.nib/keyedobjects.nibbin0 -> 32690 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/no.lproj/InfoPlist.stringsbin0 -> 276 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/no.lproj/Localizable.stringsbin0 -> 1084 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/no.lproj/main.nib/keyedobjects.nibbin0 -> 33581 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/pl.lproj/InfoPlist.stringsbin0 -> 274 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/pl.lproj/Localizable.stringsbin0 -> 1116 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/pl.lproj/main.nib/keyedobjects.nibbin0 -> 35113 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/pt.lproj/InfoPlist.stringsbin0 -> 274 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/pt.lproj/Localizable.stringsbin0 -> 1192 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/pt.lproj/main.nib/keyedobjects.nibbin0 -> 34533 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/pt_PT.lproj/InfoPlist.stringsbin0 -> 274 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/pt_PT.lproj/Localizable.stringsbin0 -> 1140 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/pt_PT.lproj/main.nib/keyedobjects.nibbin0 -> 35485 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/ru.lproj/InfoPlist.stringsbin0 -> 274 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/ru.lproj/Localizable.stringsbin0 -> 1122 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/ru.lproj/main.nib/keyedobjects.nibbin0 -> 36593 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/sv.lproj/InfoPlist.stringsbin0 -> 260 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/sv.lproj/Localizable.stringsbin0 -> 1106 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/sv.lproj/main.nib/keyedobjects.nibbin0 -> 35017 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/zh_CN.lproj/InfoPlist.stringsbin0 -> 260 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/zh_CN.lproj/Localizable.stringsbin0 -> 884 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/zh_CN.lproj/main.nib/keyedobjects.nibbin0 -> 31481 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/zh_TW.lproj/InfoPlist.stringsbin0 -> 266 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/zh_TW.lproj/Localizable.stringsbin0 -> 890 bytes
-rw-r--r--xorg-server/hw/xquartz/bundle/zh_TW.lproj/main.nib/keyedobjects.nibbin0 -> 31748 bytes
-rw-r--r--xorg-server/hw/xquartz/darwin.c1026
-rw-r--r--xorg-server/hw/xquartz/darwin.h132
-rw-r--r--xorg-server/hw/xquartz/darwinClut8.h531
-rw-r--r--xorg-server/hw/xquartz/darwinEvents.c461
-rw-r--r--xorg-server/hw/xquartz/darwinEvents.h40
-rw-r--r--xorg-server/hw/xquartz/darwinKeyboard.c1009
-rw-r--r--xorg-server/hw/xquartz/darwinKeyboard.h45
-rw-r--r--xorg-server/hw/xquartz/darwinXinput.c309
-rw-r--r--xorg-server/hw/xquartz/keysym2ucs.c909
-rw-r--r--xorg-server/hw/xquartz/keysym2ucs.h36
-rw-r--r--xorg-server/hw/xquartz/pseudoramiX.c438
-rw-r--r--xorg-server/hw/xquartz/pseudoramiX.h9
-rw-r--r--xorg-server/hw/xquartz/quartz.c500
-rw-r--r--xorg-server/hw/xquartz/quartz.h134
-rw-r--r--xorg-server/hw/xquartz/quartzAudio.c346
-rw-r--r--xorg-server/hw/xquartz/quartzAudio.h40
-rw-r--r--xorg-server/hw/xquartz/quartzCocoa.m146
-rw-r--r--xorg-server/hw/xquartz/quartzCommon.h107
-rw-r--r--xorg-server/hw/xquartz/quartzCursor.c646
-rw-r--r--xorg-server/hw/xquartz/quartzCursor.h42
-rw-r--r--xorg-server/hw/xquartz/quartzForeground.c47
-rw-r--r--xorg-server/hw/xquartz/quartzForeground.h37
-rw-r--r--xorg-server/hw/xquartz/quartzKeyboard.c324
-rw-r--r--xorg-server/hw/xquartz/quartzKeyboard.h53
-rw-r--r--xorg-server/hw/xquartz/quartzPasteboard.c145
-rw-r--r--xorg-server/hw/xquartz/quartzPasteboard.h44
-rw-r--r--xorg-server/hw/xquartz/quartzStartup.c112
-rw-r--r--xorg-server/hw/xquartz/xpr/Makefile.am78
-rw-r--r--xorg-server/hw/xquartz/xpr/Makefile.in847
-rw-r--r--xorg-server/hw/xquartz/xpr/appledri.c352
-rw-r--r--xorg-server/hw/xquartz/xpr/appledri.h106
-rw-r--r--xorg-server/hw/xquartz/xpr/appledristr.h175
-rw-r--r--xorg-server/hw/xquartz/xpr/dri.c737
-rw-r--r--xorg-server/hw/xquartz/xpr/dri.h128
-rw-r--r--xorg-server/hw/xquartz/xpr/dristruct.h76
-rw-r--r--xorg-server/hw/xquartz/xpr/x-hash.c343
-rw-r--r--xorg-server/hw/xquartz/xpr/x-hash.h60
-rw-r--r--xorg-server/hw/xquartz/xpr/x-hook.c109
-rw-r--r--xorg-server/hw/xquartz/xpr/x-hook.h42
-rw-r--r--xorg-server/hw/xquartz/xpr/x-list.c337
-rw-r--r--xorg-server/hw/xquartz/xpr/x-list.h77
-rw-r--r--xorg-server/hw/xquartz/xpr/xpr.h47
-rw-r--r--xorg-server/hw/xquartz/xpr/xprAppleWM.c100
-rw-r--r--xorg-server/hw/xquartz/xpr/xprCursor.c422
-rw-r--r--xorg-server/hw/xquartz/xpr/xprFrame.c528
-rw-r--r--xorg-server/hw/xquartz/xpr/xprScreen.c438
119 files changed, 23758 insertions, 0 deletions
diff --git a/xorg-server/hw/xquartz/GL/Makefile.am b/xorg-server/hw/xquartz/GL/Makefile.am
new file mode 100644
index 000000000..450ee5c5b
--- /dev/null
+++ b/xorg-server/hw/xquartz/GL/Makefile.am
@@ -0,0 +1,13 @@
+noinst_LTLIBRARIES = libCGLCore.la
+AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS)
+AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/glx \
+ -I$(top_srcdir)/GL/include \
+ -I$(top_srcdir)/GL/mesa/glapi \
+ -I$(top_srcdir)/hw/xquartz \
+ -I$(top_srcdir)/hw/xquartz/xpr \
+ -I$(top_srcdir)/miext/damage
+
+libCGLCore_la_SOURCES = \
+ indirect.c
diff --git a/xorg-server/hw/xquartz/GL/Makefile.in b/xorg-server/hw/xquartz/GL/Makefile.in
new file mode 100644
index 000000000..893c0123b
--- /dev/null
+++ b/xorg-server/hw/xquartz/GL/Makefile.in
@@ -0,0 +1,653 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = hw/xquartz/GL
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \
+ $(top_builddir)/include/xorg-server.h \
+ $(top_builddir)/include/dix-config.h \
+ $(top_builddir)/include/xgl-config.h \
+ $(top_builddir)/include/xorg-config.h \
+ $(top_builddir)/include/xkb-config.h \
+ $(top_builddir)/include/xwin-config.h \
+ $(top_builddir)/include/kdrive-config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libCGLCore_la_LIBADD =
+am_libCGLCore_la_OBJECTS = indirect.lo
+libCGLCore_la_OBJECTS = $(am_libCGLCore_la_OBJECTS)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(libCGLCore_la_SOURCES)
+DIST_SOURCES = $(libCGLCore_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
+ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+APPDEFAULTDIR = @APPDEFAULTDIR@
+APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@
+APP_MAN_DIR = @APP_MAN_DIR@
+APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASE_FONT_PATH = @BASE_FONT_PATH@
+BUILD_DATE = @BUILD_DATE@
+BUILD_TIME = @BUILD_TIME@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DARWIN_LIBS = @DARWIN_LIBS@
+DBUS_CFLAGS = @DBUS_CFLAGS@
+DBUS_LIBS = @DBUS_LIBS@
+DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@
+DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@
+DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DGA_CFLAGS = @DGA_CFLAGS@
+DGA_LIBS = @DGA_LIBS@
+DIX_CFLAGS = @DIX_CFLAGS@
+DLLTOOL = @DLLTOOL@
+DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@
+DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@
+DMXMODULES_LIBS = @DMXMODULES_LIBS@
+DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@
+DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@
+DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@
+DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@
+DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
+DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
+DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
+DRIPROTO_LIBS = @DRIPROTO_LIBS@
+DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
+DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
+DRI_DRIVER_PATH = @DRI_DRIVER_PATH@
+DSYMUTIL = @DSYMUTIL@
+DTRACE = @DTRACE@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
+FREETYPE_LIBS = @FREETYPE_LIBS@
+GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
+GLX_DEFINES = @GLX_DEFINES@
+GL_CFLAGS = @GL_CFLAGS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+HAL_CFLAGS = @HAL_CFLAGS@
+HAL_LIBS = @HAL_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDRIVE_CFLAGS = @KDRIVE_CFLAGS@
+KDRIVE_INCS = @KDRIVE_INCS@
+KDRIVE_LIBS = @KDRIVE_LIBS@
+KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@
+KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@
+KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@
+LAUNCHD = @LAUNCHD@
+LDFLAGS = @LDFLAGS@
+LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
+LIBDRM_LIBS = @LIBDRM_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_MAN_DIR = @LIB_MAN_DIR@
+LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
+LINUXDOC = @LINUXDOC@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MAKE_HTML = @MAKE_HTML@
+MAKE_PDF = @MAKE_PDF@
+MAKE_PS = @MAKE_PS@
+MAKE_TEXT = @MAKE_TEXT@
+MESA_SOURCE = @MESA_SOURCE@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+MKFONTDIR = @MKFONTDIR@
+MKFONTSCALE = @MKFONTSCALE@
+NMEDIT = @NMEDIT@
+OBJC = @OBJC@
+OBJCCLD = @OBJCCLD@
+OBJCDEPMODE = @OBJCDEPMODE@
+OBJCFLAGS = @OBJCFLAGS@
+OBJCLINK = @OBJCLINK@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
+PCIACCESS_LIBS = @PCIACCESS_LIBS@
+PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@
+PERL = @PERL@
+PKG_CONFIG = @PKG_CONFIG@
+PROJECTROOT = @PROJECTROOT@
+PS2PDF = @PS2PDF@
+RANLIB = @RANLIB@
+RAWCPP = @RAWCPP@
+RAWCPPFLAGS = @RAWCPPFLAGS@
+SED = @SED@
+SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@
+SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@
+STRIP = @STRIP@
+TSLIB_CFLAGS = @TSLIB_CFLAGS@
+TSLIB_LIBS = @TSLIB_LIBS@
+UTILS_SYS_LIBS = @UTILS_SYS_LIBS@
+VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@
+VENDOR_NAME = @VENDOR_NAME@
+VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@
+VENDOR_RELEASE = @VENDOR_RELEASE@
+VERSION = @VERSION@
+X11APP_ARCHS = @X11APP_ARCHS@
+X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
+X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@
+XDMCP_CFLAGS = @XDMCP_CFLAGS@
+XDMCP_LIBS = @XDMCP_LIBS@
+XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@
+XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@
+XDMX_CFLAGS = @XDMX_CFLAGS@
+XDMX_LIBS = @XDMX_LIBS@
+XDMX_SYS_LIBS = @XDMX_SYS_LIBS@
+XEGLMODULES_CFLAGS = @XEGLMODULES_CFLAGS@
+XEGL_LIBS = @XEGL_LIBS@
+XEGL_SYS_LIBS = @XEGL_SYS_LIBS@
+XEPHYR_CFLAGS = @XEPHYR_CFLAGS@
+XEPHYR_DRI_LIBS = @XEPHYR_DRI_LIBS@
+XEPHYR_INCS = @XEPHYR_INCS@
+XEPHYR_LIBS = @XEPHYR_LIBS@
+XF86CONFIGFILE = @XF86CONFIGFILE@
+XF86MISC_CFLAGS = @XF86MISC_CFLAGS@
+XF86MISC_LIBS = @XF86MISC_LIBS@
+XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
+XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
+XGLMODULES_CFLAGS = @XGLMODULES_CFLAGS@
+XGLMODULES_LIBS = @XGLMODULES_LIBS@
+XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@
+XGLXMODULES_LIBS = @XGLXMODULES_LIBS@
+XGLX_LIBS = @XGLX_LIBS@
+XGLX_SYS_LIBS = @XGLX_SYS_LIBS@
+XGL_LIBS = @XGL_LIBS@
+XGL_MODULE_PATH = @XGL_MODULE_PATH@
+XGL_SYS_LIBS = @XGL_SYS_LIBS@
+XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
+XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
+XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
+XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@
+XLIB_CFLAGS = @XLIB_CFLAGS@
+XLIB_LIBS = @XLIB_LIBS@
+XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@
+XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
+XNEST_LIBS = @XNEST_LIBS@
+XNEST_SYS_LIBS = @XNEST_SYS_LIBS@
+XORGCFG_DEP_CFLAGS = @XORGCFG_DEP_CFLAGS@
+XORGCFG_DEP_LIBS = @XORGCFG_DEP_LIBS@
+XORGCONFIG_DEP_CFLAGS = @XORGCONFIG_DEP_CFLAGS@
+XORGCONFIG_DEP_LIBS = @XORGCONFIG_DEP_LIBS@
+XORG_CFLAGS = @XORG_CFLAGS@
+XORG_INCS = @XORG_INCS@
+XORG_LIBS = @XORG_LIBS@
+XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@
+XORG_MODULES_LIBS = @XORG_MODULES_LIBS@
+XORG_OS = @XORG_OS@
+XORG_OS_SUBDIR = @XORG_OS_SUBDIR@
+XORG_SYS_LIBS = @XORG_SYS_LIBS@
+XPRINTMODULES_CFLAGS = @XPRINTMODULES_CFLAGS@
+XPRINTMODULES_LIBS = @XPRINTMODULES_LIBS@
+XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@
+XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@
+XPRINT_CFLAGS = @XPRINT_CFLAGS@
+XPRINT_LIBS = @XPRINT_LIBS@
+XPRINT_SYS_LIBS = @XPRINT_SYS_LIBS@
+XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
+XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
+XSDL_INCS = @XSDL_INCS@
+XSDL_LIBS = @XSDL_LIBS@
+XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@
+XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@
+XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@
+XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@
+XSERVER_LIBS = @XSERVER_LIBS@
+XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@
+XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@
+XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@
+XVFB_LIBS = @XVFB_LIBS@
+XVFB_SYS_LIBS = @XVFB_SYS_LIBS@
+XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@
+XWINMODULES_LIBS = @XWINMODULES_LIBS@
+XWIN_LIBS = @XWIN_LIBS@
+XWIN_SERVER_NAME = @XWIN_SERVER_NAME@
+XWIN_SYS_LIBS = @XWIN_SYS_LIBS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+__XCONFIGFILE__ = @__XCONFIGFILE__@
+abi_ansic = @abi_ansic@
+abi_extension = @abi_extension@
+abi_font = @abi_font@
+abi_videodrv = @abi_videodrv@
+abi_xinput = @abi_xinput@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+driverdir = @driverdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+extdir = @extdir@
+ft_config = @ft_config@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+launchagentsdir = @launchagentsdir@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+logdir = @logdir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sdkdir = @sdkdir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+xglmoduledir = @xglmoduledir@
+xpconfigdir = @xpconfigdir@
+noinst_LTLIBRARIES = libCGLCore.la
+AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS)
+AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/glx \
+ -I$(top_srcdir)/GL/include \
+ -I$(top_srcdir)/GL/mesa/glapi \
+ -I$(top_srcdir)/hw/xquartz \
+ -I$(top_srcdir)/hw/xquartz/xpr \
+ -I$(top_srcdir)/miext/damage
+
+libCGLCore_la_SOURCES = \
+ indirect.c
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xquartz/GL/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign hw/xquartz/GL/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libCGLCore.la: $(libCGLCore_la_OBJECTS) $(libCGLCore_la_DEPENDENCIES)
+ $(LINK) $(libCGLCore_la_OBJECTS) $(libCGLCore_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indirect.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/xorg-server/hw/xquartz/GL/indirect.c b/xorg-server/hw/xquartz/GL/indirect.c
new file mode 100644
index 000000000..07a9c066a
--- /dev/null
+++ b/xorg-server/hw/xquartz/GL/indirect.c
@@ -0,0 +1,1938 @@
+/*
+ * GLX implementation that uses Apple's OpenGL.framework
+ * (Indirect rendering path)
+ *
+ * Copyright (c) 2007 Apple Inc.
+ * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved.
+ * Copyright (c) 2002 Greg Parker. All Rights Reserved.
+ *
+ * Portions of this file are copied from Mesa's xf86glx.c,
+ * which contains the following copyright:
+ *
+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "dri.h"
+
+#define GL_EXT_histogram 1
+#define GL_EXT_polygon_offset 1
+#define GL_SGIS_pixel_texture 1
+#define GL_SGIX_pixel_texture 1
+#define GL_EXT_multisample 1
+#define GL_SGIS_multisample 1
+#define GL_EXT_vertex_array 1
+#define GL_ARB_point_parameters 1
+#define GL_NV_vertex_array_range 1
+#define GL_MESA_resize_buffers 1
+#define GL_ARB_window_pos 1
+#define GL_EXT_cull_vertex 1
+#define GL_NV_vertex_program 1
+#define GL_APPLE_fence 1
+#define GL_IBM_multimode_draw_arrays 1
+#define GL_EXT_fragment_shader 1
+
+#include <OpenGL/OpenGL.h>
+#include <OpenGL/CGLContext.h>
+
+// X11 and X11's glx
+#include <GL/gl.h>
+#include <GL/glxproto.h>
+#include <windowstr.h>
+#include <resource.h>
+#include <GL/glxint.h>
+#include <GL/glxtokens.h>
+#include <scrnintstr.h>
+#include <glxserver.h>
+#include <glxscreens.h>
+#include <glxdrawable.h>
+#include <glxcontext.h>
+#include <glxext.h>
+#include <glxutil.h>
+#include <glxscreens.h>
+#include <GL/internal/glcore.h>
+#include "x-hash.h"
+#include "x-list.h"
+
+#include <dispatch.h>
+#define GLAPIENTRYP *
+typedef unsigned long long GLuint64EXT;
+typedef long long GLint64EXT;
+#include <Xplugin.h>
+#include "glcontextmodes.h"
+#include <glapi.h>
+#include <glapitable.h>
+
+// ggs: needed to call back to glx with visual configs
+extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, void **configprivs);
+__GLXprovider * GlxGetDRISWrastProvider (void);
+
+// Write debugging output, or not
+#ifdef GLAQUA_DEBUG
+#define GLAQUA_DEBUG_MSG ErrorF
+#else
+#define GLAQUA_DEBUG_MSG(a, ...)
+#endif
+
+static void setup_dispatch_table(void);
+GLuint __glFloorLog2(GLuint val);
+void warn_func(void * p1, char *format, ...);
+
+// some prototypes
+static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen);
+static __GLXdrawable * __glXAquaScreenCreateDrawable(__GLXscreen *screen, DrawablePtr pDraw, XID drawId, __GLcontextModes *modes);
+
+static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
+ int *nvisualp, int *ndepthp,
+ int *rootDepthp, VisualID *defaultVisp,
+ unsigned long sizes, int bitsPerRGB);
+static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
+ void **privates);
+
+static void glAquaResetExtension(void);
+static void __glXAquaContextDestroy(__GLXcontext *baseContext);
+static int __glXAquaContextMakeCurrent(__GLXcontext *baseContext);
+static int __glXAquaContextLoseCurrent(__GLXcontext *baseContext);
+static int __glXAquaContextForceCurrent(__GLXcontext *baseContext);
+static int __glXAquaContextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, unsigned long mask);
+
+static CGLPixelFormatObj makeFormat(__GLcontextModes *mode);
+
+__GLXprovider __glXDRISWRastProvider = {
+ __glXAquaScreenProbe,
+ "Core OpenGL",
+ NULL
+};
+
+__GLXprovider *
+GlxGetDRISWRastProvider (void)
+{
+ GLAQUA_DEBUG_MSG("GlxGetDRISWRastProvider\n");
+ return &__glXDRISWRastProvider;
+}
+
+typedef struct __GLXAquaScreen __GLXAquaScreen;
+typedef struct __GLXAquaContext __GLXAquaContext;
+typedef struct __GLXAquaDrawable __GLXAquaDrawable;
+
+struct __GLXAquaScreen {
+ __GLXscreen base;
+ int index;
+ int num_vis;
+ __GLcontextModes *modes;
+};
+
+static __GLXAquaScreen glAquaScreens[MAXSCREENS];
+
+struct __GLXAquaContext {
+ __GLXcontext base;
+ CGLContextObj ctx;
+ CGLPixelFormatObj pixelFormat;
+ xp_surface_id sid;
+ unsigned isAttached :1;
+};
+
+struct __GLXAquaDrawable {
+ __GLXdrawable base;
+ DrawablePtr pDraw;
+ xp_surface_id sid;
+};
+
+static __GLXcontext *
+__glXAquaScreenCreateContext(__GLXscreen *screen,
+ __GLcontextModes *modes,
+ __GLXcontext *baseShareContext)
+{
+ __GLXAquaContext *context;
+ __GLXAquaContext *shareContext = (__GLXAquaContext *) baseShareContext;
+ CGLError gl_err;
+
+ GLAQUA_DEBUG_MSG("glXAquaScreenCreateContext\n");
+
+ context = malloc (sizeof (__GLXAquaContext));
+ if (context == NULL) return NULL;
+
+ memset(context, 0, sizeof *context);
+
+ context->base.pGlxScreen = screen;
+ context->base.modes = modes;
+
+ context->base.destroy = __glXAquaContextDestroy;
+ context->base.makeCurrent = __glXAquaContextMakeCurrent;
+ context->base.loseCurrent = __glXAquaContextLoseCurrent;
+ context->base.copy = __glXAquaContextCopy;
+ context->base.forceCurrent = __glXAquaContextForceCurrent;
+ // context->base.createDrawable = __glXAquaContextCreateDrawable;
+
+ context->pixelFormat = makeFormat(modes);
+ if (!context->pixelFormat) {
+ free(context);
+ return NULL;
+ }
+
+ context->ctx = NULL;
+ gl_err = CGLCreateContext(context->pixelFormat,
+ shareContext ? shareContext->ctx : NULL,
+ &context->ctx);
+
+ if (gl_err != 0) {
+ ErrorF("CGLCreateContext error: %s\n", CGLErrorString(gl_err));
+ CGLDestroyPixelFormat(context->pixelFormat);
+ free(context);
+ return NULL;
+ }
+ setup_dispatch_table();
+ GLAQUA_DEBUG_MSG("glAquaCreateContext done\n");
+ return &context->base;
+}
+
+static __GLXextensionInfo __glDDXExtensionInfo = {
+ GL_CORE_APPLE,
+ glAquaResetExtension,
+ glAquaInitVisuals,
+ glAquaSetVisualConfigs
+};
+
+void *__glXglDDXExtensionInfo(void) {
+ GLAQUA_DEBUG_MSG("glXAglDDXExtensionInfo\n");
+ return &__glDDXExtensionInfo;
+}
+
+/* maps from surface id -> list of __GLcontext */
+static x_hash_table *surface_hash;
+
+static void __glXAquaContextDestroy(__GLXcontext *baseContext) {
+ x_list *lst;
+
+ __GLXAquaContext *context = (__GLXAquaContext *) baseContext;
+
+ GLAQUA_DEBUG_MSG("glAquaContextDestroy (ctx 0x%x)\n",
+ (unsigned int) baseContext);
+ if (context != NULL) {
+ if (context->sid != 0 && surface_hash != NULL) {
+ lst = x_hash_table_lookup(surface_hash, (void *) context->sid, NULL);
+ lst = x_list_remove(lst, context);
+ x_hash_table_insert(surface_hash, (void *) context->sid, lst);
+ }
+
+ if (context->ctx != NULL) CGLDestroyContext(context->ctx);
+
+ if (context->pixelFormat != NULL) CGLDestroyPixelFormat(context->pixelFormat);
+
+ free(context);
+ }
+}
+
+static int __glXAquaContextLoseCurrent(__GLXcontext *baseContext) {
+ CGLError gl_err;
+
+ GLAQUA_DEBUG_MSG("glAquaLoseCurrent (ctx 0x%p)\n", baseContext);
+
+ gl_err = CGLSetCurrentContext(NULL);
+ if (gl_err != 0)
+ ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
+
+ __glXLastContext = NULL; // Mesa does this; why?
+
+ return GL_TRUE;
+}
+
+/* Called when a surface is destroyed as a side effect of destroying
+ the window it's attached to. */
+static void surface_notify(void *_arg, void *data) {
+ DRISurfaceNotifyArg *arg = (DRISurfaceNotifyArg *)_arg;
+ __GLXAquaDrawable *draw = (__GLXAquaDrawable *)data;
+ __GLXAquaContext *context;
+ x_list *lst;
+ if(_arg == NULL || data == NULL) {
+ ErrorF("surface_notify called with bad params");
+ return;
+ }
+
+ GLAQUA_DEBUG_MSG("surface_notify(%p, %p)\n", _arg, data);
+ switch (arg->kind) {
+ case AppleDRISurfaceNotifyDestroyed:
+ if (surface_hash != NULL)
+ x_hash_table_remove(surface_hash, (void *) arg->id);
+ draw->base.pDraw = NULL;
+ draw->sid = 0;
+ break;
+
+ case AppleDRISurfaceNotifyChanged:
+ if (surface_hash != NULL) {
+ lst = x_hash_table_lookup(surface_hash, (void *) arg->id, NULL);
+ for (; lst != NULL; lst = lst->next)
+ {
+ context = lst->data;
+ xp_update_gl_context(context->ctx);
+ }
+ }
+ break;
+ default:
+ ErrorF("surface_notify: unknown kind %d\n", arg->kind);
+ break;
+ }
+}
+
+static void attach(__GLXAquaContext *context, __GLXAquaDrawable *draw) {
+ DrawablePtr pDraw;
+ GLAQUA_DEBUG_MSG("attach(%p, %p)\n", context, draw);
+ pDraw = draw->base.pDraw;
+
+ if (draw->sid == 0) {
+// if (!quartzProcs->CreateSurface(pDraw->pScreen, pDraw->id, pDraw,
+ if (!DRICreateSurface(pDraw->pScreen, pDraw->id, pDraw,
+ 0, &draw->sid, NULL,
+ surface_notify, draw))
+ return;
+ draw->pDraw = pDraw;
+ }
+
+ if (!context->isAttached || context->sid != draw->sid) {
+ x_list *lst;
+
+ if (xp_attach_gl_context(context->ctx, draw->sid) != Success) {
+// quartzProcs->DestroySurface(pDraw->pScreen, pDraw->id, pDraw,
+ DRIDestroySurface(pDraw->pScreen, pDraw->id, pDraw,
+ surface_notify, draw);
+ if (surface_hash != NULL)
+ x_hash_table_remove(surface_hash, (void *) draw->sid);
+
+ draw->sid = 0;
+ return;
+ }
+
+ context->isAttached = TRUE;
+ context->sid = draw->sid;
+
+ if (surface_hash == NULL)
+ surface_hash = x_hash_table_new(NULL, NULL, NULL, NULL);
+
+ lst = x_hash_table_lookup(surface_hash, (void *) context->sid, NULL);
+ if (x_list_find(lst, context) == NULL) {
+ lst = x_list_prepend(lst, context);
+ x_hash_table_insert(surface_hash, (void *) context->sid, lst);
+ }
+
+ GLAQUA_DEBUG_MSG("attached 0x%x to 0x%x\n", (unsigned int) pDraw->id,
+ (unsigned int) draw->sid);
+ }
+}
+
+#if 0 // unused
+static void unattach(__GLXAquaContext *context) {
+ x_list *lst;
+ GLAQUA_DEBUG_MSG("unattach\n");
+ if (context == NULL) {
+ ErrorF("Tried to unattach a null context\n");
+ return;
+ }
+ if (context->isAttached) {
+ GLAQUA_DEBUG_MSG("unattaching\n");
+
+ if (surface_hash != NULL) {
+ lst = x_hash_table_lookup(surface_hash, (void *) context->sid, NULL);
+ lst = x_list_remove(lst, context);
+ x_hash_table_insert(surface_hash, (void *) context->sid, lst);
+ }
+
+ CGLClearDrawable(context->ctx);
+ context->isAttached = FALSE;
+ context->sid = 0;
+ }
+}
+#endif
+
+static int __glXAquaContextMakeCurrent(__GLXcontext *baseContext) {
+ CGLError gl_err;
+ __GLXAquaContext *context = (__GLXAquaContext *) baseContext;
+ __GLXAquaDrawable *drawPriv = (__GLXAquaDrawable *) context->base.drawPriv;
+
+ GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%p)\n", baseContext);
+
+ attach(context, drawPriv);
+
+ gl_err = CGLSetCurrentContext(context->ctx);
+ if (gl_err != 0)
+ ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
+
+ return gl_err == 0;
+}
+
+static int __glXAquaContextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc, unsigned long mask)
+{
+ CGLError gl_err;
+
+ __GLXAquaContext *dst = (__GLXAquaContext *) baseDst;
+ __GLXAquaContext *src = (__GLXAquaContext *) baseSrc;
+
+ GLAQUA_DEBUG_MSG("GLXAquaContextCopy\n");
+
+ gl_err = CGLCopyContext(src->ctx, dst->ctx, mask);
+ if (gl_err != 0)
+ ErrorF("CGLCopyContext error: %s\n", CGLErrorString(gl_err));
+
+ return gl_err == 0;
+}
+
+static int __glXAquaContextForceCurrent(__GLXcontext *baseContext)
+{
+ CGLError gl_err;
+ __GLXAquaContext *context = (__GLXAquaContext *) baseContext;
+ GLAQUA_DEBUG_MSG("glAquaForceCurrent (ctx %p)\n", context->ctx);
+
+ gl_err = CGLSetCurrentContext(context->ctx);
+ if (gl_err != 0)
+ ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
+
+ return gl_err == 0;
+}
+
+/* Drawing surface notification callbacks */
+
+static GLboolean __glXAquaDrawableResize(__GLXdrawable *base) {
+ GLAQUA_DEBUG_MSG("unimplemented glAquaDrawableResize\n");
+ return GL_TRUE;
+}
+
+static GLboolean __glXAquaDrawableSwapBuffers(__GLXdrawable *base) {
+ CGLError gl_err;
+ __GLXAquaContext * drawableCtx;
+// GLAQUA_DEBUG_MSG("glAquaDrawableSwapBuffers(%p)\n",base);
+
+ if(!base) {
+ ErrorF("glXAquaDrawbleSwapBuffers passed NULL\n");
+ return GL_FALSE;
+ }
+
+ drawableCtx = (__GLXAquaContext *)base->drawGlxc;
+
+ if (drawableCtx != NULL && drawableCtx->ctx != NULL) {
+ gl_err = CGLFlushDrawable(drawableCtx->ctx);
+ if (gl_err != 0)
+ ErrorF("CGLFlushDrawable error: %s\n", CGLErrorString(gl_err));
+ }
+ return GL_TRUE;
+}
+
+static CGLPixelFormatObj makeFormat(__GLcontextModes *mode) {
+ int i;
+ CGLPixelFormatAttribute attr[64]; // currently uses max of 30
+ CGLPixelFormatObj result;
+ GLint n_formats;
+ CGLError gl_err;
+
+ GLAQUA_DEBUG_MSG("makeFormat\n");
+
+ if (!mode->rgbMode)
+ return NULL;
+
+ i = 0;
+
+ // attr [i++] = kCGLPFAAcelerated; // require hwaccel - BAD for multiscreen
+ // attr [i++] = kCGLPFANoRecovery; // disable fallback renderers - BAD
+
+ if (mode->stereoMode) {
+ attr[i++] = kCGLPFAStereo;
+ }
+ if (mode->doubleBufferMode) {
+ attr[i++] = kCGLPFADoubleBuffer;
+ }
+
+ if (mode->colorIndexMode) {
+ /* ignored */
+ }
+
+ if (mode->rgbMode) {
+ attr[i++] = kCGLPFAColorSize;
+ attr[i++] = mode->redBits + mode->greenBits + mode->blueBits;
+ attr[i++] = kCGLPFAAlphaSize;
+ attr[i++] = 1; /* FIXME: ignoring mode->alphaBits which is always 0 */
+ }
+
+ if (mode->haveAccumBuffer) {
+ attr[i++] = kCGLPFAAccumSize;
+ attr[i++] = mode->accumRedBits + mode->accumGreenBits
+ + mode->accumBlueBits + mode->accumAlphaBits;
+ }
+
+ if (mode->haveDepthBuffer) {
+ attr[i++] = kCGLPFADepthSize;
+ attr[i++] = mode->depthBits;
+ }
+
+ if (mode->haveStencilBuffer) {
+ attr[i++] = kCGLPFAStencilSize;
+ attr[i++] = mode->stencilBits;
+ }
+
+ attr[i++] = kCGLPFAAuxBuffers;
+ attr[i++] = mode->numAuxBuffers;
+
+ /* mode->level ignored */
+
+ /* mode->pixmapMode ? */
+
+ attr[i++] = 0;
+
+ GLAQUA_DEBUG_MSG("makeFormat almost done\n");
+
+ result = NULL;
+ gl_err = CGLChoosePixelFormat(attr, &result, &n_formats);
+ if (gl_err != 0)
+ ErrorF("CGLChoosePixelFormat error: %s\n", CGLErrorString(gl_err));
+
+ GLAQUA_DEBUG_MSG("makeFormat done (0x%x)\n", (unsigned int) result);
+
+ return result;
+}
+
+// Originally copied from Mesa
+
+static int numConfigs = 0;
+static __GLXvisualConfig *visualConfigs = NULL;
+static void **visualPrivates = NULL;
+
+/*
+ * In the case the driver defines no GLX visuals we'll use these.
+ * Note that for TrueColor and DirectColor visuals, bufferSize is the
+ * sum of redSize, greenSize, blueSize and alphaSize, which may be larger
+ * than the nplanes/rootDepth of the server's X11 visuals
+ */
+#define NUM_FALLBACK_CONFIGS 5
+static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
+ /* [0] = RGB, double buffered, Z */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [1] = RGB, double buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 16, 16, 16, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [2] = RGB+Alpha, double buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 8, /* rgba sizes */
+ -1, -1, -1, -1, /* rgba masks */
+ 16, 16, 16, 16, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [3] = RGB+Alpha, single buffered, Z, stencil, accum */
+ {
+ -1, /* vid */
+ -1, /* class */
+ True, /* rgba */
+ -1, -1, -1, 8, /* rgba sizes */
+ -1, -1, -1, -1, /* rgba masks */
+ 16, 16, 16, 16, /* rgba accum sizes */
+ False, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 8, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+ /* [4] = CI, double buffered, Z */
+ {
+ -1, /* vid */
+ -1, /* class */
+ False, /* rgba? (false = color index) */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ True, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE, /* visualRating */
+ GLX_NONE, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+ },
+};
+
+static __GLXvisualConfig NullConfig = {
+ -1, /* vid */
+ -1, /* class */
+ False, /* rgba */
+ -1, -1, -1, 0, /* rgba sizes */
+ -1, -1, -1, 0, /* rgba masks */
+ 0, 0, 0, 0, /* rgba accum sizes */
+ False, /* doubleBuffer */
+ False, /* stereo */
+ -1, /* bufferSize */
+ 16, /* depthSize */
+ 0, /* stencilSize */
+ 0, /* auxBuffers */
+ 0, /* level */
+ GLX_NONE_EXT, /* visualRating */
+ 0, /* transparentPixel */
+ 0, 0, 0, 0, /* transparent rgba color (floats scaled to ints) */
+ 0 /* transparentIndex */
+};
+
+
+static inline int count_bits(uint32_t x)
+{
+ x = x - ((x >> 1) & 0x55555555);
+ x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
+ x = (x + (x >> 4)) & 0x0f0f0f0f;
+ x = x + (x >> 8);
+ x = x + (x >> 16);
+ return x & 63;
+}
+
+
+static Bool init_visuals(int *nvisualp, VisualPtr *visualp,
+ VisualID *defaultVisp,
+ int ndepth, DepthPtr pdepth,
+ int rootDepth)
+{
+ int numRGBconfigs;
+ int numCIconfigs;
+ int numVisuals = *nvisualp;
+ int numNewVisuals;
+ int numNewConfigs;
+ VisualPtr pVisual = *visualp;
+ VisualPtr pVisualNew = NULL;
+ VisualID *orig_vid = NULL;
+ __GLcontextModes *modes;
+ __GLXvisualConfig *pNewVisualConfigs = NULL;
+ void **glXVisualPriv;
+ void **pNewVisualPriv;
+ int found_default;
+ int i, j, k;
+
+ GLAQUA_DEBUG_MSG("init_visuals\n");
+
+ if (numConfigs > 0)
+ numNewConfigs = numConfigs;
+ else
+ numNewConfigs = NUM_FALLBACK_CONFIGS;
+
+ /* Alloc space for the list of new GLX visuals */
+ pNewVisualConfigs = (__GLXvisualConfig *)
+ malloc(numNewConfigs * sizeof(__GLXvisualConfig));
+ if (!pNewVisualConfigs) {
+ return FALSE;
+ }
+
+ /* Alloc space for the list of new GLX visual privates */
+ pNewVisualPriv = (void **) malloc(numNewConfigs * sizeof(void *));
+ if (!pNewVisualPriv) {
+ free(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /*
+ ** If SetVisualConfigs was not called, then use default GLX
+ ** visual configs.
+ */
+ if (numConfigs == 0) {
+ memcpy(pNewVisualConfigs, FallbackConfigs,
+ NUM_FALLBACK_CONFIGS * sizeof(__GLXvisualConfig));
+ memset(pNewVisualPriv, 0, NUM_FALLBACK_CONFIGS * sizeof(void *));
+ }
+ else {
+ /* copy driver's visual config info */
+ for (i = 0; i < numConfigs; i++) {
+ pNewVisualConfigs[i] = visualConfigs[i];
+ pNewVisualPriv[i] = visualPrivates[i];
+ }
+ }
+
+ /* Count the number of RGB and CI visual configs */
+ numRGBconfigs = 0;
+ numCIconfigs = 0;
+ for (i = 0; i < numNewConfigs; i++) {
+ if (pNewVisualConfigs[i].rgba)
+ numRGBconfigs++;
+ else
+ numCIconfigs++;
+ }
+
+ /* Count the total number of visuals to compute */
+ numNewVisuals = 0;
+ for (i = 0; i < numVisuals; i++) {
+ int count;
+
+ count = ((pVisual[i].class == TrueColor ||
+ pVisual[i].class == DirectColor)
+ ? numRGBconfigs : numCIconfigs);
+ if (count == 0)
+ count = 1; /* preserve the existing visual */
+
+ numNewVisuals += count;
+ }
+
+ /* Reset variables for use with the next screen/driver's visual configs */
+ visualConfigs = NULL;
+ numConfigs = 0;
+
+ /* Alloc temp space for the list of orig VisualIDs for each new visual */
+ orig_vid = (VisualID *)malloc(numNewVisuals * sizeof(VisualID));
+ if (!orig_vid) {
+ free(pNewVisualPriv);
+ free(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the list of glXVisuals */
+ modes = _gl_context_modes_create(numNewVisuals, sizeof(__GLcontextModes));
+ if (modes == NULL) {
+ free(orig_vid);
+ free(pNewVisualPriv);
+ free(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the list of glXVisualPrivates */
+ glXVisualPriv = (void **)malloc(numNewVisuals * sizeof(void *));
+ if (!glXVisualPriv) {
+ _gl_context_modes_destroy( modes );
+ free(orig_vid);
+ free(pNewVisualPriv);
+ free(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Alloc space for the new list of the X server's visuals */
+ pVisualNew = (VisualPtr)malloc(numNewVisuals * sizeof(VisualRec));
+ if (!pVisualNew) {
+ free(glXVisualPriv);
+ _gl_context_modes_destroy( modes );
+ free(orig_vid);
+ free(pNewVisualPriv);
+ free(pNewVisualConfigs);
+ return FALSE;
+ }
+
+ /* Initialize the new visuals */
+ found_default = FALSE;
+ glAquaScreens[screenInfo.numScreens-1].modes = modes;
+ for (i = j = 0; i < numVisuals; i++) {
+ int is_rgb = (pVisual[i].class == TrueColor ||
+ pVisual[i].class == DirectColor);
+
+ if (!is_rgb)
+ {
+ /* We don't support non-rgb visuals for GL. But we don't
+ want to remove them either, so just pass them through
+ with null glX configs */
+
+ pVisualNew[j] = pVisual[i];
+ pVisualNew[j].vid = FakeClientID(0);
+
+ /* Check for the default visual */
+ if (!found_default && pVisual[i].vid == *defaultVisp) {
+ *defaultVisp = pVisualNew[j].vid;
+ found_default = TRUE;
+ }
+
+ /* Save the old VisualID */
+ orig_vid[j] = pVisual[i].vid;
+
+ /* Initialize the glXVisual */
+ _gl_copy_visual_to_context_mode( modes, & NullConfig );
+ modes->visualID = pVisualNew[j].vid;
+
+ j++;
+
+ continue;
+ }
+
+ for (k = 0; k < numNewConfigs; k++) {
+ if (pNewVisualConfigs[k].rgba != is_rgb)
+ continue;
+
+ assert( modes != NULL );
+
+ /* Initialize the new visual */
+ pVisualNew[j] = pVisual[i];
+ pVisualNew[j].vid = FakeClientID(0);
+
+ /* Check for the default visual */
+ if (!found_default && pVisual[i].vid == *defaultVisp) {
+ *defaultVisp = pVisualNew[j].vid;
+ found_default = TRUE;
+ }
+
+ /* Save the old VisualID */
+ orig_vid[j] = pVisual[i].vid;
+
+ /* Initialize the glXVisual */
+ _gl_copy_visual_to_context_mode( modes, & pNewVisualConfigs[k] );
+ modes->visualID = pVisualNew[j].vid;
+
+ /*
+ * If the class is -1, then assume the X visual information
+ * is identical to what GLX needs, and take them from the X
+ * visual. NOTE: if class != -1, then all other fields MUST
+ * be initialized.
+ */
+ if (modes->visualType == GLX_NONE) {
+ modes->visualType = _gl_convert_from_x_visual_type( pVisual[i].class );
+ modes->redBits = count_bits(pVisual[i].redMask);
+ modes->greenBits = count_bits(pVisual[i].greenMask);
+ modes->blueBits = count_bits(pVisual[i].blueMask);
+ modes->alphaBits = modes->alphaBits;
+ modes->redMask = pVisual[i].redMask;
+ modes->greenMask = pVisual[i].greenMask;
+ modes->blueMask = pVisual[i].blueMask;
+ modes->alphaMask = modes->alphaMask;
+ modes->rgbBits = (is_rgb)
+ ? (modes->redBits + modes->greenBits +
+ modes->blueBits + modes->alphaBits)
+ : rootDepth;
+ }
+
+ /* Save the device-dependent private for this visual */
+ glXVisualPriv[j] = pNewVisualPriv[k];
+
+ j++;
+ modes = modes->next;
+ }
+ }
+
+ assert(j <= numNewVisuals);
+
+ /* Save the GLX visuals in the screen structure */
+ glAquaScreens[screenInfo.numScreens-1].num_vis = numNewVisuals;
+ // glAquaScreens[screenInfo.numScreens-1].priv = glXVisualPriv;
+
+ /* set up depth's VisualIDs */
+ for (i = 0; i < ndepth; i++) {
+ int numVids = 0;
+ VisualID *pVids = NULL;
+ int k, n = 0;
+
+ /* Count the new number of VisualIDs at this depth */
+ for (j = 0; j < pdepth[i].numVids; j++)
+ for (k = 0; k < numNewVisuals; k++)
+ if (pdepth[i].vids[j] == orig_vid[k])
+ numVids++;
+
+ /* Allocate a new list of VisualIDs for this depth */
+ pVids = (VisualID *)malloc(numVids * sizeof(VisualID));
+
+ /* Initialize the new list of VisualIDs for this depth */
+ for (j = 0; j < pdepth[i].numVids; j++)
+ for (k = 0; k < numNewVisuals; k++)
+ if (pdepth[i].vids[j] == orig_vid[k])
+ pVids[n++] = pVisualNew[k].vid;
+
+ /* Update this depth's list of VisualIDs */
+ free(pdepth[i].vids);
+ pdepth[i].vids = pVids;
+ pdepth[i].numVids = numVids;
+ }
+
+ /* Update the X server's visuals */
+ *nvisualp = numNewVisuals;
+ *visualp = pVisualNew;
+
+ /* Free the old list of the X server's visuals */
+ free(pVisual);
+
+ /* Clean up temporary allocations */
+ free(orig_vid);
+ free(pNewVisualPriv);
+ free(pNewVisualConfigs);
+
+ /* Free the private list created by DDX HW driver */
+ if (visualPrivates)
+ free(visualPrivates);
+ visualPrivates = NULL;
+
+ return TRUE;
+}
+
+Bool enable_stereo = FALSE;
+/* based on code in i830_dri.c
+ This ends calling glAquaSetVisualConfigs to set the static
+ numconfigs, etc. */
+static void
+glAquaInitVisualConfigs(void)
+{
+ int lclNumConfigs = 0;
+ __GLXvisualConfig *lclVisualConfigs = NULL;
+ void **lclVisualPrivates = NULL;
+
+ int stereo, depth, aux, buffers, stencil, accum;
+ int i = 0;
+
+ GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs ");
+
+ /* count num configs:
+ 2 stereo (on, off) (optional)
+ 2 Z buffer (0, 24 bit)
+ 2 AUX buffer (0, 2)
+ 2 buffers (single, double)
+ 2 stencil (0, 8 bit)
+ 2 accum (0, 64 bit)
+ = 64 configs with stereo, or 32 without */
+
+ if (enable_stereo) lclNumConfigs = 2 * 2 * 2 * 2 * 2 * 2; /* 64 */
+ else lclNumConfigs = 2 * 2 * 2 * 2 * 2; /* 32 */
+
+ /* alloc */
+ lclVisualConfigs = xcalloc(sizeof(__GLXvisualConfig), lclNumConfigs);
+ lclVisualPrivates = xcalloc(sizeof(void *), lclNumConfigs);
+
+ /* fill in configs */
+ if (NULL != lclVisualConfigs) {
+ i = 0; /* current buffer */
+ for (stereo = 0; stereo < (enable_stereo ? 2 : 1); stereo++) {
+ for (depth = 0; depth < 2; depth++) {
+ for (aux = 0; aux < 2; aux++) {
+ for (buffers = 0; buffers < 2; buffers++) {
+ for (stencil = 0; stencil < 2; stencil++) {
+ for (accum = 0; accum < 2; accum++) {
+ lclVisualConfigs[i].vid = -1;
+ lclVisualConfigs[i].class = -1;
+ lclVisualConfigs[i].rgba = TRUE;
+ lclVisualConfigs[i].redSize = -1;
+ lclVisualConfigs[i].greenSize = -1;
+ lclVisualConfigs[i].blueSize = -1;
+ lclVisualConfigs[i].redMask = -1;
+ lclVisualConfigs[i].greenMask = -1;
+ lclVisualConfigs[i].blueMask = -1;
+ lclVisualConfigs[i].alphaMask = 0;
+ if (accum) {
+ lclVisualConfigs[i].accumRedSize = 16;
+ lclVisualConfigs[i].accumGreenSize = 16;
+ lclVisualConfigs[i].accumBlueSize = 16;
+ lclVisualConfigs[i].accumAlphaSize = 16;
+ } else {
+ lclVisualConfigs[i].accumRedSize = 0;
+ lclVisualConfigs[i].accumGreenSize = 0;
+ lclVisualConfigs[i].accumBlueSize = 0;
+ lclVisualConfigs[i].accumAlphaSize = 0;
+ }
+ lclVisualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE;
+ lclVisualConfigs[i].stereo = stereo ? TRUE : FALSE;
+ lclVisualConfigs[i].bufferSize = -1;
+
+ lclVisualConfigs[i].depthSize = depth? 24 : 0;
+ lclVisualConfigs[i].stencilSize = stencil ? 8 : 0;
+ lclVisualConfigs[i].auxBuffers = aux ? 2 : 0;
+ lclVisualConfigs[i].level = 0;
+ lclVisualConfigs[i].visualRating = GLX_NONE_EXT;
+ lclVisualConfigs[i].transparentPixel = 0;
+ lclVisualConfigs[i].transparentRed = 0;
+ lclVisualConfigs[i].transparentGreen = 0;
+ lclVisualConfigs[i].transparentBlue = 0;
+ lclVisualConfigs[i].transparentAlpha = 0;
+ lclVisualConfigs[i].transparentIndex = 0;
+ i++;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ if (i != lclNumConfigs)
+ GLAQUA_DEBUG_MSG("glAquaInitVisualConfigs failed to alloc visual configs");
+
+ GlxSetVisualConfigs(lclNumConfigs, lclVisualConfigs, lclVisualPrivates);
+}
+
+
+static void glAquaSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
+ void **privates)
+{
+ GLAQUA_DEBUG_MSG("glAquaSetVisualConfigs\n");
+
+ numConfigs = nconfigs;
+ visualConfigs = configs;
+ visualPrivates = privates;
+}
+
+static Bool glAquaInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
+ int *nvisualp, int *ndepthp,
+ int *rootDepthp, VisualID *defaultVisp,
+ unsigned long sizes, int bitsPerRGB)
+{
+ GLAQUA_DEBUG_MSG("glAquaInitVisuals\n");
+
+ if (numConfigs == 0) /* if no configs */
+ glAquaInitVisualConfigs(); /* ensure the visual configs are setup */
+
+ /*
+ * setup the visuals supported by this particular screen.
+ */
+ return init_visuals(nvisualp, visualp, defaultVisp,
+ *ndepthp, *depthp, *rootDepthp);
+}
+
+#if 0
+static void fixup_visuals(int screen)
+{
+ ScreenPtr pScreen = screenInfo.screens[screen];
+ glAquaScreenRec *pScr = &glAquaScreens[screen];
+ int j;
+ __GLcontextModes *modes;
+
+ GLAQUA_DEBUG_MSG("fixup_visuals\n");
+
+ for ( modes = pScr->modes ; modes != NULL ; modes = modes->next ) {
+ const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
+ const int nplanes = (modes->rgbBits - modes->alphaBits);
+ const VisualPtr pVis = pScreen->visuals;
+
+ /* Find a visual that matches the GLX visual's class and size */
+ for (j = 0; j < pScreen->numVisuals; j++) {
+ if (pVis[j].class == vis_class &&
+ pVis[j].nplanes == nplanes) {
+
+ /* Fixup the masks */
+ modes->redMask = pVis[j].redMask;
+ modes->greenMask = pVis[j].greenMask;
+ modes->blueMask = pVis[j].blueMask;
+
+ /* Recalc the sizes */
+ modes->redBits = count_bits(modes->redMask);
+ modes->greenBits = count_bits(modes->greenMask);
+ modes->blueBits = count_bits(modes->blueMask);
+ }
+ }
+ }
+}
+#endif
+static void __glXAquaScreenDestroy(__GLXscreen *screen) {
+
+ GLAQUA_DEBUG_MSG("glXAquaScreenDestroy(%p)\n", screen);
+ __glXScreenDestroy(screen);
+
+ free(screen);
+}
+
+static void init_screen_visuals(__GLXAquaScreen *screen) {
+ ScreenPtr pScreen = screen->base.pScreen;
+
+ __GLcontextModes *modes;
+ int *used;
+ int i, j;
+
+ GLAQUA_DEBUG_MSG("init_screen_visuals\n");
+
+ /* FIXME: Change 'used' to be a array of bits (rather than of ints),
+ * FIXME: create a stack array of 8 or 16 bytes. If 'numVisuals' is less
+ * FIXME: than 64 or 128 the stack array can be used instead of calling
+ * FIXME: malloc / free. If nothing else, convert 'used' to
+ * FIXME: array of bytes instead of ints!
+ */
+ used = (int *)malloc(pScreen->numVisuals * sizeof(int));
+ memset(used, 0, pScreen->numVisuals * sizeof(int));
+
+ i = 0;
+ for ( modes = screen -> base.modes
+ ; modes != NULL
+ ; modes = modes->next ) {
+ const int vis_class = _gl_convert_to_x_visual_type( modes->visualType );
+ const int nplanes = (modes->rgbBits - modes->alphaBits);
+ const VisualPtr pVis = pScreen->visuals;
+
+ for (j = 0; j < pScreen->numVisuals; j++) {
+ if (pVis[j].class == vis_class &&
+ pVis[j].nplanes == nplanes &&
+ pVis[j].redMask == modes->redMask &&
+ pVis[j].greenMask == modes->greenMask &&
+ pVis[j].blueMask == modes->blueMask &&
+ !used[j]) {
+
+ /* set the VisualID */
+ modes->visualID = pVis[j].vid;
+
+ /* Mark this visual used */
+ used[j] = 1;
+ break;
+ }
+ }
+ if ( j == pScreen->numVisuals ) {
+ ErrorF("No matching visual for __GLcontextMode with "
+ "visual class = %d (%d), nplanes = %u\n",
+ vis_class,
+ (int)modes->visualType,
+ (unsigned int)(modes->rgbBits - modes->alphaBits) );
+ }
+ else if ( modes->visualID == -1 ) {
+ FatalError( "Matching visual found, but visualID still -1!\n" );
+ }
+
+ i++;
+ }
+
+ free(used);
+}
+
+static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) {
+ __GLXAquaScreen *screen;
+ GLAQUA_DEBUG_MSG("glXAquaScreenProbe\n");
+ if (screen == NULL) return NULL;
+
+ screen = malloc(sizeof *screen);
+
+ __glXScreenInit(&screen->base, pScreen);
+
+ screen->base.destroy = __glXAquaScreenDestroy;
+ screen->base.createContext = __glXAquaScreenCreateContext;
+ screen->base.createDrawable = __glXAquaScreenCreateDrawable;
+ screen->base.pScreen = pScreen;
+
+ init_screen_visuals(screen);
+
+ return &screen->base;
+}
+
+static void __glXAquaDrawableDestroy(__GLXdrawable *base) {
+ GLAQUA_DEBUG_MSG("glAquaDestroyDrawablePrivate\n");
+
+ /* It doesn't work to call DRIDestroySurface here, the drawable's
+ already gone.. But dri.c notices the window destruction and
+ frees the surface itself. */
+
+ free(base);
+}
+
+static __GLXdrawable *
+__glXAquaScreenCreateDrawable(__GLXscreen *screen,
+ DrawablePtr pDraw,
+ XID drawId,
+ __GLcontextModes *modes) {
+ __GLXAquaDrawable *glxPriv;
+
+ GLAQUA_DEBUG_MSG("glAquaScreenCreateDrawable(%p,%p,%d,%p)\n", context, pDraw, drawId, modes);
+
+ glxPriv = xalloc(sizeof *glxPriv);
+ if (glxPriv == NULL) return NULL;
+
+ memset(glxPriv, 0, sizeof *glxPriv);
+
+ if (!__glXDrawableInit(&glxPriv->base, screen, pDraw, drawId, modes)) {
+ xfree(glxPriv);
+ return NULL;
+ }
+
+ glxPriv->base.destroy = __glXAquaDrawableDestroy;
+ glxPriv->base.resize = __glXAquaDrawableResize;
+ glxPriv->base.swapBuffers = __glXAquaDrawableSwapBuffers;
+ // glxPriv->base.copySubBuffer = __glXAquaDrawableCopySubBuffer;
+
+ return &glxPriv->base;
+}
+
+static void glAquaResetExtension(void)
+{
+ GLAQUA_DEBUG_MSG("glAquaResetExtension\n");
+ CGLSetOption(kCGLGOResetLibrary, GL_TRUE);
+}
+
+// Extra goodies for glx
+
+GLuint __glFloorLog2(GLuint val)
+{
+ int c = 0;
+
+ while (val > 1) {
+ c++;
+ val >>= 1;
+ }
+ return c;
+}
+
+void warn_func(void * p1, char *format, ...) {
+ va_list v;
+ va_start(v, format);
+ vfprintf(stderr, format, v);
+ va_end(v);
+}
+
+static void setup_dispatch_table(void) {
+ struct _glapi_table *disp=_glapi_get_dispatch();
+ _glapi_set_warning_func((_glapi_warning_func)warn_func);
+ _glapi_noop_enable_warnings(TRUE);
+
+ SET_Accum(disp, glAccum);
+ SET_ActiveStencilFaceEXT(disp, glActiveStencilFaceEXT);
+ SET_ActiveTextureARB(disp, glActiveTextureARB);
+//SET_AlphaFragmentOp1ATI(disp, glAlphaFragmentOp1EXT); // <-- EXT -> ATI
+//SET_AlphaFragmentOp2ATI(disp, glAlphaFragmentOp2EXT);
+//SET_AlphaFragmentOp3ATI(disp, glAlphaFragmentOp3EXT);
+ SET_AlphaFunc(disp, glAlphaFunc);
+//SET_AreProgramsResidentNV(disp, glAreProgramsResidentNV);
+ SET_AreTexturesResident(disp, glAreTexturesResident);
+ SET_ArrayElement(disp, glArrayElement);
+ SET_AttachObjectARB(disp, glAttachObjectARB);
+ SET_Begin(disp, glBegin);
+//SET_BeginFragmentShaderATI(disp, glBeginFragmentShaderEXT); // <-- EXT -> ATI
+ SET_BeginQueryARB(disp, glBeginQueryARB);
+ SET_BindAttribLocationARB(disp, glBindAttribLocationARB);
+ SET_BindBufferARB(disp, glBindBufferARB);
+//SET_BindFragmentShaderATI(disp, glBindFragmentShaderEXT); // <-- EXT -> ATI
+ SET_BindFramebufferEXT(disp, glBindFramebufferEXT);
+//SET_BindProgramNV(disp, glBindProgramNV);
+ SET_BindRenderbufferEXT(disp, glBindRenderbufferEXT);
+ SET_BindTexture(disp, glBindTexture);
+ SET_Bitmap(disp, glBitmap);
+ SET_BlendColor(disp, glBlendColor);
+ SET_BlendEquation(disp, glBlendEquation);
+ SET_BlendEquationSeparateEXT(disp, glBlendEquationSeparateEXT);
+ SET_BlendFunc(disp, glBlendFunc);
+ SET_BlendFuncSeparateEXT(disp, glBlendFuncSeparateEXT);
+ SET_BlitFramebufferEXT(disp, glBlitFramebufferEXT);
+ SET_BufferDataARB(disp, glBufferDataARB);
+ SET_BufferSubDataARB(disp, glBufferSubDataARB);
+ SET_CallList(disp, glCallList);
+ SET_CallLists(disp, glCallLists);
+ SET_CheckFramebufferStatusEXT(disp, glCheckFramebufferStatusEXT);
+ SET_Clear(disp, glClear);
+ SET_ClearAccum(disp, glClearAccum);
+ SET_ClearColor(disp, glClearColor);
+ SET_ClearDepth(disp, glClearDepth);
+ SET_ClearIndex(disp, glClearIndex);
+ SET_ClearStencil(disp, glClearStencil);
+ SET_ClientActiveTextureARB(disp, glClientActiveTextureARB);
+ SET_ClipPlane(disp, glClipPlane);
+ SET_Color3b(disp, glColor3b);
+ SET_Color3bv(disp, glColor3bv);
+ SET_Color3d(disp, glColor3d);
+ SET_Color3dv(disp, glColor3dv);
+ SET_Color3f(disp, glColor3f);
+ SET_Color3fv(disp, glColor3fv);
+ SET_Color3i(disp, glColor3i);
+ SET_Color3iv(disp, glColor3iv);
+ SET_Color3s(disp, glColor3s);
+ SET_Color3sv(disp, glColor3sv);
+ SET_Color3ub(disp, glColor3ub);
+ SET_Color3ubv(disp, glColor3ubv);
+ SET_Color3ui(disp, glColor3ui);
+ SET_Color3uiv(disp, glColor3uiv);
+ SET_Color3us(disp, glColor3us);
+ SET_Color3usv(disp, glColor3usv);
+ SET_Color4b(disp, glColor4b);
+ SET_Color4bv(disp, glColor4bv);
+ SET_Color4d(disp, glColor4d);
+ SET_Color4dv(disp, glColor4dv);
+ SET_Color4f(disp, glColor4f);
+ SET_Color4fv(disp, glColor4fv);
+ SET_Color4i(disp, glColor4i);
+ SET_Color4iv(disp, glColor4iv);
+ SET_Color4s(disp, glColor4s);
+ SET_Color4sv(disp, glColor4sv);
+ SET_Color4ub(disp, glColor4ub);
+ SET_Color4ubv(disp, glColor4ubv);
+ SET_Color4ui(disp, glColor4ui);
+ SET_Color4uiv(disp, glColor4uiv);
+ SET_Color4us(disp, glColor4us);
+ SET_Color4usv(disp, glColor4usv);
+//SET_ColorFragmentOp1ATI(disp, glColorFragmentOp1EXT); // <-- EXT -> ATI
+//SET_ColorFragmentOp2ATI(disp, glColorFragmentOp2EXT);
+//SET_ColorFragmentOp3ATI(disp, glColorFragmentOp3EXT);
+ SET_ColorMask(disp, glColorMask);
+ SET_ColorMaterial(disp, glColorMaterial);
+ SET_ColorPointer(disp, glColorPointer);
+//SET_ColorPointerEXT(disp, glColorPointerEXT);
+ SET_ColorSubTable(disp, glColorSubTable);
+ SET_ColorTable(disp, glColorTable);
+ SET_ColorTableParameterfv(disp, glColorTableParameterfv);
+ SET_ColorTableParameteriv(disp, glColorTableParameteriv);
+ SET_CombinerInputNV(disp, glCombinerInputNV);
+ SET_CombinerOutputNV(disp, glCombinerOutputNV);
+ SET_CombinerParameterfNV(disp, glCombinerParameterfNV);
+ SET_CombinerParameterfvNV(disp, glCombinerParameterfvNV);
+ SET_CombinerParameteriNV(disp, glCombinerParameteriNV);
+ SET_CombinerParameterivNV(disp, glCombinerParameterivNV);
+ SET_CompileShaderARB(disp, glCompileShaderARB);
+ SET_CompressedTexImage1DARB(disp, glCompressedTexImage1DARB);
+ SET_CompressedTexImage2DARB(disp, glCompressedTexImage2DARB);
+ SET_CompressedTexImage3DARB(disp, glCompressedTexImage3DARB);
+ SET_CompressedTexSubImage1DARB(disp, glCompressedTexSubImage1DARB);
+ SET_CompressedTexSubImage2DARB(disp, glCompressedTexSubImage2DARB);
+ SET_CompressedTexSubImage3DARB(disp, glCompressedTexSubImage3DARB);
+ SET_ConvolutionFilter1D(disp, glConvolutionFilter1D);
+ SET_ConvolutionFilter2D(disp, glConvolutionFilter2D);
+ SET_ConvolutionParameterf(disp, glConvolutionParameterf);
+ SET_ConvolutionParameterfv(disp, glConvolutionParameterfv);
+ SET_ConvolutionParameteri(disp, glConvolutionParameteri);
+ SET_ConvolutionParameteriv(disp, glConvolutionParameteriv);
+ SET_CopyColorSubTable(disp, glCopyColorSubTable);
+ SET_CopyColorTable(disp, glCopyColorTable);
+ SET_CopyConvolutionFilter1D(disp, glCopyConvolutionFilter1D);
+ SET_CopyConvolutionFilter2D(disp, glCopyConvolutionFilter2D);
+ SET_CopyPixels(disp, glCopyPixels);
+ SET_CopyTexImage1D(disp, glCopyTexImage1D);
+ SET_CopyTexImage2D(disp, glCopyTexImage2D);
+ SET_CopyTexSubImage1D(disp, glCopyTexSubImage1D);
+ SET_CopyTexSubImage2D(disp, glCopyTexSubImage2D);
+ SET_CopyTexSubImage3D(disp, glCopyTexSubImage3D);
+ SET_CreateProgramObjectARB(disp, glCreateProgramObjectARB);
+ SET_CreateShaderObjectARB(disp, glCreateShaderObjectARB);
+ SET_CullFace(disp, glCullFace);
+//SET_CullParameterdvEXT(disp, glCullParameterdvEXT);
+//SET_CullParameterfvEXT(disp, glCullParameterfvEXT);
+ SET_DeleteBuffersARB(disp, glDeleteBuffersARB);
+ SET_DeleteFencesNV(disp, glDeleteFencesAPPLE);
+//SET_DeleteFragmentShaderATI(disp, glDeleteFragmentShaderEXT); // <-- EXT -> ATI
+ SET_DeleteFramebuffersEXT(disp, glDeleteFramebuffersEXT);
+ SET_DeleteLists(disp, glDeleteLists);
+ SET_DeleteObjectARB(disp, glDeleteObjectARB);
+//SET_DeleteProgramsNV(disp, glDeleteProgramsNV);
+ SET_DeleteQueriesARB(disp, glDeleteQueriesARB);
+ SET_DeleteRenderbuffersEXT(disp, glDeleteRenderbuffersEXT);
+ SET_DeleteTextures(disp, glDeleteTextures);
+ SET_DepthBoundsEXT(disp, glDepthBoundsEXT);
+ SET_DepthFunc(disp, glDepthFunc);
+ SET_DepthMask(disp, glDepthMask);
+ SET_DepthRange(disp, glDepthRange);
+ SET_DetachObjectARB(disp, glDetachObjectARB);
+ SET_Disable(disp, glDisable);
+ SET_DisableClientState(disp, glDisableClientState);
+ SET_DisableVertexAttribArrayARB(disp, glDisableVertexAttribArrayARB);
+ SET_DrawArrays(disp, glDrawArrays);
+ SET_DrawBuffer(disp, glDrawBuffer);
+ SET_DrawBuffersARB(disp, glDrawBuffersARB);
+ SET_DrawElements(disp, glDrawElements);
+ SET_DrawPixels(disp, glDrawPixels);
+ SET_DrawRangeElements(disp, glDrawRangeElements);
+ SET_EdgeFlag(disp, glEdgeFlag);
+ SET_EdgeFlagPointer(disp, glEdgeFlagPointer);
+//SET_EdgeFlagPointerEXT(disp, glEdgeFlagPointerEXT);
+ SET_EdgeFlagv(disp, glEdgeFlagv);
+ SET_Enable(disp, glEnable);
+ SET_EnableClientState(disp, glEnableClientState);
+ SET_EnableVertexAttribArrayARB(disp, glEnableVertexAttribArrayARB);
+ SET_End(disp, glEnd);
+//SET_EndFragmentShaderATI(disp, glEndFragmentShaderEXT); // <-- EXT -> ATI
+ SET_EndList(disp, glEndList);
+ SET_EndQueryARB(disp, glEndQueryARB);
+ SET_EvalCoord1d(disp, glEvalCoord1d);
+ SET_EvalCoord1dv(disp, glEvalCoord1dv);
+ SET_EvalCoord1f(disp, glEvalCoord1f);
+ SET_EvalCoord1fv(disp, glEvalCoord1fv);
+ SET_EvalCoord2d(disp, glEvalCoord2d);
+ SET_EvalCoord2dv(disp, glEvalCoord2dv);
+ SET_EvalCoord2f(disp, glEvalCoord2f);
+ SET_EvalCoord2fv(disp, glEvalCoord2fv);
+ SET_EvalMesh1(disp, glEvalMesh1);
+ SET_EvalMesh2(disp, glEvalMesh2);
+ SET_EvalPoint1(disp, glEvalPoint1);
+ SET_EvalPoint2(disp, glEvalPoint2);
+//SET_ExecuteProgramNV(disp, glExecuteProgramNV);
+ SET_FeedbackBuffer(disp, glFeedbackBuffer);
+ SET_FinalCombinerInputNV(disp, glFinalCombinerInputNV);
+ SET_Finish(disp, glFinish);
+ SET_FinishFenceNV(disp, glFinishFenceAPPLE); // <-- APPLE -> NV
+ SET_Flush(disp, glFlush);
+//SET_FlushVertexArrayRangeNV(disp, glFlushVertexArrayRangeNV);
+ SET_FogCoordPointerEXT(disp, glFogCoordPointerEXT);
+ SET_FogCoorddEXT(disp, glFogCoorddEXT);
+ SET_FogCoorddvEXT(disp, glFogCoorddvEXT);
+ SET_FogCoordfEXT(disp, glFogCoordfEXT);
+ SET_FogCoordfvEXT(disp, glFogCoordfvEXT);
+ SET_Fogf(disp, glFogf);
+ SET_Fogfv(disp, glFogfv);
+ SET_Fogi(disp, glFogi);
+ SET_Fogiv(disp, glFogiv);
+ SET_FramebufferRenderbufferEXT(disp, glFramebufferRenderbufferEXT);
+ SET_FramebufferTexture1DEXT(disp, glFramebufferTexture1DEXT);
+ SET_FramebufferTexture2DEXT(disp, glFramebufferTexture2DEXT);
+ SET_FramebufferTexture3DEXT(disp, glFramebufferTexture3DEXT);
+ SET_FrontFace(disp, glFrontFace);
+ SET_Frustum(disp, glFrustum);
+ SET_GenBuffersARB(disp, glGenBuffersARB);
+ SET_GenFencesNV(disp, glGenFencesAPPLE); // <-- APPLE -> NV
+//SET_GenFragmentShadersATI(disp, glGenFragmentShadersEXT); // <-- EXT -> ATI
+ SET_GenFramebuffersEXT(disp, glGenFramebuffersEXT);
+ SET_GenLists(disp, glGenLists);
+//SET_GenProgramsNV(disp, glGenProgramsNV);
+ SET_GenQueriesARB(disp, glGenQueriesARB);
+ SET_GenRenderbuffersEXT(disp, glGenRenderbuffersEXT);
+ SET_GenTextures(disp, glGenTextures);
+ SET_GenerateMipmapEXT(disp, glGenerateMipmapEXT);
+ SET_GetActiveAttribARB(disp, glGetActiveAttribARB);
+ SET_GetActiveUniformARB(disp, glGetActiveUniformARB);
+ SET_GetAttachedObjectsARB(disp, glGetAttachedObjectsARB);
+ SET_GetAttribLocationARB(disp, glGetAttribLocationARB);
+ SET_GetBooleanv(disp, glGetBooleanv);
+ SET_GetBufferParameterivARB(disp, glGetBufferParameterivARB);
+ SET_GetBufferPointervARB(disp, glGetBufferPointervARB);
+ SET_GetBufferSubDataARB(disp, glGetBufferSubDataARB);
+ SET_GetClipPlane(disp, glGetClipPlane);
+ SET_GetColorTable(disp, glGetColorTable);
+ SET_GetColorTableParameterfv(disp, glGetColorTableParameterfv);
+ SET_GetColorTableParameteriv(disp, glGetColorTableParameteriv);
+ SET_GetCombinerInputParameterfvNV(disp, glGetCombinerInputParameterfvNV);
+ SET_GetCombinerInputParameterivNV(disp, glGetCombinerInputParameterivNV);
+ SET_GetCombinerOutputParameterfvNV(disp, glGetCombinerOutputParameterfvNV);
+ SET_GetCombinerOutputParameterivNV(disp, glGetCombinerOutputParameterivNV);
+ SET_GetCompressedTexImageARB(disp, glGetCompressedTexImageARB);
+ SET_GetConvolutionFilter(disp, glGetConvolutionFilter);
+ SET_GetConvolutionParameterfv(disp, glGetConvolutionParameterfv);
+ SET_GetConvolutionParameteriv(disp, glGetConvolutionParameteriv);
+ SET_GetDoublev(disp, glGetDoublev);
+ SET_GetError(disp, glGetError);
+//SET_GetFenceivNV(disp, glGetFenceivNV);
+ SET_GetFinalCombinerInputParameterfvNV(disp, glGetFinalCombinerInputParameterfvNV);
+ SET_GetFinalCombinerInputParameterivNV(disp, glGetFinalCombinerInputParameterivNV);
+ SET_GetFloatv(disp, glGetFloatv);
+ SET_GetFramebufferAttachmentParameterivEXT(disp, glGetFramebufferAttachmentParameterivEXT);
+ SET_GetHandleARB(disp, glGetHandleARB);
+ SET_GetHistogram(disp, glGetHistogram);
+ SET_GetHistogramParameterfv(disp, glGetHistogramParameterfv);
+ SET_GetHistogramParameteriv(disp, glGetHistogramParameteriv);
+ SET_GetInfoLogARB(disp, glGetInfoLogARB);
+ SET_GetIntegerv(disp, glGetIntegerv);
+ SET_GetLightfv(disp, glGetLightfv);
+ SET_GetLightiv(disp, glGetLightiv);
+ SET_GetMapdv(disp, glGetMapdv);
+ SET_GetMapfv(disp, glGetMapfv);
+ SET_GetMapiv(disp, glGetMapiv);
+ SET_GetMaterialfv(disp, glGetMaterialfv);
+ SET_GetMaterialiv(disp, glGetMaterialiv);
+ SET_GetMinmax(disp, glGetMinmax);
+ SET_GetMinmaxParameterfv(disp, glGetMinmaxParameterfv);
+ SET_GetMinmaxParameteriv(disp, glGetMinmaxParameteriv);
+ SET_GetObjectParameterfvARB(disp, glGetObjectParameterfvARB);
+ SET_GetObjectParameterivARB(disp, glGetObjectParameterivARB);
+ SET_GetPixelMapfv(disp, glGetPixelMapfv);
+ SET_GetPixelMapuiv(disp, glGetPixelMapuiv);
+ SET_GetPixelMapusv(disp, glGetPixelMapusv);
+//SET_GetPixelTexGenParameterfvSGIS(disp, glGetPixelTexGenParameterfvSGIS);
+//SET_GetPixelTexGenParameterivSGIS(disp, glGetPixelTexGenParameterivSGIS);
+ SET_GetPointerv(disp, glGetPointerv);
+ SET_GetPolygonStipple(disp, glGetPolygonStipple);
+ SET_GetProgramEnvParameterdvARB(disp, glGetProgramEnvParameterdvARB);
+ SET_GetProgramEnvParameterfvARB(disp, glGetProgramEnvParameterfvARB);
+ SET_GetProgramLocalParameterdvARB(disp, glGetProgramLocalParameterdvARB);
+ SET_GetProgramLocalParameterfvARB(disp, glGetProgramLocalParameterfvARB);
+//SET_GetProgramNamedParameterdvNV(disp, glGetProgramNamedParameterdvNV);
+//SET_GetProgramNamedParameterfvNV(disp, glGetProgramNamedParameterfvNV);
+//SET_GetProgramParameterdvNV(disp, glGetProgramParameterdvNV);
+//SET_GetProgramParameterfvNV(disp, glGetProgramParameterfvNV);
+ SET_GetProgramStringARB(disp, glGetProgramStringARB);
+//SET_GetProgramStringNV(disp, glGetProgramStringNV);
+ SET_GetProgramivARB(disp, glGetProgramivARB);
+//SET_GetProgramivNV(disp, glGetProgramivNV);
+//SET_GetQueryObjecti64vEXT(disp, glGetQueryObjecti64vEXT);
+ SET_GetQueryObjectivARB(disp, glGetQueryObjectivARB);
+//SET_GetQueryObjectui64vEXT(disp, glGetQueryObjectui64vEXT);
+ SET_GetQueryObjectuivARB(disp, glGetQueryObjectuivARB);
+ SET_GetQueryivARB(disp, glGetQueryivARB);
+ SET_GetRenderbufferParameterivEXT(disp, glGetRenderbufferParameterivEXT);
+ SET_GetSeparableFilter(disp, glGetSeparableFilter);
+ SET_GetShaderSourceARB(disp, glGetShaderSourceARB);
+ SET_GetString(disp, glGetString);
+ SET_GetTexEnvfv(disp, glGetTexEnvfv);
+ SET_GetTexEnviv(disp, glGetTexEnviv);
+ SET_GetTexGendv(disp, glGetTexGendv);
+ SET_GetTexGenfv(disp, glGetTexGenfv);
+ SET_GetTexGeniv(disp, glGetTexGeniv);
+ SET_GetTexImage(disp, glGetTexImage);
+ SET_GetTexLevelParameterfv(disp, glGetTexLevelParameterfv);
+ SET_GetTexLevelParameteriv(disp, glGetTexLevelParameteriv);
+ SET_GetTexParameterfv(disp, glGetTexParameterfv);
+ SET_GetTexParameteriv(disp, glGetTexParameteriv);
+//SET_GetTrackMatrixivNV(disp, glGetTrackMatrixivNV);
+ SET_GetUniformLocationARB(disp, glGetUniformLocationARB);
+ SET_GetUniformfvARB(disp, glGetUniformfvARB);
+ SET_GetUniformivARB(disp, glGetUniformivARB);
+//SET_GetVertexAttribPointervNV(disp, glGetVertexAttribPointervNV);
+ SET_GetVertexAttribdvARB(disp, glGetVertexAttribdvARB);
+//SET_GetVertexAttribdvNV(disp, glGetVertexAttribdvNV);
+ SET_GetVertexAttribfvARB(disp, glGetVertexAttribfvARB);
+//SET_GetVertexAttribfvNV(disp, glGetVertexAttribfvNV);
+ SET_GetVertexAttribivARB(disp, glGetVertexAttribivARB);
+//SET_GetVertexAttribivNV(disp, glGetVertexAttribivNV);
+ SET_Hint(disp, glHint);
+ SET_Histogram(disp, glHistogram);
+ SET_IndexMask(disp, glIndexMask);
+ SET_IndexPointer(disp, glIndexPointer);
+//SET_IndexPointerEXT(disp, glIndexPointerEXT);
+ SET_Indexd(disp, glIndexd);
+ SET_Indexdv(disp, glIndexdv);
+ SET_Indexf(disp, glIndexf);
+ SET_Indexfv(disp, glIndexfv);
+ SET_Indexi(disp, glIndexi);
+ SET_Indexiv(disp, glIndexiv);
+ SET_Indexs(disp, glIndexs);
+ SET_Indexsv(disp, glIndexsv);
+ SET_Indexub(disp, glIndexub);
+ SET_Indexubv(disp, glIndexubv);
+ SET_InitNames(disp, glInitNames);
+ SET_InterleavedArrays(disp, glInterleavedArrays);
+ SET_IsBufferARB(disp, glIsBufferARB);
+ SET_IsEnabled(disp, glIsEnabled);
+ SET_IsFenceNV(disp, glIsFenceAPPLE); // <-- APPLE -> NV
+ SET_IsFramebufferEXT(disp, glIsFramebufferEXT);
+ SET_IsList(disp, glIsList);
+//SET_IsProgramNV(disp, glIsProgramNV);
+ SET_IsQueryARB(disp, glIsQueryARB);
+ SET_IsRenderbufferEXT(disp, glIsRenderbufferEXT);
+ SET_IsTexture(disp, glIsTexture);
+ SET_LightModelf(disp, glLightModelf);
+ SET_LightModelfv(disp, glLightModelfv);
+ SET_LightModeli(disp, glLightModeli);
+ SET_LightModeliv(disp, glLightModeliv);
+ SET_Lightf(disp, glLightf);
+ SET_Lightfv(disp, glLightfv);
+ SET_Lighti(disp, glLighti);
+ SET_Lightiv(disp, glLightiv);
+ SET_LineStipple(disp, glLineStipple);
+ SET_LineWidth(disp, glLineWidth);
+ SET_LinkProgramARB(disp, glLinkProgramARB);
+ SET_ListBase(disp, glListBase);
+ SET_LoadIdentity(disp, glLoadIdentity);
+ SET_LoadMatrixd(disp, glLoadMatrixd);
+ SET_LoadMatrixf(disp, glLoadMatrixf);
+ SET_LoadName(disp, glLoadName);
+//SET_LoadProgramNV(disp, glLoadProgramNV);
+ SET_LoadTransposeMatrixdARB(disp, glLoadTransposeMatrixdARB);
+ SET_LoadTransposeMatrixfARB(disp, glLoadTransposeMatrixfARB);
+ SET_LockArraysEXT(disp, glLockArraysEXT);
+ SET_LogicOp(disp, glLogicOp);
+ SET_Map1d(disp, glMap1d);
+ SET_Map1f(disp, glMap1f);
+ SET_Map2d(disp, glMap2d);
+ SET_Map2f(disp, glMap2f);
+ SET_MapBufferARB(disp, glMapBufferARB);
+ SET_MapGrid1d(disp, glMapGrid1d);
+ SET_MapGrid1f(disp, glMapGrid1f);
+ SET_MapGrid2d(disp, glMapGrid2d);
+ SET_MapGrid2f(disp, glMapGrid2f);
+ SET_Materialf(disp, glMaterialf);
+ SET_Materialfv(disp, glMaterialfv);
+ SET_Materiali(disp, glMateriali);
+ SET_Materialiv(disp, glMaterialiv);
+ SET_MatrixMode(disp, glMatrixMode);
+ SET_Minmax(disp, glMinmax);
+ SET_MultMatrixd(disp, glMultMatrixd);
+ SET_MultMatrixf(disp, glMultMatrixf);
+ SET_MultTransposeMatrixdARB(disp, glMultTransposeMatrixdARB);
+ SET_MultTransposeMatrixfARB(disp, glMultTransposeMatrixfARB);
+ SET_MultiDrawArraysEXT(disp, glMultiDrawArraysEXT);
+ SET_MultiDrawElementsEXT(disp, glMultiDrawElementsEXT);
+//SET_MultiModeDrawArraysIBM(disp, glMultiModeDrawArraysIBM);
+//SET_MultiModeDrawElementsIBM(disp, glMultiModeDrawElementsIBM);
+ SET_MultiTexCoord1dARB(disp, glMultiTexCoord1dARB);
+ SET_MultiTexCoord1dvARB(disp, glMultiTexCoord1dvARB);
+ SET_MultiTexCoord1fARB(disp, glMultiTexCoord1fARB);
+ SET_MultiTexCoord1fvARB(disp, glMultiTexCoord1fvARB);
+ SET_MultiTexCoord1iARB(disp, glMultiTexCoord1iARB);
+ SET_MultiTexCoord1ivARB(disp, glMultiTexCoord1ivARB);
+ SET_MultiTexCoord1sARB(disp, glMultiTexCoord1sARB);
+ SET_MultiTexCoord1svARB(disp, glMultiTexCoord1svARB);
+ SET_MultiTexCoord2dARB(disp, glMultiTexCoord2dARB);
+ SET_MultiTexCoord2dvARB(disp, glMultiTexCoord2dvARB);
+ SET_MultiTexCoord2fARB(disp, glMultiTexCoord2fARB);
+ SET_MultiTexCoord2fvARB(disp, glMultiTexCoord2fvARB);
+ SET_MultiTexCoord2iARB(disp, glMultiTexCoord2iARB);
+ SET_MultiTexCoord2ivARB(disp, glMultiTexCoord2ivARB);
+ SET_MultiTexCoord2sARB(disp, glMultiTexCoord2sARB);
+ SET_MultiTexCoord2svARB(disp, glMultiTexCoord2svARB);
+ SET_MultiTexCoord3dARB(disp, glMultiTexCoord3dARB);
+ SET_MultiTexCoord3dvARB(disp, glMultiTexCoord3dvARB);
+ SET_MultiTexCoord3fARB(disp, glMultiTexCoord3fARB);
+ SET_MultiTexCoord3fvARB(disp, glMultiTexCoord3fvARB);
+ SET_MultiTexCoord3iARB(disp, glMultiTexCoord3iARB);
+ SET_MultiTexCoord3ivARB(disp, glMultiTexCoord3ivARB);
+ SET_MultiTexCoord3sARB(disp, glMultiTexCoord3sARB);
+ SET_MultiTexCoord3svARB(disp, glMultiTexCoord3svARB);
+ SET_MultiTexCoord4dARB(disp, glMultiTexCoord4dARB);
+ SET_MultiTexCoord4dvARB(disp, glMultiTexCoord4dvARB);
+ SET_MultiTexCoord4fARB(disp, glMultiTexCoord4fARB);
+ SET_MultiTexCoord4fvARB(disp, glMultiTexCoord4fvARB);
+ SET_MultiTexCoord4iARB(disp, glMultiTexCoord4iARB);
+ SET_MultiTexCoord4ivARB(disp, glMultiTexCoord4ivARB);
+ SET_MultiTexCoord4sARB(disp, glMultiTexCoord4sARB);
+ SET_MultiTexCoord4svARB(disp, glMultiTexCoord4svARB);
+ SET_NewList(disp, glNewList);
+ SET_Normal3b(disp, glNormal3b);
+ SET_Normal3bv(disp, glNormal3bv);
+ SET_Normal3d(disp, glNormal3d);
+ SET_Normal3dv(disp, glNormal3dv);
+ SET_Normal3f(disp, glNormal3f);
+ SET_Normal3fv(disp, glNormal3fv);
+ SET_Normal3i(disp, glNormal3i);
+ SET_Normal3iv(disp, glNormal3iv);
+ SET_Normal3s(disp, glNormal3s);
+ SET_Normal3sv(disp, glNormal3sv);
+ SET_NormalPointer(disp, glNormalPointer);
+//SET_NormalPointerEXT(disp, glNormalPointerEXT);
+ SET_Ortho(disp, glOrtho);
+//SET_PassTexCoordATI(disp, glPassTexCoordEXT); // <-- EXT -> ATI
+ SET_PassThrough(disp, glPassThrough);
+ SET_PixelMapfv(disp, glPixelMapfv);
+ SET_PixelMapuiv(disp, glPixelMapuiv);
+ SET_PixelMapusv(disp, glPixelMapusv);
+ SET_PixelStoref(disp, glPixelStoref);
+ SET_PixelStorei(disp, glPixelStorei);
+//SET_PixelTexGenParameterfSGIS(disp, glPixelTexGenParameterfSGIS);
+//SET_PixelTexGenParameterfvSGIS(disp, glPixelTexGenParameterfvSGIS);
+//SET_PixelTexGenParameteriSGIS(disp, glPixelTexGenParameteriSGIS);
+//SET_PixelTexGenParameterivSGIS(disp, glPixelTexGenParameterivSGIS);
+// SET_PixelTexGenSGIX(disp, glPixelTexGenSGIX);
+ SET_PixelTransferf(disp, glPixelTransferf);
+ SET_PixelTransferi(disp, glPixelTransferi);
+ SET_PixelZoom(disp, glPixelZoom);
+ SET_PointParameterfEXT(disp, glPointParameterfARB); // <-- ARB -> EXT
+ SET_PointParameterfvEXT(disp, glPointParameterfvARB); // <-- ARB -> EXT
+ SET_PointParameteriNV(disp, glPointParameteriNV);
+ SET_PointParameterivNV(disp, glPointParameterivNV);
+ SET_PointSize(disp, glPointSize);
+ SET_PolygonMode(disp, glPolygonMode);
+ SET_PolygonOffset(disp, glPolygonOffset);
+//SET_PolygonOffsetEXT(disp, glPolygonOffsetEXT);
+ SET_PolygonStipple(disp, glPolygonStipple);
+ SET_PopAttrib(disp, glPopAttrib);
+ SET_PopClientAttrib(disp, glPopClientAttrib);
+ SET_PopMatrix(disp, glPopMatrix);
+ SET_PopName(disp, glPopName);
+ SET_PrioritizeTextures(disp, glPrioritizeTextures);
+ SET_ProgramEnvParameter4dARB(disp, glProgramEnvParameter4dARB);
+ SET_ProgramEnvParameter4dvARB(disp, glProgramEnvParameter4dvARB);
+ SET_ProgramEnvParameter4fARB(disp, glProgramEnvParameter4fARB);
+ SET_ProgramEnvParameter4fvARB(disp, glProgramEnvParameter4fvARB);
+ SET_ProgramLocalParameter4dARB(disp, glProgramLocalParameter4dARB);
+ SET_ProgramLocalParameter4dvARB(disp, glProgramLocalParameter4dvARB);
+ SET_ProgramLocalParameter4fARB(disp, glProgramLocalParameter4fARB);
+ SET_ProgramLocalParameter4fvARB(disp, glProgramLocalParameter4fvARB);
+//SET_ProgramNamedParameter4dNV(disp, glProgramNamedParameter4dNV);
+//SET_ProgramNamedParameter4dvNV(disp, glProgramNamedParameter4dvNV);
+//SET_ProgramNamedParameter4fNV(disp, glProgramNamedParameter4fNV);
+//SET_ProgramNamedParameter4fvNV(disp, glProgramNamedParameter4fvNV);
+//SET_ProgramParameter4dNV(disp, glProgramParameter4dNV);
+//SET_ProgramParameter4dvNV(disp, glProgramParameter4dvNV);
+//SET_ProgramParameter4fNV(disp, glProgramParameter4fNV);
+//SET_ProgramParameter4fvNV(disp, glProgramParameter4fvNV);
+//SET_ProgramParameters4dvNV(disp, glProgramParameters4dvNV);
+//SET_ProgramParameters4fvNV(disp, glProgramParameters4fvNV);
+ SET_ProgramStringARB(disp, glProgramStringARB);
+ SET_PushAttrib(disp, glPushAttrib);
+ SET_PushClientAttrib(disp, glPushClientAttrib);
+ SET_PushMatrix(disp, glPushMatrix);
+ SET_PushName(disp, glPushName);
+ SET_RasterPos2d(disp, glRasterPos2d);
+ SET_RasterPos2dv(disp, glRasterPos2dv);
+ SET_RasterPos2f(disp, glRasterPos2f);
+ SET_RasterPos2fv(disp, glRasterPos2fv);
+ SET_RasterPos2i(disp, glRasterPos2i);
+ SET_RasterPos2iv(disp, glRasterPos2iv);
+ SET_RasterPos2s(disp, glRasterPos2s);
+ SET_RasterPos2sv(disp, glRasterPos2sv);
+ SET_RasterPos3d(disp, glRasterPos3d);
+ SET_RasterPos3dv(disp, glRasterPos3dv);
+ SET_RasterPos3f(disp, glRasterPos3f);
+ SET_RasterPos3fv(disp, glRasterPos3fv);
+ SET_RasterPos3i(disp, glRasterPos3i);
+ SET_RasterPos3iv(disp, glRasterPos3iv);
+ SET_RasterPos3s(disp, glRasterPos3s);
+ SET_RasterPos3sv(disp, glRasterPos3sv);
+ SET_RasterPos4d(disp, glRasterPos4d);
+ SET_RasterPos4dv(disp, glRasterPos4dv);
+ SET_RasterPos4f(disp, glRasterPos4f);
+ SET_RasterPos4fv(disp, glRasterPos4fv);
+ SET_RasterPos4i(disp, glRasterPos4i);
+ SET_RasterPos4iv(disp, glRasterPos4iv);
+ SET_RasterPos4s(disp, glRasterPos4s);
+ SET_RasterPos4sv(disp, glRasterPos4sv);
+ SET_ReadBuffer(disp, glReadBuffer);
+ SET_ReadPixels(disp, glReadPixels);
+ SET_Rectd(disp, glRectd);
+ SET_Rectdv(disp, glRectdv);
+ SET_Rectf(disp, glRectf);
+ SET_Rectfv(disp, glRectfv);
+ SET_Recti(disp, glRecti);
+ SET_Rectiv(disp, glRectiv);
+ SET_Rects(disp, glRects);
+ SET_Rectsv(disp, glRectsv);
+ SET_RenderMode(disp, glRenderMode);
+ SET_RenderbufferStorageEXT(disp, glRenderbufferStorageEXT);
+//SET_RequestResidentProgramsNV(disp, glRequestResidentProgramsNV);
+ SET_ResetHistogram(disp, glResetHistogram);
+ SET_ResetMinmax(disp, glResetMinmax);
+//SET_ResizeBuffersMESA(disp, glResizeBuffersMESA);
+ SET_Rotated(disp, glRotated);
+ SET_Rotatef(disp, glRotatef);
+ SET_SampleCoverageARB(disp, glSampleCoverageARB);
+//SET_SampleMapATI(disp, glSampleMapEXT); // <-- EXT -> ATI
+//SET_SampleMaskSGIS(disp, glSampleMaskSGIS);
+//SET_SamplePatternSGIS(disp, glSamplePatternSGIS);
+ SET_Scaled(disp, glScaled);
+ SET_Scalef(disp, glScalef);
+ SET_Scissor(disp, glScissor);
+ SET_SecondaryColor3bEXT(disp, glSecondaryColor3bEXT);
+ SET_SecondaryColor3bvEXT(disp, glSecondaryColor3bvEXT);
+ SET_SecondaryColor3dEXT(disp, glSecondaryColor3dEXT);
+ SET_SecondaryColor3dvEXT(disp, glSecondaryColor3dvEXT);
+ SET_SecondaryColor3fEXT(disp, glSecondaryColor3fEXT);
+ SET_SecondaryColor3fvEXT(disp, glSecondaryColor3fvEXT);
+ SET_SecondaryColor3iEXT(disp, glSecondaryColor3iEXT);
+ SET_SecondaryColor3ivEXT(disp, glSecondaryColor3ivEXT);
+ SET_SecondaryColor3sEXT(disp, glSecondaryColor3sEXT);
+ SET_SecondaryColor3svEXT(disp, glSecondaryColor3svEXT);
+ SET_SecondaryColor3ubEXT(disp, glSecondaryColor3ubEXT);
+ SET_SecondaryColor3ubvEXT(disp, glSecondaryColor3ubvEXT);
+ SET_SecondaryColor3uiEXT(disp, glSecondaryColor3uiEXT);
+ SET_SecondaryColor3uivEXT(disp, glSecondaryColor3uivEXT);
+ SET_SecondaryColor3usEXT(disp, glSecondaryColor3usEXT);
+ SET_SecondaryColor3usvEXT(disp, glSecondaryColor3usvEXT);
+ SET_SecondaryColorPointerEXT(disp, glSecondaryColorPointerEXT);
+ SET_SelectBuffer(disp, glSelectBuffer);
+ SET_SeparableFilter2D(disp, glSeparableFilter2D);
+ SET_SetFenceNV(disp, glSetFenceAPPLE); // <-- APPLE -> NV
+//SET_SetFragmentShaderConstantATI(disp, glSetFragmentShaderConstantEXT); // <-- EXT -> ATI
+ SET_ShadeModel(disp, glShadeModel);
+ SET_ShaderSourceARB(disp, glShaderSourceARB);
+ SET_StencilFunc(disp, glStencilFunc);
+ SET_StencilFuncSeparate(disp, glStencilFuncSeparate);
+ SET_StencilMask(disp, glStencilMask);
+ SET_StencilMaskSeparate(disp, glStencilMaskSeparate);
+ SET_StencilOp(disp, glStencilOp);
+ SET_StencilOpSeparate(disp, glStencilOpSeparate);
+ SET_TestFenceNV(disp, glTestFenceAPPLE); // <-- APPLE -> NV
+ SET_TexCoord1d(disp, glTexCoord1d);
+ SET_TexCoord1dv(disp, glTexCoord1dv);
+ SET_TexCoord1f(disp, glTexCoord1f);
+ SET_TexCoord1fv(disp, glTexCoord1fv);
+ SET_TexCoord1i(disp, glTexCoord1i);
+ SET_TexCoord1iv(disp, glTexCoord1iv);
+ SET_TexCoord1s(disp, glTexCoord1s);
+ SET_TexCoord1sv(disp, glTexCoord1sv);
+ SET_TexCoord2d(disp, glTexCoord2d);
+ SET_TexCoord2dv(disp, glTexCoord2dv);
+ SET_TexCoord2f(disp, glTexCoord2f);
+ SET_TexCoord2fv(disp, glTexCoord2fv);
+ SET_TexCoord2i(disp, glTexCoord2i);
+ SET_TexCoord2iv(disp, glTexCoord2iv);
+ SET_TexCoord2s(disp, glTexCoord2s);
+ SET_TexCoord2sv(disp, glTexCoord2sv);
+ SET_TexCoord3d(disp, glTexCoord3d);
+ SET_TexCoord3dv(disp, glTexCoord3dv);
+ SET_TexCoord3f(disp, glTexCoord3f);
+ SET_TexCoord3fv(disp, glTexCoord3fv);
+ SET_TexCoord3i(disp, glTexCoord3i);
+ SET_TexCoord3iv(disp, glTexCoord3iv);
+ SET_TexCoord3s(disp, glTexCoord3s);
+ SET_TexCoord3sv(disp, glTexCoord3sv);
+ SET_TexCoord4d(disp, glTexCoord4d);
+ SET_TexCoord4dv(disp, glTexCoord4dv);
+ SET_TexCoord4f(disp, glTexCoord4f);
+ SET_TexCoord4fv(disp, glTexCoord4fv);
+ SET_TexCoord4i(disp, glTexCoord4i);
+ SET_TexCoord4iv(disp, glTexCoord4iv);
+ SET_TexCoord4s(disp, glTexCoord4s);
+ SET_TexCoord4sv(disp, glTexCoord4sv);
+ SET_TexCoordPointer(disp, glTexCoordPointer);
+//SET_TexCoordPointerEXT(disp, glTexCoordPointerEXT);
+ SET_TexEnvf(disp, glTexEnvf);
+ SET_TexEnvfv(disp, glTexEnvfv);
+ SET_TexEnvi(disp, glTexEnvi);
+ SET_TexEnviv(disp, glTexEnviv);
+ SET_TexGend(disp, glTexGend);
+ SET_TexGendv(disp, glTexGendv);
+ SET_TexGenf(disp, glTexGenf);
+ SET_TexGenfv(disp, glTexGenfv);
+ SET_TexGeni(disp, glTexGeni);
+ SET_TexGeniv(disp, glTexGeniv);
+ SET_TexImage1D(disp, glTexImage1D);
+ SET_TexImage2D(disp, glTexImage2D);
+ SET_TexImage3D(disp, glTexImage3D);
+ SET_TexParameterf(disp, glTexParameterf);
+ SET_TexParameterfv(disp, glTexParameterfv);
+ SET_TexParameteri(disp, glTexParameteri);
+ SET_TexParameteriv(disp, glTexParameteriv);
+ SET_TexSubImage1D(disp, glTexSubImage1D);
+ SET_TexSubImage2D(disp, glTexSubImage2D);
+ SET_TexSubImage3D(disp, glTexSubImage3D);
+//SET_TrackMatrixNV(disp, glTrackMatrixNV);
+ SET_Translated(disp, glTranslated);
+ SET_Translatef(disp, glTranslatef);
+ SET_Uniform1fARB(disp, glUniform1fARB);
+ SET_Uniform1fvARB(disp, glUniform1fvARB);
+ SET_Uniform1iARB(disp, glUniform1iARB);
+ SET_Uniform1ivARB(disp, glUniform1ivARB);
+ SET_Uniform2fARB(disp, glUniform2fARB);
+ SET_Uniform2fvARB(disp, glUniform2fvARB);
+ SET_Uniform2iARB(disp, glUniform2iARB);
+ SET_Uniform2ivARB(disp, glUniform2ivARB);
+ SET_Uniform3fARB(disp, glUniform3fARB);
+ SET_Uniform3fvARB(disp, glUniform3fvARB);
+ SET_Uniform3iARB(disp, glUniform3iARB);
+ SET_Uniform3ivARB(disp, glUniform3ivARB);
+ SET_Uniform4fARB(disp, glUniform4fARB);
+ SET_Uniform4fvARB(disp, glUniform4fvARB);
+ SET_Uniform4iARB(disp, glUniform4iARB);
+ SET_Uniform4ivARB(disp, glUniform4ivARB);
+ SET_UniformMatrix2fvARB(disp, glUniformMatrix2fvARB);
+ SET_UniformMatrix3fvARB(disp, glUniformMatrix3fvARB);
+ SET_UniformMatrix4fvARB(disp, glUniformMatrix4fvARB);
+ SET_UnlockArraysEXT(disp, glUnlockArraysEXT);
+ SET_UnmapBufferARB(disp, glUnmapBufferARB);
+ SET_UseProgramObjectARB(disp, glUseProgramObjectARB);
+ SET_ValidateProgramARB(disp, glValidateProgramARB);
+ SET_Vertex2d(disp, glVertex2d);
+ SET_Vertex2dv(disp, glVertex2dv);
+ SET_Vertex2f(disp, glVertex2f);
+ SET_Vertex2fv(disp, glVertex2fv);
+ SET_Vertex2i(disp, glVertex2i);
+ SET_Vertex2iv(disp, glVertex2iv);
+ SET_Vertex2s(disp, glVertex2s);
+ SET_Vertex2sv(disp, glVertex2sv);
+ SET_Vertex3d(disp, glVertex3d);
+ SET_Vertex3dv(disp, glVertex3dv);
+ SET_Vertex3f(disp, glVertex3f);
+ SET_Vertex3fv(disp, glVertex3fv);
+ SET_Vertex3i(disp, glVertex3i);
+ SET_Vertex3iv(disp, glVertex3iv);
+ SET_Vertex3s(disp, glVertex3s);
+ SET_Vertex3sv(disp, glVertex3sv);
+ SET_Vertex4d(disp, glVertex4d);
+ SET_Vertex4dv(disp, glVertex4dv);
+ SET_Vertex4f(disp, glVertex4f);
+ SET_Vertex4fv(disp, glVertex4fv);
+ SET_Vertex4i(disp, glVertex4i);
+ SET_Vertex4iv(disp, glVertex4iv);
+ SET_Vertex4s(disp, glVertex4s);
+ SET_Vertex4sv(disp, glVertex4sv);
+//SET_VertexArrayRangeNV(disp, glVertexArrayRangeNV);
+ SET_VertexAttrib1dARB(disp, glVertexAttrib1dARB);
+ SET_VertexAttrib1dvARB(disp, glVertexAttrib1dvARB);
+ SET_VertexAttrib1fARB(disp, glVertexAttrib1fARB);
+ SET_VertexAttrib1fvARB(disp, glVertexAttrib1fvARB);
+ SET_VertexAttrib1sARB(disp, glVertexAttrib1sARB);
+ SET_VertexAttrib1svARB(disp, glVertexAttrib1svARB);
+ SET_VertexAttrib2dARB(disp, glVertexAttrib2dARB);
+ SET_VertexAttrib2dvARB(disp, glVertexAttrib2dvARB);
+ SET_VertexAttrib2fARB(disp, glVertexAttrib2fARB);
+ SET_VertexAttrib2fvARB(disp, glVertexAttrib2fvARB);
+ SET_VertexAttrib2sARB(disp, glVertexAttrib2sARB);
+ SET_VertexAttrib2svARB(disp, glVertexAttrib2svARB);
+ SET_VertexAttrib3dARB(disp, glVertexAttrib3dARB);
+ SET_VertexAttrib3dvARB(disp, glVertexAttrib3dvARB);
+ SET_VertexAttrib3fARB(disp, glVertexAttrib3fARB);
+ SET_VertexAttrib3fvARB(disp, glVertexAttrib3fvARB);
+ SET_VertexAttrib3sARB(disp, glVertexAttrib3sARB);
+ SET_VertexAttrib3svARB(disp, glVertexAttrib3svARB);
+ SET_VertexAttrib4NbvARB(disp, glVertexAttrib4NbvARB);
+ SET_VertexAttrib4NivARB(disp, glVertexAttrib4NivARB);
+ SET_VertexAttrib4NsvARB(disp, glVertexAttrib4NsvARB);
+ SET_VertexAttrib4NubARB(disp, glVertexAttrib4NubARB);
+ SET_VertexAttrib4NubvARB(disp, glVertexAttrib4NubvARB);
+ SET_VertexAttrib4NuivARB(disp, glVertexAttrib4NuivARB);
+ SET_VertexAttrib4NusvARB(disp, glVertexAttrib4NusvARB);
+ SET_VertexAttrib4bvARB(disp, glVertexAttrib4bvARB);
+ SET_VertexAttrib4dARB(disp, glVertexAttrib4dARB);
+ SET_VertexAttrib4dvARB(disp, glVertexAttrib4dvARB);
+ SET_VertexAttrib4fARB(disp, glVertexAttrib4fARB);
+ SET_VertexAttrib4fvARB(disp, glVertexAttrib4fvARB);
+ SET_VertexAttrib4ivARB(disp, glVertexAttrib4ivARB);
+ SET_VertexAttrib4sARB(disp, glVertexAttrib4sARB);
+ SET_VertexAttrib4svARB(disp, glVertexAttrib4svARB);
+ SET_VertexAttrib4ubvARB(disp, glVertexAttrib4ubvARB);
+ SET_VertexAttrib4uivARB(disp, glVertexAttrib4uivARB);
+ SET_VertexAttrib4usvARB(disp, glVertexAttrib4usvARB);
+ SET_VertexAttribPointerARB(disp, glVertexAttribPointerARB);
+ SET_VertexPointer(disp, glVertexPointer);
+// SET_VertexPointerEXT(disp, glVertexPointerEXT);
+ SET_Viewport(disp, glViewport);
+ SET_WindowPos2dMESA(disp, glWindowPos2dARB);
+ SET_WindowPos2dvMESA(disp, glWindowPos2dvARB);
+ SET_WindowPos2fMESA(disp, glWindowPos2fARB);
+ SET_WindowPos2fvMESA(disp, glWindowPos2fvARB);
+ SET_WindowPos2iMESA(disp, glWindowPos2iARB);
+ SET_WindowPos2ivMESA(disp, glWindowPos2ivARB);
+ SET_WindowPos2sMESA(disp, glWindowPos2sARB);
+ SET_WindowPos2svMESA(disp, glWindowPos2svARB);
+ SET_WindowPos3dMESA(disp, glWindowPos3dARB);
+ SET_WindowPos3dvMESA(disp, glWindowPos3dvARB);
+ SET_WindowPos3fMESA(disp, glWindowPos3fARB);
+ SET_WindowPos3fvMESA(disp, glWindowPos3fvARB);
+ SET_WindowPos3iMESA(disp, glWindowPos3iARB);
+ SET_WindowPos3ivMESA(disp, glWindowPos3ivARB);
+ SET_WindowPos3sMESA(disp, glWindowPos3sARB);
+ SET_WindowPos3svMESA(disp, glWindowPos3svARB);
+//SET_WindowPos4dMESA(disp, glWindowPos4dMESA);
+//SET_WindowPos4dvMESA(disp, glWindowPos4dvMESA);
+//SET_WindowPos4fMESA(disp, glWindowPos4fMESA);
+//SET_WindowPos4fvMESA(disp, glWindowPos4fvMESA);
+//SET_WindowPos4iMESA(disp, glWindowPos4iMESA);
+//SET_WindowPos4ivMESA(disp, glWindowPos4ivMESA);
+//SET_WindowPos4sMESA(disp, glWindowPos4sMESA);
+//SET_WindowPos4svMESA(disp, glWindowPos4svMESA);
+}
diff --git a/xorg-server/hw/xquartz/Makefile.am b/xorg-server/hw/xquartz/Makefile.am
new file mode 100644
index 000000000..999013d1b
--- /dev/null
+++ b/xorg-server/hw/xquartz/Makefile.am
@@ -0,0 +1,57 @@
+noinst_LTLIBRARIES = libXquartz.la
+AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS)
+AM_OBJCFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS)
+AM_CPPFLAGS = \
+ -DBUILD_DATE=\"$(BUILD_DATE)\" \
+ -DXSERVER_VERSION=\"$(VERSION)\" \
+ -DINXQUARTZ \
+ -DUSE_NEW_CLUT \
+ -DXFree86Server \
+ -I$(top_srcdir)/miext/rootless
+
+if X11APP
+X11APP_SUBDIRS = bundle
+endif
+
+SUBDIRS = . GL xpr $(X11APP_SUBDIRS)
+DIST_SUBDIRS = GL xpr bundle
+
+libXquartz_la_SOURCES = \
+ $(top_srcdir)/fb/fbcmap_mi.c \
+ $(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/Xext/dpmsstubs.c \
+ X11Application.m \
+ X11Controller.m \
+ applewm.c \
+ darwin.c \
+ darwinEvents.c \
+ darwinKeyboard.c \
+ darwinXinput.c \
+ keysym2ucs.c \
+ pseudoramiX.c \
+ quartz.c \
+ quartzAudio.c \
+ quartzCocoa.m \
+ quartzForeground.c \
+ quartzKeyboard.c \
+ quartzPasteboard.c \
+ quartzStartup.c
+
+EXTRA_DIST = \
+ X11Application.h \
+ X11Controller.h \
+ applewmExt.h \
+ darwinClut8.h \
+ darwin.h \
+ darwinEvents.h \
+ darwinKeyboard.h \
+ keysym2ucs.h \
+ pseudoramiX.h \
+ quartz.h \
+ quartzAudio.h \
+ quartzCommon.h \
+ quartzCursor.c \
+ quartzCursor.h \
+ quartzForeground.h \
+ quartzKeyboard.h \
+ quartzPasteboard.h
diff --git a/xorg-server/hw/xquartz/Makefile.in b/xorg-server/hw/xquartz/Makefile.in
new file mode 100644
index 000000000..b57b513bf
--- /dev/null
+++ b/xorg-server/hw/xquartz/Makefile.in
@@ -0,0 +1,877 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = hw/xquartz
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \
+ $(top_builddir)/include/xorg-server.h \
+ $(top_builddir)/include/dix-config.h \
+ $(top_builddir)/include/xgl-config.h \
+ $(top_builddir)/include/xorg-config.h \
+ $(top_builddir)/include/xkb-config.h \
+ $(top_builddir)/include/xwin-config.h \
+ $(top_builddir)/include/kdrive-config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libXquartz_la_LIBADD =
+am_libXquartz_la_OBJECTS = fbcmap_mi.lo miinitext.lo dpmsstubs.lo \
+ X11Application.lo X11Controller.lo applewm.lo darwin.lo \
+ darwinEvents.lo darwinKeyboard.lo darwinXinput.lo \
+ keysym2ucs.lo pseudoramiX.lo quartz.lo quartzAudio.lo \
+ quartzCocoa.lo quartzForeground.lo quartzKeyboard.lo \
+ quartzPasteboard.lo quartzStartup.lo
+libXquartz_la_OBJECTS = $(am_libXquartz_la_OBJECTS)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+OBJCCOMPILE = $(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)
+LTOBJCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)
+OBJCLD = $(OBJC)
+SOURCES = $(libXquartz_la_SOURCES)
+DIST_SOURCES = $(libXquartz_la_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
+ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+APPDEFAULTDIR = @APPDEFAULTDIR@
+APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@
+APP_MAN_DIR = @APP_MAN_DIR@
+APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASE_FONT_PATH = @BASE_FONT_PATH@
+BUILD_DATE = @BUILD_DATE@
+BUILD_TIME = @BUILD_TIME@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DARWIN_LIBS = @DARWIN_LIBS@
+DBUS_CFLAGS = @DBUS_CFLAGS@
+DBUS_LIBS = @DBUS_LIBS@
+DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@
+DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@
+DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DGA_CFLAGS = @DGA_CFLAGS@
+DGA_LIBS = @DGA_LIBS@
+DIX_CFLAGS = @DIX_CFLAGS@
+DLLTOOL = @DLLTOOL@
+DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@
+DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@
+DMXMODULES_LIBS = @DMXMODULES_LIBS@
+DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@
+DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@
+DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@
+DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@
+DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
+DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
+DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
+DRIPROTO_LIBS = @DRIPROTO_LIBS@
+DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
+DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
+DRI_DRIVER_PATH = @DRI_DRIVER_PATH@
+DSYMUTIL = @DSYMUTIL@
+DTRACE = @DTRACE@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
+FREETYPE_LIBS = @FREETYPE_LIBS@
+GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
+GLX_DEFINES = @GLX_DEFINES@
+GL_CFLAGS = @GL_CFLAGS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+HAL_CFLAGS = @HAL_CFLAGS@
+HAL_LIBS = @HAL_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDRIVE_CFLAGS = @KDRIVE_CFLAGS@
+KDRIVE_INCS = @KDRIVE_INCS@
+KDRIVE_LIBS = @KDRIVE_LIBS@
+KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@
+KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@
+KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@
+LAUNCHD = @LAUNCHD@
+LDFLAGS = @LDFLAGS@
+LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
+LIBDRM_LIBS = @LIBDRM_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_MAN_DIR = @LIB_MAN_DIR@
+LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
+LINUXDOC = @LINUXDOC@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MAKE_HTML = @MAKE_HTML@
+MAKE_PDF = @MAKE_PDF@
+MAKE_PS = @MAKE_PS@
+MAKE_TEXT = @MAKE_TEXT@
+MESA_SOURCE = @MESA_SOURCE@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+MKFONTDIR = @MKFONTDIR@
+MKFONTSCALE = @MKFONTSCALE@
+NMEDIT = @NMEDIT@
+OBJC = @OBJC@
+OBJCCLD = @OBJCCLD@
+OBJCDEPMODE = @OBJCDEPMODE@
+OBJCFLAGS = @OBJCFLAGS@
+OBJCLINK = @OBJCLINK@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
+PCIACCESS_LIBS = @PCIACCESS_LIBS@
+PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@
+PERL = @PERL@
+PKG_CONFIG = @PKG_CONFIG@
+PROJECTROOT = @PROJECTROOT@
+PS2PDF = @PS2PDF@
+RANLIB = @RANLIB@
+RAWCPP = @RAWCPP@
+RAWCPPFLAGS = @RAWCPPFLAGS@
+SED = @SED@
+SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@
+SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@
+STRIP = @STRIP@
+TSLIB_CFLAGS = @TSLIB_CFLAGS@
+TSLIB_LIBS = @TSLIB_LIBS@
+UTILS_SYS_LIBS = @UTILS_SYS_LIBS@
+VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@
+VENDOR_NAME = @VENDOR_NAME@
+VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@
+VENDOR_RELEASE = @VENDOR_RELEASE@
+VERSION = @VERSION@
+X11APP_ARCHS = @X11APP_ARCHS@
+X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
+X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@
+XDMCP_CFLAGS = @XDMCP_CFLAGS@
+XDMCP_LIBS = @XDMCP_LIBS@
+XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@
+XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@
+XDMX_CFLAGS = @XDMX_CFLAGS@
+XDMX_LIBS = @XDMX_LIBS@
+XDMX_SYS_LIBS = @XDMX_SYS_LIBS@
+XEGLMODULES_CFLAGS = @XEGLMODULES_CFLAGS@
+XEGL_LIBS = @XEGL_LIBS@
+XEGL_SYS_LIBS = @XEGL_SYS_LIBS@
+XEPHYR_CFLAGS = @XEPHYR_CFLAGS@
+XEPHYR_DRI_LIBS = @XEPHYR_DRI_LIBS@
+XEPHYR_INCS = @XEPHYR_INCS@
+XEPHYR_LIBS = @XEPHYR_LIBS@
+XF86CONFIGFILE = @XF86CONFIGFILE@
+XF86MISC_CFLAGS = @XF86MISC_CFLAGS@
+XF86MISC_LIBS = @XF86MISC_LIBS@
+XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
+XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
+XGLMODULES_CFLAGS = @XGLMODULES_CFLAGS@
+XGLMODULES_LIBS = @XGLMODULES_LIBS@
+XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@
+XGLXMODULES_LIBS = @XGLXMODULES_LIBS@
+XGLX_LIBS = @XGLX_LIBS@
+XGLX_SYS_LIBS = @XGLX_SYS_LIBS@
+XGL_LIBS = @XGL_LIBS@
+XGL_MODULE_PATH = @XGL_MODULE_PATH@
+XGL_SYS_LIBS = @XGL_SYS_LIBS@
+XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
+XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
+XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
+XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@
+XLIB_CFLAGS = @XLIB_CFLAGS@
+XLIB_LIBS = @XLIB_LIBS@
+XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@
+XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
+XNEST_LIBS = @XNEST_LIBS@
+XNEST_SYS_LIBS = @XNEST_SYS_LIBS@
+XORGCFG_DEP_CFLAGS = @XORGCFG_DEP_CFLAGS@
+XORGCFG_DEP_LIBS = @XORGCFG_DEP_LIBS@
+XORGCONFIG_DEP_CFLAGS = @XORGCONFIG_DEP_CFLAGS@
+XORGCONFIG_DEP_LIBS = @XORGCONFIG_DEP_LIBS@
+XORG_CFLAGS = @XORG_CFLAGS@
+XORG_INCS = @XORG_INCS@
+XORG_LIBS = @XORG_LIBS@
+XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@
+XORG_MODULES_LIBS = @XORG_MODULES_LIBS@
+XORG_OS = @XORG_OS@
+XORG_OS_SUBDIR = @XORG_OS_SUBDIR@
+XORG_SYS_LIBS = @XORG_SYS_LIBS@
+XPRINTMODULES_CFLAGS = @XPRINTMODULES_CFLAGS@
+XPRINTMODULES_LIBS = @XPRINTMODULES_LIBS@
+XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@
+XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@
+XPRINT_CFLAGS = @XPRINT_CFLAGS@
+XPRINT_LIBS = @XPRINT_LIBS@
+XPRINT_SYS_LIBS = @XPRINT_SYS_LIBS@
+XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
+XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
+XSDL_INCS = @XSDL_INCS@
+XSDL_LIBS = @XSDL_LIBS@
+XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@
+XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@
+XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@
+XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@
+XSERVER_LIBS = @XSERVER_LIBS@
+XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@
+XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@
+XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@
+XVFB_LIBS = @XVFB_LIBS@
+XVFB_SYS_LIBS = @XVFB_SYS_LIBS@
+XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@
+XWINMODULES_LIBS = @XWINMODULES_LIBS@
+XWIN_LIBS = @XWIN_LIBS@
+XWIN_SERVER_NAME = @XWIN_SERVER_NAME@
+XWIN_SYS_LIBS = @XWIN_SYS_LIBS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+__XCONFIGFILE__ = @__XCONFIGFILE__@
+abi_ansic = @abi_ansic@
+abi_extension = @abi_extension@
+abi_font = @abi_font@
+abi_videodrv = @abi_videodrv@
+abi_xinput = @abi_xinput@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+driverdir = @driverdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+extdir = @extdir@
+ft_config = @ft_config@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+launchagentsdir = @launchagentsdir@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+logdir = @logdir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sdkdir = @sdkdir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+xglmoduledir = @xglmoduledir@
+xpconfigdir = @xpconfigdir@
+noinst_LTLIBRARIES = libXquartz.la
+AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS)
+AM_OBJCFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS)
+AM_CPPFLAGS = \
+ -DBUILD_DATE=\"$(BUILD_DATE)\" \
+ -DXSERVER_VERSION=\"$(VERSION)\" \
+ -DINXQUARTZ \
+ -DUSE_NEW_CLUT \
+ -DXFree86Server \
+ -I$(top_srcdir)/miext/rootless
+
+@X11APP_TRUE@X11APP_SUBDIRS = bundle
+SUBDIRS = . GL xpr $(X11APP_SUBDIRS)
+DIST_SUBDIRS = GL xpr bundle
+libXquartz_la_SOURCES = \
+ $(top_srcdir)/fb/fbcmap_mi.c \
+ $(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/Xext/dpmsstubs.c \
+ X11Application.m \
+ X11Controller.m \
+ applewm.c \
+ darwin.c \
+ darwinEvents.c \
+ darwinKeyboard.c \
+ darwinXinput.c \
+ keysym2ucs.c \
+ pseudoramiX.c \
+ quartz.c \
+ quartzAudio.c \
+ quartzCocoa.m \
+ quartzForeground.c \
+ quartzKeyboard.c \
+ quartzPasteboard.c \
+ quartzStartup.c
+
+EXTRA_DIST = \
+ X11Application.h \
+ X11Controller.h \
+ applewmExt.h \
+ darwinClut8.h \
+ darwin.h \
+ darwinEvents.h \
+ darwinKeyboard.h \
+ keysym2ucs.h \
+ pseudoramiX.h \
+ quartz.h \
+ quartzAudio.h \
+ quartzCommon.h \
+ quartzCursor.c \
+ quartzCursor.h \
+ quartzForeground.h \
+ quartzKeyboard.h \
+ quartzPasteboard.h
+
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .m .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xquartz/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign hw/xquartz/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libXquartz.la: $(libXquartz_la_OBJECTS) $(libXquartz_la_DEPENDENCIES)
+ $(OBJCLINK) $(libXquartz_la_OBJECTS) $(libXquartz_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/X11Application.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/X11Controller.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/applewm.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/darwin.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/darwinEvents.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/darwinKeyboard.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/darwinXinput.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dpmsstubs.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbcmap_mi.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keysym2ucs.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miinitext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pseudoramiX.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quartz.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quartzAudio.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quartzCocoa.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quartzForeground.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quartzKeyboard.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quartzPasteboard.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quartzStartup.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+fbcmap_mi.lo: $(top_srcdir)/fb/fbcmap_mi.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fbcmap_mi.lo -MD -MP -MF $(DEPDIR)/fbcmap_mi.Tpo -c -o fbcmap_mi.lo `test -f '$(top_srcdir)/fb/fbcmap_mi.c' || echo '$(srcdir)/'`$(top_srcdir)/fb/fbcmap_mi.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/fbcmap_mi.Tpo $(DEPDIR)/fbcmap_mi.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/fb/fbcmap_mi.c' object='fbcmap_mi.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fbcmap_mi.lo `test -f '$(top_srcdir)/fb/fbcmap_mi.c' || echo '$(srcdir)/'`$(top_srcdir)/fb/fbcmap_mi.c
+
+miinitext.lo: $(top_srcdir)/mi/miinitext.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT miinitext.lo -MD -MP -MF $(DEPDIR)/miinitext.Tpo -c -o miinitext.lo `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/miinitext.Tpo $(DEPDIR)/miinitext.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/mi/miinitext.c' object='miinitext.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o miinitext.lo `test -f '$(top_srcdir)/mi/miinitext.c' || echo '$(srcdir)/'`$(top_srcdir)/mi/miinitext.c
+
+dpmsstubs.lo: $(top_srcdir)/Xext/dpmsstubs.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dpmsstubs.lo -MD -MP -MF $(DEPDIR)/dpmsstubs.Tpo -c -o dpmsstubs.lo `test -f '$(top_srcdir)/Xext/dpmsstubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xext/dpmsstubs.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/dpmsstubs.Tpo $(DEPDIR)/dpmsstubs.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/Xext/dpmsstubs.c' object='dpmsstubs.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dpmsstubs.lo `test -f '$(top_srcdir)/Xext/dpmsstubs.c' || echo '$(srcdir)/'`$(top_srcdir)/Xext/dpmsstubs.c
+
+.m.o:
+@am__fastdepOBJC_TRUE@ $(OBJCCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepOBJC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepOBJC_FALSE@ $(OBJCCOMPILE) -c -o $@ $<
+
+.m.obj:
+@am__fastdepOBJC_TRUE@ $(OBJCCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepOBJC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepOBJC_FALSE@ $(OBJCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.m.lo:
+@am__fastdepOBJC_TRUE@ $(LTOBJCCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepOBJC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepOBJC_FALSE@ DEPDIR=$(DEPDIR) $(OBJCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepOBJC_FALSE@ $(LTOBJCCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES)
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am check check-am clean clean-generic clean-libtool \
+ clean-noinstLTLIBRARIES ctags ctags-recursive distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/xorg-server/hw/xquartz/X11Application.h b/xorg-server/hw/xquartz/X11Application.h
new file mode 100644
index 000000000..86da67f2e
--- /dev/null
+++ b/xorg-server/hw/xquartz/X11Application.h
@@ -0,0 +1,103 @@
+/* X11Application.h -- subclass of NSApplication to multiplex events
+
+ Copyright (c) 2002-2007 Apple Inc. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name(s) of the above
+ copyright holders shall not be used in advertising or otherwise to
+ promote the sale, use or other dealings in this Software without
+ prior written authorization. */
+
+#ifndef X11APPLICATION_H
+#define X11APPLICATION_H 1
+
+#if __OBJC__
+
+#import <Cocoa/Cocoa.h>
+#import "X11Controller.h"
+
+@interface X11Application : NSApplication {
+ X11Controller *_controller;
+
+ unsigned int _x_active :1;
+}
+
+- (void) set_controller:controller;
+- (void) set_window_menu:(NSArray *)list;
+
+- (int) prefs_get_integer:(NSString *)key default:(int)def;
+- (const char *) prefs_get_string:(NSString *)key default:(const char *)def;
+- (float) prefs_get_float:(NSString *)key default:(float)def;
+- (int) prefs_get_boolean:(NSString *)key default:(int)def;
+- (NSArray *) prefs_get_array:(NSString *)key;
+- (void) prefs_set_integer:(NSString *)key value:(int)value;
+- (void) prefs_set_float:(NSString *)key value:(float)value;
+- (void) prefs_set_boolean:(NSString *)key value:(int)value;
+- (void) prefs_set_array:(NSString *)key value:(NSArray *)value;
+- (void) prefs_set_string:(NSString *)key value:(NSString *)value;
+- (void) prefs_synchronize;
+
+- (BOOL) x_active;
+
+@end
+
+extern X11Application *X11App;
+
+#endif /* __OBJC__ */
+
+void X11ApplicationSetWindowMenu (int nitems, const char **items,
+ const char *shortcuts);
+void X11ApplicationSetWindowMenuCheck (int idx);
+void X11ApplicationSetFrontProcess (void);
+void X11ApplicationSetCanQuit (int state);
+void X11ApplicationServerReady (void);
+void X11ApplicationShowHideMenubar (int state);
+
+void X11ApplicationMain(int argc, const char **argv, void (*server_thread) (void *), void *server_arg);
+
+extern int X11EnableKeyEquivalents;
+extern int quartzHasRoot, quartzEnableRootless;
+
+#define APP_PREFS "org.x.X11"
+
+#define PREFS_APPSMENU "apps_menu"
+#define PREFS_FAKEBUTTONS "enable_fake_buttons"
+#define PREFS_SYSBEEP "enable_system_beep"
+#define PREFS_KEYEQUIVS "enable_key_equivalents"
+#define PREFS_KEYMAP_FILE "keymap_file"
+#define PREFS_SYNC_KEYMAP "sync_keymap"
+#define PREFS_DEPTH "depth"
+#define PREFS_NO_AUTH "no_auth"
+#define PREFS_NO_TCP "nolisten_tcp"
+#define PREFS_DONE_XINIT_CHECK "done_xinit_check"
+#define PREFS_NO_QUIT_ALERT "no_quit_alert"
+#define PREFS_FAKE_BUTTON2 "fake_button2"
+#define PREFS_FAKE_BUTTON3 "fake_button3"
+#define PREFS_ROOTLESS "rootless"
+#define PREFS_FULLSCREEN_HOTKEYS "fullscreen_hotkeys"
+#define PREFS_SWAP_ALT_META "swap_alt_meta"
+#define PREFS_XP_OPTIONS "xp_options"
+#define PREFS_ENABLE_STEREO "enable_stereo"
+#define PREFS_LOGIN_SHELL "login_shell"
+#define PREFS_QUARTZ_WM_CLICK_THROUGH "wm_click_through"
+
+#endif /* X11APPLICATION_H */
diff --git a/xorg-server/hw/xquartz/X11Application.m b/xorg-server/hw/xquartz/X11Application.m
new file mode 100644
index 000000000..be5511d30
--- /dev/null
+++ b/xorg-server/hw/xquartz/X11Application.m
@@ -0,0 +1,922 @@
+/* X11Application.m -- subclass of NSApplication to multiplex events
+
+ Copyright (c) 2002-2007 Apple Inc.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name(s) of the above
+ copyright holders shall not be used in advertising or otherwise to
+ promote the sale, use or other dealings in this Software without
+ prior written authorization. */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "quartzCommon.h"
+#include "quartzForeground.h"
+
+#import "X11Application.h"
+#include <Carbon/Carbon.h>
+
+/* ouch! */
+#define BOOL X_BOOL
+# include "darwin.h"
+# include "darwinEvents.h"
+# include "quartz.h"
+# define _APPLEWM_SERVER_
+# include "X11/extensions/applewm.h"
+# include "micmap.h"
+#undef BOOL
+
+#include <mach/mach.h>
+#include <unistd.h>
+#include <pthread.h>
+
+#include "rootlessCommon.h"
+
+WindowPtr xprGetXWindowFromAppKit(int windowNumber); // xpr/xprFrame.c
+
+#define DEFAULTS_FILE "/usr/X11/lib/X11/xserver/Xquartz.plist"
+
+int X11EnableKeyEquivalents = TRUE;
+int quartzHasRoot = FALSE, quartzEnableRootless = TRUE;
+
+extern int darwinFakeButtons, input_check_flag;
+extern Bool enable_stereo;
+
+extern xEvent *darwinEvents;
+
+X11Application *X11App;
+
+#define ALL_KEY_MASKS (NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask)
+
+@implementation X11Application
+
+typedef struct message_struct message;
+struct message_struct {
+ mach_msg_header_t hdr;
+ SEL selector;
+ NSObject *arg;
+};
+
+static mach_port_t _port;
+
+static void send_nsevent (NSEventType type, NSEvent *e);
+
+/* Quartz mode initialization routine. This is often dynamically loaded
+ but is statically linked into this X server. */
+Bool QuartzModeBundleInit(void);
+
+static void init_ports (void) {
+ kern_return_t r;
+ NSPort *p;
+
+ if (_port != MACH_PORT_NULL) return;
+
+ r = mach_port_allocate (mach_task_self (), MACH_PORT_RIGHT_RECEIVE, &_port);
+ if (r != KERN_SUCCESS) return;
+
+ p = [NSMachPort portWithMachPort:_port];
+ [p setDelegate:NSApp];
+ [p scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
+}
+
+static void message_kit_thread (SEL selector, NSObject *arg) {
+ message msg;
+ kern_return_t r;
+
+ msg.hdr.msgh_bits = MACH_MSGH_BITS (MACH_MSG_TYPE_MAKE_SEND, 0);
+ msg.hdr.msgh_size = sizeof (msg);
+ msg.hdr.msgh_remote_port = _port;
+ msg.hdr.msgh_local_port = MACH_PORT_NULL;
+ msg.hdr.msgh_reserved = 0;
+ msg.hdr.msgh_id = 0;
+
+ msg.selector = selector;
+ msg.arg = [arg retain];
+
+ r = mach_msg (&msg.hdr, MACH_SEND_MSG, msg.hdr.msgh_size,
+ 0, MACH_PORT_NULL, 0, MACH_PORT_NULL);
+ if (r != KERN_SUCCESS)
+ ErrorF("%s: mach_msg failed: %x\n", __FUNCTION__, r);
+}
+
+- (void) handleMachMessage:(void *)_msg {
+ message *msg = _msg;
+
+ [self performSelector:msg->selector withObject:msg->arg];
+ [msg->arg release];
+}
+
+- (void) set_controller:obj {
+ if (_controller == nil) _controller = [obj retain];
+}
+
+- (void) dealloc {
+ if (_controller != nil) [_controller release];
+
+ if (_port != MACH_PORT_NULL)
+ mach_port_deallocate (mach_task_self (), _port);
+
+ [super dealloc];
+}
+
+- (void) orderFrontStandardAboutPanel: (id) sender {
+ NSMutableDictionary *dict;
+ NSDictionary *infoDict;
+ NSString *tem;
+
+ dict = [NSMutableDictionary dictionaryWithCapacity:2];
+ infoDict = [[NSBundle mainBundle] infoDictionary];
+
+ [dict setObject: NSLocalizedString (@"The X Window System", @"About panel")
+ forKey:@"ApplicationName"];
+
+ tem = [infoDict objectForKey:@"CFBundleShortVersionString"];
+
+ [dict setObject:[NSString stringWithFormat:@"XQuartz %@ - (xorg-server %s)", tem, XSERVER_VERSION]
+ forKey:@"ApplicationVersion"];
+
+ [self orderFrontStandardAboutPanelWithOptions: dict];
+}
+
+- (void) activateX:(BOOL)state {
+ /* Create a TSM document that supports full Unicode input, and
+ have it activated while X is active (unless using the old
+ keymapping files) */
+ static TSMDocumentID x11_document;
+ DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active)
+ if (state) {
+ QuartzMessageServerThread (kXDarwinActivate, 0);
+
+ if (!_x_active) {
+ if (x11_document == 0 && darwinKeymapFile == NULL) {
+ OSType types[1];
+ types[0] = kUnicodeDocument;
+ NewTSMDocument (1, types, &x11_document, 0);
+ }
+
+ if (x11_document != 0) ActivateTSMDocument (x11_document);
+ }
+ } else {
+ QuartzMessageServerThread (kXDarwinDeactivate, 0);
+
+ if (_x_active && x11_document != 0)
+ DeactivateTSMDocument (x11_document);
+ }
+
+ _x_active = state;
+}
+
+- (void) became_key:(NSWindow *)win {
+ [self activateX:NO];
+}
+
+- (void) sendEvent:(NSEvent *)e {
+ NSEventType type;
+ BOOL for_appkit, for_x;
+
+ type = [e type];
+
+ /* By default pass down the responder chain and to X. */
+ for_appkit = YES;
+ for_x = YES;
+
+ switch (type) {
+ case NSLeftMouseDown: case NSRightMouseDown: case NSOtherMouseDown:
+ case NSLeftMouseUp: case NSRightMouseUp: case NSOtherMouseUp:
+ if ([e window] != nil) {
+ /* Pointer event has an (AppKit) window. Probably something for the kit. */
+ for_x = NO;
+ if (_x_active) [self activateX:NO];
+ } else if ([self modalWindow] == nil) {
+ /* Must be an X window. Tell appkit it doesn't have focus. */
+ WindowPtr pWin = xprGetXWindowFromAppKit([e windowNumber]);
+ if (pWin) RootlessReorderWindow(pWin);
+ for_appkit = NO;
+
+ if ([self isActive]) {
+ [self deactivate];
+
+ if (!_x_active && quartzProcs->IsX11Window([e window],
+ [e windowNumber]))
+ [self activateX:YES];
+ }
+ }
+ break;
+
+ case NSKeyDown: case NSKeyUp:
+ if (_x_active) {
+ static int swallow_up;
+
+ /* No kit window is focused, so send it to X. */
+ for_appkit = NO;
+ if (type == NSKeyDown) {
+ /* Before that though, see if there are any global
+ shortcuts bound to it. */
+
+ if (X11EnableKeyEquivalents
+ && [[self mainMenu] performKeyEquivalent:e]) {
+ swallow_up = [e keyCode];
+ for_x = NO;
+ } else if (!quartzEnableRootless
+ && ([e modifierFlags] & ALL_KEY_MASKS)
+ == (NSCommandKeyMask | NSAlternateKeyMask)
+ && ([e keyCode] == 0 /*a*/
+ || [e keyCode] == 53 /*Esc*/)) {
+ swallow_up = 0;
+ for_x = NO;
+#ifdef DARWIN_DDX_MISSING
+ QuartzMessageServerThread (kXDarwinToggleFullscreen, 0);
+#endif
+ }
+ } else {
+ /* If we saw a key equivalent on the down, don't pass
+ the up through to X. */
+
+ if (swallow_up != 0 && [e keyCode] == swallow_up) {
+ swallow_up = 0;
+ for_x = NO;
+ }
+ }
+ } else for_x = NO;
+ break;
+
+ case NSFlagsChanged:
+ /* For the l33t X users who remap modifier keys to normal keysyms. */
+ if (!_x_active) for_x = NO;
+ break;
+
+ case NSAppKitDefined:
+ switch ([e subtype]) {
+ case NSApplicationActivatedEventType:
+ for_x = NO;
+ if ([self modalWindow] == nil) {
+ for_appkit = NO;
+
+ /* FIXME: hack to avoid having to pass the event to appkit,
+ which would cause it to raise one of its windows. */
+ _appFlags._active = YES;
+
+ [self activateX:YES];
+ if ([e data2] & 0x10) X11ApplicationSetFrontProcess();
+ }
+ break;
+
+ case 18: /* ApplicationDidReactivate */
+ if (quartzHasRoot) for_appkit = NO;
+ break;
+
+ case NSApplicationDeactivatedEventType:
+ for_x = NO;
+ [self activateX:NO];
+ break;
+ }
+ break;
+
+ default: break; /* for gcc */
+ }
+
+ if (for_appkit) [super sendEvent:e];
+
+ if (for_x) send_nsevent (type, e);
+}
+
+- (void) set_window_menu:(NSArray *)list {
+ [_controller set_window_menu:list];
+}
+
+- (void) set_window_menu_check:(NSNumber *)n {
+ [_controller set_window_menu_check:n];
+}
+
+- (void) set_apps_menu:(NSArray *)list {
+ [_controller set_apps_menu:list];
+}
+
+- (void) set_front_process:unused {
+ /* Hackery needed due to argv[0] hackery */
+ // [self activateX:YES];
+ ProcessSerialNumber psn = { 0, kCurrentProcess };
+ SetFrontProcess(&psn);
+
+ QuartzMessageServerThread(kXDarwinBringAllToFront, 0);
+}
+
+- (void) set_can_quit:(NSNumber *)state {
+ [_controller set_can_quit:[state boolValue]];
+}
+
+- (void) server_ready:unused {
+ [_controller server_ready];
+}
+
+- (void) show_hide_menubar:(NSNumber *)state {
+ if ([state boolValue]) ShowMenuBar ();
+ else HideMenuBar ();
+}
+
+
+/* user preferences */
+
+/* Note that these functions only work for arrays whose elements
+ can be toll-free-bridged between NS and CF worlds. */
+
+static const void *cfretain (CFAllocatorRef a, const void *b) {
+ return CFRetain (b);
+}
+
+static void cfrelease (CFAllocatorRef a, const void *b) {
+ CFRelease (b);
+}
+
+static CFMutableArrayRef nsarray_to_cfarray (NSArray *in) {
+ CFMutableArrayRef out;
+ CFArrayCallBacks cb;
+ NSObject *ns;
+ const CFTypeRef *cf;
+ int i, count;
+
+ memset (&cb, 0, sizeof (cb));
+ cb.version = 0;
+ cb.retain = cfretain;
+ cb.release = cfrelease;
+
+ count = [in count];
+ out = CFArrayCreateMutable (NULL, count, &cb);
+
+ for (i = 0; i < count; i++) {
+ ns = [in objectAtIndex:i];
+
+ if ([ns isKindOfClass:[NSArray class]])
+ cf = (CFTypeRef) nsarray_to_cfarray ((NSArray *) ns);
+ else
+ cf = CFRetain ((CFTypeRef) ns);
+
+ CFArrayAppendValue (out, cf);
+ CFRelease (cf);
+ }
+
+ return out;
+}
+
+static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
+ NSMutableArray *out;
+ const CFTypeRef *cf;
+ NSObject *ns;
+ int i, count;
+
+ count = CFArrayGetCount (in);
+ out = [[NSMutableArray alloc] initWithCapacity:count];
+
+ for (i = 0; i < count; i++) {
+ cf = CFArrayGetValueAtIndex (in, i);
+
+ if (CFGetTypeID (cf) == CFArrayGetTypeID ())
+ ns = cfarray_to_nsarray ((CFArrayRef) cf);
+ else
+ ns = [(id)cf retain];
+
+ [out addObject:ns];
+ [ns release];
+ }
+
+ return out;
+}
+
+- (CFPropertyListRef) prefs_get:(NSString *)key {
+ CFPropertyListRef value;
+
+ value = CFPreferencesCopyAppValue ((CFStringRef) key, CFSTR (APP_PREFS));
+
+ if (value == NULL) {
+ static CFDictionaryRef defaults;
+
+ if (defaults == NULL) {
+ CFStringRef error = NULL;
+ CFDataRef data;
+ CFURLRef url;
+ SInt32 error_code;
+
+ url = (CFURLCreateFromFileSystemRepresentation
+ (NULL, (unsigned char *)DEFAULTS_FILE, strlen (DEFAULTS_FILE), false));
+ if (CFURLCreateDataAndPropertiesFromResource (NULL, url, &data,
+ NULL, NULL, &error_code)) {
+ defaults = (CFPropertyListCreateFromXMLData
+ (NULL, data, kCFPropertyListMutableContainersAndLeaves, &error));
+ if (error != NULL) CFRelease (error);
+ CFRelease (data);
+ }
+ CFRelease (url);
+
+ if (defaults != NULL) {
+ NSMutableArray *apps, *elt;
+ int count, i;
+ NSString *name, *nname;
+
+ /* Localize the names in the default apps menu. */
+
+ apps = [(NSDictionary *)defaults objectForKey:@PREFS_APPSMENU];
+ if (apps != nil) {
+ count = [apps count];
+ for (i = 0; i < count; i++) {
+ elt = [apps objectAtIndex:i];
+ if (elt != nil && [elt isKindOfClass:[NSArray class]]) {
+ name = [elt objectAtIndex:0];
+ if (name != nil) {
+ nname = NSLocalizedString (name, nil);
+ if (nname != nil && nname != name)
+ [elt replaceObjectAtIndex:0 withObject:nname];
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (defaults != NULL) value = CFDictionaryGetValue (defaults, key);
+ if (value != NULL) CFRetain (value);
+ }
+
+ return value;
+}
+
+- (int) prefs_get_integer:(NSString *)key default:(int)def {
+ CFPropertyListRef value;
+ int ret;
+
+ value = [self prefs_get:key];
+
+ if (value != NULL && CFGetTypeID (value) == CFNumberGetTypeID ())
+ CFNumberGetValue (value, kCFNumberIntType, &ret);
+ else if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ())
+ ret = CFStringGetIntValue (value);
+ else
+ ret = def;
+
+ if (value != NULL) CFRelease (value);
+
+ return ret;
+}
+
+- (const char *) prefs_get_string:(NSString *)key default:(const char *)def {
+ CFPropertyListRef value;
+ const char *ret = NULL;
+
+ value = [self prefs_get:key];
+
+ if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ()) {
+ NSString *s = (NSString *) value;
+
+ ret = [s UTF8String];
+ }
+
+ if (value != NULL) CFRelease (value);
+
+ return ret != NULL ? ret : def;
+}
+
+- (float) prefs_get_float:(NSString *)key default:(float)def {
+ CFPropertyListRef value;
+ float ret = def;
+
+ value = [self prefs_get:key];
+
+ if (value != NULL
+ && CFGetTypeID (value) == CFNumberGetTypeID ()
+ && CFNumberIsFloatType (value))
+ CFNumberGetValue (value, kCFNumberFloatType, &ret);
+ else if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ())
+ ret = CFStringGetDoubleValue (value);
+
+ if (value != NULL) CFRelease (value);
+
+ return ret;
+}
+
+- (int) prefs_get_boolean:(NSString *)key default:(int)def {
+ CFPropertyListRef value;
+ int ret = def;
+
+ value = [self prefs_get:key];
+
+ if (value != NULL) {
+ if (CFGetTypeID (value) == CFNumberGetTypeID ())
+ CFNumberGetValue (value, kCFNumberIntType, &ret);
+ else if (CFGetTypeID (value) == CFBooleanGetTypeID ())
+ ret = CFBooleanGetValue (value);
+ else if (CFGetTypeID (value) == CFStringGetTypeID ()) {
+ const char *tem = [(NSString *) value UTF8String];
+ if (strcasecmp (tem, "true") == 0 || strcasecmp (tem, "yes") == 0)
+ ret = YES;
+ else
+ ret = NO;
+ }
+
+ CFRelease (value);
+ }
+ return ret;
+}
+
+- (NSArray *) prefs_get_array:(NSString *)key {
+ NSArray *ret = nil;
+ CFPropertyListRef value;
+
+ value = [self prefs_get:key];
+
+ if (value != NULL) {
+ if (CFGetTypeID (value) == CFArrayGetTypeID ())
+ ret = [cfarray_to_nsarray (value) autorelease];
+
+ CFRelease (value);
+ }
+
+ return ret;
+}
+
+- (void) prefs_set_integer:(NSString *)key value:(int)value {
+ CFNumberRef x;
+
+ x = CFNumberCreate (NULL, kCFNumberIntType, &value);
+
+ CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) x, CFSTR (APP_PREFS),
+ kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+ CFRelease (x);
+}
+
+- (void) prefs_set_float:(NSString *)key value:(float)value {
+ CFNumberRef x;
+
+ x = CFNumberCreate (NULL, kCFNumberFloatType, &value);
+
+ CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) x, CFSTR (APP_PREFS),
+ kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+ CFRelease (x);
+}
+
+- (void) prefs_set_boolean:(NSString *)key value:(int)value {
+ CFPreferencesSetValue ((CFStringRef) key,
+ (CFTypeRef) value ? kCFBooleanTrue
+ : kCFBooleanFalse, CFSTR (APP_PREFS),
+ kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+
+}
+
+- (void) prefs_set_array:(NSString *)key value:(NSArray *)value {
+ CFArrayRef cfarray;
+
+ cfarray = nsarray_to_cfarray (value);
+ CFPreferencesSetValue ((CFStringRef) key,
+ (CFTypeRef) cfarray,
+ CFSTR (APP_PREFS),
+ kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
+ CFRelease (cfarray);
+}
+
+- (void) prefs_set_string:(NSString *)key value:(NSString *)value {
+ CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) value,
+ CFSTR (APP_PREFS), kCFPreferencesCurrentUser,
+ kCFPreferencesAnyHost);
+}
+
+- (void) prefs_synchronize {
+ CFPreferencesAppSynchronize (kCFPreferencesCurrentApplication);
+}
+
+- (void) read_defaults
+{
+ const char *tem;
+
+ quartzUseSysBeep = [self prefs_get_boolean:@PREFS_SYSBEEP
+ default:quartzUseSysBeep];
+ quartzEnableRootless = [self prefs_get_boolean:@PREFS_ROOTLESS
+ default:quartzEnableRootless];
+#ifdef DARWIN_DDX_MISSING
+ quartzFullscreenDisableHotkeys = ![self prefs_get_boolean:
+ @PREFS_FULLSCREEN_HOTKEYS default:
+ !quartzFullscreenDisableHotkeys];
+ quartzXpluginOptions = [self prefs_get_integer:@PREFS_XP_OPTIONS
+ default:quartzXpluginOptions];
+#endif
+ darwinFakeButtons = [self prefs_get_boolean:@PREFS_FAKEBUTTONS
+ default:darwinFakeButtons];
+ if (darwinFakeButtons) {
+ const char *fake2, *fake3;
+
+ fake2 = [self prefs_get_string:@PREFS_FAKE_BUTTON2 default:NULL];
+ fake3 = [self prefs_get_string:@PREFS_FAKE_BUTTON3 default:NULL];
+
+ if (fake2 != NULL) darwinFakeMouse2Mask = DarwinParseModifierList(fake2);
+ if (fake3 != NULL) darwinFakeMouse3Mask = DarwinParseModifierList(fake3);
+ }
+
+ X11EnableKeyEquivalents = [self prefs_get_boolean:@PREFS_KEYEQUIVS
+ default:X11EnableKeyEquivalents];
+
+ darwinSyncKeymap = [self prefs_get_boolean:@PREFS_SYNC_KEYMAP
+ default:darwinSyncKeymap];
+
+ tem = [self prefs_get_string:@PREFS_KEYMAP_FILE default:NULL];
+ if (tem != NULL) darwinKeymapFile = strdup (tem);
+ else darwinKeymapFile = NULL;
+
+ darwinDesiredDepth = [self prefs_get_integer:@PREFS_DEPTH
+ default:darwinDesiredDepth];
+
+ enable_stereo = [self prefs_get_boolean:@PREFS_ENABLE_STEREO
+ default:false];
+}
+
+/* This will end up at the end of the responder chain. */
+- (void) copy:sender {
+ QuartzMessageServerThread (kXDarwinPasteboardNotify, 1,
+ AppleWMCopyToPasteboard);
+}
+
+- (BOOL) x_active {
+ return _x_active;
+}
+
+@end
+
+static NSArray *
+array_with_strings_and_numbers (int nitems, const char **items,
+ const char *numbers) {
+ NSMutableArray *array, *subarray;
+ NSString *string, *number;
+ int i;
+
+ /* (Can't autorelease on the X server thread) */
+
+ array = [[NSMutableArray alloc] initWithCapacity:nitems];
+
+ for (i = 0; i < nitems; i++) {
+ subarray = [[NSMutableArray alloc] initWithCapacity:2];
+
+ string = [[NSString alloc] initWithUTF8String:items[i]];
+ [subarray addObject:string];
+ [string release];
+
+ if (numbers[i] != 0) {
+ number = [[NSString alloc] initWithFormat:@"%d", numbers[i]];
+ [subarray addObject:number];
+ [number release];
+ } else
+ [subarray addObject:@""];
+
+ [array addObject:subarray];
+ [subarray release];
+ }
+
+ return array;
+}
+
+void X11ApplicationSetWindowMenu (int nitems, const char **items,
+ const char *shortcuts) {
+ NSArray *array;
+ array = array_with_strings_and_numbers (nitems, items, shortcuts);
+
+ /* Send the array of strings over to the appkit thread */
+
+ message_kit_thread (@selector (set_window_menu:), array);
+ [array release];
+}
+
+void X11ApplicationSetWindowMenuCheck (int idx) {
+ NSNumber *n;
+
+ n = [[NSNumber alloc] initWithInt:idx];
+
+ message_kit_thread (@selector (set_window_menu_check:), n);
+
+ [n release];
+}
+
+void X11ApplicationSetFrontProcess (void) {
+ message_kit_thread (@selector (set_front_process:), nil);
+}
+
+void X11ApplicationSetCanQuit (int state) {
+ NSNumber *n;
+
+ n = [[NSNumber alloc] initWithBool:state];
+
+ message_kit_thread (@selector (set_can_quit:), n);
+
+ [n release];
+}
+
+void X11ApplicationServerReady (void) {
+ message_kit_thread (@selector (server_ready:), nil);
+}
+
+void X11ApplicationShowHideMenubar (int state) {
+ NSNumber *n;
+
+ n = [[NSNumber alloc] initWithBool:state];
+
+ message_kit_thread (@selector (show_hide_menubar:), n);
+
+ [n release];
+}
+
+static void * create_thread (void *func, void *arg) {
+ pthread_attr_t attr;
+ pthread_t tid;
+
+ pthread_attr_init (&attr);
+ pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM);
+ pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
+ pthread_create (&tid, &attr, func, arg);
+ pthread_attr_destroy (&attr);
+
+ return (void *) tid;
+}
+
+static void check_xinitrc (void) {
+ char *tem, buf[1024];
+ NSString *msg;
+
+ if ([X11App prefs_get_boolean:@PREFS_DONE_XINIT_CHECK default:NO])
+ return;
+
+ tem = getenv ("HOME");
+ if (tem == NULL) goto done;
+
+ snprintf (buf, sizeof (buf), "%s/.xinitrc", tem);
+ if (access (buf, F_OK) != 0)
+ goto done;
+
+ /* FIXME: put localized strings into Resources/English.lproj */
+
+ msg = NSLocalizedString (@"You have an existing ~/.xinitrc file.\n\n\
+Windows displayed by X11 applications may not have titlebars, or may look \
+different to windows displayed by native applications.\n\n\
+Would you like to move aside the existing file and use the standard X11 \
+environment?", @"Startup xinitrc dialog");
+
+ if (NSRunAlertPanel (nil, msg, NSLocalizedString (@"Yes", @""),
+ NSLocalizedString (@"No", @""), nil)
+ == NSAlertDefaultReturn) {
+ char buf2[1024];
+ int i = -1;
+
+ snprintf (buf2, sizeof (buf2), "%s.old", buf);
+
+ for (i = 1; access (buf2, F_OK) == 0; i++)
+ snprintf (buf2, sizeof (buf2), "%s.old.%d", buf, i);
+
+ rename (buf, buf2);
+ }
+
+ done:
+ [X11App prefs_set_boolean:@PREFS_DONE_XINIT_CHECK value:YES];
+ [X11App prefs_synchronize];
+}
+
+void X11ApplicationMain (int argc, const char **argv, void (*server_thread) (void *), void *server_arg) {
+ NSAutoreleasePool *pool;
+
+#ifdef DEBUG
+ while (access ("/tmp/x11-block", F_OK) == 0) sleep (1);
+#endif
+
+ pool = [[NSAutoreleasePool alloc] init];
+ X11App = (X11Application *) [X11Application sharedApplication];
+ init_ports ();
+ [NSApp read_defaults];
+ [NSBundle loadNibNamed:@"main" owner:NSApp];
+ [[NSNotificationCenter defaultCenter] addObserver:NSApp
+ selector:@selector (became_key:)
+ name:NSWindowDidBecomeKeyNotification object:nil];
+ check_xinitrc ();
+
+ /*
+ * The xpr Quartz mode is statically linked into this server.
+ * Initialize all the Quartz functions.
+ */
+ QuartzModeBundleInit();
+
+ /* Calculate the height of the menubar so we can avoid it. */
+ aquaMenuBarHeight = NSHeight([[NSScreen mainScreen] frame]) -
+ NSMaxY([[NSScreen mainScreen] visibleFrame]);
+
+ if (!create_thread (server_thread, server_arg)) {
+ ErrorF("can't create secondary thread\n");
+ exit (1);
+ }
+
+ QuartzMoveToForeground();
+
+ [NSApp run];
+ /* not reached */
+}
+
+/* event conversion */
+
+static inline unsigned short
+convert_flags (unsigned int nsflags) {
+ unsigned int xflags = 0;
+
+ if (nsflags == ~0) return 0xffff;
+
+ if (nsflags & NSAlphaShiftKeyMask) xflags |= LockMask;
+ if (nsflags & NSShiftKeyMask) xflags |= ShiftMask;
+ if (nsflags & NSControlKeyMask) xflags |= ControlMask;
+ if (nsflags & NSAlternateKeyMask) xflags |= Mod1Mask;
+ if (nsflags & NSCommandKeyMask) xflags |= Mod2Mask;
+ /* FIXME: secondaryfn? */
+
+ return xflags;
+}
+
+
+// This code should probably be merged with that in XDarwin's XServer.m - BB
+static void send_nsevent (NSEventType type, NSEvent *e) {
+ // static unsigned int button_state = 0;
+ NSRect screen;
+ NSPoint location;
+ NSWindow *window;
+ int pointer_x, pointer_y, ev_button, ev_type;
+ // int num_events=0, i=0, state;
+ // xEvent xe;
+
+ /* convert location to global top-left coordinates */
+ location = [e locationInWindow];
+ window = [e window];
+ screen = [[[NSScreen screens] objectAtIndex:0] frame];
+
+ if (window != nil) {
+ NSRect frame = [window frame];
+ pointer_x = location.x + frame.origin.x;
+ pointer_y = (((screen.origin.y + screen.size.height)
+ - location.y) - frame.origin.y);
+ } else {
+ pointer_x = location.x;
+ pointer_y = (screen.origin.y + screen.size.height) - location.y;
+ }
+
+ pointer_y -= aquaMenuBarHeight;
+ // state = convert_flags ([e modifierFlags]);
+
+ switch (type) {
+ case NSLeftMouseDown: ev_button=1; ev_type=ButtonPress; goto handle_mouse;
+ case NSOtherMouseDown: ev_button=2; ev_type=ButtonPress; goto handle_mouse;
+ case NSRightMouseDown: ev_button=3; ev_type=ButtonPress; goto handle_mouse;
+ case NSLeftMouseUp: ev_button=1; ev_type=ButtonRelease; goto handle_mouse;
+ case NSOtherMouseUp: ev_button=2; ev_type=ButtonRelease; goto handle_mouse;
+ case NSRightMouseUp: ev_button=3; ev_type=ButtonRelease; goto handle_mouse;
+ case NSLeftMouseDragged: ev_button=1; ev_type=MotionNotify; goto handle_mouse;
+ case NSOtherMouseDragged: ev_button=2; ev_type=MotionNotify; goto handle_mouse;
+ case NSRightMouseDragged: ev_button=3; ev_type=MotionNotify; goto handle_mouse;
+ case NSMouseMoved: ev_button=0; ev_type=MotionNotify; goto handle_mouse;
+ handle_mouse:
+
+ /* I'm not sure the below code is necessary or useful (-bb)
+ if(ev_type==ButtonPress) {
+ if (!quartzProcs->IsX11Window([e window], [e windowNumber])) {
+ fprintf(stderr, "Dropping event because it's not a window\n");
+ break;
+ }
+ button_state |= (1 << ev_button);
+ DarwinSendPointerEvents(ev_type, ev_button, pointer_x, pointer_y);
+ } else if (ev_type==ButtonRelease && (button_state & (1 << ev_button)) == 0) break;
+ */
+ DarwinSendPointerEvents(ev_type, ev_button, pointer_x, pointer_y);
+ break;
+ case NSScrollWheel:
+ DarwinSendScrollEvents([e deltaY], pointer_x, pointer_y);
+ break;
+
+ case NSKeyDown: // do we need to translate these keyCodes?
+ case NSKeyUp:
+ DarwinSendKeyboardEvents((type == NSKeyDown)?KeyPress:KeyRelease, [e keyCode]);
+ break;
+
+ case NSFlagsChanged:
+ DarwinUpdateModKeys([e modifierFlags]);
+ break;
+ default: break; /* for gcc */
+ }
+}
diff --git a/xorg-server/hw/xquartz/X11Controller.h b/xorg-server/hw/xquartz/X11Controller.h
new file mode 100644
index 000000000..64d5cd1ce
--- /dev/null
+++ b/xorg-server/hw/xquartz/X11Controller.h
@@ -0,0 +1,103 @@
+/* X11Controller.h -- connect the IB ui
+
+ Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name(s) of the above
+ copyright holders shall not be used in advertising or otherwise to
+ promote the sale, use or other dealings in this Software without
+ prior written authorization. */
+
+#ifndef X11CONTROLLER_H
+#define X11CONTROLLER_H 1
+
+#if __OBJC__
+
+#import <Cocoa/Cocoa.h>
+#include "xpr/x-list.h"
+
+@interface X11Controller : NSObject
+{
+ IBOutlet NSPanel *prefs_panel;
+
+ IBOutlet NSButton *fake_buttons;
+ IBOutlet NSButton *enable_fullscreen;
+ IBOutlet NSButton *use_sysbeep;
+ IBOutlet NSButton *enable_keyequivs;
+ IBOutlet NSButton *sync_keymap;
+ IBOutlet NSButton *click_through;
+ IBOutlet NSButton *enable_auth;
+ IBOutlet NSButton *enable_tcp;
+ IBOutlet NSPopUpButton *depth;
+
+ IBOutlet NSMenuItem *x11_about_item;
+ IBOutlet NSMenuItem *window_separator;
+ IBOutlet NSMenuItem *dock_window_separator;
+ IBOutlet NSMenuItem *apps_separator;
+ IBOutlet NSMenuItem *toggle_fullscreen_item;
+ IBOutlet NSMenu *dock_apps_menu;
+ IBOutlet NSTableView *apps_table;
+
+ NSArray *apps;
+ NSMutableArray *table_apps;
+
+ IBOutlet NSMenu *dock_menu;
+
+ int checked_window_item;
+ x_list *pending_apps;
+
+ BOOL finished_launching;
+ BOOL can_quit;
+}
+
+- (void) set_window_menu:(NSArray *)list;
+- (void) set_window_menu_check:(NSNumber *)n;
+- (void) set_apps_menu:(NSArray *)list;
+- (void) set_can_quit:(BOOL)state;
+- (void) server_ready;
+
+- (IBAction) apps_table_show:(id)sender;
+- (IBAction) apps_table_cancel:(id)sender;
+- (IBAction) apps_table_done:(id)sender;
+- (IBAction) apps_table_new:(id)sender;
+- (IBAction) apps_table_duplicate:(id)sender;
+- (IBAction) apps_table_delete:(id)sender;
+- (IBAction) bring_to_front:(id)sender;
+- (IBAction) close_window:(id)sender;
+- (IBAction) minimize_window:(id)sender;
+- (IBAction) zoom_window:(id)sender;
+- (IBAction) next_window:(id)sender;
+- (IBAction) previous_window:(id)sender;
+- (IBAction) enable_fullscreen_changed:(id)sender;
+- (IBAction) toggle_fullscreen:(id)sender;
+- (IBAction) prefs_changed:(id)sender;
+- (IBAction) prefs_show:(id)sender;
+- (IBAction) quit:(id)sender;
+- (IBAction) x11_help:(id)sender;
+
+@end
+
+#endif /* __OBJC__ */
+
+void X11ControllerMain(int argc, const char **argv, void (*server_thread) (void *), void *server_arg);
+
+#endif /* X11CONTROLLER_H */
diff --git a/xorg-server/hw/xquartz/X11Controller.m b/xorg-server/hw/xquartz/X11Controller.m
new file mode 100644
index 000000000..5111eafc3
--- /dev/null
+++ b/xorg-server/hw/xquartz/X11Controller.m
@@ -0,0 +1,749 @@
+/* X11Controller.m -- connect the IB ui, also the NSApp delegate
+
+ Copyright (c) 2002-2007 Apple Inc. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name(s) of the above
+ copyright holders shall not be used in advertising or otherwise to
+ promote the sale, use or other dealings in this Software without
+ prior written authorization. */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#define DEFAULT_PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11/bin"
+
+#include "quartzCommon.h"
+
+#import "X11Controller.h"
+#import "X11Application.h"
+#import <Carbon/Carbon.h>
+
+/* ouch! */
+#define BOOL X_BOOL
+#include "opaque.h"
+# include "darwin.h"
+# include "quartz.h"
+# define _APPLEWM_SERVER_
+# include "X11/extensions/applewm.h"
+# include "applewmExt.h"
+#undef BOOL
+
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+@implementation X11Controller
+
+- (void) awakeFromNib
+{
+ X11Application *xapp = NSApp;
+ NSArray *array;
+
+ /* Point X11Application at ourself. */
+ [xapp set_controller:self];
+
+ array = [xapp prefs_get_array:@PREFS_APPSMENU];
+ if (array != nil)
+ {
+ int count;
+
+ /* convert from [TITLE1 COMMAND1 TITLE2 COMMAND2 ...]
+ to [[TITLE1 COMMAND1] [TITLE2 COMMAND2] ...] format. */
+
+ count = [array count];
+ if (count > 0
+ && ![[array objectAtIndex:0] isKindOfClass:[NSArray class]])
+ {
+ int i;
+ NSMutableArray *copy, *sub;
+
+ copy = [NSMutableArray arrayWithCapacity:(count / 2)];
+
+ for (i = 0; i < count / 2; i++)
+ {
+ sub = [[NSMutableArray alloc] initWithCapacity:3];
+ [sub addObject:[array objectAtIndex:i*2]];
+ [sub addObject:[array objectAtIndex:i*2+1]];
+ [sub addObject:@""];
+ [copy addObject:sub];
+ [sub release];
+ }
+
+ array = copy;
+ }
+
+ [self set_apps_menu:array];
+ }
+}
+
+- (void) item_selected:sender
+{
+ [NSApp activateIgnoringOtherApps:YES];
+
+ QuartzMessageServerThread (kXDarwinControllerNotify, 2,
+ AppleWMWindowMenuItem, [sender tag]);
+}
+
+- (void) remove_window_menu
+{
+ NSMenu *menu;
+ int first, count, i;
+
+ /* Work backwards so we don't mess up the indices */
+ menu = [window_separator menu];
+ first = [menu indexOfItem:window_separator] + 1;
+ count = [menu numberOfItems];
+ for (i = count - 1; i >= first; i--)
+ [menu removeItemAtIndex:i];
+
+ menu = [dock_window_separator menu];
+ count = [menu indexOfItem:dock_window_separator];
+ for (i = 0; i < count; i++)
+ [dock_menu removeItemAtIndex:0];
+}
+
+- (void) install_window_menu:(NSArray *)list
+{
+ NSMenu *menu;
+ NSMenuItem *item;
+ int first, count, i;
+
+ menu = [window_separator menu];
+ first = [menu indexOfItem:window_separator] + 1;
+ count = [list count];
+ for (i = 0; i < count; i++)
+ {
+ NSString *name, *shortcut;
+
+ name = [[list objectAtIndex:i] objectAtIndex:0];
+ shortcut = [[list objectAtIndex:i] objectAtIndex:1];
+
+ item = (NSMenuItem *) [menu addItemWithTitle:name action:@selector
+ (item_selected:) keyEquivalent:shortcut];
+ [item setTarget:self];
+ [item setTag:i];
+ [item setEnabled:YES];
+
+ item = (NSMenuItem *) [dock_menu insertItemWithTitle:name
+ action:@selector
+ (item_selected:) keyEquivalent:shortcut
+ atIndex:i];
+ [item setTarget:self];
+ [item setTag:i];
+ [item setEnabled:YES];
+ }
+
+ if (checked_window_item >= 0 && checked_window_item < count)
+ {
+ item = (NSMenuItem *) [menu itemAtIndex:first + checked_window_item];
+ [item setState:NSOnState];
+ item = (NSMenuItem *) [dock_menu itemAtIndex:checked_window_item];
+ [item setState:NSOnState];
+ }
+}
+
+- (void) remove_apps_menu
+{
+ NSMenu *menu;
+ NSMenuItem *item;
+ int i;
+
+ if (apps == nil || apps_separator == nil) return;
+
+ menu = [apps_separator menu];
+
+ if (menu != nil)
+ {
+ for (i = [menu numberOfItems] - 1; i >= 0; i--)
+ {
+ item = (NSMenuItem *) [menu itemAtIndex:i];
+ if ([item tag] != 0)
+ [menu removeItemAtIndex:i];
+ }
+ }
+
+ if (dock_apps_menu != nil)
+ {
+ for (i = [dock_apps_menu numberOfItems] - 1; i >= 0; i--)
+ {
+ item = (NSMenuItem *) [dock_apps_menu itemAtIndex:i];
+ if ([item tag] != 0)
+ [dock_apps_menu removeItemAtIndex:i];
+ }
+ }
+
+ [apps release];
+ apps = nil;
+}
+
+- (void) prepend_apps_item:(NSArray *)list index:(int)i menu:(NSMenu *)menu
+{
+ NSString *title, *shortcut = @"";
+ NSArray *group;
+ NSMenuItem *item;
+
+ group = [list objectAtIndex:i];
+ title = [group objectAtIndex:0];
+ if ([group count] >= 3)
+ shortcut = [group objectAtIndex:2];
+
+ if ([title length] != 0)
+ {
+ item = (NSMenuItem *) [menu insertItemWithTitle:title
+ action:@selector (app_selected:)
+ keyEquivalent:shortcut atIndex:0];
+ [item setTarget:self];
+ [item setEnabled:YES];
+ }
+ else
+ {
+ item = (NSMenuItem *) [NSMenuItem separatorItem];
+ [menu insertItem:item atIndex:0];
+ }
+
+ [item setTag:i+1]; /* can't be zero, so add one */
+}
+
+- (void) install_apps_menu:(NSArray *)list
+{
+ NSMenu *menu;
+ int i, count;
+
+ count = [list count];
+
+ if (count == 0 || apps_separator == nil) return;
+
+ menu = [apps_separator menu];
+
+ for (i = count - 1; i >= 0; i--)
+ {
+ if (menu != nil)
+ [self prepend_apps_item:list index:i menu:menu];
+ if (dock_apps_menu != nil)
+ [self prepend_apps_item:list index:i menu:dock_apps_menu];
+ }
+
+ apps = [list retain];
+}
+
+- (void) set_window_menu:(NSArray *)list
+{
+ [self remove_window_menu];
+ [self install_window_menu:list];
+
+ QuartzMessageServerThread (kXDarwinControllerNotify, 1,
+ AppleWMWindowMenuNotify);
+}
+
+- (void) set_window_menu_check:(NSNumber *)nn
+{
+ NSMenu *menu;
+ NSMenuItem *item;
+ int first, count;
+ int n = [nn intValue];
+
+ menu = [window_separator menu];
+ first = [menu indexOfItem:window_separator] + 1;
+ count = [menu numberOfItems] - first;
+
+ if (checked_window_item >= 0 && checked_window_item < count)
+ {
+ item = (NSMenuItem *) [menu itemAtIndex:first + checked_window_item];
+ [item setState:NSOffState];
+ item = (NSMenuItem *) [dock_menu itemAtIndex:checked_window_item];
+ [item setState:NSOffState];
+ }
+ if (n >= 0 && n < count)
+ {
+ item = (NSMenuItem *) [menu itemAtIndex:first + n];
+ [item setState:NSOnState];
+ item = (NSMenuItem *) [dock_menu itemAtIndex:n];
+ [item setState:NSOnState];
+ }
+ checked_window_item = n;
+}
+
+- (void) set_apps_menu:(NSArray *)list
+{
+ [self remove_apps_menu];
+ [self install_apps_menu:list];
+}
+
+- (void) launch_client:(NSString *)filename
+{
+ const char *command = [filename UTF8String];
+ const char *argv[7];
+ int child1, child2 = 0;
+ int status;
+
+ argv[0] = "/usr/bin/login";
+ argv[1] = "-fp";
+ argv[2] = getlogin();
+ argv[3] = [X11App prefs_get_string:@PREFS_LOGIN_SHELL default:"/bin/sh"];
+ argv[4] = "-c";
+ argv[5] = command;
+ argv[6] = NULL;
+
+ /* Do the fork-twice trick to avoid having to reap zombies */
+
+ child1 = fork();
+
+ switch (child1) {
+ case -1: /* error */
+ break;
+
+ case 0: /* child1 */
+ child2 = fork();
+
+ switch (child2) {
+ int max_files, i;
+ char buf[1024], *temp;
+
+ case -1: /* error */
+ _exit(1);
+
+ case 0: /* child2 */
+ /* close all open files except for standard streams */
+ max_files = sysconf(_SC_OPEN_MAX);
+ for (i = 3; i < max_files; i++) close(i);
+
+ /* ensure stdin is on /dev/null */
+ close(0);
+ open("/dev/null", O_RDONLY);
+
+ /* Setup environment */
+ temp = getenv("DISPLAY");
+ if (temp == NULL || temp[0] == 0) {
+ snprintf(buf, sizeof(buf), ":%s", display);
+ setenv("DISPLAY", buf, TRUE);
+ }
+
+ temp = getenv("PATH");
+ if (temp == NULL || temp[0] == 0)
+ setenv ("PATH", DEFAULT_PATH, TRUE);
+ else if (strnstr(temp, "/usr/X11/bin", sizeof(temp)) == NULL) {
+ snprintf(buf, sizeof(buf), "%s:/usr/X11/bin", temp);
+ setenv("PATH", buf, TRUE);
+ }
+ /* cd $HOME */
+ temp = getenv("HOME");
+ if (temp != NULL && temp[0]!=0) chdir(temp);
+
+ execvp(argv[0], (char **const) argv);
+
+ _exit(2);
+
+ default: /* parent (child1) */
+ _exit(0);
+ }
+ break;
+
+ default: /* parent */
+ waitpid(child1, &status, 0);
+ }
+}
+
+- (void) app_selected:sender
+{
+ int tag;
+ NSString *item;
+
+ tag = [sender tag] - 1;
+ if (apps == nil || tag < 0 || tag >= [apps count])
+ return;
+
+ item = [[apps objectAtIndex:tag] objectAtIndex:1];
+
+ [self launch_client:item];
+}
+
+- (IBAction) apps_table_show:sender
+{
+ NSArray *columns;
+
+ if (table_apps == nil) {
+ table_apps = [[NSMutableArray alloc] initWithCapacity:1];
+
+ if (apps != nil)[table_apps addObjectsFromArray:apps];
+ }
+
+ columns = [apps_table tableColumns];
+ [[columns objectAtIndex:0] setIdentifier:@"0"];
+ [[columns objectAtIndex:1] setIdentifier:@"1"];
+ [[columns objectAtIndex:2] setIdentifier:@"2"];
+
+ [apps_table setDataSource:self];
+ [apps_table selectRow:0 byExtendingSelection:NO];
+
+ [[apps_table window] makeKeyAndOrderFront:sender];
+}
+
+- (IBAction) apps_table_cancel:sender
+{
+ [[apps_table window] orderOut:sender];
+ [apps_table reloadData];
+
+ [table_apps release];
+ table_apps = nil;
+}
+
+- (IBAction) apps_table_done:sender
+{
+ [apps_table deselectAll:sender]; /* flush edits? */
+
+ [self remove_apps_menu];
+ [self install_apps_menu:table_apps];
+
+ [NSApp prefs_set_array:@PREFS_APPSMENU value:table_apps];
+ [NSApp prefs_synchronize];
+
+ [[apps_table window] orderOut:sender];
+
+ [table_apps release];
+ table_apps = nil;
+}
+
+- (IBAction) apps_table_new:sender
+{
+ NSMutableArray *item;
+
+ int row = [apps_table selectedRow], i;
+
+ if (row < 0) row = 0;
+ else row = row + 1;
+
+ i = row;
+ if (i > [table_apps count])
+ return; /* avoid exceptions */
+
+ [apps_table deselectAll:sender];
+
+ item = [[NSMutableArray alloc] initWithCapacity:3];
+ [item addObject:@""];
+ [item addObject:@""];
+ [item addObject:@""];
+
+ [table_apps insertObject:item atIndex:i];
+ [item release];
+
+ [apps_table reloadData];
+ [apps_table selectRow:row byExtendingSelection:NO];
+}
+
+- (IBAction) apps_table_duplicate:sender
+{
+ int row = [apps_table selectedRow], i;
+ NSObject *item;
+
+ if (row < 0) {
+ [self apps_table_new:sender];
+ return;
+ }
+
+ i = row;
+ if (i > [table_apps count] - 1) return; /* avoid exceptions */
+
+ [apps_table deselectAll:sender];
+
+ item = [[table_apps objectAtIndex:i] mutableCopy];
+ [table_apps insertObject:item atIndex:i];
+ [item release];
+
+ [apps_table reloadData];
+ [apps_table selectRow:row+1 byExtendingSelection:NO];
+}
+
+- (IBAction) apps_table_delete:sender
+{
+ int row = [apps_table selectedRow];
+
+ if (row >= 0)
+ {
+ int i = row;
+
+ if (i > [table_apps count] - 1) return; /* avoid exceptions */
+
+ [apps_table deselectAll:sender];
+
+ [table_apps removeObjectAtIndex:i];
+ }
+
+ [apps_table reloadData];
+
+ row = MIN (row, [table_apps count] - 1);
+ if (row >= 0)
+ [apps_table selectRow:row byExtendingSelection:NO];
+}
+
+- (int) numberOfRowsInTableView:(NSTableView *)tableView
+{
+ if (table_apps == nil) return 0;
+
+ return [table_apps count];
+}
+
+- (id) tableView:(NSTableView *)tableView
+objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
+{
+ NSArray *item;
+ int col;
+
+ if (table_apps == nil) return nil;
+
+ col = [[tableColumn identifier] intValue];
+
+ item = [table_apps objectAtIndex:row];
+ if ([item count] > col)
+ return [item objectAtIndex:col];
+ else
+ return @"";
+}
+
+- (void) tableView:(NSTableView *)tableView setObjectValue:(id)object
+ forTableColumn:(NSTableColumn *)tableColumn row:(int)row
+{
+ NSMutableArray *item;
+ int col;
+
+ if (table_apps == nil) return;
+
+ col = [[tableColumn identifier] intValue];
+
+ item = [table_apps objectAtIndex:row];
+ [item replaceObjectAtIndex:col withObject:object];
+}
+
+- (void) hide_window:sender
+{
+ if ([X11App x_active])
+ QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMHideWindow);
+ else
+ NSBeep (); /* FIXME: something here */
+}
+
+- (IBAction)bring_to_front:sender
+{
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1, AppleWMBringAllToFront);
+}
+
+- (IBAction)close_window:sender
+{
+ if ([X11App x_active])
+ QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMCloseWindow);
+ else
+ [[NSApp keyWindow] performClose:sender];
+}
+
+- (IBAction)minimize_window:sender
+{
+ if ([X11App x_active])
+ QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMMinimizeWindow);
+ else
+ [[NSApp keyWindow] performMiniaturize:sender];
+}
+
+- (IBAction)zoom_window:sender
+{
+ if ([X11App x_active])
+ QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMZoomWindow);
+ else
+ [[NSApp keyWindow] performZoom:sender];
+}
+
+- (IBAction) next_window:sender
+{
+ QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMNextWindow);
+}
+
+- (IBAction) previous_window:sender
+{
+ QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMPreviousWindow);
+}
+
+- (IBAction) enable_fullscreen_changed:sender
+{
+ int value = ![enable_fullscreen intValue];
+
+#ifdef DARWIN_DDX_MISSING
+ QuartzMessageServerThread (kXDarwinSetRootless, 1, value);
+#endif
+
+ [NSApp prefs_set_boolean:@PREFS_ROOTLESS value:value];
+ [NSApp prefs_synchronize];
+}
+
+- (IBAction) toggle_fullscreen:sender
+{
+#ifdef DARWIN_DDX_MISSING
+ QuartzMessageServerThread (kXDarwinToggleFullscreen, 0);
+#endif
+}
+
+- (void) set_can_quit:(BOOL)state
+{
+ can_quit = state;
+}
+
+- (IBAction)prefs_changed:sender
+{
+ darwinFakeButtons = [fake_buttons intValue];
+ quartzUseSysBeep = [use_sysbeep intValue];
+ X11EnableKeyEquivalents = [enable_keyequivs intValue];
+ darwinSyncKeymap = [sync_keymap intValue];
+
+ /* after adding prefs here, also add to [X11Application read_defaults]
+ and below */
+
+ [NSApp prefs_set_boolean:@PREFS_FAKEBUTTONS value:darwinFakeButtons];
+ [NSApp prefs_set_boolean:@PREFS_SYSBEEP value:quartzUseSysBeep];
+ [NSApp prefs_set_boolean:@PREFS_KEYEQUIVS value:X11EnableKeyEquivalents];
+ [NSApp prefs_set_boolean:@PREFS_SYNC_KEYMAP value:darwinSyncKeymap];
+ [NSApp prefs_set_boolean:@PREFS_QUARTZ_WM_CLICK_THROUGH value:[click_through intValue]];
+ [NSApp prefs_set_boolean:@PREFS_NO_AUTH value:![enable_auth intValue]];
+ [NSApp prefs_set_boolean:@PREFS_NO_TCP value:![enable_tcp intValue]];
+ [NSApp prefs_set_integer:@PREFS_DEPTH value:[depth selectedTag]];
+
+ [NSApp prefs_synchronize];
+}
+
+- (IBAction) prefs_show:sender
+{
+ [fake_buttons setIntValue:darwinFakeButtons];
+ [use_sysbeep setIntValue:quartzUseSysBeep];
+ [enable_keyequivs setIntValue:X11EnableKeyEquivalents];
+ [sync_keymap setIntValue:darwinSyncKeymap];
+ [sync_keymap setEnabled:darwinKeymapFile == NULL];
+ [click_through setIntValue:[NSApp prefs_get_boolean:@PREFS_QUARTZ_WM_CLICK_THROUGH default:NO]];
+
+ [enable_auth setIntValue:![NSApp prefs_get_boolean:@PREFS_NO_AUTH default:NO]];
+ [enable_tcp setIntValue:![NSApp prefs_get_boolean:@PREFS_NO_TCP default:NO]];
+ [depth selectItemAtIndex:[depth indexOfItemWithTag:[NSApp prefs_get_integer:@PREFS_DEPTH default:-1]]];
+
+ [enable_fullscreen setIntValue:!quartzEnableRootless];
+
+ [prefs_panel makeKeyAndOrderFront:sender];
+}
+
+- (IBAction) quit:sender
+{
+ QuartzMessageServerThread (kXDarwinQuit, 0);
+}
+
+- (IBAction) x11_help:sender
+{
+ AHLookupAnchor ((CFStringRef)NSLocalizedString(@"Mac Help", no comment), CFSTR ("mchlp2276"));
+}
+
+- (BOOL) validateMenuItem:(NSMenuItem *)item
+{
+ NSMenu *menu = [item menu];
+
+ if (item == toggle_fullscreen_item)
+ return !quartzEnableRootless;
+ else if (menu == [window_separator menu] || menu == dock_menu
+ || (menu == [x11_about_item menu] && [item tag] == 42))
+ return (AppleWMSelectedEvents () & AppleWMControllerNotifyMask) != 0;
+ else
+ return TRUE;
+}
+
+- (void) applicationDidHide:(NSNotification *)notify
+{
+ QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMHideAll);
+}
+
+- (void) applicationDidUnhide:(NSNotification *)notify
+{
+ QuartzMessageServerThread (kXDarwinControllerNotify, 1, AppleWMShowAll);
+}
+
+- (NSApplicationTerminateReply) applicationShouldTerminate:sender
+{
+ NSString *msg;
+
+ if (can_quit || [X11App prefs_get_boolean:@PREFS_NO_QUIT_ALERT default:NO])
+ return NSTerminateNow;
+
+ /* Make sure we're frontmost. */
+ [NSApp activateIgnoringOtherApps:YES];
+
+ msg = NSLocalizedString (@"Are you sure you want to quit X11?\n\nIf you quit X11, any X11 applications you are running will stop immediately and you will lose any changes you have not saved.", @"Dialog when quitting");
+
+ /* FIXME: safe to run the alert in here? Or should we return Later
+ and then run the alert on a timer? It seems to work here, so.. */
+
+ return (NSRunAlertPanel (nil, msg, NSLocalizedString (@"Quit", @""),
+ NSLocalizedString (@"Cancel", @""), nil)
+ == NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel;
+}
+
+- (void) applicationWillTerminate:(NSNotification *)aNotification
+{
+ [X11App prefs_synchronize];
+
+ /* shutdown the X server, it will exit () for us. */
+ QuartzMessageServerThread (kXDarwinQuit, 0);
+
+ /* In case it doesn't, exit anyway after a while. */
+ while (sleep (10) != 0) ;
+ exit (1);
+}
+
+- (void) server_ready
+{
+ x_list *node;
+
+ finished_launching = YES;
+
+ for (node = pending_apps; node != NULL; node = node->next)
+ {
+ NSString *filename = node->data;
+ [self launch_client:filename];
+ [filename release];
+ }
+
+ x_list_free (pending_apps);
+ pending_apps = NULL;
+}
+
+- (BOOL) application:(NSApplication *)app openFile:(NSString *)filename
+{
+ const char *name = [filename UTF8String];
+
+ if (finished_launching)
+ [self launch_client:filename];
+ else if (name[0] != ':') /* ignore display names */
+ pending_apps = x_list_prepend (pending_apps, [filename retain]);
+
+ /* FIXME: report failures. */
+ return YES;
+}
+
+@end
+
+void X11ControllerMain(int argc, const char **argv, void (*server_thread) (void *), void *server_arg) {
+ X11ApplicationMain (argc, argv, server_thread, server_arg);
+}
diff --git a/xorg-server/hw/xquartz/applewm.c b/xorg-server/hw/xquartz/applewm.c
new file mode 100644
index 000000000..072e57ff4
--- /dev/null
+++ b/xorg-server/hw/xquartz/applewm.c
@@ -0,0 +1,707 @@
+/**************************************************************************
+
+Copyright (c) 2002-2007 Apple Inc. All Rights Reserved.
+Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "quartzCommon.h"
+
+#define NEED_REPLIES
+#define NEED_EVENTS
+#include "misc.h"
+#include "dixstruct.h"
+#include "globals.h"
+#include "extnsionst.h"
+#include "colormapst.h"
+#include "cursorstr.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "servermd.h"
+#include "swaprep.h"
+#include "propertyst.h"
+#include <X11/Xatom.h>
+#include "darwin.h"
+#define _APPLEWM_SERVER_
+#include "X11/extensions/applewmstr.h"
+#include "applewmExt.h"
+#include "X11Application.h"
+
+#define DEFINE_ATOM_HELPER(func,atom_name) \
+static Atom func (void) { \
+ static int generation; \
+ static Atom atom; \
+ if (generation != serverGeneration) { \
+ generation = serverGeneration; \
+ atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \
+ } \
+ return atom; \
+}
+
+DEFINE_ATOM_HELPER(xa_native_screen_origin, "_NATIVE_SCREEN_ORIGIN")
+DEFINE_ATOM_HELPER (xa_apple_no_order_in, "_APPLE_NO_ORDER_IN")
+
+static AppleWMProcsPtr appleWMProcs;
+
+static int WMErrorBase;
+
+static DISPATCH_PROC(ProcAppleWMDispatch);
+static DISPATCH_PROC(SProcAppleWMDispatch);
+
+static void AppleWMResetProc(ExtensionEntry* extEntry);
+
+static unsigned char WMReqCode = 0;
+static int WMEventBase = 0;
+
+static RESTYPE ClientType, EventType; /* resource types for event masks */
+static XID eventResource;
+
+/* Currently selected events */
+static unsigned int eventMask = 0;
+
+static int WMFreeClient (pointer data, XID id);
+static int WMFreeEvents (pointer data, XID id);
+static void SNotifyEvent(xAppleWMNotifyEvent *from, xAppleWMNotifyEvent *to);
+
+typedef struct _WMEvent *WMEventPtr;
+typedef struct _WMEvent {
+ WMEventPtr next;
+ ClientPtr client;
+ XID clientResource;
+ unsigned int mask;
+} WMEventRec;
+
+static inline BoxRec
+make_box (int x, int y, int w, int h)
+{
+ BoxRec r;
+ r.x1 = x;
+ r.y1 = y;
+ r.x2 = x + w;
+ r.y2 = y + h;
+ return r;
+}
+
+void
+AppleWMExtensionInit(
+ AppleWMProcsPtr procsPtr)
+{
+ ExtensionEntry* extEntry;
+
+ ClientType = CreateNewResourceType(WMFreeClient);
+ EventType = CreateNewResourceType(WMFreeEvents);
+ eventResource = FakeClientID(0);
+
+ if (ClientType && EventType &&
+ (extEntry = AddExtension(APPLEWMNAME,
+ AppleWMNumberEvents,
+ AppleWMNumberErrors,
+ ProcAppleWMDispatch,
+ SProcAppleWMDispatch,
+ AppleWMResetProc,
+ StandardMinorOpcode)))
+ {
+ WMReqCode = (unsigned char)extEntry->base;
+ WMErrorBase = extEntry->errorBase;
+ WMEventBase = extEntry->eventBase;
+ EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent;
+ appleWMProcs = procsPtr;
+ }
+}
+
+/*ARGSUSED*/
+static void
+AppleWMResetProc (
+ ExtensionEntry* extEntry
+)
+{
+}
+
+/* Updates the _NATIVE_SCREEN_ORIGIN property on the given root window. */
+void
+AppleWMSetScreenOrigin(
+ WindowPtr pWin
+)
+{
+ long data[2];
+
+ data[0] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].x
+ + darwinMainScreenX);
+ data[1] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].y
+ + darwinMainScreenY);
+
+ dixChangeWindowProperty(serverClient, pWin, xa_native_screen_origin(),
+ XA_INTEGER, 32, PropModeReplace, 2, data, TRUE);
+}
+
+/* Window managers can set the _APPLE_NO_ORDER_IN property on windows
+ that are being genie-restored from the Dock. We want them to
+ be mapped but remain ordered-out until the animation
+ completes (when the Dock will order them in). */
+Bool
+AppleWMDoReorderWindow(
+ WindowPtr pWin
+)
+{
+ Atom atom;
+ PropertyPtr prop;
+ int rc;
+
+ atom = xa_apple_no_order_in();
+ rc = dixLookupProperty(&prop, pWin, atom, serverClient, DixReadAccess);
+ return (rc == Success) && (prop->type == atom);
+}
+
+
+static int
+ProcAppleWMQueryVersion(
+ register ClientPtr client
+)
+{
+ xAppleWMQueryVersionReply rep;
+ register int n;
+
+ REQUEST_SIZE_MATCH(xAppleWMQueryVersionReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = APPLE_WM_MAJOR_VERSION;
+ rep.minorVersion = APPLE_WM_MINOR_VERSION;
+ rep.patchVersion = APPLE_WM_PATCH_VERSION;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ }
+ WriteToClient(client, sizeof(xAppleWMQueryVersionReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+
+/* events */
+
+static inline void
+updateEventMask (WMEventPtr *pHead)
+{
+ WMEventPtr pCur;
+
+ eventMask = 0;
+ for (pCur = *pHead; pCur != NULL; pCur = pCur->next)
+ eventMask |= pCur->mask;
+}
+
+/*ARGSUSED*/
+static int
+WMFreeClient (data, id)
+ pointer data;
+ XID id;
+{
+ WMEventPtr pEvent;
+ WMEventPtr *pHead, pCur, pPrev;
+
+ pEvent = (WMEventPtr) data;
+ pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType);
+ if (pHead) {
+ pPrev = 0;
+ for (pCur = *pHead; pCur && pCur != pEvent; pCur=pCur->next)
+ pPrev = pCur;
+ if (pCur) {
+ if (pPrev)
+ pPrev->next = pEvent->next;
+ else
+ *pHead = pEvent->next;
+ }
+ updateEventMask (pHead);
+ }
+ xfree ((pointer) pEvent);
+ return 1;
+}
+
+/*ARGSUSED*/
+static int
+WMFreeEvents (data, id)
+ pointer data;
+ XID id;
+{
+ WMEventPtr *pHead, pCur, pNext;
+
+ pHead = (WMEventPtr *) data;
+ for (pCur = *pHead; pCur; pCur = pNext) {
+ pNext = pCur->next;
+ FreeResource (pCur->clientResource, ClientType);
+ xfree ((pointer) pCur);
+ }
+ xfree ((pointer) pHead);
+ eventMask = 0;
+ return 1;
+}
+
+static int
+ProcAppleWMSelectInput (register ClientPtr client)
+{
+ REQUEST(xAppleWMSelectInputReq);
+ WMEventPtr pEvent, pNewEvent, *pHead;
+ XID clientResource;
+
+ REQUEST_SIZE_MATCH (xAppleWMSelectInputReq);
+ pHead = (WMEventPtr *)SecurityLookupIDByType(client,
+ eventResource, EventType, DixWriteAccess);
+ if (stuff->mask != 0) {
+ if (pHead) {
+ /* check for existing entry. */
+ for (pEvent = *pHead; pEvent; pEvent = pEvent->next)
+ {
+ if (pEvent->client == client)
+ {
+ pEvent->mask = stuff->mask;
+ updateEventMask (pHead);
+ return Success;
+ }
+ }
+ }
+
+ /* build the entry */
+ pNewEvent = (WMEventPtr) xalloc (sizeof (WMEventRec));
+ if (!pNewEvent)
+ return BadAlloc;
+ pNewEvent->next = 0;
+ pNewEvent->client = client;
+ pNewEvent->mask = stuff->mask;
+ /*
+ * add a resource that will be deleted when
+ * the client goes away
+ */
+ clientResource = FakeClientID (client->index);
+ pNewEvent->clientResource = clientResource;
+ if (!AddResource (clientResource, ClientType, (pointer)pNewEvent))
+ return BadAlloc;
+ /*
+ * create a resource to contain a pointer to the list
+ * of clients selecting input. This must be indirect as
+ * the list may be arbitrarily rearranged which cannot be
+ * done through the resource database.
+ */
+ if (!pHead)
+ {
+ pHead = (WMEventPtr *) xalloc (sizeof (WMEventPtr));
+ if (!pHead ||
+ !AddResource (eventResource, EventType, (pointer)pHead))
+ {
+ FreeResource (clientResource, RT_NONE);
+ return BadAlloc;
+ }
+ *pHead = 0;
+ }
+ pNewEvent->next = *pHead;
+ *pHead = pNewEvent;
+ updateEventMask (pHead);
+ } else if (stuff->mask == 0) {
+ /* delete the interest */
+ if (pHead) {
+ pNewEvent = 0;
+ for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
+ if (pEvent->client == client)
+ break;
+ pNewEvent = pEvent;
+ }
+ if (pEvent) {
+ FreeResource (pEvent->clientResource, ClientType);
+ if (pNewEvent)
+ pNewEvent->next = pEvent->next;
+ else
+ *pHead = pEvent->next;
+ xfree (pEvent);
+ updateEventMask (pHead);
+ }
+ }
+ } else {
+ client->errorValue = stuff->mask;
+ return BadValue;
+ }
+ return Success;
+}
+
+/*
+ * deliver the event
+ */
+
+void
+AppleWMSendEvent (type, mask, which, arg)
+ int type, which, arg;
+ unsigned int mask;
+{
+ WMEventPtr *pHead, pEvent;
+ ClientPtr client;
+ xAppleWMNotifyEvent se;
+
+ pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType);
+ if (!pHead)
+ return;
+ for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
+ client = pEvent->client;
+ if ((pEvent->mask & mask) == 0
+ || client == serverClient || client->clientGone)
+ {
+ continue;
+ }
+ se.type = type + WMEventBase;
+ se.kind = which;
+ se.arg = arg;
+ se.sequenceNumber = client->sequence;
+ se.time = currentTime.milliseconds;
+ WriteEventsToClient (client, 1, (xEvent *) &se);
+ }
+}
+
+/* Safe to call from any thread. */
+unsigned int
+AppleWMSelectedEvents (void)
+{
+ return eventMask;
+}
+
+
+/* general utility functions */
+
+static int
+ProcAppleWMDisableUpdate(
+ register ClientPtr client
+)
+{
+ REQUEST_SIZE_MATCH(xAppleWMDisableUpdateReq);
+
+ appleWMProcs->DisableUpdate();
+
+ return (client->noClientException);
+}
+
+static int
+ProcAppleWMReenableUpdate(
+ register ClientPtr client
+)
+{
+ REQUEST_SIZE_MATCH(xAppleWMReenableUpdateReq);
+
+ appleWMProcs->EnableUpdate();
+
+ return (client->noClientException);
+}
+
+
+/* window functions */
+
+static int
+ProcAppleWMSetWindowMenu(
+ register ClientPtr client
+)
+{
+ const char *bytes, **items;
+ char *shortcuts;
+ int max_len, nitems, i, j;
+ REQUEST(xAppleWMSetWindowMenuReq);
+
+ REQUEST_AT_LEAST_SIZE(xAppleWMSetWindowMenuReq);
+
+ nitems = stuff->nitems;
+ items = xalloc (sizeof (char *) * nitems);
+ shortcuts = xalloc (sizeof (char) * nitems);
+
+ max_len = (stuff->length << 2) - sizeof(xAppleWMSetWindowMenuReq);
+ bytes = (char *) &stuff[1];
+
+ for (i = j = 0; i < max_len && j < nitems;)
+ {
+ shortcuts[j] = bytes[i++];
+ items[j++] = bytes + i;
+
+ while (i < max_len)
+ {
+ if (bytes[i++] == 0)
+ break;
+ }
+ }
+ X11ApplicationSetWindowMenu (nitems, items, shortcuts);
+ free(items);
+ free(shortcuts);
+
+ return (client->noClientException);
+}
+
+static int
+ProcAppleWMSetWindowMenuCheck(
+ register ClientPtr client
+)
+{
+ REQUEST(xAppleWMSetWindowMenuCheckReq);
+
+ REQUEST_SIZE_MATCH(xAppleWMSetWindowMenuCheckReq);
+ X11ApplicationSetWindowMenuCheck(stuff->index);
+ return (client->noClientException);
+}
+
+static int
+ProcAppleWMSetFrontProcess(
+ register ClientPtr client
+)
+{
+ REQUEST_SIZE_MATCH(xAppleWMSetFrontProcessReq);
+
+ X11ApplicationSetFrontProcess();
+ return (client->noClientException);
+}
+
+static int
+ProcAppleWMSetWindowLevel(register ClientPtr client)
+{
+ REQUEST(xAppleWMSetWindowLevelReq);
+ WindowPtr pWin;
+ int err;
+
+ REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq);
+
+ if (Success != dixLookupWindow(&pWin, stuff->window, client,
+ DixReadAccess))
+ return BadValue;
+
+ if (stuff->level < 0 || stuff->level >= AppleWMNumWindowLevels) {
+ return BadValue;
+ }
+
+ err = appleWMProcs->SetWindowLevel(pWin, stuff->level);
+ if (err != Success) {
+ return err;
+ }
+
+ return (client->noClientException);
+}
+
+static int
+ProcAppleWMSetCanQuit(
+ register ClientPtr client
+)
+{
+ REQUEST(xAppleWMSetCanQuitReq);
+
+ REQUEST_SIZE_MATCH(xAppleWMSetCanQuitReq);
+
+ X11ApplicationSetCanQuit(stuff->state);
+ return (client->noClientException);
+}
+
+
+/* frame functions */
+
+static int
+ProcAppleWMFrameGetRect(
+ register ClientPtr client
+)
+{
+ xAppleWMFrameGetRectReply rep;
+ BoxRec ir, or, rr;
+ REQUEST(xAppleWMFrameGetRectReq);
+
+ REQUEST_SIZE_MATCH(xAppleWMFrameGetRectReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih);
+ or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh);
+
+ if (appleWMProcs->FrameGetRect(stuff->frame_rect,
+ stuff->frame_class,
+ &or, &ir, &rr) != Success)
+ {
+ return BadValue;
+ }
+
+ rep.x = rr.x1;
+ rep.y = rr.y1;
+ rep.w = rr.x2 - rr.x1;
+ rep.h = rr.y2 - rr.y1;
+
+ WriteToClient(client, sizeof(xAppleWMFrameGetRectReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcAppleWMFrameHitTest(
+ register ClientPtr client
+)
+{
+ xAppleWMFrameHitTestReply rep;
+ BoxRec ir, or;
+ int ret;
+ REQUEST(xAppleWMFrameHitTestReq);
+
+ REQUEST_SIZE_MATCH(xAppleWMFrameHitTestReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih);
+ or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh);
+
+ if (appleWMProcs->FrameHitTest(stuff->frame_class, stuff->px,
+ stuff->py, &or, &ir, &ret) != Success)
+ {
+ return BadValue;
+ }
+
+ rep.ret = ret;
+
+ WriteToClient(client, sizeof(xAppleWMFrameHitTestReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcAppleWMFrameDraw(
+ register ClientPtr client
+)
+{
+ BoxRec ir, or;
+ unsigned int title_length, title_max;
+ unsigned char *title_bytes;
+ REQUEST(xAppleWMFrameDrawReq);
+ WindowPtr pWin;
+
+ REQUEST_AT_LEAST_SIZE(xAppleWMFrameDrawReq);
+
+ if (Success != dixLookupWindow(&pWin, stuff->window, client,
+ DixReadAccess))
+ return BadValue;
+
+ ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih);
+ or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh);
+
+ title_length = stuff->title_length;
+ title_max = (stuff->length << 2) - sizeof(xAppleWMFrameDrawReq);
+
+ if (title_max < title_length)
+ return BadValue;
+
+ title_bytes = (unsigned char *) &stuff[1];
+
+ errno = appleWMProcs->FrameDraw(pWin, stuff->frame_class,
+ stuff->frame_attr, &or, &ir,
+ title_length, title_bytes);
+ if (errno != Success) {
+ return errno;
+ }
+
+ return (client->noClientException);
+}
+
+
+/* dispatch */
+
+static int
+ProcAppleWMDispatch (
+ register ClientPtr client
+)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data)
+ {
+ case X_AppleWMQueryVersion:
+ return ProcAppleWMQueryVersion(client);
+ }
+
+ if (!LocalClient(client))
+ return WMErrorBase + AppleWMClientNotLocal;
+
+ switch (stuff->data)
+ {
+ case X_AppleWMSelectInput:
+ return ProcAppleWMSelectInput(client);
+ case X_AppleWMDisableUpdate:
+ return ProcAppleWMDisableUpdate(client);
+ case X_AppleWMReenableUpdate:
+ return ProcAppleWMReenableUpdate(client);
+ case X_AppleWMSetWindowMenu:
+ return ProcAppleWMSetWindowMenu(client);
+ case X_AppleWMSetWindowMenuCheck:
+ return ProcAppleWMSetWindowMenuCheck(client);
+ case X_AppleWMSetFrontProcess:
+ return ProcAppleWMSetFrontProcess(client);
+ case X_AppleWMSetWindowLevel:
+ return ProcAppleWMSetWindowLevel(client);
+ case X_AppleWMSetCanQuit:
+ return ProcAppleWMSetCanQuit(client);
+ case X_AppleWMFrameGetRect:
+ return ProcAppleWMFrameGetRect(client);
+ case X_AppleWMFrameHitTest:
+ return ProcAppleWMFrameHitTest(client);
+ case X_AppleWMFrameDraw:
+ return ProcAppleWMFrameDraw(client);
+ default:
+ return BadRequest;
+ }
+}
+
+static void
+SNotifyEvent(from, to)
+ xAppleWMNotifyEvent *from, *to;
+{
+ to->type = from->type;
+ to->kind = from->kind;
+ cpswaps (from->sequenceNumber, to->sequenceNumber);
+ cpswapl (from->time, to->time);
+ cpswapl (from->arg, to->arg);
+}
+
+static int
+SProcAppleWMQueryVersion(
+ register ClientPtr client
+)
+{
+ register int n;
+ REQUEST(xAppleWMQueryVersionReq);
+ swaps(&stuff->length, n);
+ return ProcAppleWMQueryVersion(client);
+}
+
+static int
+SProcAppleWMDispatch (
+ register ClientPtr client
+)
+{
+ REQUEST(xReq);
+
+ /* It is bound to be non-local when there is byte swapping */
+ if (!LocalClient(client))
+ return WMErrorBase + AppleWMClientNotLocal;
+
+ /* only local clients are allowed WM access */
+ switch (stuff->data)
+ {
+ case X_AppleWMQueryVersion:
+ return SProcAppleWMQueryVersion(client);
+ default:
+ return BadRequest;
+ }
+}
diff --git a/xorg-server/hw/xquartz/applewmExt.h b/xorg-server/hw/xquartz/applewmExt.h
new file mode 100644
index 000000000..60d49ef59
--- /dev/null
+++ b/xorg-server/hw/xquartz/applewmExt.h
@@ -0,0 +1,84 @@
+/*
+ * External interface for the server's AppleWM support
+ */
+/**************************************************************************
+
+Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
+Copyright (c) 2003-2004 Torrey T. Lyons. All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#ifndef _APPLEWMEXT_H_
+#define _APPLEWMEXT_H_
+
+#include "window.h"
+
+typedef int (*DisableUpdateProc)(void);
+typedef int (*EnableUpdateProc)(void);
+typedef int (*SetWindowLevelProc)(WindowPtr pWin, int level);
+typedef int (*FrameGetRectProc)(int type, int class, const BoxRec *outer,
+ const BoxRec *inner, BoxRec *ret);
+typedef int (*FrameHitTestProc)(int class, int x, int y,
+ const BoxRec *outer,
+ const BoxRec *inner, int *ret);
+typedef int (*FrameDrawProc)(WindowPtr pWin, int class, unsigned int attr,
+ const BoxRec *outer, const BoxRec *inner,
+ unsigned int title_len,
+ const unsigned char *title_bytes);
+
+/*
+ * AppleWM implementation function list
+ */
+typedef struct _AppleWMProcs {
+ DisableUpdateProc DisableUpdate;
+ EnableUpdateProc EnableUpdate;
+ SetWindowLevelProc SetWindowLevel;
+ FrameGetRectProc FrameGetRect;
+ FrameHitTestProc FrameHitTest;
+ FrameDrawProc FrameDraw;
+} AppleWMProcsRec, *AppleWMProcsPtr;
+
+void AppleWMExtensionInit(
+ AppleWMProcsPtr procsPtr
+);
+
+void AppleWMSetScreenOrigin(
+ WindowPtr pWin
+);
+
+Bool AppleWMDoReorderWindow(
+ WindowPtr pWin
+);
+
+void AppleWMSendEvent(
+ int /* type */,
+ unsigned int /* mask */,
+ int /* which */,
+ int /* arg */
+);
+
+unsigned int AppleWMSelectedEvents(
+ void
+);
+
+#endif /* _APPLEWMEXT_H_ */
diff --git a/xorg-server/hw/xquartz/bundle/Dutch.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Dutch.lproj/InfoPlist.strings
new file mode 100644
index 000000000..8f978d63f
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Dutch.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/Dutch.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Dutch.lproj/Localizable.strings
new file mode 100644
index 000000000..1ff39fe67
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Dutch.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/Dutch.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Dutch.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..95c26d7b3
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Dutch.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/English.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/English.lproj/InfoPlist.strings
new file mode 100644
index 000000000..88e1f04ac
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/English.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/English.lproj/Localizable.strings
new file mode 100644
index 000000000..c83b08536
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/English.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/English.lproj/main.nib/designable.nib b/xorg-server/hw/xquartz/bundle/English.lproj/main.nib/designable.nib
new file mode 100644
index 000000000..ea3a0daa8
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/English.lproj/main.nib/designable.nib
@@ -0,0 +1,3482 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.02">
+ <data>
+ <int key="IBDocument.SystemTarget">1050</int>
+ <string key="IBDocument.SystemVersion">9C31</string>
+ <string key="IBDocument.InterfaceBuilderVersion">639</string>
+ <string key="IBDocument.AppKitVersion">949.26</string>
+ <string key="IBDocument.HIToolboxVersion">352.00</string>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="57"/>
+ <integer value="285"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="904585544">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomObject" id="815810918">
+ <object class="NSMutableString" key="NSClassName">
+ <characters key="NS.bytes">NSApplication</characters>
+ </object>
+ </object>
+ <object class="NSCustomObject" id="941939442">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSCustomObject" id="951368722">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ <object class="NSMenu" id="524015605">
+ <string key="NSTitle">MainMenu</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="365880285">
+ <reference key="NSMenu" ref="524015605"/>
+ <string key="NSTitle">X11</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <object class="NSCustomResource" key="NSOnImage" id="531645050">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSMenuCheckmark</string>
+ </object>
+ <object class="NSCustomResource" key="NSMixedImage" id="351811234">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSMenuMixedState</string>
+ </object>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="576521955">
+ <string key="NSTitle">X11</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="139290918">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">About X11</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="386173216">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">Preferences...</string>
+ <string key="NSKeyEquiv">,</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="272876017">
+ <reference key="NSMenu" ref="576521955"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="32285361">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">Services</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="821388474">
+ <object class="NSMutableString" key="NSTitle">
+ <characters key="NS.bytes">Services</characters>
+ </object>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <string key="NSName">_NSServicesMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="431301145">
+ <reference key="NSMenu" ref="576521955"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="6876565">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">Toggle Full Screen</string>
+ <string key="NSKeyEquiv">a</string>
+ <int key="NSKeyEquivModMask">1572864</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="479677589">
+ <reference key="NSMenu" ref="576521955"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="301008465">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">Hide X11</string>
+ <string key="NSKeyEquiv">h</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <int key="NSTag">42</int>
+ </object>
+ <object class="NSMenuItem" id="206802571">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">Hide Others</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="1023546148">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">Show All</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <int key="NSTag">42</int>
+ </object>
+ <object class="NSMenuItem" id="848095279">
+ <reference key="NSMenu" ref="576521955"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="274138642">
+ <reference key="NSMenu" ref="576521955"/>
+ <string key="NSTitle">Quit X11</string>
+ <string key="NSKeyEquiv">q</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ </object>
+ <string key="NSName">_NSAppleMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="868031522">
+ <reference key="NSMenu" ref="524015605"/>
+ <string key="NSTitle">Applications</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="981161348">
+ <string key="NSTitle">Applications</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="390088328">
+ <reference key="NSMenu" ref="981161348"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="1065386165">
+ <reference key="NSMenu" ref="981161348"/>
+ <string key="NSTitle">Customize...</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="200491363">
+ <reference key="NSMenu" ref="524015605"/>
+ <string key="NSTitle">Edit</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="526778998">
+ <string key="NSTitle">Edit</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="1010221707">
+ <reference key="NSMenu" ref="526778998"/>
+ <string key="NSTitle">Undo</string>
+ <string key="NSKeyEquiv">z</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="535038564">
+ <reference key="NSMenu" ref="526778998"/>
+ <string key="NSTitle">Redo</string>
+ <string key="NSKeyEquiv">Z</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="839739619">
+ <reference key="NSMenu" ref="526778998"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="581727829">
+ <reference key="NSMenu" ref="526778998"/>
+ <string key="NSTitle">Cut</string>
+ <string key="NSKeyEquiv">x</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="185296989">
+ <reference key="NSMenu" ref="526778998"/>
+ <string key="NSTitle">Copy</string>
+ <string key="NSKeyEquiv">c</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="924678073">
+ <reference key="NSMenu" ref="526778998"/>
+ <string key="NSTitle">Paste</string>
+ <string key="NSKeyEquiv">v</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="994817848">
+ <reference key="NSMenu" ref="526778998"/>
+ <string key="NSTitle">Delete</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="322866464">
+ <reference key="NSMenu" ref="526778998"/>
+ <string key="NSTitle">Select All</string>
+ <string key="NSKeyEquiv">a</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="931553638">
+ <reference key="NSMenu" ref="524015605"/>
+ <string key="NSTitle">Window</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="96874957">
+ <object class="NSMutableString" key="NSTitle">
+ <characters key="NS.bytes">Window</characters>
+ </object>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="677652931">
+ <reference key="NSMenu" ref="96874957"/>
+ <string key="NSTitle">Minimize</string>
+ <string key="NSKeyEquiv">m</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="1066447520">
+ <reference key="NSMenu" ref="96874957"/>
+ <string key="NSTitle">Zoom</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="1036389925">
+ <reference key="NSMenu" ref="96874957"/>
+ <string key="NSTitle">Cycle Through Windows</string>
+ <string key="NSKeyEquiv">`</string>
+ <int key="NSKeyEquivModMask">1048840</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="369641893">
+ <reference key="NSMenu" ref="96874957"/>
+ <string key="NSTitle">Reverse Cycle Through Windows</string>
+ <string key="NSKeyEquiv">~</string>
+ <int key="NSKeyEquivModMask">1179914</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="280172320">
+ <reference key="NSMenu" ref="96874957"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="984461797">
+ <reference key="NSMenu" ref="96874957"/>
+ <string key="NSTitle">Close</string>
+ <string key="NSKeyEquiv">w</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="155085383">
+ <reference key="NSMenu" ref="96874957"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="276216762">
+ <reference key="NSMenu" ref="96874957"/>
+ <string key="NSTitle">Bring All to Front</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="444952046">
+ <reference key="NSMenu" ref="96874957"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ </object>
+ <string key="NSName">_NSWindowsMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="551174276">
+ <reference key="NSMenu" ref="524015605"/>
+ <string key="NSTitle">Help</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="511848303">
+ <string key="NSTitle">Help</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="504984881">
+ <reference key="NSMenu" ref="511848303"/>
+ <string key="NSTitle">X11 Help</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ <string key="NSName">_NSMainMenu</string>
+ </object>
+ <object class="NSCustomObject" id="485884620">
+ <string key="NSClassName">X11Controller</string>
+ </object>
+ <object class="NSWindowTemplate" id="124913468">
+ <int key="NSWindowStyleMask">3</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{319, 294}, {481, 345}}</string>
+ <int key="NSWTFlags">1350041600</int>
+ <string key="NSWindowTitle">X11 Preferences</string>
+ <string key="NSWindowClass">NSPanel</string>
+ <object class="NSMutableString" key="NSViewClass">
+ <characters key="NS.bytes">View</characters>
+ </object>
+ <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSWindowContentMinSize">{213, 107}</string>
+ <object class="NSView" key="NSWindowView" id="941366957">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTabView" id="448510093">
+ <reference key="NSNextResponder" ref="941366957"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{10, 10}, {458, 325}}</string>
+ <reference key="NSSuperview" ref="941366957"/>
+ <object class="NSMutableArray" key="NSTabViewItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTabViewItem" id="287591690">
+ <object class="NSMutableString" key="NSIdentifier">
+ <characters key="NS.bytes">1</characters>
+ </object>
+ <object class="NSView" key="NSView" id="596750588">
+ <reference key="NSNextResponder" ref="448510093"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="119157981">
+ <reference key="NSNextResponder" ref="596750588"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 243}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="596750588"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="990762273">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Emulate three button mouse</string>
+ <object class="NSFont" key="NSSupport" id="463863101">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.300000e+01</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="119157981"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <object class="NSButtonImageSource" key="NSAlternateImage" id="391434389">
+ <string key="NSImageName">NSSwitch</string>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="443008216">
+ <reference key="NSNextResponder" ref="596750588"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 93}, {385, 31}}</string>
+ <reference key="NSSuperview" ref="596750588"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="391919450">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">When enabled, menu bar key equivalents may interfere with X11 applications that use the Meta modifier.</string>
+ <object class="NSFont" key="NSSupport" id="26">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.100000e+01</double>
+ <int key="NSfFlags">3100</int>
+ </object>
+ <reference key="NSControlView" ref="443008216"/>
+ <object class="NSColor" key="NSBackgroundColor" id="57160303">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlColor</string>
+ <object class="NSColor" key="NSColor" id="590688762">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC42NjY2NjY2OQA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor" id="930815747">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlTextColor</string>
+ <object class="NSColor" key="NSColor" id="214098874">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSTextField" id="282885445">
+ <reference key="NSNextResponder" ref="596750588"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 208}, {385, 29}}</string>
+ <reference key="NSSuperview" ref="596750588"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="649334366">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string type="base64-UTF8" key="NSContents">SG9sZCBPcHRpb24gYW5kIENvbW1hbmQgd2hpbGUgY2xpY2tpbmcgdG8gYWN0aXZhdGUgdGhlIG1pZGRs
+ZSBhbmQgcmlnaHQgbW91c2UgYnV0dG9ucy4KA</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="282885445"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSButton" id="842100515">
+ <reference key="NSNextResponder" ref="596750588"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 130}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="596750588"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="940564599">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Enable key equivalents under X11</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="842100515"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="31160162">
+ <reference key="NSNextResponder" ref="596750588"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 159}, {385, 14}}</string>
+ <reference key="NSSuperview" ref="596750588"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="666057093">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">Allows input menu changes to overwrite the current X11 keymap.</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="31160162"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSButton" id="179949713">
+ <reference key="NSNextResponder" ref="596750588"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 179}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="596750588"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="967619578">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Follow system keyboard layout</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="179949713"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="915448994">
+ <reference key="NSNextResponder" ref="596750588"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 69}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="596750588"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="117056849">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Click-through Inactive Windows</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="915448994"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="707276799">
+ <reference key="NSNextResponder" ref="596750588"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{33, 32}, {385, 31}}</string>
+ <reference key="NSSuperview" ref="596750588"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="318286890">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">When enabled, clicking on an inactive window will cause that mouse click to pass through to that window in addition to activating it.</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="707276799"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrame">{{10, 33}, {438, 279}}</string>
+ <reference key="NSSuperview" ref="448510093"/>
+ </object>
+ <string key="NSLabel">Input</string>
+ <reference key="NSColor" ref="57160303"/>
+ <reference key="NSTabView" ref="448510093"/>
+ </object>
+ <object class="NSTabViewItem" id="960678392">
+ <object class="NSMutableString" key="NSIdentifier">
+ <characters key="NS.bytes">2</characters>
+ </object>
+ <object class="NSView" key="NSView" id="515308735">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="418227126">
+ <reference key="NSNextResponder" ref="515308735"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 116}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="515308735"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="1016069354">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Use system alert effect</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="418227126"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="1039016593">
+ <reference key="NSNextResponder" ref="515308735"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 82}, {385, 28}}</string>
+ <reference key="NSSuperview" ref="515308735"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="624655599">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">X11 beeps will use the standard system alert, as defined in the Sound Effects system preferences panel.</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="1039016593"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSPopUpButton" id="709074847">
+ <reference key="NSNextResponder" ref="515308735"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{74, 235}, {128, 26}}</string>
+ <reference key="NSSuperview" ref="515308735"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSPopUpButtonCell" key="NSCell" id="633115429">
+ <int key="NSCellFlags">-2076049856</int>
+ <int key="NSCellFlags2">1024</int>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="709074847"/>
+ <int key="NSButtonFlags">109199615</int>
+ <int key="NSButtonFlags2">1</int>
+ <object class="NSFont" key="NSAlternateImage">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.300000e+01</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <object class="NSMutableString" key="NSAlternateContents">
+ <characters key="NS.bytes"/>
+ </object>
+ <object class="NSMutableString" key="NSKeyEquivalent">
+ <characters key="NS.bytes"/>
+ </object>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ <object class="NSMenuItem" key="NSMenuItem" id="616492372">
+ <reference key="NSMenu" ref="341113515"/>
+ <string key="NSTitle">From Display</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <int key="NSState">1</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">_popUpItemAction:</string>
+ <int key="NSTag">-1</int>
+ <reference key="NSTarget" ref="633115429"/>
+ </object>
+ <bool key="NSMenuItemRespectAlignment">YES</bool>
+ <object class="NSMenu" key="NSMenu" id="341113515">
+ <object class="NSMutableString" key="NSTitle">
+ <characters key="NS.bytes">OtherViews</characters>
+ </object>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="616492372"/>
+ <object class="NSMenuItem" id="759499526">
+ <reference key="NSMenu" ref="341113515"/>
+ <string key="NSTitle">256 Colors</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">_popUpItemAction:</string>
+ <int key="NSTag">8</int>
+ <reference key="NSTarget" ref="633115429"/>
+ </object>
+ <object class="NSMenuItem" id="543935434">
+ <reference key="NSMenu" ref="341113515"/>
+ <string key="NSTitle">Thousands</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">_popUpItemAction:</string>
+ <int key="NSTag">15</int>
+ <reference key="NSTarget" ref="633115429"/>
+ </object>
+ <object class="NSMenuItem" id="836673018">
+ <reference key="NSMenu" ref="341113515"/>
+ <string key="NSTitle">Millions</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">_popUpItemAction:</string>
+ <int key="NSTag">24</int>
+ <reference key="NSTarget" ref="633115429"/>
+ </object>
+ </object>
+ </object>
+ <int key="NSPreferredEdge">3</int>
+ <bool key="NSUsesItemFromMenu">YES</bool>
+ <bool key="NSAltersState">YES</bool>
+ <int key="NSArrowPosition">1</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="201731424">
+ <reference key="NSNextResponder" ref="515308735"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{17, 238}, {55, 20}}</string>
+ <reference key="NSSuperview" ref="515308735"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="930265681">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string type="base64-UTF8" key="NSContents">Q29sb3JzOgo</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="201731424"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSTextField" id="86150604">
+ <reference key="NSNextResponder" ref="515308735"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 216}, {392, 14}}</string>
+ <reference key="NSSuperview" ref="515308735"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="311969422">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">This option takes effect when X11 is launched again.</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="86150604"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSButton" id="477203622">
+ <reference key="NSNextResponder" ref="515308735"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 182}, {409, 23}}</string>
+ <reference key="NSSuperview" ref="515308735"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="631531164">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Full screen mode</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="477203622"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="298603383">
+ <reference key="NSNextResponder" ref="515308735"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 145}, {385, 31}}</string>
+ <reference key="NSSuperview" ref="515308735"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="761107402">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">Enables the X11 root window. Use the Command-Option-A keystroke to enter and leave full screen mode.</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="298603383"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrame">{{10, 33}, {438, 279}}</string>
+ </object>
+ <string key="NSLabel">Output</string>
+ <reference key="NSColor" ref="57160303"/>
+ <reference key="NSTabView" ref="448510093"/>
+ </object>
+ <object class="NSTabViewItem" id="348328898">
+ <object class="NSView" key="NSView" id="300811574">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="989050925">
+ <reference key="NSNextResponder" ref="300811574"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 243}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="300811574"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="189594322">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Authenticate connections</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="989050925"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="700826966">
+ <reference key="NSNextResponder" ref="300811574"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 166}, {402, 18}}</string>
+ <reference key="NSSuperview" ref="300811574"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="489340979">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Allow connections from network clients</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="700826966"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSAlternateImage" ref="391434389"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSTextField" id="168436707">
+ <reference key="NSNextResponder" ref="300811574"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 195}, {385, 42}}</string>
+ <reference key="NSSuperview" ref="300811574"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="53243865">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string type="base64-UTF8" key="NSContents">TGF1bmNoaW5nIFgxMSB3aWxsIGNyZWF0ZSBYYXV0aG9yaXR5IGFjY2Vzcy1jb250cm9sIGtleXMuIElm
+IHRoZSBzeXN0ZW0ncyBJUCBhZGRyZXNzIGNoYW5nZXMsIHRoZXNlIGtleXMgYmVjb21lIGludmFsaWQg
+d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="168436707"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSTextField" id="363817195">
+ <reference key="NSNextResponder" ref="300811574"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 118}, {385, 42}}</string>
+ <reference key="NSSuperview" ref="300811574"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="390084685">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">If enabled, Authenticate connections must also be enabled to ensure system security. When disabled, connections from remote applications are not allowed.</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="363817195"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ <object class="NSTextField" id="223835729">
+ <reference key="NSNextResponder" ref="300811574"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{20, 17}, {404, 14}}</string>
+ <reference key="NSSuperview" ref="300811574"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="283628678">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">4194304</int>
+ <string key="NSContents">These options take effect when X11 is next launched.</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="223835729"/>
+ <reference key="NSBackgroundColor" ref="57160303"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrame">{{10, 33}, {438, 279}}</string>
+ </object>
+ <string key="NSLabel">Security</string>
+ <reference key="NSColor" ref="57160303"/>
+ <reference key="NSTabView" ref="448510093"/>
+ </object>
+ </object>
+ <reference key="NSSelectedTabViewItem" ref="287591690"/>
+ <reference key="NSFont" ref="463863101"/>
+ <int key="NSTvFlags">0</int>
+ <bool key="NSAllowTruncatedLabels">YES</bool>
+ <bool key="NSDrawsBackground">YES</bool>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="596750588"/>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{481, 345}</string>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
+ <string key="NSMinSize">{213, 129}</string>
+ <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSFrameAutosaveName">x11_prefs</string>
+ </object>
+ <object class="NSWindowTemplate" id="604417141">
+ <int key="NSWindowStyleMask">11</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{361, 362}, {454, 311}}</string>
+ <int key="NSWTFlags">1350041600</int>
+ <string key="NSWindowTitle">X11 Application Menu</string>
+ <string key="NSWindowClass">NSPanel</string>
+ <object class="NSMutableString" key="NSViewClass">
+ <characters key="NS.bytes">View</characters>
+ </object>
+ <string key="NSWindowContentMaxSize">{10000, 10000}</string>
+ <string key="NSWindowContentMinSize">{320, 240}</string>
+ <object class="NSView" key="NSWindowView" id="85544634">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSButton" id="671954382">
+ <reference key="NSNextResponder" ref="85544634"/>
+ <int key="NSvFlags">265</int>
+ <string key="NSFrame">{{340, 231}, {100, 32}}</string>
+ <reference key="NSSuperview" ref="85544634"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="143554520">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">137887744</int>
+ <string key="NSContents">Duplicate</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="671954382"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <object class="NSFont" key="NSAlternateImage" id="549406736">
+ <string key="NSName">Helvetica</string>
+ <double key="NSSize">1.300000e+01</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <object class="NSMutableString" key="NSAlternateContents">
+ <characters key="NS.bytes"/>
+ </object>
+ <object class="NSMutableString" key="NSKeyEquivalent">
+ <characters key="NS.bytes"/>
+ </object>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="492358940">
+ <reference key="NSNextResponder" ref="85544634"/>
+ <int key="NSvFlags">265</int>
+ <string key="NSFrame">{{340, 199}, {100, 32}}</string>
+ <reference key="NSSuperview" ref="85544634"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="8201128">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">137887744</int>
+ <string key="NSContents">Remove</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="492358940"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="549406736"/>
+ <object class="NSMutableString" key="NSAlternateContents">
+ <characters key="NS.bytes"/>
+ </object>
+ <object class="NSMutableString" key="NSKeyEquivalent">
+ <characters key="NS.bytes"/>
+ </object>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSScrollView" id="1063387772">
+ <reference key="NSNextResponder" ref="85544634"/>
+ <int key="NSvFlags">274</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSClipView" id="580565898">
+ <reference key="NSNextResponder" ref="1063387772"/>
+ <int key="NSvFlags">2304</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTableView" id="905092943">
+ <reference key="NSNextResponder" ref="580565898"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrameSize">{301, 198}</string>
+ <reference key="NSSuperview" ref="580565898"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTableHeaderView" key="NSHeaderView" id="792419186">
+ <reference key="NSNextResponder" ref="672307654"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrameSize">{301, 17}</string>
+ <reference key="NSSuperview" ref="672307654"/>
+ <reference key="NSTableView" ref="905092943"/>
+ </object>
+ <object class="_NSCornerView" key="NSCornerView" id="898633680">
+ <reference key="NSNextResponder" ref="1063387772"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{302, 0}, {16, 17}}</string>
+ <reference key="NSSuperview" ref="1063387772"/>
+ </object>
+ <object class="NSMutableArray" key="NSTableColumns">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTableColumn" id="84282687">
+ <double key="NSWidth">9.900000e+01</double>
+ <double key="NSMinWidth">4.000000e+01</double>
+ <double key="NSMaxWidth">1.000000e+03</double>
+ <object class="NSTableHeaderCell" key="NSHeaderCell">
+ <int key="NSCellFlags">75628032</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Name</string>
+ <reference key="NSSupport" ref="26"/>
+ <object class="NSColor" key="NSBackgroundColor" id="113872566">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC4zMzMzMzI5OQA</bytes>
+ </object>
+ <object class="NSColor" key="NSTextColor" id="249576247">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">headerTextColor</string>
+ <reference key="NSColor" ref="214098874"/>
+ </object>
+ </object>
+ <object class="NSTextFieldCell" key="NSDataCell" id="432610585">
+ <int key="NSCellFlags">338820672</int>
+ <int key="NSCellFlags2">1024</int>
+ <string key="NSContents">Text Cell</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="905092943"/>
+ <object class="NSColor" key="NSBackgroundColor" id="822946413">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ <int key="NSResizingMask">3</int>
+ <bool key="NSIsResizeable">YES</bool>
+ <bool key="NSIsEditable">YES</bool>
+ <reference key="NSTableView" ref="905092943"/>
+ </object>
+ <object class="NSTableColumn" id="938444323">
+ <double key="NSWidth">1.217310e+02</double>
+ <double key="NSMinWidth">6.273100e+01</double>
+ <double key="NSMaxWidth">1.000000e+03</double>
+ <object class="NSTableHeaderCell" key="NSHeaderCell">
+ <int key="NSCellFlags">75628032</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Command</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSBackgroundColor" ref="113872566"/>
+ <reference key="NSTextColor" ref="249576247"/>
+ </object>
+ <object class="NSTextFieldCell" key="NSDataCell" id="825378892">
+ <int key="NSCellFlags">338820672</int>
+ <int key="NSCellFlags2">1024</int>
+ <string key="NSContents">Text Cell</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="905092943"/>
+ <reference key="NSBackgroundColor" ref="822946413"/>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ <int key="NSResizingMask">3</int>
+ <bool key="NSIsResizeable">YES</bool>
+ <bool key="NSIsEditable">YES</bool>
+ <reference key="NSTableView" ref="905092943"/>
+ </object>
+ <object class="NSTableColumn" id="242608782">
+ <double key="NSWidth">7.100000e+01</double>
+ <double key="NSMinWidth">1.000000e+01</double>
+ <double key="NSMaxWidth">1.000000e+03</double>
+ <object class="NSTableHeaderCell" key="NSHeaderCell">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Shortcut</string>
+ <reference key="NSSupport" ref="26"/>
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">headerColor</string>
+ <reference key="NSColor" ref="822946413"/>
+ </object>
+ <reference key="NSTextColor" ref="249576247"/>
+ </object>
+ <object class="NSTextFieldCell" key="NSDataCell" id="34714764">
+ <int key="NSCellFlags">338820672</int>
+ <int key="NSCellFlags2">1024</int>
+ <string key="NSContents">Text Cell</string>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.200000e+01</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <reference key="NSControlView" ref="905092943"/>
+ <bool key="NSDrawsBackground">YES</bool>
+ <object class="NSColor" key="NSBackgroundColor" id="812484075">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlBackgroundColor</string>
+ <reference key="NSColor" ref="590688762"/>
+ </object>
+ <reference key="NSTextColor" ref="930815747"/>
+ </object>
+ <int key="NSResizingMask">3</int>
+ <bool key="NSIsResizeable">YES</bool>
+ <bool key="NSIsEditable">YES</bool>
+ <reference key="NSTableView" ref="905092943"/>
+ </object>
+ </object>
+ <double key="NSIntercellSpacingWidth">3.000000e+00</double>
+ <double key="NSIntercellSpacingHeight">2.000000e+00</double>
+ <reference key="NSBackgroundColor" ref="822946413"/>
+ <object class="NSColor" key="NSGridColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">gridColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC41AA</bytes>
+ </object>
+ </object>
+ <double key="NSRowHeight">1.700000e+01</double>
+ <int key="NSTvFlags">1379958784</int>
+ <int key="NSColumnAutoresizingStyle">1</int>
+ <int key="NSDraggingSourceMaskForLocal">-1</int>
+ <int key="NSDraggingSourceMaskForNonLocal">0</int>
+ <bool key="NSAllowsTypeSelect">YES</bool>
+ </object>
+ </object>
+ <string key="NSFrame">{{1, 17}, {301, 198}}</string>
+ <reference key="NSSuperview" ref="1063387772"/>
+ <reference key="NSNextKeyView" ref="905092943"/>
+ <reference key="NSDocView" ref="905092943"/>
+ <reference key="NSBGColor" ref="812484075"/>
+ <int key="NScvFlags">4</int>
+ </object>
+ <object class="NSScroller" id="842897584">
+ <reference key="NSNextResponder" ref="1063387772"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{302, 17}, {15, 198}}</string>
+ <reference key="NSSuperview" ref="1063387772"/>
+ <reference key="NSTarget" ref="1063387772"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSPercent">9.949238e-01</double>
+ </object>
+ <object class="NSScroller" id="17278747">
+ <reference key="NSNextResponder" ref="1063387772"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{1, 215}, {301, 15}}</string>
+ <reference key="NSSuperview" ref="1063387772"/>
+ <int key="NSsFlags">1</int>
+ <reference key="NSTarget" ref="1063387772"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSPercent">6.885246e-01</double>
+ </object>
+ <object class="NSClipView" id="672307654">
+ <reference key="NSNextResponder" ref="1063387772"/>
+ <int key="NSvFlags">2304</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="792419186"/>
+ </object>
+ <string key="NSFrame">{{1, 0}, {301, 17}}</string>
+ <reference key="NSSuperview" ref="1063387772"/>
+ <reference key="NSNextKeyView" ref="792419186"/>
+ <reference key="NSDocView" ref="792419186"/>
+ <reference key="NSBGColor" ref="812484075"/>
+ <int key="NScvFlags">4</int>
+ </object>
+ <reference ref="898633680"/>
+ </object>
+ <string key="NSFrame">{{20, 60}, {318, 231}}</string>
+ <reference key="NSSuperview" ref="85544634"/>
+ <reference key="NSNextKeyView" ref="580565898"/>
+ <int key="NSsFlags">50</int>
+ <reference key="NSVScroller" ref="842897584"/>
+ <reference key="NSHScroller" ref="17278747"/>
+ <reference key="NSContentView" ref="580565898"/>
+ <reference key="NSHeaderClipView" ref="672307654"/>
+ <reference key="NSCornerView" ref="898633680"/>
+ <bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
+ </object>
+ <object class="NSButton" id="758204686">
+ <reference key="NSNextResponder" ref="85544634"/>
+ <int key="NSvFlags">265</int>
+ <string key="NSFrame">{{340, 263}, {100, 32}}</string>
+ <reference key="NSSuperview" ref="85544634"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="1025474039">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">137887744</int>
+ <string key="NSContents">Add Item</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="758204686"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="549406736"/>
+ <object class="NSMutableString" key="NSAlternateContents">
+ <characters key="NS.bytes"/>
+ </object>
+ <object class="NSMutableString" key="NSKeyEquivalent">
+ <characters key="NS.bytes"/>
+ </object>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="125703429">
+ <reference key="NSNextResponder" ref="85544634"/>
+ <int key="NSvFlags">257</int>
+ <string key="NSFrame">{{356, 12}, {84, 32}}</string>
+ <reference key="NSSuperview" ref="85544634"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="892296813">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">137887744</int>
+ <string key="NSContents">Cancel</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="125703429"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="549406736"/>
+ <object class="NSMutableString" key="NSAlternateContents">
+ <characters key="NS.bytes"/>
+ </object>
+ <object class="NSMutableString" key="NSKeyEquivalent">
+ <characters key="NS.bytes"/>
+ </object>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="724002248">
+ <reference key="NSNextResponder" ref="85544634"/>
+ <int key="NSvFlags">257</int>
+ <string key="NSFrame">{{272, 12}, {84, 32}}</string>
+ <reference key="NSSuperview" ref="85544634"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="809610613">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">137887744</int>
+ <string key="NSContents">Done</string>
+ <reference key="NSSupport" ref="463863101"/>
+ <reference key="NSControlView" ref="724002248"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="549406736"/>
+ <string key="NSAlternateContents"/>
+ <object class="NSMutableString" key="NSKeyEquivalent">
+ <characters key="NS.bytes"/>
+ </object>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{454, 311}</string>
+ <reference key="NSSuperview"/>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
+ <string key="NSMinSize">{320, 262}</string>
+ <string key="NSFrameAutosaveName">x11_apps</string>
+ </object>
+ <object class="NSMenu" id="294137138">
+ <string key="NSTitle">Menu</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="318286212">
+ <reference key="NSMenu" ref="294137138"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="511651072">
+ <reference key="NSMenu" ref="294137138"/>
+ <string key="NSTitle">Applications</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="48278059">
+ <string key="NSTitle">Applications</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="563798000">
+ <reference key="NSMenu" ref="48278059"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ <object class="NSMenuItem" id="1032342329">
+ <reference key="NSMenu" ref="48278059"/>
+ <string type="base64-UTF8" key="NSTitle">Q3VzdG9taXpl4oCmA</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="531645050"/>
+ <reference key="NSMixedImage" ref="351811234"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ <string key="NSName"/>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">cut:</string>
+ <reference key="source" ref="941939442"/>
+ <reference key="destination" ref="581727829"/>
+ </object>
+ <int key="connectionID">175</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">paste:</string>
+ <reference key="source" ref="941939442"/>
+ <reference key="destination" ref="924678073"/>
+ </object>
+ <int key="connectionID">176</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">redo:</string>
+ <reference key="source" ref="941939442"/>
+ <reference key="destination" ref="535038564"/>
+ </object>
+ <int key="connectionID">178</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">selectAll:</string>
+ <reference key="source" ref="941939442"/>
+ <reference key="destination" ref="322866464"/>
+ </object>
+ <int key="connectionID">179</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">undo:</string>
+ <reference key="source" ref="941939442"/>
+ <reference key="destination" ref="1010221707"/>
+ </object>
+ <int key="connectionID">180</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">copy:</string>
+ <reference key="source" ref="941939442"/>
+ <reference key="destination" ref="185296989"/>
+ </object>
+ <int key="connectionID">181</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">delete:</string>
+ <reference key="source" ref="941939442"/>
+ <reference key="destination" ref="994817848"/>
+ </object>
+ <int key="connectionID">195</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">minimize_window:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="677652931"/>
+ </object>
+ <int key="connectionID">202</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">close_window:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="984461797"/>
+ </object>
+ <int key="connectionID">205</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">zoom_window:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="1066447520"/>
+ </object>
+ <int key="connectionID">206</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">bring_to_front:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="276216762"/>
+ </object>
+ <int key="connectionID">207</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">hideOtherApplications:</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="206802571"/>
+ </object>
+ <int key="connectionID">263</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">apps_separator</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="390088328"/>
+ </object>
+ <int key="connectionID">273</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">apps_table</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="905092943"/>
+ </object>
+ <int key="connectionID">301</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">apps_table_done:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="724002248"/>
+ </object>
+ <int key="connectionID">302</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">apps_table_delete:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="492358940"/>
+ </object>
+ <int key="connectionID">303</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">apps_table_duplicate:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="671954382"/>
+ </object>
+ <int key="connectionID">304</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">apps_table_show:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="1065386165"/>
+ </object>
+ <int key="connectionID">308</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">apps_table_cancel:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="125703429"/>
+ </object>
+ <int key="connectionID">309</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">apps_table_new:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="758204686"/>
+ </object>
+ <int key="connectionID">311</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_show:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="386173216"/>
+ </object>
+ <int key="connectionID">318</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">x11_about_item</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="139290918"/>
+ </object>
+ <int key="connectionID">321</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">enable_auth</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="989050925"/>
+ </object>
+ <int key="connectionID">387</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">enable_tcp</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="700826966"/>
+ </object>
+ <int key="connectionID">388</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">depth</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="709074847"/>
+ </object>
+ <int key="connectionID">389</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">use_sysbeep</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="418227126"/>
+ </object>
+ <int key="connectionID">390</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">fake_buttons</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="119157981"/>
+ </object>
+ <int key="connectionID">391</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">sync_keymap</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="179949713"/>
+ </object>
+ <int key="connectionID">392</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">enable_keyequivs</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="842100515"/>
+ </object>
+ <int key="connectionID">393</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="119157981"/>
+ </object>
+ <int key="connectionID">394</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="179949713"/>
+ </object>
+ <int key="connectionID">395</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="842100515"/>
+ </object>
+ <int key="connectionID">396</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="418227126"/>
+ </object>
+ <int key="connectionID">397</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="709074847"/>
+ </object>
+ <int key="connectionID">398</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="989050925"/>
+ </object>
+ <int key="connectionID">399</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="700826966"/>
+ </object>
+ <int key="connectionID">401</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">prefs_panel</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="124913468"/>
+ </object>
+ <int key="connectionID">402</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">x11_help:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="504984881"/>
+ </object>
+ <int key="connectionID">422</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">dockMenu</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="294137138"/>
+ </object>
+ <int key="connectionID">426</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">dock_menu</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="294137138"/>
+ </object>
+ <int key="connectionID">428</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="485884620"/>
+ </object>
+ <int key="connectionID">429</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">hide:</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="301008465"/>
+ </object>
+ <int key="connectionID">430</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">unhideAllApplications:</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="1023546148"/>
+ </object>
+ <int key="connectionID">431</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">orderFrontStandardAboutPanel:</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="139290918"/>
+ </object>
+ <int key="connectionID">433</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">dock_apps_menu</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="48278059"/>
+ </object>
+ <int key="connectionID">530</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">dock_window_separator</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="318286212"/>
+ </object>
+ <int key="connectionID">531</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">apps_table_show:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="1032342329"/>
+ </object>
+ <int key="connectionID">534</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">next_window:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="1036389925"/>
+ </object>
+ <int key="connectionID">539</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">previous_window:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="369641893"/>
+ </object>
+ <int key="connectionID">540</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">enable_fullscreen</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="477203622"/>
+ </object>
+ <int key="connectionID">546</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">enable_fullscreen_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="477203622"/>
+ </object>
+ <int key="connectionID">547</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggle_fullscreen:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="6876565"/>
+ </object>
+ <int key="connectionID">548</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">toggle_fullscreen_item</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="6876565"/>
+ </object>
+ <int key="connectionID">549</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">prefs_changed:</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="915448994"/>
+ </object>
+ <int key="connectionID">300300</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">window_separator</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="444952046"/>
+ </object>
+ <int key="connectionID">300331</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">click_through</string>
+ <reference key="source" ref="485884620"/>
+ <reference key="destination" ref="915448994"/>
+ </object>
+ <int key="connectionID">300332</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">menu</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="524015605"/>
+ </object>
+ <int key="connectionID">300334</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">terminate:</string>
+ <reference key="source" ref="815810918"/>
+ <reference key="destination" ref="274138642"/>
+ </object>
+ <int key="connectionID">300336</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <object class="NSArray" key="object" id="330408435">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="children" ref="904585544"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="815810918"/>
+ <reference key="parent" ref="330408435"/>
+ <string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="941939442"/>
+ <reference key="parent" ref="330408435"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="951368722"/>
+ <reference key="parent" ref="330408435"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">29</int>
+ <reference key="object" ref="524015605"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="931553638"/>
+ <reference ref="365880285"/>
+ <reference ref="200491363"/>
+ <reference ref="868031522"/>
+ <reference ref="551174276"/>
+ </object>
+ <reference key="parent" ref="330408435"/>
+ <string key="objectName">MainMenu</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">19</int>
+ <reference key="object" ref="931553638"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="96874957"/>
+ </object>
+ <reference key="parent" ref="524015605"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">24</int>
+ <reference key="object" ref="96874957"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="677652931"/>
+ <reference ref="276216762"/>
+ <reference ref="1066447520"/>
+ <reference ref="1036389925"/>
+ <reference ref="280172320"/>
+ <reference ref="369641893"/>
+ <reference ref="984461797"/>
+ <reference ref="155085383"/>
+ <reference ref="444952046"/>
+ </object>
+ <reference key="parent" ref="931553638"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="276216762"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">23</int>
+ <reference key="object" ref="677652931"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">92</int>
+ <reference key="object" ref="280172320"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">203</int>
+ <reference key="object" ref="984461797"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">204</int>
+ <reference key="object" ref="1066447520"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">536</int>
+ <reference key="object" ref="155085383"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">537</int>
+ <reference key="object" ref="1036389925"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">538</int>
+ <reference key="object" ref="369641893"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">56</int>
+ <reference key="object" ref="365880285"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="576521955"/>
+ </object>
+ <reference key="parent" ref="524015605"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">57</int>
+ <reference key="object" ref="576521955"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="139290918"/>
+ <reference ref="386173216"/>
+ <reference ref="32285361"/>
+ <reference ref="301008465"/>
+ <reference ref="274138642"/>
+ <reference ref="272876017"/>
+ <reference ref="431301145"/>
+ <reference ref="206802571"/>
+ <reference ref="848095279"/>
+ <reference ref="1023546148"/>
+ <reference ref="6876565"/>
+ <reference ref="479677589"/>
+ </object>
+ <reference key="parent" ref="365880285"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">58</int>
+ <reference key="object" ref="139290918"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">129</int>
+ <reference key="object" ref="386173216"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">131</int>
+ <reference key="object" ref="32285361"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="821388474"/>
+ </object>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">130</int>
+ <reference key="object" ref="821388474"/>
+ <reference key="parent" ref="32285361"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">134</int>
+ <reference key="object" ref="301008465"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">136</int>
+ <reference key="object" ref="274138642"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">143</int>
+ <reference key="object" ref="272876017"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">144</int>
+ <reference key="object" ref="431301145"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">145</int>
+ <reference key="object" ref="206802571"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">149</int>
+ <reference key="object" ref="848095279"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">150</int>
+ <reference key="object" ref="1023546148"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">544</int>
+ <reference key="object" ref="6876565"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">545</int>
+ <reference key="object" ref="479677589"/>
+ <reference key="parent" ref="576521955"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">163</int>
+ <reference key="object" ref="200491363"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="526778998"/>
+ </object>
+ <reference key="parent" ref="524015605"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">169</int>
+ <reference key="object" ref="526778998"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="839739619"/>
+ <reference ref="185296989"/>
+ <reference ref="1010221707"/>
+ <reference ref="581727829"/>
+ <reference ref="994817848"/>
+ <reference ref="924678073"/>
+ <reference ref="322866464"/>
+ <reference ref="535038564"/>
+ </object>
+ <reference key="parent" ref="200491363"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">156</int>
+ <reference key="object" ref="839739619"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">157</int>
+ <reference key="object" ref="185296989"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">158</int>
+ <reference key="object" ref="1010221707"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">160</int>
+ <reference key="object" ref="581727829"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">164</int>
+ <reference key="object" ref="994817848"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">171</int>
+ <reference key="object" ref="924678073"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">172</int>
+ <reference key="object" ref="322866464"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">173</int>
+ <reference key="object" ref="535038564"/>
+ <reference key="parent" ref="526778998"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">269</int>
+ <reference key="object" ref="868031522"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="981161348"/>
+ </object>
+ <reference key="parent" ref="524015605"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">270</int>
+ <reference key="object" ref="981161348"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="390088328"/>
+ <reference ref="1065386165"/>
+ </object>
+ <reference key="parent" ref="868031522"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">272</int>
+ <reference key="object" ref="390088328"/>
+ <reference key="parent" ref="981161348"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">305</int>
+ <reference key="object" ref="1065386165"/>
+ <reference key="parent" ref="981161348"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">419</int>
+ <reference key="object" ref="551174276"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="511848303"/>
+ </object>
+ <reference key="parent" ref="524015605"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">420</int>
+ <reference key="object" ref="511848303"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="504984881"/>
+ </object>
+ <reference key="parent" ref="551174276"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">421</int>
+ <reference key="object" ref="504984881"/>
+ <reference key="parent" ref="511848303"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">196</int>
+ <reference key="object" ref="485884620"/>
+ <reference key="parent" ref="330408435"/>
+ <string key="objectName">X11Controller</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">244</int>
+ <reference key="object" ref="124913468"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="941366957"/>
+ </object>
+ <reference key="parent" ref="330408435"/>
+ <string key="objectName">PrefsPanel</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">245</int>
+ <reference key="object" ref="941366957"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="448510093"/>
+ </object>
+ <reference key="parent" ref="124913468"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">348</int>
+ <reference key="object" ref="448510093"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="287591690"/>
+ <reference ref="960678392"/>
+ <reference ref="348328898"/>
+ </object>
+ <reference key="parent" ref="941366957"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">349</int>
+ <reference key="object" ref="287591690"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="596750588"/>
+ </object>
+ <reference key="parent" ref="448510093"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">351</int>
+ <reference key="object" ref="596750588"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="119157981"/>
+ <reference ref="443008216"/>
+ <reference ref="282885445"/>
+ <reference ref="842100515"/>
+ <reference ref="31160162"/>
+ <reference ref="179949713"/>
+ <reference ref="915448994"/>
+ <reference ref="707276799"/>
+ </object>
+ <reference key="parent" ref="287591690"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">363</int>
+ <reference key="object" ref="119157981"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="990762273"/>
+ </object>
+ <reference key="parent" ref="596750588"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">364</int>
+ <reference key="object" ref="443008216"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="391919450"/>
+ </object>
+ <reference key="parent" ref="596750588"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">365</int>
+ <reference key="object" ref="282885445"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="649334366"/>
+ </object>
+ <reference key="parent" ref="596750588"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">368</int>
+ <reference key="object" ref="842100515"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="940564599"/>
+ </object>
+ <reference key="parent" ref="596750588"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">369</int>
+ <reference key="object" ref="31160162"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="666057093"/>
+ </object>
+ <reference key="parent" ref="596750588"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">370</int>
+ <reference key="object" ref="179949713"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="967619578"/>
+ </object>
+ <reference key="parent" ref="596750588"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">352</int>
+ <reference key="object" ref="960678392"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="515308735"/>
+ </object>
+ <reference key="parent" ref="448510093"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">350</int>
+ <reference key="object" ref="515308735"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="418227126"/>
+ <reference ref="1039016593"/>
+ <reference ref="709074847"/>
+ <reference ref="201731424"/>
+ <reference ref="86150604"/>
+ <reference ref="477203622"/>
+ <reference ref="298603383"/>
+ </object>
+ <reference key="parent" ref="960678392"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">371</int>
+ <reference key="object" ref="418227126"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1016069354"/>
+ </object>
+ <reference key="parent" ref="515308735"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">372</int>
+ <reference key="object" ref="1039016593"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="624655599"/>
+ </object>
+ <reference key="parent" ref="515308735"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">382</int>
+ <reference key="object" ref="709074847"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="633115429"/>
+ </object>
+ <reference key="parent" ref="515308735"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">385</int>
+ <reference key="object" ref="201731424"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="930265681"/>
+ </object>
+ <reference key="parent" ref="515308735"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">386</int>
+ <reference key="object" ref="86150604"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="311969422"/>
+ </object>
+ <reference key="parent" ref="515308735"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">541</int>
+ <reference key="object" ref="477203622"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="631531164"/>
+ </object>
+ <reference key="parent" ref="515308735"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">543</int>
+ <reference key="object" ref="298603383"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="761107402"/>
+ </object>
+ <reference key="parent" ref="515308735"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">353</int>
+ <reference key="object" ref="348328898"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="300811574"/>
+ </object>
+ <reference key="parent" ref="448510093"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">354</int>
+ <reference key="object" ref="300811574"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="989050925"/>
+ <reference ref="700826966"/>
+ <reference ref="168436707"/>
+ <reference ref="363817195"/>
+ <reference ref="223835729"/>
+ </object>
+ <reference key="parent" ref="348328898"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">374</int>
+ <reference key="object" ref="989050925"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="189594322"/>
+ </object>
+ <reference key="parent" ref="300811574"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">375</int>
+ <reference key="object" ref="700826966"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="489340979"/>
+ </object>
+ <reference key="parent" ref="300811574"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">376</int>
+ <reference key="object" ref="168436707"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="53243865"/>
+ </object>
+ <reference key="parent" ref="300811574"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">377</int>
+ <reference key="object" ref="363817195"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="390084685"/>
+ </object>
+ <reference key="parent" ref="300811574"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">379</int>
+ <reference key="object" ref="223835729"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="283628678"/>
+ </object>
+ <reference key="parent" ref="300811574"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">285</int>
+ <reference key="object" ref="604417141"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="85544634"/>
+ </object>
+ <reference key="parent" ref="330408435"/>
+ <string key="objectName">EditPrograms</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">286</int>
+ <reference key="object" ref="85544634"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1063387772"/>
+ <reference ref="758204686"/>
+ <reference ref="671954382"/>
+ <reference ref="492358940"/>
+ <reference ref="125703429"/>
+ <reference ref="724002248"/>
+ </object>
+ <reference key="parent" ref="604417141"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">423</int>
+ <reference key="object" ref="294137138"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="318286212"/>
+ <reference ref="511651072"/>
+ </object>
+ <reference key="parent" ref="330408435"/>
+ <string key="objectName">DockMenu</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">524</int>
+ <reference key="object" ref="318286212"/>
+ <reference key="parent" ref="294137138"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">526</int>
+ <reference key="object" ref="511651072"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="48278059"/>
+ </object>
+ <reference key="parent" ref="294137138"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">527</int>
+ <reference key="object" ref="48278059"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1032342329"/>
+ <reference ref="563798000"/>
+ </object>
+ <reference key="parent" ref="511651072"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">532</int>
+ <reference key="object" ref="1032342329"/>
+ <reference key="parent" ref="48278059"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">533</int>
+ <reference key="object" ref="563798000"/>
+ <reference key="parent" ref="48278059"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100363</int>
+ <reference key="object" ref="990762273"/>
+ <reference key="parent" ref="119157981"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100364</int>
+ <reference key="object" ref="391919450"/>
+ <reference key="parent" ref="443008216"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100365</int>
+ <reference key="object" ref="649334366"/>
+ <reference key="parent" ref="282885445"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100368</int>
+ <reference key="object" ref="940564599"/>
+ <reference key="parent" ref="842100515"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100369</int>
+ <reference key="object" ref="666057093"/>
+ <reference key="parent" ref="31160162"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100370</int>
+ <reference key="object" ref="967619578"/>
+ <reference key="parent" ref="179949713"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100371</int>
+ <reference key="object" ref="1016069354"/>
+ <reference key="parent" ref="418227126"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100372</int>
+ <reference key="object" ref="624655599"/>
+ <reference key="parent" ref="1039016593"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100382</int>
+ <reference key="object" ref="633115429"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="341113515"/>
+ </object>
+ <reference key="parent" ref="709074847"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100385</int>
+ <reference key="object" ref="930265681"/>
+ <reference key="parent" ref="201731424"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100386</int>
+ <reference key="object" ref="311969422"/>
+ <reference key="parent" ref="86150604"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100541</int>
+ <reference key="object" ref="631531164"/>
+ <reference key="parent" ref="477203622"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100543</int>
+ <reference key="object" ref="761107402"/>
+ <reference key="parent" ref="298603383"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100374</int>
+ <reference key="object" ref="189594322"/>
+ <reference key="parent" ref="989050925"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100375</int>
+ <reference key="object" ref="489340979"/>
+ <reference key="parent" ref="700826966"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100376</int>
+ <reference key="object" ref="53243865"/>
+ <reference key="parent" ref="168436707"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100377</int>
+ <reference key="object" ref="390084685"/>
+ <reference key="parent" ref="363817195"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100379</int>
+ <reference key="object" ref="283628678"/>
+ <reference key="parent" ref="223835729"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">380</int>
+ <reference key="object" ref="341113515"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="759499526"/>
+ <reference ref="616492372"/>
+ <reference ref="543935434"/>
+ <reference ref="836673018"/>
+ </object>
+ <reference key="parent" ref="633115429"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">435</int>
+ <reference key="object" ref="759499526"/>
+ <reference key="parent" ref="341113515"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">384</int>
+ <reference key="object" ref="616492372"/>
+ <reference key="parent" ref="341113515"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">383</int>
+ <reference key="object" ref="543935434"/>
+ <reference key="parent" ref="341113515"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">381</int>
+ <reference key="object" ref="836673018"/>
+ <reference key="parent" ref="341113515"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300296</int>
+ <reference key="object" ref="915448994"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="117056849"/>
+ </object>
+ <reference key="parent" ref="596750588"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300297</int>
+ <reference key="object" ref="117056849"/>
+ <reference key="parent" ref="915448994"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300298</int>
+ <reference key="object" ref="707276799"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="318286890"/>
+ </object>
+ <reference key="parent" ref="596750588"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300299</int>
+ <reference key="object" ref="318286890"/>
+ <reference key="parent" ref="707276799"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">295</int>
+ <reference key="object" ref="1063387772"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="792419186"/>
+ <reference ref="17278747"/>
+ <reference ref="842897584"/>
+ <reference ref="905092943"/>
+ </object>
+ <reference key="parent" ref="85544634"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300295</int>
+ <reference key="object" ref="792419186"/>
+ <reference key="parent" ref="1063387772"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">200295</int>
+ <reference key="object" ref="17278747"/>
+ <reference key="parent" ref="1063387772"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100295</int>
+ <reference key="object" ref="842897584"/>
+ <reference key="parent" ref="1063387772"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">296</int>
+ <reference key="object" ref="905092943"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="242608782"/>
+ <reference ref="938444323"/>
+ <reference ref="84282687"/>
+ </object>
+ <reference key="parent" ref="1063387772"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">535</int>
+ <reference key="object" ref="242608782"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="34714764"/>
+ </object>
+ <reference key="parent" ref="905092943"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">575</int>
+ <reference key="object" ref="34714764"/>
+ <reference key="parent" ref="242608782"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">298</int>
+ <reference key="object" ref="938444323"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="825378892"/>
+ </object>
+ <reference key="parent" ref="905092943"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">573</int>
+ <reference key="object" ref="825378892"/>
+ <reference key="parent" ref="938444323"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">297</int>
+ <reference key="object" ref="84282687"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="432610585"/>
+ </object>
+ <reference key="parent" ref="905092943"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">574</int>
+ <reference key="object" ref="432610585"/>
+ <reference key="parent" ref="84282687"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">310</int>
+ <reference key="object" ref="758204686"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1025474039"/>
+ </object>
+ <reference key="parent" ref="85544634"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100310</int>
+ <reference key="object" ref="1025474039"/>
+ <reference key="parent" ref="758204686"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">292</int>
+ <reference key="object" ref="671954382"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="143554520"/>
+ </object>
+ <reference key="parent" ref="85544634"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100292</int>
+ <reference key="object" ref="143554520"/>
+ <reference key="parent" ref="671954382"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">293</int>
+ <reference key="object" ref="492358940"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="8201128"/>
+ </object>
+ <reference key="parent" ref="85544634"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100293</int>
+ <reference key="object" ref="8201128"/>
+ <reference key="parent" ref="492358940"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">299</int>
+ <reference key="object" ref="125703429"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="892296813"/>
+ </object>
+ <reference key="parent" ref="85544634"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100299</int>
+ <reference key="object" ref="892296813"/>
+ <reference key="parent" ref="125703429"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">291</int>
+ <reference key="object" ref="724002248"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="809610613"/>
+ </object>
+ <reference key="parent" ref="85544634"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100291</int>
+ <reference key="object" ref="809610613"/>
+ <reference key="parent" ref="724002248"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">300330</int>
+ <reference key="object" ref="444952046"/>
+ <reference key="parent" ref="96874957"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.IBPluginDependency</string>
+ <string>-2.IBPluginDependency</string>
+ <string>-3.IBPluginDependency</string>
+ <string>-3.ImportedFromIB2</string>
+ <string>100295.IBShouldRemoveOnLegacySave</string>
+ <string>129.IBPluginDependency</string>
+ <string>129.ImportedFromIB2</string>
+ <string>130.IBPluginDependency</string>
+ <string>130.ImportedFromIB2</string>
+ <string>131.IBPluginDependency</string>
+ <string>131.ImportedFromIB2</string>
+ <string>134.IBPluginDependency</string>
+ <string>134.ImportedFromIB2</string>
+ <string>136.IBPluginDependency</string>
+ <string>136.ImportedFromIB2</string>
+ <string>143.IBPluginDependency</string>
+ <string>143.ImportedFromIB2</string>
+ <string>144.IBPluginDependency</string>
+ <string>144.ImportedFromIB2</string>
+ <string>145.IBPluginDependency</string>
+ <string>145.ImportedFromIB2</string>
+ <string>149.IBPluginDependency</string>
+ <string>149.ImportedFromIB2</string>
+ <string>150.IBPluginDependency</string>
+ <string>150.ImportedFromIB2</string>
+ <string>156.IBPluginDependency</string>
+ <string>156.ImportedFromIB2</string>
+ <string>157.IBPluginDependency</string>
+ <string>157.ImportedFromIB2</string>
+ <string>158.IBPluginDependency</string>
+ <string>158.ImportedFromIB2</string>
+ <string>160.IBPluginDependency</string>
+ <string>160.ImportedFromIB2</string>
+ <string>163.IBPluginDependency</string>
+ <string>163.ImportedFromIB2</string>
+ <string>164.IBPluginDependency</string>
+ <string>164.ImportedFromIB2</string>
+ <string>169.IBPluginDependency</string>
+ <string>169.ImportedFromIB2</string>
+ <string>169.editorWindowContentRectSynchronizationRect</string>
+ <string>171.IBPluginDependency</string>
+ <string>171.ImportedFromIB2</string>
+ <string>172.IBPluginDependency</string>
+ <string>172.ImportedFromIB2</string>
+ <string>173.IBPluginDependency</string>
+ <string>173.ImportedFromIB2</string>
+ <string>19.IBPluginDependency</string>
+ <string>19.ImportedFromIB2</string>
+ <string>196.IBPluginDependency</string>
+ <string>196.ImportedFromIB2</string>
+ <string>200295.IBShouldRemoveOnLegacySave</string>
+ <string>203.IBPluginDependency</string>
+ <string>203.ImportedFromIB2</string>
+ <string>204.IBPluginDependency</string>
+ <string>204.ImportedFromIB2</string>
+ <string>23.IBPluginDependency</string>
+ <string>23.ImportedFromIB2</string>
+ <string>24.IBPluginDependency</string>
+ <string>24.ImportedFromIB2</string>
+ <string>24.editorWindowContentRectSynchronizationRect</string>
+ <string>244.IBPluginDependency</string>
+ <string>244.IBWindowTemplateEditedContentRect</string>
+ <string>244.ImportedFromIB2</string>
+ <string>244.editorWindowContentRectSynchronizationRect</string>
+ <string>244.windowTemplate.hasMaxSize</string>
+ <string>244.windowTemplate.hasMinSize</string>
+ <string>244.windowTemplate.maxSize</string>
+ <string>244.windowTemplate.minSize</string>
+ <string>245.IBPluginDependency</string>
+ <string>245.ImportedFromIB2</string>
+ <string>269.IBPluginDependency</string>
+ <string>269.ImportedFromIB2</string>
+ <string>270.IBPluginDependency</string>
+ <string>270.ImportedFromIB2</string>
+ <string>270.editorWindowContentRectSynchronizationRect</string>
+ <string>272.IBPluginDependency</string>
+ <string>272.ImportedFromIB2</string>
+ <string>285.IBEditorWindowLastContentRect</string>
+ <string>285.IBPluginDependency</string>
+ <string>285.IBViewEditorWindowController.showingBoundsRectangles</string>
+ <string>285.IBViewEditorWindowController.showingLayoutRectangles</string>
+ <string>285.IBWindowTemplateEditedContentRect</string>
+ <string>285.ImportedFromIB2</string>
+ <string>285.editorWindowContentRectSynchronizationRect</string>
+ <string>285.lastResizeAction</string>
+ <string>285.windowTemplate.hasMaxSize</string>
+ <string>285.windowTemplate.hasMinSize</string>
+ <string>285.windowTemplate.maxSize</string>
+ <string>285.windowTemplate.minSize</string>
+ <string>286.IBPluginDependency</string>
+ <string>286.ImportedFromIB2</string>
+ <string>29.IBEditorWindowLastContentRect</string>
+ <string>29.IBPluginDependency</string>
+ <string>29.ImportedFromIB2</string>
+ <string>29.editorWindowContentRectSynchronizationRect</string>
+ <string>291.IBPluginDependency</string>
+ <string>291.ImportedFromIB2</string>
+ <string>292.IBPluginDependency</string>
+ <string>292.ImportedFromIB2</string>
+ <string>293.IBPluginDependency</string>
+ <string>293.ImportedFromIB2</string>
+ <string>295.IBPluginDependency</string>
+ <string>295.ImportedFromIB2</string>
+ <string>296.IBPluginDependency</string>
+ <string>296.ImportedFromIB2</string>
+ <string>297.IBPluginDependency</string>
+ <string>297.ImportedFromIB2</string>
+ <string>298.IBPluginDependency</string>
+ <string>298.ImportedFromIB2</string>
+ <string>299.IBPluginDependency</string>
+ <string>299.ImportedFromIB2</string>
+ <string>300295.IBShouldRemoveOnLegacySave</string>
+ <string>300296.IBPluginDependency</string>
+ <string>300296.ImportedFromIB2</string>
+ <string>300298.IBPluginDependency</string>
+ <string>300298.ImportedFromIB2</string>
+ <string>300330.IBPluginDependency</string>
+ <string>300330.ImportedFromIB2</string>
+ <string>305.IBPluginDependency</string>
+ <string>305.ImportedFromIB2</string>
+ <string>310.IBPluginDependency</string>
+ <string>310.ImportedFromIB2</string>
+ <string>348.IBPluginDependency</string>
+ <string>348.ImportedFromIB2</string>
+ <string>349.IBPluginDependency</string>
+ <string>349.ImportedFromIB2</string>
+ <string>350.IBPluginDependency</string>
+ <string>350.ImportedFromIB2</string>
+ <string>351.IBPluginDependency</string>
+ <string>351.ImportedFromIB2</string>
+ <string>352.IBPluginDependency</string>
+ <string>352.ImportedFromIB2</string>
+ <string>353.IBPluginDependency</string>
+ <string>353.ImportedFromIB2</string>
+ <string>354.IBPluginDependency</string>
+ <string>354.ImportedFromIB2</string>
+ <string>363.IBPluginDependency</string>
+ <string>363.ImportedFromIB2</string>
+ <string>364.IBPluginDependency</string>
+ <string>364.ImportedFromIB2</string>
+ <string>365.IBPluginDependency</string>
+ <string>365.ImportedFromIB2</string>
+ <string>368.IBPluginDependency</string>
+ <string>368.ImportedFromIB2</string>
+ <string>369.IBPluginDependency</string>
+ <string>369.ImportedFromIB2</string>
+ <string>370.IBPluginDependency</string>
+ <string>370.ImportedFromIB2</string>
+ <string>371.IBPluginDependency</string>
+ <string>371.ImportedFromIB2</string>
+ <string>372.IBPluginDependency</string>
+ <string>372.ImportedFromIB2</string>
+ <string>374.IBPluginDependency</string>
+ <string>374.ImportedFromIB2</string>
+ <string>375.IBPluginDependency</string>
+ <string>375.ImportedFromIB2</string>
+ <string>376.IBPluginDependency</string>
+ <string>376.ImportedFromIB2</string>
+ <string>377.IBPluginDependency</string>
+ <string>377.ImportedFromIB2</string>
+ <string>379.IBPluginDependency</string>
+ <string>379.ImportedFromIB2</string>
+ <string>380.IBPluginDependency</string>
+ <string>380.ImportedFromIB2</string>
+ <string>381.IBPluginDependency</string>
+ <string>381.ImportedFromIB2</string>
+ <string>382.IBPluginDependency</string>
+ <string>382.ImportedFromIB2</string>
+ <string>383.IBPluginDependency</string>
+ <string>383.ImportedFromIB2</string>
+ <string>384.IBPluginDependency</string>
+ <string>384.ImportedFromIB2</string>
+ <string>385.IBPluginDependency</string>
+ <string>385.ImportedFromIB2</string>
+ <string>386.IBPluginDependency</string>
+ <string>386.ImportedFromIB2</string>
+ <string>419.IBPluginDependency</string>
+ <string>419.ImportedFromIB2</string>
+ <string>420.IBPluginDependency</string>
+ <string>420.ImportedFromIB2</string>
+ <string>421.IBPluginDependency</string>
+ <string>421.ImportedFromIB2</string>
+ <string>423.IBPluginDependency</string>
+ <string>423.ImportedFromIB2</string>
+ <string>435.IBPluginDependency</string>
+ <string>435.ImportedFromIB2</string>
+ <string>5.IBPluginDependency</string>
+ <string>5.ImportedFromIB2</string>
+ <string>524.IBPluginDependency</string>
+ <string>524.ImportedFromIB2</string>
+ <string>526.IBPluginDependency</string>
+ <string>526.ImportedFromIB2</string>
+ <string>527.IBPluginDependency</string>
+ <string>527.ImportedFromIB2</string>
+ <string>532.IBPluginDependency</string>
+ <string>532.ImportedFromIB2</string>
+ <string>533.IBPluginDependency</string>
+ <string>533.ImportedFromIB2</string>
+ <string>535.IBPluginDependency</string>
+ <string>535.ImportedFromIB2</string>
+ <string>536.IBPluginDependency</string>
+ <string>536.ImportedFromIB2</string>
+ <string>537.IBPluginDependency</string>
+ <string>537.ImportedFromIB2</string>
+ <string>538.IBPluginDependency</string>
+ <string>538.ImportedFromIB2</string>
+ <string>541.IBPluginDependency</string>
+ <string>541.ImportedFromIB2</string>
+ <string>543.IBPluginDependency</string>
+ <string>543.ImportedFromIB2</string>
+ <string>544.IBPluginDependency</string>
+ <string>544.ImportedFromIB2</string>
+ <string>545.IBPluginDependency</string>
+ <string>545.ImportedFromIB2</string>
+ <string>56.IBPluginDependency</string>
+ <string>56.ImportedFromIB2</string>
+ <string>57.IBEditorWindowLastContentRect</string>
+ <string>57.IBPluginDependency</string>
+ <string>57.ImportedFromIB2</string>
+ <string>57.editorWindowContentRectSynchronizationRect</string>
+ <string>573.IBPluginDependency</string>
+ <string>573.ImportedFromIB2</string>
+ <string>574.IBPluginDependency</string>
+ <string>574.ImportedFromIB2</string>
+ <string>575.IBPluginDependency</string>
+ <string>575.ImportedFromIB2</string>
+ <string>58.IBPluginDependency</string>
+ <string>58.ImportedFromIB2</string>
+ <string>92.IBPluginDependency</string>
+ <string>92.ImportedFromIB2</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1" id="9"/>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{202, 626}, {154, 153}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{271, 666}, {301, 153}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{184, 290}, {481, 345}}</string>
+ <reference ref="9"/>
+ <string>{{184, 290}, {481, 345}}</string>
+ <reference ref="9"/>
+ <reference ref="9"/>
+ <string>{3.40282e+38, 3.40282e+38}</string>
+ <string>{213, 107}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{100, 746}, {155, 33}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{537, 545}, {454, 311}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <reference ref="9"/>
+ <string>{{537, 545}, {454, 311}}</string>
+ <reference ref="9"/>
+ <string>{{433, 406}, {486, 327}}</string>
+ <object class="NSDictionary">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>IBResizeActionFinalFrame</string>
+ <string>IBResizeActionInitialFrame</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>{{537, 554}, {454, 311}}</string>
+ <string>{{537, 576}, {471, 289}}</string>
+ </object>
+ </object>
+ <integer value="0"/>
+ <reference ref="9"/>
+ <string>{3.40282e+38, 3.40282e+38}</string>
+ <string>{320, 240}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{0, 836}, {336, 20}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{67, 819}, {336, 20}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{12, 633}, {218, 203}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>{{79, 616}, {218, 203}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">300336</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">FirstResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSFormatter</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">X11Controller</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>apps_table_cancel:</string>
+ <string>apps_table_delete:</string>
+ <string>apps_table_done:</string>
+ <string>apps_table_duplicate:</string>
+ <string>apps_table_new:</string>
+ <string>apps_table_show:</string>
+ <string>bring_to_front:</string>
+ <string>close_window:</string>
+ <string>enable_fullscreen_changed:</string>
+ <string>minimize_window:</string>
+ <string>next_window:</string>
+ <string>prefs_changed:</string>
+ <string>prefs_show:</string>
+ <string>previous_window:</string>
+ <string>quit:</string>
+ <string>toggle_fullscreen:</string>
+ <string>x11_help:</string>
+ <string>zoom_window:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>apps_separator</string>
+ <string>apps_table</string>
+ <string>click_through</string>
+ <string>depth</string>
+ <string>dock_apps_menu</string>
+ <string>dock_menu</string>
+ <string>dock_window_separator</string>
+ <string>enable_auth</string>
+ <string>enable_fullscreen</string>
+ <string>enable_keyequivs</string>
+ <string>enable_tcp</string>
+ <string>fake_buttons</string>
+ <string>prefs_panel</string>
+ <string>sync_keymap</string>
+ <string>toggle_fullscreen_item</string>
+ <string>use_sysbeep</string>
+ <string>window_separator</string>
+ <string>x11_about_item</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSMenuItem</string>
+ <string>NSTableView</string>
+ <string>NSButton</string>
+ <string>NSPopUpButton</string>
+ <string>NSMenu</string>
+ <string>NSMenu</string>
+ <string>NSMenuItem</string>
+ <string>NSButton</string>
+ <string>NSButton</string>
+ <string>NSButton</string>
+ <string>NSButton</string>
+ <string>NSButton</string>
+ <string>NSPanel</string>
+ <string>NSButton</string>
+ <string>NSMenuItem</string>
+ <string>NSButton</string>
+ <string>NSMenuItem</string>
+ <string>NSMenuItem</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <nil key="IBDocument.LastKnownRelativeProjectPath"/>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>
diff --git a/xorg-server/hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..f60dcbacb
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/English.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/French.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/French.lproj/InfoPlist.strings
new file mode 100644
index 000000000..88e1f04ac
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/French.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/French.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/French.lproj/Localizable.strings
new file mode 100644
index 000000000..2770dfb8c
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/French.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/French.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/French.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..9f9a7da67
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/French.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/German.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/German.lproj/InfoPlist.strings
new file mode 100644
index 000000000..aa37e7555
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/German.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/German.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/German.lproj/Localizable.strings
new file mode 100644
index 000000000..a5489ab5c
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/German.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/German.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/German.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..19532a9c2
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/German.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/Info.plist b/xorg-server/hw/xquartz/bundle/Info.plist
new file mode 100644
index 000000000..6ba02dda2
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Info.plist
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>X11</string>
+ <key>CFBundleGetInfoString</key>
+ <string>X11</string>
+ <key>CFBundleIconFile</key>
+ <string>X11.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.x.X11</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>X11</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>2.2.0</string>
+ <key>CFBundleSignature</key>
+ <string>x11a</string>
+ <key>CSResourcesFileMapped</key>
+ <true/>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2003-2008, Apple Inc.
+Copyright © 2003, XFree86 Project, Inc.
+Copyright © 2003-2008, X.org Foundation, Inc.
+</string>
+ <key>NSMainNibFile</key>
+ <string>main</string>
+ <key>NSPrincipalClass</key>
+ <string>X11Application</string>
+ <key>LSBackgroundOnly</key>
+ <true/>
+</dict>
+</plist>
diff --git a/xorg-server/hw/xquartz/bundle/Italian.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Italian.lproj/InfoPlist.strings
new file mode 100644
index 000000000..412169880
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Italian.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/Italian.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Italian.lproj/Localizable.strings
new file mode 100644
index 000000000..d05d73d44
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Italian.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/Italian.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Italian.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..b6e2e1bb1
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Italian.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/Japanese.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Japanese.lproj/InfoPlist.strings
new file mode 100644
index 000000000..2d6330fa7
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Japanese.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/Japanese.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Japanese.lproj/Localizable.strings
new file mode 100644
index 000000000..99821ea1f
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Japanese.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/Japanese.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Japanese.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..523fd0856
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Japanese.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/Makefile.am b/xorg-server/hw/xquartz/bundle/Makefile.am
new file mode 100644
index 000000000..801fdc7d8
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Makefile.am
@@ -0,0 +1,77 @@
+bin_SCRIPTS = x11app
+
+.PHONY: x11app
+
+x11app:
+ xcodebuild CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ARCHS="$(X11APP_ARCHS)"
+
+install-data-hook:
+ xcodebuild install DSTROOT="/$(DESTDIR)" INSTALL_PATH="$(APPLE_APPLICATIONS_DIR)" DEPLOYMENT_LOCATION=YES SKIP_INSTALL=NO ARCHS="$(X11APP_ARCHS)"
+
+clean-local:
+ rm -rf build
+
+resourcedir=$(libdir)/X11/xserver
+resource_DATA = Xquartz.plist
+
+EXTRA_DIST = \
+ $(resource_DATA) \
+ Info.plist \
+ X11.icns \
+ bundle-main.c \
+ X11.xcodeproj/project.pbxproj \
+ Dutch.lproj/InfoPlist.strings \
+ Dutch.lproj/Localizable.strings \
+ Dutch.lproj/main.nib/keyedobjects.nib \
+ English.lproj/InfoPlist.strings \
+ English.lproj/Localizable.strings \
+ English.lproj/main.nib/designable.nib \
+ English.lproj/main.nib/keyedobjects.nib \
+ French.lproj/InfoPlist.strings \
+ French.lproj/Localizable.strings \
+ French.lproj/main.nib/keyedobjects.nib \
+ German.lproj/InfoPlist.strings \
+ German.lproj/Localizable.strings \
+ German.lproj/main.nib/keyedobjects.nib \
+ Italian.lproj/InfoPlist.strings \
+ Italian.lproj/Localizable.strings \
+ Italian.lproj/main.nib/keyedobjects.nib \
+ Japanese.lproj/InfoPlist.strings \
+ Japanese.lproj/Localizable.strings \
+ Japanese.lproj/main.nib/keyedobjects.nib \
+ Spanish.lproj/InfoPlist.strings \
+ Spanish.lproj/Localizable.strings \
+ Spanish.lproj/main.nib/keyedobjects.nib \
+ da.lproj/InfoPlist.strings \
+ da.lproj/Localizable.strings \
+ da.lproj/main.nib/keyedobjects.nib \
+ fi.lproj/InfoPlist.strings \
+ fi.lproj/Localizable.strings \
+ fi.lproj/main.nib/keyedobjects.nib \
+ ko.lproj/InfoPlist.strings \
+ ko.lproj/Localizable.strings \
+ ko.lproj/main.nib/keyedobjects.nib \
+ no.lproj/InfoPlist.strings \
+ no.lproj/Localizable.strings \
+ no.lproj/main.nib/keyedobjects.nib \
+ pl.lproj/InfoPlist.strings \
+ pl.lproj/Localizable.strings \
+ pl.lproj/main.nib/keyedobjects.nib \
+ pt.lproj/InfoPlist.strings \
+ pt.lproj/Localizable.strings \
+ pt.lproj/main.nib/keyedobjects.nib \
+ pt_PT.lproj/InfoPlist.strings \
+ pt_PT.lproj/Localizable.strings \
+ pt_PT.lproj/main.nib/keyedobjects.nib \
+ ru.lproj/InfoPlist.strings \
+ ru.lproj/Localizable.strings \
+ ru.lproj/main.nib/keyedobjects.nib \
+ sv.lproj/InfoPlist.strings \
+ sv.lproj/Localizable.strings \
+ sv.lproj/main.nib/keyedobjects.nib \
+ zh_CN.lproj/InfoPlist.strings \
+ zh_CN.lproj/Localizable.strings \
+ zh_CN.lproj/main.nib/keyedobjects.nib \
+ zh_TW.lproj/InfoPlist.strings \
+ zh_TW.lproj/Localizable.strings \
+ zh_TW.lproj/main.nib/keyedobjects.nib
diff --git a/xorg-server/hw/xquartz/bundle/Makefile.in b/xorg-server/hw/xquartz/bundle/Makefile.in
new file mode 100644
index 000000000..bd065ed9d
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Makefile.in
@@ -0,0 +1,663 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = hw/xquartz/bundle
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \
+ $(top_builddir)/include/xorg-server.h \
+ $(top_builddir)/include/dix-config.h \
+ $(top_builddir)/include/xgl-config.h \
+ $(top_builddir)/include/xorg-config.h \
+ $(top_builddir)/include/xkb-config.h \
+ $(top_builddir)/include/xwin-config.h \
+ $(top_builddir)/include/kdrive-config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(resourcedir)"
+binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(bin_SCRIPTS)
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+resourceDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(resource_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
+ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+APPDEFAULTDIR = @APPDEFAULTDIR@
+APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@
+APP_MAN_DIR = @APP_MAN_DIR@
+APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASE_FONT_PATH = @BASE_FONT_PATH@
+BUILD_DATE = @BUILD_DATE@
+BUILD_TIME = @BUILD_TIME@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DARWIN_LIBS = @DARWIN_LIBS@
+DBUS_CFLAGS = @DBUS_CFLAGS@
+DBUS_LIBS = @DBUS_LIBS@
+DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@
+DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@
+DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DGA_CFLAGS = @DGA_CFLAGS@
+DGA_LIBS = @DGA_LIBS@
+DIX_CFLAGS = @DIX_CFLAGS@
+DLLTOOL = @DLLTOOL@
+DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@
+DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@
+DMXMODULES_LIBS = @DMXMODULES_LIBS@
+DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@
+DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@
+DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@
+DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@
+DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
+DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
+DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
+DRIPROTO_LIBS = @DRIPROTO_LIBS@
+DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
+DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
+DRI_DRIVER_PATH = @DRI_DRIVER_PATH@
+DSYMUTIL = @DSYMUTIL@
+DTRACE = @DTRACE@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
+FREETYPE_LIBS = @FREETYPE_LIBS@
+GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
+GLX_DEFINES = @GLX_DEFINES@
+GL_CFLAGS = @GL_CFLAGS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+HAL_CFLAGS = @HAL_CFLAGS@
+HAL_LIBS = @HAL_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDRIVE_CFLAGS = @KDRIVE_CFLAGS@
+KDRIVE_INCS = @KDRIVE_INCS@
+KDRIVE_LIBS = @KDRIVE_LIBS@
+KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@
+KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@
+KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@
+LAUNCHD = @LAUNCHD@
+LDFLAGS = @LDFLAGS@
+LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
+LIBDRM_LIBS = @LIBDRM_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_MAN_DIR = @LIB_MAN_DIR@
+LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
+LINUXDOC = @LINUXDOC@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MAKE_HTML = @MAKE_HTML@
+MAKE_PDF = @MAKE_PDF@
+MAKE_PS = @MAKE_PS@
+MAKE_TEXT = @MAKE_TEXT@
+MESA_SOURCE = @MESA_SOURCE@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+MKFONTDIR = @MKFONTDIR@
+MKFONTSCALE = @MKFONTSCALE@
+NMEDIT = @NMEDIT@
+OBJC = @OBJC@
+OBJCCLD = @OBJCCLD@
+OBJCDEPMODE = @OBJCDEPMODE@
+OBJCFLAGS = @OBJCFLAGS@
+OBJCLINK = @OBJCLINK@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
+PCIACCESS_LIBS = @PCIACCESS_LIBS@
+PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@
+PERL = @PERL@
+PKG_CONFIG = @PKG_CONFIG@
+PROJECTROOT = @PROJECTROOT@
+PS2PDF = @PS2PDF@
+RANLIB = @RANLIB@
+RAWCPP = @RAWCPP@
+RAWCPPFLAGS = @RAWCPPFLAGS@
+SED = @SED@
+SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@
+SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@
+STRIP = @STRIP@
+TSLIB_CFLAGS = @TSLIB_CFLAGS@
+TSLIB_LIBS = @TSLIB_LIBS@
+UTILS_SYS_LIBS = @UTILS_SYS_LIBS@
+VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@
+VENDOR_NAME = @VENDOR_NAME@
+VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@
+VENDOR_RELEASE = @VENDOR_RELEASE@
+VERSION = @VERSION@
+X11APP_ARCHS = @X11APP_ARCHS@
+X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
+X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@
+XDMCP_CFLAGS = @XDMCP_CFLAGS@
+XDMCP_LIBS = @XDMCP_LIBS@
+XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@
+XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@
+XDMX_CFLAGS = @XDMX_CFLAGS@
+XDMX_LIBS = @XDMX_LIBS@
+XDMX_SYS_LIBS = @XDMX_SYS_LIBS@
+XEGLMODULES_CFLAGS = @XEGLMODULES_CFLAGS@
+XEGL_LIBS = @XEGL_LIBS@
+XEGL_SYS_LIBS = @XEGL_SYS_LIBS@
+XEPHYR_CFLAGS = @XEPHYR_CFLAGS@
+XEPHYR_DRI_LIBS = @XEPHYR_DRI_LIBS@
+XEPHYR_INCS = @XEPHYR_INCS@
+XEPHYR_LIBS = @XEPHYR_LIBS@
+XF86CONFIGFILE = @XF86CONFIGFILE@
+XF86MISC_CFLAGS = @XF86MISC_CFLAGS@
+XF86MISC_LIBS = @XF86MISC_LIBS@
+XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
+XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
+XGLMODULES_CFLAGS = @XGLMODULES_CFLAGS@
+XGLMODULES_LIBS = @XGLMODULES_LIBS@
+XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@
+XGLXMODULES_LIBS = @XGLXMODULES_LIBS@
+XGLX_LIBS = @XGLX_LIBS@
+XGLX_SYS_LIBS = @XGLX_SYS_LIBS@
+XGL_LIBS = @XGL_LIBS@
+XGL_MODULE_PATH = @XGL_MODULE_PATH@
+XGL_SYS_LIBS = @XGL_SYS_LIBS@
+XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
+XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
+XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
+XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@
+XLIB_CFLAGS = @XLIB_CFLAGS@
+XLIB_LIBS = @XLIB_LIBS@
+XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@
+XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
+XNEST_LIBS = @XNEST_LIBS@
+XNEST_SYS_LIBS = @XNEST_SYS_LIBS@
+XORGCFG_DEP_CFLAGS = @XORGCFG_DEP_CFLAGS@
+XORGCFG_DEP_LIBS = @XORGCFG_DEP_LIBS@
+XORGCONFIG_DEP_CFLAGS = @XORGCONFIG_DEP_CFLAGS@
+XORGCONFIG_DEP_LIBS = @XORGCONFIG_DEP_LIBS@
+XORG_CFLAGS = @XORG_CFLAGS@
+XORG_INCS = @XORG_INCS@
+XORG_LIBS = @XORG_LIBS@
+XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@
+XORG_MODULES_LIBS = @XORG_MODULES_LIBS@
+XORG_OS = @XORG_OS@
+XORG_OS_SUBDIR = @XORG_OS_SUBDIR@
+XORG_SYS_LIBS = @XORG_SYS_LIBS@
+XPRINTMODULES_CFLAGS = @XPRINTMODULES_CFLAGS@
+XPRINTMODULES_LIBS = @XPRINTMODULES_LIBS@
+XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@
+XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@
+XPRINT_CFLAGS = @XPRINT_CFLAGS@
+XPRINT_LIBS = @XPRINT_LIBS@
+XPRINT_SYS_LIBS = @XPRINT_SYS_LIBS@
+XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
+XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
+XSDL_INCS = @XSDL_INCS@
+XSDL_LIBS = @XSDL_LIBS@
+XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@
+XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@
+XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@
+XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@
+XSERVER_LIBS = @XSERVER_LIBS@
+XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@
+XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@
+XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@
+XVFB_LIBS = @XVFB_LIBS@
+XVFB_SYS_LIBS = @XVFB_SYS_LIBS@
+XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@
+XWINMODULES_LIBS = @XWINMODULES_LIBS@
+XWIN_LIBS = @XWIN_LIBS@
+XWIN_SERVER_NAME = @XWIN_SERVER_NAME@
+XWIN_SYS_LIBS = @XWIN_SYS_LIBS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+__XCONFIGFILE__ = @__XCONFIGFILE__@
+abi_ansic = @abi_ansic@
+abi_extension = @abi_extension@
+abi_font = @abi_font@
+abi_videodrv = @abi_videodrv@
+abi_xinput = @abi_xinput@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+driverdir = @driverdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+extdir = @extdir@
+ft_config = @ft_config@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+launchagentsdir = @launchagentsdir@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+logdir = @logdir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sdkdir = @sdkdir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+xglmoduledir = @xglmoduledir@
+xpconfigdir = @xpconfigdir@
+bin_SCRIPTS = x11app
+resourcedir = $(libdir)/X11/xserver
+resource_DATA = Xquartz.plist
+EXTRA_DIST = \
+ $(resource_DATA) \
+ Info.plist \
+ X11.icns \
+ bundle-main.c \
+ X11.xcodeproj/project.pbxproj \
+ Dutch.lproj/InfoPlist.strings \
+ Dutch.lproj/Localizable.strings \
+ Dutch.lproj/main.nib/keyedobjects.nib \
+ English.lproj/InfoPlist.strings \
+ English.lproj/Localizable.strings \
+ English.lproj/main.nib/designable.nib \
+ English.lproj/main.nib/keyedobjects.nib \
+ French.lproj/InfoPlist.strings \
+ French.lproj/Localizable.strings \
+ French.lproj/main.nib/keyedobjects.nib \
+ German.lproj/InfoPlist.strings \
+ German.lproj/Localizable.strings \
+ German.lproj/main.nib/keyedobjects.nib \
+ Italian.lproj/InfoPlist.strings \
+ Italian.lproj/Localizable.strings \
+ Italian.lproj/main.nib/keyedobjects.nib \
+ Japanese.lproj/InfoPlist.strings \
+ Japanese.lproj/Localizable.strings \
+ Japanese.lproj/main.nib/keyedobjects.nib \
+ Spanish.lproj/InfoPlist.strings \
+ Spanish.lproj/Localizable.strings \
+ Spanish.lproj/main.nib/keyedobjects.nib \
+ da.lproj/InfoPlist.strings \
+ da.lproj/Localizable.strings \
+ da.lproj/main.nib/keyedobjects.nib \
+ fi.lproj/InfoPlist.strings \
+ fi.lproj/Localizable.strings \
+ fi.lproj/main.nib/keyedobjects.nib \
+ ko.lproj/InfoPlist.strings \
+ ko.lproj/Localizable.strings \
+ ko.lproj/main.nib/keyedobjects.nib \
+ no.lproj/InfoPlist.strings \
+ no.lproj/Localizable.strings \
+ no.lproj/main.nib/keyedobjects.nib \
+ pl.lproj/InfoPlist.strings \
+ pl.lproj/Localizable.strings \
+ pl.lproj/main.nib/keyedobjects.nib \
+ pt.lproj/InfoPlist.strings \
+ pt.lproj/Localizable.strings \
+ pt.lproj/main.nib/keyedobjects.nib \
+ pt_PT.lproj/InfoPlist.strings \
+ pt_PT.lproj/Localizable.strings \
+ pt_PT.lproj/main.nib/keyedobjects.nib \
+ ru.lproj/InfoPlist.strings \
+ ru.lproj/Localizable.strings \
+ ru.lproj/main.nib/keyedobjects.nib \
+ sv.lproj/InfoPlist.strings \
+ sv.lproj/Localizable.strings \
+ sv.lproj/main.nib/keyedobjects.nib \
+ zh_CN.lproj/InfoPlist.strings \
+ zh_CN.lproj/Localizable.strings \
+ zh_CN.lproj/main.nib/keyedobjects.nib \
+ zh_TW.lproj/InfoPlist.strings \
+ zh_TW.lproj/Localizable.strings \
+ zh_TW.lproj/main.nib/keyedobjects.nib
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xquartz/bundle/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign hw/xquartz/bundle/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f $$d$$p; then \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-resourceDATA: $(resource_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(resourcedir)" || $(MKDIR_P) "$(DESTDIR)$(resourcedir)"
+ @list='$(resource_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(resourceDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(resourcedir)/$$f'"; \
+ $(resourceDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(resourcedir)/$$f"; \
+ done
+
+uninstall-resourceDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(resource_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(resourcedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(resourcedir)/$$f"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(resourcedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-resourceDATA
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binSCRIPTS
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS uninstall-resourceDATA
+
+.MAKE: install-am install-data-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ clean-local distclean distclean-generic distclean-libtool \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-binSCRIPTS install-data install-data-am \
+ install-data-hook install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-resourceDATA install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-binSCRIPTS uninstall-resourceDATA
+
+
+.PHONY: x11app
+
+x11app:
+ xcodebuild CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ARCHS="$(X11APP_ARCHS)"
+
+install-data-hook:
+ xcodebuild install DSTROOT="/$(DESTDIR)" INSTALL_PATH="$(APPLE_APPLICATIONS_DIR)" DEPLOYMENT_LOCATION=YES SKIP_INSTALL=NO ARCHS="$(X11APP_ARCHS)"
+
+clean-local:
+ rm -rf build
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/xorg-server/hw/xquartz/bundle/Spanish.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Spanish.lproj/InfoPlist.strings
new file mode 100644
index 000000000..0e4287d14
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Spanish.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/Spanish.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Spanish.lproj/Localizable.strings
new file mode 100644
index 000000000..652f432a5
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Spanish.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/Spanish.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Spanish.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..029349dd0
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Spanish.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/X11.icns b/xorg-server/hw/xquartz/bundle/X11.icns
new file mode 100644
index 000000000..d770e617d
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/X11.icns
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/X11.xcodeproj/project.pbxproj b/xorg-server/hw/xquartz/bundle/X11.xcodeproj/project.pbxproj
new file mode 100644
index 000000000..ae8ec07e6
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/X11.xcodeproj/project.pbxproj
@@ -0,0 +1,458 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 527F24190B5D938C007840A7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */; };
+ 527F241A0B5D938C007840A7 /* main.nib in Resources */ = {isa = PBXBuildFile; fileRef = 02345980000FD03B11CA0E72 /* main.nib */; };
+ 527F241B0B5D938C007840A7 /* X11.icns in Resources */ = {isa = PBXBuildFile; fileRef = 50459C5F038587C60ECA21EC /* X11.icns */; };
+ 527F241D0B5D938C007840A7 /* bundle-main.c in Sources */ = {isa = PBXBuildFile; fileRef = 50EE2AB703849F0B0ECA21EC /* bundle-main.c */; };
+ 527F241F0B5D938C007840A7 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50F4F0A7039D6ACA0E82C0CB /* CoreFoundation.framework */; };
+ 527F24200B5D938C007840A7 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 570C5748047186C400ACF82F /* SystemConfiguration.framework */; };
+ 527F24370B5D9D89007840A7 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 527F24260B5D938C007840A7 /* Info.plist */; };
+ 52D9C0ED0BCDDF6B00CD2AFC /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 52D9C0EB0BCDDF6B00CD2AFC /* Localizable.strings */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 0867D6ABFE840B52C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 1870340FFE93FCAF11CA0CD7 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E460D1B6C05005958A5 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E470D1B6C05005958A5 /* Dutch */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Dutch; path = Dutch.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E480D1B6C05005958A5 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E490D1B6C05005958A5 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E4A0D1B6C05005958A5 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = German; path = German.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E4B0D1B6C05005958A5 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Italian; path = Italian.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E4C0D1B6C05005958A5 /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Japanese; path = Japanese.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E4D0D1B6C05005958A5 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E4E0D1B6C05005958A5 /* no */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = no; path = no.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E4F0D1B6C05005958A5 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E500D1B6C05005958A5 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E510D1B6C05005958A5 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E520D1B6C05005958A5 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E530D1B6C05005958A5 /* Spanish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Spanish; path = Spanish.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E540D1B6C05005958A5 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E550D1B6C05005958A5 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E560D1B6C05005958A5 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 3FB03E570D1B6C17005958A5 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E580D1B6C17005958A5 /* Dutch */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Dutch; path = Dutch.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E590D1B6C17005958A5 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E5A0D1B6C17005958A5 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E5B0D1B6C17005958A5 /* German */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = German; path = German.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E5C0D1B6C17005958A5 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Italian; path = Italian.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E5D0D1B6C17005958A5 /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Japanese; path = Japanese.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E5E0D1B6C17005958A5 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E5F0D1B6C17005958A5 /* no */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = no; path = no.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E600D1B6C17005958A5 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E610D1B6C17005958A5 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E620D1B6C17005958A5 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E630D1B6C17005958A5 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E640D1B6C17005958A5 /* Spanish */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Spanish; path = Spanish.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E650D1B6C17005958A5 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E660D1B6C17005958A5 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E670D1B6C17005958A5 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 3FB03E680D1B6C34005958A5 /* da */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = da; path = da.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E690D1B6C34005958A5 /* Dutch */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Dutch; path = Dutch.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E6A0D1B6C34005958A5 /* fi */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = fi; path = fi.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E6B0D1B6C34005958A5 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E6C0D1B6C34005958A5 /* German */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = German; path = German.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E6D0D1B6C34005958A5 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = Italian.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E6E0D1B6C34005958A5 /* Japanese */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Japanese; path = Japanese.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E6F0D1B6C34005958A5 /* ko */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ko; path = ko.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E700D1B6C34005958A5 /* no */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = no; path = no.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E710D1B6C34005958A5 /* pl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pl; path = pl.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E720D1B6C34005958A5 /* pt */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt; path = pt.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E730D1B6C34005958A5 /* pt_PT */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = pt_PT; path = pt_PT.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E740D1B6C34005958A5 /* ru */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = ru; path = ru.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E750D1B6C34005958A5 /* Spanish */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Spanish; path = Spanish.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E760D1B6C34005958A5 /* sv */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = sv; path = sv.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E770D1B6C34005958A5 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = zh_CN; path = zh_CN.lproj/main.nib; sourceTree = "<group>"; };
+ 3FB03E780D1B6C34005958A5 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = zh_TW; path = zh_TW.lproj/main.nib; sourceTree = "<group>"; };
+ 50459C5F038587C60ECA21EC /* X11.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = X11.icns; sourceTree = "<group>"; };
+ 50EE2AB703849F0B0ECA21EC /* bundle-main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = "bundle-main.c"; sourceTree = "<group>"; };
+ 50F4F0A7039D6ACA0E82C0CB /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
+ 527F24260B5D938C007840A7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; };
+ 527F24270B5D938C007840A7 /* X11.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = X11.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 52D9C0EC0BCDDF6B00CD2AFC /* English */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 570C5748047186C400ACF82F /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = /System/Library/Frameworks/SystemConfiguration.framework; sourceTree = "<absolute>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 527F241E0B5D938C007840A7 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 527F241F0B5D938C007840A7 /* CoreFoundation.framework in Frameworks */,
+ 527F24200B5D938C007840A7 /* SystemConfiguration.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 195DF8CFFE9D517E11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 527F24270B5D938C007840A7 /* X11.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 20286C29FDCF999611CA2CEA /* X11 */ = {
+ isa = PBXGroup;
+ children = (
+ 20286C2AFDCF999611CA2CEA /* Sources */,
+ 20286C2CFDCF999611CA2CEA /* Resources */,
+ 20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */,
+ 195DF8CFFE9D517E11CA2CBB /* Products */,
+ 527F24260B5D938C007840A7 /* Info.plist */,
+ );
+ name = X11;
+ sourceTree = "<group>";
+ };
+ 20286C2AFDCF999611CA2CEA /* Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 50EE2AB703849F0B0ECA21EC /* bundle-main.c */,
+ );
+ name = Sources;
+ sourceTree = "<group>";
+ };
+ 20286C2CFDCF999611CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 52D9C0EB0BCDDF6B00CD2AFC /* Localizable.strings */,
+ 50459C5F038587C60ECA21EC /* X11.icns */,
+ 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */,
+ 02345980000FD03B11CA0E72 /* main.nib */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */ = {
+ isa = PBXGroup;
+ children = (
+ 50F4F0A7039D6ACA0E82C0CB /* CoreFoundation.framework */,
+ 570C5748047186C400ACF82F /* SystemConfiguration.framework */,
+ );
+ name = "External Frameworks and Libraries";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ 527F24170B5D938C007840A7 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 527F24160B5D938C007840A7 /* X11 */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 527F24220B5D938C007840A7 /* Build configuration list for PBXNativeTarget "X11" */;
+ buildPhases = (
+ 527F24170B5D938C007840A7 /* Headers */,
+ 527F24180B5D938C007840A7 /* Resources */,
+ 527F241C0B5D938C007840A7 /* Sources */,
+ 527F241E0B5D938C007840A7 /* Frameworks */,
+ 527F24210B5D938C007840A7 /* Rez */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = X11;
+ productName = X11;
+ productReference = 527F24270B5D938C007840A7 /* X11.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 20286C28FDCF999611CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = 527F24080B5D8FFC007840A7 /* Build configuration list for PBXProject "X11" */;
+ compatibilityVersion = "Xcode 2.4";
+ hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ da,
+ Dutch,
+ fi,
+ Italian,
+ ko,
+ no,
+ pl,
+ pt,
+ pt_PT,
+ ru,
+ Spanish,
+ sv,
+ zh_CN,
+ zh_TW,
+ );
+ mainGroup = 20286C29FDCF999611CA2CEA /* X11 */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 527F24160B5D938C007840A7 /* X11 */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 527F24180B5D938C007840A7 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 527F24370B5D9D89007840A7 /* Info.plist in Resources */,
+ 527F24190B5D938C007840A7 /* InfoPlist.strings in Resources */,
+ 527F241A0B5D938C007840A7 /* main.nib in Resources */,
+ 527F241B0B5D938C007840A7 /* X11.icns in Resources */,
+ 52D9C0ED0BCDDF6B00CD2AFC /* Localizable.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXRezBuildPhase section */
+ 527F24210B5D938C007840A7 /* Rez */ = {
+ isa = PBXRezBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXRezBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 527F241C0B5D938C007840A7 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 527F241D0B5D938C007840A7 /* bundle-main.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 02345980000FD03B11CA0E72 /* main.nib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 1870340FFE93FCAF11CA0CD7 /* English */,
+ 3FB03E680D1B6C34005958A5 /* da */,
+ 3FB03E690D1B6C34005958A5 /* Dutch */,
+ 3FB03E6A0D1B6C34005958A5 /* fi */,
+ 3FB03E6B0D1B6C34005958A5 /* French */,
+ 3FB03E6C0D1B6C34005958A5 /* German */,
+ 3FB03E6D0D1B6C34005958A5 /* Italian */,
+ 3FB03E6E0D1B6C34005958A5 /* Japanese */,
+ 3FB03E6F0D1B6C34005958A5 /* ko */,
+ 3FB03E700D1B6C34005958A5 /* no */,
+ 3FB03E710D1B6C34005958A5 /* pl */,
+ 3FB03E720D1B6C34005958A5 /* pt */,
+ 3FB03E730D1B6C34005958A5 /* pt_PT */,
+ 3FB03E740D1B6C34005958A5 /* ru */,
+ 3FB03E750D1B6C34005958A5 /* Spanish */,
+ 3FB03E760D1B6C34005958A5 /* sv */,
+ 3FB03E770D1B6C34005958A5 /* zh_CN */,
+ 3FB03E780D1B6C34005958A5 /* zh_TW */,
+ );
+ name = main.nib;
+ sourceTree = "<group>";
+ };
+ 0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 0867D6ABFE840B52C02AAC07 /* English */,
+ 3FB03E570D1B6C17005958A5 /* da */,
+ 3FB03E580D1B6C17005958A5 /* Dutch */,
+ 3FB03E590D1B6C17005958A5 /* fi */,
+ 3FB03E5A0D1B6C17005958A5 /* French */,
+ 3FB03E5B0D1B6C17005958A5 /* German */,
+ 3FB03E5C0D1B6C17005958A5 /* Italian */,
+ 3FB03E5D0D1B6C17005958A5 /* Japanese */,
+ 3FB03E5E0D1B6C17005958A5 /* ko */,
+ 3FB03E5F0D1B6C17005958A5 /* no */,
+ 3FB03E600D1B6C17005958A5 /* pl */,
+ 3FB03E610D1B6C17005958A5 /* pt */,
+ 3FB03E620D1B6C17005958A5 /* pt_PT */,
+ 3FB03E630D1B6C17005958A5 /* ru */,
+ 3FB03E640D1B6C17005958A5 /* Spanish */,
+ 3FB03E650D1B6C17005958A5 /* sv */,
+ 3FB03E660D1B6C17005958A5 /* zh_CN */,
+ 3FB03E670D1B6C17005958A5 /* zh_TW */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ 52D9C0EB0BCDDF6B00CD2AFC /* Localizable.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 52D9C0EC0BCDDF6B00CD2AFC /* English */,
+ 3FB03E460D1B6C05005958A5 /* da */,
+ 3FB03E470D1B6C05005958A5 /* Dutch */,
+ 3FB03E480D1B6C05005958A5 /* fi */,
+ 3FB03E490D1B6C05005958A5 /* French */,
+ 3FB03E4A0D1B6C05005958A5 /* German */,
+ 3FB03E4B0D1B6C05005958A5 /* Italian */,
+ 3FB03E4C0D1B6C05005958A5 /* Japanese */,
+ 3FB03E4D0D1B6C05005958A5 /* ko */,
+ 3FB03E4E0D1B6C05005958A5 /* no */,
+ 3FB03E4F0D1B6C05005958A5 /* pl */,
+ 3FB03E500D1B6C05005958A5 /* pt */,
+ 3FB03E510D1B6C05005958A5 /* pt_PT */,
+ 3FB03E520D1B6C05005958A5 /* ru */,
+ 3FB03E530D1B6C05005958A5 /* Spanish */,
+ 3FB03E540D1B6C05005958A5 /* sv */,
+ 3FB03E550D1B6C05005958A5 /* zh_CN */,
+ 3FB03E560D1B6C05005958A5 /* zh_TW */,
+ );
+ name = Localizable.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 527F24090B5D8FFC007840A7 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INSTALL_MODE_FLAG = "a+rX";
+ };
+ name = Development;
+ };
+ 527F240A0B5D8FFC007840A7 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INSTALL_MODE_FLAG = "a+rX";
+ };
+ name = Deployment;
+ };
+ 527F240B0B5D8FFC007840A7 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INSTALL_MODE_FLAG = "a+rX";
+ };
+ name = Default;
+ };
+ 527F24230B5D938C007840A7 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ FRAMEWORK_SEARCH_PATHS = "";
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ HEADER_SEARCH_PATHS = /usr/X11/include;
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = /usr/X11;
+ LIBRARY_SEARCH_PATHS = /usr/X11/lib;
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = (
+ "-lXau",
+ "-lxcb",
+ "-lX11",
+ );
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = X11;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 527F24240B5D938C007840A7 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ FRAMEWORK_SEARCH_PATHS = "";
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ HEADER_SEARCH_PATHS = /usr/X11/include;
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = /usr/X11;
+ LIBRARY_SEARCH_PATHS = /usr/X11/lib;
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = (
+ "-lXau",
+ "-lxcb",
+ "-lX11",
+ );
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = X11;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 527F24250B5D938C007840A7 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = "";
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ HEADER_SEARCH_PATHS = /usr/X11/include;
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = /usr/X11;
+ LIBRARY_SEARCH_PATHS = /usr/X11/lib;
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = (
+ "-lXau",
+ "-lxcb",
+ "-lX11",
+ );
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = X11;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 527F24080B5D8FFC007840A7 /* Build configuration list for PBXProject "X11" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 527F24090B5D8FFC007840A7 /* Development */,
+ 527F240A0B5D8FFC007840A7 /* Deployment */,
+ 527F240B0B5D8FFC007840A7 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 527F24220B5D938C007840A7 /* Build configuration list for PBXNativeTarget "X11" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 527F24230B5D938C007840A7 /* Development */,
+ 527F24240B5D938C007840A7 /* Deployment */,
+ 527F24250B5D938C007840A7 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 20286C28FDCF999611CA2CEA /* Project object */;
+}
diff --git a/xorg-server/hw/xquartz/bundle/Xquartz.plist b/xorg-server/hw/xquartz/bundle/Xquartz.plist
new file mode 100644
index 000000000..e15704516
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/Xquartz.plist
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+
+<!-- This file contains system-wide defaults for the Apple X11 server -->
+
+<plist version="1.0">
+<dict>
+ <key>apps_menu</key>
+ <array>
+ <array>
+ <string>Terminal</string>
+ <string>xterm</string>
+ <string>n</string>
+ </array>
+ <array>
+ <string>xman</string>
+ <string>xman</string>
+ <string></string>
+ </array>
+ <array>
+ <string>xlogo</string>
+ <string>xlogo</string>
+ <string></string>
+ </array>
+ </array>
+</dict>
+</plist>
diff --git a/xorg-server/hw/xquartz/bundle/bundle-main.c b/xorg-server/hw/xquartz/bundle/bundle-main.c
new file mode 100644
index 000000000..e97770a55
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/bundle-main.c
@@ -0,0 +1,136 @@
+/* main.c -- X application launcher
+
+ Copyright (c) 2007 Jeremy Huddleston
+ Copyright (c) 2007 Apple Inc
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name(s) of the above
+ copyright holders shall not be used in advertising or otherwise to
+ promote the sale, use or other dealings in this Software without
+ prior written authorization. */
+
+#include <X11/Xlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <CoreFoundation/CoreFoundation.h>
+
+#define DEFAULT_CLIENT "/usr/X11/bin/xterm"
+#define DEFAULT_STARTX "/usr/X11/bin/startx"
+#define DEFAULT_SHELL "/bin/sh"
+
+static int execute(const char *command);
+static char *command_from_prefs(const char *key, const char *default_value);
+
+int main(int argc, char **argv) {
+ Display *display;
+ const char *s;
+
+ size_t i;
+ fprintf(stderr, "X11.app: main(): argc=%d\n", argc);
+ for(i=0; i < argc; i++) {
+ fprintf(stderr, "\targv[%u] = %s\n", (unsigned)i, argv[i]);
+ }
+
+ /* If we have a process serial number and it's our only arg, act as if
+ * the user double clicked the app bundle: launch app_to_run if possible
+ */
+ if(argc == 1 || (argc == 2 && !strncmp(argv[1], "-psn_", 5))) {
+ /* Now, try to open a display, if so, run the launcher */
+ display = XOpenDisplay(NULL);
+ if(display) {
+ fprintf(stderr, "X11.app: Closing the display and sleeping for 2s to allow the X server to start up.\n");
+ /* Could open the display, start the launcher */
+ XCloseDisplay(display);
+
+ /* Give 2 seconds for the server to start...
+ * TODO: *Really* fix this race condition
+ */
+ usleep(2000);
+ return execute(command_from_prefs("app_to_run", DEFAULT_CLIENT));
+ }
+ }
+
+ /* Start the server */
+ if(s = getenv("DISPLAY")) {
+ fprintf(stderr, "X11.app: Could not connect to server (DISPLAY=\"%s\", unsetting). Starting X server.\n", s);
+ unsetenv("DISPLAY");
+ } else {
+ fprintf(stderr, "X11.app: Could not connect to server (DISPLAY is not set). Starting X server.\n");
+ }
+ return execute(command_from_prefs("startx_script", DEFAULT_STARTX));
+}
+
+static int execute(const char *command) {
+ const char *newargv[7];
+ const char **s;
+
+ newargv[0] = "/usr/bin/login";
+ newargv[1] = "-fp";
+ newargv[2] = getlogin();
+ newargv[3] = command_from_prefs("login_shell", DEFAULT_SHELL);
+ newargv[4] = "-c";
+ newargv[5] = command;
+ newargv[6] = NULL;
+
+ fprintf(stderr, "X11.app: Launching %s:\n", command);
+ for(s=newargv; *s; s++) {
+ fprintf(stderr, "\targv[%d] = %s\n", s - newargv, *s);
+ }
+
+ execvp (newargv[0], (char * const *) newargv);
+ perror ("X11.app: Couldn't exec.");
+ return(1);
+}
+
+static char *command_from_prefs(const char *key, const char *default_value) {
+ char *command = NULL;
+
+ CFStringRef cfKey = CFStringCreateWithCString(NULL, key, kCFStringEncodingASCII);
+ CFPropertyListRef PlistRef = CFPreferencesCopyAppValue(cfKey, kCFPreferencesCurrentApplication);
+
+ if ((PlistRef == NULL) || (CFGetTypeID(PlistRef) != CFStringGetTypeID())) {
+ CFStringRef cfDefaultValue = CFStringCreateWithCString(NULL, default_value, kCFStringEncodingASCII);
+
+ CFPreferencesSetAppValue(cfKey, cfDefaultValue, kCFPreferencesCurrentApplication);
+ CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
+
+ int len = strlen(default_value) + 1;
+ command = (char *)malloc(len * sizeof(char));
+ if(!command)
+ return NULL;
+ strcpy(command, default_value);
+ } else {
+ int len = CFStringGetLength((CFStringRef)PlistRef) + 1;
+ command = (char *)malloc(len * sizeof(char));
+ if(!command)
+ return NULL;
+ CFStringGetCString((CFStringRef)PlistRef, command, len, kCFStringEncodingASCII);
+ }
+
+ if (PlistRef)
+ CFRelease(PlistRef);
+
+ return command;
+}
diff --git a/xorg-server/hw/xquartz/bundle/da.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/da.lproj/InfoPlist.strings
new file mode 100644
index 000000000..88e1f04ac
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/da.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/da.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/da.lproj/Localizable.strings
new file mode 100644
index 000000000..9608a2e6b
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/da.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/da.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/da.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..4a2bd4bde
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/da.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/fi.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/fi.lproj/InfoPlist.strings
new file mode 100644
index 000000000..8e4f6474f
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/fi.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/fi.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/fi.lproj/Localizable.strings
new file mode 100644
index 000000000..e8420fbaa
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/fi.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/fi.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/fi.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..b5039fd44
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/fi.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/ko.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/ko.lproj/InfoPlist.strings
new file mode 100644
index 000000000..4c738f8b2
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/ko.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/ko.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/ko.lproj/Localizable.strings
new file mode 100644
index 000000000..56a335859
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/ko.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/ko.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/ko.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..925945c4d
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/ko.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/no.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/no.lproj/InfoPlist.strings
new file mode 100644
index 000000000..eb1cfb002
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/no.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/no.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/no.lproj/Localizable.strings
new file mode 100644
index 000000000..5157a67de
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/no.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/no.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/no.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..ca25327f5
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/no.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/pl.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/pl.lproj/InfoPlist.strings
new file mode 100644
index 000000000..b9c950214
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/pl.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/pl.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/pl.lproj/Localizable.strings
new file mode 100644
index 000000000..4ae12d77f
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/pl.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/pl.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/pl.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..e9ca5404b
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/pl.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/pt.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/pt.lproj/InfoPlist.strings
new file mode 100644
index 000000000..33c637448
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/pt.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/pt.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/pt.lproj/Localizable.strings
new file mode 100644
index 000000000..23ea96847
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/pt.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/pt.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/pt.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..e88cccdba
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/pt.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/pt_PT.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/pt_PT.lproj/InfoPlist.strings
new file mode 100644
index 000000000..33c637448
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/pt_PT.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/pt_PT.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/pt_PT.lproj/Localizable.strings
new file mode 100644
index 000000000..71c33ad14
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/pt_PT.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/pt_PT.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/pt_PT.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..a61933475
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/pt_PT.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/ru.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/ru.lproj/InfoPlist.strings
new file mode 100644
index 000000000..7f722e4b6
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/ru.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/ru.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/ru.lproj/Localizable.strings
new file mode 100644
index 000000000..3b3811234
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/ru.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/ru.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/ru.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..9354e0264
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/ru.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/sv.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/sv.lproj/InfoPlist.strings
new file mode 100644
index 000000000..655d5ff63
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/sv.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/sv.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/sv.lproj/Localizable.strings
new file mode 100644
index 000000000..796f06c21
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/sv.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/sv.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/sv.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..bd01c2dac
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/sv.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/zh_CN.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/zh_CN.lproj/InfoPlist.strings
new file mode 100644
index 000000000..b5df36885
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/zh_CN.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/zh_CN.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/zh_CN.lproj/Localizable.strings
new file mode 100644
index 000000000..f88a6da4b
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/zh_CN.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/zh_CN.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/zh_CN.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..e36c15fb6
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/zh_CN.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/zh_TW.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/zh_TW.lproj/InfoPlist.strings
new file mode 100644
index 000000000..92d5473b0
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/zh_TW.lproj/InfoPlist.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/zh_TW.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/zh_TW.lproj/Localizable.strings
new file mode 100644
index 000000000..f009302c2
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/zh_TW.lproj/Localizable.strings
Binary files differ
diff --git a/xorg-server/hw/xquartz/bundle/zh_TW.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/zh_TW.lproj/main.nib/keyedobjects.nib
new file mode 100644
index 000000000..36602c53e
--- /dev/null
+++ b/xorg-server/hw/xquartz/bundle/zh_TW.lproj/main.nib/keyedobjects.nib
Binary files differ
diff --git a/xorg-server/hw/xquartz/darwin.c b/xorg-server/hw/xquartz/darwin.c
new file mode 100644
index 000000000..20bcee592
--- /dev/null
+++ b/xorg-server/hw/xquartz/darwin.c
@@ -0,0 +1,1026 @@
+/**************************************************************
+ *
+ * Shared code for the Darwin X Server
+ * running with Quartz or IOKit display mode
+ *
+ * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved.
+ * Copyright (c) 2007 Apple Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "os.h"
+#include "servermd.h"
+#include "inputstr.h"
+#include "scrnintstr.h"
+#include "mibstore.h" // mi backing store implementation
+#include "mipointer.h" // mi software cursor
+#include "micmap.h" // mi colormap code
+#include "fb.h" // fb framebuffer code
+#include "site.h"
+#include "globals.h"
+#include "dix.h"
+
+#ifdef XINPUT
+# include <X11/extensions/XI.h>
+# include <X11/extensions/XIproto.h>
+# include "exevents.h"
+# include "extinit.h"
+#endif
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/syslimits.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#define HAS_UTSNAME 1
+#include <sys/utsname.h>
+
+#define NO_CFPLUGIN
+#include <IOKit/IOKitLib.h>
+#include <IOKit/hidsystem/IOHIDLib.h>
+#include <IOKit/hidsystem/ev_keymap.h>
+
+#ifdef MITSHM
+#define _XSHM_SERVER_
+#include <X11/extensions/XShm.h>
+#endif
+
+#include "darwin.h"
+#include "darwinEvents.h"
+#include "darwinKeyboard.h"
+#include "quartz.h"
+//#include "darwinClut8.h"
+
+#ifdef ENABLE_DEBUG_LOG
+FILE *debug_log_fp = NULL;
+#endif
+
+/*
+ * X server shared global variables
+ */
+int darwinScreensFound = 0;
+DevPrivateKey darwinScreenKey = &darwinScreenKey;
+io_connect_t darwinParamConnect = 0;
+int darwinEventReadFD = -1;
+int darwinEventWriteFD = -1;
+// int darwinMouseAccelChange = 1;
+int darwinFakeButtons = 0;
+
+// location of X11's (0,0) point in global screen coordinates
+int darwinMainScreenX = 0;
+int darwinMainScreenY = 0;
+
+// parameters read from the command line or user preferences
+unsigned int darwinDesiredWidth = 0, darwinDesiredHeight = 0;
+int darwinDesiredDepth = -1;
+int darwinDesiredRefresh = -1;
+char *darwinKeymapFile = "USA.keymapping";
+int darwinSyncKeymap = FALSE;
+
+// modifier masks for faking mouse buttons
+int darwinFakeMouse2Mask = NX_ALTERNATEMASK;
+int darwinFakeMouse3Mask = NX_COMMANDMASK;
+
+// devices
+DeviceIntPtr darwinPointer = NULL;
+DeviceIntPtr darwinKeyboard = NULL;
+
+// Common pixmap formats
+static PixmapFormatRec formats[] = {
+ { 1, 1, BITMAP_SCANLINE_PAD },
+ { 4, 8, BITMAP_SCANLINE_PAD },
+ { 8, 8, BITMAP_SCANLINE_PAD },
+ { 15, 16, BITMAP_SCANLINE_PAD },
+ { 16, 16, BITMAP_SCANLINE_PAD },
+ { 24, 32, BITMAP_SCANLINE_PAD },
+ { 32, 32, BITMAP_SCANLINE_PAD }
+};
+const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]);
+
+#ifndef OSNAME
+#define OSNAME " Darwin"
+#endif
+#ifndef OSVENDOR
+#define OSVENDOR ""
+#endif
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XORG_VERSION_SNAP
+#endif
+#ifndef BUILD_DATE
+#define BUILD_DATE ""
+#endif
+#ifndef XORG_RELEASE
+#define XORG_RELEASE "?"
+#endif
+
+void DDXRingBell(int volume, int pitch, int duration) {
+ // FIXME -- make some noise, yo
+}
+
+void
+DarwinPrintBanner(void)
+{
+ // this should change depending on which specific server we are building
+ ErrorF("XQuartz starting:\n");
+ ErrorF("X.org Release 7.2\n"); // This is here to help fink until they fix their packages.
+ ErrorF("X.Org X Server %s\nBuild Date: %s\n", XSERVER_VERSION, BUILD_DATE );
+}
+
+
+/*
+ * DarwinSaveScreen
+ * X screensaver support. Not implemented.
+ */
+static Bool DarwinSaveScreen(ScreenPtr pScreen, int on)
+{
+ // FIXME
+ if (on == SCREEN_SAVER_FORCER) {
+ } else if (on == SCREEN_SAVER_ON) {
+ } else {
+ }
+ return TRUE;
+}
+
+
+/*
+ * DarwinAddScreen
+ * This is a callback from dix during AddScreen() from InitOutput().
+ * Initialize the screen and communicate information about it back to dix.
+ */
+static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv) {
+ int dpi;
+ static int foundIndex = 0;
+ Bool ret;
+ DarwinFramebufferPtr dfb;
+
+ // reset index of found screens for each server generation
+ if (index == 0) foundIndex = 0;
+
+ // allocate space for private per screen storage
+ dfb = xalloc(sizeof(DarwinFramebufferRec));
+
+ // SCREEN_PRIV(pScreen) = dfb;
+ dixSetPrivate(&pScreen->devPrivates, darwinScreenKey, dfb);
+
+ // setup hardware/mode specific details
+ ret = QuartzAddScreen(foundIndex, pScreen);
+ foundIndex++;
+ if (! ret)
+ return FALSE;
+
+ // reset the visual list
+ miClearVisualTypes();
+
+ // setup a single visual appropriate for our pixel type
+ if(!miSetVisualTypesAndMasks(dfb->depth, dfb->visuals, dfb->bitsPerRGB,
+ dfb->preferredCVC, dfb->redMask,
+ dfb->greenMask, dfb->blueMask)) {
+ return FALSE;
+ }
+
+ miSetPixmapDepths();
+
+ // machine independent screen init
+ // setup _Screen structure in pScreen
+ if (monitorResolution)
+ dpi = monitorResolution;
+ else
+ dpi = 75;
+
+ // initialize fb
+ if (! fbScreenInit(pScreen,
+ dfb->framebuffer, // pointer to screen bitmap
+ dfb->width, dfb->height, // screen size in pixels
+ dpi, dpi, // dots per inch
+ dfb->pitch/(dfb->bitsPerPixel/8), // pixel width of framebuffer
+ dfb->bitsPerPixel)) // bits per pixel for screen
+ {
+ return FALSE;
+ }
+
+// ErrorF("Screen type: %d, %d=%d, %d=%d, %d=%d, %x=%x=%x, %x=%x=%x, %x=%x=%x\n", pScreen->visuals->class,
+// pScreen->visuals->offsetRed, dfb->bitsPerRGB * 2,
+// pScreen->visuals->offsetGreen, dfb->bitsPerRGB,
+// pScreen->visuals->offsetBlue, 0,
+// pScreen->visuals->redMask, dfb->redMask, ((1<<dfb->bitsPerRGB)-1) << pScreen->visuals->offsetRed,
+// pScreen->visuals->greenMask, dfb->greenMask, ((1<<dfb->bitsPerRGB)-1) << pScreen->visuals->offsetGreen,
+// pScreen->visuals->blueMask, dfb->blueMask, ((1<<dfb->bitsPerRGB)-1) << pScreen->visuals->offsetBlue);
+
+ // set the RGB order correctly for TrueColor
+// if (dfb->bitsPerPixel > 8) {
+// for (i = 0, visual = pScreen->visuals; // someday we may have more than 1
+// i < pScreen->numVisuals; i++, visual++) {
+// if (visual->class == TrueColor) {
+// visual->offsetRed = bitsPerRGB * 2;
+// visual->offsetGreen = bitsPerRGB;
+// visual->offsetBlue = 0;
+// visual->redMask = ((1<<bitsPerRGB)-1) << visual->offsetRed;
+// visual->greenMask = ((1<<bitsPerRGB)-1) << visual->offsetGreen;
+// visual->blueMask = ((1<<bitsPerRGB)-1) << visual->offsetBlue;
+// }
+// }
+// }
+
+#ifdef RENDER
+ if (! fbPictureInit(pScreen, 0, 0)) {
+ return FALSE;
+ }
+#endif
+
+#ifdef MITSHM
+ ShmRegisterFbFuncs(pScreen);
+#endif
+
+ // this must be initialized (why doesn't X have a default?)
+ pScreen->SaveScreen = DarwinSaveScreen;
+
+ // finish mode dependent screen setup including cursor support
+ if (!QuartzSetupScreen(index, pScreen)) {
+ return FALSE;
+ }
+
+ // create and install the default colormap and
+ // set pScreen->blackPixel / pScreen->white
+ if (!miCreateDefColormap( pScreen )) {
+ return FALSE;
+ }
+
+ /* Set the colormap to the statically defined one if we're in 8 bit
+ * mode and we're using a fixed color map. Essentially this translates
+ * to Darwin/x86 in 8-bit mode.
+ */
+// if(dfb->depth == 8) {
+// ColormapPtr map = RootlessGetColormap (pScreen);
+// for( i = 0; i < map->pVisual->ColormapEntries; i++ ) {
+// Entry *ent = map->red + i;
+// ErrorF("Setting lo %d -> r: %04x g: %04x b: %04x\n", i, darwinClut8[i].red, darwinClut8[i].green, darwinClut8[i].blue);
+// ent->co.local.red = darwinClut8[i].red;
+// ent->co.local.green = darwinClut8[i].green;
+// ent->co.local.blue = darwinClut8[i].blue;
+// }
+// }
+
+ dixScreenOrigins[index].x = dfb->x;
+ dixScreenOrigins[index].y = dfb->y;
+
+ /* ErrorF("Screen %d added: %dx%d @ (%d,%d)\n",
+ index, dfb->width, dfb->height, dfb->x, dfb->y); */
+
+ return TRUE;
+}
+
+/*
+ =============================================================================
+
+ mouse and keyboard callbacks
+
+ =============================================================================
+*/
+
+#if 0
+/*
+ * DarwinChangePointerControl
+ * Set mouse acceleration and thresholding
+ * FIXME: We currently ignore the threshold in ctrl->threshold.
+ */
+static void DarwinChangePointerControl(
+ DeviceIntPtr device,
+ PtrCtrl *ctrl )
+{
+ kern_return_t kr;
+ double acceleration;
+
+ if (!darwinMouseAccelChange)
+ return;
+
+ acceleration = ctrl->num / ctrl->den;
+ kr = IOHIDSetMouseAcceleration( darwinParamConnect, acceleration );
+ if (kr != KERN_SUCCESS)
+ ErrorF( "Could not set mouse acceleration with kernel return = 0x%x.\n", kr );
+}
+#endif
+
+/*
+ * DarwinMouseProc
+ * Handle the initialization, etc. of a mouse
+ */
+static int DarwinMouseProc(
+ DeviceIntPtr pPointer,
+ int what )
+{
+ CARD8 map[6];
+
+ switch (what) {
+
+ case DEVICE_INIT:
+ pPointer->public.on = FALSE;
+
+ // Set button map.
+ map[1] = 1;
+ map[2] = 2;
+ map[3] = 3;
+ map[4] = 4;
+ map[5] = 5;
+ InitPointerDeviceStruct( (DevicePtr)pPointer, map, 5,
+ GetMotionHistory,
+ (PtrCtrlProcPtr)NoopDDA,
+ GetMotionHistorySize(), 2);
+
+#ifdef XINPUT
+ InitValuatorAxisStruct( pPointer,
+ 0, // X axis
+ 0, // min value
+ 16000, // max value (fixme screen size?)
+ 1, // resolution (fixme ?)
+ 1, // min resolution
+ 1 ); // max resolution
+ InitValuatorAxisStruct( pPointer,
+ 1, // X axis
+ 0, // min value
+ 16000, // max value (fixme screen size?)
+ 1, // resolution (fixme ?)
+ 1, // min resolution
+ 1 ); // max resolution
+#endif
+ break;
+
+ case DEVICE_ON:
+ pPointer->public.on = TRUE;
+ AddEnabledDevice( darwinEventReadFD );
+ return Success;
+
+ case DEVICE_CLOSE:
+ case DEVICE_OFF:
+ pPointer->public.on = FALSE;
+ RemoveEnabledDevice( darwinEventReadFD );
+ return Success;
+ }
+
+ return Success;
+}
+
+
+/*
+ * DarwinKeybdProc
+ * Callback from X
+ */
+static int DarwinKeybdProc( DeviceIntPtr pDev, int onoff )
+{
+ switch ( onoff ) {
+ case DEVICE_INIT:
+ DarwinKeyboardInit( pDev );
+ break;
+ case DEVICE_ON:
+ pDev->public.on = TRUE;
+ AddEnabledDevice( darwinEventReadFD );
+ break;
+ case DEVICE_OFF:
+ pDev->public.on = FALSE;
+ RemoveEnabledDevice( darwinEventReadFD );
+ break;
+ case DEVICE_CLOSE:
+ break;
+ }
+
+ return Success;
+}
+
+/*
+===========================================================================
+
+ Utility routines
+
+===========================================================================
+*/
+
+/*
+ * DarwinFindLibraryFile
+ * Search for a file in the standard Library paths, which are (in order):
+ *
+ * ~/Library/ user specific
+ * /Library/ host specific
+ * /Network/Library/ LAN specific
+ * /System/Library/ OS specific
+ *
+ * A sub-path can be specified to search in below the various Library
+ * directories. Returns a new character string (owned by the caller)
+ * containing the full path to the first file found.
+ */
+static char * DarwinFindLibraryFile(
+ const char *file,
+ const char *pathext )
+{
+ // Library search paths
+ char *pathList[] = {
+ "",
+ "/Network",
+ "/System",
+ NULL
+ };
+ char *home;
+ char *fullPath;
+ int i = 0;
+
+ // Return the file name as is if it is already a fully qualified path.
+ if (!access(file, F_OK)) {
+ fullPath = xalloc(strlen(file)+1);
+ strcpy(fullPath, file);
+ return fullPath;
+ }
+
+ fullPath = xalloc(PATH_MAX);
+
+ home = getenv("HOME");
+ if (home) {
+ snprintf(fullPath, PATH_MAX, "%s/Library/%s/%s", home, pathext, file);
+ if (!access(fullPath, F_OK))
+ return fullPath;
+ }
+
+ while (pathList[i]) {
+ snprintf(fullPath, PATH_MAX, "%s/Library/%s/%s", pathList[i++],
+ pathext, file);
+ if (!access(fullPath, F_OK))
+ return fullPath;
+ }
+
+ xfree(fullPath);
+ return NULL;
+}
+
+
+/*
+ * DarwinParseModifierList
+ * Parse a list of modifier names and return a corresponding modifier mask
+ */
+int DarwinParseModifierList(
+ const char *constmodifiers) // string containing list of modifier names
+{
+ int result = 0;
+
+ if (constmodifiers) {
+ char *modifiers = strdup(constmodifiers);
+ char *modifier;
+ int nxkey;
+ char *p = modifiers;
+
+ while (p) {
+ modifier = strsep(&p, " ,+&|/"); // allow lots of separators
+ nxkey = DarwinModifierStringToNXKey(modifier);
+ if (nxkey != -1)
+ result |= DarwinModifierNXKeyToNXMask(nxkey);
+ else
+ ErrorF("fakebuttons: Unknown modifier \"%s\"\n", modifier);
+ }
+ free(modifiers);
+ }
+ return result;
+}
+
+/*
+===========================================================================
+
+ Functions needed to link against device independent X
+
+===========================================================================
+*/
+
+/*
+ * InitInput
+ * Register the keyboard and mouse devices
+ */
+void InitInput( int argc, char **argv )
+{
+ darwinPointer = AddInputDevice(DarwinMouseProc, TRUE);
+ RegisterPointerDevice( darwinPointer );
+
+ darwinKeyboard = AddInputDevice(DarwinKeybdProc, TRUE);
+ RegisterKeyboardDevice( darwinKeyboard );
+
+ DarwinEQInit( (DevicePtr)darwinKeyboard, (DevicePtr)darwinPointer );
+
+ QuartzInitInput(argc, argv);
+}
+
+
+/*
+ * DarwinAdjustScreenOrigins
+ * Shift all screens so the X11 (0, 0) coordinate is at the top
+ * left of the global screen coordinates.
+ *
+ * Screens can be arranged so the top left isn't on any screen, so
+ * instead use the top left of the leftmost screen as (0,0). This
+ * may mean some screen space is in -y, but it's better that (0,0)
+ * be onscreen, or else default xterms disappear. It's better that
+ * -y be used than -x, because when popup menus are forced
+ * "onscreen" by dumb window managers like twm, they'll shift the
+ * menus down instead of left, which still looks funny but is an
+ * easier target to hit.
+ */
+void
+DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo)
+{
+ int i, left, top;
+
+ left = dixScreenOrigins[0].x;
+ top = dixScreenOrigins[0].y;
+
+ /* Find leftmost screen. If there's a tie, take the topmost of the two. */
+ for (i = 1; i < pScreenInfo->numScreens; i++) {
+ if (dixScreenOrigins[i].x < left ||
+ (dixScreenOrigins[i].x == left &&
+ dixScreenOrigins[i].y < top))
+ {
+ left = dixScreenOrigins[i].x;
+ top = dixScreenOrigins[i].y;
+ }
+ }
+
+ darwinMainScreenX = left;
+ darwinMainScreenY = top;
+
+ /* Shift all screens so that there is a screen whose top left
+ is at X11 (0,0) and at global screen coordinate
+ (darwinMainScreenX, darwinMainScreenY). */
+
+ if (darwinMainScreenX != 0 || darwinMainScreenY != 0) {
+ for (i = 0; i < pScreenInfo->numScreens; i++) {
+ dixScreenOrigins[i].x -= darwinMainScreenX;
+ dixScreenOrigins[i].y -= darwinMainScreenY;
+ /* ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n",
+ i, dixScreenOrigins[i].x, dixScreenOrigins[i].y); */
+ }
+ }
+}
+
+
+/*
+ * InitOutput
+ * Initialize screenInfo for all actually accessible framebuffers.
+ *
+ * The display mode dependent code gets called three times. The mode
+ * specific InitOutput routines are expected to discover the number
+ * of potentially useful screens and cache routes to them internally.
+ * Inside DarwinAddScreen are two other mode specific calls.
+ * A mode specific AddScreen routine is called for each screen to
+ * actually initialize the screen with the ScreenPtr structure.
+ * After other screen setup has been done, a mode specific
+ * SetupScreen function can be called to finalize screen setup.
+ */
+void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv )
+{
+ int i;
+
+ pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
+ pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
+ pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
+ pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
+
+ // List how we want common pixmap formats to be padded
+ pScreenInfo->numPixmapFormats = NUMFORMATS;
+ for (i = 0; i < NUMFORMATS; i++)
+ pScreenInfo->formats[i] = formats[i];
+
+ // Discover screens and do mode specific initialization
+ QuartzInitOutput(argc, argv);
+
+ // Add screens
+ for (i = 0; i < darwinScreensFound; i++) {
+ AddScreen( DarwinAddScreen, argc, argv );
+ }
+
+ DarwinAdjustScreenOrigins(pScreenInfo);
+}
+
+
+/*
+ * OsVendorFataError
+ */
+void OsVendorFatalError( void )
+{
+ ErrorF( " OsVendorFatalError\n" );
+}
+
+
+/*
+ * OsVendorInit
+ * Initialization of Darwin OS support.
+ */
+void OsVendorInit(void)
+{
+ if (serverGeneration == 1) {
+ DarwinPrintBanner();
+#ifdef ENABLE_DEBUG_LOG
+ {
+ char *home_dir=NULL, *log_file_path=NULL;
+ home_dir = getenv("HOME");
+ if (home_dir) asprintf(&log_file_path, "%s/%s", home_dir, DEBUG_LOG_NAME);
+ if (log_file_path) {
+ if (!access(log_file_path, F_OK)) {
+ debug_log_fp = fopen(log_file_path, "a");
+ if (debug_log_fp) ErrorF("Debug logging enabled to %s\n", log_file_path);
+ }
+ free(log_file_path);
+ }
+ }
+#endif
+ }
+ // DEBUG_LOG("Xquartz started at %s\n", ctime(time(NULL)));
+
+ // Find the full path to the keymapping file.
+ if ( darwinKeymapFile ) {
+ char *tempStr = DarwinFindLibraryFile(darwinKeymapFile, "Keyboards");
+ if ( !tempStr ) {
+ ErrorF("Could not find keymapping file %s.\n", darwinKeymapFile);
+ } else {
+ ErrorF("Using keymapping provided in %s.\n", tempStr);
+ }
+ darwinKeymapFile = tempStr;
+ }
+}
+
+
+/*
+ * ddxInitGlobals
+ * Called by InitGlobals() from os/util.c.
+ */
+void ddxInitGlobals(void)
+{
+}
+
+
+/*
+ * ddxProcessArgument
+ * Process device-dependent command line args. Returns 0 if argument is
+ * not device dependent, otherwise Count of number of elements of argv
+ * that are part of a device dependent commandline option.
+ */
+int ddxProcessArgument( int argc, char *argv[], int i )
+{
+// if ( !strcmp( argv[i], "-fullscreen" ) ) {
+// ErrorF( "Running full screen in parallel with Mac OS X Quartz window server.\n" );
+// return 1;
+// }
+
+// if ( !strcmp( argv[i], "-rootless" ) ) {
+// ErrorF( "Running rootless inside Mac OS X window server.\n" );
+// return 1;
+// }
+
+ // This command line arg is passed when launched from the Aqua GUI.
+ if ( !strncmp( argv[i], "-psn_", 5 ) ) {
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "-fakebuttons" ) ) {
+ darwinFakeButtons = TRUE;
+ ErrorF( "Faking a three button mouse\n" );
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "-nofakebuttons" ) ) {
+ darwinFakeButtons = FALSE;
+ ErrorF( "Not faking a three button mouse\n" );
+ return 1;
+ }
+
+ if (!strcmp( argv[i], "-fakemouse2" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-fakemouse2 must be followed by a modifer list\n" );
+ }
+ if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], ""))
+ darwinFakeMouse2Mask = 0;
+ else
+ darwinFakeMouse2Mask = DarwinParseModifierList(argv[i+1]);
+ ErrorF("Modifier mask to fake mouse button 2 = 0x%x\n",
+ darwinFakeMouse2Mask);
+ return 2;
+ }
+
+ if (!strcmp( argv[i], "-fakemouse3" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-fakemouse3 must be followed by a modifer list\n" );
+ }
+ if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], ""))
+ darwinFakeMouse3Mask = 0;
+ else
+ darwinFakeMouse3Mask = DarwinParseModifierList(argv[i+1]);
+ ErrorF("Modifier mask to fake mouse button 3 = 0x%x\n",
+ darwinFakeMouse3Mask);
+ return 2;
+ }
+
+ if ( !strcmp( argv[i], "-keymap" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-keymap must be followed by a filename\n" );
+ }
+ darwinKeymapFile = argv[i+1];
+ return 2;
+ }
+
+ if ( !strcmp( argv[i], "-nokeymap" ) ) {
+ darwinKeymapFile = NULL;
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "+synckeymap" ) ) {
+ darwinSyncKeymap = TRUE;
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "-synckeymap" ) ) {
+ darwinSyncKeymap = FALSE;
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "-size" ) ) {
+ if ( i >= argc-2 ) {
+ FatalError( "-size must be followed by two numbers\n" );
+ }
+#ifdef OLD_POWERBOOK_G3
+ ErrorF( "Ignoring unsupported -size option on old PowerBook G3\n" );
+#else
+ darwinDesiredWidth = atoi( argv[i+1] );
+ darwinDesiredHeight = atoi( argv[i+2] );
+ ErrorF( "Attempting to use width x height = %i x %i\n",
+ darwinDesiredWidth, darwinDesiredHeight );
+#endif
+ return 3;
+ }
+
+ if ( !strcmp( argv[i], "-depth" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-depth must be followed by a number\n" );
+ }
+#ifdef OLD_POWERBOOK_G3
+ ErrorF( "Ignoring unsupported -depth option on old PowerBook G3\n");
+#else
+ darwinDesiredDepth = atoi( argv[i+1] );
+ if(darwinDesiredDepth != -1 &&
+ darwinDesiredDepth != 8 &&
+ darwinDesiredDepth != 15 &&
+ darwinDesiredDepth != 24) {
+ FatalError( "Unsupported pixel depth. Use 8, 15, or 24 bits\n" );
+ }
+
+ ErrorF( "Attempting to use pixel depth of %i\n", darwinDesiredDepth );
+#endif
+ return 2;
+ }
+
+ if ( !strcmp( argv[i], "-refresh" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-refresh must be followed by a number\n" );
+ }
+#ifdef OLD_POWERBOOK_G3
+ ErrorF( "Ignoring unsupported -refresh option on old PowerBook G3\n");
+#else
+ darwinDesiredRefresh = atoi( argv[i+1] );
+ ErrorF( "Attempting to use refresh rate of %i\n", darwinDesiredRefresh );
+#endif
+ return 2;
+ }
+
+ if (!strcmp( argv[i], "-showconfig" ) || !strcmp( argv[i], "-version" )) {
+ DarwinPrintBanner();
+ exit(0);
+ }
+
+ return 0;
+}
+
+
+/*
+ * ddxUseMsg --
+ * Print out correct use of device dependent commandline options.
+ * Maybe the user now knows what really to do ...
+ */
+void ddxUseMsg( void )
+{
+ ErrorF("\n");
+ ErrorF("\n");
+ ErrorF("Device Dependent Usage:\n");
+ ErrorF("\n");
+ ErrorF("-fakebuttons : fake a three button mouse with Command and Option keys.\n");
+ ErrorF("-nofakebuttons : don't fake a three button mouse.\n");
+ ErrorF("-fakemouse2 <modifiers> : fake middle mouse button with modifier keys.\n");
+ ErrorF("-fakemouse3 <modifiers> : fake right mouse button with modifier keys.\n");
+ ErrorF(" ex: -fakemouse2 \"option,shift\" = option-shift-click is middle button.\n");
+ ErrorF("-keymap <file> : read the keymapping from a file instead of the kernel.\n");
+ ErrorF("-version : show the server version.\n");
+ ErrorF("\n");
+// ErrorF("Quartz modes (Experimental / In Development):\n");
+// ErrorF("-fullscreen : run full screen in parallel with Mac OS X window server.\n");
+// ErrorF("-rootless : run rootless inside Mac OS X window server.\n");
+ ErrorF("\n");
+ ErrorF("Options ignored in rootless mode:\n");
+ ErrorF("-size <height> <width> : use a screen resolution of <height> x <width>.\n");
+ ErrorF("-depth <8,15,24> : use this bit depth.\n");
+ ErrorF("-refresh <rate> : use a monitor refresh rate of <rate> Hz.\n");
+ ErrorF("\n");
+}
+
+
+/*
+ * ddxGiveUp --
+ * Device dependent cleanup. Called by dix before normal server death.
+ */
+void ddxGiveUp( void )
+{
+ ErrorF( "Quitting XQuartz...\n" );
+
+ //if (!quartzRootless)
+ // quartzProcs->ReleaseScreens();
+}
+
+
+/*
+ * AbortDDX --
+ * DDX - specific abort routine. Called by AbortServer(). The attempt is
+ * made to restore all original setting of the displays. Also all devices
+ * are closed.
+ */
+void AbortDDX( void )
+{
+ ErrorF( " AbortDDX\n" );
+ /*
+ * This is needed for a abnormal server exit, since the normal exit stuff
+ * MUST also be performed (i.e. the vt must be left in a defined state)
+ */
+ ddxGiveUp();
+}
+
+#include "mivalidate.h" // for union _Validate used by windowstr.h
+#include "windowstr.h" // for struct _Window
+#include "scrnintstr.h" // for struct _Screen
+
+// This is copied from Xserver/hw/xfree86/common/xf86Helper.c.
+// Quartz mode uses this when switching in and out of Quartz.
+// Quartz or IOKit can use this when waking from sleep.
+// Copyright (c) 1997-1998 by The XFree86 Project, Inc.
+
+/*
+ * xf86SetRootClip --
+ * Enable or disable rendering to the screen by
+ * setting the root clip list and revalidating
+ * all of the windows
+ */
+
+void
+xf86SetRootClip (ScreenPtr pScreen, BOOL enable)
+{
+ WindowPtr pWin = WindowTable[pScreen->myNum];
+ WindowPtr pChild;
+ Bool WasViewable = (Bool)(pWin->viewable);
+ Bool anyMarked = TRUE;
+ RegionPtr pOldClip = NULL, bsExposed;
+#ifdef DO_SAVE_UNDERS
+ Bool dosave = FALSE;
+#endif
+ WindowPtr pLayerWin;
+ BoxRec box;
+
+ if (WasViewable)
+ {
+ for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
+ {
+ (void) (*pScreen->MarkOverlappedWindows)(pChild,
+ pChild,
+ &pLayerWin);
+ }
+ (*pScreen->MarkWindow) (pWin);
+ anyMarked = TRUE;
+ if (pWin->valdata)
+ {
+ if (HasBorder (pWin))
+ {
+ RegionPtr borderVisible;
+
+ borderVisible = REGION_CREATE(pScreen, NullBox, 1);
+ REGION_SUBTRACT(pScreen, borderVisible,
+ &pWin->borderClip, &pWin->winSize);
+ pWin->valdata->before.borderVisible = borderVisible;
+ }
+ pWin->valdata->before.resized = TRUE;
+ }
+ }
+
+ /*
+ * Use REGION_BREAK to avoid optimizations in ValidateTree
+ * that assume the root borderClip can't change well, normally
+ * it doesn't...)
+ */
+ if (enable)
+ {
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = pScreen->width;
+ box.y2 = pScreen->height;
+ REGION_RESET(pScreen, &pWin->borderClip, &box);
+ REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
+ }
+ else
+ {
+ REGION_EMPTY(pScreen, &pWin->borderClip);
+ REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
+ }
+
+ ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
+
+ if (WasViewable)
+ {
+ if (pWin->backStorage)
+ {
+ pOldClip = REGION_CREATE(pScreen, NullBox, 1);
+ REGION_COPY(pScreen, pOldClip, &pWin->clipList);
+ }
+
+ if (pWin->firstChild)
+ {
+ anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild,
+ pWin->firstChild,
+ (WindowPtr *)NULL);
+ }
+ else
+ {
+ (*pScreen->MarkWindow) (pWin);
+ anyMarked = TRUE;
+ }
+
+#ifdef DO_SAVE_UNDERS
+ if (DO_SAVE_UNDERS(pWin))
+ {
+ dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin);
+ }
+#endif /* DO_SAVE_UNDERS */
+
+ if (anyMarked)
+ (*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
+ }
+
+ if (pWin->backStorage &&
+ ((pWin->backingStore == Always) || WasViewable))
+ {
+ if (!WasViewable)
+ pOldClip = &pWin->clipList; /* a convenient empty region */
+ bsExposed = (*pScreen->TranslateBackingStore)
+ (pWin, 0, 0, pOldClip,
+ pWin->drawable.x, pWin->drawable.y);
+ if (WasViewable)
+ REGION_DESTROY(pScreen, pOldClip);
+ if (bsExposed)
+ {
+ RegionPtr valExposed = NullRegion;
+
+ if (pWin->valdata)
+ valExposed = &pWin->valdata->after.exposed;
+ (*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
+ if (valExposed)
+ REGION_EMPTY(pScreen, valExposed);
+ REGION_DESTROY(pScreen, bsExposed);
+ }
+ }
+ if (WasViewable)
+ {
+ if (anyMarked)
+ (*pScreen->HandleExposures)(pWin);
+#ifdef DO_SAVE_UNDERS
+ if (dosave)
+ (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin);
+#endif /* DO_SAVE_UNDERS */
+ if (anyMarked && pScreen->PostValidateTree)
+ (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther);
+ }
+ if (pWin->realized)
+ WindowsRestructured ();
+ FlushAllOutput ();
+}
diff --git a/xorg-server/hw/xquartz/darwin.h b/xorg-server/hw/xquartz/darwin.h
new file mode 100644
index 000000000..c5e2ed80d
--- /dev/null
+++ b/xorg-server/hw/xquartz/darwin.h
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifndef _DARWIN_H
+#define _DARWIN_H
+
+#include <IOKit/IOTypes.h>
+#include "inputstr.h"
+#include "scrnintstr.h"
+#include <X11/extensions/XKB.h>
+#include <assert.h>
+
+typedef struct {
+ void *framebuffer;
+ int x;
+ int y;
+ int width;
+ int height;
+ int pitch;
+ int depth;
+ int visuals;
+ int bitsPerRGB;
+ int bitsPerPixel;
+ int preferredCVC;
+ Pixel redMask;
+ Pixel greenMask;
+ Pixel blueMask;
+} DarwinFramebufferRec, *DarwinFramebufferPtr;
+
+// From darwin.c
+void DarwinPrintBanner(void);
+int DarwinParseModifierList(const char *constmodifiers);
+void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo);
+void xf86SetRootClip (ScreenPtr pScreen, BOOL enable);
+
+#define SCREEN_PRIV(pScreen) ((DarwinFramebufferPtr) \
+ dixLookupPrivate(&pScreen->devPrivates, darwinScreenKey))
+
+/*
+ * Global variables from darwin.c
+ */
+extern DevPrivateKey darwinScreenKey; // index into pScreen.devPrivates
+extern int darwinScreensFound;
+extern io_connect_t darwinParamConnect;
+extern int darwinEventReadFD;
+extern int darwinEventWriteFD;
+extern DeviceIntPtr darwinPointer;
+extern DeviceIntPtr darwinKeyboard;
+
+// User preferences
+extern int darwinMouseAccelChange;
+extern int darwinFakeButtons;
+extern int darwinFakeMouse2Mask;
+extern int darwinFakeMouse3Mask;
+extern char *darwinKeymapFile;
+extern int darwinSyncKeymap;
+extern unsigned int darwinDesiredWidth, darwinDesiredHeight;
+extern int darwinDesiredDepth;
+extern int darwinDesiredRefresh;
+
+// location of X11's (0,0) point in global screen coordinates
+extern int darwinMainScreenX;
+extern int darwinMainScreenY;
+
+
+/*
+ * Special ddx events understood by the X server
+ */
+enum {
+ kXDarwinUpdateModifiers // update all modifier keys
+ = LASTEvent+1, // (from X.h list of event names)
+ kXDarwinUpdateButtons, // update state of mouse buttons 2 and up
+ kXDarwinScrollWheel, // scroll wheel event
+ /*
+ * Quartz-specific events -- not used in IOKit mode
+ */
+ kXDarwinActivate, // restore X drawing and cursor
+ kXDarwinDeactivate, // clip X drawing and switch to Aqua cursor
+ kXDarwinSetRootClip, // enable or disable drawing to the X screen
+ kXDarwinQuit, // kill the X server and release the display
+ kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer
+ kXDarwinWritePasteboard, // copy X cut buffer onto Mac OS X pasteboard
+ kXDarwinBringAllToFront, // bring all X windows to front
+ kXDarwinToggleFullscreen, // Enable/Disable fullscreen mode
+ kXDarwinSetRootless, // Set rootless mode
+ /*
+ * AppleWM events
+ */
+ kXDarwinControllerNotify, // send an AppleWMControllerNotify event
+ kXDarwinPasteboardNotify, // notify the WM to copy or paste
+ /*
+ * Xplugin notification events
+ */
+ kXDarwinDisplayChanged, // display configuration has changed
+ kXDarwinWindowState, // window visibility state has changed
+ kXDarwinWindowMoved // window has moved on screen
+};
+
+#define ENABLE_DEBUG_LOG 1
+
+#ifdef ENABLE_DEBUG_LOG
+extern FILE *debug_log_fp;
+#define DEBUG_LOG_NAME "x11-debug.txt"
+#define DEBUG_LOG(msg, args...) if (debug_log_fp) fprintf(debug_log_fp, "%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args ); fflush(debug_log_fp);
+#else
+#define DEBUG_LOG(msg, args...)
+#endif
+
+#endif /* _DARWIN_H */
diff --git a/xorg-server/hw/xquartz/darwinClut8.h b/xorg-server/hw/xquartz/darwinClut8.h
new file mode 100644
index 000000000..8e914f3fd
--- /dev/null
+++ b/xorg-server/hw/xquartz/darwinClut8.h
@@ -0,0 +1,531 @@
+/*
+ * Darwin default 8-bit Colormap for StaticColor
+ */
+
+#ifndef _DARWIN_CLUT8_
+#define _DARWIN_CLUT8_
+
+#ifdef USE_NEW_CLUT
+
+static xColorItem darwinClut8[] = {
+ { 0, 0xffff, 0xffff, 0xffff, 0, 0 },
+ { 1, 0xfefe, 0xfefe, 0xfefe, 0, 0 },
+ { 2, 0xfdfd, 0xfdfd, 0xfdfd, 0, 0 },
+ { 3, 0xb8b8, 0x2727, 0x2b2b, 0, 0 },
+ { 4, 0xfcfc, 0xfcfc, 0xfcfc, 0, 0 },
+ { 5, 0xffff, 0xffff, 0x0, 0, 0 },
+ { 6, 0xfafa, 0xfafa, 0xfafa, 0, 0 },
+ { 7, 0xf9f9, 0xf9f9, 0xf9f9, 0, 0 },
+ { 8, 0xf8f8, 0xf8f8, 0xf8f8, 0, 0 },
+ { 9, 0xf7f7, 0xf7f7, 0xf7f7, 0, 0 },
+ { 10, 0xf6f6, 0xf6f6, 0xf6f6, 0, 0 },
+ { 11, 0xf5f5, 0xf5f5, 0xf5f5, 0, 0 },
+ { 12, 0xf4f4, 0xf4f4, 0xf4f4, 0, 0 },
+ { 13, 0xf2f2, 0xf2f2, 0xf2f2, 0, 0 },
+ { 14, 0xf1f1, 0xf1f1, 0xf1f1, 0, 0 },
+ { 15, 0x0, 0x0, 0x0, 0, 0 },
+ { 16, 0xefef, 0xefef, 0xefef, 0, 0 },
+ { 17, 0xeeee, 0xeeee, 0xeeee, 0, 0 },
+ { 18, 0xeded, 0xeded, 0xeded, 0, 0 },
+ { 19, 0xebeb, 0xebeb, 0xebeb, 0, 0 },
+ { 20, 0xe8e8, 0xe8e8, 0xe8e8, 0, 0 },
+ { 21, 0xe7e7, 0xe7e7, 0xe7e7, 0, 0 },
+ { 22, 0xc9c9, 0x3838, 0x3e3e, 0, 0 },
+ { 23, 0xe5e5, 0xe5e5, 0xe5e5, 0, 0 },
+ { 24, 0xffff, 0x0, 0xffff, 0, 0 },
+ { 25, 0xfbfb, 0xfbfb, 0xfbfb, 0, 0 },
+ { 26, 0xdede, 0x6c6c, 0x7272, 0, 0 },
+ { 27, 0xe0e0, 0xe0e0, 0xe0e0, 0, 0 },
+ { 28, 0xe8e8, 0x8686, 0x9090, 0, 0 },
+ { 29, 0xdede, 0xdede, 0xdede, 0, 0 },
+ { 30, 0xdddd, 0xdddd, 0xdddd, 0, 0 },
+ { 31, 0xd3d3, 0x7e7e, 0x8d8d, 0, 0 },
+ { 32, 0xd9d9, 0xd9d9, 0xd9d9, 0, 0 },
+ { 33, 0xf3f3, 0x9696, 0xa6a6, 0, 0 },
+ { 34, 0xb1b1, 0x1c1c, 0x3939, 0, 0 },
+ { 35, 0xffff, 0x0, 0x0, 0, 0 },
+ { 36, 0xbebe, 0x5e5e, 0x7272, 0, 0 },
+ { 37, 0xd3d3, 0xd3d3, 0xd3d3, 0, 0 },
+ { 38, 0xc6c6, 0x2e2e, 0x6767, 0, 0 },
+ { 39, 0xd1d1, 0xd1d1, 0xd1d1, 0, 0 },
+ { 40, 0xa3a3, 0x606, 0x4545, 0, 0 },
+ { 41, 0xcece, 0xcece, 0xcece, 0, 0 },
+ { 42, 0xcccc, 0xcccc, 0xffff, 0, 0 },
+ { 43, 0xcccc, 0xcccc, 0xcccc, 0, 0 },
+ { 44, 0xc6c6, 0x8f8f, 0xa7a7, 0, 0 },
+ { 45, 0xe1e1, 0xd3d3, 0xd9d9, 0, 0 },
+ { 46, 0xcece, 0x9e9e, 0xb4b4, 0, 0 },
+ { 47, 0xcaca, 0xcaca, 0xcaca, 0, 0 },
+ { 48, 0xbfbf, 0x3f3f, 0x7d7d, 0, 0 },
+ { 49, 0xc9c9, 0xc9c9, 0xc9c9, 0, 0 },
+ { 50, 0xf4f4, 0x8989, 0xbebe, 0, 0 },
+ { 51, 0xc6c6, 0xc6c6, 0xc6c6, 0, 0 },
+ { 52, 0xd6d6, 0x5151, 0x9797, 0, 0 },
+ { 53, 0xc9c9, 0x2c2c, 0x8484, 0, 0 },
+ { 54, 0x9696, 0x1a1a, 0x6a6a, 0, 0 },
+ { 55, 0xc2c2, 0xc2c2, 0xc2c2, 0, 0 },
+ { 56, 0xf3f3, 0x6f6f, 0xc6c6, 0, 0 },
+ { 57, 0xe5e5, 0x4c4c, 0xbbbb, 0, 0 },
+ { 58, 0xb7b7, 0x5a5a, 0x9c9c, 0, 0 },
+ { 59, 0xbfbf, 0xbfbf, 0xbfbf, 0, 0 },
+ { 60, 0xbebe, 0xbebe, 0xbebe, 0, 0 },
+ { 61, 0xbdbd, 0xbdbd, 0xbdbd, 0, 0 },
+ { 62, 0xb8b8, 0x2121, 0xa2a2, 0, 0 },
+ { 63, 0xd3d3, 0x4444, 0xc0c0, 0, 0 },
+ { 64, 0xc2c2, 0x6666, 0xb7b7, 0, 0 },
+ { 65, 0xf4f4, 0x6666, 0xe6e6, 0, 0 },
+ { 66, 0xfcfc, 0x7373, 0xfdfd, 0, 0 },
+ { 67, 0xb9b9, 0xb9b9, 0xb9b9, 0, 0 },
+ { 68, 0xeaea, 0xdfdf, 0xeaea, 0, 0 },
+ { 69, 0xd4d4, 0x7171, 0xd5d5, 0, 0 },
+ { 70, 0xf9f9, 0x8b8b, 0xffff, 0, 0 },
+ { 71, 0xf5f5, 0xadad, 0xffff, 0, 0 },
+ { 72, 0xbcbc, 0x9292, 0xc2c2, 0, 0 },
+ { 73, 0xc7c7, 0x4f4f, 0xd9d9, 0, 0 },
+ { 74, 0xa0a0, 0x4444, 0xafaf, 0, 0 },
+ { 75, 0xc8c8, 0x8c8c, 0xd5d5, 0, 0 },
+ { 76, 0xd7d7, 0x7474, 0xf7f7, 0, 0 },
+ { 77, 0xb4b4, 0xb4b4, 0xb4b4, 0, 0 },
+ { 78, 0xdada, 0x9595, 0xf9f9, 0, 0 },
+ { 79, 0xeded, 0xcbcb, 0xffff, 0, 0 },
+ { 80, 0xb2b2, 0xb2b2, 0xb2b2, 0, 0 },
+ { 81, 0xa1a1, 0x6161, 0xd7d7, 0, 0 },
+ { 82, 0xb2b2, 0x8585, 0xe2e2, 0, 0 },
+ { 83, 0x5959, 0x2626, 0x9c9c, 0, 0 },
+ { 84, 0x7c7c, 0x5151, 0xcccc, 0, 0 },
+ { 85, 0xb0b0, 0xb0b0, 0xb0b0, 0, 0 },
+ { 86, 0xb4b4, 0x8e8e, 0xfcfc, 0, 0 },
+ { 87, 0xd5d5, 0xc0c0, 0xffff, 0, 0 },
+ { 88, 0x5d5d, 0x3232, 0xcccc, 0, 0 },
+ { 89, 0x7b7b, 0x5c5c, 0xe5e5, 0, 0 },
+ { 90, 0xc0c0, 0xb0b0, 0xfdfd, 0, 0 },
+ { 91, 0x6060, 0x5353, 0xadad, 0, 0 },
+ { 92, 0x1212, 0xc0c, 0x7e7e, 0, 0 },
+ { 93, 0x2e2e, 0x2929, 0x9999, 0, 0 },
+ { 94, 0x7979, 0x7878, 0xe9e9, 0, 0 },
+ { 95, 0x5b5b, 0x5c5c, 0xd0d0, 0, 0 },
+ { 96, 0x6969, 0x6a6a, 0xcccc, 0, 0 },
+ { 97, 0x9393, 0x9494, 0xf8f8, 0, 0 },
+ { 98, 0x9292, 0x9292, 0xc3c3, 0, 0 },
+ { 99, 0x4141, 0x4444, 0xbaba, 0, 0 },
+ { 100, 0xa8a8, 0xabab, 0xffff, 0, 0 },
+ { 101, 0xa3a3, 0xa3a3, 0xa3a3, 0, 0 },
+ { 102, 0xdbdb, 0xdddd, 0xeaea, 0, 0 },
+ { 103, 0x3131, 0x4949, 0xaaaa, 0, 0 },
+ { 104, 0x7070, 0x8f8f, 0xf9f9, 0, 0 },
+ { 105, 0x4848, 0x6666, 0xc1c1, 0, 0 },
+ { 106, 0x5c5c, 0x7e7e, 0xe9e9, 0, 0 },
+ { 107, 0xe2e2, 0xe5e5, 0xebeb, 0, 0 },
+ { 108, 0xb0b0, 0xcdcd, 0xffff, 0, 0 },
+ { 109, 0x6c6c, 0x8989, 0xb7b7, 0, 0 },
+ { 110, 0x3434, 0x6565, 0xafaf, 0, 0 },
+ { 111, 0x8c8c, 0xb9b9, 0xffff, 0, 0 },
+ { 112, 0x3737, 0x7979, 0xd4d4, 0, 0 },
+ { 113, 0x5a5a, 0x9999, 0xeaea, 0, 0 },
+ { 114, 0xe0e, 0x4c4c, 0x9595, 0, 0 },
+ { 115, 0x7979, 0xb9b9, 0xffff, 0, 0 },
+ { 116, 0x8a8a, 0xa3a3, 0xbcbc, 0, 0 },
+ { 117, 0x2020, 0x6161, 0x9d9d, 0, 0 },
+ { 118, 0x8f8f, 0xaeae, 0xcaca, 0, 0 },
+ { 119, 0xa0a, 0x6060, 0xa8a8, 0, 0 },
+ { 120, 0x3f3f, 0x9494, 0xd9d9, 0, 0 },
+ { 121, 0x6363, 0xb5b5, 0xf9f9, 0, 0 },
+ { 122, 0xe2e2, 0xe8e8, 0xeded, 0, 0 },
+ { 123, 0x2828, 0x6a6a, 0x9999, 0, 0 },
+ { 124, 0x5555, 0xb2b2, 0xe7e7, 0, 0 },
+ { 125, 0x3232, 0x8989, 0xa9a9, 0, 0 },
+ { 126, 0xcfcf, 0xdada, 0xdede, 0, 0 },
+ { 127, 0x2929, 0xa1a1, 0xc7c7, 0, 0 },
+ { 128, 0x8686, 0xa9a9, 0xb4b4, 0, 0 },
+ { 129, 0x0, 0x5f5f, 0x7979, 0, 0 },
+ { 130, 0xc0c, 0x7777, 0x8e8e, 0, 0 },
+ { 131, 0x1212, 0x8f8f, 0xabab, 0, 0 },
+ { 132, 0x4141, 0xbaba, 0xd5d5, 0, 0 },
+ { 133, 0x2424, 0x8282, 0x8383, 0, 0 },
+ { 134, 0x2c2c, 0xc4c4, 0xc3c3, 0, 0 },
+ { 135, 0x1a1a, 0xabab, 0xa6a6, 0, 0 },
+ { 136, 0x4b4b, 0xa8a8, 0xa2a2, 0, 0 },
+ { 137, 0xa0a, 0x9393, 0x8585, 0, 0 },
+ { 138, 0xd0d, 0xa5a5, 0x9696, 0, 0 },
+ { 139, 0x2626, 0xbcbc, 0xacac, 0, 0 },
+ { 140, 0x404, 0x8181, 0x7272, 0, 0 },
+ { 141, 0x1919, 0xb3b3, 0x8686, 0, 0 },
+ { 142, 0x2929, 0xc1c1, 0x9494, 0, 0 },
+ { 143, 0x2121, 0x9c9c, 0x7171, 0, 0 },
+ { 144, 0x202, 0x8c8c, 0x5050, 0, 0 },
+ { 145, 0x3535, 0xd0d0, 0x8989, 0, 0 },
+ { 146, 0x4646, 0xa5a5, 0x7676, 0, 0 },
+ { 147, 0x202, 0x7d7d, 0x3939, 0, 0 },
+ { 148, 0x2929, 0xc9c9, 0x7171, 0, 0 },
+ { 149, 0x5757, 0xd6d6, 0x8f8f, 0, 0 },
+ { 150, 0xa2a2, 0xb5b5, 0xaaaa, 0, 0 },
+ { 151, 0x101, 0x8888, 0x2a2a, 0, 0 },
+ { 152, 0x7474, 0xbebe, 0x8a8a, 0, 0 },
+ { 153, 0x1919, 0xb6b6, 0x4747, 0, 0 },
+ { 154, 0x2d2d, 0xc6c6, 0x5151, 0, 0 },
+ { 155, 0x3838, 0xdede, 0x5d5d, 0, 0 },
+ { 156, 0x4c4c, 0xf4f4, 0x6f6f, 0, 0 },
+ { 157, 0x9191, 0x9c9c, 0x9393, 0, 0 },
+ { 158, 0x0, 0x8e8e, 0x1919, 0, 0 },
+ { 159, 0x1010, 0xafaf, 0x2828, 0, 0 },
+ { 160, 0xe3e3, 0xe3e3, 0xe3e3, 0, 0 },
+ { 161, 0x808, 0xa1a1, 0x1a1a, 0, 0 },
+ { 162, 0x5959, 0xc2c2, 0x6161, 0, 0 },
+ { 163, 0xf0f0, 0xf0f0, 0xf0f0, 0, 0 },
+ { 164, 0x8f8f, 0x9c9c, 0x9090, 0, 0 },
+ { 165, 0x2323, 0xcece, 0x2a2a, 0, 0 },
+ { 166, 0x1212, 0xbaba, 0x1717, 0, 0 },
+ { 167, 0x101, 0x8a8a, 0x202, 0, 0 },
+ { 168, 0x303, 0x9a9a, 0x202, 0, 0 },
+ { 169, 0x4040, 0xe4e4, 0x4040, 0, 0 },
+ { 170, 0x808, 0xb2b2, 0x505, 0, 0 },
+ { 171, 0x1313, 0xcccc, 0xf0f, 0, 0 },
+ { 172, 0x3636, 0xd7d7, 0x3232, 0, 0 },
+ { 173, 0x2828, 0xe9e9, 0x1f1f, 0, 0 },
+ { 174, 0x5353, 0xfbfb, 0x4c4c, 0, 0 },
+ { 175, 0x6f6f, 0xafaf, 0x6a6a, 0, 0 },
+ { 176, 0x7171, 0xe0e0, 0x6767, 0, 0 },
+ { 177, 0x3232, 0xc0c0, 0x1212, 0, 0 },
+ { 178, 0x2929, 0xa5a5, 0x808, 0, 0 },
+ { 179, 0x5c5c, 0xdddd, 0x3535, 0, 0 },
+ { 180, 0x0, 0xffff, 0xffff, 0, 0 },
+ { 181, 0x6363, 0xc8c8, 0x4545, 0, 0 },
+ { 182, 0x8686, 0xfdfd, 0x5b5b, 0, 0 },
+ { 183, 0x7171, 0xf6f6, 0x3939, 0, 0 },
+ { 184, 0x5555, 0xcccc, 0x1515, 0, 0 },
+ { 185, 0x0, 0xffff, 0x0, 0, 0 },
+ { 186, 0x9090, 0xcaca, 0x6e6e, 0, 0 },
+ { 187, 0x4343, 0xa7a7, 0x101, 0, 0 },
+ { 188, 0x8d8d, 0xe4e4, 0x3737, 0, 0 },
+ { 189, 0xb3b3, 0xf0f0, 0x6464, 0, 0 },
+ { 190, 0x8585, 0x8e8e, 0x7a7a, 0, 0 },
+ { 191, 0xb0b0, 0xfafa, 0x4d4d, 0, 0 },
+ { 192, 0xd6d6, 0xd6d6, 0xd6d6, 0, 0 },
+ { 193, 0x8888, 0xd0d0, 0x1a1a, 0, 0 },
+ { 194, 0x6a6a, 0xa7a7, 0x303, 0, 0 },
+ { 195, 0x9898, 0xbfbf, 0x4141, 0, 0 },
+ { 196, 0xcdcd, 0xf8f8, 0x5151, 0, 0 },
+ { 197, 0x9494, 0xa4a4, 0x5555, 0, 0 },
+ { 198, 0x9191, 0xb0b0, 0xa0a, 0, 0 },
+ { 199, 0xdada, 0xf1f1, 0x3c3c, 0, 0 },
+ { 200, 0xbaba, 0xcaca, 0x5353, 0, 0 },
+ { 201, 0xb9b9, 0xc3c3, 0x2828, 0, 0 },
+ { 202, 0xb1b1, 0xbaba, 0x1212, 0, 0 },
+ { 203, 0xd2d2, 0xd9d9, 0x2626, 0, 0 },
+ { 204, 0xe8e8, 0xecec, 0x2d2d, 0, 0 },
+ { 205, 0x9898, 0x9696, 0x202, 0, 0 },
+ { 206, 0xadad, 0xadad, 0x5c5c, 0, 0 },
+ { 207, 0xe2e2, 0xd8d8, 0x3838, 0, 0 },
+ { 208, 0xd9d9, 0xc4c4, 0x3838, 0, 0 },
+ { 209, 0xa8a8, 0x9a9a, 0x5050, 0, 0 },
+ { 210, 0x0, 0x0, 0xffff, 0, 0 },
+ { 211, 0xbebe, 0xaeae, 0x5e5e, 0, 0 },
+ { 212, 0x9a9a, 0x9898, 0x8e8e, 0, 0 },
+ { 213, 0xacac, 0x8d8d, 0xd0d, 0, 0 },
+ { 214, 0xc5c5, 0xa0a0, 0x2b2b, 0, 0 },
+ { 215, 0xdbdb, 0xb5b5, 0x4848, 0, 0 },
+ { 216, 0xdddd, 0x0, 0x0, 0, 0 },
+ { 217, 0x9c9c, 0x6d6d, 0x303, 0, 0 },
+ { 218, 0xd4d4, 0xa8a8, 0x4747, 0, 0 },
+ { 219, 0xb7b7, 0x7171, 0x1717, 0, 0 },
+ { 220, 0xdcdc, 0xa1a1, 0x5a5a, 0, 0 },
+ { 221, 0xb9b9, 0x9c9c, 0x7c7c, 0, 0 },
+ { 222, 0xb4b4, 0xabab, 0xa2a2, 0, 0 },
+ { 223, 0x9e9e, 0x4b4b, 0x101, 0, 0 },
+ { 224, 0xc8c8, 0x7878, 0x3535, 0, 0 },
+ { 225, 0xd2d2, 0x8d8d, 0x5151, 0, 0 },
+ { 226, 0xadad, 0x5252, 0xf0f, 0, 0 },
+ { 227, 0x0, 0xbbbb, 0x0, 0, 0 },
+ { 228, 0xb2b2, 0x6666, 0x3838, 0, 0 },
+ { 229, 0xb1b1, 0xa6a6, 0x9f9f, 0, 0 },
+ { 230, 0xb1b1, 0x8787, 0x6f6f, 0, 0 },
+ { 231, 0xa4a4, 0x3434, 0x303, 0, 0 },
+ { 232, 0xeeee, 0x9e9e, 0x8585, 0, 0 },
+ { 233, 0xc9c9, 0x7373, 0x5a5a, 0, 0 },
+ { 234, 0xe6e6, 0x9494, 0x7c7c, 0, 0 },
+ { 235, 0xa9a9, 0x2222, 0x606, 0, 0 },
+ { 236, 0xdbdb, 0x8787, 0x7474, 0, 0 },
+ { 237, 0xb0b0, 0x2e2e, 0x1515, 0, 0 },
+ { 238, 0xb7b7, 0x5a5a, 0x5050, 0, 0 },
+ { 239, 0xb2b2, 0x4242, 0x3b3b, 0, 0 },
+ { 240, 0xcdcd, 0x7373, 0x6e6e, 0, 0 },
+ { 241, 0xd9d9, 0x5858, 0x5858, 0, 0 },
+ { 242, 0xacac, 0xacac, 0xacac, 0, 0 },
+ { 243, 0xa0a0, 0xa0a0, 0xa0a0, 0, 0 },
+ { 244, 0x9a9a, 0x9a9a, 0x9a9a, 0, 0 },
+ { 245, 0x9292, 0x9292, 0x9292, 0, 0 },
+ { 246, 0x8e8e, 0x8e8e, 0x8e8e, 0, 0 },
+ { 247, 0xbbbb, 0xbbbb, 0xbbbb, 0, 0 },
+ { 248, 0x8181, 0x8181, 0x8181, 0, 0 },
+ { 249, 0x8888, 0x8888, 0x8888, 0, 0 },
+ { 250, 0x7777, 0x7777, 0x7777, 0, 0 },
+ { 251, 0x5555, 0x5555, 0x5555, 0, 0 },
+ { 252, 0x4444, 0x4444, 0x4444, 0, 0 },
+ { 253, 0x2222, 0x2222, 0x2222, 0, 0 },
+ { 254, 0x7b7b, 0x7b7b, 0x7b7b, 0, 0 },
+ { 255, 0x0, 0x0, 0x0, 0, 0 },
+};
+
+#else /* !USE_NEW_CLUT */
+
+static xColorItem darwinClut8[] = {
+ { 0, 0x0000, 0x0000, 0x0000, 0, 0 },
+ { 1, 0xffff, 0xffff, 0xcccc, 0, 0 },
+ { 2, 0xffff, 0xffff, 0x9999, 0, 0 },
+ { 3, 0xffff, 0xffff, 0x6666, 0, 0 },
+ { 4, 0xffff, 0xffff, 0x3333, 0, 0 },
+ { 5, 0xffff, 0xffff, 0x0000, 0, 0 },
+ { 6, 0xffff, 0xcccc, 0xffff, 0, 0 },
+ { 7, 0xffff, 0xcccc, 0xcccc, 0, 0 },
+ { 8, 0xffff, 0xcccc, 0x9999, 0, 0 },
+ { 9, 0xffff, 0xcccc, 0x6666, 0, 0 },
+ { 10, 0xffff, 0xcccc, 0x3333, 0, 0 },
+ { 11, 0xffff, 0xcccc, 0x0000, 0, 0 },
+ { 12, 0xffff, 0x9999, 0xffff, 0, 0 },
+ { 13, 0xffff, 0x9999, 0xcccc, 0, 0 },
+ { 14, 0xffff, 0x9999, 0x9999, 0, 0 },
+ { 15, 0xffff, 0x9999, 0x6666, 0, 0 },
+ { 16, 0xffff, 0x9999, 0x3333, 0, 0 },
+ { 17, 0xffff, 0x9999, 0x0000, 0, 0 },
+ { 18, 0xffff, 0x6666, 0xffff, 0, 0 },
+ { 19, 0xffff, 0x6666, 0xcccc, 0, 0 },
+ { 20, 0xffff, 0x6666, 0x9999, 0, 0 },
+ { 21, 0xffff, 0x6666, 0x6666, 0, 0 },
+ { 22, 0xffff, 0x6666, 0x3333, 0, 0 },
+ { 23, 0xffff, 0x6666, 0x0000, 0, 0 },
+ { 24, 0xffff, 0x3333, 0xffff, 0, 0 },
+ { 25, 0xffff, 0x3333, 0xcccc, 0, 0 },
+ { 26, 0xffff, 0x3333, 0x9999, 0, 0 },
+ { 27, 0xffff, 0x3333, 0x6666, 0, 0 },
+ { 28, 0xffff, 0x3333, 0x3333, 0, 0 },
+ { 29, 0xffff, 0x3333, 0x0000, 0, 0 },
+ { 30, 0xffff, 0x0000, 0xffff, 0, 0 },
+ { 31, 0xffff, 0x0000, 0xcccc, 0, 0 },
+ { 32, 0xffff, 0x0000, 0x9999, 0, 0 },
+ { 33, 0xffff, 0x0000, 0x6666, 0, 0 },
+ { 34, 0xffff, 0x0000, 0x3333, 0, 0 },
+ { 35, 0xffff, 0x0000, 0x0000, 0, 0 },
+ { 36, 0xcccc, 0xffff, 0xffff, 0, 0 },
+ { 37, 0xcccc, 0xffff, 0xcccc, 0, 0 },
+ { 38, 0xcccc, 0xffff, 0x9999, 0, 0 },
+ { 39, 0xcccc, 0xffff, 0x6666, 0, 0 },
+ { 40, 0xcccc, 0xffff, 0x3333, 0, 0 },
+ { 41, 0xcccc, 0xffff, 0x0000, 0, 0 },
+ { 42, 0xcccc, 0xcccc, 0xffff, 0, 0 },
+ { 43, 0xcccc, 0xcccc, 0xcccc, 0, 0 },
+ { 44, 0xcccc, 0xcccc, 0x9999, 0, 0 },
+ { 45, 0xcccc, 0xcccc, 0x6666, 0, 0 },
+ { 46, 0xcccc, 0xcccc, 0x3333, 0, 0 },
+ { 47, 0xcccc, 0xcccc, 0x0000, 0, 0 },
+ { 48, 0xcccc, 0x9999, 0xffff, 0, 0 },
+ { 49, 0xcccc, 0x9999, 0xcccc, 0, 0 },
+ { 50, 0xcccc, 0x9999, 0x9999, 0, 0 },
+ { 51, 0xcccc, 0x9999, 0x6666, 0, 0 },
+ { 52, 0xcccc, 0x9999, 0x3333, 0, 0 },
+ { 53, 0xcccc, 0x9999, 0x0000, 0, 0 },
+ { 54, 0xcccc, 0x6666, 0xffff, 0, 0 },
+ { 55, 0xcccc, 0x6666, 0xcccc, 0, 0 },
+ { 56, 0xcccc, 0x6666, 0x9999, 0, 0 },
+ { 57, 0xcccc, 0x6666, 0x6666, 0, 0 },
+ { 58, 0xcccc, 0x6666, 0x3333, 0, 0 },
+ { 59, 0xcccc, 0x6666, 0x0000, 0, 0 },
+ { 60, 0xcccc, 0x3333, 0xffff, 0, 0 },
+ { 61, 0xcccc, 0x3333, 0xcccc, 0, 0 },
+ { 62, 0xcccc, 0x3333, 0x9999, 0, 0 },
+ { 63, 0xcccc, 0x3333, 0x6666, 0, 0 },
+ { 64, 0xcccc, 0x3333, 0x3333, 0, 0 },
+ { 65, 0xcccc, 0x3333, 0x0000, 0, 0 },
+ { 66, 0xcccc, 0x0000, 0xffff, 0, 0 },
+ { 67, 0xcccc, 0x0000, 0xcccc, 0, 0 },
+ { 68, 0xcccc, 0x0000, 0x9999, 0, 0 },
+ { 69, 0xcccc, 0x0000, 0x6666, 0, 0 },
+ { 70, 0xcccc, 0x0000, 0x3333, 0, 0 },
+ { 71, 0xcccc, 0x0000, 0x0000, 0, 0 },
+ { 72, 0x9999, 0xffff, 0xffff, 0, 0 },
+ { 73, 0x9999, 0xffff, 0xcccc, 0, 0 },
+ { 74, 0x9999, 0xffff, 0x9999, 0, 0 },
+ { 75, 0x9999, 0xffff, 0x6666, 0, 0 },
+ { 76, 0x9999, 0xffff, 0x3333, 0, 0 },
+ { 77, 0x9999, 0xffff, 0x0000, 0, 0 },
+ { 78, 0x9999, 0xcccc, 0xffff, 0, 0 },
+ { 79, 0x9999, 0xcccc, 0xcccc, 0, 0 },
+ { 80, 0x9999, 0xcccc, 0x9999, 0, 0 },
+ { 81, 0x9999, 0xcccc, 0x6666, 0, 0 },
+ { 82, 0x9999, 0xcccc, 0x3333, 0, 0 },
+ { 83, 0x9999, 0xcccc, 0x0000, 0, 0 },
+ { 84, 0x9999, 0x9999, 0xffff, 0, 0 },
+ { 85, 0x9999, 0x9999, 0xcccc, 0, 0 },
+ { 86, 0x9999, 0x9999, 0x9999, 0, 0 },
+ { 87, 0x9999, 0x9999, 0x6666, 0, 0 },
+ { 88, 0x9999, 0x9999, 0x3333, 0, 0 },
+ { 89, 0x9999, 0x9999, 0x0000, 0, 0 },
+ { 90, 0x9999, 0x6666, 0xffff, 0, 0 },
+ { 91, 0x9999, 0x6666, 0xcccc, 0, 0 },
+ { 92, 0x9999, 0x6666, 0x9999, 0, 0 },
+ { 93, 0x9999, 0x6666, 0x6666, 0, 0 },
+ { 94, 0x9999, 0x6666, 0x3333, 0, 0 },
+ { 95, 0x9999, 0x6666, 0x0000, 0, 0 },
+ { 96, 0x9999, 0x3333, 0xffff, 0, 0 },
+ { 97, 0x9999, 0x3333, 0xcccc, 0, 0 },
+ { 98, 0x9999, 0x3333, 0x9999, 0, 0 },
+ { 99, 0x9999, 0x3333, 0x6666, 0, 0 },
+ { 100, 0x9999, 0x3333, 0x3333, 0, 0 },
+ { 101, 0x9999, 0x3333, 0x0000, 0, 0 },
+ { 102, 0x9999, 0x0000, 0xffff, 0, 0 },
+ { 103, 0x9999, 0x0000, 0xcccc, 0, 0 },
+ { 104, 0x9999, 0x0000, 0x9999, 0, 0 },
+ { 105, 0x9999, 0x0000, 0x6666, 0, 0 },
+ { 106, 0x9999, 0x0000, 0x3333, 0, 0 },
+ { 107, 0x9999, 0x0000, 0x0000, 0, 0 },
+ { 108, 0x6666, 0xffff, 0xffff, 0, 0 },
+ { 109, 0x6666, 0xffff, 0xcccc, 0, 0 },
+ { 110, 0x6666, 0xffff, 0x9999, 0, 0 },
+ { 111, 0x6666, 0xffff, 0x6666, 0, 0 },
+ { 112, 0x6666, 0xffff, 0x3333, 0, 0 },
+ { 113, 0x6666, 0xffff, 0x0000, 0, 0 },
+ { 114, 0x6666, 0xcccc, 0xffff, 0, 0 },
+ { 115, 0x6666, 0xcccc, 0xcccc, 0, 0 },
+ { 116, 0x6666, 0xcccc, 0x9999, 0, 0 },
+ { 117, 0x6666, 0xcccc, 0x6666, 0, 0 },
+ { 118, 0x6666, 0xcccc, 0x3333, 0, 0 },
+ { 119, 0x6666, 0xcccc, 0x0000, 0, 0 },
+ { 120, 0x6666, 0x9999, 0xffff, 0, 0 },
+ { 121, 0x6666, 0x9999, 0xcccc, 0, 0 },
+ { 122, 0x6666, 0x9999, 0x9999, 0, 0 },
+ { 123, 0x6666, 0x9999, 0x6666, 0, 0 },
+ { 124, 0x6666, 0x9999, 0x3333, 0, 0 },
+ { 125, 0x6666, 0x9999, 0x0000, 0, 0 },
+ { 126, 0x6666, 0x6666, 0xffff, 0, 0 },
+ { 127, 0x6666, 0x6666, 0xcccc, 0, 0 },
+ { 128, 0x6666, 0x6666, 0x9999, 0, 0 },
+ { 129, 0x6666, 0x6666, 0x6666, 0, 0 },
+ { 130, 0x6666, 0x6666, 0x3333, 0, 0 },
+ { 131, 0x6666, 0x6666, 0x0000, 0, 0 },
+ { 132, 0x6666, 0x3333, 0xffff, 0, 0 },
+ { 133, 0x6666, 0x3333, 0xcccc, 0, 0 },
+ { 134, 0x6666, 0x3333, 0x9999, 0, 0 },
+ { 135, 0x6666, 0x3333, 0x6666, 0, 0 },
+ { 136, 0x6666, 0x3333, 0x3333, 0, 0 },
+ { 137, 0x6666, 0x3333, 0x0000, 0, 0 },
+ { 138, 0x6666, 0x0000, 0xffff, 0, 0 },
+ { 139, 0x6666, 0x0000, 0xcccc, 0, 0 },
+ { 140, 0x6666, 0x0000, 0x9999, 0, 0 },
+ { 141, 0x6666, 0x0000, 0x6666, 0, 0 },
+ { 142, 0x6666, 0x0000, 0x3333, 0, 0 },
+ { 143, 0x6666, 0x0000, 0x0000, 0, 0 },
+ { 144, 0x3333, 0xffff, 0xffff, 0, 0 },
+ { 145, 0x3333, 0xffff, 0xcccc, 0, 0 },
+ { 146, 0x3333, 0xffff, 0x9999, 0, 0 },
+ { 147, 0x3333, 0xffff, 0x6666, 0, 0 },
+ { 148, 0x3333, 0xffff, 0x3333, 0, 0 },
+ { 149, 0x3333, 0xffff, 0x0000, 0, 0 },
+ { 150, 0x3333, 0xcccc, 0xffff, 0, 0 },
+ { 151, 0x3333, 0xcccc, 0xcccc, 0, 0 },
+ { 152, 0x3333, 0xcccc, 0x9999, 0, 0 },
+ { 153, 0x3333, 0xcccc, 0x6666, 0, 0 },
+ { 154, 0x3333, 0xcccc, 0x3333, 0, 0 },
+ { 155, 0x3333, 0xcccc, 0x0000, 0, 0 },
+ { 156, 0x3333, 0x9999, 0xffff, 0, 0 },
+ { 157, 0x3333, 0x9999, 0xcccc, 0, 0 },
+ { 158, 0x3333, 0x9999, 0x9999, 0, 0 },
+ { 159, 0x3333, 0x9999, 0x6666, 0, 0 },
+ { 160, 0x3333, 0x9999, 0x3333, 0, 0 },
+ { 161, 0x3333, 0x9999, 0x0000, 0, 0 },
+ { 162, 0x3333, 0x6666, 0xffff, 0, 0 },
+ { 163, 0x3333, 0x6666, 0xcccc, 0, 0 },
+ { 164, 0x3333, 0x6666, 0x9999, 0, 0 },
+ { 165, 0x3333, 0x6666, 0x6666, 0, 0 },
+ { 166, 0x3333, 0x6666, 0x3333, 0, 0 },
+ { 167, 0x3333, 0x6666, 0x0000, 0, 0 },
+ { 168, 0x3333, 0x3333, 0xffff, 0, 0 },
+ { 169, 0x3333, 0x3333, 0xcccc, 0, 0 },
+ { 170, 0x3333, 0x3333, 0x9999, 0, 0 },
+ { 171, 0x3333, 0x3333, 0x6666, 0, 0 },
+ { 172, 0x3333, 0x3333, 0x3333, 0, 0 },
+ { 173, 0x3333, 0x3333, 0x0000, 0, 0 },
+ { 174, 0x3333, 0x0000, 0xffff, 0, 0 },
+ { 175, 0x3333, 0x0000, 0xcccc, 0, 0 },
+ { 176, 0x3333, 0x0000, 0x9999, 0, 0 },
+ { 177, 0x3333, 0x0000, 0x6666, 0, 0 },
+ { 178, 0x3333, 0x0000, 0x3333, 0, 0 },
+ { 179, 0x3333, 0x0000, 0x0000, 0, 0 },
+ { 180, 0x0000, 0xffff, 0xffff, 0, 0 },
+ { 181, 0x0000, 0xffff, 0xcccc, 0, 0 },
+ { 182, 0x0000, 0xffff, 0x9999, 0, 0 },
+ { 183, 0x0000, 0xffff, 0x6666, 0, 0 },
+ { 184, 0x0000, 0xffff, 0x3333, 0, 0 },
+ { 185, 0x0000, 0xffff, 0x0000, 0, 0 },
+ { 186, 0x0000, 0xcccc, 0xffff, 0, 0 },
+ { 187, 0x0000, 0xcccc, 0xcccc, 0, 0 },
+ { 188, 0x0000, 0xcccc, 0x9999, 0, 0 },
+ { 189, 0x0000, 0xcccc, 0x6666, 0, 0 },
+ { 190, 0x0000, 0xcccc, 0x3333, 0, 0 },
+ { 191, 0x0000, 0xcccc, 0x0000, 0, 0 },
+ { 192, 0x0000, 0x9999, 0xffff, 0, 0 },
+ { 193, 0x0000, 0x9999, 0xcccc, 0, 0 },
+ { 194, 0x0000, 0x9999, 0x9999, 0, 0 },
+ { 195, 0x0000, 0x9999, 0x6666, 0, 0 },
+ { 196, 0x0000, 0x9999, 0x3333, 0, 0 },
+ { 197, 0x0000, 0x9999, 0x0000, 0, 0 },
+ { 198, 0x0000, 0x6666, 0xffff, 0, 0 },
+ { 199, 0x0000, 0x6666, 0xcccc, 0, 0 },
+ { 200, 0x0000, 0x6666, 0x9999, 0, 0 },
+ { 201, 0x0000, 0x6666, 0x6666, 0, 0 },
+ { 202, 0x0000, 0x6666, 0x3333, 0, 0 },
+ { 203, 0x0000, 0x6666, 0x0000, 0, 0 },
+ { 204, 0x0000, 0x3333, 0xffff, 0, 0 },
+ { 205, 0x0000, 0x3333, 0xcccc, 0, 0 },
+ { 206, 0x0000, 0x3333, 0x9999, 0, 0 },
+ { 207, 0x0000, 0x3333, 0x6666, 0, 0 },
+ { 208, 0x0000, 0x3333, 0x3333, 0, 0 },
+ { 209, 0x0000, 0x3333, 0x0000, 0, 0 },
+ { 210, 0x0000, 0x0000, 0xffff, 0, 0 },
+ { 211, 0x0000, 0x0000, 0xcccc, 0, 0 },
+ { 212, 0x0000, 0x0000, 0x9999, 0, 0 },
+ { 213, 0x0000, 0x0000, 0x6666, 0, 0 },
+ { 214, 0x0000, 0x0000, 0x3333, 0, 0 },
+ { 215, 0xeeee, 0x0000, 0x0000, 0, 0 },
+ { 216, 0xdddd, 0x0000, 0x0000, 0, 0 },
+ { 217, 0xbbbb, 0x0000, 0x0000, 0, 0 },
+ { 218, 0xaaaa, 0x0000, 0x0000, 0, 0 },
+ { 219, 0x8888, 0x0000, 0x0000, 0, 0 },
+ { 220, 0x7777, 0x0000, 0x0000, 0, 0 },
+ { 221, 0x5555, 0x0000, 0x0000, 0, 0 },
+ { 222, 0x4444, 0x0000, 0x0000, 0, 0 },
+ { 223, 0x2222, 0x0000, 0x0000, 0, 0 },
+ { 224, 0x1111, 0x0000, 0x0000, 0, 0 },
+ { 225, 0x0000, 0xeeee, 0x0000, 0, 0 },
+ { 226, 0x0000, 0xdddd, 0x0000, 0, 0 },
+ { 227, 0x0000, 0xbbbb, 0x0000, 0, 0 },
+ { 228, 0x0000, 0xaaaa, 0x0000, 0, 0 },
+ { 229, 0x0000, 0x8888, 0x0000, 0, 0 },
+ { 230, 0x0000, 0x7777, 0x0000, 0, 0 },
+ { 231, 0x0000, 0x5555, 0x0000, 0, 0 },
+ { 232, 0x0000, 0x4444, 0x0000, 0, 0 },
+ { 233, 0x0000, 0x2222, 0x0000, 0, 0 },
+ { 234, 0x0000, 0x1111, 0x0000, 0, 0 },
+ { 235, 0x0000, 0x0000, 0xeeee, 0, 0 },
+ { 236, 0x0000, 0x0000, 0xdddd, 0, 0 },
+ { 237, 0x0000, 0x0000, 0xbbbb, 0, 0 },
+ { 238, 0x0000, 0x0000, 0xaaaa, 0, 0 },
+ { 239, 0x0000, 0x0000, 0x8888, 0, 0 },
+ { 240, 0x0000, 0x0000, 0x7777, 0, 0 },
+ { 241, 0x0000, 0x0000, 0x5555, 0, 0 },
+ { 242, 0x0000, 0x0000, 0x4444, 0, 0 },
+ { 243, 0x0000, 0x0000, 0x2222, 0, 0 },
+ { 244, 0x0000, 0x0000, 0x1111, 0, 0 },
+ { 245, 0xeeee, 0xeeee, 0xeeee, 0, 0 },
+ { 246, 0xdddd, 0xdddd, 0xdddd, 0, 0 },
+ { 247, 0xbbbb, 0xbbbb, 0xbbbb, 0, 0 },
+ { 248, 0xaaaa, 0xaaaa, 0xaaaa, 0, 0 },
+ { 249, 0x8888, 0x8888, 0x8888, 0, 0 },
+ { 250, 0x7777, 0x7777, 0x7777, 0, 0 },
+ { 251, 0x5555, 0x5555, 0x5555, 0, 0 },
+ { 252, 0x4444, 0x4444, 0x4444, 0, 0 },
+ { 253, 0x2222, 0x2222, 0x2222, 0, 0 },
+ { 254, 0x1111, 0x1111, 0x1111, 0, 0 },
+ { 255, 0xffff, 0xffff, 0xffff, 0, 0 }
+};
+#endif /* USE_NEW_CLUT */
+
+#endif /* _DARWIN_CLUT8_ */
diff --git a/xorg-server/hw/xquartz/darwinEvents.c b/xorg-server/hw/xquartz/darwinEvents.c
new file mode 100644
index 000000000..827fd81b8
--- /dev/null
+++ b/xorg-server/hw/xquartz/darwinEvents.c
@@ -0,0 +1,461 @@
+/*
+Darwin event queue and event handling
+
+Copyright 2007 Apple Inc.
+Copyright 2004 Kaleb S. KEITHLEY. All Rights Reserved.
+Copyright (c) 2002-2004 Torrey T. Lyons. All Rights Reserved.
+
+This file is based on mieq.c by Keith Packard,
+which contains the following copyright:
+Copyright 1990, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ */
+
+#define NEED_EVENTS
+#include <X11/X.h>
+#include <X11/Xmd.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "inputstr.h"
+#include "mi.h"
+#include "scrnintstr.h"
+#include "mipointer.h"
+
+#include "darwin.h"
+#include "quartz.h"
+#include "darwinKeyboard.h"
+#include "darwinEvents.h"
+
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <unistd.h>
+#include <IOKit/hidsystem/IOLLEvent.h>
+
+/* Fake button press/release for scroll wheel move. */
+#define SCROLLWHEELUPFAKE 4
+#define SCROLLWHEELDOWNFAKE 5
+
+#define QUEUE_SIZE 256
+
+typedef struct _Event {
+ xEvent event;
+ ScreenPtr pScreen;
+} EventRec, *EventPtr;
+
+int input_check_zero, input_check_flag;
+
+static int old_flags = 0; // last known modifier state
+
+typedef struct _EventQueue {
+ HWEventQueueType head, tail; /* long for SetInputCheck */
+ CARD32 lastEventTime; /* to avoid time running backwards */
+ Bool lastMotion;
+ EventRec events[QUEUE_SIZE]; /* static allocation for signals */
+ DevicePtr pKbd, pPtr; /* device pointer, to get funcs */
+ ScreenPtr pEnqueueScreen; /* screen events are being delivered to */
+ ScreenPtr pDequeueScreen; /* screen events are being dispatched to */
+} EventQueueRec, *EventQueuePtr;
+
+static EventQueueRec darwinEventQueue;
+xEvent *darwinEvents;
+
+/*
+ * DarwinPressModifierMask
+ * Press or release the given modifier key, specified by its mask.
+ */
+static void DarwinPressModifierMask(
+ int pressed,
+ int mask) // one of NX_*MASK constants
+{
+ int key = DarwinModifierNXMaskToNXKey(mask);
+
+ if (key != -1) {
+ int keycode = DarwinModifierNXKeyToNXKeycode(key, 0);
+ if (keycode != 0)
+ DarwinSendKeyboardEvents(pressed, keycode);
+ }
+}
+
+#ifdef NX_DEVICELCTLKEYMASK
+#define CONTROL_MASK(flags) (flags & (NX_DEVICELCTLKEYMASK|NX_DEVICERCTLKEYMASK))
+#else
+#define CONTROL_MASK(flags) (NX_CONTROLMASK)
+#endif /* NX_DEVICELCTLKEYMASK */
+
+#ifdef NX_DEVICELSHIFTKEYMASK
+#define SHIFT_MASK(flags) (flags & (NX_DEVICELSHIFTKEYMASK|NX_DEVICERSHIFTKEYMASK))
+#else
+#define SHIFT_MASK(flags) (NX_SHIFTMASK)
+#endif /* NX_DEVICELSHIFTKEYMASK */
+
+#ifdef NX_DEVICELCMDKEYMASK
+#define COMMAND_MASK(flags) (flags & (NX_DEVICELCMDKEYMASK|NX_DEVICERCMDKEYMASK))
+#else
+#define COMMAND_MASK(flags) (NX_COMMANDMASK)
+#endif /* NX_DEVICELCMDKEYMASK */
+
+#ifdef NX_DEVICELALTKEYMASK
+#define ALTERNATE_MASK(flags) (flags & (NX_DEVICELALTKEYMASK|NX_DEVICERALTKEYMASK))
+#else
+#define ALTERNATE_MASK(flags) (NX_ALTERNATEMASK)
+#endif /* NX_DEVICELALTKEYMASK */
+
+/*
+ * DarwinUpdateModifiers
+ * Send events to update the modifier state.
+ */
+static void DarwinUpdateModifiers(
+ int pressed, // KeyPress or KeyRelease
+ int flags ) // modifier flags that have changed
+{
+ if (flags & NX_ALPHASHIFTMASK) {
+ DarwinPressModifierMask(pressed, NX_ALPHASHIFTMASK);
+ }
+ if (flags & NX_COMMANDMASK) {
+ DarwinPressModifierMask(pressed, COMMAND_MASK(flags));
+ }
+ if (flags & NX_CONTROLMASK) {
+ DarwinPressModifierMask(pressed, CONTROL_MASK(flags));
+ }
+ if (flags & NX_ALTERNATEMASK) {
+ DarwinPressModifierMask(pressed, ALTERNATE_MASK(flags));
+ }
+ if (flags & NX_SHIFTMASK) {
+ DarwinPressModifierMask(pressed, SHIFT_MASK(flags));
+ }
+ if (flags & NX_SECONDARYFNMASK) {
+ DarwinPressModifierMask(pressed, NX_SECONDARYFNMASK);
+ }
+}
+
+/*
+ * DarwinReleaseModifiers
+ * This hacky function releases all modifier keys. It should be called when X11.app
+ * is deactivated (kXDarwinDeactivate) to prevent modifiers from getting stuck if they
+ * are held down during a "context" switch -- otherwise, we would miss the KeyUp.
+ */
+static void DarwinReleaseModifiers(void) {
+ DarwinUpdateModifiers(KeyRelease, COMMAND_MASK(-1) | CONTROL_MASK(-1) | ALTERNATE_MASK(-1) | SHIFT_MASK(-1));
+}
+
+/*
+ * DarwinSimulateMouseClick
+ * Send a mouse click to X when multiple mouse buttons are simulated
+ * with modifier-clicks, such as command-click for button 2. The dix
+ * layer is told that the previously pressed modifier key(s) are
+ * released, the simulated click event is sent. After the mouse button
+ * is released, the modifier keys are reverted to their actual state,
+ * which may or may not be pressed at that point. This is usually
+ * closest to what the user wants. Ie. the user typically wants to
+ * simulate a button 2 press instead of Command-button 2.
+ */
+static void DarwinSimulateMouseClick(
+ int pointer_x,
+ int pointer_y,
+ int whichButton, // mouse button to be pressed
+ int modifierMask) // modifiers used for the fake click
+{
+ // first fool X into forgetting about the keys
+ // for some reason, it's not enough to tell X we released the Command key --
+ // it has to be the *left* Command key.
+ if (modifierMask & NX_COMMANDMASK) modifierMask |=NX_DEVICELCMDKEYMASK ;
+ DarwinUpdateModifiers(KeyRelease, modifierMask);
+
+ // push the mouse button
+ DarwinSendPointerEvents(ButtonPress, whichButton, pointer_x, pointer_y);
+ DarwinSendPointerEvents(ButtonRelease, whichButton, pointer_x, pointer_y);
+
+ // restore old modifiers
+ DarwinUpdateModifiers(KeyPress, modifierMask);
+}
+
+
+Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr) {
+ darwinEvents = (xEvent *)malloc(sizeof(xEvent) * GetMaximumEventsNum());
+ mieqInit();
+ darwinEventQueue.head = darwinEventQueue.tail = 0;
+ darwinEventQueue.lastEventTime = GetTimeInMillis ();
+ darwinEventQueue.pKbd = pKbd;
+ darwinEventQueue.pPtr = pPtr;
+ darwinEventQueue.pEnqueueScreen = screenInfo.screens[0];
+ darwinEventQueue.pDequeueScreen = darwinEventQueue.pEnqueueScreen;
+ SetInputCheck(&input_check_zero, &input_check_flag);
+ return TRUE;
+}
+
+
+/*
+ * DarwinEQEnqueue
+ * Must be thread safe with ProcessInputEvents.
+ * DarwinEQEnqueue - called from event gathering thread
+ * ProcessInputEvents - called from X server thread
+ * DarwinEQEnqueue should never be called from more than one thread.
+ *
+ * This should be deprecated in favor of miEQEnqueue -- BB
+ */
+void DarwinEQEnqueue(const xEventPtr e) {
+ HWEventQueueType oldtail, newtail;
+
+ oldtail = darwinEventQueue.tail;
+
+ // mieqEnqueue() collapses successive motion events into one event.
+ // This is difficult to do in a thread-safe way and rarely useful.
+
+ newtail = oldtail + 1;
+ if (newtail == QUEUE_SIZE) newtail = 0;
+ /* Toss events which come in late */
+ if (newtail == darwinEventQueue.head) return;
+
+ darwinEventQueue.events[oldtail].event = *e;
+
+ /*
+ * Make sure that event times don't go backwards - this
+ * is "unnecessary", but very useful
+ */
+ if (e->u.keyButtonPointer.time < darwinEventQueue.lastEventTime &&
+ darwinEventQueue.lastEventTime - e->u.keyButtonPointer.time < 10000)
+ {
+ darwinEventQueue.events[oldtail].event.u.keyButtonPointer.time =
+ darwinEventQueue.lastEventTime;
+ }
+ darwinEventQueue.events[oldtail].pScreen = darwinEventQueue.pEnqueueScreen;
+
+ // Update the tail after the event is prepared
+ darwinEventQueue.tail = newtail;
+
+ // Signal there is an event ready to handle
+ DarwinPokeEQ();
+}
+
+
+/*
+ * DarwinEQPointerPost
+ * Post a pointer event. Used by the mipointer.c routines.
+ */
+void DarwinEQPointerPost(DeviceIntPtr pdev, xEventPtr e) {
+ (*darwinEventQueue.pPtr->processInputProc)
+ (e, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+}
+
+
+void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX) {
+ darwinEventQueue.pEnqueueScreen = pScreen;
+ if (fromDIX)
+ darwinEventQueue.pDequeueScreen = pScreen;
+}
+
+
+/*
+ * ProcessInputEvents
+ * Read and process events from the event queue until it is empty.
+ */
+void ProcessInputEvents(void) {
+ EventRec *e;
+ int x, y;
+ xEvent xe;
+ // button number and modifier mask of currently pressed fake button
+ input_check_flag=0;
+
+ // ErrorF("calling mieqProcessInputEvents\n");
+ mieqProcessInputEvents();
+
+ // Empty the signaling pipe
+ x = sizeof(xe);
+ while (x == sizeof(xe))
+ x = read(darwinEventReadFD, &xe, sizeof(xe));
+
+ while (darwinEventQueue.head != darwinEventQueue.tail)
+ {
+ if (screenIsSaved == SCREEN_SAVER_ON)
+ dixSaveScreens (serverClient, SCREEN_SAVER_OFF, ScreenSaverReset);
+
+ e = &darwinEventQueue.events[darwinEventQueue.head];
+ xe = e->event;
+
+ // Shift from global screen coordinates to coordinates relative to
+ // the origin of the current screen.
+ xe.u.keyButtonPointer.rootX -= darwinMainScreenX +
+ dixScreenOrigins[miPointerCurrentScreen()->myNum].x;
+ xe.u.keyButtonPointer.rootY -= darwinMainScreenY +
+ dixScreenOrigins[miPointerCurrentScreen()->myNum].y;
+
+ /* ErrorF("old rootX = (%d,%d) darwinMainScreen = (%d,%d) dixScreenOrigins[%d]=(%d,%d)\n",
+ xe.u.keyButtonPointer.rootX, xe.u.keyButtonPointer.rootY,
+ darwinMainScreenX, darwinMainScreenY,
+ miPointerCurrentScreen()->myNum,
+ dixScreenOrigins[miPointerCurrentScreen()->myNum].x,
+ dixScreenOrigins[miPointerCurrentScreen()->myNum].y); */
+
+ //Assumption - screen switching can only occur on motion events
+
+ if (e->pScreen != darwinEventQueue.pDequeueScreen)
+ {
+ darwinEventQueue.pDequeueScreen = e->pScreen;
+ x = xe.u.keyButtonPointer.rootX;
+ y = xe.u.keyButtonPointer.rootY;
+ if (darwinEventQueue.head == QUEUE_SIZE - 1)
+ darwinEventQueue.head = 0;
+ else
+ ++darwinEventQueue.head;
+ NewCurrentScreen (darwinEventQueue.pDequeueScreen, x, y);
+ }
+ else
+ {
+ if (darwinEventQueue.head == QUEUE_SIZE - 1)
+ darwinEventQueue.head = 0;
+ else
+ ++darwinEventQueue.head;
+ switch (xe.u.u.type) {
+ case KeyPress:
+ case KeyRelease:
+ ErrorF("Unexpected Keyboard event in DarwinProcessInputEvents\n");
+ break;
+
+ case ButtonPress:
+ ErrorF("Unexpected ButtonPress event in DarwinProcessInputEvents\n");
+ break;
+
+ case ButtonRelease:
+ ErrorF("Unexpected ButtonRelease event in DarwinProcessInputEvents\n");
+ break;
+
+ case MotionNotify:
+ ErrorF("Unexpected ButtonRelease event in DarwinProcessInputEvents\n");
+ break;
+
+ case kXDarwinUpdateModifiers:
+ ErrorF("Unexpected ButtonRelease event in DarwinProcessInputEvents\n");
+ break;
+
+ case kXDarwinUpdateButtons:
+ ErrorF("Unexpected XDarwinScrollWheel event in DarwinProcessInputEvents\n");
+ break;
+
+ case kXDarwinScrollWheel:
+ ErrorF("Unexpected XDarwinScrollWheel event in DarwinProcessInputEvents\n");
+ break;
+
+ case kXDarwinDeactivate:
+ DarwinReleaseModifiers();
+ // fall through
+ default:
+ // Check for mode specific event
+ QuartzProcessEvent(&xe);
+ }
+ }
+ }
+
+ // miPointerUpdate();
+}
+
+/* Sends a null byte down darwinEventWriteFD, which will cause the
+ Dispatch() event loop to check out event queue */
+void DarwinPokeEQ(void) {
+ char nullbyte=0;
+ input_check_flag++;
+ // <daniels> bushing: oh, i ... er ... christ.
+ write(darwinEventWriteFD, &nullbyte, 1);
+}
+
+void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y) {
+ static int darwinFakeMouseButtonDown = 0;
+ static int darwinFakeMouseButtonMask = 0;
+ int i, num_events;
+ int valuators[2] = {pointer_x, pointer_y};
+ if (ev_type == ButtonPress && darwinFakeButtons && ev_button == 1) {
+ // Mimic multi-button mouse with modifier-clicks
+ // If both sets of modifiers are pressed,
+ // button 2 is clicked.
+ if ((old_flags & darwinFakeMouse2Mask) == darwinFakeMouse2Mask) {
+ DarwinSimulateMouseClick(pointer_x, pointer_y, 2, darwinFakeMouse2Mask);
+ darwinFakeMouseButtonDown = 2;
+ darwinFakeMouseButtonMask = darwinFakeMouse2Mask;
+ } else if ((old_flags & darwinFakeMouse3Mask) == darwinFakeMouse3Mask) {
+ DarwinSimulateMouseClick(pointer_x, pointer_y, 3, darwinFakeMouse3Mask);
+ darwinFakeMouseButtonDown = 3;
+ darwinFakeMouseButtonMask = darwinFakeMouse3Mask;
+ }
+ }
+ if (ev_type == ButtonRelease && darwinFakeButtons && darwinFakeMouseButtonDown) {
+ // If last mousedown was a fake click, don't check for
+ // mouse modifiers here. The user may have released the
+ // modifiers before the mouse button.
+ ev_button = darwinFakeMouseButtonDown;
+ darwinFakeMouseButtonDown = 0;
+ // Bring modifiers back up to date
+ DarwinUpdateModifiers(KeyPress, darwinFakeMouseButtonMask & old_flags);
+ darwinFakeMouseButtonMask = 0;
+ }
+
+ num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button,
+ POINTER_ABSOLUTE, 0, 2, valuators);
+
+ for(i=0; i<num_events; i++) mieqEnqueue (darwinPointer,&darwinEvents[i]);
+ DarwinPokeEQ();
+}
+
+void DarwinSendKeyboardEvents(int ev_type, int keycode) {
+ int i, num_events;
+ if (old_flags == 0 && darwinSyncKeymap && darwinKeymapFile == NULL) {
+ /* See if keymap has changed. */
+
+ static unsigned int last_seed;
+ unsigned int this_seed;
+
+ this_seed = QuartzSystemKeymapSeed();
+ if (this_seed != last_seed) {
+ last_seed = this_seed;
+ DarwinKeyboardReload(darwinKeyboard);
+ }
+ }
+
+ num_events = GetKeyboardEvents(darwinEvents, darwinKeyboard, ev_type, keycode + MIN_KEYCODE);
+ for(i=0; i<num_events; i++) mieqEnqueue(darwinKeyboard,&darwinEvents[i]);
+ DarwinPokeEQ();
+}
+
+/* Send the appropriate number of button 4 / 5 clicks to emulate scroll wheel */
+void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y) {
+ int i;
+ int ev_button = count > 0.0f ? 4 : 5;
+ int valuators[2] = {pointer_x, pointer_y};
+
+ for (count = fabs(count); count > 0.0; count = count - 1.0f) {
+ int num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonPress, ev_button,
+ POINTER_ABSOLUTE, 0, 2, valuators);
+ for(i=0; i<num_events; i++) mieqEnqueue(darwinPointer,&darwinEvents[i]);
+ num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonRelease, ev_button,
+ POINTER_ABSOLUTE, 0, 2, valuators);
+ for(i=0; i<num_events; i++) mieqEnqueue(darwinPointer,&darwinEvents[i]);
+ }
+ DarwinPokeEQ();
+}
+
+/* Send the appropriate KeyPress/KeyRelease events to GetKeyboardEvents to
+ reflect changing modifier flags (alt, control, meta, etc) */
+void DarwinUpdateModKeys(int flags) {
+ DarwinUpdateModifiers(KeyRelease, old_flags & ~flags);
+ DarwinUpdateModifiers(KeyPress, ~old_flags & flags);
+ old_flags = flags;
+}
diff --git a/xorg-server/hw/xquartz/darwinEvents.h b/xorg-server/hw/xquartz/darwinEvents.h
new file mode 100644
index 000000000..82cc26bc0
--- /dev/null
+++ b/xorg-server/hw/xquartz/darwinEvents.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifndef _DARWIN_EVENTS_H
+#define _DARWIN_EVENTS_H
+
+Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr);
+void DarwinEQEnqueue(const xEventPtr e);
+void DarwinEQPointerPost(DeviceIntPtr pDev, xEventPtr e);
+void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
+void DarwinPokeEQ(void);
+void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y);
+void DarwinSendKeyboardEvents(int ev_type, int keycode);
+void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y);
+void DarwinUpdateModKeys(int flags);
+
+#endif /* _DARWIN_EVENTS_H */
diff --git a/xorg-server/hw/xquartz/darwinKeyboard.c b/xorg-server/hw/xquartz/darwinKeyboard.c
new file mode 100644
index 000000000..8d1ee8ec9
--- /dev/null
+++ b/xorg-server/hw/xquartz/darwinKeyboard.c
@@ -0,0 +1,1009 @@
+//=============================================================================
+//
+// Keyboard support for the Darwin X Server
+//
+// Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved.
+// Copyright (c) 2003 Apple Computer, Inc. All Rights Reserved.
+// Copyright 2004 Kaleb S. KEITHLEY. All Rights Reserved.
+//
+// The code to parse the Darwin keymap is derived from dumpkeymap.c
+// by Eric Sunshine, which includes the following copyright:
+//
+// Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.com>
+// All rights reserved.
+//
+//-----------------------------------------------------------------------------
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// 3. The name of the author may not be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+// NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+//=============================================================================
+
+
+/*
+===========================================================================
+
+ An X keyCode must be in the range XkbMinLegalKeyCode (8) to
+ XkbMaxLegalKeyCode(255).
+
+ The keyCodes we get from the kernel range from 0 to 127, so we need to
+ offset the range before passing the keyCode to X.
+
+ An X KeySym is an extended ascii code that is device independent.
+
+ The modifier map is accessed by the keyCode, but the normal map is
+ accessed by keyCode - MIN_KEYCODE. Sigh.
+
+===========================================================================
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+// Define this to get a diagnostic output to stderr which is helpful
+// in determining how the X server is interpreting the Darwin keymap.
+// #define DUMP_DARWIN_KEYMAP
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <IOKit/hidsystem/event_status_driver.h>
+#include <IOKit/hidsystem/ev_keymap.h>
+#include <architecture/byte_order.h> // For the NXSwap*
+#include "darwin.h"
+#include "darwinKeyboard.h"
+#include "quartzKeyboard.h"
+#include "quartzAudio.h"
+
+#ifdef NDEBUG
+#undef NDEBUG
+#include <assert.h>
+#define NDEBUG 1
+#else
+#include <assert.h>
+#endif
+
+#define AltMask Mod1Mask
+#define MetaMask Mod2Mask
+#define FunctionMask Mod3Mask
+
+#define UK(a) NoSymbol // unknown symbol
+
+static KeySym const next_to_x[256] = {
+ NoSymbol, NoSymbol, NoSymbol, XK_KP_Enter,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
+ NoSymbol, XK_Return, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, XK_Escape,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
+ XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
+ XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
+ XK_comma, XK_minus, XK_period, XK_slash,
+ XK_0, XK_1, XK_2, XK_3,
+ XK_4, XK_5, XK_6, XK_7,
+ XK_8, XK_9, XK_colon, XK_semicolon,
+ XK_less, XK_equal, XK_greater, XK_question,
+ XK_at, XK_A, XK_B, XK_C,
+ XK_D, XK_E, XK_F, XK_G,
+ XK_H, XK_I, XK_J, XK_K,
+ XK_L, XK_M, XK_N, XK_O,
+ XK_P, XK_Q, XK_R, XK_S,
+ XK_T, XK_U, XK_V, XK_W,
+ XK_X, XK_Y, XK_Z, XK_bracketleft,
+ XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
+ XK_grave, XK_a, XK_b, XK_c,
+ XK_d, XK_e, XK_f, XK_g,
+ XK_h, XK_i, XK_j, XK_k,
+ XK_l, XK_m, XK_n, XK_o,
+ XK_p, XK_q, XK_r, XK_s,
+ XK_t, XK_u, XK_v, XK_w,
+ XK_x, XK_y, XK_z, XK_braceleft,
+ XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace,
+// 128
+ NoSymbol, XK_Agrave, XK_Aacute, XK_Acircumflex,
+ XK_Atilde, XK_Adiaeresis, XK_Aring, XK_Ccedilla,
+ XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis,
+ XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis,
+// 144
+ XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute,
+ XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_Ugrave,
+ XK_Uacute, XK_Ucircumflex, XK_Udiaeresis, XK_Yacute,
+ XK_THORN, XK_mu, XK_multiply, XK_division,
+// 160
+ XK_copyright, XK_exclamdown, XK_cent, XK_sterling,
+ UK(fraction), XK_yen, UK(fhook), XK_section,
+ XK_currency, XK_rightsinglequotemark,
+ XK_leftdoublequotemark,
+ XK_guillemotleft,
+ XK_leftanglebracket,
+ XK_rightanglebracket,
+ UK(filigature), UK(flligature),
+// 176
+ XK_registered, XK_endash, XK_dagger, XK_doubledagger,
+ XK_periodcentered,XK_brokenbar, XK_paragraph, UK(bullet),
+ XK_singlelowquotemark,
+ XK_doublelowquotemark,
+ XK_rightdoublequotemark,
+ XK_guillemotright,
+ XK_ellipsis, UK(permille), XK_notsign, XK_questiondown,
+// 192
+ XK_onesuperior, XK_dead_grave, XK_dead_acute, XK_dead_circumflex,
+ XK_dead_tilde, XK_dead_macron, XK_dead_breve, XK_dead_abovedot,
+ XK_dead_diaeresis,
+ XK_twosuperior, XK_dead_abovering,
+ XK_dead_cedilla,
+ XK_threesuperior,
+ XK_dead_doubleacute,
+ XK_dead_ogonek, XK_dead_caron,
+// 208
+ XK_emdash, XK_plusminus, XK_onequarter, XK_onehalf,
+ XK_threequarters,
+ XK_agrave, XK_aacute, XK_acircumflex,
+ XK_atilde, XK_adiaeresis, XK_aring, XK_ccedilla,
+ XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis,
+// 224
+ XK_igrave, XK_AE, XK_iacute, XK_ordfeminine,
+ XK_icircumflex, XK_idiaeresis, XK_eth, XK_ntilde,
+ XK_Lstroke, XK_Ooblique, XK_OE, XK_masculine,
+ XK_ograve, XK_oacute, XK_ocircumflex, XK_otilde,
+// 240
+ XK_odiaeresis, XK_ae, XK_ugrave, XK_uacute,
+ XK_ucircumflex, XK_idotless, XK_udiaeresis, XK_ygrave,
+ XK_lstroke, XK_ooblique, XK_oe, XK_ssharp,
+ XK_thorn, XK_ydiaeresis, NoSymbol, NoSymbol,
+ };
+
+#define MIN_SYMBOL 0xAC
+static KeySym const symbol_to_x[] = {
+ XK_Left, XK_Up, XK_Right, XK_Down
+ };
+static int const NUM_SYMBOL = sizeof(symbol_to_x) / sizeof(symbol_to_x[0]);
+
+#define MIN_FUNCKEY 0x20
+static KeySym const funckey_to_x[] = {
+ XK_F1, XK_F2, XK_F3, XK_F4,
+ XK_F5, XK_F6, XK_F7, XK_F8,
+ XK_F9, XK_F10, XK_F11, XK_F12,
+ XK_Insert, XK_Delete, XK_Home, XK_End,
+ XK_Page_Up, XK_Page_Down, XK_F13, XK_F14,
+ XK_F15
+ };
+static int const NUM_FUNCKEY = sizeof(funckey_to_x) / sizeof(funckey_to_x[0]);
+
+typedef struct {
+ KeySym normalSym;
+ KeySym keypadSym;
+} darwinKeyPad_t;
+
+static darwinKeyPad_t const normal_to_keypad[] = {
+ { XK_0, XK_KP_0 },
+ { XK_1, XK_KP_1 },
+ { XK_2, XK_KP_2 },
+ { XK_3, XK_KP_3 },
+ { XK_4, XK_KP_4 },
+ { XK_5, XK_KP_5 },
+ { XK_6, XK_KP_6 },
+ { XK_7, XK_KP_7 },
+ { XK_8, XK_KP_8 },
+ { XK_9, XK_KP_9 },
+ { XK_equal, XK_KP_Equal },
+ { XK_asterisk, XK_KP_Multiply },
+ { XK_plus, XK_KP_Add },
+ { XK_comma, XK_KP_Separator },
+ { XK_minus, XK_KP_Subtract },
+ { XK_period, XK_KP_Decimal },
+ { XK_slash, XK_KP_Divide }
+};
+static int const NUM_KEYPAD = sizeof(normal_to_keypad) / sizeof(normal_to_keypad[0]);
+
+static void DarwinChangeKeyboardControl( DeviceIntPtr device, KeybdCtrl *ctrl )
+{
+ // keyclick, bell volume / pitch, autorepead, LED's
+}
+
+darwinKeyboardInfo keyInfo;
+static FILE *fref = NULL;
+static char *inBuffer = NULL;
+
+//-----------------------------------------------------------------------------
+// Data Stream Object
+// Can be configured to treat embedded "numbers" as being composed of
+// either 1, 2, or 4 bytes, apiece.
+//-----------------------------------------------------------------------------
+typedef struct _DataStream {
+ unsigned char const *data;
+ unsigned char const *data_end;
+ short number_size; // Size in bytes of a "number" in the stream.
+} DataStream;
+
+static DataStream* new_data_stream(unsigned char const* data, int size) {
+ DataStream* s = (DataStream*)xalloc( sizeof(DataStream) );
+ if(s) {
+ s->data = data;
+ s->data_end = data + size;
+ s->number_size = 1; // Default to byte-sized numbers.
+ }
+ return s;
+}
+
+static void destroy_data_stream(DataStream* s) {
+ xfree(s);
+}
+
+static unsigned char get_byte(DataStream* s) {
+ assert(s->data + 1 <= s->data_end);
+ return *s->data++;
+}
+
+static short get_word(DataStream* s) {
+ short hi, lo;
+ assert(s->data + 2 <= s->data_end);
+ hi = *s->data++;
+ lo = *s->data++;
+ return ((hi << 8) | lo);
+}
+
+static int get_dword(DataStream* s) {
+ int b1, b2, b3, b4;
+ assert(s->data + 4 <= s->data_end);
+ b4 = *s->data++;
+ b3 = *s->data++;
+ b2 = *s->data++;
+ b1 = *s->data++;
+ return ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1);
+}
+
+static int get_number(DataStream* s) {
+ switch (s->number_size) {
+ case 4: return get_dword(s);
+ case 2: return get_word(s);
+ default: return get_byte(s);
+ }
+}
+
+//-----------------------------------------------------------------------------
+// Utility functions to help parse Darwin keymap
+//-----------------------------------------------------------------------------
+
+/*
+ * bits_set
+ * Calculate number of bits set in the modifier mask.
+ */
+static short bits_set(short mask) {
+ short n = 0;
+
+ for ( ; mask != 0; mask >>= 1)
+ if ((mask & 0x01) != 0)
+ n++;
+ return n;
+}
+
+/*
+ * parse_next_char_code
+ * Read the next character code from the Darwin keymapping
+ * and write it to the X keymap.
+ */
+static void parse_next_char_code(DataStream *s, KeySym *k) {
+ const short charSet = get_number(s);
+ const short charCode = get_number(s);
+
+ if (charSet == 0) { // ascii character
+ if (charCode >= 0 && charCode < 256)
+ *k = next_to_x[charCode];
+ } else if (charSet == 0x01) { // symbol character
+ if (charCode >= MIN_SYMBOL &&
+ charCode <= MIN_SYMBOL + NUM_SYMBOL)
+ *k = symbol_to_x[charCode - MIN_SYMBOL];
+ } else if (charSet == 0xFE) { // function key
+ if (charCode >= MIN_FUNCKEY &&
+ charCode <= MIN_FUNCKEY + NUM_FUNCKEY)
+ *k = funckey_to_x[charCode - MIN_FUNCKEY];
+ }
+}
+
+
+/*
+ * DarwinReadKeymapFile
+ * Read the appropriate keymapping from a keymapping file.
+ */
+static Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) {
+ struct stat st;
+ NXEventSystemDevice info[20];
+ int interface = 0, handler_id = 0;
+ int map_interface, map_handler_id, map_size = 0;
+ unsigned int i, size;
+ int *bufferEnd;
+ union km_tag {
+ int *intP;
+ char *charP;
+ } km;
+
+ fref = fopen( darwinKeymapFile, "rb" );
+ if (fref == NULL) {
+ ErrorF("Unable to open keymapping file '%s' (%s).\n",
+ darwinKeymapFile, strerror(errno));
+ return FALSE;
+ }
+ if (fstat(fileno(fref), &st) == -1) {
+ ErrorF("Could not stat keymapping file '%s' (%s).\n",
+ darwinKeymapFile, strerror(errno));
+ return FALSE;
+ }
+
+ // check to make sure we don't crash later
+ if (st.st_size <= 16*sizeof(int)) {
+ ErrorF("Keymapping file '%s' is invalid (too small).\n",
+ darwinKeymapFile);
+ return FALSE;
+ }
+
+ inBuffer = (char*) xalloc( st.st_size );
+ bufferEnd = (int *) (inBuffer + st.st_size);
+ if (fread(inBuffer, st.st_size, 1, fref) != 1) {
+ ErrorF("Could not read %qd bytes from keymapping file '%s' (%s).\n",
+ st.st_size, darwinKeymapFile, strerror(errno));
+ return FALSE;
+ }
+
+ if (strncmp( inBuffer, "KYM1", 4 ) == 0) {
+ // Magic number OK.
+ } else if (strncmp( inBuffer, "KYMP", 4 ) == 0) {
+ ErrorF("Keymapping file '%s' is intended for use with the original NeXT keyboards and cannot be used by XDarwin.\n", darwinKeymapFile);
+ return FALSE;
+ } else {
+ ErrorF("Keymapping file '%s' has a bad magic number and cannot be used by XDarwin.\n", darwinKeymapFile);
+ return FALSE;
+ }
+
+ // find the keyboard interface and handler id
+ size = sizeof( info ) / sizeof( int );
+ if (!NXEventSystemInfo( darwinParamConnect, NX_EVS_DEVICE_INFO,
+ (NXEventSystemInfoType) info, &size )) {
+ ErrorF("Error reading event status driver info.\n");
+ return FALSE;
+ }
+
+ size = size * sizeof( int ) / sizeof( info[0] );
+ for( i = 0; i < size; i++) {
+ if (info[i].dev_type == NX_EVS_DEVICE_TYPE_KEYBOARD) {
+ Bool hasInterface = FALSE;
+ Bool hasMatch = FALSE;
+
+ interface = info[i].interface;
+ handler_id = info[i].id;
+
+ // Find an appropriate keymapping:
+ // The first time we try to match both interface and handler_id.
+ // If we can't match both, we take the first match for interface.
+
+ do {
+ km.charP = inBuffer;
+ km.intP++;
+ while (km.intP+3 < bufferEnd) {
+ map_interface = NXSwapBigIntToHost(*(km.intP++));
+ map_handler_id = NXSwapBigIntToHost(*(km.intP++));
+ map_size = NXSwapBigIntToHost(*(km.intP++));
+ if (map_interface == interface) {
+ if (map_handler_id == handler_id || hasInterface) {
+ hasMatch = TRUE;
+ break;
+ } else {
+ hasInterface = TRUE;
+ }
+ }
+ km.charP += map_size;
+ }
+ } while (hasInterface && !hasMatch);
+
+ if (hasMatch) {
+ // fill in NXKeyMapping structure
+ keyMap->size = map_size;
+ keyMap->mapping = (char*) xalloc(map_size);
+ memcpy(keyMap->mapping, km.charP, map_size);
+ return TRUE;
+ }
+ } // if dev_id == keyboard device
+ } // foreach info struct
+
+ // The keymapping file didn't match any of the info structs
+ // returned by NXEventSystemInfo.
+ ErrorF("Keymapping file '%s' did not contain appropriate keyboard interface.\n", darwinKeymapFile);
+ return FALSE;
+}
+
+
+/*
+ * DarwinParseNXKeyMapping
+ */
+static Bool DarwinParseNXKeyMapping(darwinKeyboardInfo *info) {
+ KeySym *k;
+ int i;
+ short numMods, numKeys, numPadKeys = 0;
+ Bool haveKeymap = FALSE;
+ NXKeyMapping keyMap;
+ DataStream *keyMapStream;
+ unsigned char const *numPadStart = 0;
+
+ if (darwinKeymapFile) {
+ haveKeymap = DarwinReadKeymapFile(&keyMap);
+ if (fref)
+ fclose(fref);
+ if (inBuffer)
+ xfree(inBuffer);
+ if (!haveKeymap) {
+ ErrorF("Reverting to kernel keymapping.\n");
+ }
+ }
+
+ if (!haveKeymap) {
+ // get the Darwin keyboard map
+ keyMap.size = NXKeyMappingLength( darwinParamConnect );
+ keyMap.mapping = (char*) xalloc( keyMap.size );
+ if (!NXGetKeyMapping( darwinParamConnect, &keyMap )) {
+ return FALSE;
+ }
+ }
+
+ keyMapStream = new_data_stream( (unsigned char const*)keyMap.mapping,
+ keyMap.size );
+
+ // check the type of map
+ if (get_word(keyMapStream)) {
+ keyMapStream->number_size = 2;
+ ErrorF("Current 16-bit keymapping may not be interpreted correctly.\n");
+ }
+
+ // Insert X modifier KeySyms into the keyboard map.
+ numMods = get_number(keyMapStream);
+ while (numMods-- > 0) {
+ int left = 1; // first keycode is left
+ short const charCode = get_number(keyMapStream);
+ short numKeyCodes = get_number(keyMapStream);
+
+ // This is just a marker, not a real modifier.
+ // Store numeric keypad keys for later.
+ if (charCode == NX_MODIFIERKEY_NUMERICPAD) {
+ numPadStart = keyMapStream->data;
+ numPadKeys = numKeyCodes;
+ }
+
+ while (numKeyCodes-- > 0) {
+ const short keyCode = get_number(keyMapStream);
+ if (charCode != NX_MODIFIERKEY_NUMERICPAD) {
+ switch (charCode) {
+ case NX_MODIFIERKEY_ALPHALOCK:
+ info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Caps_Lock;
+ break;
+ case NX_MODIFIERKEY_SHIFT:
+ info->keyMap[keyCode * GLYPHS_PER_KEY] =
+ (left ? XK_Shift_L : XK_Shift_R);
+ break;
+ case NX_MODIFIERKEY_CONTROL:
+ info->keyMap[keyCode * GLYPHS_PER_KEY] =
+ (left ? XK_Control_L : XK_Control_R);
+ break;
+ case NX_MODIFIERKEY_ALTERNATE:
+ // info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Mode_switch;
+ info->keyMap[keyCode * GLYPHS_PER_KEY] =
+ (left ? XK_Alt_L : XK_Alt_R);
+ break;
+ case NX_MODIFIERKEY_COMMAND:
+ info->keyMap[keyCode * GLYPHS_PER_KEY] =
+ (left ? XK_Meta_L : XK_Meta_R);
+ break;
+ case NX_MODIFIERKEY_SECONDARYFN:
+ info->keyMap[keyCode * GLYPHS_PER_KEY] =
+ (left ? XK_Control_L : XK_Control_R);
+ break;
+ case NX_MODIFIERKEY_HELP:
+ // Help is not an X11 modifier; treat as normal key
+ info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Help;
+ break;
+ }
+ }
+ left = 0;
+ }
+ }
+
+ // Convert the Darwin keyboard mapping to an X keyboard map.
+ // A key can have a different character code for each combination of
+ // modifiers. We currently ignore all modifier combinations except
+ // those with Shift, AlphaLock, and Alt.
+ numKeys = get_number(keyMapStream);
+ for (i = 0, k = info->keyMap; i < numKeys; i++, k += GLYPHS_PER_KEY) {
+ short const charGenMask = get_number(keyMapStream);
+ if (charGenMask != 0xFF) { // is key bound?
+ short numKeyCodes = 1 << bits_set(charGenMask);
+
+ // Record unmodified case
+ parse_next_char_code( keyMapStream, k );
+ numKeyCodes--;
+
+ // If AlphaLock and Shift modifiers produce different codes,
+ // we record the Shift case since X handles AlphaLock.
+ if (charGenMask & 0x01) { // AlphaLock
+ parse_next_char_code( keyMapStream, k+1 );
+ numKeyCodes--;
+ }
+
+ if (charGenMask & 0x02) { // Shift
+ parse_next_char_code( keyMapStream, k+1 );
+ numKeyCodes--;
+
+ if (charGenMask & 0x01) { // Shift-AlphaLock
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+ }
+ }
+
+ // Skip the Control cases
+ if (charGenMask & 0x04) { // Control
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+
+ if (charGenMask & 0x01) { // Control-AlphaLock
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+ }
+
+ if (charGenMask & 0x02) { // Control-Shift
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+
+ if (charGenMask & 0x01) { // Shift-Control-AlphaLock
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+ }
+ }
+ }
+
+ // Process Alt cases
+ if (charGenMask & 0x08) { // Alt
+ parse_next_char_code( keyMapStream, k+2 );
+ numKeyCodes--;
+
+ if (charGenMask & 0x01) { // Alt-AlphaLock
+ parse_next_char_code( keyMapStream, k+3 );
+ numKeyCodes--;
+ }
+
+ if (charGenMask & 0x02) { // Alt-Shift
+ parse_next_char_code( keyMapStream, k+3 );
+ numKeyCodes--;
+
+ if (charGenMask & 0x01) { // Alt-Shift-AlphaLock
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+ }
+ }
+ }
+
+ while (numKeyCodes-- > 0) {
+ get_number(keyMapStream); get_number(keyMapStream);
+ }
+
+ if (k[3] == k[2]) k[3] = NoSymbol;
+ if (k[2] == k[1]) k[2] = NoSymbol;
+ if (k[1] == k[0]) k[1] = NoSymbol;
+ if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol;
+ }
+ }
+
+ // Now we have to go back through the list of keycodes that are on the
+ // numeric keypad and update the X keymap.
+ keyMapStream->data = numPadStart;
+ while(numPadKeys-- > 0) {
+ const short keyCode = get_number(keyMapStream);
+ k = &info->keyMap[keyCode * GLYPHS_PER_KEY];
+ for (i = 0; i < NUM_KEYPAD; i++) {
+ if (*k == normal_to_keypad[i].normalSym) {
+ k[0] = normal_to_keypad[i].keypadSym;
+ break;
+ }
+ }
+ }
+
+ // free Darwin keyboard map
+ destroy_data_stream( keyMapStream );
+ xfree( keyMap.mapping );
+
+ return TRUE;
+}
+
+/*
+ * DarwinBuildModifierMaps
+ * Use the keyMap field of keyboard info structure to populate
+ * the modMap and modifierKeycodes fields.
+ */
+static void DarwinBuildModifierMaps(darwinKeyboardInfo *info) {
+ int i;
+ KeySym *k;
+
+ memset(info->modMap, NoSymbol, sizeof(info->modMap));
+ memset(info->modifierKeycodes, 0, sizeof(info->modifierKeycodes));
+
+ for (i = 0; i < NUM_KEYCODES; i++) {
+ k = info->keyMap + i * GLYPHS_PER_KEY;
+
+ switch (*k) {
+ case XK_Shift_L:
+ info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][0] = i;
+ info->modMap[MIN_KEYCODE + i] = ShiftMask;
+ break;
+
+ case XK_Shift_R:
+#ifdef NX_MODIFIERKEY_RSHIFT
+ info->modifierKeycodes[NX_MODIFIERKEY_RSHIFT][0] = i;
+#else
+ info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][0] = i;
+#endif
+ info->modMap[MIN_KEYCODE + i] = ShiftMask;
+ break;
+
+ case XK_Control_L:
+ info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][0] = i;
+ info->modMap[MIN_KEYCODE + i] = ControlMask;
+ break;
+
+ case XK_Control_R:
+#ifdef NX_MODIFIERKEY_RCONTROL
+ info->modifierKeycodes[NX_MODIFIERKEY_RCONTROL][0] = i;
+#else
+ info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][0] = i;
+#endif
+ info->modMap[MIN_KEYCODE + i] = ControlMask;
+ break;
+
+ case XK_Caps_Lock:
+ info->modifierKeycodes[NX_MODIFIERKEY_ALPHALOCK][0] = i;
+ info->modMap[MIN_KEYCODE + i] = LockMask;
+ break;
+
+ case XK_Alt_L:
+ info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i;
+ info->modMap[MIN_KEYCODE + i] = Mod1Mask;
+ *k = XK_Mode_switch; // Yes, this is ugly. This needs to be cleaned up when we integrate quartzKeyboard with this code and refactor.
+ break;
+
+ case XK_Alt_R:
+#ifdef NX_MODIFIERKEY_RALTERNATE
+ info->modifierKeycodes[NX_MODIFIERKEY_RALTERNATE][0] = i;
+#else
+ info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i;
+#endif
+ *k = XK_Mode_switch; // Yes, this is ugly. This needs to be cleaned up when we integrate quartzKeyboard with this code and refactor.
+ info->modMap[MIN_KEYCODE + i] = Mod1Mask;
+ break;
+
+ case XK_Mode_switch:
+ info->modMap[MIN_KEYCODE + i] = Mod1Mask;
+ break;
+
+ case XK_Meta_L:
+ info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][0] = i;
+ info->modMap[MIN_KEYCODE + i] = Mod2Mask;
+ break;
+
+ case XK_Meta_R:
+#ifdef NX_MODIFIERKEY_RCOMMAND
+ info->modifierKeycodes[NX_MODIFIERKEY_RCOMMAND][0] = i;
+#else
+ info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][0] = i;
+#endif
+ info->modMap[MIN_KEYCODE + i] = Mod2Mask;
+ break;
+
+ case XK_Num_Lock:
+ info->modMap[MIN_KEYCODE + i] = Mod3Mask;
+ break;
+ }
+ }
+}
+
+/*
+ * DarwinLoadKeyboardMapping
+ * Load the keyboard map from a file or system and convert
+ * it to an equivalent X keyboard map and modifier map.
+ */
+static void DarwinLoadKeyboardMapping(KeySymsRec *keySyms) {
+ memset(keyInfo.keyMap, 0, sizeof(keyInfo.keyMap));
+
+ /* TODO: Clean this up
+ * QuartzReadSystemKeymap is in quartz/quartzKeyboard.c
+ * DarwinParseNXKeyMapping is here
+ */
+ if (!DarwinParseNXKeyMapping(&keyInfo)) {
+ DEBUG_LOG("DarwinParseNXKeyMapping returned 0... running QuartzReadSystemKeymap().\n");
+ if (!QuartzReadSystemKeymap(&keyInfo)) {
+ FatalError("Could not build a valid keymap.");
+ }
+ }
+
+ DarwinBuildModifierMaps(&keyInfo);
+
+#ifdef DUMP_DARWIN_KEYMAP
+ int i;
+ KeySym *k;
+ DEBUG_LOG("Darwin -> X converted keyboard map\n");
+ for (i = 0, k = keyInfo.keyMap; i < NX_NUMKEYCODES;
+ i++, k += GLYPHS_PER_KEY)
+ {
+ int j;
+ for (j = 0; j < GLYPHS_PER_KEY; j++) {
+ if (k[j] == NoSymbol) {
+ DEBUG_LOG("0x%02x:\tNoSym\n", i);
+ } else {
+ DEBUG_LOG("0x%02x:\t0x%lx\n", i, k[j]);
+ }
+ }
+ }
+#endif
+
+ keySyms->map = keyInfo.keyMap;
+ keySyms->mapWidth = GLYPHS_PER_KEY;
+ keySyms->minKeyCode = MIN_KEYCODE;
+ keySyms->maxKeyCode = MAX_KEYCODE;
+}
+
+
+/*
+ * DarwinKeyboardInit
+ * Get the Darwin keyboard map and compute an equivalent
+ * X keyboard map and modifier map. Set the new keyboard
+ * device structure.
+ */
+void DarwinKeyboardInit(DeviceIntPtr pDev) {
+ KeySymsRec keySyms;
+
+ // Open a shared connection to the HID System.
+ // Note that the Event Status Driver is really just a wrapper
+ // for a kIOHIDParamConnectType connection.
+ assert( darwinParamConnect = NXOpenEventStatus() );
+
+ DarwinLoadKeyboardMapping(&keySyms);
+ // DarwinKeyboardReload(pDev);
+ /* Initialize the seed, so we don't reload the keymap unnecessarily
+ (and possibly overwrite xinitrc changes) */
+ QuartzSystemKeymapSeed();
+
+ assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms,
+ keyInfo.modMap, QuartzBell,
+ DarwinChangeKeyboardControl ));
+}
+
+
+/* Borrowed from dix/devices.c */
+static Bool InitModMap(register KeyClassPtr keyc) {
+ int i, j;
+ CARD8 keysPerModifier[8];
+ CARD8 mask;
+
+ // darwinKeyc = keyc;
+ if (keyc->modifierKeyMap != NULL)
+ xfree (keyc->modifierKeyMap);
+
+ keyc->maxKeysPerModifier = 0;
+ for (i = 0; i < 8; i++)
+ keysPerModifier[i] = 0;
+ for (i = 8; i < MAP_LENGTH; i++)
+ {
+ for (j = 0, mask = 1; j < 8; j++, mask <<= 1)
+ {
+ if (mask & keyc->modifierMap[i])
+ {
+ if (++keysPerModifier[j] > keyc->maxKeysPerModifier)
+ keyc->maxKeysPerModifier = keysPerModifier[j];
+ }
+ }
+ }
+ keyc->modifierKeyMap = (KeyCode *)xalloc(8*keyc->maxKeysPerModifier);
+ if (!keyc->modifierKeyMap && keyc->maxKeysPerModifier)
+ return (FALSE);
+ bzero((char *)keyc->modifierKeyMap, 8*(int)keyc->maxKeysPerModifier);
+ for (i = 0; i < 8; i++)
+ keysPerModifier[i] = 0;
+ for (i = 8; i < MAP_LENGTH; i++)
+ {
+ for (j = 0, mask = 1; j < 8; j++, mask <<= 1)
+ {
+ if (mask & keyc->modifierMap[i])
+ {
+ keyc->modifierKeyMap[(j*keyc->maxKeysPerModifier) +
+ keysPerModifier[j]] = i;
+ keysPerModifier[j]++;
+ }
+ }
+ }
+ return TRUE;
+}
+
+
+void DarwinKeyboardReload(DeviceIntPtr pDev) {
+ KeySymsRec keySyms;
+
+ DarwinLoadKeyboardMapping(&keySyms);
+
+ if (SetKeySymsMap(&pDev->key->curKeySyms, &keySyms)) {
+ /* now try to update modifiers. */
+
+ memmove(pDev->key->modifierMap, keyInfo.modMap, MAP_LENGTH);
+ InitModMap(pDev->key);
+ } else DEBUG_LOG("SetKeySymsMap=0\n");
+
+ SendMappingNotify(MappingKeyboard, MIN_KEYCODE, NUM_KEYCODES, 0);
+ SendMappingNotify(MappingModifier, 0, 0, 0);
+}
+
+
+//-----------------------------------------------------------------------------
+// Modifier translation functions
+//
+// There are three different ways to specify a Mac modifier key:
+// keycode - specifies hardware key, read from keymapping
+// key - NX_MODIFIERKEY_*, really an index
+// mask - NX_*MASK, mask for modifier flags in event record
+// Left and right side have different keycodes but the same key and mask.
+//-----------------------------------------------------------------------------
+
+/*
+ * DarwinModifierNXKeyToNXKeycode
+ * Return the keycode for an NX_MODIFIERKEY_* modifier.
+ * side = 0 for left or 1 for right.
+ * Returns 0 if key+side is not a known modifier.
+ */
+int DarwinModifierNXKeyToNXKeycode(int key, int side) {
+ return keyInfo.modifierKeycodes[key][side];
+}
+
+/*
+ * DarwinModifierNXKeycodeToNXKey
+ * Returns -1 if keycode+side is not a modifier key
+ * outSide may be NULL, else it gets 0 for left and 1 for right.
+ */
+int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide) {
+ int key, side;
+
+ keycode += MIN_KEYCODE;
+ // search modifierKeycodes for this keycode+side
+ for (key = 0; key < NX_NUMMODIFIERS; key++) {
+ for (side = 0; side <= 1; side++) {
+ if (keyInfo.modifierKeycodes[key][side] == keycode) break;
+ }
+ }
+ if (key == NX_NUMMODIFIERS) return -1;
+ if (outSide) *outSide = side;
+ return key;
+}
+
+/*
+ * DarwinModifierNXMaskToNXKey
+ * Returns -1 if mask is not a known modifier mask.
+ */
+int DarwinModifierNXMaskToNXKey(int mask) {
+ switch (mask) {
+ case NX_ALPHASHIFTMASK: return NX_MODIFIERKEY_ALPHALOCK;
+ case NX_SHIFTMASK: return NX_MODIFIERKEY_SHIFT;
+#ifdef NX_DEVICELSHIFTKEYMASK
+ case NX_DEVICELSHIFTKEYMASK: return NX_MODIFIERKEY_SHIFT;
+ case NX_DEVICERSHIFTKEYMASK: return NX_MODIFIERKEY_RSHIFT;
+#endif
+ case NX_CONTROLMASK: return NX_MODIFIERKEY_CONTROL;
+#ifdef NX_DEVICELCTLKEYMASK
+ case NX_DEVICELCTLKEYMASK: return NX_MODIFIERKEY_CONTROL;
+ case NX_DEVICERCTLKEYMASK: return NX_MODIFIERKEY_RCONTROL;
+#endif
+ case NX_ALTERNATEMASK: return NX_MODIFIERKEY_ALTERNATE;
+#ifdef NX_DEVICELALTKEYMASK
+ case NX_DEVICELALTKEYMASK: return NX_MODIFIERKEY_ALTERNATE;
+ case NX_DEVICERALTKEYMASK: return NX_MODIFIERKEY_RALTERNATE;
+#endif
+ case NX_COMMANDMASK: return NX_MODIFIERKEY_COMMAND;
+#ifdef NX_DEVICELCMDKEYMASK
+ case NX_DEVICELCMDKEYMASK: return NX_MODIFIERKEY_COMMAND;
+ case NX_DEVICERCMDKEYMASK: return NX_MODIFIERKEY_RCOMMAND;
+#endif
+ case NX_NUMERICPADMASK: return NX_MODIFIERKEY_NUMERICPAD;
+ case NX_HELPMASK: return NX_MODIFIERKEY_HELP;
+ case NX_SECONDARYFNMASK: return NX_MODIFIERKEY_SECONDARYFN;
+ }
+ return -1;
+}
+
+static const char *DarwinModifierNXMaskTostring(int mask) {
+ switch (mask) {
+ case NX_ALPHASHIFTMASK: return "NX_ALPHASHIFTMASK";
+ case NX_SHIFTMASK: return "NX_SHIFTMASK";
+ case NX_DEVICELSHIFTKEYMASK: return "NX_DEVICELSHIFTKEYMASK";
+ case NX_DEVICERSHIFTKEYMASK: return "NX_DEVICERSHIFTKEYMASK";
+ case NX_CONTROLMASK: return "NX_CONTROLMASK";
+ case NX_DEVICELCTLKEYMASK: return "NX_DEVICELCTLKEYMASK";
+ case NX_DEVICERCTLKEYMASK: return "NX_DEVICERCTLKEYMASK";
+ case NX_ALTERNATEMASK: return "NX_ALTERNATEMASK";
+ case NX_DEVICELALTKEYMASK: return "NX_DEVICELALTKEYMASK";
+ case NX_DEVICERALTKEYMASK: return "NX_DEVICERALTKEYMASK";
+ case NX_COMMANDMASK: return "NX_COMMANDMASK";
+ case NX_DEVICELCMDKEYMASK: return "NX_DEVICELCMDKEYMASK";
+ case NX_DEVICERCMDKEYMASK: return "NX_DEVICERCMDKEYMASK";
+ case NX_NUMERICPADMASK: return "NX_NUMERICPADMASK";
+ case NX_HELPMASK: return "NX_HELPMASK";
+ case NX_SECONDARYFNMASK: return "NX_SECONDARYFNMASK";
+ }
+ return "unknown mask";
+}
+
+/*
+ * DarwinModifierNXKeyToNXMask
+ * Returns 0 if key is not a known modifier key.
+ */
+int DarwinModifierNXKeyToNXMask(int key) {
+ switch (key) {
+ case NX_MODIFIERKEY_ALPHALOCK: return NX_ALPHASHIFTMASK;
+ case NX_MODIFIERKEY_SHIFT: return NX_SHIFTMASK;
+#ifdef NX_MODIFIERKEY_RSHIFT
+ case NX_MODIFIERKEY_RSHIFT: return NX_SHIFTMASK;
+#endif
+ case NX_MODIFIERKEY_CONTROL: return NX_CONTROLMASK;
+#ifdef NX_MODIFIERKEY_RCONTROL
+ case NX_MODIFIERKEY_RCONTROL: return NX_CONTROLMASK;
+#endif
+ case NX_MODIFIERKEY_ALTERNATE: return NX_ALTERNATEMASK;
+#ifdef NX_MODIFIERKEY_RALTERNATE
+ case NX_MODIFIERKEY_RALTERNATE: return NX_ALTERNATEMASK;
+#endif
+ case NX_MODIFIERKEY_COMMAND: return NX_COMMANDMASK;
+#ifdef NX_MODIFIERKEY_RCOMMAND
+ case NX_MODIFIERKEY_RCOMMAND: return NX_COMMANDMASK;
+#endif
+ case NX_MODIFIERKEY_NUMERICPAD: return NX_NUMERICPADMASK;
+ case NX_MODIFIERKEY_HELP: return NX_HELPMASK;
+ case NX_MODIFIERKEY_SECONDARYFN: return NX_SECONDARYFNMASK;
+ }
+ return 0;
+}
+
+/*
+ * DarwinModifierStringToNXKey
+ * Returns -1 if string is not a known modifier.
+ */
+int DarwinModifierStringToNXKey(const char *str) {
+ if (!strcasecmp(str, "shift")) return NX_MODIFIERKEY_SHIFT;
+ else if (!strcasecmp(str, "control")) return NX_MODIFIERKEY_CONTROL;
+ else if (!strcasecmp(str, "option")) return NX_MODIFIERKEY_ALTERNATE;
+ else if (!strcasecmp(str, "command")) return NX_MODIFIERKEY_COMMAND;
+ else if (!strcasecmp(str, "fn")) return NX_MODIFIERKEY_SECONDARYFN;
+ else return -1;
+}
+
+/*
+ * LegalModifier
+ * This allows the ddx layer to prevent some keys from being remapped
+ * as modifier keys.
+ */
+Bool LegalModifier(unsigned int key, DeviceIntPtr pDev)
+{
+ return 1;
+}
diff --git a/xorg-server/hw/xquartz/darwinKeyboard.h b/xorg-server/hw/xquartz/darwinKeyboard.h
new file mode 100644
index 000000000..5cf64c7d1
--- /dev/null
+++ b/xorg-server/hw/xquartz/darwinKeyboard.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2003-2004 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifndef DARWIN_KEYBOARD_H
+#define DARWIN_KEYBOARD_H 1
+
+#include "quartzKeyboard.h"
+
+/* Provided for darwinEvents.c */
+extern darwinKeyboardInfo keyInfo;
+void DarwinKeyboardReload(DeviceIntPtr pDev);
+void DarwinKeyboardInit(DeviceIntPtr pDev);
+int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide);
+int DarwinModifierNXKeyToNXKeycode(int key, int side);
+int DarwinModifierNXKeyToNXMask(int key);
+int DarwinModifierNXMaskToNXKey(int mask);
+int DarwinModifierStringToNXKey(const char *string);
+
+/* Provided for darwin.c */
+void DarwinKeyboardInit(DeviceIntPtr pDev);
+
+#endif /* DARWIN_KEYBOARD_H */
diff --git a/xorg-server/hw/xquartz/darwinXinput.c b/xorg-server/hw/xquartz/darwinXinput.c
new file mode 100644
index 000000000..e62ec0ab6
--- /dev/null
+++ b/xorg-server/hw/xquartz/darwinXinput.c
@@ -0,0 +1,309 @@
+
+/*
+ * X server support of the XINPUT extension for Darwin
+ *
+ * This is currently a copy of mi/stubs.c, but eventually this
+ * should include more complete XINPUT support.
+ */
+
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#define NEED_EVENTS
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "inputstr.h"
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "XIstubs.h"
+#include "chgkbd.h"
+
+/***********************************************************************
+ *
+ * Caller: ProcXChangeKeyboardDevice
+ *
+ * This procedure does the implementation-dependent portion of the work
+ * needed to change the keyboard device.
+ *
+ * The X keyboard device has a FocusRec. If the device that has been
+ * made into the new X keyboard did not have a FocusRec,
+ * ProcXChangeKeyboardDevice will allocate one for it.
+ *
+ * If you do not want clients to be able to focus the old X keyboard
+ * device, call DeleteFocusClassDeviceStruct to free the FocusRec.
+ *
+ * If you support input devices with keys that you do not want to be
+ * used as the X keyboard, you need to check for them here and return
+ * a BadDevice error.
+ *
+ * The default implementation is to do nothing (assume you do want
+ * clients to be able to focus the old X keyboard). The commented-out
+ * sample code shows what you might do if you don't want the default.
+ *
+ */
+
+int ChangeKeyboardDevice (DeviceIntPtr old_dev, DeviceIntPtr new_dev) {
+ /***********************************************************************
+ DeleteFocusClassDeviceStruct(old_dev); * defined in xchgptr.c *
+ **********************************************************************/
+ return BadMatch;
+}
+
+
+/***********************************************************************
+ *
+ * Caller: ProcXChangePointerDevice
+ *
+ * This procedure does the implementation-dependent portion of the work
+ * needed to change the pointer device.
+ *
+ * The X pointer device does not have a FocusRec. If the device that
+ * has been made into the new X pointer had a FocusRec,
+ * ProcXChangePointerDevice will free it.
+ *
+ * If you want clients to be able to focus the old pointer device that
+ * has now become accessible through the input extension, you need to
+ * add a FocusRec to it here.
+ *
+ * The XChangePointerDevice protocol request also allows the client
+ * to choose which axes of the new pointer device are used to move
+ * the X cursor in the X- and Y- directions. If the axes are different
+ * than the default ones, you need to keep track of that here.
+ *
+ * If you support input devices with valuators that you do not want to be
+ * used as the X pointer, you need to check for them here and return a
+ * BadDevice error.
+ *
+ * The default implementation is to do nothing (assume you don't want
+ * clients to be able to focus the old X pointer). The commented-out
+ * sample code shows what you might do if you don't want the default.
+ *
+ */
+
+int
+ChangePointerDevice (
+ DeviceIntPtr old_dev,
+ DeviceIntPtr new_dev,
+ unsigned char x,
+ unsigned char y)
+ {
+ /***********************************************************************
+ InitFocusClassDeviceStruct(old_dev); * allow focusing old ptr*
+
+ x_axis = x; * keep track of new x-axis*
+ y_axis = y; * keep track of new y-axis*
+ if (x_axis != 0 || y_axis != 1)
+ axes_changed = TRUE; * remember axes have changed*
+ else
+ axes_changed = FALSE;
+ *************************************************************************/
+ return BadMatch;
+ }
+
+/***********************************************************************
+ *
+ * Caller: ProcXCloseDevice
+ *
+ * Take care of implementation-dependent details of closing a device.
+ * Some implementations may actually close the device, others may just
+ * remove this clients interest in that device.
+ *
+ * The default implementation is to do nothing (assume all input devices
+ * are initialized during X server initialization and kept open).
+ *
+ */
+
+void
+CloseInputDevice (d, client)
+ DeviceIntPtr d;
+ ClientPtr client;
+ {
+ }
+
+/***********************************************************************
+ *
+ * Caller: ProcXListInputDevices
+ *
+ * This is the implementation-dependent routine to initialize an input
+ * device to the point that information about it can be listed.
+ * Some implementations open all input devices when the server is first
+ * initialized, and never close them. Other implementations open only
+ * the X pointer and keyboard devices during server initialization,
+ * and only open other input devices when some client makes an
+ * XOpenDevice request. If some other process has the device open, the
+ * server may not be able to get information about the device to list it.
+ *
+ * This procedure should be used by implementations that do not initialize
+ * all input devices at server startup. It should do device-dependent
+ * initialization for any devices not previously initialized, and call
+ * AddInputDevice for each of those devices so that a DeviceIntRec will be
+ * created for them.
+ *
+ * The default implementation is to do nothing (assume all input devices
+ * are initialized during X server initialization and kept open).
+ * The commented-out sample code shows what you might do if you don't want
+ * the default.
+ *
+ */
+
+void
+AddOtherInputDevices ()
+ {
+ /**********************************************************************
+ for each uninitialized device, do something like:
+
+ DeviceIntPtr dev;
+ DeviceProc deviceProc;
+ pointer private;
+
+ dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE);
+ dev->public.devicePrivate = private;
+ RegisterOtherDevice(dev);
+ dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
+ ************************************************************************/
+
+ }
+
+/***********************************************************************
+ *
+ * Caller: ProcXOpenDevice
+ *
+ * This is the implementation-dependent routine to open an input device.
+ * Some implementations open all input devices when the server is first
+ * initialized, and never close them. Other implementations open only
+ * the X pointer and keyboard devices during server initialization,
+ * and only open other input devices when some client makes an
+ * XOpenDevice request. This entry point is for the latter type of
+ * implementation.
+ *
+ * If the physical device is not already open, do it here. In this case,
+ * you need to keep track of the fact that one or more clients has the
+ * device open, and physically close it when the last client that has
+ * it open does an XCloseDevice.
+ *
+ * The default implementation is to do nothing (assume all input devices
+ * are opened during X server initialization and kept open).
+ *
+ */
+
+void
+OpenInputDevice (dev, client, status)
+ DeviceIntPtr dev;
+ ClientPtr client;
+ int *status;
+ {
+ }
+
+/****************************************************************************
+ *
+ * Caller: ProcXSetDeviceMode
+ *
+ * Change the mode of an extension device.
+ * This function is used to change the mode of a device from reporting
+ * relative motion to reporting absolute positional information, and
+ * vice versa.
+ * The default implementation below is that no such devices are supported.
+ *
+ */
+
+int
+SetDeviceMode (client, dev, mode)
+ register ClientPtr client;
+ DeviceIntPtr dev;
+ int mode;
+ {
+ return BadMatch;
+ }
+
+/****************************************************************************
+ *
+ * Caller: ProcXSetDeviceValuators
+ *
+ * Set the value of valuators on an extension input device.
+ * This function is used to set the initial value of valuators on
+ * those input devices that are capable of reporting either relative
+ * motion or an absolute position, and allow an initial position to be set.
+ * The default implementation below is that no such devices are supported.
+ *
+ */
+
+int
+SetDeviceValuators (client, dev, valuators, first_valuator, num_valuators)
+ register ClientPtr client;
+ DeviceIntPtr dev;
+ int *valuators;
+ int first_valuator;
+ int num_valuators;
+ {
+ return BadMatch;
+ }
+
+/****************************************************************************
+ *
+ * Caller: ProcXChangeDeviceControl
+ *
+ * Change the specified device controls on an extension input device.
+ *
+ */
+
+int
+ChangeDeviceControl (client, dev, control)
+ register ClientPtr client;
+ DeviceIntPtr dev;
+ xDeviceCtl *control;
+ {
+ switch (control->control)
+ {
+ case DEVICE_RESOLUTION:
+ return (BadMatch);
+ default:
+ return (BadMatch);
+ }
+ }
diff --git a/xorg-server/hw/xquartz/keysym2ucs.c b/xorg-server/hw/xquartz/keysym2ucs.c
new file mode 100644
index 000000000..8626ebc4e
--- /dev/null
+++ b/xorg-server/hw/xquartz/keysym2ucs.c
@@ -0,0 +1,909 @@
+/*
+ *
+ * This module converts keysym values into the corresponding ISO 10646
+ * (UCS, Unicode) values.
+ *
+ * The array keysymtab[] contains pairs of X11 keysym values for graphical
+ * characters and the corresponding Unicode value. The function
+ * keysym2ucs() maps a keysym onto a Unicode value using a binary search,
+ * therefore keysymtab[] must remain SORTED by keysym value.
+ *
+ * The keysym -> UTF-8 conversion will hopefully one day be provided
+ * by Xlib via XmbLookupString() and should ideally not have to be
+ * done in X applications. But we are not there yet.
+ *
+ * We allow to represent any UCS character in the range U-00000000 to
+ * U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff.
+ * This admittedly does not cover the entire 31-bit space of UCS, but
+ * it does cover all of the characters up to U-10FFFF, which can be
+ * represented by UTF-16, and more, and it is very unlikely that higher
+ * UCS codes will ever be assigned by ISO. So to get Unicode character
+ * U+ABCD you can directly use keysym 0x0100abcd.
+ *
+ * NOTE: The comments in the table below contain the actual character
+ * encoded in UTF-8, so for viewing and editing best use an editor in
+ * UTF-8 mode.
+ *
+ * Author: Markus G. Kuhn <mkuhn@acm.org>, University of Cambridge, April 2001
+ *
+ * Special thanks to Richard Verhoeven <river@win.tue.nl> for preparing
+ * an initial draft of the mapping table.
+ *
+ * This software is in the public domain. Share and enjoy!
+ *
+ * AUTOMATICALLY GENERATED FILE, DO NOT EDIT !!! (unicode/convmap.pl)
+ */
+
+#include "keysym2ucs.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+struct codepair {
+ unsigned short keysym;
+ unsigned short ucs;
+};
+
+const static struct codepair keysymtab[] = {
+ { 0x01a1, 0x0104 },
+ { 0x01a2, 0x02d8 },
+ { 0x01a3, 0x0141 },
+ { 0x01a5, 0x013d },
+ { 0x01a6, 0x015a },
+ { 0x01a9, 0x0160 },
+ { 0x01aa, 0x015e },
+ { 0x01ab, 0x0164 },
+ { 0x01ac, 0x0179 },
+ { 0x01ae, 0x017d },
+ { 0x01af, 0x017b },
+ { 0x01b1, 0x0105 },
+ { 0x01b2, 0x02db },
+ { 0x01b3, 0x0142 },
+ { 0x01b5, 0x013e },
+ { 0x01b6, 0x015b },
+ { 0x01b7, 0x02c7 },
+ { 0x01b9, 0x0161 },
+ { 0x01ba, 0x015f },
+ { 0x01bb, 0x0165 },
+ { 0x01bc, 0x017a },
+ { 0x01bd, 0x02dd },
+ { 0x01be, 0x017e },
+ { 0x01bf, 0x017c },
+ { 0x01c0, 0x0154 },
+ { 0x01c3, 0x0102 },
+ { 0x01c5, 0x0139 },
+ { 0x01c6, 0x0106 },
+ { 0x01c8, 0x010c },
+ { 0x01ca, 0x0118 },
+ { 0x01cc, 0x011a },
+ { 0x01cf, 0x010e },
+ { 0x01d0, 0x0110 },
+ { 0x01d1, 0x0143 },
+ { 0x01d2, 0x0147 },
+ { 0x01d5, 0x0150 },
+ { 0x01d8, 0x0158 },
+ { 0x01d9, 0x016e },
+ { 0x01db, 0x0170 },
+ { 0x01de, 0x0162 },
+ { 0x01e0, 0x0155 },
+ { 0x01e3, 0x0103 },
+ { 0x01e5, 0x013a },
+ { 0x01e6, 0x0107 },
+ { 0x01e8, 0x010d },
+ { 0x01ea, 0x0119 },
+ { 0x01ec, 0x011b },
+ { 0x01ef, 0x010f },
+ { 0x01f0, 0x0111 },
+ { 0x01f1, 0x0144 },
+ { 0x01f2, 0x0148 },
+ { 0x01f5, 0x0151 },
+ { 0x01f8, 0x0159 },
+ { 0x01f9, 0x016f },
+ { 0x01fb, 0x0171 },
+ { 0x01fe, 0x0163 },
+ { 0x01ff, 0x02d9 },
+ { 0x02a1, 0x0126 },
+ { 0x02a6, 0x0124 },
+ { 0x02a9, 0x0130 },
+ { 0x02ab, 0x011e },
+ { 0x02ac, 0x0134 },
+ { 0x02b1, 0x0127 },
+ { 0x02b6, 0x0125 },
+ { 0x02b9, 0x0131 },
+ { 0x02bb, 0x011f },
+ { 0x02bc, 0x0135 },
+ { 0x02c5, 0x010a },
+ { 0x02c6, 0x0108 },
+ { 0x02d5, 0x0120 },
+ { 0x02d8, 0x011c },
+ { 0x02dd, 0x016c },
+ { 0x02de, 0x015c },
+ { 0x02e5, 0x010b },
+ { 0x02e6, 0x0109 },
+ { 0x02f5, 0x0121 },
+ { 0x02f8, 0x011d },
+ { 0x02fd, 0x016d },
+ { 0x02fe, 0x015d },
+ { 0x03a2, 0x0138 },
+ { 0x03a3, 0x0156 },
+ { 0x03a5, 0x0128 },
+ { 0x03a6, 0x013b },
+ { 0x03aa, 0x0112 },
+ { 0x03ab, 0x0122 },
+ { 0x03ac, 0x0166 },
+ { 0x03b3, 0x0157 },
+ { 0x03b5, 0x0129 },
+ { 0x03b6, 0x013c },
+ { 0x03ba, 0x0113 },
+ { 0x03bb, 0x0123 },
+ { 0x03bc, 0x0167 },
+ { 0x03bd, 0x014a },
+ { 0x03bf, 0x014b },
+ { 0x03c0, 0x0100 },
+ { 0x03c7, 0x012e },
+ { 0x03cc, 0x0116 },
+ { 0x03cf, 0x012a },
+ { 0x03d1, 0x0145 },
+ { 0x03d2, 0x014c },
+ { 0x03d3, 0x0136 },
+ { 0x03d9, 0x0172 },
+ { 0x03dd, 0x0168 },
+ { 0x03de, 0x016a },
+ { 0x03e0, 0x0101 },
+ { 0x03e7, 0x012f },
+ { 0x03ec, 0x0117 },
+ { 0x03ef, 0x012b },
+ { 0x03f1, 0x0146 },
+ { 0x03f2, 0x014d },
+ { 0x03f3, 0x0137 },
+ { 0x03f9, 0x0173 },
+ { 0x03fd, 0x0169 },
+ { 0x03fe, 0x016b },
+ { 0x047e, 0x203e },
+ { 0x04a1, 0x3002 },
+ { 0x04a2, 0x300c },
+ { 0x04a3, 0x300d },
+ { 0x04a4, 0x3001 },
+ { 0x04a5, 0x30fb },
+ { 0x04a6, 0x30f2 },
+ { 0x04a7, 0x30a1 },
+ { 0x04a8, 0x30a3 },
+ { 0x04a9, 0x30a5 },
+ { 0x04aa, 0x30a7 },
+ { 0x04ab, 0x30a9 },
+ { 0x04ac, 0x30e3 },
+ { 0x04ad, 0x30e5 },
+ { 0x04ae, 0x30e7 },
+ { 0x04af, 0x30c3 },
+ { 0x04b0, 0x30fc },
+ { 0x04b1, 0x30a2 },
+ { 0x04b2, 0x30a4 },
+ { 0x04b3, 0x30a6 },
+ { 0x04b4, 0x30a8 },
+ { 0x04b5, 0x30aa },
+ { 0x04b6, 0x30ab },
+ { 0x04b7, 0x30ad },
+ { 0x04b8, 0x30af },
+ { 0x04b9, 0x30b1 },
+ { 0x04ba, 0x30b3 },
+ { 0x04bb, 0x30b5 },
+ { 0x04bc, 0x30b7 },
+ { 0x04bd, 0x30b9 },
+ { 0x04be, 0x30bb },
+ { 0x04bf, 0x30bd },
+ { 0x04c0, 0x30bf },
+ { 0x04c1, 0x30c1 },
+ { 0x04c2, 0x30c4 },
+ { 0x04c3, 0x30c6 },
+ { 0x04c4, 0x30c8 },
+ { 0x04c5, 0x30ca },
+ { 0x04c6, 0x30cb },
+ { 0x04c7, 0x30cc },
+ { 0x04c8, 0x30cd },
+ { 0x04c9, 0x30ce },
+ { 0x04ca, 0x30cf },
+ { 0x04cb, 0x30d2 },
+ { 0x04cc, 0x30d5 },
+ { 0x04cd, 0x30d8 },
+ { 0x04ce, 0x30db },
+ { 0x04cf, 0x30de },
+ { 0x04d0, 0x30df },
+ { 0x04d1, 0x30e0 },
+ { 0x04d2, 0x30e1 },
+ { 0x04d3, 0x30e2 },
+ { 0x04d4, 0x30e4 },
+ { 0x04d5, 0x30e6 },
+ { 0x04d6, 0x30e8 },
+ { 0x04d7, 0x30e9 },
+ { 0x04d8, 0x30ea },
+ { 0x04d9, 0x30eb },
+ { 0x04da, 0x30ec },
+ { 0x04db, 0x30ed },
+ { 0x04dc, 0x30ef },
+ { 0x04dd, 0x30f3 },
+ { 0x04de, 0x309b },
+ { 0x04df, 0x309c },
+ { 0x05ac, 0x060c },
+ { 0x05bb, 0x061b },
+ { 0x05bf, 0x061f },
+ { 0x05c1, 0x0621 },
+ { 0x05c2, 0x0622 },
+ { 0x05c3, 0x0623 },
+ { 0x05c4, 0x0624 },
+ { 0x05c5, 0x0625 },
+ { 0x05c6, 0x0626 },
+ { 0x05c7, 0x0627 },
+ { 0x05c8, 0x0628 },
+ { 0x05c9, 0x0629 },
+ { 0x05ca, 0x062a },
+ { 0x05cb, 0x062b },
+ { 0x05cc, 0x062c },
+ { 0x05cd, 0x062d },
+ { 0x05ce, 0x062e },
+ { 0x05cf, 0x062f },
+ { 0x05d0, 0x0630 },
+ { 0x05d1, 0x0631 },
+ { 0x05d2, 0x0632 },
+ { 0x05d3, 0x0633 },
+ { 0x05d4, 0x0634 },
+ { 0x05d5, 0x0635 },
+ { 0x05d6, 0x0636 },
+ { 0x05d7, 0x0637 },
+ { 0x05d8, 0x0638 },
+ { 0x05d9, 0x0639 },
+ { 0x05da, 0x063a },
+ { 0x05e0, 0x0640 },
+ { 0x05e1, 0x0641 },
+ { 0x05e2, 0x0642 },
+ { 0x05e3, 0x0643 },
+ { 0x05e4, 0x0644 },
+ { 0x05e5, 0x0645 },
+ { 0x05e6, 0x0646 },
+ { 0x05e7, 0x0647 },
+ { 0x05e8, 0x0648 },
+ { 0x05e9, 0x0649 },
+ { 0x05ea, 0x064a },
+ { 0x05eb, 0x064b },
+ { 0x05ec, 0x064c },
+ { 0x05ed, 0x064d },
+ { 0x05ee, 0x064e },
+ { 0x05ef, 0x064f },
+ { 0x05f0, 0x0650 },
+ { 0x05f1, 0x0651 },
+ { 0x05f2, 0x0652 },
+ { 0x06a1, 0x0452 },
+ { 0x06a2, 0x0453 },
+ { 0x06a3, 0x0451 },
+ { 0x06a4, 0x0454 },
+ { 0x06a5, 0x0455 },
+ { 0x06a6, 0x0456 },
+ { 0x06a7, 0x0457 },
+ { 0x06a8, 0x0458 },
+ { 0x06a9, 0x0459 },
+ { 0x06aa, 0x045a },
+ { 0x06ab, 0x045b },
+ { 0x06ac, 0x045c },
+ { 0x06ae, 0x045e },
+ { 0x06af, 0x045f },
+ { 0x06b0, 0x2116 },
+ { 0x06b1, 0x0402 },
+ { 0x06b2, 0x0403 },
+ { 0x06b3, 0x0401 },
+ { 0x06b4, 0x0404 },
+ { 0x06b5, 0x0405 },
+ { 0x06b6, 0x0406 },
+ { 0x06b7, 0x0407 },
+ { 0x06b8, 0x0408 },
+ { 0x06b9, 0x0409 },
+ { 0x06ba, 0x040a },
+ { 0x06bb, 0x040b },
+ { 0x06bc, 0x040c },
+ { 0x06be, 0x040e },
+ { 0x06bf, 0x040f },
+ { 0x06c0, 0x044e },
+ { 0x06c1, 0x0430 },
+ { 0x06c2, 0x0431 },
+ { 0x06c3, 0x0446 },
+ { 0x06c4, 0x0434 },
+ { 0x06c5, 0x0435 },
+ { 0x06c6, 0x0444 },
+ { 0x06c7, 0x0433 },
+ { 0x06c8, 0x0445 },
+ { 0x06c9, 0x0438 },
+ { 0x06ca, 0x0439 },
+ { 0x06cb, 0x043a },
+ { 0x06cc, 0x043b },
+ { 0x06cd, 0x043c },
+ { 0x06ce, 0x043d },
+ { 0x06cf, 0x043e },
+ { 0x06d0, 0x043f },
+ { 0x06d1, 0x044f },
+ { 0x06d2, 0x0440 },
+ { 0x06d3, 0x0441 },
+ { 0x06d4, 0x0442 },
+ { 0x06d5, 0x0443 },
+ { 0x06d6, 0x0436 },
+ { 0x06d7, 0x0432 },
+ { 0x06d8, 0x044c },
+ { 0x06d9, 0x044b },
+ { 0x06da, 0x0437 },
+ { 0x06db, 0x0448 },
+ { 0x06dc, 0x044d },
+ { 0x06dd, 0x0449 },
+ { 0x06de, 0x0447 },
+ { 0x06df, 0x044a },
+ { 0x06e0, 0x042e },
+ { 0x06e1, 0x0410 },
+ { 0x06e2, 0x0411 },
+ { 0x06e3, 0x0426 },
+ { 0x06e4, 0x0414 },
+ { 0x06e5, 0x0415 },
+ { 0x06e6, 0x0424 },
+ { 0x06e7, 0x0413 },
+ { 0x06e8, 0x0425 },
+ { 0x06e9, 0x0418 },
+ { 0x06ea, 0x0419 },
+ { 0x06eb, 0x041a },
+ { 0x06ec, 0x041b },
+ { 0x06ed, 0x041c },
+ { 0x06ee, 0x041d },
+ { 0x06ef, 0x041e },
+ { 0x06f0, 0x041f },
+ { 0x06f1, 0x042f },
+ { 0x06f2, 0x0420 },
+ { 0x06f3, 0x0421 },
+ { 0x06f4, 0x0422 },
+ { 0x06f5, 0x0423 },
+ { 0x06f6, 0x0416 },
+ { 0x06f7, 0x0412 },
+ { 0x06f8, 0x042c },
+ { 0x06f9, 0x042b },
+ { 0x06fa, 0x0417 },
+ { 0x06fb, 0x0428 },
+ { 0x06fc, 0x042d },
+ { 0x06fd, 0x0429 },
+ { 0x06fe, 0x0427 },
+ { 0x06ff, 0x042a },
+ { 0x07a1, 0x0386 },
+ { 0x07a2, 0x0388 },
+ { 0x07a3, 0x0389 },
+ { 0x07a4, 0x038a },
+ { 0x07a5, 0x03aa },
+ { 0x07a7, 0x038c },
+ { 0x07a8, 0x038e },
+ { 0x07a9, 0x03ab },
+ { 0x07ab, 0x038f },
+ { 0x07ae, 0x0385 },
+ { 0x07af, 0x2015 },
+ { 0x07b1, 0x03ac },
+ { 0x07b2, 0x03ad },
+ { 0x07b3, 0x03ae },
+ { 0x07b4, 0x03af },
+ { 0x07b5, 0x03ca },
+ { 0x07b6, 0x0390 },
+ { 0x07b7, 0x03cc },
+ { 0x07b8, 0x03cd },
+ { 0x07b9, 0x03cb },
+ { 0x07ba, 0x03b0 },
+ { 0x07bb, 0x03ce },
+ { 0x07c1, 0x0391 },
+ { 0x07c2, 0x0392 },
+ { 0x07c3, 0x0393 },
+ { 0x07c4, 0x0394 },
+ { 0x07c5, 0x0395 },
+ { 0x07c6, 0x0396 },
+ { 0x07c7, 0x0397 },
+ { 0x07c8, 0x0398 },
+ { 0x07c9, 0x0399 },
+ { 0x07ca, 0x039a },
+ { 0x07cb, 0x039b },
+ { 0x07cc, 0x039c },
+ { 0x07cd, 0x039d },
+ { 0x07ce, 0x039e },
+ { 0x07cf, 0x039f },
+ { 0x07d0, 0x03a0 },
+ { 0x07d1, 0x03a1 },
+ { 0x07d2, 0x03a3 },
+ { 0x07d4, 0x03a4 },
+ { 0x07d5, 0x03a5 },
+ { 0x07d6, 0x03a6 },
+ { 0x07d7, 0x03a7 },
+ { 0x07d8, 0x03a8 },
+ { 0x07d9, 0x03a9 },
+ { 0x07e1, 0x03b1 },
+ { 0x07e2, 0x03b2 },
+ { 0x07e3, 0x03b3 },
+ { 0x07e4, 0x03b4 },
+ { 0x07e5, 0x03b5 },
+ { 0x07e6, 0x03b6 },
+ { 0x07e7, 0x03b7 },
+ { 0x07e8, 0x03b8 },
+ { 0x07e9, 0x03b9 },
+ { 0x07ea, 0x03ba },
+ { 0x07eb, 0x03bb },
+ { 0x07ec, 0x03bc },
+ { 0x07ed, 0x03bd },
+ { 0x07ee, 0x03be },
+ { 0x07ef, 0x03bf },
+ { 0x07f0, 0x03c0 },
+ { 0x07f1, 0x03c1 },
+ { 0x07f2, 0x03c3 },
+ { 0x07f3, 0x03c2 },
+ { 0x07f4, 0x03c4 },
+ { 0x07f5, 0x03c5 },
+ { 0x07f6, 0x03c6 },
+ { 0x07f7, 0x03c7 },
+ { 0x07f8, 0x03c8 },
+ { 0x07f9, 0x03c9 },
+ { 0x08a1, 0x23b7 },
+ { 0x08a2, 0x250c },
+ { 0x08a3, 0x2500 },
+ { 0x08a4, 0x2320 },
+ { 0x08a5, 0x2321 },
+ { 0x08a6, 0x2502 },
+ { 0x08a7, 0x23a1 },
+ { 0x08a8, 0x23a3 },
+ { 0x08a9, 0x23a4 },
+ { 0x08aa, 0x23a6 },
+ { 0x08ab, 0x239b },
+ { 0x08ac, 0x239d },
+ { 0x08ad, 0x239e },
+ { 0x08ae, 0x23a0 },
+ { 0x08af, 0x23a8 },
+ { 0x08b0, 0x23ac },
+ { 0x08bc, 0x2264 },
+ { 0x08bd, 0x2260 },
+ { 0x08be, 0x2265 },
+ { 0x08bf, 0x222b },
+ { 0x08c0, 0x2234 },
+ { 0x08c1, 0x221d },
+ { 0x08c2, 0x221e },
+ { 0x08c5, 0x2207 },
+ { 0x08c8, 0x223c },
+ { 0x08c9, 0x2243 },
+ { 0x08cd, 0x21d4 },
+ { 0x08ce, 0x21d2 },
+ { 0x08cf, 0x2261 },
+ { 0x08d6, 0x221a },
+ { 0x08da, 0x2282 },
+ { 0x08db, 0x2283 },
+ { 0x08dc, 0x2229 },
+ { 0x08dd, 0x222a },
+ { 0x08de, 0x2227 },
+ { 0x08df, 0x2228 },
+ { 0x08ef, 0x2202 },
+ { 0x08f6, 0x0192 },
+ { 0x08fb, 0x2190 },
+ { 0x08fc, 0x2191 },
+ { 0x08fd, 0x2192 },
+ { 0x08fe, 0x2193 },
+ { 0x09e0, 0x25c6 },
+ { 0x09e1, 0x2592 },
+ { 0x09e2, 0x2409 },
+ { 0x09e3, 0x240c },
+ { 0x09e4, 0x240d },
+ { 0x09e5, 0x240a },
+ { 0x09e8, 0x2424 },
+ { 0x09e9, 0x240b },
+ { 0x09ea, 0x2518 },
+ { 0x09eb, 0x2510 },
+ { 0x09ec, 0x250c },
+ { 0x09ed, 0x2514 },
+ { 0x09ee, 0x253c },
+ { 0x09ef, 0x23ba },
+ { 0x09f0, 0x23bb },
+ { 0x09f1, 0x2500 },
+ { 0x09f2, 0x23bc },
+ { 0x09f3, 0x23bd },
+ { 0x09f4, 0x251c },
+ { 0x09f5, 0x2524 },
+ { 0x09f6, 0x2534 },
+ { 0x09f7, 0x252c },
+ { 0x09f8, 0x2502 },
+ { 0x0aa1, 0x2003 },
+ { 0x0aa2, 0x2002 },
+ { 0x0aa3, 0x2004 },
+ { 0x0aa4, 0x2005 },
+ { 0x0aa5, 0x2007 },
+ { 0x0aa6, 0x2008 },
+ { 0x0aa7, 0x2009 },
+ { 0x0aa8, 0x200a },
+ { 0x0aa9, 0x2014 },
+ { 0x0aaa, 0x2013 },
+ { 0x0aae, 0x2026 },
+ { 0x0aaf, 0x2025 },
+ { 0x0ab0, 0x2153 },
+ { 0x0ab1, 0x2154 },
+ { 0x0ab2, 0x2155 },
+ { 0x0ab3, 0x2156 },
+ { 0x0ab4, 0x2157 },
+ { 0x0ab5, 0x2158 },
+ { 0x0ab6, 0x2159 },
+ { 0x0ab7, 0x215a },
+ { 0x0ab8, 0x2105 },
+ { 0x0abb, 0x2012 },
+ { 0x0abc, 0x2329 },
+ { 0x0abe, 0x232a },
+ { 0x0ac3, 0x215b },
+ { 0x0ac4, 0x215c },
+ { 0x0ac5, 0x215d },
+ { 0x0ac6, 0x215e },
+ { 0x0ac9, 0x2122 },
+ { 0x0aca, 0x2613 },
+ { 0x0acc, 0x25c1 },
+ { 0x0acd, 0x25b7 },
+ { 0x0ace, 0x25cb },
+ { 0x0acf, 0x25af },
+ { 0x0ad0, 0x2018 },
+ { 0x0ad1, 0x2019 },
+ { 0x0ad2, 0x201c },
+ { 0x0ad3, 0x201d },
+ { 0x0ad4, 0x211e },
+ { 0x0ad6, 0x2032 },
+ { 0x0ad7, 0x2033 },
+ { 0x0ad9, 0x271d },
+ { 0x0adb, 0x25ac },
+ { 0x0adc, 0x25c0 },
+ { 0x0add, 0x25b6 },
+ { 0x0ade, 0x25cf },
+ { 0x0adf, 0x25ae },
+ { 0x0ae0, 0x25e6 },
+ { 0x0ae1, 0x25ab },
+ { 0x0ae2, 0x25ad },
+ { 0x0ae3, 0x25b3 },
+ { 0x0ae4, 0x25bd },
+ { 0x0ae5, 0x2606 },
+ { 0x0ae6, 0x2022 },
+ { 0x0ae7, 0x25aa },
+ { 0x0ae8, 0x25b2 },
+ { 0x0ae9, 0x25bc },
+ { 0x0aea, 0x261c },
+ { 0x0aeb, 0x261e },
+ { 0x0aec, 0x2663 },
+ { 0x0aed, 0x2666 },
+ { 0x0aee, 0x2665 },
+ { 0x0af0, 0x2720 },
+ { 0x0af1, 0x2020 },
+ { 0x0af2, 0x2021 },
+ { 0x0af3, 0x2713 },
+ { 0x0af4, 0x2717 },
+ { 0x0af5, 0x266f },
+ { 0x0af6, 0x266d },
+ { 0x0af7, 0x2642 },
+ { 0x0af8, 0x2640 },
+ { 0x0af9, 0x260e },
+ { 0x0afa, 0x2315 },
+ { 0x0afb, 0x2117 },
+ { 0x0afc, 0x2038 },
+ { 0x0afd, 0x201a },
+ { 0x0afe, 0x201e },
+ { 0x0ba3, 0x003c },
+ { 0x0ba6, 0x003e },
+ { 0x0ba8, 0x2228 },
+ { 0x0ba9, 0x2227 },
+ { 0x0bc0, 0x00af },
+ { 0x0bc2, 0x22a5 },
+ { 0x0bc3, 0x2229 },
+ { 0x0bc4, 0x230a },
+ { 0x0bc6, 0x005f },
+ { 0x0bca, 0x2218 },
+ { 0x0bcc, 0x2395 },
+ { 0x0bce, 0x22a4 },
+ { 0x0bcf, 0x25cb },
+ { 0x0bd3, 0x2308 },
+ { 0x0bd6, 0x222a },
+ { 0x0bd8, 0x2283 },
+ { 0x0bda, 0x2282 },
+ { 0x0bdc, 0x22a2 },
+ { 0x0bfc, 0x22a3 },
+ { 0x0cdf, 0x2017 },
+ { 0x0ce0, 0x05d0 },
+ { 0x0ce1, 0x05d1 },
+ { 0x0ce2, 0x05d2 },
+ { 0x0ce3, 0x05d3 },
+ { 0x0ce4, 0x05d4 },
+ { 0x0ce5, 0x05d5 },
+ { 0x0ce6, 0x05d6 },
+ { 0x0ce7, 0x05d7 },
+ { 0x0ce8, 0x05d8 },
+ { 0x0ce9, 0x05d9 },
+ { 0x0cea, 0x05da },
+ { 0x0ceb, 0x05db },
+ { 0x0cec, 0x05dc },
+ { 0x0ced, 0x05dd },
+ { 0x0cee, 0x05de },
+ { 0x0cef, 0x05df },
+ { 0x0cf0, 0x05e0 },
+ { 0x0cf1, 0x05e1 },
+ { 0x0cf2, 0x05e2 },
+ { 0x0cf3, 0x05e3 },
+ { 0x0cf4, 0x05e4 },
+ { 0x0cf5, 0x05e5 },
+ { 0x0cf6, 0x05e6 },
+ { 0x0cf7, 0x05e7 },
+ { 0x0cf8, 0x05e8 },
+ { 0x0cf9, 0x05e9 },
+ { 0x0cfa, 0x05ea },
+ { 0x0da1, 0x0e01 },
+ { 0x0da2, 0x0e02 },
+ { 0x0da3, 0x0e03 },
+ { 0x0da4, 0x0e04 },
+ { 0x0da5, 0x0e05 },
+ { 0x0da6, 0x0e06 },
+ { 0x0da7, 0x0e07 },
+ { 0x0da8, 0x0e08 },
+ { 0x0da9, 0x0e09 },
+ { 0x0daa, 0x0e0a },
+ { 0x0dab, 0x0e0b },
+ { 0x0dac, 0x0e0c },
+ { 0x0dad, 0x0e0d },
+ { 0x0dae, 0x0e0e },
+ { 0x0daf, 0x0e0f },
+ { 0x0db0, 0x0e10 },
+ { 0x0db1, 0x0e11 },
+ { 0x0db2, 0x0e12 },
+ { 0x0db3, 0x0e13 },
+ { 0x0db4, 0x0e14 },
+ { 0x0db5, 0x0e15 },
+ { 0x0db6, 0x0e16 },
+ { 0x0db7, 0x0e17 },
+ { 0x0db8, 0x0e18 },
+ { 0x0db9, 0x0e19 },
+ { 0x0dba, 0x0e1a },
+ { 0x0dbb, 0x0e1b },
+ { 0x0dbc, 0x0e1c },
+ { 0x0dbd, 0x0e1d },
+ { 0x0dbe, 0x0e1e },
+ { 0x0dbf, 0x0e1f },
+ { 0x0dc0, 0x0e20 },
+ { 0x0dc1, 0x0e21 },
+ { 0x0dc2, 0x0e22 },
+ { 0x0dc3, 0x0e23 },
+ { 0x0dc4, 0x0e24 },
+ { 0x0dc5, 0x0e25 },
+ { 0x0dc6, 0x0e26 },
+ { 0x0dc7, 0x0e27 },
+ { 0x0dc8, 0x0e28 },
+ { 0x0dc9, 0x0e29 },
+ { 0x0dca, 0x0e2a },
+ { 0x0dcb, 0x0e2b },
+ { 0x0dcc, 0x0e2c },
+ { 0x0dcd, 0x0e2d },
+ { 0x0dce, 0x0e2e },
+ { 0x0dcf, 0x0e2f },
+ { 0x0dd0, 0x0e30 },
+ { 0x0dd1, 0x0e31 },
+ { 0x0dd2, 0x0e32 },
+ { 0x0dd3, 0x0e33 },
+ { 0x0dd4, 0x0e34 },
+ { 0x0dd5, 0x0e35 },
+ { 0x0dd6, 0x0e36 },
+ { 0x0dd7, 0x0e37 },
+ { 0x0dd8, 0x0e38 },
+ { 0x0dd9, 0x0e39 },
+ { 0x0dda, 0x0e3a },
+ { 0x0ddf, 0x0e3f },
+ { 0x0de0, 0x0e40 },
+ { 0x0de1, 0x0e41 },
+ { 0x0de2, 0x0e42 },
+ { 0x0de3, 0x0e43 },
+ { 0x0de4, 0x0e44 },
+ { 0x0de5, 0x0e45 },
+ { 0x0de6, 0x0e46 },
+ { 0x0de7, 0x0e47 },
+ { 0x0de8, 0x0e48 },
+ { 0x0de9, 0x0e49 },
+ { 0x0dea, 0x0e4a },
+ { 0x0deb, 0x0e4b },
+ { 0x0dec, 0x0e4c },
+ { 0x0ded, 0x0e4d },
+ { 0x0df0, 0x0e50 },
+ { 0x0df1, 0x0e51 },
+ { 0x0df2, 0x0e52 },
+ { 0x0df3, 0x0e53 },
+ { 0x0df4, 0x0e54 },
+ { 0x0df5, 0x0e55 },
+ { 0x0df6, 0x0e56 },
+ { 0x0df7, 0x0e57 },
+ { 0x0df8, 0x0e58 },
+ { 0x0df9, 0x0e59 },
+ { 0x0ea1, 0x3131 },
+ { 0x0ea2, 0x3132 },
+ { 0x0ea3, 0x3133 },
+ { 0x0ea4, 0x3134 },
+ { 0x0ea5, 0x3135 },
+ { 0x0ea6, 0x3136 },
+ { 0x0ea7, 0x3137 },
+ { 0x0ea8, 0x3138 },
+ { 0x0ea9, 0x3139 },
+ { 0x0eaa, 0x313a },
+ { 0x0eab, 0x313b },
+ { 0x0eac, 0x313c },
+ { 0x0ead, 0x313d },
+ { 0x0eae, 0x313e },
+ { 0x0eaf, 0x313f },
+ { 0x0eb0, 0x3140 },
+ { 0x0eb1, 0x3141 },
+ { 0x0eb2, 0x3142 },
+ { 0x0eb3, 0x3143 },
+ { 0x0eb4, 0x3144 },
+ { 0x0eb5, 0x3145 },
+ { 0x0eb6, 0x3146 },
+ { 0x0eb7, 0x3147 },
+ { 0x0eb8, 0x3148 },
+ { 0x0eb9, 0x3149 },
+ { 0x0eba, 0x314a },
+ { 0x0ebb, 0x314b },
+ { 0x0ebc, 0x314c },
+ { 0x0ebd, 0x314d },
+ { 0x0ebe, 0x314e },
+ { 0x0ebf, 0x314f },
+ { 0x0ec0, 0x3150 },
+ { 0x0ec1, 0x3151 },
+ { 0x0ec2, 0x3152 },
+ { 0x0ec3, 0x3153 },
+ { 0x0ec4, 0x3154 },
+ { 0x0ec5, 0x3155 },
+ { 0x0ec6, 0x3156 },
+ { 0x0ec7, 0x3157 },
+ { 0x0ec8, 0x3158 },
+ { 0x0ec9, 0x3159 },
+ { 0x0eca, 0x315a },
+ { 0x0ecb, 0x315b },
+ { 0x0ecc, 0x315c },
+ { 0x0ecd, 0x315d },
+ { 0x0ece, 0x315e },
+ { 0x0ecf, 0x315f },
+ { 0x0ed0, 0x3160 },
+ { 0x0ed1, 0x3161 },
+ { 0x0ed2, 0x3162 },
+ { 0x0ed3, 0x3163 },
+ { 0x0ed4, 0x11a8 },
+ { 0x0ed5, 0x11a9 },
+ { 0x0ed6, 0x11aa },
+ { 0x0ed7, 0x11ab },
+ { 0x0ed8, 0x11ac },
+ { 0x0ed9, 0x11ad },
+ { 0x0eda, 0x11ae },
+ { 0x0edb, 0x11af },
+ { 0x0edc, 0x11b0 },
+ { 0x0edd, 0x11b1 },
+ { 0x0ede, 0x11b2 },
+ { 0x0edf, 0x11b3 },
+ { 0x0ee0, 0x11b4 },
+ { 0x0ee1, 0x11b5 },
+ { 0x0ee2, 0x11b6 },
+ { 0x0ee3, 0x11b7 },
+ { 0x0ee4, 0x11b8 },
+ { 0x0ee5, 0x11b9 },
+ { 0x0ee6, 0x11ba },
+ { 0x0ee7, 0x11bb },
+ { 0x0ee8, 0x11bc },
+ { 0x0ee9, 0x11bd },
+ { 0x0eea, 0x11be },
+ { 0x0eeb, 0x11bf },
+ { 0x0eec, 0x11c0 },
+ { 0x0eed, 0x11c1 },
+ { 0x0eee, 0x11c2 },
+ { 0x0eef, 0x316d },
+ { 0x0ef0, 0x3171 },
+ { 0x0ef1, 0x3178 },
+ { 0x0ef2, 0x317f },
+ { 0x0ef3, 0x3181 },
+ { 0x0ef4, 0x3184 },
+ { 0x0ef5, 0x3186 },
+ { 0x0ef6, 0x318d },
+ { 0x0ef7, 0x318e },
+ { 0x0ef8, 0x11eb },
+ { 0x0ef9, 0x11f0 },
+ { 0x0efa, 0x11f9 },
+ { 0x0eff, 0x20a9 },
+#if 0
+ /* FIXME: there is no keysym 0x13a4? But 0x20ac is EuroSign in both
+ keysym and Unicode */
+ { 0x13a4, 0x20ac },
+#endif
+ { 0x13bc, 0x0152 },
+ { 0x13bd, 0x0153 },
+ { 0x13be, 0x0178 },
+ { 0x20ac, 0x20ac },
+
+ /* Special function keys. */
+
+ { 0xff08, 0x0008 }, /* XK_BackSpace */
+ { 0xff09, 0x0009 }, /* XK_Tab */
+ { 0xff0a, 0x000a }, /* XK_Linefeed */
+ { 0xff0d, 0x000d }, /* XK_Return */
+ { 0xff13, 0x0013 }, /* XK_Pause */
+ { 0xff1b, 0x001b }, /* XK_Escape */
+ { 0xff50, 0x0001 }, /* XK_Home */
+ { 0xff51, 0x001c }, /* XK_Left */
+ { 0xff52, 0x001e }, /* XK_Up */
+ { 0xff53, 0x001d }, /* XK_Right */
+ { 0xff54, 0x001f }, /* XK_Down */
+ { 0xff55, 0x000b }, /* XK_Prior */
+ { 0xff56, 0x000c }, /* XK_Next */
+ { 0xff57, 0x0004 }, /* XK_End */
+ { 0xff6a, 0x0005 }, /* XK_Help */
+ { 0xffff, 0x007f }, /* XK_Delete */
+};
+
+long keysym2ucs(int keysym)
+{
+ int min = 0;
+ int max = sizeof(keysymtab) / sizeof(struct codepair) - 1;
+ int mid;
+
+ /* first check for Latin-1 characters (1:1 mapping) */
+ if ((keysym >= 0x0020 && keysym <= 0x007e) ||
+ (keysym >= 0x00a0 && keysym <= 0x00ff))
+ return keysym;
+
+ /* also check for directly encoded 24-bit UCS characters */
+ if ((keysym & 0xff000000) == 0x01000000)
+ return keysym & 0x00ffffff;
+
+ /* binary search in table */
+ while (max >= min) {
+ mid = (min + max) / 2;
+ if (keysymtab[mid].keysym < keysym)
+ min = mid + 1;
+ else if (keysymtab[mid].keysym > keysym)
+ max = mid - 1;
+ else {
+ /* found it */
+ return keysymtab[mid].ucs;
+ }
+ }
+
+ /* no matching Unicode value found */
+ return -1;
+}
+
+static int reverse_compare (const void *a, const void *b)
+{
+ const struct codepair *ca = a, *cb = b;
+
+ return ca->ucs - cb->ucs;
+}
+
+int ucs2keysym(long ucs)
+{
+ static struct codepair *reverse_keysymtab;
+
+ int min = 0;
+ int max = sizeof(keysymtab) / sizeof(struct codepair) - 1;
+ int mid;
+
+ if (reverse_keysymtab == NULL)
+ {
+ reverse_keysymtab = malloc (sizeof (keysymtab));
+ memcpy (reverse_keysymtab, keysymtab, sizeof (keysymtab));
+
+ qsort (reverse_keysymtab,
+ sizeof (keysymtab) / sizeof (struct codepair),
+ sizeof (struct codepair),
+ reverse_compare);
+ }
+
+ /* first check for Latin-1 characters (1:1 mapping) */
+ if ((ucs >= 0x0020 && ucs <= 0x007e) ||
+ (ucs >= 0x00a0 && ucs <= 0x00ff))
+ return ucs;
+
+ /* binary search in table */
+ while (max >= min) {
+ mid = (min + max) / 2;
+ if (reverse_keysymtab[mid].ucs < ucs)
+ min = mid + 1;
+ else if (reverse_keysymtab[mid].ucs > ucs)
+ max = mid - 1;
+ else {
+ /* found it */
+ return reverse_keysymtab[mid].keysym;
+ }
+ }
+
+ /* finally, assume a directly encoded 24-bit UCS character */
+ return ucs | 0x01000000;
+}
diff --git a/xorg-server/hw/xquartz/keysym2ucs.h b/xorg-server/hw/xquartz/keysym2ucs.h
new file mode 100644
index 000000000..f5b7a18f2
--- /dev/null
+++ b/xorg-server/hw/xquartz/keysym2ucs.h
@@ -0,0 +1,36 @@
+/*
+ * This module converts keysym values into the corresponding ISO 10646
+ * (UCS, Unicode) values.
+ *
+ * The array keysymtab[] contains pairs of X11 keysym values for graphical
+ * characters and the corresponding Unicode value. The function
+ * keysym2ucs() maps a keysym onto a Unicode value using a binary search,
+ * therefore keysymtab[] must remain SORTED by keysym value.
+ *
+ * The keysym -> UTF-8 conversion will hopefully one day be provided
+ * by Xlib via XmbLookupString() and should ideally not have to be
+ * done in X applications. But we are not there yet.
+ *
+ * We allow to represent any UCS character in the range U-00000000 to
+ * U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff.
+ * This admittedly does not cover the entire 31-bit space of UCS, but
+ * it does cover all of the characters up to U-10FFFF, which can be
+ * represented by UTF-16, and more, and it is very unlikely that higher
+ * UCS codes will ever be assigned by ISO. So to get Unicode character
+ * U+ABCD you can directly use keysym 0x0100abcd.
+ *
+ * Author: Markus G. Kuhn <mkuhn@acm.org>, University of Cambridge, April 2001
+ *
+ * Special thanks to Richard Verhoeven <river@win.tue.nl> for preparing
+ * an initial draft of the mapping table.
+ *
+ * This software is in the public domain. Share and enjoy!
+ */
+
+#ifndef KEYSYM2UCS_H
+#define KEYSYM2UCS_H 1
+
+extern long keysym2ucs(int keysym);
+extern int ucs2keysym(long ucs);
+
+#endif /* KEYSYM2UCS_H */
diff --git a/xorg-server/hw/xquartz/pseudoramiX.c b/xorg-server/hw/xquartz/pseudoramiX.c
new file mode 100644
index 000000000..49d5eb6d4
--- /dev/null
+++ b/xorg-server/hw/xquartz/pseudoramiX.c
@@ -0,0 +1,438 @@
+/*
+ * Minimal implementation of PanoramiX/Xinerama
+ *
+ * This is used in rootless mode where the underlying window server
+ * already provides an abstracted view of multiple screens as one
+ * large screen area.
+ *
+ * This code is largely based on panoramiX.c, which contains the
+ * following copyright notice:
+ */
+/*****************************************************************
+Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
+BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Digital Equipment Corporation
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from Digital
+Equipment Corporation.
+******************************************************************/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "pseudoramiX.h"
+#include "extnsionst.h"
+#include "dixstruct.h"
+#include "window.h"
+#include <X11/extensions/panoramiXproto.h>
+#include "globals.h"
+
+Bool noPseudoramiXExtension = FALSE;
+extern int noPanoramiXExtension;
+
+extern int ProcPanoramiXQueryVersion (ClientPtr client);
+
+static void PseudoramiXResetProc(ExtensionEntry *extEntry);
+
+static int ProcPseudoramiXQueryVersion(ClientPtr client);
+static int ProcPseudoramiXGetState(ClientPtr client);
+static int ProcPseudoramiXGetScreenCount(ClientPtr client);
+static int ProcPseudoramiXGetScreenSize(ClientPtr client);
+static int ProcPseudoramiXIsActive(ClientPtr client);
+static int ProcPseudoramiXQueryScreens(ClientPtr client);
+static int ProcPseudoramiXDispatch(ClientPtr client);
+
+static int SProcPseudoramiXQueryVersion(ClientPtr client);
+static int SProcPseudoramiXGetState(ClientPtr client);
+static int SProcPseudoramiXGetScreenCount(ClientPtr client);
+static int SProcPseudoramiXGetScreenSize(ClientPtr client);
+static int SProcPseudoramiXIsActive(ClientPtr client);
+static int SProcPseudoramiXQueryScreens(ClientPtr client);
+static int SProcPseudoramiXDispatch(ClientPtr client);
+
+
+typedef struct {
+ int x;
+ int y;
+ int w;
+ int h;
+} PseudoramiXScreenRec;
+
+static PseudoramiXScreenRec *pseudoramiXScreens = NULL;
+static int pseudoramiXScreensAllocated = 0;
+static int pseudoramiXNumScreens = 0;
+static unsigned long pseudoramiXGeneration = 0;
+
+
+// Add a PseudoramiX screen.
+// The rest of the X server will know nothing about this screen.
+// Can be called before or after extension init.
+// Screens must be re-added once per generation.
+void
+PseudoramiXAddScreen(int x, int y, int w, int h)
+{
+ PseudoramiXScreenRec *s;
+
+ if (noPseudoramiXExtension) return;
+
+ if (pseudoramiXNumScreens == pseudoramiXScreensAllocated) {
+ pseudoramiXScreensAllocated += pseudoramiXScreensAllocated + 1;
+ pseudoramiXScreens = xrealloc(pseudoramiXScreens,
+ pseudoramiXScreensAllocated *
+ sizeof(PseudoramiXScreenRec));
+ }
+
+ s = &pseudoramiXScreens[pseudoramiXNumScreens++];
+ s->x = x;
+ s->y = y;
+ s->w = w;
+ s->h = h;
+}
+
+
+// Initialize PseudoramiX.
+// Copied from PanoramiXExtensionInit
+void PseudoramiXExtensionInit(int argc, char *argv[])
+{
+ Bool success = FALSE;
+ ExtensionEntry *extEntry;
+
+ if (noPseudoramiXExtension) return;
+
+ /* Even with only one screen we need to enable PseudoramiX to allow
+ dynamic screen configuration changes. */
+#if 0
+ if (pseudoramiXNumScreens == 1) {
+ // Only one screen - disable Xinerama extension.
+ noPseudoramiXExtension = TRUE;
+ return;
+ }
+#endif
+
+ // The server must not run the PanoramiX operations.
+ noPanoramiXExtension = TRUE;
+
+ if (pseudoramiXGeneration != serverGeneration) {
+ extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0,
+ ProcPseudoramiXDispatch,
+ SProcPseudoramiXDispatch,
+ PseudoramiXResetProc,
+ StandardMinorOpcode);
+ if (!extEntry) {
+ ErrorF("PseudoramiXExtensionInit(): AddExtension failed\n");
+ } else {
+ pseudoramiXGeneration = serverGeneration;
+ success = TRUE;
+ }
+ }
+
+ if (!success) {
+ ErrorF("%s Extension (PseudoramiX) failed to initialize\n",
+ PANORAMIX_PROTOCOL_NAME);
+ return;
+ }
+}
+
+
+void PseudoramiXResetScreens(void)
+{
+ pseudoramiXNumScreens = 0;
+}
+
+
+static void PseudoramiXResetProc(ExtensionEntry *extEntry)
+{
+ PseudoramiXResetScreens();
+}
+
+
+// was PanoramiX
+static int ProcPseudoramiXQueryVersion(ClientPtr client)
+{
+ return ProcPanoramiXQueryVersion(client);
+}
+
+
+// was PanoramiX
+static int ProcPseudoramiXGetState(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetStateReq);
+ WindowPtr pWin;
+ xPanoramiXGetStateReply rep;
+ register int n, rc;
+
+ REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.state = !noPseudoramiXExtension;
+ if (client->swapped) {
+ swaps (&rep.sequenceNumber, n);
+ swapl (&rep.length, n);
+ swaps (&rep.state, n);
+ }
+ WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
+ return client->noClientException;
+}
+
+
+// was PanoramiX
+static int ProcPseudoramiXGetScreenCount(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenCountReq);
+ WindowPtr pWin;
+ xPanoramiXGetScreenCountReply rep;
+ register int n, rc;
+
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.ScreenCount = pseudoramiXNumScreens;
+ if (client->swapped) {
+ swaps (&rep.sequenceNumber, n);
+ swapl (&rep.length, n);
+ swaps (&rep.ScreenCount, n);
+ }
+ WriteToClient (client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep);
+ return client->noClientException;
+}
+
+
+// was PanoramiX
+static int ProcPseudoramiXGetScreenSize(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenSizeReq);
+ WindowPtr pWin;
+ xPanoramiXGetScreenSizeReply rep;
+ register int n, rc;
+
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ /* screen dimensions */
+ rep.width = pseudoramiXScreens[stuff->screen].w;
+ // was panoramiXdataPtr[stuff->screen].width;
+ rep.height = pseudoramiXScreens[stuff->screen].h;
+ // was panoramiXdataPtr[stuff->screen].height;
+ if (client->swapped) {
+ swaps (&rep.sequenceNumber, n);
+ swapl (&rep.length, n);
+ swaps (&rep.width, n);
+ swaps (&rep.height, n);
+ }
+ WriteToClient (client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep);
+ return client->noClientException;
+}
+
+
+// was Xinerama
+static int ProcPseudoramiXIsActive(ClientPtr client)
+{
+ /* REQUEST(xXineramaIsActiveReq); */
+ xXineramaIsActiveReply rep;
+
+ REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.state = !noPseudoramiXExtension;
+ if (client->swapped) {
+ register int n;
+ swaps (&rep.sequenceNumber, n);
+ swapl (&rep.length, n);
+ swapl (&rep.state, n);
+ }
+ WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
+ return client->noClientException;
+}
+
+
+// was Xinerama
+static int ProcPseudoramiXQueryScreens(ClientPtr client)
+{
+ /* REQUEST(xXineramaQueryScreensReq); */
+ xXineramaQueryScreensReply rep;
+
+ REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.number = noPseudoramiXExtension ? 0 : pseudoramiXNumScreens;
+ rep.length = rep.number * sz_XineramaScreenInfo >> 2;
+ if (client->swapped) {
+ register int n;
+ swaps (&rep.sequenceNumber, n);
+ swapl (&rep.length, n);
+ swapl (&rep.number, n);
+ }
+ WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep);
+
+ if (!noPseudoramiXExtension) {
+ xXineramaScreenInfo scratch;
+ int i;
+
+ for(i = 0; i < pseudoramiXNumScreens; i++) {
+ scratch.x_org = pseudoramiXScreens[i].x;
+ scratch.y_org = pseudoramiXScreens[i].y;
+ scratch.width = pseudoramiXScreens[i].w;
+ scratch.height = pseudoramiXScreens[i].h;
+
+ if(client->swapped) {
+ register int n;
+ swaps (&scratch.x_org, n);
+ swaps (&scratch.y_org, n);
+ swaps (&scratch.width, n);
+ swaps (&scratch.height, n);
+ }
+ WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch);
+ }
+ }
+
+ return client->noClientException;
+}
+
+
+// was PanoramiX
+static int ProcPseudoramiXDispatch (ClientPtr client)
+{ REQUEST(xReq);
+ switch (stuff->data)
+ {
+ case X_PanoramiXQueryVersion:
+ return ProcPseudoramiXQueryVersion(client);
+ case X_PanoramiXGetState:
+ return ProcPseudoramiXGetState(client);
+ case X_PanoramiXGetScreenCount:
+ return ProcPseudoramiXGetScreenCount(client);
+ case X_PanoramiXGetScreenSize:
+ return ProcPseudoramiXGetScreenSize(client);
+ case X_XineramaIsActive:
+ return ProcPseudoramiXIsActive(client);
+ case X_XineramaQueryScreens:
+ return ProcPseudoramiXQueryScreens(client);
+ }
+ return BadRequest;
+}
+
+
+
+static int
+SProcPseudoramiXQueryVersion (ClientPtr client)
+{
+ REQUEST(xPanoramiXQueryVersionReq);
+ register int n;
+
+ swaps(&stuff->length,n);
+ REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
+ return ProcPseudoramiXQueryVersion(client);
+}
+
+static int
+SProcPseudoramiXGetState(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetStateReq);
+ register int n;
+
+ swaps (&stuff->length, n);
+ REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+ return ProcPseudoramiXGetState(client);
+}
+
+static int
+SProcPseudoramiXGetScreenCount(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenCountReq);
+ register int n;
+
+ swaps (&stuff->length, n);
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+ return ProcPseudoramiXGetScreenCount(client);
+}
+
+static int
+SProcPseudoramiXGetScreenSize(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenSizeReq);
+ register int n;
+
+ swaps (&stuff->length, n);
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+ return ProcPseudoramiXGetScreenSize(client);
+}
+
+
+static int
+SProcPseudoramiXIsActive(ClientPtr client)
+{
+ REQUEST(xXineramaIsActiveReq);
+ register int n;
+
+ swaps (&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
+ return ProcPseudoramiXIsActive(client);
+}
+
+
+static int
+SProcPseudoramiXQueryScreens(ClientPtr client)
+{
+ REQUEST(xXineramaQueryScreensReq);
+ register int n;
+
+ swaps (&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
+ return ProcPseudoramiXQueryScreens(client);
+}
+
+
+static int
+SProcPseudoramiXDispatch (ClientPtr client)
+{ REQUEST(xReq);
+ switch (stuff->data)
+ {
+ case X_PanoramiXQueryVersion:
+ return SProcPseudoramiXQueryVersion(client);
+ case X_PanoramiXGetState:
+ return SProcPseudoramiXGetState(client);
+ case X_PanoramiXGetScreenCount:
+ return SProcPseudoramiXGetScreenCount(client);
+ case X_PanoramiXGetScreenSize:
+ return SProcPseudoramiXGetScreenSize(client);
+ case X_XineramaIsActive:
+ return SProcPseudoramiXIsActive(client);
+ case X_XineramaQueryScreens:
+ return SProcPseudoramiXQueryScreens(client);
+ }
+ return BadRequest;
+}
diff --git a/xorg-server/hw/xquartz/pseudoramiX.h b/xorg-server/hw/xquartz/pseudoramiX.h
new file mode 100644
index 000000000..df5010d1d
--- /dev/null
+++ b/xorg-server/hw/xquartz/pseudoramiX.h
@@ -0,0 +1,9 @@
+/*
+ * Minimal implementation of PanoramiX/Xinerama
+ */
+
+extern int noPseudoramiXExtension;
+
+void PseudoramiXAddScreen(int x, int y, int w, int h);
+void PseudoramiXExtensionInit(int argc, char *argv[]);
+void PseudoramiXResetScreens(void);
diff --git a/xorg-server/hw/xquartz/quartz.c b/xorg-server/hw/xquartz/quartz.c
new file mode 100644
index 000000000..6f42c538f
--- /dev/null
+++ b/xorg-server/hw/xquartz/quartz.c
@@ -0,0 +1,500 @@
+/*
+ *
+ * Quartz-specific support for the Darwin X Server
+ *
+ * Copyright (c) 2001-2004 Greg Parker and Torrey T. Lyons.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "quartzCommon.h"
+#include "quartz.h"
+#include "darwin.h"
+#include "darwinEvents.h"
+#include "quartzAudio.h"
+#include "pseudoramiX.h"
+#define _APPLEWM_SERVER_
+#include "applewmExt.h"
+
+#include "X11Application.h"
+
+#include <X11/extensions/applewm.h>
+#include <X11/extensions/randr.h>
+
+// X headers
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "colormapst.h"
+#include "globals.h"
+#include "rootlessWindow.h"
+
+// System headers
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <IOKit/pwr_mgt/IOPMLib.h>
+
+#define FAKE_RANDR 1
+
+// Shared global variables for Quartz modes
+int quartzEventWriteFD = -1;
+int quartzRootless = -1;
+int quartzUseSysBeep = 0;
+int quartzUseAGL = 1;
+int quartzEnableKeyEquivalents = 1;
+int quartzServerVisible = TRUE;
+int quartzServerQuitting = FALSE;
+DevPrivateKey quartzScreenKey = &quartzScreenKey;
+int aquaMenuBarHeight = 0;
+QuartzModeProcsPtr quartzProcs = NULL;
+const char *quartzOpenGLBundle = NULL;
+
+#if defined(RANDR) && !defined(FAKE_RANDR)
+Bool QuartzRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) {
+ return FALSE;
+}
+
+Bool QuartzRandRSetConfig (ScreenPtr pScreen,
+ Rotation randr,
+ int rate,
+ RRScreenSizePtr pSize) {
+ return FALSE;
+}
+
+Bool QuartzRandRInit (ScreenPtr pScreen) {
+ rrScrPrivPtr pScrPriv;
+
+ if (!RRScreenInit (pScreen)) return FALSE;
+
+ pScrPriv = rrGetScrPriv(pScreen);
+ pScrPriv->rrGetInfo = QuartzRandRGetInfo;
+ pScrPriv->rrSetConfig = QuartzRandRSetConfig;
+ return TRUE;
+}
+#endif
+
+/*
+===========================================================================
+
+ Screen functions
+
+===========================================================================
+*/
+
+/*
+ * QuartzAddScreen
+ * Do mode dependent initialization of each screen for Quartz.
+ */
+Bool QuartzAddScreen(
+ int index,
+ ScreenPtr pScreen)
+{
+ // allocate space for private per screen Quartz specific storage
+ QuartzScreenPtr displayInfo = xcalloc(sizeof(QuartzScreenRec), 1);
+
+ // QUARTZ_PRIV(pScreen) = displayInfo;
+ dixSetPrivate(&pScreen->devPrivates, quartzScreenKey, displayInfo);
+
+ // do Quartz mode specific initialization
+ return quartzProcs->AddScreen(index, pScreen);
+}
+
+
+/*
+ * QuartzSetupScreen
+ * Finalize mode specific setup of each screen.
+ */
+Bool QuartzSetupScreen(
+ int index,
+ ScreenPtr pScreen)
+{
+ // do Quartz mode specific setup
+ if (! quartzProcs->SetupScreen(index, pScreen))
+ return FALSE;
+
+ // setup cursor support
+ if (! quartzProcs->InitCursor(pScreen))
+ return FALSE;
+
+ return TRUE;
+}
+
+
+/*
+ * QuartzInitOutput
+ * Quartz display initialization.
+ */
+void QuartzInitOutput(
+ int argc,
+ char **argv )
+{
+ if (serverGeneration == 0) {
+ QuartzAudioInit();
+ }
+
+ if (!RegisterBlockAndWakeupHandlers(QuartzBlockHandler,
+ QuartzWakeupHandler,
+ NULL))
+ {
+ FatalError("Could not register block and wakeup handlers.");
+ }
+
+ // Do display mode specific initialization
+ quartzProcs->DisplayInit();
+}
+
+
+/*
+ * QuartzInitInput
+ * Inform the main thread the X server is ready to handle events.
+ */
+void QuartzInitInput(
+ int argc,
+ char **argv )
+{
+ X11ApplicationSetCanQuit(1);
+ X11ApplicationServerReady();
+ // Do final display mode specific initialization before handling events
+ if (quartzProcs->InitInput)
+ quartzProcs->InitInput(argc, argv);
+}
+
+
+#ifdef FAKE_RANDR
+extern char *ConnectionInfo;
+
+static int padlength[4] = {0, 3, 2, 1};
+
+static void
+RREditConnectionInfo (ScreenPtr pScreen)
+{
+ xConnSetup *connSetup;
+ char *vendor;
+ xPixmapFormat *formats;
+ xWindowRoot *root;
+ xDepth *depth;
+ xVisualType *visual;
+ int screen = 0;
+ int d;
+
+ connSetup = (xConnSetup *) ConnectionInfo;
+ vendor = (char *) connSetup + sizeof (xConnSetup);
+ formats = (xPixmapFormat *) ((char *) vendor +
+ connSetup->nbytesVendor +
+ padlength[connSetup->nbytesVendor & 3]);
+ root = (xWindowRoot *) ((char *) formats +
+ sizeof (xPixmapFormat) * screenInfo.numPixmapFormats);
+ while (screen != pScreen->myNum)
+ {
+ depth = (xDepth *) ((char *) root +
+ sizeof (xWindowRoot));
+ for (d = 0; d < root->nDepths; d++)
+ {
+ visual = (xVisualType *) ((char *) depth +
+ sizeof (xDepth));
+ depth = (xDepth *) ((char *) visual +
+ depth->nVisuals * sizeof (xVisualType));
+ }
+ root = (xWindowRoot *) ((char *) depth);
+ screen++;
+ }
+ root->pixWidth = pScreen->width;
+ root->pixHeight = pScreen->height;
+ root->mmWidth = pScreen->mmWidth;
+ root->mmHeight = pScreen->mmHeight;
+}
+#endif
+
+/*
+ * QuartzUpdateScreens
+ * Adjust for screen arrangement changes.
+ */
+static void QuartzUpdateScreens(void)
+{
+ ScreenPtr pScreen;
+ WindowPtr pRoot;
+ int x, y, width, height, sx, sy;
+ xEvent e;
+
+ DEBUG_LOG("QuartzUpdateScreens()\n");
+ if (noPseudoramiXExtension || screenInfo.numScreens != 1)
+ {
+ /* FIXME: if not using Xinerama, we have multiple screens, and
+ to do this properly may need to add or remove screens. Which
+ isn't possible. So don't do anything. Another reason why
+ we default to running with Xinerama. */
+
+ return;
+ }
+
+ pScreen = screenInfo.screens[0];
+
+ PseudoramiXResetScreens();
+ quartzProcs->AddPseudoramiXScreens(&x, &y, &width, &height);
+
+ dixScreenOrigins[pScreen->myNum].x = x;
+ dixScreenOrigins[pScreen->myNum].y = y;
+ pScreen->mmWidth = pScreen->mmWidth * ((double) width / pScreen->width);
+ pScreen->mmHeight = pScreen->mmHeight * ((double) height / pScreen->height);
+ pScreen->width = width;
+ pScreen->height = height;
+
+#ifndef FAKE_RANDR
+ if(!QuartzRandRInit(pScreen))
+ FatalError("Failed to init RandR extension.\n");
+#endif
+
+ DarwinAdjustScreenOrigins(&screenInfo);
+ quartzProcs->UpdateScreen(pScreen);
+
+ sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
+ sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
+
+ /* Adjust the root window. */
+ pRoot = WindowTable[pScreen->myNum];
+ AppleWMSetScreenOrigin(pRoot);
+ pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL);
+ miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
+// QuartzIgnoreNextWarpCursor();
+ DefineInitialRootWindow(pRoot);
+
+ /* Send an event for the root reconfigure */
+ e.u.u.type = ConfigureNotify;
+ e.u.configureNotify.window = pRoot->drawable.id;
+ e.u.configureNotify.aboveSibling = None;
+ e.u.configureNotify.x = x - sx;
+ e.u.configureNotify.y = y - sy;
+ e.u.configureNotify.width = width;
+ e.u.configureNotify.height = height;
+ e.u.configureNotify.borderWidth = wBorderWidth(pRoot);
+ e.u.configureNotify.override = pRoot->overrideRedirect;
+ DeliverEvents(pRoot, &e, 1, NullWindow);
+
+#ifdef FAKE_RANDR
+ RREditConnectionInfo(pScreen);
+#endif
+}
+
+
+/*
+ * QuartzShow
+ * Show the X server on screen. Does nothing if already shown.
+ * Calls mode specific screen resume to restore the X clip regions
+ * (if needed) and the X server cursor state.
+ */
+static void QuartzShow(
+ int x, // cursor location
+ int y )
+{
+ int i;
+
+ if (!quartzServerVisible) {
+ quartzServerVisible = TRUE;
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ if (screenInfo.screens[i]) {
+ quartzProcs->ResumeScreen(screenInfo.screens[i], x, y);
+ }
+ }
+ }
+}
+
+
+/*
+ * QuartzHide
+ * Remove the X server display from the screen. Does nothing if already
+ * hidden. Calls mode specific screen suspend to set X clip regions to
+ * prevent drawing (if needed) and restore the Aqua cursor.
+ */
+static void QuartzHide(void)
+{
+ int i;
+
+ if (quartzServerVisible) {
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ if (screenInfo.screens[i]) {
+ quartzProcs->SuspendScreen(screenInfo.screens[i]);
+ }
+ }
+ }
+ quartzServerVisible = FALSE;
+}
+
+
+/*
+ * QuartzSetRootClip
+ * Enable or disable rendering to the X screen.
+ */
+static void QuartzSetRootClip(
+ BOOL enable)
+{
+ int i;
+
+ if (!quartzServerVisible)
+ return;
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ if (screenInfo.screens[i]) {
+ xf86SetRootClip(screenInfo.screens[i], enable);
+ }
+ }
+}
+
+
+/*
+ * QuartzMessageServerThread
+ * Send the X server thread a message by placing it on the event queue.
+ */
+void
+QuartzMessageServerThread(
+ int type,
+ int argc, ...)
+{
+ xEvent xe;
+ INT32 *argv;
+ int i, max_args;
+ va_list args;
+
+ memset(&xe, 0, sizeof(xe));
+ xe.u.u.type = type;
+ xe.u.clientMessage.u.l.type = type;
+
+ argv = &xe.u.clientMessage.u.l.longs0;
+ max_args = 4;
+
+ if (argc > 0 && argc <= max_args) {
+ va_start (args, argc);
+ for (i = 0; i < argc; i++)
+ argv[i] = (int) va_arg (args, int);
+ va_end (args);
+ }
+
+ DarwinEQEnqueue(&xe);
+}
+
+
+/*
+ * QuartzProcessEvent
+ * Process Quartz specific events.
+ */
+void QuartzProcessEvent(xEvent *xe) {
+ switch (xe->u.u.type) {
+ case kXDarwinControllerNotify:
+ DEBUG_LOG("kXDarwinControllerNotify\n");
+ AppleWMSendEvent(AppleWMControllerNotify,
+ AppleWMControllerNotifyMask,
+ xe->u.clientMessage.u.l.longs0,
+ xe->u.clientMessage.u.l.longs1);
+ break;
+
+ case kXDarwinPasteboardNotify:
+ DEBUG_LOG("kXDarwinPasteboardNotify\n");
+ AppleWMSendEvent(AppleWMPasteboardNotify,
+ AppleWMPasteboardNotifyMask,
+ xe->u.clientMessage.u.l.longs0,
+ xe->u.clientMessage.u.l.longs1);
+ break;
+
+ case kXDarwinActivate:
+ DEBUG_LOG("kXDarwinActivate\n");
+ QuartzShow(xe->u.keyButtonPointer.rootX,
+ xe->u.keyButtonPointer.rootY);
+ AppleWMSendEvent(AppleWMActivationNotify,
+ AppleWMActivationNotifyMask,
+ AppleWMIsActive, 0);
+ break;
+
+ case kXDarwinDeactivate:
+ DEBUG_LOG("kXDarwinDeactivate\n");
+ AppleWMSendEvent(AppleWMActivationNotify,
+ AppleWMActivationNotifyMask,
+ AppleWMIsInactive, 0);
+ QuartzHide();
+ break;
+
+ case kXDarwinDisplayChanged:
+ DEBUG_LOG("kXDarwinDisplayChanged\n");
+ QuartzUpdateScreens();
+ break;
+
+ case kXDarwinWindowState:
+ DEBUG_LOG("kXDarwinWindowState\n");
+ RootlessNativeWindowStateChanged(xe->u.clientMessage.u.l.longs0,
+ xe->u.clientMessage.u.l.longs1);
+ break;
+
+ case kXDarwinWindowMoved:
+ DEBUG_LOG("kXDarwinWindowMoved\n");
+ RootlessNativeWindowMoved ((WindowPtr)xe->u.clientMessage.u.l.longs0);
+ break;
+
+ case kXDarwinToggleFullscreen:
+ DEBUG_LOG("kXDarwinToggleFullscreen\n");
+#ifdef DARWIN_DDX_MISSING
+ if (quartzEnableRootless) QuartzSetFullscreen(!quartzHasRoot);
+ else if (quartzHasRoot) QuartzHide();
+ else QuartzShow();
+#else
+ // ErrorF("kXDarwinToggleFullscreen not implemented\n");
+#endif
+ break;
+
+ case kXDarwinSetRootless:
+ DEBUG_LOG("kXDarwinSetRootless\n");
+#ifdef DARWIN_DDX_MISSING
+ QuartzSetRootless(xe->u.clientMessage.u.l.longs0);
+ if (!quartzEnableRootless && !quartzHasRoot) QuartzHide();
+#else
+ // ErrorF("kXDarwinSetRootless not implemented\n");
+#endif
+ break;
+
+ case kXDarwinSetRootClip:
+ QuartzSetRootClip((BOOL)xe->u.clientMessage.u.l.longs0);
+ break;
+
+ case kXDarwinQuit:
+ GiveUp(0);
+ break;
+
+ case kXDarwinReadPasteboard:
+ QuartzReadPasteboard();
+ break;
+
+ case kXDarwinWritePasteboard:
+ QuartzWritePasteboard();
+ break;
+
+ case kXDarwinBringAllToFront:
+ DEBUG_LOG("kXDarwinBringAllToFront\n");
+ RootlessOrderAllWindows();
+ break;
+
+ default:
+ ErrorF("Unknown application defined event type %d.\n", xe->u.u.type);
+ }
+}
diff --git a/xorg-server/hw/xquartz/quartz.h b/xorg-server/hw/xquartz/quartz.h
new file mode 100644
index 000000000..fbe308a92
--- /dev/null
+++ b/xorg-server/hw/xquartz/quartz.h
@@ -0,0 +1,134 @@
+/*
+ * quartz.h
+ *
+ * External interface of the Quartz display modes seen by the generic, mode
+ * independent parts of the Darwin X server.
+ *
+ * Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifndef _QUARTZ_H
+#define _QUARTZ_H
+
+#include "quartzPasteboard.h"
+
+#include "screenint.h"
+#include "window.h"
+
+/*------------------------------------------
+ Quartz display mode function types
+ ------------------------------------------*/
+
+/*
+ * Display mode initialization
+ */
+typedef void (*DisplayInitProc)(void);
+typedef Bool (*AddScreenProc)(int index, ScreenPtr pScreen);
+typedef Bool (*SetupScreenProc)(int index, ScreenPtr pScreen);
+typedef void (*InitInputProc)(int argc, char **argv);
+
+/*
+ * Cursor functions
+ */
+typedef Bool (*InitCursorProc)(ScreenPtr pScreen);
+typedef void (*CursorUpdateProc)(void);
+
+/*
+ * Suspend and resume X11 activity
+ */
+typedef void (*SuspendScreenProc)(ScreenPtr pScreen);
+typedef void (*ResumeScreenProc)(ScreenPtr pScreen, int x, int y);
+typedef void (*CaptureScreensProc)(void);
+typedef void (*ReleaseScreensProc)(void);
+
+/*
+ * Screen state change support
+ */
+typedef void (*ScreenChangedProc)(void);
+typedef void (*AddPseudoramiXScreensProc)(int *x, int *y, int *width, int *height);
+typedef void (*UpdateScreenProc)(ScreenPtr pScreen);
+
+/*
+ * Rootless helper functions
+ */
+typedef Bool (*IsX11WindowProc)(void *nsWindow, int windowNumber);
+typedef void (*HideWindowsProc)(Bool hide);
+
+/*
+ * Rootless functions for optional export to GLX layer
+ */
+typedef void * (*FrameForWindowProc)(WindowPtr pWin, Bool create);
+typedef WindowPtr (*TopLevelParentProc)(WindowPtr pWindow);
+typedef Bool (*CreateSurfaceProc)
+ (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable,
+ unsigned int client_id, unsigned int *surface_id,
+ unsigned int key[2], void (*notify) (void *arg, void *data),
+ void *notify_data);
+typedef Bool (*DestroySurfaceProc)
+ (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable,
+ void (*notify) (void *arg, void *data), void *notify_data);
+
+/*
+ * Quartz display mode function list
+ */
+typedef struct _QuartzModeProcs {
+ DisplayInitProc DisplayInit;
+ AddScreenProc AddScreen;
+ SetupScreenProc SetupScreen;
+ InitInputProc InitInput;
+
+ InitCursorProc InitCursor;
+ CursorUpdateProc CursorUpdate; // Not used if NULL
+
+ SuspendScreenProc SuspendScreen;
+ ResumeScreenProc ResumeScreen;
+ CaptureScreensProc CaptureScreens; // Only called in fullscreen
+ ReleaseScreensProc ReleaseScreens; // Only called in fullscreen
+
+ ScreenChangedProc ScreenChanged;
+ AddPseudoramiXScreensProc AddPseudoramiXScreens;
+ UpdateScreenProc UpdateScreen;
+
+ IsX11WindowProc IsX11Window;
+ HideWindowsProc HideWindows;
+
+ FrameForWindowProc FrameForWindow;
+ TopLevelParentProc TopLevelParent;
+ CreateSurfaceProc CreateSurface;
+ DestroySurfaceProc DestroySurface;
+} QuartzModeProcsRec, *QuartzModeProcsPtr;
+
+extern QuartzModeProcsPtr quartzProcs;
+extern int quartzHasRoot, quartzEnableRootless;
+
+Bool QuartzAddScreen(int index, ScreenPtr pScreen);
+Bool QuartzSetupScreen(int index, ScreenPtr pScreen);
+void QuartzInitOutput(int argc,char **argv);
+void QuartzInitInput(int argc, char **argv);
+void QuartzGiveUp(void);
+void QuartzProcessEvent(xEvent *xe);
+
+#endif
diff --git a/xorg-server/hw/xquartz/quartzAudio.c b/xorg-server/hw/xquartz/quartzAudio.c
new file mode 100644
index 000000000..5dee32f54
--- /dev/null
+++ b/xorg-server/hw/xquartz/quartzAudio.c
@@ -0,0 +1,346 @@
+//
+// QuartzAudio.m
+//
+// X Window bell support using CoreAudio or AppKit.
+// Greg Parker gparker@cs.stanford.edu 19 Feb 2001
+//
+// Info about sine wave sound playback:
+// CoreAudio code derived from macosx-dev posting by Tim Wood
+// http://www.omnigroup.com/mailman/archive/macosx-dev/2000-May/002004.html
+// Smoothing transitions between sounds
+// http://www.wam.umd.edu/~mphoenix/dss/dss.html
+//
+/*
+ * Copyright (c) 2001 Greg Parker. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "quartzCommon.h"
+#include "quartzAudio.h"
+
+#include <CoreAudio/CoreAudio.h>
+#include <pthread.h>
+
+#include "inputstr.h"
+#include <X11/extensions/XI.h>
+#include <assert.h>
+
+void NSBeep(void);
+
+typedef struct QuartzAudioRec {
+ double frequency;
+ double amplitude;
+
+ UInt32 curFrame;
+ UInt32 remainingFrames;
+ UInt32 totalFrames;
+ UInt32 bytesPerFrame;
+ double sampleRate;
+ UInt32 fadeLength;
+
+ UInt32 bufferByteCount;
+ Boolean playing;
+ pthread_mutex_t lock;
+
+ // used to fade out interrupted sound and avoid 'pop'
+ double prevFrequency;
+ double prevAmplitude;
+ UInt32 prevFrame;
+} QuartzAudioRec;
+
+static AudioDeviceID quartzAudioDevice = kAudioDeviceUnknown;
+static QuartzAudioRec data;
+
+
+/*
+ * QuartzAudioEnvelope
+ * Fade sound in and out to avoid pop.
+ * Sounds with shorter duration will never reach full amplitude. Deal.
+ */
+static double QuartzAudioEnvelope(
+ UInt32 curFrame,
+ UInt32 totalFrames,
+ UInt32 fadeLength )
+{
+ double fadeFrames = min(fadeLength, totalFrames / 2);
+ if (fadeFrames < 1) return 0;
+
+ if (curFrame < fadeFrames) {
+ return curFrame / fadeFrames;
+ } else if (curFrame > totalFrames - fadeFrames) {
+ return (totalFrames-curFrame) / fadeFrames;
+ } else {
+ return 1.0;
+ }
+}
+
+
+/*
+ * QuartzFillBuffer
+ * Fill this buffer with data and update the data position.
+ * FIXME: this is ugly
+ */
+static void QuartzFillBuffer(
+ AudioBuffer *audiobuffer,
+ QuartzAudioRec *data )
+{
+ float *buffer, *b;
+ unsigned int frame, frameCount;
+ unsigned int bufferFrameCount;
+ float multiplier, v;
+ int i;
+
+ buffer = (float *)audiobuffer->mData;
+ bufferFrameCount = audiobuffer->mDataByteSize / data->bytesPerFrame;
+
+ frameCount = min(bufferFrameCount, data->remainingFrames);
+
+ // Fade out previous sine wave, if any.
+ b = buffer;
+ if (data->prevFrame) {
+ multiplier = 2*M_PI*(data->prevFrequency/data->sampleRate);
+ for (frame = 0; frame < data->fadeLength; frame++) {
+ v = data->prevAmplitude *
+ QuartzAudioEnvelope(frame+data->fadeLength,
+ 2*data->fadeLength,
+ data->fadeLength) *
+ sin(multiplier * (data->prevFrame+frame));
+ for (i = 0; i < audiobuffer->mNumberChannels; i++) {
+ *b++ = v;
+ }
+ }
+ // no more prev fade
+ data->prevFrame = 0;
+
+ // adjust for space eaten by prev fade
+ buffer += audiobuffer->mNumberChannels*frame;
+ bufferFrameCount -= frame;
+ frameCount = min(bufferFrameCount, data->remainingFrames);
+ }
+
+ // Write a sine wave with the specified frequency and amplitude
+ multiplier = 2*M_PI*(data->frequency/data->sampleRate);
+ for (frame = 0; frame < frameCount; frame++) {
+ v = data->amplitude *
+ QuartzAudioEnvelope(data->curFrame+frame, data->totalFrames,
+ data->fadeLength) *
+ sin(multiplier * (data->curFrame+frame));
+ for (i = 0; i < audiobuffer->mNumberChannels; i++) {
+ *b++ = v;
+ }
+ }
+
+ // Zero out the rest of the buffer, if any
+ memset(b, 0, sizeof(float) * audiobuffer->mNumberChannels *
+ (bufferFrameCount-frame));
+
+ data->curFrame += frameCount;
+ data->remainingFrames -= frameCount;
+ if (data->remainingFrames == 0) {
+ data->playing = FALSE;
+ data->curFrame = 0;
+ }
+}
+
+
+/*
+ * QuartzAudioIOProc
+ * Callback function for audio playback.
+ * FIXME: use inOutputTime to correct for skipping
+ */
+static OSStatus
+QuartzAudioIOProc(
+ AudioDeviceID inDevice,
+ const AudioTimeStamp *inNow,
+ const AudioBufferList *inInputData,
+ const AudioTimeStamp *inInputTime,
+ AudioBufferList *outOutputData,
+ const AudioTimeStamp *inOutputTime,
+ void *inClientData )
+{
+ QuartzAudioRec *data = (QuartzAudioRec *)inClientData;
+ int i;
+ Boolean wasPlaying;
+
+ pthread_mutex_lock(&data->lock);
+ wasPlaying = data->playing;
+ for (i = 0; i < outOutputData->mNumberBuffers; i++) {
+ if (data->playing) {
+ QuartzFillBuffer(outOutputData->mBuffers+i, data);
+ }
+ else {
+ memset(outOutputData->mBuffers[i].mData, 0,
+ outOutputData->mBuffers[i].mDataByteSize);
+ }
+ }
+ if (wasPlaying && !data->playing) {
+ OSStatus err;
+ err = AudioDeviceStop(inDevice, QuartzAudioIOProc);
+ }
+ pthread_mutex_unlock(&data->lock);
+ return 0;
+}
+
+
+/*
+ * QuartzCoreAudioBell
+ * Play a tone using the CoreAudio API
+ */
+static void QuartzCoreAudioBell(
+ int volume, // volume is % of max
+ int pitch, // pitch is Hz
+ int duration ) // duration is milliseconds
+{
+ if (quartzAudioDevice == kAudioDeviceUnknown) return;
+
+ pthread_mutex_lock(&data.lock);
+
+ // fade previous sound, if any
+ data.prevFrequency = data.frequency;
+ data.prevAmplitude = data.amplitude;
+ data.prevFrame = data.curFrame;
+
+ // set new sound
+ data.frequency = pitch;
+ data.amplitude = volume / 100.0;
+ data.curFrame = 0;
+ data.totalFrames = (int)(data.sampleRate * duration / 1000.0);
+ data.remainingFrames = data.totalFrames;
+
+ if (! data.playing) {
+ OSStatus status;
+ status = AudioDeviceStart(quartzAudioDevice, QuartzAudioIOProc);
+ if (status) {
+ ErrorF("QuartzAudioBell: AudioDeviceStart returned %ld\n", status);
+ } else {
+ data.playing = TRUE;
+ }
+ }
+ pthread_mutex_unlock(&data.lock);
+}
+
+
+/*
+ * QuartzBell
+ * Ring the bell
+ */
+void QuartzBell(
+ int volume, // volume in percent of max
+ DeviceIntPtr pDevice,
+ pointer ctrl,
+ int class )
+{
+ int pitch; // pitch in Hz
+ int duration; // duration in milliseconds
+
+ if (class == BellFeedbackClass) {
+ pitch = ((BellCtrl*)ctrl)->pitch;
+ duration = ((BellCtrl*)ctrl)->duration;
+ } else if (class == KbdFeedbackClass) {
+ pitch = ((KeybdCtrl*)ctrl)->bell_pitch;
+ duration = ((KeybdCtrl*)ctrl)->bell_duration;
+ } else {
+ ErrorF("QuartzBell: bad bell class %d\n", class);
+ return;
+ }
+
+ if (quartzUseSysBeep) {
+ if (volume)
+ NSBeep();
+ } else {
+ QuartzCoreAudioBell(volume, pitch, duration);
+ }
+}
+
+
+/*
+ * QuartzAudioInit
+ * Prepare to play the bell with the CoreAudio API
+ */
+void QuartzAudioInit(void)
+{
+ UInt32 propertySize;
+ OSStatus status;
+ AudioDeviceID outputDevice;
+ AudioStreamBasicDescription outputStreamDescription;
+ double sampleRate;
+
+ // Get the default output device
+ propertySize = sizeof(outputDevice);
+ status = AudioHardwareGetProperty(
+ kAudioHardwarePropertyDefaultOutputDevice,
+ &propertySize, &outputDevice);
+ if (status) {
+ ErrorF("QuartzAudioInit: AudioHardwareGetProperty returned %ld\n",
+ status);
+ return;
+ }
+ if (outputDevice == kAudioDeviceUnknown) {
+ ErrorF("QuartzAudioInit: No audio output devices available.\n");
+ return;
+ }
+
+ // Get the basic device description
+ propertySize = sizeof(outputStreamDescription);
+ status = AudioDeviceGetProperty(outputDevice, 0, FALSE,
+ kAudioDevicePropertyStreamFormat,
+ &propertySize, &outputStreamDescription);
+ if (status) {
+ ErrorF("QuartzAudioInit: GetProperty(stream format) returned %ld\n",
+ status);
+ return;
+ }
+ sampleRate = outputStreamDescription.mSampleRate;
+
+ // Fill in the playback data
+ data.frequency = 0;
+ data.amplitude = 0;
+ data.curFrame = 0;
+ data.remainingFrames = 0;
+ data.bytesPerFrame = outputStreamDescription.mBytesPerFrame;
+ data.sampleRate = sampleRate;
+ // data.bufferByteCount = bufferByteCount;
+ data.playing = FALSE;
+ data.prevAmplitude = 0;
+ data.prevFrame = 0;
+ data.prevFrequency = 0;
+ data.fadeLength = data.sampleRate / 200;
+ pthread_mutex_init(&data.lock, NULL); // fixme error check
+
+ // fixme assert fadeLength<framesPerBuffer
+
+ // Prepare for playback
+ status = AudioDeviceAddIOProc(outputDevice, QuartzAudioIOProc, &data);
+ if (status) {
+ ErrorF("QuartzAudioInit: AddIOProc returned %ld\n", status);
+ return;
+ }
+
+ // success!
+ quartzAudioDevice = outputDevice;
+}
diff --git a/xorg-server/hw/xquartz/quartzAudio.h b/xorg-server/hw/xquartz/quartzAudio.h
new file mode 100644
index 000000000..c406bbc2a
--- /dev/null
+++ b/xorg-server/hw/xquartz/quartzAudio.h
@@ -0,0 +1,40 @@
+//
+// QuartzAudio.h
+//
+// X Window bell support using CoreAudio or AppKit.
+// Greg Parker gparker@cs.stanford.edu 19 Feb 2001
+/*
+ * Copyright (c) 2001 Greg Parker. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifndef _QUARTZAUDIO_H
+#define _QUARTZAUDIO_H
+
+#include "input.h"
+
+void QuartzAudioInit(void);
+void QuartzBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class);
+
+#endif
diff --git a/xorg-server/hw/xquartz/quartzCocoa.m b/xorg-server/hw/xquartz/quartzCocoa.m
new file mode 100644
index 000000000..53e3f0897
--- /dev/null
+++ b/xorg-server/hw/xquartz/quartzCocoa.m
@@ -0,0 +1,146 @@
+/**************************************************************
+ *
+ * Quartz-specific support for the Darwin X Server
+ * that requires Cocoa and Objective-C.
+ *
+ * This file is separate from the parts of Quartz support
+ * that use X include files to avoid symbol collisions.
+ *
+ * Copyright (c) 2001-2004 Torrey T. Lyons and Greg Parker.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "quartzCommon.h"
+#include "quartzPasteboard.h"
+
+#define BOOL xBOOL
+#include "darwin.h"
+#undef BOOL
+
+#include <Cocoa/Cocoa.h>
+
+#include "pseudoramiX.h"
+
+extern void FatalError(const char *, ...);
+extern char *display;
+extern int noPanoramiXExtension;
+
+/*
+ * QuartzWriteCocoaPasteboard
+ * Write text to the Mac OS X pasteboard.
+ */
+void QuartzWriteCocoaPasteboard(
+ char *text)
+{
+ NSPasteboard *pasteboard;
+ NSArray *pasteboardTypes;
+ NSString *string;
+
+ if (! text) return;
+ pasteboard = [NSPasteboard generalPasteboard];
+ if (! pasteboard) return;
+ string = [NSString stringWithCString:text];
+ if (! string) return;
+ pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType];
+
+ // nil owner because we don't provide type translations
+ [pasteboard declareTypes:pasteboardTypes owner:nil];
+ [pasteboard setString:string forType:NSStringPboardType];
+}
+
+
+/*
+ * QuartzReadCocoaPasteboard
+ * Read text from the Mac OS X pasteboard and return it as a heap string.
+ * The caller must free the string.
+ */
+char *QuartzReadCocoaPasteboard(void)
+{
+ NSPasteboard *pasteboard;
+ NSArray *pasteboardTypes;
+ NSString *existingType;
+ char *text = NULL;
+
+ pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType];
+ pasteboard = [NSPasteboard generalPasteboard];
+ if (! pasteboard) return NULL;
+
+ existingType = [pasteboard availableTypeFromArray:pasteboardTypes];
+ if (existingType) {
+ NSString *string = [pasteboard stringForType:existingType];
+ char *buffer;
+
+ if (! string) return NULL;
+ buffer = (char *) [string UTF8String];
+ text = (char *) malloc(strlen(buffer)+1);
+ if (text)
+ strcpy(text, buffer);
+ }
+
+ return text;
+}
+
+
+/*
+ * QuartzFSUseQDCursor
+ * Return whether the screen should use a QuickDraw cursor.
+ */
+int QuartzFSUseQDCursor(
+ int depth) // screen depth
+{
+ return TRUE;
+}
+
+
+/*
+ * QuartzBlockHandler
+ * Clean out any autoreleased objects.
+ */
+void QuartzBlockHandler(
+ pointer blockData,
+ OSTimePtr pTimeout,
+ pointer pReadmask)
+{
+ static NSAutoreleasePool *aPool = nil;
+
+ [aPool release];
+ aPool = [[NSAutoreleasePool alloc] init];
+}
+
+
+/*
+ * QuartzWakeupHandler
+ */
+void QuartzWakeupHandler(
+ pointer blockData,
+ int result,
+ pointer pReadmask)
+{
+ // nothing here
+}
diff --git a/xorg-server/hw/xquartz/quartzCommon.h b/xorg-server/hw/xquartz/quartzCommon.h
new file mode 100644
index 000000000..a0d467389
--- /dev/null
+++ b/xorg-server/hw/xquartz/quartzCommon.h
@@ -0,0 +1,107 @@
+/*
+ * quartzCommon.h
+ *
+ * Common definitions used internally by all Quartz modes
+ *
+ * This file should be included before any X11 or IOKit headers
+ * so that it can avoid symbol conflicts.
+ *
+ * Copyright (c) 2001-2004 Torrey T. Lyons and Greg Parker.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifndef _QUARTZCOMMON_H
+#define _QUARTZCOMMON_H
+
+// QuickDraw in ApplicationServices has the following conflicts with
+// the basic X server headers. Use QD_<name> to use the QuickDraw
+// definition of any of these symbols, or the normal name for the
+// X11 definition.
+#define Cursor QD_Cursor
+#define WindowPtr QD_WindowPtr
+#define Picture QD_Picture
+#include <ApplicationServices/ApplicationServices.h>
+#undef Cursor
+#undef WindowPtr
+#undef Picture
+#include <X11/Xdefs.h>
+#include "privates.h"
+
+// Quartz specific per screen storage structure
+typedef struct {
+ // List of CoreGraphics displays that this X11 screen covers.
+ // This is more than one CG display for video mirroring and
+ // rootless PseudoramiX mode.
+ // No CG display will be covered by more than one X11 screen.
+ int displayCount;
+ CGDirectDisplayID *displayIDs;
+} QuartzScreenRec, *QuartzScreenPtr;
+
+#define QUARTZ_PRIV(pScreen) \
+ ((QuartzScreenPtr)dixLookupPrivate(&pScreen->devPrivates, quartzScreenKey))
+
+// Data stored at startup for Cocoa front end
+extern int quartzEventWriteFD;
+
+// User preferences used by Quartz modes
+extern int quartzRootless;
+extern int quartzUseSysBeep;
+extern int quartzUseAGL;
+extern int quartzEnableKeyEquivalents;
+
+// Other shared data
+extern int quartzServerVisible;
+extern int quartzServerQuitting;
+extern DevPrivateKey quartzScreenKey;
+extern int aquaMenuBarHeight;
+
+// Name of GLX bundle for native OpenGL
+extern const char *quartzOpenGLBundle;
+
+void QuartzReadPreferences(void);
+void QuartzMessageMainThread(unsigned msg, void *data, unsigned length);
+void QuartzMessageServerThread(int type, int argc, ...);
+void QuartzSetWindowMenu(int nitems, const char **items,
+ const char *shortcuts);
+void QuartzFSCapture(void);
+void QuartzFSRelease(void);
+int QuartzFSUseQDCursor(int depth);
+void QuartzBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask);
+void QuartzWakeupHandler(pointer blockData, int result, pointer pReadmask);
+
+// Messages that can be sent to the main thread.
+enum {
+ kQuartzServerHidden,
+ kQuartzServerStarted,
+ kQuartzServerDied,
+ kQuartzCursorUpdate,
+ kQuartzPostEvent,
+ kQuartzSetWindowMenu,
+ kQuartzSetWindowMenuCheck,
+ kQuartzSetFrontProcess,
+ kQuartzSetCanQuit
+};
+
+#endif /* _QUARTZCOMMON_H */
diff --git a/xorg-server/hw/xquartz/quartzCursor.c b/xorg-server/hw/xquartz/quartzCursor.c
new file mode 100644
index 000000000..f82ccd380
--- /dev/null
+++ b/xorg-server/hw/xquartz/quartzCursor.c
@@ -0,0 +1,646 @@
+/**************************************************************
+ *
+ * Support for using the Quartz Window Manager cursor
+ *
+ * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "quartzCommon.h"
+#include "quartzCursor.h"
+#include "darwin.h"
+
+#include <pthread.h>
+
+#include "mi.h"
+#include "scrnintstr.h"
+#include "cursorstr.h"
+#include "mipointrst.h"
+#include "globals.h"
+
+// Size of the QuickDraw cursor
+#define CURSORWIDTH 16
+#define CURSORHEIGHT 16
+
+typedef struct {
+ int qdCursorMode;
+ int qdCursorVisible;
+ int useQDCursor;
+ QueryBestSizeProcPtr QueryBestSize;
+ miPointerSpriteFuncPtr spriteFuncs;
+} QuartzCursorScreenRec, *QuartzCursorScreenPtr;
+
+static DevPrivateKey darwinCursorScreenKey = &darwinCursorScreenKey;
+static CursorPtr quartzLatentCursor = NULL;
+static QD_Cursor gQDArrow; // QuickDraw arrow cursor
+
+// Cursor for the main thread to set (NULL = arrow cursor).
+static CCrsrHandle currentCursor = NULL;
+static pthread_mutex_t cursorMutex;
+static pthread_cond_t cursorCondition;
+
+#define CURSOR_PRIV(pScreen) ((QuartzCursorScreenPtr) \
+ dixLookupPrivate(&pScreen->devPrivates, darwinCursorScreenKey))
+
+#define HIDE_QD_CURSOR(pScreen, visible) \
+ if (visible) { \
+ int ix; \
+ for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \
+ CGDisplayHideCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \
+ } \
+ visible = FALSE; \
+ } ((void)0)
+
+#define SHOW_QD_CURSOR(pScreen, visible) \
+ { \
+ int ix; \
+ for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \
+ CGDisplayShowCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \
+ } \
+ visible = TRUE; \
+ } ((void)0)
+
+#define CHANGE_QD_CURSOR(cursorH) \
+ if (!quartzServerQuitting) { \
+ /* Acquire lock and tell the main thread to change cursor */ \
+ pthread_mutex_lock(&cursorMutex); \
+ currentCursor = (CCrsrHandle) (cursorH); \
+ QuartzMessageMainThread(kQuartzCursorUpdate, NULL, 0); \
+ \
+ /* Wait for the main thread to change the cursor */ \
+ pthread_cond_wait(&cursorCondition, &cursorMutex); \
+ pthread_mutex_unlock(&cursorMutex); \
+ } ((void)0)
+
+
+/*
+ * MakeQDCursor helpers: CTAB_ENTER, interleave
+ */
+
+// Add a color entry to a ctab
+#define CTAB_ENTER(ctab, index, r, g, b) \
+ ctab->ctTable[index].value = index; \
+ ctab->ctTable[index].rgb.red = r; \
+ ctab->ctTable[index].rgb.green = g; \
+ ctab->ctTable[index].rgb.blue = b
+
+// Make an unsigned short by interleaving the bits of bytes c1 and c2.
+// High bit of c1 is first; low bit of c2 is last.
+// Interleave is a built-in INTERCAL operator.
+static unsigned short
+interleave(
+ unsigned char c1,
+ unsigned char c2 )
+{
+ return
+ ((c1 & 0x80) << 8) | ((c2 & 0x80) << 7) |
+ ((c1 & 0x40) << 7) | ((c2 & 0x40) << 6) |
+ ((c1 & 0x20) << 6) | ((c2 & 0x20) << 5) |
+ ((c1 & 0x10) << 5) | ((c2 & 0x10) << 4) |
+ ((c1 & 0x08) << 4) | ((c2 & 0x08) << 3) |
+ ((c1 & 0x04) << 3) | ((c2 & 0x04) << 2) |
+ ((c1 & 0x02) << 2) | ((c2 & 0x02) << 1) |
+ ((c1 & 0x01) << 1) | ((c2 & 0x01) << 0) ;
+}
+
+/*
+ * MakeQDCursor
+ * Make a QuickDraw color cursor from the given X11 cursor.
+ * Warning: This code is nasty. Color cursors were meant to be read
+ * from resources; constructing the structures programmatically is messy.
+ */
+/*
+ QuickDraw cursor representation:
+ Our color cursor is a 2 bit per pixel pixmap.
+ Each pixel's bits are (source<<1 | mask) from the original X cursor pixel.
+ The cursor's color table maps the colors like this:
+ (2-bit value | X result | colortable | Mac result)
+ 00 | transparent | white | transparent (white outside mask)
+ 01 | back color | back color | back color
+ 10 | undefined | black | invert background (just for fun)
+ 11 | fore color | fore color | fore color
+*/
+static CCrsrHandle
+MakeQDCursor(
+ CursorPtr pCursor )
+{
+ CCrsrHandle result;
+ CCrsrPtr curs;
+ int i, w, h;
+ unsigned short rowMask;
+ PixMap *pix;
+ ColorTable *ctab;
+ unsigned short *image;
+
+ result = (CCrsrHandle) NewHandleClear(sizeof(CCrsr));
+ if (!result) return NULL;
+ HLock((Handle)result);
+ curs = *result;
+
+ // Initialize CCrsr
+ curs->crsrType = 0x8001; // 0x8000 = b&w, 0x8001 = color
+ curs->crsrMap = (PixMapHandle) NewHandleClear(sizeof(PixMap));
+ if (!curs->crsrMap) goto pixAllocFailed;
+ HLock((Handle)curs->crsrMap);
+ pix = *curs->crsrMap;
+ curs->crsrData = NULL; // raw cursor image data (set below)
+ curs->crsrXData = NULL; // QD's processed data
+ curs->crsrXValid = 0; // zero means QD must re-process cursor data
+ curs->crsrXHandle = NULL; // reserved
+ memset(curs->crsr1Data, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w data
+ memset(curs->crsrMask, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w & color mask
+ curs->crsrHotSpot.h = min(CURSORWIDTH, pCursor->bits->xhot); // hot spot
+ curs->crsrHotSpot.v = min(CURSORHEIGHT, pCursor->bits->yhot); // hot spot
+ curs->crsrXTable = 0; // reserved
+ curs->crsrID = GetCTSeed(); // unique ID from Color Manager
+
+ // Set the b&w data and mask
+ w = min(pCursor->bits->width, CURSORWIDTH);
+ h = min(pCursor->bits->height, CURSORHEIGHT);
+ rowMask = ~((1 << (CURSORWIDTH - w)) - 1);
+ for (i = 0; i < h; i++) {
+ curs->crsr1Data[i] = rowMask &
+ ((pCursor->bits->source[i*4]<<8) | pCursor->bits->source[i*4+1]);
+ curs->crsrMask[i] = rowMask &
+ ((pCursor->bits->mask[i*4]<<8) | pCursor->bits->mask[i*4+1]);
+ }
+
+ // Set the color data and mask
+ // crsrMap: defines bit depth and size and colortable only
+ pix->rowBytes = (CURSORWIDTH * 2 / 8) | 0x8000; // last bit on means PixMap
+ SetRect(&pix->bounds, 0, 0, CURSORWIDTH, CURSORHEIGHT); // see TN 1020
+ pix->pixelSize = 2;
+ pix->cmpCount = 1;
+ pix->cmpSize = 2;
+ // pix->pmTable set below
+
+ // crsrData is the pixel data. crsrMap's baseAddr is not used.
+ curs->crsrData = NewHandleClear(CURSORWIDTH*CURSORHEIGHT * 2 / 8);
+ if (!curs->crsrData) goto imageAllocFailed;
+ HLock((Handle)curs->crsrData);
+ image = (unsigned short *) *curs->crsrData;
+ // Pixel data is just 1-bit data and mask interleaved (see above)
+ for (i = 0; i < h; i++) {
+ unsigned char s, m;
+ s = pCursor->bits->source[i*4] & (rowMask >> 8);
+ m = pCursor->bits->mask[i*4] & (rowMask >> 8);
+ image[2*i] = interleave(s, m);
+ s = pCursor->bits->source[i*4+1] & (rowMask & 0x00ff);
+ m = pCursor->bits->mask[i*4+1] & (rowMask & 0x00ff);
+ image[2*i+1] = interleave(s, m);
+ }
+
+ // Build the color table (entries described above)
+ // NewPixMap allocates a color table handle.
+ pix->pmTable = (CTabHandle) NewHandleClear(sizeof(ColorTable) + 3
+ * sizeof(ColorSpec));
+ if (!pix->pmTable) goto ctabAllocFailed;
+ HLock((Handle)pix->pmTable);
+ ctab = *pix->pmTable;
+ ctab->ctSeed = GetCTSeed();
+ ctab->ctFlags = 0;
+ ctab->ctSize = 3; // color count - 1
+ CTAB_ENTER(ctab, 0, 0xffff, 0xffff, 0xffff);
+ CTAB_ENTER(ctab, 1, pCursor->backRed, pCursor->backGreen,
+ pCursor->backBlue);
+ CTAB_ENTER(ctab, 2, 0x0000, 0x0000, 0x0000);
+ CTAB_ENTER(ctab, 3, pCursor->foreRed, pCursor->foreGreen,
+ pCursor->foreBlue);
+
+ HUnlock((Handle)pix->pmTable); // ctab
+ HUnlock((Handle)curs->crsrData); // image data
+ HUnlock((Handle)curs->crsrMap); // pix
+ HUnlock((Handle)result); // cursor
+
+ return result;
+
+ // "What we have here is a failure to allocate"
+ctabAllocFailed:
+ HUnlock((Handle)curs->crsrData);
+ DisposeHandle((Handle)curs->crsrData);
+imageAllocFailed:
+ HUnlock((Handle)curs->crsrMap);
+ DisposeHandle((Handle)curs->crsrMap);
+pixAllocFailed:
+ HUnlock((Handle)result);
+ DisposeHandle((Handle)result);
+ return NULL;
+}
+
+
+/*
+ * FreeQDCursor
+ * Destroy a QuickDraw color cursor created with MakeQDCursor().
+ * The cursor must not currently be on screen.
+ */
+static void FreeQDCursor(CCrsrHandle cursHandle)
+{
+ CCrsrPtr curs;
+ PixMap *pix;
+
+ HLock((Handle)cursHandle);
+ curs = *cursHandle;
+ HLock((Handle)curs->crsrMap);
+ pix = *curs->crsrMap;
+ DisposeHandle((Handle)pix->pmTable);
+ HUnlock((Handle)curs->crsrMap);
+ DisposeHandle((Handle)curs->crsrMap);
+ DisposeHandle((Handle)curs->crsrData);
+ HUnlock((Handle)cursHandle);
+ DisposeHandle((Handle)cursHandle);
+}
+
+
+/*
+===========================================================================
+
+ Pointer sprite functions
+
+===========================================================================
+*/
+
+/*
+ * QuartzRealizeCursor
+ * Convert the X cursor representation to QuickDraw format if possible.
+ */
+Bool
+QuartzRealizeCursor(
+ ScreenPtr pScreen,
+ CursorPtr pCursor )
+{
+ CCrsrHandle qdCursor;
+ QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ if(!pCursor || !pCursor->bits)
+ return FALSE;
+
+ // if the cursor is too big we use a software cursor
+ if ((pCursor->bits->height > CURSORHEIGHT) ||
+ (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor)
+ {
+ if (quartzRootless) {
+ // rootless can't use a software cursor
+ return TRUE;
+ } else {
+ return (*ScreenPriv->spriteFuncs->RealizeCursor)
+ (pScreen, pCursor);
+ }
+ }
+
+ // make new cursor image
+ qdCursor = MakeQDCursor(pCursor);
+ if (!qdCursor) return FALSE;
+
+ // save the result
+ dixSetPrivate(&pCursor->devPrivates, pScreen, qdCursor);
+
+ return TRUE;
+}
+
+
+/*
+ * QuartzUnrealizeCursor
+ * Free the storage space associated with a realized cursor.
+ */
+Bool
+QuartzUnrealizeCursor(
+ ScreenPtr pScreen,
+ CursorPtr pCursor )
+{
+ QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ if ((pCursor->bits->height > CURSORHEIGHT) ||
+ (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor)
+ {
+ if (quartzRootless) {
+ return TRUE;
+ } else {
+ return (*ScreenPriv->spriteFuncs->UnrealizeCursor)
+ (pScreen, pCursor);
+ }
+ } else {
+ CCrsrHandle oldCursor = dixLookupPrivate(&pCursor->devPrivates,
+ pScreen);
+ if (currentCursor != oldCursor) {
+ // This should only fail when quitting, in which case we just leak.
+ FreeQDCursor(oldCursor);
+ }
+ dixSetPrivate(&pCursor->devPrivates, pScreen, NULL);
+ return TRUE;
+ }
+}
+
+
+/*
+ * QuartzSetCursor
+ * Set the cursor sprite and position.
+ * Use QuickDraw cursor if possible.
+ */
+static void
+QuartzSetCursor(
+ ScreenPtr pScreen,
+ CursorPtr pCursor,
+ int x,
+ int y)
+{
+ QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ quartzLatentCursor = pCursor;
+
+ // Don't touch Mac OS cursor if X is hidden!
+ if (!quartzServerVisible)
+ return;
+
+ if (!pCursor) {
+ // Remove the cursor completely.
+ HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
+ if (! ScreenPriv->qdCursorMode)
+ (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
+ }
+ else if ((pCursor->bits->height <= CURSORHEIGHT) &&
+ (pCursor->bits->width <= CURSORWIDTH) && ScreenPriv->useQDCursor)
+ {
+ // Cursor is small enough to use QuickDraw directly.
+ if (! ScreenPriv->qdCursorMode) // remove the X cursor
+ (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
+ ScreenPriv->qdCursorMode = TRUE;
+
+ CHANGE_QD_CURSOR(dixLookupPrivate(&pCursor->devPrivates, pScreen));
+ SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
+ }
+ else if (quartzRootless) {
+ // Rootless can't use a software cursor, so we just use Mac OS arrow.
+ CHANGE_QD_CURSOR(NULL);
+ SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
+ }
+ else {
+ // Cursor is too big for QuickDraw. Use X software cursor.
+ HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
+ ScreenPriv->qdCursorMode = FALSE;
+ (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y);
+ }
+}
+
+
+/*
+ * QuartzReallySetCursor
+ * Set the QuickDraw cursor. Called from the main thread since changing the
+ * cursor with QuickDraw is not thread safe on dual processor machines.
+ */
+void
+QuartzReallySetCursor()
+{
+ pthread_mutex_lock(&cursorMutex);
+
+ if (currentCursor) {
+ SetCCursor(currentCursor);
+ } else {
+ SetCursor(&gQDArrow);
+ }
+
+ pthread_cond_signal(&cursorCondition);
+ pthread_mutex_unlock(&cursorMutex);
+}
+
+
+/*
+ * QuartzMoveCursor
+ * Move the cursor. This is a noop for QuickDraw.
+ */
+static void
+QuartzMoveCursor(
+ ScreenPtr pScreen,
+ int x,
+ int y)
+{
+ QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ // only the X cursor needs to be explicitly moved
+ if (!ScreenPriv->qdCursorMode)
+ (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y);
+}
+
+
+static miPointerSpriteFuncRec quartzSpriteFuncsRec = {
+ QuartzRealizeCursor,
+ QuartzUnrealizeCursor,
+ QuartzSetCursor,
+ QuartzMoveCursor
+};
+
+
+/*
+===========================================================================
+
+ Pointer screen functions
+
+===========================================================================
+*/
+
+/*
+ * QuartzCursorOffScreen
+ */
+static Bool QuartzCursorOffScreen(ScreenPtr *pScreen, int *x, int *y)
+{
+ return FALSE;
+}
+
+
+/*
+ * QuartzCrossScreen
+ */
+static void QuartzCrossScreen(ScreenPtr pScreen, Bool entering)
+{
+ return;
+}
+
+
+/*
+ * QuartzWarpCursor
+ * Change the cursor position without generating an event or motion history.
+ * The input coordinates (x,y) are in pScreen-local X11 coordinates.
+ *
+ */
+static void
+QuartzWarpCursor(
+ ScreenPtr pScreen,
+ int x,
+ int y)
+{
+ static int neverMoved = TRUE;
+
+ if (neverMoved) {
+ // Don't move the cursor the first time. This is the jump-to-center
+ // initialization, and it's annoying because we may still be in MacOS.
+ neverMoved = FALSE;
+ return;
+ }
+
+ if (quartzServerVisible) {
+ CGDisplayErr cgErr;
+ CGPoint cgPoint;
+ // Only need to do this for one display. Any display will do.
+ CGDirectDisplayID cgID = QUARTZ_PRIV(pScreen)->displayIDs[0];
+ CGRect cgRect = CGDisplayBounds(cgID);
+
+ // Convert (x,y) to CoreGraphics screen-local CG coordinates.
+ // This is necessary because the X11 screen and CG screen may not
+ // coincide. (e.g. X11 screen may be moved to dodge the menu bar)
+
+ // Make point in X11 global coordinates
+ cgPoint = CGPointMake(x + dixScreenOrigins[pScreen->myNum].x,
+ y + dixScreenOrigins[pScreen->myNum].y);
+ // Shift to CoreGraphics global screen coordinates
+ cgPoint.x += darwinMainScreenX;
+ cgPoint.y += darwinMainScreenY;
+ // Shift to CoreGraphics screen-local coordinates
+ cgPoint.x -= cgRect.origin.x;
+ cgPoint.y -= cgRect.origin.y;
+
+ cgErr = CGDisplayMoveCursorToPoint(cgID, cgPoint);
+ if (cgErr != CGDisplayNoErr) {
+ ErrorF("Could not set cursor position with error code 0x%x.\n",
+ cgErr);
+ }
+ }
+
+ miPointerWarpCursor(pScreen, x, y);
+ miPointerUpdate();
+}
+
+
+static miPointerScreenFuncRec quartzScreenFuncsRec = {
+ QuartzCursorOffScreen,
+ QuartzCrossScreen,
+ QuartzWarpCursor,
+ DarwinEQPointerPost,
+ DarwinEQSwitchScreen
+};
+
+
+/*
+===========================================================================
+
+ Other screen functions
+
+===========================================================================
+*/
+
+/*
+ * QuartzCursorQueryBestSize
+ * Handle queries for best cursor size
+ */
+static void
+QuartzCursorQueryBestSize(
+ int class,
+ unsigned short *width,
+ unsigned short *height,
+ ScreenPtr pScreen)
+{
+ QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ if (class == CursorShape) {
+ *width = CURSORWIDTH;
+ *height = CURSORHEIGHT;
+ } else {
+ (*ScreenPriv->QueryBestSize)(class, width, height, pScreen);
+ }
+}
+
+
+/*
+ * QuartzInitCursor
+ * Initialize cursor support
+ */
+Bool
+QuartzInitCursor(
+ ScreenPtr pScreen )
+{
+ QuartzCursorScreenPtr ScreenPriv;
+ miPointerScreenPtr PointPriv;
+ DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
+
+ // initialize software cursor handling (always needed as backup)
+ if (!miDCInitialize(pScreen, &quartzScreenFuncsRec)) {
+ return FALSE;
+ }
+
+ ScreenPriv = xcalloc( 1, sizeof(QuartzCursorScreenRec) );
+ if (!ScreenPriv) return FALSE;
+
+ CURSOR_PRIV(pScreen) = ScreenPriv;
+
+ // override some screen procedures
+ ScreenPriv->QueryBestSize = pScreen->QueryBestSize;
+ pScreen->QueryBestSize = QuartzCursorQueryBestSize;
+
+ // initialize QuickDraw cursor handling
+ GetQDGlobalsArrow(&gQDArrow);
+ PointPriv = (miPointerScreenPtr)
+ dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey);
+
+ ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
+ PointPriv->spriteFuncs = &quartzSpriteFuncsRec;
+
+ if (!quartzRootless)
+ ScreenPriv->useQDCursor = QuartzFSUseQDCursor(dfb->colorBitsPerPixel);
+ else
+ ScreenPriv->useQDCursor = TRUE;
+ ScreenPriv->qdCursorMode = TRUE;
+ ScreenPriv->qdCursorVisible = TRUE;
+
+ // initialize cursor mutex lock
+ pthread_mutex_init(&cursorMutex, NULL);
+
+ // initialize condition for waiting
+ pthread_cond_init(&cursorCondition, NULL);
+
+ return TRUE;
+}
+
+
+// X server is hiding. Restore the Aqua cursor.
+void QuartzSuspendXCursor(
+ ScreenPtr pScreen )
+{
+ QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ CHANGE_QD_CURSOR(NULL);
+ SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
+}
+
+
+// X server is showing. Restore the X cursor.
+void QuartzResumeXCursor(
+ ScreenPtr pScreen,
+ int x,
+ int y )
+{
+ QuartzSetCursor(pScreen, quartzLatentCursor, x, y);
+}
diff --git a/xorg-server/hw/xquartz/quartzCursor.h b/xorg-server/hw/xquartz/quartzCursor.h
new file mode 100644
index 000000000..56a02098d
--- /dev/null
+++ b/xorg-server/hw/xquartz/quartzCursor.h
@@ -0,0 +1,42 @@
+/*
+ * quartzCursor.h
+ *
+ * External interface for Quartz hardware cursor
+ *
+ * Copyright (c) 2001 Torrey T. Lyons and Greg Parker.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifndef QUARTZCURSOR_H
+#define QUARTZCURSOR_H
+
+#include "screenint.h"
+
+Bool QuartzInitCursor(ScreenPtr pScreen);
+void QuartzReallySetCursor(void);
+void QuartzSuspendXCursor(ScreenPtr pScreen);
+void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y);
+
+#endif
diff --git a/xorg-server/hw/xquartz/quartzForeground.c b/xorg-server/hw/xquartz/quartzForeground.c
new file mode 100644
index 000000000..0e724de76
--- /dev/null
+++ b/xorg-server/hw/xquartz/quartzForeground.c
@@ -0,0 +1,47 @@
+/* foreground.c - Push the current process into the foreground.
+
+ This is in a separate file because of Quartz/X type conflicts.
+
+ Copyright (c) 2007 Jeremy Huddleston
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name(s) of the above
+ copyright holders shall not be used in advertising or otherwise to
+ promote the sale, use or other dealings in this Software without
+ prior written authorization. */
+
+#include <ApplicationServices/ApplicationServices.h>
+#include <stdio.h>
+
+#include "quartzForeground.h"
+
+int QuartzMoveToForeground() {
+ ProcessSerialNumber psn = { 0, kCurrentProcess };
+ OSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication);
+ if( returnCode == 0) {
+ fprintf(stderr, "TransformProcessType: Success\n");
+ SetFrontProcess(&psn);
+ } else {
+ fprintf(stderr, "TransformProcessType: Failure\n");
+ }
+ return (int)returnCode;
+}
diff --git a/xorg-server/hw/xquartz/quartzForeground.h b/xorg-server/hw/xquartz/quartzForeground.h
new file mode 100644
index 000000000..b5422ff9c
--- /dev/null
+++ b/xorg-server/hw/xquartz/quartzForeground.h
@@ -0,0 +1,37 @@
+/* foreground.h - Push the current process into the foreground.
+
+ This is in a separate file because of Quartz/X type conflicts.
+
+ Copyright (c) 2007 Jeremy Huddleston
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name(s) of the above
+ copyright holders shall not be used in advertising or otherwise to
+ promote the sale, use or other dealings in this Software without
+ prior written authorization. */
+
+#ifndef _QUARTZ_FOREGROUND_H_
+#define _QUARTZ_FOREGROUND_H_
+
+int QuartzMoveToForeground(void);
+
+#endif /* _QUARTZ_FOREGROUND_H_ */
diff --git a/xorg-server/hw/xquartz/quartzKeyboard.c b/xorg-server/hw/xquartz/quartzKeyboard.c
new file mode 100644
index 000000000..9b899ca67
--- /dev/null
+++ b/xorg-server/hw/xquartz/quartzKeyboard.c
@@ -0,0 +1,324 @@
+/*
+ quartzKeyboard.c
+
+ Code to build a keymap using the Carbon Keyboard Layout API.
+
+ Copyright (c) 2003-2007 Apple Inc.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name(s) of the above
+ copyright holders shall not be used in advertising or otherwise to
+ promote the sale, use or other dealings in this Software without
+ prior written authorization.
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "quartzCommon.h"
+
+#include <CoreServices/CoreServices.h>
+#include <Carbon/Carbon.h>
+
+#include "quartzKeyboard.h"
+#include "X11/keysym.h"
+#include "keysym2ucs.h"
+
+#define HACK_MISSING 1
+#define HACK_KEYPAD 1
+
+enum {
+ MOD_COMMAND = 256,
+ MOD_SHIFT = 512,
+ MOD_OPTION = 2048,
+ MOD_CONTROL = 4096,
+};
+
+#define UKEYSYM(u) ((u) | 0x01000000)
+
+/* Table of keycode->keysym mappings we use to fallback on for important
+ keys that are often not in the Unicode mapping. */
+
+const static struct {
+ unsigned short keycode;
+ KeySym keysym;
+} known_keys[] = {
+ {55, XK_Meta_L},
+ {56, XK_Shift_L},
+ {57, XK_Caps_Lock},
+ {58, XK_Alt_L},
+ {59, XK_Control_L},
+
+ {60, XK_Shift_R},
+ {61, XK_Alt_R},
+ {62, XK_Control_R},
+ {63, XK_Meta_R},
+
+ {122, XK_F1},
+ {120, XK_F2},
+ {99, XK_F3},
+ {118, XK_F4},
+ {96, XK_F5},
+ {97, XK_F6},
+ {98, XK_F7},
+ {100, XK_F8},
+ {101, XK_F9},
+ {109, XK_F10},
+ {103, XK_F11},
+ {111, XK_F12},
+ {105, XK_F13},
+ {107, XK_F14},
+ {113, XK_F15},
+};
+
+/* Table of keycode->old,new-keysym mappings we use to fixup the numeric
+ keypad entries. */
+
+const static struct {
+ unsigned short keycode;
+ KeySym normal, keypad;
+} known_numeric_keys[] = {
+ {65, XK_period, XK_KP_Decimal},
+ {67, XK_asterisk, XK_KP_Multiply},
+ {69, XK_plus, XK_KP_Add},
+ {75, XK_slash, XK_KP_Divide},
+ {76, 0x01000003, XK_KP_Enter},
+ {78, XK_minus, XK_KP_Subtract},
+ {81, XK_equal, XK_KP_Equal},
+ {82, XK_0, XK_KP_0},
+ {83, XK_1, XK_KP_1},
+ {84, XK_2, XK_KP_2},
+ {85, XK_3, XK_KP_3},
+ {86, XK_4, XK_KP_4},
+ {87, XK_5, XK_KP_5},
+ {88, XK_6, XK_KP_6},
+ {89, XK_7, XK_KP_7},
+ {91, XK_8, XK_KP_8},
+ {92, XK_9, XK_KP_9},
+};
+
+/* Table mapping normal keysyms to their dead equivalents.
+ FIXME: all the unicode keysyms (apart from circumflex) were guessed. */
+
+const static struct {
+ KeySym normal, dead;
+} dead_keys[] = {
+ {XK_grave, XK_dead_grave},
+ {XK_acute, XK_dead_acute},
+ {XK_asciicircum, XK_dead_circumflex},
+ {UKEYSYM (0x2c6), XK_dead_circumflex}, /* MODIFIER LETTER CIRCUMFLEX ACCENT */
+ {XK_asciitilde, XK_dead_tilde},
+ {UKEYSYM (0x2dc), XK_dead_tilde}, /* SMALL TILDE */
+ {XK_macron, XK_dead_macron},
+ {XK_breve, XK_dead_breve},
+ {XK_abovedot, XK_dead_abovedot},
+ {XK_diaeresis, XK_dead_diaeresis},
+ {UKEYSYM (0x2da), XK_dead_abovering}, /* DOT ABOVE */
+ {XK_doubleacute, XK_dead_doubleacute},
+ {XK_caron, XK_dead_caron},
+ {XK_cedilla, XK_dead_cedilla},
+ {XK_ogonek, XK_dead_ogonek},
+ {UKEYSYM (0x269), XK_dead_iota}, /* LATIN SMALL LETTER IOTA */
+ {UKEYSYM (0x2ec), XK_dead_voiced_sound}, /* MODIFIER LETTER VOICING */
+/* {XK_semivoiced_sound, XK_dead_semivoiced_sound}, */
+ {UKEYSYM (0x323), XK_dead_belowdot}, /* COMBINING DOT BELOW */
+ {UKEYSYM (0x309), XK_dead_hook}, /* COMBINING HOOK ABOVE */
+ {UKEYSYM (0x31b), XK_dead_horn}, /* COMBINING HORN */
+};
+
+unsigned int QuartzSystemKeymapSeed(void) {
+ static unsigned int seed;
+ static KeyboardLayoutRef last_key_layout;
+ KeyboardLayoutRef key_layout;
+
+ KLGetCurrentKeyboardLayout (&key_layout);
+ if (key_layout != last_key_layout) seed++;
+ last_key_layout = key_layout;
+
+ return seed;
+}
+
+static inline UniChar macroman2ucs(unsigned char c) {
+ /* Precalculated table mapping MacRoman-128 to Unicode. Generated
+ by creating single element CFStringRefs then extracting the
+ first character. */
+
+ static const unsigned short table[128] = {
+ 0xc4, 0xc5, 0xc7, 0xc9, 0xd1, 0xd6, 0xdc, 0xe1,
+ 0xe0, 0xe2, 0xe4, 0xe3, 0xe5, 0xe7, 0xe9, 0xe8,
+ 0xea, 0xeb, 0xed, 0xec, 0xee, 0xef, 0xf1, 0xf3,
+ 0xf2, 0xf4, 0xf6, 0xf5, 0xfa, 0xf9, 0xfb, 0xfc,
+ 0x2020, 0xb0, 0xa2, 0xa3, 0xa7, 0x2022, 0xb6, 0xdf,
+ 0xae, 0xa9, 0x2122, 0xb4, 0xa8, 0x2260, 0xc6, 0xd8,
+ 0x221e, 0xb1, 0x2264, 0x2265, 0xa5, 0xb5, 0x2202, 0x2211,
+ 0x220f, 0x3c0, 0x222b, 0xaa, 0xba, 0x3a9, 0xe6, 0xf8,
+ 0xbf, 0xa1, 0xac, 0x221a, 0x192, 0x2248, 0x2206, 0xab,
+ 0xbb, 0x2026, 0xa0, 0xc0, 0xc3, 0xd5, 0x152, 0x153,
+ 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0xf7, 0x25ca,
+ 0xff, 0x178, 0x2044, 0x20ac, 0x2039, 0x203a, 0xfb01, 0xfb02,
+ 0x2021, 0xb7, 0x201a, 0x201e, 0x2030, 0xc2, 0xca, 0xc1,
+ 0xcb, 0xc8, 0xcd, 0xce, 0xcf, 0xcc, 0xd3, 0xd4,
+ 0xf8ff, 0xd2, 0xda, 0xdb, 0xd9, 0x131, 0x2c6, 0x2dc,
+ 0xaf, 0x2d8, 0x2d9, 0x2da, 0xb8, 0x2dd, 0x2db, 0x2c7,
+ };
+
+ if (c < 128) return c;
+ else return table[c - 128];
+}
+
+static KeySym make_dead_key(KeySym in) {
+ int i;
+
+ for (i = 0; i < sizeof (dead_keys) / sizeof (dead_keys[0]); i++)
+ if (dead_keys[i].normal == in) return dead_keys[i].dead;
+
+ return in;
+}
+
+Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) {
+ KeyboardLayoutRef key_layout;
+ const void *chr_data = NULL;
+ int num_keycodes = NUM_KEYCODES;
+ UInt32 keyboard_type = 0;
+ int is_uchr = 1, i, j;
+ OSStatus err;
+ KeySym *k;
+
+ TISInputSourceRef currentKeyLayoutRef = TISCopyCurrentKeyboardLayoutInputSource();
+ keyboard_type = LMGetKbdType ();
+ if (currentKeyLayoutRef) {
+ CFDataRef currentKeyLayoutDataRef = (CFDataRef )TISGetInputSourceProperty(currentKeyLayoutRef, kTISPropertyUnicodeKeyLayoutData);
+ if (currentKeyLayoutDataRef) chr_data = CFDataGetBytePtr(currentKeyLayoutDataRef);
+ }
+
+ if (chr_data == NULL) {
+ KLGetCurrentKeyboardLayout (&key_layout);
+ KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data);
+ }
+
+ if (chr_data == NULL) {
+ KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data);
+ is_uchr = 0;
+ num_keycodes = 128;
+ }
+
+ if (chr_data == NULL) {
+ ErrorF ( "Couldn't get uchr or kchr resource\n");
+ return FALSE;
+ }
+
+ /* Scan the keycode range for the Unicode character that each
+ key produces in the four shift states. Then convert that to
+ an X11 keysym (which may just the bit that says "this is
+ Unicode" if it can't find the real symbol.) */
+
+ for (i = 0; i < num_keycodes; i++) {
+ static const int mods[4] = {0, MOD_SHIFT, MOD_OPTION,
+ MOD_OPTION | MOD_SHIFT};
+
+ k = info->keyMap + i * GLYPHS_PER_KEY;
+
+ for (j = 0; j < 4; j++) {
+ if (is_uchr) {
+ UniChar s[8];
+ UniCharCount len;
+ UInt32 dead_key_state = 0, extra_dead = 0;
+
+ err = UCKeyTranslate (chr_data, i, kUCKeyActionDown,
+ mods[j] >> 8, keyboard_type, 0,
+ &dead_key_state, 8, &len, s);
+ if (err != noErr) continue;
+
+ if (len == 0 && dead_key_state != 0) {
+ /* Found a dead key. Work out which one it is, but
+ remembering that it's dead. */
+ err = UCKeyTranslate (chr_data, i, kUCKeyActionDown,
+ mods[j] >> 8, keyboard_type,
+ kUCKeyTranslateNoDeadKeysMask,
+ &extra_dead, 8, &len, s);
+ if (err != noErr) continue;
+ }
+
+ if (len > 0 && s[0] != 0x0010) {
+ k[j] = ucs2keysym (s[0]);
+ if (dead_key_state != 0) k[j] = make_dead_key (k[j]);
+ }
+ } else { // kchr
+ UInt32 c, state = 0, state2 = 0;
+ UInt16 code;
+
+ code = i | mods[j];
+ c = KeyTranslate (chr_data, code, &state);
+
+ /* Dead keys are only processed on key-down, so ask
+ to translate those events. When we find a dead key,
+ translating the matching key up event will give
+ us the actual dead character. */
+
+ if (state != 0)
+ c = KeyTranslate (chr_data, code | 128, &state2);
+
+ /* Characters seem to be in MacRoman encoding. */
+
+ if (c != 0 && c != 0x0010) {
+ k[j] = ucs2keysym (macroman2ucs (c & 255));
+
+ if (state != 0) k[j] = make_dead_key (k[j]);
+ }
+ }
+ }
+
+ if (k[3] == k[2]) k[3] = NoSymbol;
+ if (k[2] == k[1]) k[2] = NoSymbol;
+ if (k[1] == k[0]) k[1] = NoSymbol;
+ if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol;
+ }
+
+ /* Fix up some things that are normally missing.. */
+
+ if (HACK_MISSING) {
+ for (i = 0; i < sizeof (known_keys) / sizeof (known_keys[0]); i++) {
+ k = info->keyMap + known_keys[i].keycode * GLYPHS_PER_KEY;
+
+ if (k[0] == NoSymbol && k[1] == NoSymbol
+ && k[2] == NoSymbol && k[3] == NoSymbol)
+ k[0] = known_keys[i].keysym;
+ }
+ }
+
+ /* And some more things. We find the right symbols for the numeric
+ keypad, but not the KP_ keysyms. So try to convert known keycodes. */
+
+ if (HACK_KEYPAD) {
+ for (i = 0; i < sizeof (known_numeric_keys)
+ / sizeof (known_numeric_keys[0]); i++) {
+ k = info->keyMap + known_numeric_keys[i].keycode * GLYPHS_PER_KEY;
+
+ if (k[0] == known_numeric_keys[i].normal)
+ k[0] = known_numeric_keys[i].keypad;
+ }
+ }
+ if(currentKeyLayoutRef) CFRelease(currentKeyLayoutRef);
+
+ return TRUE;
+}
diff --git a/xorg-server/hw/xquartz/quartzKeyboard.h b/xorg-server/hw/xquartz/quartzKeyboard.h
new file mode 100644
index 000000000..0c7e70e48
--- /dev/null
+++ b/xorg-server/hw/xquartz/quartzKeyboard.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2003-2004 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifndef QUARTZ_KEYBOARD_H
+#define QUARTZ_KEYBOARD_H 1
+
+#define XK_TECHNICAL // needed to get XK_Escape
+#define XK_PUBLISHING
+#include "X11/keysym.h"
+#include "inputstr.h"
+
+// Each key can generate 4 glyphs. They are, in order:
+// unshifted, shifted, modeswitch unshifted, modeswitch shifted
+#define GLYPHS_PER_KEY 4
+#define NUM_KEYCODES 248 // NX_NUMKEYCODES might be better
+#define MIN_KEYCODE XkbMinLegalKeyCode // unfortunately, this isn't 0...
+#define MAX_KEYCODE NUM_KEYCODES + MIN_KEYCODE - 1
+
+typedef struct darwinKeyboardInfo_struct {
+ CARD8 modMap[MAP_LENGTH];
+ KeySym keyMap[MAP_LENGTH * GLYPHS_PER_KEY];
+ unsigned char modifierKeycodes[32][2];
+} darwinKeyboardInfo;
+
+/* These functions need to be implemented by XQuartz, XDarwin, etc. */
+void DarwinKeyboardReload(DeviceIntPtr pDev);
+Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info);
+unsigned int QuartzSystemKeymapSeed(void);
+
+#endif /* QUARTZ_KEYBOARD_H */
diff --git a/xorg-server/hw/xquartz/quartzPasteboard.c b/xorg-server/hw/xquartz/quartzPasteboard.c
new file mode 100644
index 000000000..0bf84f5d5
--- /dev/null
+++ b/xorg-server/hw/xquartz/quartzPasteboard.c
@@ -0,0 +1,145 @@
+/**************************************************************
+ * quartzPasteboard.c
+ *
+ * Aqua pasteboard <-> X cut buffer
+ * Greg Parker gparker@cs.stanford.edu March 8, 2001
+ **************************************************************/
+/*
+ * Copyright (c) 2001 Greg Parker. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "quartzPasteboard.h"
+
+#include <X11/Xatom.h>
+#include "windowstr.h"
+#include "propertyst.h"
+#include "scrnintstr.h"
+#include "selection.h"
+#include "globals.h"
+
+
+// Helper function to read the X11 cut buffer
+// FIXME: What about multiple screens? Currently, this reads the first
+// CUT_BUFFER0 from the first screen where the buffer content is a string.
+// Returns a string on the heap that the caller must free.
+// Returns NULL if there is no cut text or there is not enough memory.
+static char * QuartzReadCutBuffer(void)
+{
+ int rc, i;
+ char *text = NULL;
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ ScreenPtr pScreen = screenInfo.screens[i];
+ PropertyPtr pProp;
+
+ rc = dixLookupProperty(&pProp, WindowTable[pScreen->myNum],
+ XA_CUT_BUFFER0, serverClient, DixReadAccess);
+ if (rc != Success) continue;
+ if (pProp->type != XA_STRING) continue;
+ if (pProp->format != 8) continue;
+
+ text = xalloc(1 + pProp->size);
+ if (! text) continue;
+ memcpy(text, pProp->data, pProp->size);
+ text[pProp->size] = '\0';
+ return text;
+ }
+
+ // didn't find any text
+ return NULL;
+}
+
+// Write X cut buffer to Mac OS X pasteboard
+// Called by ProcessInputEvents() in response to request from X server thread.
+void QuartzWritePasteboard(void)
+{
+ char *text;
+ text = QuartzReadCutBuffer();
+ if (text) {
+ QuartzWriteCocoaPasteboard(text);
+ free(text);
+ }
+}
+
+#define strequal(a, b) (0 == strcmp((a), (b)))
+
+// Read Mac OS X pasteboard into X cut buffer
+// Called by ProcessInputEvents() in response to request from X server thread.
+void QuartzReadPasteboard(void)
+{
+ char *oldText = QuartzReadCutBuffer();
+ char *text = QuartzReadCocoaPasteboard();
+
+ // Compare text with current cut buffer contents.
+ // Change the buffer if both exist and are different
+ // OR if there is new text but no old text.
+ // Otherwise, don't clear the selection unnecessarily.
+
+ if ((text && oldText && !strequal(text, oldText)) ||
+ (text && !oldText)) {
+ int scrn, rc;
+ Selection *pSel;
+
+ for (scrn = 0; scrn < screenInfo.numScreens; scrn++) {
+ ScreenPtr pScreen = screenInfo.screens[scrn];
+ // Set the cut buffers on each screen
+ // fixme really on each screen?
+ dixChangeWindowProperty(serverClient, WindowTable[pScreen->myNum],
+ XA_CUT_BUFFER0, XA_STRING, 8, PropModeReplace,
+ strlen(text), (pointer)text, TRUE);
+ }
+
+ // Undo any current X selection (similar to code in dispatch.c)
+ // FIXME: what about secondary selection?
+ // FIXME: only touch first XA_PRIMARY selection?
+ rc = dixLookupSelection(&pSel, XA_PRIMARY, serverClient,
+ DixSetAttrAccess);
+ if (rc == Success) {
+ // Notify client if necessary
+ if (pSel->client) {
+ xEvent event;
+
+ event.u.u.type = SelectionClear;
+ event.u.selectionClear.time = GetTimeInMillis();
+ event.u.selectionClear.window = pSel->window;
+ event.u.selectionClear.atom = pSel->selection;
+ TryClientEvents(pSel->client, &event, 1, NoEventMask,
+ NoEventMask /*CantBeFiltered*/, NullGrab);
+ }
+
+ // Erase it
+ pSel->pWin = NullWindow;
+ pSel->window = None;
+ pSel->client = NullClient;
+ }
+ }
+
+ if (text) free(text);
+ if (oldText) free(oldText);
+}
diff --git a/xorg-server/hw/xquartz/quartzPasteboard.h b/xorg-server/hw/xquartz/quartzPasteboard.h
new file mode 100644
index 000000000..d6a8ee815
--- /dev/null
+++ b/xorg-server/hw/xquartz/quartzPasteboard.h
@@ -0,0 +1,44 @@
+/*
+ QuartzPasteboard.h
+
+ Mac OS X pasteboard <-> X cut buffer
+ Greg Parker gparker@cs.stanford.edu March 8, 2001
+*/
+/*
+ * Copyright (c) 2001 Greg Parker. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifndef _QUARTZPASTEBOARD_H
+#define _QUARTZPASTEBOARD_H
+
+// Aqua->X
+void QuartzReadPasteboard(void);
+char * QuartzReadCocoaPasteboard(void); // caller must free string
+
+// X->Aqua
+void QuartzWritePasteboard(void);
+void QuartzWriteCocoaPasteboard(char *text);
+
+#endif /* _QUARTZPASTEBOARD_H */
diff --git a/xorg-server/hw/xquartz/quartzStartup.c b/xorg-server/hw/xquartz/quartzStartup.c
new file mode 100644
index 000000000..e25e15583
--- /dev/null
+++ b/xorg-server/hw/xquartz/quartzStartup.c
@@ -0,0 +1,112 @@
+/**************************************************************
+ *
+ * Startup code for the Quartz Darwin X Server
+ *
+ * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <CoreFoundation/CoreFoundation.h>
+#include "quartzCommon.h"
+#include "X11Controller.h"
+#include "darwin.h"
+#include "quartz.h"
+#include "opaque.h"
+#include "micmap.h"
+
+#ifdef NDEBUG
+#undef NDEBUG
+#include <assert.h>
+#define NDEBUG 1
+#else
+#include <assert.h>
+#endif
+
+char **envpGlobal; // argcGlobal and argvGlobal
+ // are from dix/globals.c
+
+int main(int argc, char **argv, char **envp);
+void _InitHLTB(void);
+void DarwinHandleGUI(int argc, char **argv, char **envp);
+
+static void server_thread (void *arg) {
+ exit (main (argcGlobal, argvGlobal, envpGlobal));
+}
+
+/*
+ * DarwinHandleGUI
+ * This function is called first from main(). The first time
+ * it is called we start the Mac OS X front end. The front end
+ * will call main() again from another thread to run the X
+ * server. On the second call this function loads the user
+ * preferences set by the Mac OS X front end.
+ */
+void DarwinHandleGUI(int argc, char **argv, char **envp) {
+ static Bool been_here = FALSE;
+ int i;
+ int fd[2];
+
+ if (been_here) {
+ return;
+ }
+ been_here = TRUE;
+
+ // Make a pipe to pass events
+ assert( pipe(fd) == 0 );
+ darwinEventReadFD = fd[0];
+ darwinEventWriteFD = fd[1];
+ fcntl(darwinEventReadFD, F_SETFL, O_NONBLOCK);
+
+ // Store command line arguments to pass back to main()
+ argcGlobal = argc;
+ argvGlobal = argv;
+ envpGlobal = envp;
+
+ for (i = 1; i < argc; i++) {
+ // Display version info without starting Mac OS X UI if requested
+ if (!strcmp( argv[i], "-showconfig" ) || !strcmp( argv[i], "-version" )) {
+ DarwinPrintBanner();
+ exit(0);
+ }
+ }
+
+ /* Initially I ran the X server on the main thread, and received
+ events on the second thread. But now we may be using Carbon,
+ that needs to run on the main thread. (Otherwise, when it's
+ prebound, it will initialize itself on the wrong thread)
+
+ grr.. but doing that means that if the X thread gets scheduled
+ before the main thread when we're _not_ prebound, things fail,
+ so initialize by hand. */
+
+ _InitHLTB();
+ X11ControllerMain(argc, (const char **)argv, server_thread, NULL);
+ exit(0);
+}
diff --git a/xorg-server/hw/xquartz/xpr/Makefile.am b/xorg-server/hw/xquartz/xpr/Makefile.am
new file mode 100644
index 000000000..ae1b19297
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/Makefile.am
@@ -0,0 +1,78 @@
+bin_PROGRAMS = Xquartz
+
+AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS)
+AM_CPPFLAGS = \
+ -I$(srcdir) -I$(srcdir)/.. \
+ -I$(top_srcdir)/miext \
+ -I$(top_srcdir)/miext/rootless \
+ -I$(top_srcdir)/miext/rootless/safeAlpha
+
+Xquartz_SOURCES = \
+ appledri.c \
+ dri.c \
+ xprAppleWM.c \
+ xprCursor.c \
+ xprFrame.c \
+ xprScreen.c \
+ x-hash.c \
+ x-hook.c \
+ x-list.c
+
+Xquartz_LDADD = \
+ $(top_builddir)/hw/xquartz/libXquartz.la \
+ $(top_builddir)/dix/dixfonts.lo \
+ $(top_builddir)/config/libconfig.a \
+ $(top_builddir)/dix/libdix.la \
+ $(top_builddir)/os/libos.la \
+ $(top_builddir)/dix/libxpstubs.la \
+ $(top_builddir)/miext/shadow/libshadow.la \
+ $(top_builddir)/fb/libfb.la \
+ $(top_builddir)/mi/libmi.la \
+ $(top_builddir)/composite/libcomposite.la \
+ $(top_builddir)/damageext/libdamageext.la \
+ $(top_builddir)/miext/damage/libdamage.la \
+ $(top_builddir)/xfixes/libxfixes.la \
+ $(top_builddir)/miext/cw/libcw.la \
+ $(top_builddir)/Xext/libXext.la \
+ $(top_builddir)/xkb/libxkb.la \
+ $(top_builddir)/xkb/libxkbstubs.la \
+ $(top_builddir)/Xi/libXi.la \
+ $(top_builddir)/dbe/libdbe.la \
+ $(top_builddir)/record/librecord.la \
+ $(top_builddir)/XTrap/libxtrap.la \
+ $(top_builddir)/miext/rootless/librootless.la \
+ $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \
+ $(top_builddir)/miext/rootless/accel/librlAccel.la \
+ $(DARWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lXplugin
+
+Xquartz_LDFLAGS = \
+ -XCClinker -Objc \
+ -Wl,-u,_miDCInitialize \
+ -Wl,-framework,Carbon \
+ -L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL \
+ -Wl,-framework,OpenGL \
+ -Wl,-framework,Cocoa \
+ -Wl,-framework,CoreAudio \
+ -Wl,-framework,IOKit
+
+appmandir = $(APP_MAN_DIR)
+appman_PRE = Xquartz.man.pre
+appman_PROCESSED = $(appman_PRE:man.pre=man)
+appman_DATA = $(appman_PRE:man.pre=@APP_MAN_SUFFIX@)
+
+CLEANFILES = $(appman_PROCESSED) $(appman_DATA)
+
+include $(top_srcdir)/cpprules.in
+
+.man.$(APP_MAN_SUFFIX):
+ cp $< $@
+
+EXTRA_DIST = \
+ dri.h \
+ dristruct.h \
+ appledri.h \
+ appledristr.h \
+ x-hash.h \
+ x-hook.h \
+ x-list.h \
+ xpr.h
diff --git a/xorg-server/hw/xquartz/xpr/Makefile.in b/xorg-server/hw/xquartz/xpr/Makefile.in
new file mode 100644
index 000000000..6f3dcb75c
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/Makefile.in
@@ -0,0 +1,847 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# -*- Makefile -*-
+# Rules for generating files using the C pre-processor
+# (Replaces CppFileTarget from Imake)
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = Xquartz$(EXEEXT)
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/cpprules.in
+subdir = hw/xquartz/xpr
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \
+ $(top_builddir)/include/xorg-server.h \
+ $(top_builddir)/include/dix-config.h \
+ $(top_builddir)/include/xgl-config.h \
+ $(top_builddir)/include/xorg-config.h \
+ $(top_builddir)/include/xkb-config.h \
+ $(top_builddir)/include/xwin-config.h \
+ $(top_builddir)/include/kdrive-config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_Xquartz_OBJECTS = appledri.$(OBJEXT) dri.$(OBJEXT) \
+ xprAppleWM.$(OBJEXT) xprCursor.$(OBJEXT) xprFrame.$(OBJEXT) \
+ xprScreen.$(OBJEXT) x-hash.$(OBJEXT) x-hook.$(OBJEXT) \
+ x-list.$(OBJEXT)
+Xquartz_OBJECTS = $(am_Xquartz_OBJECTS)
+am__DEPENDENCIES_1 =
+Xquartz_DEPENDENCIES = $(top_builddir)/hw/xquartz/libXquartz.la \
+ $(top_builddir)/dix/dixfonts.lo \
+ $(top_builddir)/config/libconfig.a \
+ $(top_builddir)/dix/libdix.la $(top_builddir)/os/libos.la \
+ $(top_builddir)/dix/libxpstubs.la \
+ $(top_builddir)/miext/shadow/libshadow.la \
+ $(top_builddir)/fb/libfb.la $(top_builddir)/mi/libmi.la \
+ $(top_builddir)/composite/libcomposite.la \
+ $(top_builddir)/damageext/libdamageext.la \
+ $(top_builddir)/miext/damage/libdamage.la \
+ $(top_builddir)/xfixes/libxfixes.la \
+ $(top_builddir)/miext/cw/libcw.la \
+ $(top_builddir)/Xext/libXext.la $(top_builddir)/xkb/libxkb.la \
+ $(top_builddir)/xkb/libxkbstubs.la $(top_builddir)/Xi/libXi.la \
+ $(top_builddir)/dbe/libdbe.la \
+ $(top_builddir)/record/librecord.la \
+ $(top_builddir)/XTrap/libxtrap.la \
+ $(top_builddir)/miext/rootless/librootless.la \
+ $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \
+ $(top_builddir)/miext/rootless/accel/librlAccel.la \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+Xquartz_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(Xquartz_LDFLAGS) \
+ $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(Xquartz_SOURCES)
+DIST_SOURCES = $(Xquartz_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+appmanDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(appman_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
+ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+APPDEFAULTDIR = @APPDEFAULTDIR@
+APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@
+APP_MAN_DIR = @APP_MAN_DIR@
+APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASE_FONT_PATH = @BASE_FONT_PATH@
+BUILD_DATE = @BUILD_DATE@
+BUILD_TIME = @BUILD_TIME@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DARWIN_LIBS = @DARWIN_LIBS@
+DBUS_CFLAGS = @DBUS_CFLAGS@
+DBUS_LIBS = @DBUS_LIBS@
+DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@
+DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@
+DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DGA_CFLAGS = @DGA_CFLAGS@
+DGA_LIBS = @DGA_LIBS@
+DIX_CFLAGS = @DIX_CFLAGS@
+DLLTOOL = @DLLTOOL@
+DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@
+DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@
+DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@
+DMXMODULES_LIBS = @DMXMODULES_LIBS@
+DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@
+DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@
+DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@
+DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@
+DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
+DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
+DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
+DRIPROTO_LIBS = @DRIPROTO_LIBS@
+DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
+DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
+DRI_DRIVER_PATH = @DRI_DRIVER_PATH@
+DSYMUTIL = @DSYMUTIL@
+DTRACE = @DTRACE@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
+FREETYPE_LIBS = @FREETYPE_LIBS@
+GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
+GLX_DEFINES = @GLX_DEFINES@
+GL_CFLAGS = @GL_CFLAGS@
+GL_LIBS = @GL_LIBS@
+GREP = @GREP@
+HAL_CFLAGS = @HAL_CFLAGS@
+HAL_LIBS = @HAL_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDRIVE_CFLAGS = @KDRIVE_CFLAGS@
+KDRIVE_INCS = @KDRIVE_INCS@
+KDRIVE_LIBS = @KDRIVE_LIBS@
+KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@
+KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@
+KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@
+LAUNCHD = @LAUNCHD@
+LDFLAGS = @LDFLAGS@
+LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
+LIBDRM_LIBS = @LIBDRM_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_MAN_DIR = @LIB_MAN_DIR@
+LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
+LINUXDOC = @LINUXDOC@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MAKE_HTML = @MAKE_HTML@
+MAKE_PDF = @MAKE_PDF@
+MAKE_PS = @MAKE_PS@
+MAKE_TEXT = @MAKE_TEXT@
+MESA_SOURCE = @MESA_SOURCE@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+MKFONTDIR = @MKFONTDIR@
+MKFONTSCALE = @MKFONTSCALE@
+NMEDIT = @NMEDIT@
+OBJC = @OBJC@
+OBJCCLD = @OBJCCLD@
+OBJCDEPMODE = @OBJCDEPMODE@
+OBJCFLAGS = @OBJCFLAGS@
+OBJCLINK = @OBJCLINK@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
+OPENSSL_LIBS = @OPENSSL_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
+PCIACCESS_LIBS = @PCIACCESS_LIBS@
+PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@
+PERL = @PERL@
+PKG_CONFIG = @PKG_CONFIG@
+PROJECTROOT = @PROJECTROOT@
+PS2PDF = @PS2PDF@
+RANLIB = @RANLIB@
+RAWCPP = @RAWCPP@
+RAWCPPFLAGS = @RAWCPPFLAGS@
+SED = sed
+SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@
+SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@
+STRIP = @STRIP@
+TSLIB_CFLAGS = @TSLIB_CFLAGS@
+TSLIB_LIBS = @TSLIB_LIBS@
+UTILS_SYS_LIBS = @UTILS_SYS_LIBS@
+VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@
+VENDOR_NAME = @VENDOR_NAME@
+VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@
+VENDOR_RELEASE = @VENDOR_RELEASE@
+VERSION = @VERSION@
+X11APP_ARCHS = @X11APP_ARCHS@
+X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
+X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@
+XDMCP_CFLAGS = @XDMCP_CFLAGS@
+XDMCP_LIBS = @XDMCP_LIBS@
+XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@
+XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@
+XDMX_CFLAGS = @XDMX_CFLAGS@
+XDMX_LIBS = @XDMX_LIBS@
+XDMX_SYS_LIBS = @XDMX_SYS_LIBS@
+XEGLMODULES_CFLAGS = @XEGLMODULES_CFLAGS@
+XEGL_LIBS = @XEGL_LIBS@
+XEGL_SYS_LIBS = @XEGL_SYS_LIBS@
+XEPHYR_CFLAGS = @XEPHYR_CFLAGS@
+XEPHYR_DRI_LIBS = @XEPHYR_DRI_LIBS@
+XEPHYR_INCS = @XEPHYR_INCS@
+XEPHYR_LIBS = @XEPHYR_LIBS@
+XF86CONFIGFILE = @XF86CONFIGFILE@
+XF86MISC_CFLAGS = @XF86MISC_CFLAGS@
+XF86MISC_LIBS = @XF86MISC_LIBS@
+XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@
+XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@
+XGLMODULES_CFLAGS = @XGLMODULES_CFLAGS@
+XGLMODULES_LIBS = @XGLMODULES_LIBS@
+XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@
+XGLXMODULES_LIBS = @XGLXMODULES_LIBS@
+XGLX_LIBS = @XGLX_LIBS@
+XGLX_SYS_LIBS = @XGLX_SYS_LIBS@
+XGL_LIBS = @XGL_LIBS@
+XGL_MODULE_PATH = @XGL_MODULE_PATH@
+XGL_SYS_LIBS = @XGL_SYS_LIBS@
+XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@
+XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@
+XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
+XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@
+XLIB_CFLAGS = @XLIB_CFLAGS@
+XLIB_LIBS = @XLIB_LIBS@
+XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@
+XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
+XNEST_LIBS = @XNEST_LIBS@
+XNEST_SYS_LIBS = @XNEST_SYS_LIBS@
+XORGCFG_DEP_CFLAGS = @XORGCFG_DEP_CFLAGS@
+XORGCFG_DEP_LIBS = @XORGCFG_DEP_LIBS@
+XORGCONFIG_DEP_CFLAGS = @XORGCONFIG_DEP_CFLAGS@
+XORGCONFIG_DEP_LIBS = @XORGCONFIG_DEP_LIBS@
+XORG_CFLAGS = @XORG_CFLAGS@
+XORG_INCS = @XORG_INCS@
+XORG_LIBS = @XORG_LIBS@
+XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@
+XORG_MODULES_LIBS = @XORG_MODULES_LIBS@
+XORG_OS = @XORG_OS@
+XORG_OS_SUBDIR = @XORG_OS_SUBDIR@
+XORG_SYS_LIBS = @XORG_SYS_LIBS@
+XPRINTMODULES_CFLAGS = @XPRINTMODULES_CFLAGS@
+XPRINTMODULES_LIBS = @XPRINTMODULES_LIBS@
+XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@
+XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@
+XPRINT_CFLAGS = @XPRINT_CFLAGS@
+XPRINT_LIBS = @XPRINT_LIBS@
+XPRINT_SYS_LIBS = @XPRINT_SYS_LIBS@
+XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
+XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
+XSDL_INCS = @XSDL_INCS@
+XSDL_LIBS = @XSDL_LIBS@
+XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@
+XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@
+XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@
+XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@
+XSERVER_LIBS = @XSERVER_LIBS@
+XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@
+XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@
+XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@
+XVFB_LIBS = @XVFB_LIBS@
+XVFB_SYS_LIBS = @XVFB_SYS_LIBS@
+XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@
+XWINMODULES_LIBS = @XWINMODULES_LIBS@
+XWIN_LIBS = @XWIN_LIBS@
+XWIN_SERVER_NAME = @XWIN_SERVER_NAME@
+XWIN_SYS_LIBS = @XWIN_SYS_LIBS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+__XCONFIGFILE__ = @__XCONFIGFILE__@
+abi_ansic = @abi_ansic@
+abi_extension = @abi_extension@
+abi_font = @abi_font@
+abi_videodrv = @abi_videodrv@
+abi_xinput = @abi_xinput@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+driverdir = @driverdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+extdir = @extdir@
+ft_config = @ft_config@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+launchagentsdir = @launchagentsdir@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+logdir = @logdir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+moduledir = @moduledir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sdkdir = @sdkdir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+xglmoduledir = @xglmoduledir@
+xpconfigdir = @xpconfigdir@
+AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS)
+AM_CPPFLAGS = \
+ -I$(srcdir) -I$(srcdir)/.. \
+ -I$(top_srcdir)/miext \
+ -I$(top_srcdir)/miext/rootless \
+ -I$(top_srcdir)/miext/rootless/safeAlpha
+
+Xquartz_SOURCES = \
+ appledri.c \
+ dri.c \
+ xprAppleWM.c \
+ xprCursor.c \
+ xprFrame.c \
+ xprScreen.c \
+ x-hash.c \
+ x-hook.c \
+ x-list.c
+
+Xquartz_LDADD = \
+ $(top_builddir)/hw/xquartz/libXquartz.la \
+ $(top_builddir)/dix/dixfonts.lo \
+ $(top_builddir)/config/libconfig.a \
+ $(top_builddir)/dix/libdix.la \
+ $(top_builddir)/os/libos.la \
+ $(top_builddir)/dix/libxpstubs.la \
+ $(top_builddir)/miext/shadow/libshadow.la \
+ $(top_builddir)/fb/libfb.la \
+ $(top_builddir)/mi/libmi.la \
+ $(top_builddir)/composite/libcomposite.la \
+ $(top_builddir)/damageext/libdamageext.la \
+ $(top_builddir)/miext/damage/libdamage.la \
+ $(top_builddir)/xfixes/libxfixes.la \
+ $(top_builddir)/miext/cw/libcw.la \
+ $(top_builddir)/Xext/libXext.la \
+ $(top_builddir)/xkb/libxkb.la \
+ $(top_builddir)/xkb/libxkbstubs.la \
+ $(top_builddir)/Xi/libXi.la \
+ $(top_builddir)/dbe/libdbe.la \
+ $(top_builddir)/record/librecord.la \
+ $(top_builddir)/XTrap/libxtrap.la \
+ $(top_builddir)/miext/rootless/librootless.la \
+ $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \
+ $(top_builddir)/miext/rootless/accel/librlAccel.la \
+ $(DARWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lXplugin
+
+Xquartz_LDFLAGS = \
+ -XCClinker -Objc \
+ -Wl,-u,_miDCInitialize \
+ -Wl,-framework,Carbon \
+ -L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL \
+ -Wl,-framework,OpenGL \
+ -Wl,-framework,Cocoa \
+ -Wl,-framework,CoreAudio \
+ -Wl,-framework,IOKit
+
+appmandir = $(APP_MAN_DIR)
+appman_PRE = Xquartz.man.pre
+appman_PROCESSED = $(appman_PRE:man.pre=man)
+appman_DATA = $(appman_PRE:man.pre=@APP_MAN_SUFFIX@)
+CLEANFILES = $(appman_PROCESSED) $(appman_DATA)
+SUFFIXES = .pre .man .man.pre
+
+# Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM
+# to cpp, because that trick does not work on all ANSI C preprocessors.
+# Delete line numbers from the cpp output (-P is not portable, I guess).
+# Allow XCOMM to be preceded by whitespace and provide a means of generating
+# output lines with trailing backslashes.
+# Allow XHASH to always be substituted, even in cases where XCOMM isn't.
+CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \
+ -e '/^\#line *[0-9][0-9]* *.*$$/d' \
+ -e '/^[ ]*XCOMM$$/s/XCOMM/\#/' \
+ -e '/^[ ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \
+ -e '/^[ ]*XHASH/s/XHASH/\#/' \
+ -e '/\@\@$$/s/\@\@$$/\\/'
+
+
+# Strings to replace in man pages
+XORGRELSTRING = @PACKAGE_STRING@
+XORGMANNAME = X Version 11
+XSERVERNAME = Xorg
+MANDEFS = \
+ -D__vendorversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
+ -D__xorgversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
+ -D__appmansuffix__=$(APP_MAN_SUFFIX) \
+ -D__filemansuffix__=$(FILE_MAN_SUFFIX) \
+ -D__libmansuffix__=$(LIB_MAN_SUFFIX) \
+ -D__miscmansuffix__=$(MISC_MAN_SUFFIX) \
+ -D__drivermansuffix__=$(DRIVER_MAN_SUFFIX) \
+ -D__adminmansuffix__=$(ADMIN_MAN_SUFFIX) \
+ -D__mandir__=$(mandir) \
+ -D__projectroot__=$(prefix) \
+ -D__xconfigfile__=$(__XCONFIGFILE__) -D__xconfigdir__=$(XCONFIGDIR) \
+ -D__xlogfile__=$(XLOGFILE) -D__xservername__=$(XSERVERNAME)
+
+EXTRA_DIST = \
+ dri.h \
+ dristruct.h \
+ appledri.h \
+ appledristr.h \
+ x-hash.h \
+ x-hook.h \
+ x-list.h \
+ xpr.h
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .pre .man .man.pre .$(APP_MAN_SUFFIX) .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/cpprules.in $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xquartz/xpr/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign hw/xquartz/xpr/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+Xquartz$(EXEEXT): $(Xquartz_OBJECTS) $(Xquartz_DEPENDENCIES)
+ @rm -f Xquartz$(EXEEXT)
+ $(Xquartz_LINK) $(Xquartz_OBJECTS) $(Xquartz_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/appledri.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x-hash.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x-hook.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x-list.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprAppleWM.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprCursor.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprFrame.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprScreen.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-appmanDATA: $(appman_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)"
+ @list='$(appman_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(appmanDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(appmandir)/$$f'"; \
+ $(appmanDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(appmandir)/$$f"; \
+ done
+
+uninstall-appmanDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(appman_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(appmandir)/$$f'"; \
+ rm -f "$(DESTDIR)$(appmandir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-appmanDATA uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libtool ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-appmanDATA install-binPROGRAMS install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-appmanDATA \
+ uninstall-binPROGRAMS
+
+
+.pre:
+ $(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@
+
+.man.pre.man:
+ $(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@
+
+.man.$(APP_MAN_SUFFIX):
+ cp $< $@
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/xorg-server/hw/xquartz/xpr/appledri.c b/xorg-server/hw/xquartz/xpr/appledri.c
new file mode 100644
index 000000000..b4a4725e2
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/appledri.c
@@ -0,0 +1,352 @@
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright 2000 VA Linux Systems, Inc.
+Copyright (c) 2002 Apple Computer, Inc.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <martin@valinux.com>
+ * Jens Owen <jens@valinux.com>
+ * Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#define NEED_REPLIES
+#define NEED_EVENTS
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "colormapst.h"
+#include "cursorstr.h"
+#include "scrnintstr.h"
+#include "servermd.h"
+#define _APPLEDRI_SERVER_
+#include "appledristr.h"
+#include "swaprep.h"
+#include "dri.h"
+#include "dristruct.h"
+#include "xpr.h"
+
+static int DRIErrorBase = 0;
+
+static DISPATCH_PROC(ProcAppleDRIDispatch);
+static DISPATCH_PROC(SProcAppleDRIDispatch);
+
+static void AppleDRIResetProc(ExtensionEntry* extEntry);
+
+static unsigned char DRIReqCode = 0;
+static int DRIEventBase = 0;
+
+static void SNotifyEvent(xAppleDRINotifyEvent *from, xAppleDRINotifyEvent *to);
+
+typedef struct _DRIEvent *DRIEventPtr;
+typedef struct _DRIEvent {
+ DRIEventPtr next;
+ ClientPtr client;
+ XID clientResource;
+ unsigned int mask;
+} DRIEventRec;
+
+
+void
+AppleDRIExtensionInit(void)
+{
+ ExtensionEntry* extEntry;
+
+ if (DRIExtensionInit() &&
+ (extEntry = AddExtension(APPLEDRINAME,
+ AppleDRINumberEvents,
+ AppleDRINumberErrors,
+ ProcAppleDRIDispatch,
+ SProcAppleDRIDispatch,
+ AppleDRIResetProc,
+ StandardMinorOpcode))) {
+ DRIReqCode = (unsigned char)extEntry->base;
+ DRIErrorBase = extEntry->errorBase;
+ DRIEventBase = extEntry->eventBase;
+ EventSwapVector[DRIEventBase] = (EventSwapPtr) SNotifyEvent;
+ }
+}
+
+/*ARGSUSED*/
+static void
+AppleDRIResetProc (
+ ExtensionEntry* extEntry
+)
+{
+ DRIReset();
+}
+
+static int
+ProcAppleDRIQueryVersion(
+ register ClientPtr client
+)
+{
+ xAppleDRIQueryVersionReply rep;
+ register int n;
+
+ REQUEST_SIZE_MATCH(xAppleDRIQueryVersionReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = APPLE_DRI_MAJOR_VERSION;
+ rep.minorVersion = APPLE_DRI_MINOR_VERSION;
+ rep.patchVersion = APPLE_DRI_PATCH_VERSION;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ }
+ WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+
+/* surfaces */
+
+static int
+ProcAppleDRIQueryDirectRenderingCapable(
+ register ClientPtr client
+)
+{
+ xAppleDRIQueryDirectRenderingCapableReply rep;
+ Bool isCapable;
+
+ REQUEST(xAppleDRIQueryDirectRenderingCapableReq);
+ REQUEST_SIZE_MATCH(xAppleDRIQueryDirectRenderingCapableReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!DRIQueryDirectRenderingCapable( screenInfo.screens[stuff->screen],
+ &isCapable)) {
+ return BadValue;
+ }
+ rep.isCapable = isCapable;
+
+ if (!LocalClient(client))
+ rep.isCapable = 0;
+
+ WriteToClient(client,
+ sizeof(xAppleDRIQueryDirectRenderingCapableReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcAppleDRIAuthConnection(
+ register ClientPtr client
+)
+{
+ xAppleDRIAuthConnectionReply rep;
+
+ REQUEST(xAppleDRIAuthConnectionReq);
+ REQUEST_SIZE_MATCH(xAppleDRIAuthConnectionReq);
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.authenticated = 1;
+
+ if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) {
+ ErrorF("Failed to authenticate %u\n", (unsigned int)stuff->magic);
+ rep.authenticated = 0;
+ }
+ WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static void surface_notify(
+ void *_arg,
+ void *data
+)
+{
+ DRISurfaceNotifyArg *arg = _arg;
+ int client_index = (int) data;
+ ClientPtr client;
+ xAppleDRINotifyEvent se;
+
+ if (client_index < 0 || client_index >= currentMaxClients)
+ return;
+
+ client = clients[client_index];
+ if (client == NULL || client == serverClient || client->clientGone)
+ return;
+
+ se.type = DRIEventBase + AppleDRISurfaceNotify;
+ se.kind = arg->kind;
+ se.arg = arg->id;
+ se.sequenceNumber = client->sequence;
+ se.time = currentTime.milliseconds;
+ WriteEventsToClient (client, 1, (xEvent *) &se);
+}
+
+static int
+ProcAppleDRICreateSurface(
+ ClientPtr client
+)
+{
+ xAppleDRICreateSurfaceReply rep;
+ DrawablePtr pDrawable;
+ xp_surface_id sid;
+ unsigned int key[2];
+ int rc;
+
+ REQUEST(xAppleDRICreateSurfaceReq);
+ REQUEST_SIZE_MATCH(xAppleDRICreateSurfaceReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
+ DixReadAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.key_0 = rep.key_1 = rep.uid = 0;
+
+ if (!DRICreateSurface( screenInfo.screens[stuff->screen],
+ (Drawable)stuff->drawable, pDrawable,
+ stuff->client_id, &sid, key,
+ surface_notify, (void *) client->index)) {
+ return BadValue;
+ }
+
+ rep.key_0 = key[0];
+ rep.key_1 = key[1];
+ rep.uid = sid;
+
+ WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcAppleDRIDestroySurface(
+ register ClientPtr client
+)
+{
+ REQUEST(xAppleDRIDestroySurfaceReq);
+ DrawablePtr pDrawable;
+ REQUEST_SIZE_MATCH(xAppleDRIDestroySurfaceReq);
+ int rc;
+
+ rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
+ DixReadAccess);
+ if (rc != Success)
+ return rc;
+
+ if (!DRIDestroySurface( screenInfo.screens[stuff->screen],
+ (Drawable)stuff->drawable,
+ pDrawable, NULL, NULL)) {
+ return BadValue;
+ }
+
+ return (client->noClientException);
+}
+
+
+/* dispatch */
+
+static int
+ProcAppleDRIDispatch (
+ register ClientPtr client
+)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data)
+ {
+ case X_AppleDRIQueryVersion:
+ return ProcAppleDRIQueryVersion(client);
+ case X_AppleDRIQueryDirectRenderingCapable:
+ return ProcAppleDRIQueryDirectRenderingCapable(client);
+ }
+
+ if (!LocalClient(client))
+ return DRIErrorBase + AppleDRIClientNotLocal;
+
+ switch (stuff->data)
+ {
+ case X_AppleDRIAuthConnection:
+ return ProcAppleDRIAuthConnection(client);
+ case X_AppleDRICreateSurface:
+ return ProcAppleDRICreateSurface(client);
+ case X_AppleDRIDestroySurface:
+ return ProcAppleDRIDestroySurface(client);
+ default:
+ return BadRequest;
+ }
+}
+
+static void
+SNotifyEvent(
+ xAppleDRINotifyEvent *from,
+ xAppleDRINotifyEvent *to
+)
+{
+ to->type = from->type;
+ to->kind = from->kind;
+ cpswaps (from->sequenceNumber, to->sequenceNumber);
+ cpswapl (from->time, to->time);
+ cpswapl (from->arg, to->arg);
+}
+
+static int
+SProcAppleDRIQueryVersion(
+ register ClientPtr client
+)
+{
+ register int n;
+ REQUEST(xAppleDRIQueryVersionReq);
+ swaps(&stuff->length, n);
+ return ProcAppleDRIQueryVersion(client);
+}
+
+static int
+SProcAppleDRIDispatch (
+ register ClientPtr client
+)
+{
+ REQUEST(xReq);
+
+ /* It is bound to be non-local when there is byte swapping */
+ if (!LocalClient(client))
+ return DRIErrorBase + AppleDRIClientNotLocal;
+
+ /* only local clients are allowed DRI access */
+ switch (stuff->data)
+ {
+ case X_AppleDRIQueryVersion:
+ return SProcAppleDRIQueryVersion(client);
+ default:
+ return BadRequest;
+ }
+}
diff --git a/xorg-server/hw/xquartz/xpr/appledri.h b/xorg-server/hw/xquartz/xpr/appledri.h
new file mode 100644
index 000000000..c4e43be12
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/appledri.h
@@ -0,0 +1,106 @@
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright 2000 VA Linux Systems, Inc.
+Copyright (c) 2002 Apple Computer, Inc.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <martin@valinux.com>
+ * Jens Owen <jens@valinux.com>
+ * Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ */
+
+#ifndef _APPLEDRI_H_
+#define _APPLEDRI_H_
+
+#include <X11/Xfuncproto.h>
+
+#define X_AppleDRIQueryVersion 0
+#define X_AppleDRIQueryDirectRenderingCapable 1
+#define X_AppleDRICreateSurface 2
+#define X_AppleDRIDestroySurface 3
+#define X_AppleDRIAuthConnection 4
+/* Requests up to and including 18 were used in a previous version */
+
+/* Events */
+#define AppleDRIObsoleteEvent1 0
+#define AppleDRIObsoleteEvent2 1
+#define AppleDRIObsoleteEvent3 2
+#define AppleDRISurfaceNotify 3
+#define AppleDRINumberEvents 4
+
+/* Errors */
+#define AppleDRIClientNotLocal 0
+#define AppleDRIOperationNotSupported 1
+#define AppleDRINumberErrors (AppleDRIOperationNotSupported + 1)
+
+/* Kinds of SurfaceNotify events: */
+#define AppleDRISurfaceNotifyChanged 0
+#define AppleDRISurfaceNotifyDestroyed 1
+
+#ifndef _APPLEDRI_SERVER_
+
+typedef struct {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came frome a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* window of event */
+ Time time; /* server timestamp when event happened */
+ int kind; /* subtype of event */
+ int arg;
+} XAppleDRINotifyEvent;
+
+_XFUNCPROTOBEGIN
+
+Bool XAppleDRIQueryExtension (Display *dpy, int *event_base, int *error_base);
+
+Bool XAppleDRIQueryVersion (Display *dpy, int *majorVersion,
+ int *minorVersion, int *patchVersion);
+
+Bool XAppleDRIQueryDirectRenderingCapable (Display *dpy, int screen,
+ Bool *isCapable);
+
+void *XAppleDRISetSurfaceNotifyHandler (void (*fun) (Display *dpy,
+ unsigned uid, int kind));
+
+Bool XAppleDRIAuthConnection (Display *dpy, int screen, unsigned int magic);
+
+Bool XAppleDRICreateSurface (Display *dpy, int screen, Drawable drawable,
+ unsigned int client_id, unsigned int key[2],
+ unsigned int* uid);
+
+Bool XAppleDRIDestroySurface (Display *dpy, int screen, Drawable drawable);
+
+Bool XAppleDRISynchronizeSurfaces (Display *dpy);
+
+_XFUNCPROTOEND
+
+#endif /* _APPLEDRI_SERVER_ */
+#endif /* _APPLEDRI_H_ */
+
diff --git a/xorg-server/hw/xquartz/xpr/appledristr.h b/xorg-server/hw/xquartz/xpr/appledristr.h
new file mode 100644
index 000000000..8649fd329
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/appledristr.h
@@ -0,0 +1,175 @@
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright 2000 VA Linux Systems, Inc.
+Copyright (c) 2002 Apple Computer, Inc.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <martin@valinux.com>
+ * Jens Owen <jens@valinux.com>
+ * Rickard E. (Rik) Fiath <faith@valinux.com>
+ *
+ */
+
+#ifndef _APPLEDRISTR_H_
+#define _APPLEDRISTR_H_
+
+#include "appledri.h"
+
+#define APPLEDRINAME "Apple-DRI"
+
+#define APPLE_DRI_MAJOR_VERSION 1 /* current version numbers */
+#define APPLE_DRI_MINOR_VERSION 0
+#define APPLE_DRI_PATCH_VERSION 0
+
+typedef struct _AppleDRIQueryVersion {
+ CARD8 reqType; /* always DRIReqCode */
+ CARD8 driReqType; /* always X_DRIQueryVersion */
+ CARD16 length B16;
+} xAppleDRIQueryVersionReq;
+#define sz_xAppleDRIQueryVersionReq 4
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 majorVersion B16; /* major version of DRI protocol */
+ CARD16 minorVersion B16; /* minor version of DRI protocol */
+ CARD32 patchVersion B32; /* patch version of DRI protocol */
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xAppleDRIQueryVersionReply;
+#define sz_xAppleDRIQueryVersionReply 32
+
+typedef struct _AppleDRIQueryDirectRenderingCapable {
+ CARD8 reqType; /* always DRIReqCode */
+ CARD8 driReqType; /* X_DRIQueryDirectRenderingCapable */
+ CARD16 length B16;
+ CARD32 screen B32;
+} xAppleDRIQueryDirectRenderingCapableReq;
+#define sz_xAppleDRIQueryDirectRenderingCapableReq 8
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ BOOL isCapable;
+ BOOL pad2;
+ BOOL pad3;
+ BOOL pad4;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ CARD32 pad8 B32;
+ CARD32 pad9 B32;
+} xAppleDRIQueryDirectRenderingCapableReply;
+#define sz_xAppleDRIQueryDirectRenderingCapableReply 32
+
+typedef struct _AppleDRIAuthConnection {
+ CARD8 reqType; /* always DRIReqCode */
+ CARD8 driReqType; /* always X_DRICloseConnection */
+ CARD16 length B16;
+ CARD32 screen B32;
+ CARD32 magic B32;
+} xAppleDRIAuthConnectionReq;
+#define sz_xAppleDRIAuthConnectionReq 12
+
+typedef struct {
+ BYTE type;
+ BOOL pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 authenticated B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xAppleDRIAuthConnectionReply;
+#define zx_xAppleDRIAuthConnectionReply 32
+
+typedef struct _AppleDRICreateSurface {
+ CARD8 reqType; /* always DRIReqCode */
+ CARD8 driReqType; /* always X_DRICreateSurface */
+ CARD16 length B16;
+ CARD32 screen B32;
+ CARD32 drawable B32;
+ CARD32 client_id B32;
+} xAppleDRICreateSurfaceReq;
+#define sz_xAppleDRICreateSurfaceReq 16
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 key_0 B32;
+ CARD32 key_1 B32;
+ CARD32 uid B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xAppleDRICreateSurfaceReply;
+#define sz_xAppleDRICreateSurfaceReply 32
+
+typedef struct _AppleDRIDestroySurface {
+ CARD8 reqType; /* always DRIReqCode */
+ CARD8 driReqType; /* always X_DRIDestroySurface */
+ CARD16 length B16;
+ CARD32 screen B32;
+ CARD32 drawable B32;
+} xAppleDRIDestroySurfaceReq;
+#define sz_xAppleDRIDestroySurfaceReq 12
+
+typedef struct _AppleDRINotify {
+ BYTE type; /* always eventBase + event type */
+ BYTE kind;
+ CARD16 sequenceNumber B16;
+ Time time B32; /* time of change */
+ CARD16 pad1 B16;
+ CARD32 arg B32;
+ CARD32 pad3 B32;
+} xAppleDRINotifyEvent;
+#define sz_xAppleDRINotifyEvent 20
+
+#ifdef _APPLEDRI_SERVER_
+
+void AppleDRISendEvent (
+#if NeedFunctionPrototypes
+ int /* type */,
+ unsigned int /* mask */,
+ int /* which */,
+ int /* arg */
+#endif
+);
+
+#endif /* _APPLEDRI_SERVER_ */
+#endif /* _APPLEDRISTR_H_ */
diff --git a/xorg-server/hw/xquartz/xpr/dri.c b/xorg-server/hw/xquartz/xpr/dri.c
new file mode 100644
index 000000000..3aacb192d
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/dri.c
@@ -0,0 +1,737 @@
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright 2000 VA Linux Systems, Inc.
+Copyright (c) 2002 Apple Computer, Inc.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Jens Owen <jens@valinux.com>
+ * Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifdef XFree86LOADER
+#include "xf86.h"
+#include "xf86_ansic.h"
+#else
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+
+#define NEED_REPLIES
+#define NEED_EVENTS
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "colormapst.h"
+#include "cursorstr.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "servermd.h"
+#define _APPLEDRI_SERVER_
+#include "appledristr.h"
+#include "swaprep.h"
+#include "dri.h"
+#include "dristruct.h"
+#include "mi.h"
+#include "mipointer.h"
+#include "rootless.h"
+#include "x-hash.h"
+#include "x-hook.h"
+
+#include <AvailabilityMacros.h>
+
+static DevPrivateKey DRIScreenPrivKey = &DRIScreenPrivKey;
+static DevPrivateKey DRIWindowPrivKey = &DRIWindowPrivKey;
+static DevPrivateKey DRIPixmapPrivKey = &DRIPixmapPrivKey;
+
+static RESTYPE DRIDrawablePrivResType;
+
+static x_hash_table *surface_hash; /* maps surface ids -> drawablePrivs */
+
+/* FIXME: don't hardcode this? */
+#define CG_INFO_FILE "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Resources/Info-macos.plist"
+
+/* Corresponds to SU Jaguar Green */
+#define CG_REQUIRED_MAJOR 1
+#define CG_REQUIRED_MINOR 157
+#define CG_REQUIRED_MICRO 11
+
+/* Returns version as major.minor.micro in 10.10.10 fixed form */
+static unsigned int
+get_cg_version (void)
+{
+ static unsigned int version;
+
+ FILE *fh;
+ char *ptr;
+
+ if (version != 0)
+ return version;
+
+ /* I tried CFBundleGetVersion, but it returns zero, so.. */
+
+ fh = fopen (CG_INFO_FILE, "r");
+ if (fh != NULL)
+ {
+ char buf[256];
+
+ while (fgets (buf, sizeof (buf), fh) != NULL)
+ {
+ unsigned char c;
+
+ if (!strstr (buf, "<key>CFBundleShortVersionString</key>")
+ || fgets (buf, sizeof (buf), fh) == NULL)
+ {
+ continue;
+ }
+
+ ptr = strstr (buf, "<string>");
+ if (ptr == NULL)
+ continue;
+
+ ptr += strlen ("<string>");
+
+ /* Now PTR points to "MAJOR.MINOR.MICRO". */
+
+ version = 0;
+
+ again:
+ switch ((c = *ptr++))
+ {
+ case '.':
+ version = version * 1024;
+ goto again;
+
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ version = ((version & ~0x3ff)
+ + (version & 0x3ff) * 10 + (c - '0'));
+ goto again;
+ }
+ break;
+ }
+
+ fclose (fh);
+ }
+
+ return version;
+}
+
+static Bool
+test_cg_version (unsigned int major, unsigned int minor, unsigned int micro)
+{
+ unsigned int cg_ver = get_cg_version ();
+
+ unsigned int cg_major = (cg_ver >> 20) & 0x3ff;
+ unsigned int cg_minor = (cg_ver >> 10) & 0x3ff;
+ unsigned int cg_micro = cg_ver & 0x3ff;
+
+ if (cg_major > major)
+ return TRUE;
+ else if (cg_major < major)
+ return FALSE;
+
+ /* cg_major == major */
+
+ if (cg_minor > minor)
+ return TRUE;
+ else if (cg_minor < minor)
+ return FALSE;
+
+ /* cg_minor == minor */
+
+ if (cg_micro < micro)
+ return FALSE;
+
+ return TRUE;
+}
+
+Bool
+DRIScreenInit(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv;
+ int i;
+
+ pDRIPriv = (DRIScreenPrivPtr) xcalloc(1, sizeof(DRIScreenPrivRec));
+ if (!pDRIPriv) {
+ dixSetPrivate(&pScreen->devPrivates, DRIScreenPrivKey, NULL);
+ return FALSE;
+ }
+
+ dixSetPrivate(&pScreen->devPrivates, DRIScreenPrivKey, pDRIPriv);
+ pDRIPriv->directRenderingSupport = TRUE;
+ pDRIPriv->nrWindows = 0;
+
+ /* Need recent cg for window access update */
+ if (!test_cg_version (CG_REQUIRED_MAJOR,
+ CG_REQUIRED_MINOR,
+ CG_REQUIRED_MICRO))
+ {
+ ErrorF ("[DRI] disabled direct rendering; requires CoreGraphics %d.%d.%d\n",
+ CG_REQUIRED_MAJOR, CG_REQUIRED_MINOR, CG_REQUIRED_MICRO);
+
+ pDRIPriv->directRenderingSupport = FALSE;
+
+ /* Note we don't nuke the dri private, since we need it for
+ managing indirect surfaces. */
+ }
+
+ /* Initialize drawable tables */
+ for (i = 0; i < DRI_MAX_DRAWABLES; i++) {
+ pDRIPriv->DRIDrawables[i] = NULL;
+ }
+
+ return TRUE;
+}
+
+Bool
+DRIFinishScreenInit(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ /* Wrap DRI support */
+ pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree;
+ pScreen->ValidateTree = DRIValidateTree;
+
+ pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree;
+ pScreen->PostValidateTree = DRIPostValidateTree;
+
+ pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
+ pScreen->WindowExposures = DRIWindowExposures;
+
+ pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
+ pScreen->CopyWindow = DRICopyWindow;
+
+ pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
+ pScreen->ClipNotify = DRIClipNotify;
+
+ // ErrorF("[DRI] screen %d installation complete\n", pScreen->myNum);
+
+ return TRUE;
+}
+
+void
+DRICloseScreen(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (pDRIPriv && pDRIPriv->directRenderingSupport) {
+ xfree(pDRIPriv);
+ dixSetPrivate(&pScreen->devPrivates, DRIScreenPrivKey, NULL);
+ }
+}
+
+Bool
+DRIExtensionInit(void)
+{
+ DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete);
+
+ return TRUE;
+}
+
+void
+DRIReset(void)
+{
+ /*
+ * This stub routine is called when the X Server recycles, resources
+ * allocated by DRIExtensionInit need to be managed here.
+ *
+ * Currently this routine is a stub because all the interesting resources
+ * are managed via the screen init process.
+ */
+}
+
+Bool
+DRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool* isCapable)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (pDRIPriv)
+ *isCapable = pDRIPriv->directRenderingSupport;
+ else
+ *isCapable = FALSE;
+
+ return TRUE;
+}
+
+Bool
+DRIAuthConnection(ScreenPtr pScreen, unsigned int magic)
+{
+#if 0
+ /* FIXME: something? */
+
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (drmAuthMagic(pDRIPriv->drmFD, magic)) return FALSE;
+#endif
+ return TRUE;
+}
+
+static void
+DRIUpdateSurface(DRIDrawablePrivPtr pDRIDrawablePriv, DrawablePtr pDraw)
+{
+ xp_window_changes wc;
+ unsigned int flags = 0;
+
+ if (pDRIDrawablePriv->sid == 0)
+ return;
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+ wc.depth = (pDraw->bitsPerPixel == 32 ? XP_DEPTH_ARGB8888
+ : pDraw->bitsPerPixel == 16 ? XP_DEPTH_RGB555 : XP_DEPTH_NIL);
+ if (wc.depth != XP_DEPTH_NIL)
+ flags |= XP_DEPTH;
+#endif
+
+ if (pDraw->type == DRAWABLE_WINDOW) {
+ WindowPtr pWin = (WindowPtr) pDraw;
+ WindowPtr pTopWin = TopLevelParent(pWin);
+
+ wc.x = pWin->drawable.x - (pTopWin->drawable.x - pTopWin->borderWidth);
+ wc.y = pWin->drawable.y - (pTopWin->drawable.y - pTopWin->borderWidth);
+ wc.width = pWin->drawable.width + 2 * pWin->borderWidth;
+ wc.height = pWin->drawable.height + 2 * pWin->borderWidth;
+ wc.bit_gravity = XP_GRAVITY_NONE;
+
+ wc.shape_nrects = REGION_NUM_RECTS(&pWin->clipList);
+ wc.shape_rects = REGION_RECTS(&pWin->clipList);
+ wc.shape_tx = - (pTopWin->drawable.x - pTopWin->borderWidth);
+ wc.shape_ty = - (pTopWin->drawable.y - pTopWin->borderWidth);
+
+ flags |= XP_BOUNDS | XP_SHAPE;
+
+ } else if (pDraw->type == DRAWABLE_PIXMAP) {
+ wc.x = 0;
+ wc.y = 0;
+ wc.width = pDraw->width;
+ wc.height = pDraw->height;
+ wc.bit_gravity = XP_GRAVITY_NONE;
+ flags |= XP_BOUNDS;
+ }
+
+ xp_configure_surface(pDRIDrawablePriv->sid, flags, &wc);
+}
+
+Bool
+DRICreateSurface(ScreenPtr pScreen, Drawable id,
+ DrawablePtr pDrawable, xp_client_id client_id,
+ xp_surface_id *surface_id, unsigned int ret_key[2],
+ void (*notify) (void *arg, void *data), void *notify_data)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv;
+ xp_window_id wid = 0;
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ WindowPtr pWin = (WindowPtr)pDrawable;
+
+ pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
+ if (pDRIDrawablePriv == NULL) {
+ xp_error err;
+ xp_window_changes wc;
+
+ /* allocate a DRI Window Private record */
+ if (!(pDRIDrawablePriv = xalloc(sizeof(DRIDrawablePrivRec)))) {
+ return FALSE;
+ }
+
+ pDRIDrawablePriv->pDraw = pDrawable;
+ pDRIDrawablePriv->pScreen = pScreen;
+ pDRIDrawablePriv->refCount = 0;
+ pDRIDrawablePriv->drawableIndex = -1;
+ pDRIDrawablePriv->notifiers = NULL;
+
+ /* find the physical window */
+ wid = (xp_window_id) RootlessFrameForWindow(pWin, TRUE);
+ if (wid == 0) {
+ xfree(pDRIDrawablePriv);
+ return FALSE;
+ }
+
+ /* allocate the physical surface */
+ err = xp_create_surface(wid, &pDRIDrawablePriv->sid);
+ if (err != Success) {
+ xfree(pDRIDrawablePriv);
+ return FALSE;
+ }
+
+ /* Make it visible */
+ wc.stack_mode = XP_MAPPED_ABOVE;
+ wc.sibling = 0;
+ err = xp_configure_surface(pDRIDrawablePriv->sid, XP_STACKING, &wc);
+ if (err != Success)
+ {
+ xp_destroy_surface(pDRIDrawablePriv->sid);
+ xfree(pDRIDrawablePriv);
+ return FALSE;
+ }
+
+ /* save private off of preallocated index */
+ dixSetPrivate(&pWin->devPrivates, DRIWindowPrivKey,
+ pDRIDrawablePriv);
+ }
+ }
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+ else if (pDrawable->type == DRAWABLE_PIXMAP) {
+ PixmapPtr pPix = (PixmapPtr)pDrawable;
+
+ pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix);
+ if (pDRIDrawablePriv == NULL) {
+ xp_error err;
+
+ /* allocate a DRI Window Private record */
+ if (!(pDRIDrawablePriv = xcalloc(1, sizeof(DRIDrawablePrivRec)))) {
+ return FALSE;
+ }
+
+ pDRIDrawablePriv->pDraw = pDrawable;
+ pDRIDrawablePriv->pScreen = pScreen;
+ pDRIDrawablePriv->refCount = 0;
+ pDRIDrawablePriv->drawableIndex = -1;
+ pDRIDrawablePriv->notifiers = NULL;
+
+ /* Passing a null window id to Xplugin in 10.3+ asks for
+ an accelerated offscreen surface. */
+
+ err = xp_create_surface(0, &pDRIDrawablePriv->sid);
+ if (err != Success) {
+ xfree(pDRIDrawablePriv);
+ return FALSE;
+ }
+
+ /* save private off of preallocated index */
+ dixSetPrivate(&pPix->devPrivates, DRIPixmapPrivKey,
+ pDRIDrawablePriv);
+ }
+ }
+#endif
+
+ else { /* for GLX 1.3, a PBuffer */
+ /* NOT_DONE */
+ return FALSE;
+ }
+
+ /* Finish initialization of new surfaces */
+ if (pDRIDrawablePriv->refCount == 0) {
+ unsigned int key[2] = {0};
+ xp_error err;
+
+ /* try to give the client access to the surface */
+ if (client_id != 0 && wid != 0)
+ {
+ err = xp_export_surface(wid, pDRIDrawablePriv->sid,
+ client_id, key);
+ if (err != Success) {
+ xp_destroy_surface(pDRIDrawablePriv->sid);
+ xfree(pDRIDrawablePriv);
+ return FALSE;
+ }
+ }
+
+ pDRIDrawablePriv->key[0] = key[0];
+ pDRIDrawablePriv->key[1] = key[1];
+
+ ++pDRIPriv->nrWindows;
+
+ /* and stash it by surface id */
+ if (surface_hash == NULL)
+ surface_hash = x_hash_table_new(NULL, NULL, NULL, NULL);
+ x_hash_table_insert(surface_hash,
+ (void *) pDRIDrawablePriv->sid, pDRIDrawablePriv);
+
+ /* track this in case this window is destroyed */
+ AddResource(id, DRIDrawablePrivResType, (pointer)pDrawable);
+
+ /* Initialize shape */
+ DRIUpdateSurface(pDRIDrawablePriv, pDrawable);
+ }
+
+ pDRIDrawablePriv->refCount++;
+
+ *surface_id = pDRIDrawablePriv->sid;
+
+ if (ret_key != NULL) {
+ ret_key[0] = pDRIDrawablePriv->key[0];
+ ret_key[1] = pDRIDrawablePriv->key[1];
+ }
+
+ if (notify != NULL) {
+ pDRIDrawablePriv->notifiers = x_hook_add(pDRIDrawablePriv->notifiers,
+ notify, notify_data);
+ }
+
+ return TRUE;
+}
+
+Bool
+DRIDestroySurface(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable,
+ void (*notify) (void *, void *), void *notify_data)
+{
+ DRIDrawablePrivPtr pDRIDrawablePriv;
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW((WindowPtr)pDrawable);
+ } else if (pDrawable->type == DRAWABLE_PIXMAP) {
+ pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_PIXMAP((PixmapPtr)pDrawable);
+ } else {
+ return FALSE;
+ }
+
+ if (pDRIDrawablePriv != NULL) {
+ if (notify != NULL) {
+ pDRIDrawablePriv->notifiers = x_hook_remove(pDRIDrawablePriv->notifiers,
+ notify, notify_data);
+ }
+ if (--pDRIDrawablePriv->refCount <= 0) {
+ /* This calls back to DRIDrawablePrivDelete
+ which frees the private area */
+ FreeResourceByType(id, DRIDrawablePrivResType, FALSE);
+ }
+ }
+
+ return TRUE;
+}
+
+Bool
+DRIDrawablePrivDelete(pointer pResource, XID id)
+{
+ DrawablePtr pDrawable = (DrawablePtr)pResource;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pDrawable->pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv = NULL;
+ WindowPtr pWin = NULL;
+ PixmapPtr pPix = NULL;
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ pWin = (WindowPtr)pDrawable;
+ pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
+ } else if (pDrawable->type == DRAWABLE_PIXMAP) {
+ pPix = (PixmapPtr)pDrawable;
+ pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix);
+ }
+
+ if (pDRIDrawablePriv == NULL)
+ return FALSE;
+
+ if (pDRIDrawablePriv->drawableIndex != -1) {
+ /* release drawable table entry */
+ pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL;
+ }
+
+ if (pDRIDrawablePriv->sid != 0) {
+ xp_destroy_surface(pDRIDrawablePriv->sid);
+ x_hash_table_remove(surface_hash, (void *) pDRIDrawablePriv->sid);
+ }
+
+ if (pDRIDrawablePriv->notifiers != NULL)
+ x_hook_free(pDRIDrawablePriv->notifiers);
+
+ xfree(pDRIDrawablePriv);
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ dixSetPrivate(&pWin->devPrivates, DRIWindowPrivKey, NULL);
+ } else if (pDrawable->type == DRAWABLE_PIXMAP) {
+ dixSetPrivate(&pPix->devPrivates, DRIPixmapPrivKey, NULL);
+ }
+
+ --pDRIPriv->nrWindows;
+
+ return TRUE;
+}
+
+void
+DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
+
+ if (pDRIDrawablePriv) {
+ /* FIXME: something? */
+ }
+
+ pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures;
+
+ (*pScreen->WindowExposures)(pWin, prgn, bsreg);
+
+ pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
+ pScreen->WindowExposures = DRIWindowExposures;
+}
+
+void
+DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv;
+
+ if (pDRIPriv->nrWindows > 0) {
+ pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
+ if (pDRIDrawablePriv != NULL) {
+ DRIUpdateSurface(pDRIDrawablePriv, &pWin->drawable);
+ }
+ }
+
+ /* unwrap */
+ pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow;
+
+ /* call lower layers */
+ (*pScreen->CopyWindow)(pWin, ptOldOrg, prgnSrc);
+
+ /* rewrap */
+ pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
+ pScreen->CopyWindow = DRICopyWindow;
+}
+
+int
+DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
+{
+ ScreenPtr pScreen = pParent->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ int returnValue;
+
+ /* unwrap */
+ pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree;
+
+ /* call lower layers */
+ returnValue = (*pScreen->ValidateTree)(pParent, pChild, kind);
+
+ /* rewrap */
+ pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree;
+ pScreen->ValidateTree = DRIValidateTree;
+
+ return returnValue;
+}
+
+void
+DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
+{
+ ScreenPtr pScreen;
+ DRIScreenPrivPtr pDRIPriv;
+
+ if (pParent) {
+ pScreen = pParent->drawable.pScreen;
+ } else {
+ pScreen = pChild->drawable.pScreen;
+ }
+ pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (pDRIPriv->wrap.PostValidateTree) {
+ /* unwrap */
+ pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree;
+
+ /* call lower layers */
+ (*pScreen->PostValidateTree)(pParent, pChild, kind);
+
+ /* rewrap */
+ pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree;
+ pScreen->PostValidateTree = DRIPostValidateTree;
+ }
+}
+
+void
+DRIClipNotify(WindowPtr pWin, int dx, int dy)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv;
+
+ if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
+ DRIUpdateSurface(pDRIDrawablePriv, &pWin->drawable);
+ }
+
+ if (pDRIPriv->wrap.ClipNotify) {
+ pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify;
+
+ (*pScreen->ClipNotify)(pWin, dx, dy);
+
+ pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
+ pScreen->ClipNotify = DRIClipNotify;
+ }
+}
+
+/* This lets us get at the unwrapped functions so that they can correctly
+ * call the lower level functions, and choose whether they will be
+ * called at every level of recursion (eg in validatetree).
+ */
+DRIWrappedFuncsRec *
+DRIGetWrappedFuncs(ScreenPtr pScreen)
+{
+ return &(DRI_SCREEN_PRIV(pScreen)->wrap);
+}
+
+void
+DRIQueryVersion(int *majorVersion,
+ int *minorVersion,
+ int *patchVersion)
+{
+ *majorVersion = APPLE_DRI_MAJOR_VERSION;
+ *minorVersion = APPLE_DRI_MINOR_VERSION;
+ *patchVersion = APPLE_DRI_PATCH_VERSION;
+}
+
+void
+DRISurfaceNotify(xp_surface_id id, int kind)
+{
+ DRIDrawablePrivPtr pDRIDrawablePriv = NULL;
+ DRISurfaceNotifyArg arg;
+
+ arg.id = id;
+ arg.kind = kind;
+
+ if (surface_hash != NULL)
+ {
+ pDRIDrawablePriv = x_hash_table_lookup(surface_hash,
+ (void *) id, NULL);
+ }
+
+ if (pDRIDrawablePriv == NULL)
+ return;
+
+ if (kind == AppleDRISurfaceNotifyDestroyed)
+ {
+ pDRIDrawablePriv->sid = 0;
+ x_hash_table_remove(surface_hash, (void *) id);
+ }
+
+ x_hook_run(pDRIDrawablePriv->notifiers, &arg);
+
+ if (kind == AppleDRISurfaceNotifyDestroyed)
+ {
+ /* Kill off the handle. */
+
+ FreeResourceByType(pDRIDrawablePriv->pDraw->id,
+ DRIDrawablePrivResType, FALSE);
+ }
+}
diff --git a/xorg-server/hw/xquartz/xpr/dri.h b/xorg-server/hw/xquartz/xpr/dri.h
new file mode 100644
index 000000000..cf2638a9f
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/dri.h
@@ -0,0 +1,128 @@
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright (c) 2002 Apple Computer, Inc.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Jens Owen <jens@precisioninsight.com>
+ *
+ */
+
+/* Prototypes for AppleDRI functions */
+
+#ifndef _DRI_H_
+#define _DRI_H_
+
+#include <X11/Xdefs.h>
+#include "scrnintstr.h"
+#define _APPLEDRI_SERVER_
+#include "appledri.h"
+#include "Xplugin.h"
+
+typedef void (*ClipNotifyPtr)( WindowPtr, int, int );
+
+
+/*
+ * These functions can be wrapped by the DRI. Each of these have
+ * generic default funcs (initialized in DRICreateInfoRec) and can be
+ * overridden by the driver in its [driver]DRIScreenInit function.
+ */
+typedef struct {
+ WindowExposuresProcPtr WindowExposures;
+ CopyWindowProcPtr CopyWindow;
+ ValidateTreeProcPtr ValidateTree;
+ PostValidateTreeProcPtr PostValidateTree;
+ ClipNotifyProcPtr ClipNotify;
+} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr;
+
+typedef struct {
+ xp_surface_id id;
+ int kind;
+} DRISurfaceNotifyArg;
+
+extern Bool DRIScreenInit(ScreenPtr pScreen);
+
+extern Bool DRIFinishScreenInit(ScreenPtr pScreen);
+
+extern void DRICloseScreen(ScreenPtr pScreen);
+
+extern Bool DRIExtensionInit(void);
+
+extern void DRIReset(void);
+
+extern Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen,
+ Bool *isCapable);
+
+extern Bool DRIAuthConnection(ScreenPtr pScreen, unsigned int magic);
+
+extern Bool DRICreateSurface(ScreenPtr pScreen,
+ Drawable id,
+ DrawablePtr pDrawable,
+ xp_client_id client_id,
+ xp_surface_id *surface_id,
+ unsigned int key[2],
+ void (*notify) (void *arg, void *data),
+ void *notify_data);
+
+extern Bool DRIDestroySurface(ScreenPtr pScreen,
+ Drawable id,
+ DrawablePtr pDrawable,
+ void (*notify) (void *arg, void *data),
+ void *notify_data);
+
+extern Bool DRIDrawablePrivDelete(pointer pResource,
+ XID id);
+
+extern DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen);
+
+extern void DRICopyWindow(WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc);
+
+extern int DRIValidateTree(WindowPtr pParent,
+ WindowPtr pChild,
+ VTKind kind);
+
+extern void DRIPostValidateTree(WindowPtr pParent,
+ WindowPtr pChild,
+ VTKind kind);
+
+extern void DRIClipNotify(WindowPtr pWin,
+ int dx,
+ int dy);
+
+extern void DRIWindowExposures(WindowPtr pWin,
+ RegionPtr prgn,
+ RegionPtr bsreg);
+
+extern void DRISurfaceNotify (xp_surface_id id, int kind);
+
+extern void DRIQueryVersion(int *majorVersion,
+ int *minorVersion,
+ int *patchVersion);
+
+#endif
diff --git a/xorg-server/hw/xquartz/xpr/dristruct.h b/xorg-server/hw/xquartz/xpr/dristruct.h
new file mode 100644
index 000000000..19d78a973
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/dristruct.h
@@ -0,0 +1,76 @@
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright (c) 2002 Apple Computer, Inc.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Jens Owen <jens@precisioninsight.com>
+ *
+ */
+
+#ifndef DRI_STRUCT_H
+#define DRI_STRUCT_H
+
+#include "dri.h"
+#include "x-list.h"
+
+#define DRI_MAX_DRAWABLES 256
+
+#define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) ((DRIDrawablePrivPtr) \
+ dixLookupPrivate(&(pWin)->devPrivates, DRIWindowPrivKey))
+
+#define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) ((DRIDrawablePrivPtr) \
+ dixLookupPrivate(&(pPix)->devPrivates, DRIPixmapPrivKey))
+
+typedef struct _DRIDrawablePrivRec
+{
+ xp_surface_id sid;
+ int drawableIndex;
+ DrawablePtr pDraw;
+ ScreenPtr pScreen;
+ int refCount;
+ unsigned int key[2];
+ x_list *notifiers; /* list of (FUN . DATA) */
+} DRIDrawablePrivRec, *DRIDrawablePrivPtr;
+
+#define DRI_SCREEN_PRIV(pScreen) ((DRIScreenPrivPtr) \
+ dixLookupPrivate(&(pScreen)->devPrivates, DRIScreenPrivKey))
+
+#define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \
+ dixLookupPrivate(&screenInfo.screens[screenIndex]->devPrivates, \
+ DRIScreenPrivKey))
+
+
+typedef struct _DRIScreenPrivRec
+{
+ Bool directRenderingSupport;
+ int nrWindows;
+ DRIWrappedFuncsRec wrap;
+ DrawablePtr DRIDrawables[DRI_MAX_DRAWABLES];
+} DRIScreenPrivRec, *DRIScreenPrivPtr;
+
+#endif /* DRI_STRUCT_H */
diff --git a/xorg-server/hw/xquartz/xpr/x-hash.c b/xorg-server/hw/xquartz/xpr/x-hash.c
new file mode 100644
index 000000000..55d28bacd
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/x-hash.c
@@ -0,0 +1,343 @@
+/* x-hash.c - basic hash tables
+
+ Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name(s) of the above
+ copyright holders shall not be used in advertising or otherwise to
+ promote the sale, use or other dealings in this Software without
+ prior written authorization. */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "x-hash.h"
+#include "x-list.h"
+#include <stdlib.h>
+#include <assert.h>
+
+struct x_hash_table_struct {
+ unsigned int bucket_index;
+ unsigned int total_keys;
+ x_list **buckets;
+
+ x_hash_fun *hash_key;
+ x_compare_fun *compare_keys;
+ x_destroy_fun *destroy_key;
+ x_destroy_fun *destroy_value;
+};
+
+#define ITEM_NEW(k, v) X_PFX (list_prepend) ((x_list *) (k), v)
+#define ITEM_FREE(i) X_PFX (list_free_1) (i)
+#define ITEM_KEY(i) ((void *) (i)->next)
+#define ITEM_VALUE(i) ((i)->data)
+
+#define SPLIT_THRESHOLD_FACTOR 2
+
+/* http://planetmath.org/?op=getobj&from=objects&name=GoodHashTablePrimes */
+static const unsigned int bucket_sizes[] = {
+ 29, 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, 49157,
+ 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469, 12582917,
+ 25165843, 50331653, 100663319, 201326611, 402653189, 805306457,
+ 1610612741
+};
+
+#define N_BUCKET_SIZES (sizeof (bucket_sizes) / sizeof (bucket_sizes[0]))
+
+static inline unsigned int
+hash_table_total_buckets (x_hash_table *h)
+{
+ return bucket_sizes[h->bucket_index];
+}
+
+static inline void
+hash_table_destroy_item (x_hash_table *h, void *k, void *v)
+{
+ if (h->destroy_key != 0)
+ (*h->destroy_key) (k);
+
+ if (h->destroy_value != 0)
+ (*h->destroy_value) (v);
+}
+
+static inline unsigned int
+hash_table_hash_key (x_hash_table *h, void *k)
+{
+ if (h->hash_key != 0)
+ return (*h->hash_key) (k);
+ else
+ return (unsigned int) k;
+}
+
+static inline int
+hash_table_compare_keys (x_hash_table *h, void *k1, void *k2)
+{
+ if (h->compare_keys == 0)
+ return k1 == k2;
+ else
+ return (*h->compare_keys) (k1, k2) == 0;
+}
+
+static void
+hash_table_split (x_hash_table *h)
+{
+ x_list **new, **old;
+ x_list *node, *item, *next;
+ int new_size, old_size;
+ unsigned int b;
+ int i;
+
+ if (h->bucket_index == N_BUCKET_SIZES - 1)
+ return;
+
+ old_size = hash_table_total_buckets (h);
+ old = h->buckets;
+
+ h->bucket_index++;
+
+ new_size = hash_table_total_buckets (h);
+ new = calloc (new_size, sizeof (x_list *));
+
+ if (new == 0)
+ {
+ h->bucket_index--;
+ return;
+ }
+
+ for (i = 0; i < old_size; i++)
+ {
+ for (node = old[i]; node != 0; node = next)
+ {
+ next = node->next;
+ item = node->data;
+
+ b = hash_table_hash_key (h, ITEM_KEY (item)) % new_size;
+
+ node->next = new[b];
+ new[b] = node;
+ }
+ }
+
+ h->buckets = new;
+ free (old);
+}
+
+X_EXTERN x_hash_table *
+X_PFX (hash_table_new) (x_hash_fun *hash,
+ x_compare_fun *compare,
+ x_destroy_fun *key_destroy,
+ x_destroy_fun *value_destroy)
+{
+ x_hash_table *h;
+
+ h = calloc (1, sizeof (x_hash_table));
+ if (h == 0)
+ return 0;
+
+ h->bucket_index = 0;
+ h->buckets = calloc (hash_table_total_buckets (h), sizeof (x_list *));
+
+ if (h->buckets == 0)
+ {
+ free (h);
+ return 0;
+ }
+
+ h->hash_key = hash;
+ h->compare_keys = compare;
+ h->destroy_key = key_destroy;
+ h->destroy_value = value_destroy;
+
+ return h;
+}
+
+X_EXTERN void
+X_PFX (hash_table_free) (x_hash_table *h)
+{
+ int n, i;
+ x_list *node, *item;
+
+ assert (h != NULL);
+
+ n = hash_table_total_buckets (h);
+
+ for (i = 0; i < n; i++)
+ {
+ for (node = h->buckets[i]; node != 0; node = node->next)
+ {
+ item = node->data;
+ hash_table_destroy_item (h, ITEM_KEY (item), ITEM_VALUE (item));
+ ITEM_FREE (item);
+ }
+ X_PFX (list_free) (h->buckets[i]);
+ }
+
+ free (h->buckets);
+ free (h);
+}
+
+X_EXTERN unsigned int
+X_PFX (hash_table_size) (x_hash_table *h)
+{
+ assert (h != NULL);
+
+ return h->total_keys;
+}
+
+static void
+hash_table_modify (x_hash_table *h, void *k, void *v, int replace)
+{
+ unsigned int hash_value;
+ x_list *node, *item;
+
+ assert (h != NULL);
+
+ hash_value = hash_table_hash_key (h, k);
+
+ for (node = h->buckets[hash_value % hash_table_total_buckets (h)];
+ node != 0; node = node->next)
+ {
+ item = node->data;
+
+ if (hash_table_compare_keys (h, ITEM_KEY (item), k))
+ {
+ if (replace)
+ {
+ hash_table_destroy_item (h, ITEM_KEY (item),
+ ITEM_VALUE (item));
+ item->next = k;
+ ITEM_VALUE (item) = v;
+ }
+ else
+ {
+ hash_table_destroy_item (h, k, ITEM_VALUE (item));
+ ITEM_VALUE (item) = v;
+ }
+ return;
+ }
+ }
+
+ /* Key isn't already in the table. Insert it. */
+
+ if (h->total_keys + 1
+ > hash_table_total_buckets (h) * SPLIT_THRESHOLD_FACTOR)
+ {
+ hash_table_split (h);
+ }
+
+ hash_value = hash_value % hash_table_total_buckets (h);
+ h->buckets[hash_value] = X_PFX (list_prepend) (h->buckets[hash_value],
+ ITEM_NEW (k, v));
+ h->total_keys++;
+}
+
+X_EXTERN void
+X_PFX (hash_table_insert) (x_hash_table *h, void *k, void *v)
+{
+ hash_table_modify (h, k, v, 0);
+}
+
+X_EXTERN void
+X_PFX (hash_table_replace) (x_hash_table *h, void *k, void *v)
+{
+ hash_table_modify (h, k, v, 1);
+}
+
+X_EXTERN void
+X_PFX (hash_table_remove) (x_hash_table *h, void *k)
+{
+ unsigned int hash_value;
+ x_list **ptr, *item;
+
+ assert (h != NULL);
+
+ hash_value = hash_table_hash_key (h, k);
+
+ for (ptr = &h->buckets[hash_value % hash_table_total_buckets (h)];
+ *ptr != 0; ptr = &((*ptr)->next))
+ {
+ item = (*ptr)->data;
+
+ if (hash_table_compare_keys (h, ITEM_KEY (item), k))
+ {
+ hash_table_destroy_item (h, ITEM_KEY (item), ITEM_VALUE (item));
+ ITEM_FREE (item);
+ item = *ptr;
+ *ptr = item->next;
+ X_PFX (list_free_1) (item);
+ h->total_keys--;
+ return;
+ }
+ }
+}
+
+X_EXTERN void *
+X_PFX (hash_table_lookup) (x_hash_table *h, void *k, void **k_ret)
+{
+ unsigned int hash_value;
+ x_list *node, *item;
+
+ assert (h != NULL);
+
+ hash_value = hash_table_hash_key (h, k);
+
+ for (node = h->buckets[hash_value % hash_table_total_buckets (h)];
+ node != 0; node = node->next)
+ {
+ item = node->data;
+
+ if (hash_table_compare_keys (h, ITEM_KEY (item), k))
+ {
+ if (k_ret != 0)
+ *k_ret = ITEM_KEY (item);
+
+ return ITEM_VALUE (item);
+ }
+ }
+
+ if (k_ret != 0)
+ *k_ret = 0;
+
+ return 0;
+}
+
+X_EXTERN void
+X_PFX (hash_table_foreach) (x_hash_table *h,
+ x_hash_foreach_fun *fun, void *data)
+{
+ int i, n;
+ x_list *node, *item;
+
+ assert (h != NULL);
+
+ n = hash_table_total_buckets (h);
+
+ for (i = 0; i < n; i++)
+ {
+ for (node = h->buckets[i]; node != 0; node = node->next)
+ {
+ item = node->data;
+ (*fun) (ITEM_KEY (item), ITEM_VALUE (item), data);
+ }
+ }
+}
diff --git a/xorg-server/hw/xquartz/xpr/x-hash.h b/xorg-server/hw/xquartz/xpr/x-hash.h
new file mode 100644
index 000000000..3456dbedf
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/x-hash.h
@@ -0,0 +1,60 @@
+/* x-hash.h -- basic hash table class
+
+ Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name(s) of the above
+ copyright holders shall not be used in advertising or otherwise to
+ promote the sale, use or other dealings in this Software without
+ prior written authorization. */
+
+#ifndef X_HASH_H
+#define X_HASH_H 1
+
+typedef struct x_hash_table_struct x_hash_table;
+
+typedef int (x_compare_fun) (const void *a, const void *b);
+typedef unsigned int (x_hash_fun) (const void *k);
+typedef void (x_destroy_fun) (void *x);
+typedef void (x_hash_foreach_fun) (void *k, void *v, void *data);
+
+/* for X_PFX and X_EXTERN */
+#include "x-list.h"
+
+X_EXTERN x_hash_table *X_PFX (hash_table_new) (x_hash_fun *hash,
+ x_compare_fun *compare,
+ x_destroy_fun *key_destroy,
+ x_destroy_fun *value_destroy);
+X_EXTERN void X_PFX (hash_table_free) (x_hash_table *h);
+
+X_EXTERN unsigned int X_PFX (hash_table_size) (x_hash_table *h);
+
+X_EXTERN void X_PFX (hash_table_insert) (x_hash_table *h, void *k, void *v);
+X_EXTERN void X_PFX (hash_table_replace) (x_hash_table *h, void *k, void *v);
+X_EXTERN void X_PFX (hash_table_remove) (x_hash_table *h, void *k);
+X_EXTERN void *X_PFX (hash_table_lookup) (x_hash_table *h,
+ void *k, void **k_ret);
+X_EXTERN void X_PFX (hash_table_foreach) (x_hash_table *h,
+ x_hash_foreach_fun *fun,
+ void *data);
+
+#endif /* X_HASH_H */
diff --git a/xorg-server/hw/xquartz/xpr/x-hook.c b/xorg-server/hw/xquartz/xpr/x-hook.c
new file mode 100644
index 000000000..bb873bbfb
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/x-hook.c
@@ -0,0 +1,109 @@
+/* x-hook.c
+
+ Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name(s) of the above
+ copyright holders shall not be used in advertising or otherwise to
+ promote the sale, use or other dealings in this Software without
+ prior written authorization. */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "x-hook.h"
+#include <stdlib.h>
+#include <assert.h>
+
+#define CELL_NEW(f,d) X_PFX (list_prepend) ((x_list *) (f), (d))
+#define CELL_FREE(c) X_PFX (list_free_1) (c)
+#define CELL_FUN(c) ((x_hook_function *) ((c)->next))
+#define CELL_DATA(c) ((c)->data)
+
+X_EXTERN x_list *
+X_PFX (hook_add) (x_list *lst, x_hook_function *fun, void *data)
+{
+ return X_PFX (list_prepend) (lst, CELL_NEW (fun, data));
+}
+
+X_EXTERN x_list *
+X_PFX (hook_remove) (x_list *lst, x_hook_function *fun, void *data)
+{
+ x_list *node, *cell;
+ x_list *to_delete = NULL;
+
+ for (node = lst; node != NULL; node = node->next)
+ {
+ cell = node->data;
+ if (CELL_FUN (cell) == fun && CELL_DATA (cell) == data)
+ to_delete = X_PFX (list_prepend) (to_delete, cell);
+ }
+
+ for (node = to_delete; node != NULL; node = node->next)
+ {
+ cell = node->data;
+ lst = X_PFX (list_remove) (lst, cell);
+ CELL_FREE (cell);
+ }
+
+ X_PFX (list_free) (to_delete);
+ return lst;
+}
+
+X_EXTERN void
+X_PFX (hook_run) (x_list *lst, void *arg)
+{
+ x_list *node, *cell;
+ x_hook_function **fun;
+ void **data;
+ int length, i;
+
+ length = X_PFX (list_length) (lst);
+ fun = alloca (sizeof (x_hook_function *) * length);
+ data = alloca (sizeof (void *) * length);
+
+ for (i = 0, node = lst; node != NULL; node = node->next, i++)
+ {
+ cell = node->data;
+ fun[i] = CELL_FUN (cell);
+ data[i] = CELL_DATA (cell);
+ }
+
+ for (i = 0; i < length; i++)
+ {
+ (*fun[i]) (arg, data[i]);
+ }
+}
+
+X_EXTERN void
+X_PFX (hook_free) (x_list *lst)
+{
+ x_list *node;
+
+ for (node = lst; node != NULL; node = node->next)
+ {
+ CELL_FREE (node->data);
+ }
+
+ X_PFX (list_free) (lst);
+}
diff --git a/xorg-server/hw/xquartz/xpr/x-hook.h b/xorg-server/hw/xquartz/xpr/x-hook.h
new file mode 100644
index 000000000..392352d50
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/x-hook.h
@@ -0,0 +1,42 @@
+/* x-hook.h -- lists of function,data pairs to call.
+
+ Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name(s) of the above
+ copyright holders shall not be used in advertising or otherwise to
+ promote the sale, use or other dealings in this Software without
+ prior written authorization. */
+
+#ifndef X_HOOK_H
+#define X_HOOK_H 1
+
+#include "x-list.h"
+
+typedef void x_hook_function (void *arg, void *data);
+
+X_EXTERN x_list *X_PFX (hook_add) (x_list *lst, x_hook_function *fun, void *data);
+X_EXTERN x_list *X_PFX (hook_remove) (x_list *lst, x_hook_function *fun, void *data);
+X_EXTERN void X_PFX (hook_run) (x_list *lst, void *arg);
+X_EXTERN void X_PFX (hook_free) (x_list *lst);
+
+#endif /* X_HOOK_H */
diff --git a/xorg-server/hw/xquartz/xpr/x-list.c b/xorg-server/hw/xquartz/xpr/x-list.c
new file mode 100644
index 000000000..3596dd355
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/x-list.c
@@ -0,0 +1,337 @@
+/* x-list.c
+
+ Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name(s) of the above
+ copyright holders shall not be used in advertising or otherwise to
+ promote the sale, use or other dealings in this Software without
+ prior written authorization. */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "x-list.h"
+#include <stdlib.h>
+#include <assert.h>
+#include <pthread.h>
+
+/* Allocate in ~4k blocks */
+#define NODES_PER_BLOCK 508
+
+typedef struct x_list_block_struct x_list_block;
+
+struct x_list_block_struct {
+ x_list l[NODES_PER_BLOCK];
+};
+
+static x_list *freelist;
+
+static pthread_mutex_t freelist_lock = PTHREAD_MUTEX_INITIALIZER;
+
+static inline void
+list_free_1 (x_list *node)
+{
+ node->next = freelist;
+ freelist = node;
+}
+
+X_EXTERN void
+X_PFX (list_free_1) (x_list *node)
+{
+ assert (node != NULL);
+
+ pthread_mutex_lock (&freelist_lock);
+
+ list_free_1 (node);
+
+ pthread_mutex_unlock (&freelist_lock);
+}
+
+X_EXTERN void
+X_PFX (list_free) (x_list *lst)
+{
+ x_list *next;
+
+ pthread_mutex_lock (&freelist_lock);
+
+ for (; lst != NULL; lst = next)
+ {
+ next = lst->next;
+ list_free_1 (lst);
+ }
+
+ pthread_mutex_unlock (&freelist_lock);
+}
+
+X_EXTERN x_list *
+X_PFX (list_prepend) (x_list *lst, void *data)
+{
+ x_list *node;
+
+ pthread_mutex_lock (&freelist_lock);
+
+ if (freelist == NULL)
+ {
+ x_list_block *b;
+ int i;
+
+ b = malloc (sizeof (x_list_block));
+
+ for (i = 0; i < NODES_PER_BLOCK - 1; i++)
+ b->l[i].next = &(b->l[i+1]);
+ b->l[i].next = NULL;
+
+ freelist = b->l;
+ }
+
+ node = freelist;
+ freelist = node->next;
+
+ pthread_mutex_unlock (&freelist_lock);
+
+ node->next = lst;
+ node->data = data;
+
+ return node;
+}
+
+X_EXTERN x_list *
+X_PFX (list_append) (x_list *lst, void *data)
+{
+ x_list *head = lst;
+
+ if (lst == NULL)
+ return X_PFX (list_prepend) (NULL, data);
+
+ while (lst->next != NULL)
+ lst = lst->next;
+
+ lst->next = X_PFX (list_prepend) (NULL, data);
+
+ return head;
+}
+
+X_EXTERN x_list *
+X_PFX (list_reverse) (x_list *lst)
+{
+ x_list *head = NULL, *next;
+
+ while (lst != NULL)
+ {
+ next = lst->next;
+ lst->next = head;
+ head = lst;
+ lst = next;
+ }
+
+ return head;
+}
+
+X_EXTERN x_list *
+X_PFX (list_find) (x_list *lst, void *data)
+{
+ for (; lst != NULL; lst = lst->next)
+ {
+ if (lst->data == data)
+ return lst;
+ }
+
+ return NULL;
+}
+
+X_EXTERN x_list *
+X_PFX (list_nth) (x_list *lst, int n)
+{
+ while (n-- > 0 && lst != NULL)
+ lst = lst->next;
+
+ return lst;
+}
+
+X_EXTERN x_list *
+X_PFX (list_pop) (x_list *lst, void **data_ret)
+{
+ void *data = NULL;
+
+ if (lst != NULL)
+ {
+ x_list *tem = lst;
+ data = lst->data;
+ lst = lst->next;
+ X_PFX (list_free_1) (tem);
+ }
+
+ if (data_ret != NULL)
+ *data_ret = data;
+
+ return lst;
+}
+
+X_EXTERN x_list *
+X_PFX (list_filter) (x_list *lst,
+ int (*pred) (void *item, void *data), void *data)
+{
+ x_list *ret = NULL, *node;
+
+ for (node = lst; node != NULL; node = node->next)
+ {
+ if ((*pred) (node->data, data))
+ ret = X_PFX (list_prepend) (ret, node->data);
+ }
+
+ return X_PFX (list_reverse) (ret);
+}
+
+X_EXTERN x_list *
+X_PFX (list_map) (x_list *lst,
+ void *(*fun) (void *item, void *data), void *data)
+{
+ x_list *ret = NULL, *node;
+
+ for (node = lst; node != NULL; node = node->next)
+ {
+ X_PFX (list_prepend) (ret, fun (node->data, data));
+ }
+
+ return X_PFX (list_reverse) (ret);
+}
+
+X_EXTERN x_list *
+X_PFX (list_copy) (x_list *lst)
+{
+ x_list *copy = NULL;
+
+ for (; lst != NULL; lst = lst->next)
+ {
+ copy = X_PFX (list_prepend) (copy, lst->data);
+ }
+
+ return X_PFX (list_reverse) (copy);
+}
+
+X_EXTERN x_list *
+X_PFX (list_remove) (x_list *lst, void *data)
+{
+ x_list **ptr, *node;
+
+ for (ptr = &lst; *ptr != NULL;)
+ {
+ node = *ptr;
+
+ if (node->data == data)
+ {
+ *ptr = node->next;
+ X_PFX (list_free_1) (node);
+ }
+ else
+ ptr = &((*ptr)->next);
+ }
+
+ return lst;
+}
+
+X_EXTERN unsigned int
+X_PFX (list_length) (x_list *lst)
+{
+ unsigned int n;
+
+ n = 0;
+ for (; lst != NULL; lst = lst->next)
+ n++;
+
+ return n;
+}
+
+X_EXTERN void
+X_PFX (list_foreach) (x_list *lst,
+ void (*fun) (void *data, void *user_data),
+ void *user_data)
+{
+ for (; lst != NULL; lst = lst->next)
+ {
+ (*fun) (lst->data, user_data);
+ }
+}
+
+static x_list *
+list_sort_1 (x_list *lst, int length,
+ int (*less) (const void *, const void *))
+{
+ x_list *mid, *ptr;
+ x_list *out_head, *out;
+ int mid_point, i;
+
+ /* This is a standard (stable) list merge sort */
+
+ if (length < 2)
+ return lst;
+
+ /* Calculate the halfway point. Split the list into two sub-lists. */
+
+ mid_point = length / 2;
+ ptr = lst;
+ for (i = mid_point - 1; i > 0; i--)
+ ptr = ptr->next;
+ mid = ptr->next;
+ ptr->next = NULL;
+
+ /* Sort each sub-list. */
+
+ lst = list_sort_1 (lst, mid_point, less);
+ mid = list_sort_1 (mid, length - mid_point, less);
+
+ /* Then merge them back together. */
+
+ assert (lst != NULL && mid != NULL);
+
+ if ((*less) (mid->data, lst->data))
+ out = out_head = mid, mid = mid->next;
+ else
+ out = out_head = lst, lst = lst->next;
+
+ while (lst != NULL && mid != NULL)
+ {
+ if ((*less) (mid->data, lst->data))
+ out = out->next = mid, mid = mid->next;
+ else
+ out = out->next = lst, lst = lst->next;
+ }
+
+ if (lst != NULL)
+ out->next = lst;
+ else
+ out->next = mid;
+
+ return out_head;
+}
+
+X_EXTERN x_list *
+X_PFX (list_sort) (x_list *lst, int (*less) (const void *, const void *))
+{
+ int length;
+
+ length = X_PFX (list_length) (lst);
+
+ return list_sort_1 (lst, length, less);
+}
diff --git a/xorg-server/hw/xquartz/xpr/x-list.h b/xorg-server/hw/xquartz/xpr/x-list.h
new file mode 100644
index 000000000..04af024a2
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/x-list.h
@@ -0,0 +1,77 @@
+/* x-list.h -- simple list type
+
+ Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
+ HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name(s) of the above
+ copyright holders shall not be used in advertising or otherwise to
+ promote the sale, use or other dealings in this Software without
+ prior written authorization. */
+
+#ifndef X_LIST_H
+#define X_LIST_H 1
+
+/* This is just a cons. */
+
+typedef struct x_list_struct x_list;
+
+struct x_list_struct {
+ void *data;
+ x_list *next;
+};
+
+#ifndef X_PFX
+# define X_PFX(x) x_ ## x
+#endif
+
+#ifndef X_EXTERN
+# define X_EXTERN __private_extern__
+#endif
+
+X_EXTERN void X_PFX (list_free_1) (x_list *node);
+X_EXTERN x_list *X_PFX (list_prepend) (x_list *lst, void *data);
+
+X_EXTERN x_list *X_PFX (list_append) (x_list *lst, void *data);
+X_EXTERN x_list *X_PFX (list_remove) (x_list *lst, void *data);
+X_EXTERN void X_PFX (list_free) (x_list *lst);
+X_EXTERN x_list *X_PFX (list_pop) (x_list *lst, void **data_ret);
+
+X_EXTERN x_list *X_PFX (list_copy) (x_list *lst);
+X_EXTERN x_list *X_PFX (list_reverse) (x_list *lst);
+X_EXTERN x_list *X_PFX (list_find) (x_list *lst, void *data);
+X_EXTERN x_list *X_PFX (list_nth) (x_list *lst, int n);
+X_EXTERN x_list *X_PFX (list_filter) (x_list *src,
+ int (*pred) (void *item, void *data),
+ void *data);
+X_EXTERN x_list *X_PFX (list_map) (x_list *src,
+ void *(*fun) (void *item, void *data),
+ void *data);
+
+X_EXTERN unsigned int X_PFX (list_length) (x_list *lst);
+X_EXTERN void X_PFX (list_foreach) (x_list *lst, void (*fun)
+ (void *data, void *user_data),
+ void *user_data);
+
+X_EXTERN x_list *X_PFX (list_sort) (x_list *lst, int (*less) (const void *,
+ const void *));
+
+#endif /* X_LIST_H */
diff --git a/xorg-server/hw/xquartz/xpr/xpr.h b/xorg-server/hw/xquartz/xpr/xpr.h
new file mode 100644
index 000000000..b8c69df0d
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/xpr.h
@@ -0,0 +1,47 @@
+/*
+ * Xplugin rootless implementation
+ *
+ * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifndef XPR_H
+#define XPR_H
+
+#include "screenint.h"
+
+Bool QuartzModeBundleInit(void);
+
+void AppleDRIExtensionInit(void);
+void xprAppleWMInit(void);
+Bool xprInit(ScreenPtr pScreen);
+Bool xprIsX11Window(void *nsWindow, int windowNumber);
+
+void xprHideWindows(Bool hide);
+
+Bool QuartzInitCursor(ScreenPtr pScreen);
+void QuartzSuspendXCursor(ScreenPtr pScreen);
+void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y);
+
+#endif /* XPR_H */
diff --git a/xorg-server/hw/xquartz/xpr/xprAppleWM.c b/xorg-server/hw/xquartz/xpr/xprAppleWM.c
new file mode 100644
index 000000000..bd82df03c
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/xprAppleWM.c
@@ -0,0 +1,100 @@
+/*
+ * Xplugin rootless implementation functions for AppleWM extension
+ *
+ * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "xpr.h"
+#include "applewmExt.h"
+#include "rootless.h"
+#include "Xplugin.h"
+#include <X11/X.h>
+
+static int xprSetWindowLevel(
+ WindowPtr pWin,
+ int level)
+{
+ xp_window_id wid;
+ xp_window_changes wc;
+
+ wid = (xp_window_id) RootlessFrameForWindow (pWin, TRUE);
+ if (wid == 0)
+ return BadWindow;
+
+ RootlessStopDrawing (pWin, FALSE);
+
+ wc.window_level = level;
+ if (xp_configure_window (wid, XP_WINDOW_LEVEL, &wc) != Success) {
+ return BadValue;
+ }
+
+ return Success;
+}
+
+
+static int xprFrameDraw(
+ WindowPtr pWin,
+ int class,
+ unsigned int attr,
+ const BoxRec *outer,
+ const BoxRec *inner,
+ unsigned int title_len,
+ const unsigned char *title_bytes)
+{
+ xp_window_id wid;
+
+ wid = (xp_window_id) RootlessFrameForWindow (pWin, FALSE);
+ if (wid == 0)
+ return BadWindow;
+
+ if (xp_frame_draw (wid, class, attr, outer, inner,
+ title_len, title_bytes) != Success)
+ {
+ return BadValue;
+ }
+
+ return Success;
+}
+
+
+static AppleWMProcsRec xprAppleWMProcs = {
+ xp_disable_update,
+ xp_reenable_update,
+ xprSetWindowLevel,
+ xp_frame_get_rect,
+ xp_frame_hit_test,
+ xprFrameDraw
+};
+
+
+void xprAppleWMInit(void)
+{
+ AppleWMExtensionInit(&xprAppleWMProcs);
+}
diff --git a/xorg-server/hw/xquartz/xpr/xprCursor.c b/xorg-server/hw/xquartz/xpr/xprCursor.c
new file mode 100644
index 000000000..e084ef90e
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/xprCursor.c
@@ -0,0 +1,422 @@
+/**************************************************************
+ *
+ * Xplugin cursor support
+ *
+ * Copyright (c) 2001 Torrey T. Lyons and Greg Parker.
+ * Copyright (c) 2002 Apple Computer, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "quartzCommon.h"
+#include "xpr.h"
+#include "darwin.h"
+#include "darwinEvents.h"
+#include "Xplugin.h"
+
+#include "mi.h"
+#include "scrnintstr.h"
+#include "cursorstr.h"
+#include "mipointrst.h"
+#include "windowstr.h"
+#include "globals.h"
+#include "servermd.h"
+#include "dixevents.h"
+
+typedef struct {
+ int cursorVisible;
+ QueryBestSizeProcPtr QueryBestSize;
+ miPointerSpriteFuncPtr spriteFuncs;
+} QuartzCursorScreenRec, *QuartzCursorScreenPtr;
+
+static DevPrivateKey darwinCursorScreenKey = &darwinCursorScreenKey;
+
+#define CURSOR_PRIV(pScreen) ((QuartzCursorScreenPtr) \
+ dixLookupPrivate(&pScreen->devPrivates, darwinCursorScreenKey))
+
+
+static Bool
+load_cursor(CursorPtr src, int screen)
+{
+ uint32_t *data;
+ uint32_t rowbytes;
+ int width, height;
+ int hot_x, hot_y;
+
+ uint32_t fg_color, bg_color;
+ uint8_t *srow, *sptr;
+ uint8_t *mrow, *mptr;
+ uint32_t *drow, *dptr;
+ unsigned xcount, ycount;
+
+ xp_error err;
+
+ width = src->bits->width;
+ height = src->bits->height;
+ hot_x = src->bits->xhot;
+ hot_y = src->bits->yhot;
+
+#ifdef ARGB_CURSOR
+ if (src->bits->argb != NULL)
+ {
+#if BITMAP_BIT_ORDER == MSBFirst
+ rowbytes = src->bits->width * sizeof (CARD32);
+ data = (uint32_t *) src->bits->argb;
+#else
+ const uint32_t *be_data=(uint32_t *) src->bits->argb;
+ unsigned i;
+ rowbytes = src->bits->width * sizeof (CARD32);
+ data=alloca (rowbytes * src->bits->height);
+ for(i=0;i<(src->bits->width*src->bits->height);i++)
+ data[i]=ntohl(be_data[i]);
+#endif
+ }
+ else
+#endif
+ {
+ fg_color = 0xFF00 | (src->foreRed >> 8);
+ fg_color <<= 16;
+ fg_color |= src->foreGreen & 0xFF00;
+ fg_color |= src->foreBlue >> 8;
+
+ bg_color = 0xFF00 | (src->backRed >> 8);
+ bg_color <<= 16;
+ bg_color |= src->backGreen & 0xFF00;
+ bg_color |= src->backBlue >> 8;
+
+ fg_color = htonl(fg_color);
+ bg_color = htonl(bg_color);
+
+ /* round up to 8 pixel boundary so we can convert whole bytes */
+ rowbytes = ((src->bits->width * 4) + 31) & ~31;
+ data = alloca(rowbytes * src->bits->height);
+
+ if (!src->bits->emptyMask)
+ {
+ ycount = src->bits->height;
+ srow = src->bits->source; mrow = src->bits->mask;
+ drow = data;
+
+ while (ycount-- > 0)
+ {
+ xcount = (src->bits->width + 7) / 8;
+ sptr = srow; mptr = mrow;
+ dptr = drow;
+
+ while (xcount-- > 0)
+ {
+ uint8_t s, m;
+ int i;
+
+ s = *sptr++; m = *mptr++;
+ for (i = 0; i < 8; i++)
+ {
+#if BITMAP_BIT_ORDER == MSBFirst
+ if (m & 128)
+ *dptr++ = (s & 128) ? fg_color : bg_color;
+ else
+ *dptr++ = 0;
+ s <<= 1; m <<= 1;
+#else
+ if (m & 1)
+ *dptr++ = (s & 1) ? fg_color : bg_color;
+ else
+ *dptr++ = 0;
+ s >>= 1; m >>= 1;
+#endif
+ }
+ }
+
+ srow += BitmapBytePad(src->bits->width);
+ mrow += BitmapBytePad(src->bits->width);
+ drow = (uint32_t *) ((char *) drow + rowbytes);
+ }
+ }
+ else
+ {
+ memset(data, 0, src->bits->height * rowbytes);
+ }
+ }
+
+ err = xp_set_cursor(width, height, hot_x, hot_y, data, rowbytes);
+ return err == Success;
+}
+
+
+/*
+===========================================================================
+
+ Pointer sprite functions
+
+===========================================================================
+*/
+
+/*
+ * QuartzRealizeCursor
+ * Convert the X cursor representation to native format if possible.
+ */
+static Bool
+QuartzRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
+{
+ if(pCursor == NULL || pCursor->bits == NULL)
+ return FALSE;
+
+ /* FIXME: cache ARGB8888 representation? */
+
+ return TRUE;
+}
+
+
+/*
+ * QuartzUnrealizeCursor
+ * Free the storage space associated with a realized cursor.
+ */
+static Bool
+QuartzUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
+{
+ return TRUE;
+}
+
+
+/*
+ * QuartzSetCursor
+ * Set the cursor sprite and position.
+ */
+static void
+QuartzSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
+{
+ QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ if (!quartzServerVisible)
+ return;
+
+ if (pCursor == NULL)
+ {
+ if (ScreenPriv->cursorVisible)
+ {
+ xp_hide_cursor();
+ ScreenPriv->cursorVisible = FALSE;
+ }
+ }
+ else
+ {
+ load_cursor(pCursor, pScreen->myNum);
+
+ if (!ScreenPriv->cursorVisible)
+ {
+ xp_show_cursor();
+ ScreenPriv->cursorVisible = TRUE;
+ }
+ }
+}
+
+
+/*
+ * QuartzMoveCursor
+ * Move the cursor. This is a noop for us.
+ */
+static void
+QuartzMoveCursor(ScreenPtr pScreen, int x, int y)
+{
+}
+
+
+static miPointerSpriteFuncRec quartzSpriteFuncsRec = {
+ QuartzRealizeCursor,
+ QuartzUnrealizeCursor,
+ QuartzSetCursor,
+ QuartzMoveCursor
+};
+
+
+/*
+===========================================================================
+
+ Pointer screen functions
+
+===========================================================================
+*/
+
+/*
+ * QuartzCursorOffScreen
+ */
+static Bool
+QuartzCursorOffScreen(ScreenPtr *pScreen, int *x, int *y)
+{
+ return FALSE;
+}
+
+
+/*
+ * QuartzCrossScreen
+ */
+static void
+QuartzCrossScreen(ScreenPtr pScreen, Bool entering)
+{
+ return;
+}
+
+
+/*
+ * QuartzWarpCursor
+ * Change the cursor position without generating an event or motion history.
+ * The input coordinates (x,y) are in pScreen-local X11 coordinates.
+ *
+ */
+static void
+QuartzWarpCursor(ScreenPtr pScreen, int x, int y)
+{
+ static Bool neverMoved = TRUE;
+
+ if (neverMoved)
+ {
+ /* Don't move the cursor the first time. This is the
+ jump-to-center initialization, and it's annoying. */
+ neverMoved = FALSE;
+ return;
+ }
+
+ if (quartzServerVisible)
+ {
+ int sx, sy;
+
+ sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
+ sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
+
+ CGWarpMouseCursorPosition(CGPointMake(sx + x, sy + y));
+ }
+
+ miPointerWarpCursor(pScreen, x, y);
+ miPointerUpdate();
+}
+
+
+static miPointerScreenFuncRec quartzScreenFuncsRec = {
+ QuartzCursorOffScreen,
+ QuartzCrossScreen,
+ QuartzWarpCursor,
+ DarwinEQPointerPost,
+ DarwinEQSwitchScreen
+};
+
+
+/*
+===========================================================================
+
+ Other screen functions
+
+===========================================================================
+*/
+
+/*
+ * QuartzCursorQueryBestSize
+ * Handle queries for best cursor size
+ */
+static void
+QuartzCursorQueryBestSize(int class, unsigned short *width,
+ unsigned short *height, ScreenPtr pScreen)
+{
+ QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ if (class == CursorShape)
+ {
+ /* FIXME: query window server? */
+ *width = 32;
+ *height = 32;
+ }
+ else
+ {
+ (*ScreenPriv->QueryBestSize)(class, width, height, pScreen);
+ }
+}
+
+/*
+ * QuartzInitCursor
+ * Initialize cursor support
+ */
+Bool
+QuartzInitCursor(ScreenPtr pScreen)
+{
+ QuartzCursorScreenPtr ScreenPriv;
+ miPointerScreenPtr PointPriv;
+
+ /* initialize software cursor handling (always needed as backup) */
+ if (!miDCInitialize(pScreen, &quartzScreenFuncsRec))
+ return FALSE;
+
+ ScreenPriv = xcalloc(1, sizeof(QuartzCursorScreenRec));
+ if (ScreenPriv == NULL)
+ return FALSE;
+
+ /* CURSOR_PRIV(pScreen) = ScreenPriv; */
+ dixSetPrivate(&pScreen->devPrivates, darwinCursorScreenKey, ScreenPriv);
+
+ /* override some screen procedures */
+ ScreenPriv->QueryBestSize = pScreen->QueryBestSize;
+ pScreen->QueryBestSize = QuartzCursorQueryBestSize;
+
+ PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey);
+
+ ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
+ PointPriv->spriteFuncs = &quartzSpriteFuncsRec;
+
+ ScreenPriv->cursorVisible = TRUE;
+ return TRUE;
+}
+
+
+/*
+ * QuartzSuspendXCursor
+ * X server is hiding. Restore the Aqua cursor.
+ */
+void
+QuartzSuspendXCursor(ScreenPtr pScreen)
+{
+}
+
+
+/*
+ * QuartzResumeXCursor
+ * X server is showing. Restore the X cursor.
+ */
+void
+QuartzResumeXCursor(ScreenPtr pScreen, int x, int y)
+{
+ WindowPtr pWin;
+ CursorPtr pCursor;
+
+ pWin = GetSpriteWindow();
+ if (pWin->drawable.pScreen != pScreen)
+ return;
+
+ pCursor = GetSpriteCursor();
+ if (pCursor == NULL)
+ return;
+
+ QuartzSetCursor(pScreen, pCursor, x, y);
+}
diff --git a/xorg-server/hw/xquartz/xpr/xprFrame.c b/xorg-server/hw/xquartz/xpr/xprFrame.c
new file mode 100644
index 000000000..864ef0d40
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/xprFrame.c
@@ -0,0 +1,528 @@
+/*
+ * Xplugin rootless implementation frame functions
+ *
+ * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "xpr.h"
+#include "rootlessCommon.h"
+#include "Xplugin.h"
+#include "x-hash.h"
+#include "x-list.h"
+#include "applewmExt.h"
+
+#include "propertyst.h"
+#include "dix.h"
+#include <X11/Xatom.h>
+#include "windowstr.h"
+
+#include <pthread.h>
+
+#define DEFINE_ATOM_HELPER(func,atom_name) \
+static Atom func (void) { \
+ static int generation; \
+ static Atom atom; \
+ if (generation != serverGeneration) { \
+ generation = serverGeneration; \
+ atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \
+ } \
+ return atom; \
+}
+
+DEFINE_ATOM_HELPER(xa_native_window_id, "_NATIVE_WINDOW_ID")
+
+/* Maps xp_window_id -> RootlessWindowRec */
+static x_hash_table *window_hash;
+static pthread_mutex_t window_hash_mutex;
+
+static Bool no_configure_window;
+
+
+static inline xp_error
+xprConfigureWindow(xp_window_id id, unsigned int mask,
+ const xp_window_changes *values)
+{
+ // ErrorF("xprConfigureWindow()\n");
+ if (!no_configure_window)
+ return xp_configure_window(id, mask, values);
+ else
+ return XP_Success;
+}
+
+
+static void
+xprSetNativeProperty(RootlessWindowPtr pFrame)
+{
+ xp_error err;
+ unsigned int native_id;
+ long data;
+
+ err = xp_get_native_window((xp_window_id) pFrame->wid, &native_id);
+ if (err == Success)
+ {
+ /* FIXME: move this to AppleWM extension */
+
+ data = native_id;
+ dixChangeWindowProperty(serverClient, pFrame->win, xa_native_window_id(),
+ XA_INTEGER, 32, PropModeReplace, 1, &data, TRUE);
+ }
+}
+
+
+/*
+ * Create and display a new frame.
+ */
+Bool
+xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
+ int newX, int newY, RegionPtr pShape)
+{
+ WindowPtr pWin = pFrame->win;
+ xp_window_changes wc;
+ unsigned int mask = 0;
+ xp_error err;
+
+ wc.x = newX;
+ wc.y = newY;
+ wc.width = pFrame->width;
+ wc.height = pFrame->height;
+ wc.bit_gravity = XP_GRAVITY_NONE;
+ mask |= XP_BOUNDS;
+
+ if (pWin->drawable.depth == 8)
+ {
+ wc.depth = XP_DEPTH_INDEX8;
+#if 0
+ wc.colormap = xprColormapCallback;
+ wc.colormap_data = pScreen;
+ mask |= XP_COLORMAP;
+#endif
+ }
+ else if (pWin->drawable.depth == 15)
+ wc.depth = XP_DEPTH_RGB555;
+ else if (pWin->drawable.depth == 24)
+ wc.depth = XP_DEPTH_ARGB8888;
+ else
+ wc.depth = XP_DEPTH_NIL;
+ mask |= XP_DEPTH;
+
+ if (pShape != NULL)
+ {
+ wc.shape_nrects = REGION_NUM_RECTS(pShape);
+ wc.shape_rects = REGION_RECTS(pShape);
+ wc.shape_tx = wc.shape_ty = 0;
+ mask |= XP_SHAPE;
+ }
+
+ err = xp_create_window(mask, &wc, (xp_window_id *) &pFrame->wid);
+
+ if (err != Success)
+ {
+ return FALSE;
+ }
+
+ if (window_hash == NULL)
+ {
+ window_hash = x_hash_table_new(NULL, NULL, NULL, NULL);
+ pthread_mutex_init(&window_hash_mutex, NULL);
+ }
+
+ pthread_mutex_lock(&window_hash_mutex);
+ x_hash_table_insert(window_hash, pFrame->wid, pFrame);
+ pthread_mutex_unlock(&window_hash_mutex);
+
+ xprSetNativeProperty(pFrame);
+
+ return TRUE;
+}
+
+
+/*
+ * Destroy a frame.
+ */
+void
+xprDestroyFrame(RootlessFrameID wid)
+{
+ pthread_mutex_lock(&window_hash_mutex);
+ x_hash_table_remove(window_hash, wid);
+ pthread_mutex_unlock(&window_hash_mutex);
+
+ xp_destroy_window((xp_window_id) wid);
+}
+
+
+/*
+ * Move a frame on screen.
+ */
+void
+xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
+{
+ xp_window_changes wc;
+
+ wc.x = newX;
+ wc.y = newY;
+ // ErrorF("xprMoveFrame(%d, %p, %d, %d)\n", wid, pScreen, newX, newY);
+ xprConfigureWindow((xp_window_id) wid, XP_ORIGIN, &wc);
+}
+
+
+/*
+ * Resize and move a frame.
+ */
+void
+xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
+ int newX, int newY, unsigned int newW, unsigned int newH,
+ unsigned int gravity)
+{
+ xp_window_changes wc;
+
+ wc.x = newX;
+ wc.y = newY;
+ wc.width = newW;
+ wc.height = newH;
+ wc.bit_gravity = gravity;
+
+ /* It's unlikely that being async will save us anything here.
+ But it can't hurt. */
+
+ xprConfigureWindow((xp_window_id) wid, XP_BOUNDS, &wc);
+}
+
+
+/*
+ * Change frame stacking.
+ */
+void
+xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
+{
+ xp_window_changes wc;
+
+ /* Stack frame below nextWid it if it exists, or raise
+ frame above everything otherwise. */
+
+ if (nextWid == NULL)
+ {
+ wc.stack_mode = XP_MAPPED_ABOVE;
+ wc.sibling = 0;
+ }
+ else
+ {
+ wc.stack_mode = XP_MAPPED_BELOW;
+ wc.sibling = (xp_window_id) nextWid;
+ }
+
+ xprConfigureWindow((xp_window_id) wid, XP_STACKING, &wc);
+}
+
+
+/*
+ * Change the frame's shape.
+ */
+void
+xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape)
+{
+ xp_window_changes wc;
+
+ if (pShape != NULL)
+ {
+ wc.shape_nrects = REGION_NUM_RECTS(pShape);
+ wc.shape_rects = REGION_RECTS(pShape);
+ }
+ else
+ {
+ wc.shape_nrects = -1;
+ wc.shape_rects = NULL;
+ }
+
+ wc.shape_tx = wc.shape_ty = 0;
+
+ xprConfigureWindow((xp_window_id) wid, XP_SHAPE, &wc);
+}
+
+
+/*
+ * Unmap a frame.
+ */
+void
+xprUnmapFrame(RootlessFrameID wid)
+{
+ xp_window_changes wc;
+
+ wc.stack_mode = XP_UNMAPPED;
+ wc.sibling = 0;
+
+ xprConfigureWindow((xp_window_id) wid, XP_STACKING, &wc);
+}
+
+
+/*
+ * Start drawing to a frame.
+ * Prepare for direct access to its backing buffer.
+ */
+void
+xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow)
+{
+ void *data[2];
+ unsigned int rowbytes[2];
+ xp_error err;
+
+ err = xp_lock_window((xp_window_id) wid, NULL, NULL, data, rowbytes, NULL);
+ if (err != Success)
+ FatalError("Could not lock window %i for drawing.", (int) wid);
+
+ *pixelData = data[0];
+ *bytesPerRow = rowbytes[0];
+}
+
+
+/*
+ * Stop drawing to a frame.
+ */
+void
+xprStopDrawing(RootlessFrameID wid, Bool flush)
+{
+ xp_unlock_window((xp_window_id) wid, flush);
+}
+
+
+/*
+ * Flush drawing updates to the screen.
+ */
+void
+xprUpdateRegion(RootlessFrameID wid, RegionPtr pDamage)
+{
+ xp_flush_window((xp_window_id) wid);
+}
+
+
+/*
+ * Mark damaged rectangles as requiring redisplay to screen.
+ */
+void
+xprDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects,
+ int shift_x, int shift_y)
+{
+ xp_mark_window((xp_window_id) wid, nrects, rects, shift_x, shift_y);
+}
+
+
+/*
+ * Called after the window associated with a frame has been switched
+ * to a new top-level parent.
+ */
+void
+xprSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin)
+{
+ DeleteProperty(serverClient, oldWin, xa_native_window_id());
+
+ xprSetNativeProperty(pFrame);
+}
+
+
+/*
+ * Called to check if the frame should be reordered when it is restacked.
+ */
+Bool xprDoReorderWindow(RootlessWindowPtr pFrame)
+{
+ WindowPtr pWin = pFrame->win;
+
+ return AppleWMDoReorderWindow(pWin);
+}
+
+
+/*
+ * Copy area in frame to another part of frame.
+ * Used to accelerate scrolling.
+ */
+void
+xprCopyWindow(RootlessFrameID wid, int dstNrects, const BoxRec *dstRects,
+ int dx, int dy)
+{
+ xp_copy_window((xp_window_id) wid, (xp_window_id) wid,
+ dstNrects, dstRects, dx, dy);
+}
+
+
+static RootlessFrameProcsRec xprRootlessProcs = {
+ xprCreateFrame,
+ xprDestroyFrame,
+ xprMoveFrame,
+ xprResizeFrame,
+ xprRestackFrame,
+ xprReshapeFrame,
+ xprUnmapFrame,
+ xprStartDrawing,
+ xprStopDrawing,
+ xprUpdateRegion,
+ xprDamageRects,
+ xprSwitchWindow,
+ xprDoReorderWindow,
+ xp_copy_bytes,
+ xp_fill_bytes,
+ xp_composite_pixels,
+ xprCopyWindow
+};
+
+
+/*
+ * Initialize XPR implementation
+ */
+Bool
+xprInit(ScreenPtr pScreen)
+{
+ RootlessInit(pScreen, &xprRootlessProcs);
+
+ rootless_CopyBytes_threshold = xp_copy_bytes_threshold;
+ rootless_FillBytes_threshold = xp_fill_bytes_threshold;
+ rootless_CompositePixels_threshold = xp_composite_area_threshold;
+ rootless_CopyWindow_threshold = xp_scroll_area_threshold;
+
+ no_configure_window = FALSE;
+
+ return TRUE;
+}
+
+
+/*
+ * Given the id of a physical window, try to find the top-level (or root)
+ * X window that it represents.
+ */
+WindowPtr
+xprGetXWindow(xp_window_id wid)
+{
+ RootlessWindowRec *winRec;
+
+ if (window_hash == NULL)
+ return NULL;
+
+ winRec = x_hash_table_lookup(window_hash, (void *) wid, NULL);
+
+ return winRec != NULL ? winRec->win : NULL;
+}
+
+/*
+ * Given the id of a physical window, try to find the top-level (or root)
+ * X window that it represents.
+ */
+WindowPtr
+xprGetXWindowFromAppKit(int windowNumber)
+{
+ RootlessWindowRec *winRec;
+ Bool ret;
+ xp_window_id wid;
+
+ if (window_hash == NULL)
+ return FALSE;
+
+ /* need to lock, since this function can be called by any thread */
+
+ pthread_mutex_lock(&window_hash_mutex);
+
+ if (xp_lookup_native_window(windowNumber, &wid))
+ ret = xprGetXWindow(wid) != NULL;
+ else
+ ret = FALSE;
+
+ pthread_mutex_unlock(&window_hash_mutex);
+
+ if (!ret) return NULL;
+ winRec = x_hash_table_lookup(window_hash, (void *) wid, NULL);
+
+ return winRec != NULL ? winRec->win : NULL;
+}
+
+
+/*
+ * The windowNumber is an AppKit window number. Returns TRUE if xpr is
+ * displaying a window with that number.
+ */
+Bool
+xprIsX11Window(void *nsWindow, int windowNumber)
+{
+ Bool ret;
+ xp_window_id wid;
+
+ if (window_hash == NULL)
+ return FALSE;
+
+ /* need to lock, since this function can be called by any thread */
+
+ pthread_mutex_lock(&window_hash_mutex);
+
+ if (xp_lookup_native_window(windowNumber, &wid))
+ ret = xprGetXWindow(wid) != NULL;
+ else
+ ret = FALSE;
+
+ pthread_mutex_unlock(&window_hash_mutex);
+
+ return ret;
+}
+
+
+/*
+ * xprHideWindows
+ * Hide or unhide all top level windows. This is called for application hide/
+ * unhide events if the window manager is not Apple-WM aware. Xplugin windows
+ * do not hide or unhide themselves.
+ */
+void
+xprHideWindows(Bool hide)
+{
+ int screen;
+ WindowPtr pRoot, pWin;
+
+ for (screen = 0; screen < screenInfo.numScreens; screen++) {
+ pRoot = WindowTable[screenInfo.screens[screen]->myNum];
+ RootlessFrameID prevWid = NULL;
+
+ for (pWin = pRoot->firstChild; pWin; pWin = pWin->nextSib) {
+ RootlessWindowRec *winRec = WINREC(pWin);
+
+ if (winRec != NULL) {
+ if (hide) {
+ xprUnmapFrame(winRec->wid);
+ } else {
+ BoxRec box;
+
+ xprRestackFrame(winRec->wid, prevWid);
+ prevWid = winRec->wid;
+
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = winRec->width;
+ box.y2 = winRec->height;
+
+ xprDamageRects(winRec->wid, 1, &box, 0, 0);
+ RootlessQueueRedisplay(screenInfo.screens[screen]);
+ }
+ }
+ }
+ }
+}
diff --git a/xorg-server/hw/xquartz/xpr/xprScreen.c b/xorg-server/hw/xquartz/xpr/xprScreen.c
new file mode 100644
index 000000000..e4e1fda7e
--- /dev/null
+++ b/xorg-server/hw/xquartz/xpr/xprScreen.c
@@ -0,0 +1,438 @@
+/*
+ * Xplugin rootless implementation screen functions
+ *
+ * Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
+ * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "quartzCommon.h"
+#include "quartz.h"
+#include "xpr.h"
+#include "pseudoramiX.h"
+#include "darwin.h"
+#include "rootless.h"
+#include "safeAlpha/safeAlpha.h"
+#include "dri.h"
+#include "globals.h"
+#include "Xplugin.h"
+#include "applewmExt.h"
+#include "micmap.h"
+
+// From xprFrame.c
+WindowPtr xprGetXWindow(xp_window_id wid);
+
+#ifdef DAMAGE
+# include "damage.h"
+#endif
+
+/* 10.4's deferred update makes X slower.. have to live with the tearing
+ for now.. */
+#define XP_NO_DEFERRED_UPDATES 8
+
+// Name of GLX bundle for native OpenGL
+static const char *xprOpenGLBundle = "glxCGL.bundle";
+
+/*
+ * eventHandler
+ * Callback handler for Xplugin events.
+ */
+static void eventHandler(unsigned int type, const void *arg,
+ unsigned int arg_size, void *data) {
+ switch (type) {
+ case XP_EVENT_DISPLAY_CHANGED:
+ DEBUG_LOG("XP_EVENT_DISPLAY_CHANGED\n");
+ QuartzMessageServerThread(kXDarwinDisplayChanged, 0);
+ break;
+
+ case XP_EVENT_WINDOW_STATE_CHANGED:
+ if (arg_size >= sizeof(xp_window_state_event)) {
+ const xp_window_state_event *ws_arg = arg;
+
+ DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED: id=%d, state=%d\n", ws_arg->id, ws_arg->state);
+ QuartzMessageServerThread(kXDarwinWindowState, 2,
+ ws_arg->id, ws_arg->state);
+ } else {
+ DEBUG_LOG("XP_EVENT_WINDOW_STATE_CHANGED: ignored\n");
+ }
+ break;
+
+ case XP_EVENT_WINDOW_MOVED:
+ DEBUG_LOG("XP_EVENT_WINDOW_MOVED\n");
+ if (arg_size == sizeof(xp_window_id)) {
+ xp_window_id id = * (xp_window_id *) arg;
+ WindowPtr pWin = xprGetXWindow(id);
+ QuartzMessageServerThread(kXDarwinWindowMoved, 1, pWin);
+ }
+ break;
+
+ case XP_EVENT_SURFACE_DESTROYED:
+ DEBUG_LOG("XP_EVENT_SURFACE_DESTROYED\n");
+ case XP_EVENT_SURFACE_CHANGED:
+ DEBUG_LOG("XP_EVENT_SURFACE_CHANGED\n");
+ if (arg_size == sizeof(xp_surface_id)) {
+ int kind;
+
+ if (type == XP_EVENT_SURFACE_DESTROYED)
+ kind = AppleDRISurfaceNotifyDestroyed;
+ else
+ kind = AppleDRISurfaceNotifyChanged;
+
+ DRISurfaceNotify(*(xp_surface_id *) arg, kind);
+ }
+ break;
+ default:
+ ErrorF("Unknown XP_EVENT type (%d) in xprScreen:eventHandler\n", type);
+ }
+}
+
+/*
+ * displayAtIndex
+ * Return the display ID for a particular display index.
+ */
+static CGDirectDisplayID
+displayAtIndex(int index)
+{
+ CGError err;
+ CGDisplayCount cnt;
+ CGDirectDisplayID dpy[index+1];
+
+ err = CGGetActiveDisplayList(index + 1, dpy, &cnt);
+ if (err == kCGErrorSuccess && cnt == index + 1)
+ return dpy[index];
+ else
+ return kCGNullDirectDisplay;
+}
+
+/*
+ * displayScreenBounds
+ * Return the bounds of a particular display.
+ */
+static CGRect
+displayScreenBounds(CGDirectDisplayID id)
+{
+ CGRect frame;
+
+ frame = CGDisplayBounds(id);
+
+ /* Remove menubar to help standard X11 window managers. */
+
+ if (frame.origin.x == 0 && frame.origin.y == 0)
+ {
+ frame.origin.y += aquaMenuBarHeight;
+ frame.size.height -= aquaMenuBarHeight;
+ }
+
+ return frame;
+}
+
+/*
+ * xprAddPseudoramiXScreens
+ * Add a single virtual screen encompassing all the physical screens
+ * with PseudoramiX.
+ */
+static void
+xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
+{
+ CGDisplayCount i, displayCount;
+ CGDirectDisplayID *displayList = NULL;
+ CGRect unionRect = CGRectNull, frame;
+
+ // Find all the CoreGraphics displays
+ CGGetActiveDisplayList(0, NULL, &displayCount);
+ displayList = xalloc(displayCount * sizeof(CGDirectDisplayID));
+ CGGetActiveDisplayList(displayCount, displayList, &displayCount);
+
+ /* Get the union of all screens */
+ for (i = 0; i < displayCount; i++)
+ {
+ CGDirectDisplayID dpy = displayList[i];
+ frame = displayScreenBounds(dpy);
+ unionRect = CGRectUnion(unionRect, frame);
+ }
+
+ /* Use unionRect as the screen size for the X server. */
+ *x = unionRect.origin.x;
+ *y = unionRect.origin.y;
+ *width = unionRect.size.width;
+ *height = unionRect.size.height;
+
+ /* Tell PseudoramiX about the real screens. */
+ for (i = 0; i < displayCount; i++)
+ {
+ CGDirectDisplayID dpy = displayList[i];
+
+ frame = displayScreenBounds(dpy);
+
+ /* ErrorF("PseudoramiX screen %d added: %dx%d @ (%d,%d).\n", i,
+ (int)frame.size.width, (int)frame.size.height,
+ (int)frame.origin.x, (int)frame.origin.y); */
+
+ frame.origin.x -= unionRect.origin.x;
+ frame.origin.y -= unionRect.origin.y;
+
+ /* ErrorF("PseudoramiX screen %d placed at X11 coordinate (%d,%d).\n",
+ i, (int)frame.origin.x, (int)frame.origin.y); */
+
+ PseudoramiXAddScreen(frame.origin.x, frame.origin.y,
+ frame.size.width, frame.size.height);
+ }
+
+ xfree(displayList);
+}
+
+/*
+ * xprDisplayInit
+ * Find number of CoreGraphics displays and initialize Xplugin.
+ */
+static void
+xprDisplayInit(void)
+{
+ CGDisplayCount displayCount;
+
+ // ErrorF("Display mode: Rootless Quartz -- Xplugin implementation\n");
+
+ CGGetActiveDisplayList(0, NULL, &displayCount);
+
+ /* With PseudoramiX, the X server only sees one screen; only PseudoramiX
+ itself knows about all of the screens. */
+
+ if (noPseudoramiXExtension)
+ darwinScreensFound = displayCount;
+ else
+ darwinScreensFound = 1;
+
+ if (xp_init(XP_BACKGROUND_EVENTS | XP_NO_DEFERRED_UPDATES) != Success)
+ FatalError("Could not initialize the Xplugin library.");
+
+ xp_select_events(XP_EVENT_DISPLAY_CHANGED
+ | XP_EVENT_WINDOW_STATE_CHANGED
+ | XP_EVENT_WINDOW_MOVED
+ | XP_EVENT_SURFACE_CHANGED
+ | XP_EVENT_SURFACE_DESTROYED,
+ eventHandler, NULL);
+
+ AppleDRIExtensionInit();
+ xprAppleWMInit();
+}
+
+/*
+ * xprAddScreen
+ * Init the framebuffer and record pixmap parameters for the screen.
+ */
+static Bool
+xprAddScreen(int index, ScreenPtr pScreen)
+{
+ DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
+ int depth = darwinDesiredDepth;
+
+ if(depth == -1) {
+ depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay);
+ //dfb->depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay);
+ //dfb->bitsPerRGB = CGDisplayBitsPerSample(kCGDirectMainDisplay);
+ //dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
+ }
+
+ switch(depth) {
+ case -8: // broken
+ FatalError("Unsupported color depth %d\n", darwinDesiredDepth);
+ dfb->visuals = (1 << StaticGray) | (1 << GrayScale);
+ dfb->preferredCVC = GrayScale;
+ dfb->depth = 8;
+ dfb->bitsPerRGB = 8;
+ dfb->bitsPerPixel = 8;
+ dfb->redMask = 0;
+ dfb->greenMask = 0;
+ dfb->blueMask = 0;
+ break;
+ case 8: // broken
+ dfb->visuals = PseudoColorMask;
+ dfb->preferredCVC = PseudoColor;
+ dfb->depth = 8;
+ dfb->bitsPerRGB = 8;
+ dfb->bitsPerPixel = 8;
+ dfb->redMask = 0;
+ dfb->greenMask = 0;
+ dfb->blueMask = 0;
+ break;
+ case 15:
+ dfb->visuals = LARGE_VISUALS;
+ dfb->preferredCVC = TrueColor;
+ dfb->depth = 15;
+ dfb->bitsPerRGB = 5;
+ dfb->bitsPerPixel = 16;
+ dfb->redMask = 0x7c00;
+ dfb->greenMask = 0x03e0;
+ dfb->blueMask = 0x001f;
+ break;
+ case 24:
+ dfb->visuals = LARGE_VISUALS;
+ dfb->preferredCVC = TrueColor;
+ dfb->depth = 24;
+ dfb->bitsPerRGB = 8;
+ dfb->bitsPerPixel = 32;
+ dfb->redMask = 0x00ff0000;
+ dfb->greenMask = 0x0000ff00;
+ dfb->blueMask = 0x000000ff;
+ break;
+ default:
+ FatalError("Unsupported color depth %d\n", darwinDesiredDepth);
+ }
+
+ if (noPseudoramiXExtension)
+ {
+ CGDirectDisplayID dpy;
+ CGRect frame;
+
+ dpy = displayAtIndex(index);
+
+ frame = displayScreenBounds(dpy);
+
+ dfb->x = frame.origin.x;
+ dfb->y = frame.origin.y;
+ dfb->width = frame.size.width;
+ dfb->height = frame.size.height;
+ }
+ else
+ {
+ xprAddPseudoramiXScreens(&dfb->x, &dfb->y, &dfb->width, &dfb->height);
+ }
+
+ /* Passing zero width (pitch) makes miCreateScreenResources set the
+ screen pixmap to the framebuffer pointer, i.e. NULL. The generic
+ rootless code takes care of making this work. */
+ dfb->pitch = 0;
+ dfb->framebuffer = NULL;
+
+ DRIScreenInit(pScreen);
+
+ return TRUE;
+}
+
+/*
+ * xprSetupScreen
+ * Setup the screen for rootless access.
+ */
+static Bool
+xprSetupScreen(int index, ScreenPtr pScreen)
+{
+ // Add alpha protecting replacements for fb screen functions
+
+#ifdef RENDER
+ {
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ ps->Composite = SafeAlphaComposite;
+ }
+#endif /* RENDER */
+
+ // Initialize accelerated rootless drawing
+ // Note that this must be done before DamageSetup().
+ RootlessAccelInit(pScreen);
+
+#ifdef DAMAGE
+ // The Damage extension needs to wrap underneath the
+ // generic rootless layer, so do it now.
+ if (!DamageSetup(pScreen))
+ return FALSE;
+#endif
+
+ // Initialize generic rootless code
+ if (!xprInit(pScreen))
+ return FALSE;
+
+ return DRIFinishScreenInit(pScreen);
+}
+
+/*
+ * xprUpdateScreen
+ * Update screen after configuation change.
+ */
+static void
+xprUpdateScreen(ScreenPtr pScreen)
+{
+ rootlessGlobalOffsetX = darwinMainScreenX;
+ rootlessGlobalOffsetY = darwinMainScreenY;
+
+ AppleWMSetScreenOrigin(WindowTable[pScreen->myNum]);
+
+ RootlessRepositionWindows(pScreen);
+ RootlessUpdateScreenPixmap(pScreen);
+}
+
+/*
+ * xprInitInput
+ * Finalize xpr specific setup.
+ */
+static void
+xprInitInput(int argc, char **argv)
+{
+ int i;
+
+ rootlessGlobalOffsetX = darwinMainScreenX;
+ rootlessGlobalOffsetY = darwinMainScreenY;
+
+ for (i = 0; i < screenInfo.numScreens; i++)
+ AppleWMSetScreenOrigin(WindowTable[i]);
+}
+
+/*
+ * Quartz display mode function list.
+ */
+static QuartzModeProcsRec xprModeProcs = {
+ xprDisplayInit,
+ xprAddScreen,
+ xprSetupScreen,
+ xprInitInput,
+ QuartzInitCursor,
+ NULL, // No need to update cursor
+ QuartzSuspendXCursor,
+ QuartzResumeXCursor,
+ NULL, // No capture or release in rootless mode
+ NULL,
+ NULL, // Xplugin sends screen change events directly
+ xprAddPseudoramiXScreens,
+ xprUpdateScreen,
+ xprIsX11Window,
+ xprHideWindows,
+ RootlessFrameForWindow,
+ TopLevelParent,
+ DRICreateSurface,
+ DRIDestroySurface
+};
+
+/*
+ * QuartzModeBundleInit
+ * Initialize the display mode bundle after loading.
+ */
+Bool
+QuartzModeBundleInit(void)
+{
+ quartzProcs = &xprModeProcs;
+ quartzOpenGLBundle = xprOpenGLBundle;
+ return TRUE;
+}