xserver: Branch 'xorg-server-1.2-apple'
Ben Byer
bbyer at kemper.freedesktop.org
Thu Nov 15 01:49:45 PST 2007
configure.ac | 39 ++++++++--------
dix/main.c | 7 ++
hw/darwin/Makefile.am | 2
hw/darwin/darwin.c | 5 --
hw/darwin/quartz/Makefile.am | 2
hw/darwin/quartz/applewm.c | 18 -------
hw/darwin/quartz/quartz.c | 7 --
hw/darwin/quartz/quartzCocoa.m | 64 --------------------------
hw/darwin/quartz/quartzStartup.c | 93 ---------------------------------------
include/dix-config.h.in | 3 +
10 files changed, 33 insertions(+), 207 deletions(-)
New commits:
commit 6ee982abcea164d5bc4472714aebb5b85d10f868
Author: Ben Byer <bbyer at bbyer.local>
Date: Thu Nov 15 01:49:33 2007 -0800
More XDarwin cleanup / dead code removal from Jeremy
diff --git a/configure.ac b/configure.ac
index 40d5649..facca68 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,11 +70,6 @@ AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
-AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [])
-if test "x$HAVE_LAUNCHD" = xyes; then
- AC_DEFINE(HAS_LAUNCHD, 1, [launchd support available])
-fi
-
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"])
@@ -464,6 +459,8 @@ AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir
[ APPLE_APPLICATIONS_DIR="${withval}" ].
[ APPLE_APPLICATIONS_DIR="/Applications/Utilities" ])
+AC_ARG_WITH(launchd, AS_HELP_STRING([--with-launchd], [Build with support for Apple's launchd (default: auto)]), [LAUNCHD=$withval], [LAUNCHD=auto])
+
AC_ARG_ENABLE(builddocs, AS_HELP_STRING([--enable-builddocs], [Build docs (default: disabled)]),
[BUILDDOCS=$enableval],
[BUILDDOCS=no])
@@ -1613,7 +1610,7 @@ if test "X$XQUARTZ" = Xauto; then
LDFLAGS=$save_LDFLAGS])
if test "X$xorg_cv_Carbon_framework" = Xyes; then
- AC_DEFINE([DARWIN_WITH_QUARTZ],[1],[Have Quartz])
+ AC_DEFINE([XQUARTZ],[1],[Have Quartz])
XQUARTZ=yes
else
XQUARTZ=no
@@ -1649,7 +1646,7 @@ if test "x$XQUARTZ" = xyes; then
AC_SUBST([DARWIN_LIBS])
AC_CHECK_LIB([Xplugin],[xp_init],[:])
AC_SUBST([APPLE_APPLICATIONS_DIR])
- CFLAGS="${CFLAGS} -DHAVE_LAUNCHD -D__DARWIN__ -DDARWIN_WITH_QUARTZ -DROOTLESS_WORKAROUND"
+ CFLAGS="${CFLAGS} -D__DARWIN__ -DROOTLESS_WORKAROUND"
PLIST_VERSION_STRING=$PACKAGE_VERSION
AC_SUBST([PLIST_VERSION_STRING])
PLIST_VENDOR_WEB=$VENDOR_WEB
@@ -1671,6 +1668,23 @@ if test "x$XQUARTZ" = xyes; then
DGA=no
fi
fi
+
+if test "x$LAUNCHD" = xauto; then
+ # Do we want to have this default to on for Xquartz builds only or any time we have launchd (like Xnest or Xvfb on OS-X)
+ #AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no])
+ AC_MSG_CHECKING([whether to support launchd])
+ if test "x$XQUARTZ" = xyes ; then
+ LAUNCHD=yes
+ else
+ LAUNCHD=no
+ fi
+ AC_MSG_RESULT([$LAUNCHD])
+fi
+
+if test "x$LAUNCHD" = xyes ; then
+ AC_DEFINE(HAVE_LAUNCHD, 1, [launchd support available])
+fi
+
# Support for objc in autotools is minimal and not documented.
OBJC='$(CC)'
OBJCLD='$(CCLD)'
@@ -1999,17 +2013,6 @@ hw/xgl/glxext/module/Makefile
hw/xnest/Makefile
hw/xwin/Makefile
hw/darwin/Makefile
-hw/darwin/bundle/Makefile
-hw/darwin/bundle/Dutch.lproj/Makefile
-hw/darwin/bundle/English.lproj/Makefile
-hw/darwin/bundle/French.lproj/Makefile
-hw/darwin/bundle/German.lproj/Makefile
-hw/darwin/bundle/Japanese.lproj/Makefile
-hw/darwin/bundle/Portuguese.lproj/Makefile
-hw/darwin/bundle/Spanish.lproj/Makefile
-hw/darwin/bundle/Swedish.lproj/Makefile
-hw/darwin/bundle/ko.lproj/Makefile
-hw/darwin/iokit/Makefile
hw/darwin/quartz/Makefile
hw/darwin/quartz/cr/Makefile
hw/darwin/quartz/fullscreen/Makefile
diff --git a/dix/main.c b/dix/main.c
index 586b800..50dbb67 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -256,10 +256,15 @@ main(int argc, char *argv[], char *envp[])
PrinterInitGlobals();
#endif
+#ifdef XQUARTZ
/* Quartz support on Mac OS X requires that the Cocoa event loop be in
* the main thread. This allows the X server main to be called again
* from another thread. */
-#ifdef DARWIN_WITH_QUARTZ
+
+ /* TODO: Put some runtime conditioning on this, so it doesn't get
+ * executed by Xvfb, Xnest, Xfake, Xephyr, etc when built at the same
+ * time as Xquartz
+ */
DarwinHandleGUI(argc, argv, envp);
#endif
diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am
index e83f04d..e23a3d1 100644
--- a/hw/darwin/Makefile.am
+++ b/hw/darwin/Makefile.am
@@ -1,5 +1,5 @@
AM_CFLAGS = @XORG_CFLAGS@
-AM_CPPFLAGS = @XORG_INCS@ -I../../miext/rootless -DUSE_NEW_CLUT -DBUILD_DATE=\"$(BUILD_DATE)\" -DHAVE_XORG_CONFIG_H -DXFree86Server
+AM_CPPFLAGS = @XORG_INCS@ -I../../miext/rootless -DUSE_NEW_CLUT -DBUILD_DATE=\"$(BUILD_DATE)\" -DHAVE_XORG_CONFIG_H -DXFree86Server -DINXQUARTZ
SUBDIRS = quartz utils
diff --git a/hw/darwin/darwin.c b/hw/darwin/darwin.c
index 52fd170..f0c35f8 100644
--- a/hw/darwin/darwin.c
+++ b/hw/darwin/darwin.c
@@ -836,14 +836,11 @@ void ddxUseMsg( void )
ErrorF("-keymap <file> : read the keymapping from a file instead of the kernel.\n");
ErrorF("-version : show the server version.\n");
ErrorF("\n");
-#ifdef DARWIN_WITH_QUARTZ
- ErrorF("Quartz modes:\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("-quartz : use default Mac OS X window server mode\n");
ErrorF("\n");
ErrorF("Options ignored in rootless mode:\n");
-#endif
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");
diff --git a/hw/darwin/quartz/Makefile.am b/hw/darwin/quartz/Makefile.am
index 5a78bfb..26bc8eb 100644
--- a/hw/darwin/quartz/Makefile.am
+++ b/hw/darwin/quartz/Makefile.am
@@ -2,7 +2,7 @@ noinst_LIBRARIES = libXQuartz.a
AM_CFLAGS = @XORG_CFLAGS@
AM_OBJCFLAGS = @XORG_CFLAGS@
-AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/.. @XORG_INCS@ -DXBINDIR=\"${bindir}\" -DINXQUARTZ -DHAS_KL_API -DHAVE_XORG_CONFIG_H
+AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/.. @XORG_INCS@ -DXBINDIR=\"${bindir}\" -DHAS_KL_API -DHAVE_XORG_CONFIG_H
SUBDIRS = cr fullscreen xpr
diff --git a/hw/darwin/quartz/applewm.c b/hw/darwin/quartz/applewm.c
index 78cf9df..2272a70 100644
--- a/hw/darwin/quartz/applewm.c
+++ b/hw/darwin/quartz/applewm.c
@@ -445,11 +445,7 @@ ProcAppleWMSetWindowMenu(
break;
}
}
-#ifdef INXQUARTZ
X11ApplicationSetWindowMenu (nitems, items, shortcuts);
-#else
- QuartzSetWindowMenu (nitems, items, shortcuts);
-#endif
free(items);
free(shortcuts);
@@ -464,12 +460,7 @@ ProcAppleWMSetWindowMenuCheck(
REQUEST(xAppleWMSetWindowMenuCheckReq);
REQUEST_SIZE_MATCH(xAppleWMSetWindowMenuCheckReq);
-#ifdef INXQUARTZ
X11ApplicationSetWindowMenuCheck (stuff->index);
-#else
- QuartzMessageMainThread(kQuartzSetWindowMenuCheck, &stuff->index,
- sizeof(stuff->index));
-#endif
return (client->noClientException);
}
@@ -480,11 +471,7 @@ ProcAppleWMSetFrontProcess(
{
REQUEST_SIZE_MATCH(xAppleWMSetFrontProcessReq);
-#ifdef INXQUARTZ
X11ApplicationSetFrontProcess();
-#else
- QuartzMessageMainThread(kQuartzSetFrontProcess, NULL, 0);
-#endif
return (client->noClientException);
}
@@ -526,12 +513,7 @@ ProcAppleWMSetCanQuit(
REQUEST_SIZE_MATCH(xAppleWMSetCanQuitReq);
-#ifdef INXQUARTZ
X11ApplicationSetCanQuit(stuff->state);
-#else
- QuartzMessageMainThread(kQuartzSetCanQuit, &stuff->state,
- sizeof(stuff->state));
-#endif
return (client->noClientException);
}
diff --git a/hw/darwin/quartz/quartz.c b/hw/darwin/quartz/quartz.c
index c0666e6..7ba452c 100644
--- a/hw/darwin/quartz/quartz.c
+++ b/hw/darwin/quartz/quartz.c
@@ -185,12 +185,8 @@ void DarwinModeInitInput(
int argc,
char **argv )
{
-#ifdef INXQUARTZ
X11ApplicationSetCanQuit(1);
X11ApplicationServerReady();
-#else
- QuartzMessageMainThread(kQuartzServerStarted, NULL, 0);
-#endif
// Do final display mode specific initialization before handling events
if (quartzProcs->InitInput)
quartzProcs->InitInput(argc, argv);
@@ -354,9 +350,6 @@ static void QuartzHide(void)
}
}
quartzServerVisible = FALSE;
-#ifndef INXQUARTZ
- QuartzMessageMainThread(kQuartzServerHidden, NULL, 0);
-#endif
}
diff --git a/hw/darwin/quartz/quartzCocoa.m b/hw/darwin/quartz/quartzCocoa.m
index 2e7b86b..c5e6e5c 100644
--- a/hw/darwin/quartz/quartzCocoa.m
+++ b/hw/darwin/quartz/quartzCocoa.m
@@ -45,63 +45,12 @@
#include <Cocoa/Cocoa.h>
-#ifndef INXQUARTZ
-#import "Preferences.h"
-#endif
#include "pseudoramiX.h"
extern void FatalError(const char *, ...);
extern char *display;
extern int noPanoramiXExtension;
-#ifndef INXQUARTZ
-/*
- * QuartzReadPreferences
- * Read the user preferences from the Cocoa front end.
- */
-void QuartzReadPreferences(void)
-{
- char *fileString;
-
- darwinFakeButtons = [Preferences fakeButtons];
- darwinFakeMouse2Mask = [Preferences button2Mask];
- darwinFakeMouse3Mask = [Preferences button3Mask];
- darwinMouseAccelChange = [Preferences mouseAccelChange];
- quartzUseSysBeep = [Preferences systemBeep];
- quartzEnableKeyEquivalents = [Preferences enableKeyEquivalents];
-
- // quartzRootless has already been set
- if (quartzRootless) {
- // Use PseudoramiX instead of Xinerama
- noPanoramiXExtension = TRUE;
- noPseudoramiXExtension = ![Preferences xinerama];
-
- quartzUseAGL = [Preferences useAGL];
- } else {
- noPanoramiXExtension = ![Preferences xinerama];
- noPseudoramiXExtension = TRUE;
-
- // Full screen can't use AGL for GLX
- quartzUseAGL = FALSE;
- }
-
- if ([Preferences useKeymapFile]) {
- fileString = (char *) [[Preferences keymapFile] lossyCString];
- darwinKeymapFile = (char *) malloc(strlen(fileString)+1);
- if (! darwinKeymapFile)
- FatalError("malloc failed in QuartzReadPreferences()!\n");
- strcpy(darwinKeymapFile, fileString);
- }
-
- display = (char *) malloc(8);
- if (! display)
- FatalError("malloc failed in QuartzReadPreferences()!\n");
- snprintf(display, 8, "%i", [Preferences display]);
-
- darwinDesiredDepth = [Preferences depth] - 1;
-}
-#endif
-
/*
* QuartzWriteCocoaPasteboard
* Write text to the Mac OS X pasteboard.
@@ -165,19 +114,6 @@ char *QuartzReadCocoaPasteboard(void)
int QuartzFSUseQDCursor(
int depth) // screen depth
{
-#ifndef INXQUARTZ
- switch ([Preferences useQDCursor]) {
- case qdCursor_Always:
- return TRUE;
- case qdCursor_Never:
- return FALSE;
- case qdCursor_Not8Bit:
- if (depth > 8)
- return TRUE;
- else
- return FALSE;
- }
-#endif
return TRUE;
}
diff --git a/hw/darwin/quartz/quartzStartup.c b/hw/darwin/quartz/quartzStartup.c
index f627790..583941d 100644
--- a/hw/darwin/quartz/quartzStartup.c
+++ b/hw/darwin/quartz/quartzStartup.c
@@ -40,19 +40,6 @@ char **envpGlobal; // argcGlobal and argvGlobal
// are from dix/globals.c
-#ifndef INXQUARTZ
-int NSApplicationMain(int argc, char *argv[]);
-
-// GLX bundle function pointers
-void * __DarwinglXMesaProvider = NULL;
-typedef void (*GlxPushProviderPtr)(void *);
-GlxPushProviderPtr GlxPushProvider = NULL;
-typedef void (*GlxExtensionInitPtr)(void);
-typedef void (*GlxWrapInitVisualsPtr)(miInitVisualsProcPtr *);
-typedef Bool (*QuartzModeBundleInitPtr)(void);
-static GlxExtensionInitPtr GlxExtensionInit = NULL;
-static GlxWrapInitVisualsPtr GlxWrapInitVisuals = NULL;
-#else
void X11ControllerMain(int argc, char *argv[],
void (*server_thread) (void *), void *server_arg);
void GlxExtensionInit(void);
@@ -63,7 +50,6 @@ static void server_thread (void *arg) {
exit (main (argcGlobal, argvGlobal, envpGlobal));
}
-#endif
/*
* DarwinHandleGUI
@@ -83,9 +69,6 @@ void DarwinHandleGUI(
int fd[2];
if (been_here) {
-#ifndef INXQUARTZ
- QuartzReadPreferences();
-#endif
return;
}
been_here = TRUE;
@@ -120,14 +103,10 @@ void DarwinHandleGUI(
}
}
-#ifndef INXQUARTZ
- main_exit = NSApplicationMain(argc, argv);
-#else
extern void _InitHLTB(void);
_InitHLTB();
X11ControllerMain(argc, argv, server_thread, NULL);
-#endif
exit(main_exit);
}
@@ -138,54 +117,6 @@ void DarwinHandleGUI(
Bool QuartzLoadDisplayBundle(
const char *dpyBundleName)
{
-#ifndef INXQUARTZ
- CFBundleRef mainBundle;
- CFStringRef bundleName;
- CFURLRef bundleURL;
- CFBundleRef dpyBundle;
- QuartzModeBundleInitPtr bundleInit;
-
- // Get the main bundle for the application
- mainBundle = CFBundleGetMainBundle();
-
- // Make CFString from bundle name
- bundleName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault,
- dpyBundleName,
- kCFStringEncodingASCII,
- kCFAllocatorNull);
-
- // Look for the appropriate bundle in the main bundle
- bundleURL = CFBundleCopyResourceURL(mainBundle, bundleName,
- NULL, NULL);
- if (!bundleURL) {
- ErrorF("Could not find display mode bundle %s.\n", dpyBundleName);
- return FALSE;
- }
-
- // Make a bundle instance using the URLRef
- dpyBundle = CFBundleCreate(kCFAllocatorDefault, bundleURL);
-
- if (!CFBundleLoadExecutable(dpyBundle)) {
- ErrorF("Could not load display mode bundle %s.\n", dpyBundleName);
- return FALSE;
- }
-
- // Lookup the bundle initialization function
- bundleInit = (void *)
- CFBundleGetFunctionPointerForName(dpyBundle,
- CFSTR("QuartzModeBundleInit"));
- if (!bundleInit) {
- ErrorF("Could not initialize display mode bundle %s.\n",
- dpyBundleName);
- return FALSE;
- }
- if (!bundleInit())
- return FALSE;
-
- // Release the CF objects
- CFRelease(bundleName);
- CFRelease(bundleURL);
-#endif
return TRUE;
}
@@ -234,20 +165,6 @@ static void LoadGlxBundle(void)
}
// Find the GLX init functions
-
-#ifndef INXQUARTZ
- __DarwinglXMesaProvider = (void *) CFBundleGetDataPointerForName(
- glxBundle, CFSTR("__glXMesaProvider"));
-
- GlxPushProvider = (void *) CFBundleGetFunctionPointerForName(
- glxBundle, CFSTR("GlxPushProvider"));
-
- GlxExtensionInit = (void *) CFBundleGetFunctionPointerForName(
- glxBundle, CFSTR("GlxExtensionInit"));
-
- GlxWrapInitVisuals = (void *) CFBundleGetFunctionPointerForName(
- glxBundle, CFSTR("GlxWrapInitVisuals"));
-#endif
if (!GlxExtensionInit || !GlxWrapInitVisuals) {
FatalError("Could not initialize GLX bundle.");
}
@@ -264,10 +181,6 @@ static void LoadGlxBundle(void)
*/
void DarwinGlxPushProvider(void *impl)
{
-#ifndef INXQUARTZ
- if (!GlxExtensionInit)
- LoadGlxBundle();
-#endif
GlxPushProvider(impl);
}
@@ -277,10 +190,6 @@ void DarwinGlxPushProvider(void *impl)
*/
void DarwinGlxExtensionInit(void)
{
-#ifndef INXQUARTZ
- if (!GlxExtensionInit)
- LoadGlxBundle();
-#endif
GlxExtensionInit();
}
@@ -291,10 +200,8 @@ void DarwinGlxExtensionInit(void)
void DarwinGlxWrapInitVisuals(
miInitVisualsProcPtr *procPtr)
{
-#ifdef INXQUARTZ
if (!GlxWrapInitVisuals)
LoadGlxBundle();
-#endif
GlxWrapInitVisuals(procPtr);
}
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 6badcca..29b917e 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -130,6 +130,9 @@
/* Define to 1 if launchd is available. */
#undef HAVE_LAUNCHD
+/* Have Quartz */
+#undef XQUARTZ
+
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
More information about the xorg-commit
mailing list