xserver: Branch 'master' - 2 commits
Ben Byer
bbyer at kemper.freedesktop.org
Tue Feb 27 09:40:08 EET 2007
hw/darwin/Makefile.am | 78 +++++++++++++++++++++++++++++++++++++--
hw/darwin/quartz/quartzStartup.c | 68 +++++++++++++++++++++++++++-------
2 files changed, 128 insertions(+), 18 deletions(-)
New commits:
diff-tree 776d4d6587c57f94bca8732f915d07a0d4e137c8 (from 154d2c13f4ec22b7e6332808bbcd049d63784891)
Author: Ben Byer <bbyer at bbyer.(none)>
Date: Mon Feb 26 23:40:00 2007 -0800
X11.app now builds correctly
diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am
index 3133eaa..22b396e 100644
--- a/hw/darwin/Makefile.am
+++ b/hw/darwin/Makefile.am
@@ -37,7 +37,7 @@ Xquartz_SOURCES = \
$(top_srcdir)/Xi/stubs.c \
apple/X11Application.m \
apple/X11Controller.m \
- quartz/XServer.m \
+ quartz/Xserver.m \
quartz/Preferences.m \
quartz/applewm.c \
quartz/keysym2ucs.c \
@@ -90,6 +90,7 @@ XDarwin_LDADD = \
Xquartz_LDADD = \
$(top_builddir)/dix/dixfonts.lo \
$(top_builddir)/dix/libdix.la \
+ $(top_builddir)/config/libconfig.a \
$(top_builddir)/os/libos.la \
./libdarwinShared.a \
$(top_builddir)/dix/libxpstubs.la \
@@ -122,7 +123,7 @@ Xquartz_LDFLAGS = \
-XCClinker -Objc \
-Wl,-u,_miDCInitialize \
-Wl,-framework,Carbon \
- -Wl,-framework,ApplicationServices \
+ -Wl,-framework,OpenGL \
-Wl,-framework,Cocoa \
-Wl,-framework,CoreAudio \
-Wl,-framework,IOKit
diff --git a/hw/darwin/quartz/quartzStartup.c b/hw/darwin/quartz/quartzStartup.c
index ae156f8..76392e4 100644
--- a/hw/darwin/quartz/quartzStartup.c
+++ b/hw/darwin/quartz/quartzStartup.c
@@ -42,10 +42,12 @@
char **envpGlobal; // argcGlobal and argvGlobal
// are from dix/globals.c
-#ifdef INX11APP
+#ifdef INXQUARTZ
void X11ControllerMain(int argc, char *argv[], void (*server_thread) (void *), void *server_arg);
+# ifdef GLXEXT
void GlxExtensionInit(void);
void GlxWrapInitVisuals(miInitVisualsProcPtr *);
+# endif
static void server_thread (void *arg) {
extern int main (int argc, char **argv, char **envp);
@@ -53,19 +55,18 @@ static void server_thread (void *arg) {
}
#else
int NSApplicationMain(int argc, char *argv[]);
+typedef Bool (*QuartzModeBundleInitPtr)(void);
+# ifdef GLXEXT
// GLX bundle function pointers
typedef void (*GlxExtensionInitPtr)(void);
static GlxExtensionInitPtr GlxExtensionInit = NULL;
-
typedef void (*GlxWrapInitVisualsPtr)(miInitVisualsProcPtr *);
static GlxWrapInitVisualsPtr GlxWrapInitVisuals = NULL;
-
-typedef Bool (*QuartzModeBundleInitPtr)(void);
-
void * __DarwinglXMesaProvider = NULL;
typedef void (*GlxPushProviderPtr)(void *);
GlxPushProviderPtr GlxPushProvider = NULL;
+# endif
#endif
/*
@@ -123,7 +124,7 @@ void DarwinHandleGUI(
}
}
-#ifdef INX11APP
+#ifdef INXQUARTZ
/* 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
@@ -143,7 +144,7 @@ void DarwinHandleGUI(
exit(main_exit);
}
-#ifndef INX11APP
+#ifndef INXQUARTZ
/*
* QuartzLoadDisplayBundle
* Try to load the appropriate bundle containing the back end display code.
@@ -201,7 +202,7 @@ Bool QuartzLoadDisplayBundle(
return TRUE;
}
-
+#ifdef GLXEXT
/*
* LoadGlxBundle
* The Quartz mode X server needs to dynamically load the appropriate
@@ -268,7 +269,7 @@ static void LoadGlxBundle(void)
CFRelease(bundleName);
CFRelease(bundleURL);
}
-
+# endif
#else
Bool QuartzLoadDisplayBundle(const char *dpyBundleName)
@@ -278,9 +279,10 @@ Bool QuartzLoadDisplayBundle(const char
#endif
+#ifdef GLXEXT
void DarwinGlxPushProvider(void *impl)
{
-#ifndef INX11APP
+#ifndef INXQUARTZ
if (!GlxExtensionInit)
LoadGlxBundle();
#endif
@@ -294,7 +296,7 @@ void DarwinGlxPushProvider(void *impl)
*/
void DarwinGlxExtensionInit(void)
{
-#ifndef INX11APP
+#ifndef INXQUARTZ
if (!GlxExtensionInit)
LoadGlxBundle();
#endif
@@ -308,13 +310,13 @@ void DarwinGlxExtensionInit(void)
void DarwinGlxWrapInitVisuals(
miInitVisualsProcPtr *procPtr)
{
-#ifndef INX11APP
+#ifndef INXQUARTZ
if (!GlxWrapInitVisuals)
LoadGlxBundle();
#endif
GlxWrapInitVisuals(procPtr);
}
-
+#endif
int DarwinModeProcessArgument( int argc, char *argv[], int i )
{
diff-tree 154d2c13f4ec22b7e6332808bbcd049d63784891 (from fa06e11f972e2a75c84b2f1586997ffc1239cbd9)
Author: Ben Byer <bbyer at bbyer.apple.com>
Date: Mon Feb 26 19:39:26 2007 -0800
more changes for X11.app
diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am
index ebbfb61..3133eaa 100644
--- a/hw/darwin/Makefile.am
+++ b/hw/darwin/Makefile.am
@@ -25,11 +25,39 @@ libdarwinShared_a_SOURCES = darwin.c \
darwinKeyboard.c \
$(darwin_XINPUT_SRCS)
-bin_PROGRAMS = XDarwin
+bin_PROGRAMS = XDarwin Xquartz
XDarwin_SOURCES = \
$(top_srcdir)/fb/fbcmap.c \
$(top_srcdir)/mi/miinitext.c \
$(top_srcdir)/Xi/stubs.c
+
+Xquartz_SOURCES = \
+ $(top_srcdir)/fb/fbcmap.c \
+ $(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/Xi/stubs.c \
+ apple/X11Application.m \
+ apple/X11Controller.m \
+ quartz/XServer.m \
+ quartz/Preferences.m \
+ quartz/applewm.c \
+ quartz/keysym2ucs.c \
+ quartz/pseudoramiX.c \
+ quartz/quartz.c \
+ quartz/quartzAudio.c \
+ quartz/quartzCocoa.m \
+ quartz/quartzKeyboard.c \
+ quartz/quartzPasteboard.c \
+ quartz/quartzStartup.c \
+ quartz/xpr/appledri.c \
+ quartz/xpr/dri.c \
+ quartz/xpr/xprAppleWM.c \
+ quartz/xpr/xprCursor.c \
+ quartz/xpr/xprFrame.c \
+ quartz/xpr/xprScreen.c \
+ quartz/xpr/x-hash.c \
+ quartz/xpr/x-hook.c \
+ quartz/xpr/x-list.c
+
XDarwin_LDADD = \
$(top_builddir)/dix/dixfonts.lo \
$(top_builddir)/dix/libdix.la \
@@ -59,12 +87,48 @@ XDarwin_LDADD = \
@XORG_LIBS@ \
-lXau -lXdmcp -lXfont -lfreetype
+Xquartz_LDADD = \
+ $(top_builddir)/dix/dixfonts.lo \
+ $(top_builddir)/dix/libdix.la \
+ $(top_builddir)/os/libos.la \
+ ./libdarwinShared.a \
+ $(top_builddir)/dix/libxpstubs.la \
+ $(top_builddir)/miext/shadow/libshadow.la \
+ $(top_builddir)/fb/libfb.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 \
+ @XORG_LIBS@ \
+ -lXau -lXdmcp -lXfont -lfreetype -lXplugin
+
XDarwin_LDFLAGS = \
- -XCClinker -Objc \
- -Wl,-u,_miDCInitialize \
- -Wl,-framework,IOKit
+ -XCClinker -Objc \
+ -Wl,-u,_miDCInitialize \
+ -Wl,-framework,IOKit
+
+Xquartz_LDFLAGS = \
+ -XCClinker -Objc \
+ -Wl,-u,_miDCInitialize \
+ -Wl,-framework,Carbon \
+ -Wl,-framework,ApplicationServices \
+ -Wl,-framework,Cocoa \
+ -Wl,-framework,CoreAudio \
+ -Wl,-framework,IOKit
XDarwin_CFLAGS = -DINXDARWIN
+Xquartz_CFLAGS = -DINXQUARTZ -DHAS_CG_MACH_PORT -DHAS_KL_API -DHAVE_XORG_CONFIG_H
if XQUARTZ
macosdir = $(darwinappdir)/Contents/MacOS
@@ -72,6 +136,10 @@ macosdir = $(darwinappdir)/Contents/MacO
DEFS += -DDARWIN_WITH_QUARTZ -DXFree86Server
macos_PROGRAMS = XDarwinApp
+macos_SCRIPTS = x11app
+
+x11app:
+ cd apple && xcodebuild
XDarwinApp_SOURCES = \
$(top_srcdir)/fb/fbcmap.c \
@@ -248,6 +316,7 @@ install-data-hook: $(HOOK_TARGETS)
xquartz-install-hook:
mv $(DESTDIR)$(macosdir)/XDarwinApp $(DESTDIR)$(macosdir)/XDarwin
+ cd apple && xcodebuild install
EXTRA_DIST = \
darwin.c \
diff --git a/hw/darwin/quartz/quartzStartup.c b/hw/darwin/quartz/quartzStartup.c
index 38fde3c..ae156f8 100644
--- a/hw/darwin/quartz/quartzStartup.c
+++ b/hw/darwin/quartz/quartzStartup.c
@@ -38,11 +38,22 @@
#include "opaque.h"
#include "micmap.h"
#include <assert.h>
-int NSApplicationMain(int argc, char *argv[]);
char **envpGlobal; // argcGlobal and argvGlobal
// are from dix/globals.c
+#ifdef INX11APP
+void X11ControllerMain(int argc, char *argv[], void (*server_thread) (void *), void *server_arg);
+void GlxExtensionInit(void);
+void GlxWrapInitVisuals(miInitVisualsProcPtr *);
+
+static void server_thread (void *arg) {
+ extern int main (int argc, char **argv, char **envp);
+ exit (main (argcGlobal, argvGlobal, envpGlobal));
+}
+#else
+int NSApplicationMain(int argc, char *argv[]);
+
// GLX bundle function pointers
typedef void (*GlxExtensionInitPtr)(void);
static GlxExtensionInitPtr GlxExtensionInit = NULL;
@@ -55,6 +66,7 @@ typedef Bool (*QuartzModeBundleInitPtr)(
void * __DarwinglXMesaProvider = NULL;
typedef void (*GlxPushProviderPtr)(void *);
GlxPushProviderPtr GlxPushProvider = NULL;
+#endif
/*
* DarwinHandleGUI
@@ -74,7 +86,9 @@ void DarwinHandleGUI(
int fd[2];
if (been_here) {
+#ifdef INXDARWINAPP
QuartzReadPreferences();
+#endif
return;
}
been_here = TRUE;
@@ -109,11 +123,27 @@ void DarwinHandleGUI(
}
}
+#ifdef INX11APP
+ /* 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. */
+ extern void _InitHLTB(void);
+
+ _InitHLTB();
+
+ X11ControllerMain(argc, argv, server_thread, NULL);
+#else
main_exit = NSApplicationMain(argc, argv);
+#endif
exit(main_exit);
}
-
+#ifndef INX11APP
/*
* QuartzLoadDisplayBundle
* Try to load the appropriate bundle containing the back end display code.
@@ -239,15 +269,21 @@ static void LoadGlxBundle(void)
CFRelease(bundleURL);
}
+#else
+
+Bool QuartzLoadDisplayBundle(const char *dpyBundleName)
+{
+ return TRUE;
+ }
+
+#endif
-/*
- * DarwinGlxExtensionInit
- * Initialize the GLX extension.
- */
void DarwinGlxPushProvider(void *impl)
{
+#ifndef INX11APP
if (!GlxExtensionInit)
LoadGlxBundle();
+#endif
GlxPushProvider(impl);
}
@@ -258,9 +294,10 @@ void DarwinGlxPushProvider(void *impl)
*/
void DarwinGlxExtensionInit(void)
{
+#ifndef INX11APP
if (!GlxExtensionInit)
LoadGlxBundle();
-
+#endif
GlxExtensionInit();
}
@@ -271,9 +308,10 @@ void DarwinGlxExtensionInit(void)
void DarwinGlxWrapInitVisuals(
miInitVisualsProcPtr *procPtr)
{
+#ifndef INX11APP
if (!GlxWrapInitVisuals)
LoadGlxBundle();
-
+#endif
GlxWrapInitVisuals(procPtr);
}
More information about the xorg-commit
mailing list