more changes for X11.app
This commit is contained in:
parent
fa06e11f97
commit
154d2c13f4
|
@ -25,11 +25,39 @@ libdarwinShared_a_SOURCES = darwin.c \
|
||||||
darwinKeyboard.c \
|
darwinKeyboard.c \
|
||||||
$(darwin_XINPUT_SRCS)
|
$(darwin_XINPUT_SRCS)
|
||||||
|
|
||||||
bin_PROGRAMS = XDarwin
|
bin_PROGRAMS = XDarwin Xquartz
|
||||||
XDarwin_SOURCES = \
|
XDarwin_SOURCES = \
|
||||||
$(top_srcdir)/fb/fbcmap.c \
|
$(top_srcdir)/fb/fbcmap.c \
|
||||||
$(top_srcdir)/mi/miinitext.c \
|
$(top_srcdir)/mi/miinitext.c \
|
||||||
$(top_srcdir)/Xi/stubs.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 = \
|
XDarwin_LDADD = \
|
||||||
$(top_builddir)/dix/dixfonts.lo \
|
$(top_builddir)/dix/dixfonts.lo \
|
||||||
$(top_builddir)/dix/libdix.la \
|
$(top_builddir)/dix/libdix.la \
|
||||||
|
@ -59,12 +87,48 @@ XDarwin_LDADD = \
|
||||||
@XORG_LIBS@ \
|
@XORG_LIBS@ \
|
||||||
-lXau -lXdmcp -lXfont -lfreetype
|
-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 = \
|
XDarwin_LDFLAGS = \
|
||||||
-XCClinker -Objc \
|
-XCClinker -Objc \
|
||||||
-Wl,-u,_miDCInitialize \
|
-Wl,-u,_miDCInitialize \
|
||||||
-Wl,-framework,IOKit
|
-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
|
XDarwin_CFLAGS = -DINXDARWIN
|
||||||
|
Xquartz_CFLAGS = -DINXQUARTZ -DHAS_CG_MACH_PORT -DHAS_KL_API -DHAVE_XORG_CONFIG_H
|
||||||
|
|
||||||
if XQUARTZ
|
if XQUARTZ
|
||||||
macosdir = $(darwinappdir)/Contents/MacOS
|
macosdir = $(darwinappdir)/Contents/MacOS
|
||||||
|
@ -72,6 +136,10 @@ macosdir = $(darwinappdir)/Contents/MacOS
|
||||||
DEFS += -DDARWIN_WITH_QUARTZ -DXFree86Server
|
DEFS += -DDARWIN_WITH_QUARTZ -DXFree86Server
|
||||||
|
|
||||||
macos_PROGRAMS = XDarwinApp
|
macos_PROGRAMS = XDarwinApp
|
||||||
|
macos_SCRIPTS = x11app
|
||||||
|
|
||||||
|
x11app:
|
||||||
|
cd apple && xcodebuild
|
||||||
|
|
||||||
XDarwinApp_SOURCES = \
|
XDarwinApp_SOURCES = \
|
||||||
$(top_srcdir)/fb/fbcmap.c \
|
$(top_srcdir)/fb/fbcmap.c \
|
||||||
|
@ -248,6 +316,7 @@ install-data-hook: $(HOOK_TARGETS)
|
||||||
|
|
||||||
xquartz-install-hook:
|
xquartz-install-hook:
|
||||||
mv $(DESTDIR)$(macosdir)/XDarwinApp $(DESTDIR)$(macosdir)/XDarwin
|
mv $(DESTDIR)$(macosdir)/XDarwinApp $(DESTDIR)$(macosdir)/XDarwin
|
||||||
|
cd apple && xcodebuild install
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
darwin.c \
|
darwin.c \
|
||||||
|
|
|
@ -38,11 +38,22 @@
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
#include "micmap.h"
|
#include "micmap.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
int NSApplicationMain(int argc, char *argv[]);
|
|
||||||
|
|
||||||
char **envpGlobal; // argcGlobal and argvGlobal
|
char **envpGlobal; // argcGlobal and argvGlobal
|
||||||
// are from dix/globals.c
|
// 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
|
// GLX bundle function pointers
|
||||||
typedef void (*GlxExtensionInitPtr)(void);
|
typedef void (*GlxExtensionInitPtr)(void);
|
||||||
static GlxExtensionInitPtr GlxExtensionInit = NULL;
|
static GlxExtensionInitPtr GlxExtensionInit = NULL;
|
||||||
|
@ -55,6 +66,7 @@ typedef Bool (*QuartzModeBundleInitPtr)(void);
|
||||||
void * __DarwinglXMesaProvider = NULL;
|
void * __DarwinglXMesaProvider = NULL;
|
||||||
typedef void (*GlxPushProviderPtr)(void *);
|
typedef void (*GlxPushProviderPtr)(void *);
|
||||||
GlxPushProviderPtr GlxPushProvider = NULL;
|
GlxPushProviderPtr GlxPushProvider = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DarwinHandleGUI
|
* DarwinHandleGUI
|
||||||
|
@ -74,7 +86,9 @@ void DarwinHandleGUI(
|
||||||
int fd[2];
|
int fd[2];
|
||||||
|
|
||||||
if (been_here) {
|
if (been_here) {
|
||||||
|
#ifdef INXDARWINAPP
|
||||||
QuartzReadPreferences();
|
QuartzReadPreferences();
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
been_here = TRUE;
|
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);
|
main_exit = NSApplicationMain(argc, argv);
|
||||||
|
#endif
|
||||||
exit(main_exit);
|
exit(main_exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef INX11APP
|
||||||
/*
|
/*
|
||||||
* QuartzLoadDisplayBundle
|
* QuartzLoadDisplayBundle
|
||||||
* Try to load the appropriate bundle containing the back end display code.
|
* Try to load the appropriate bundle containing the back end display code.
|
||||||
|
@ -239,15 +269,21 @@ static void LoadGlxBundle(void)
|
||||||
CFRelease(bundleURL);
|
CFRelease(bundleURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
Bool QuartzLoadDisplayBundle(const char *dpyBundleName)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* DarwinGlxExtensionInit
|
|
||||||
* Initialize the GLX extension.
|
|
||||||
*/
|
|
||||||
void DarwinGlxPushProvider(void *impl)
|
void DarwinGlxPushProvider(void *impl)
|
||||||
{
|
{
|
||||||
|
#ifndef INX11APP
|
||||||
if (!GlxExtensionInit)
|
if (!GlxExtensionInit)
|
||||||
LoadGlxBundle();
|
LoadGlxBundle();
|
||||||
|
#endif
|
||||||
|
|
||||||
GlxPushProvider(impl);
|
GlxPushProvider(impl);
|
||||||
}
|
}
|
||||||
|
@ -258,9 +294,10 @@ void DarwinGlxPushProvider(void *impl)
|
||||||
*/
|
*/
|
||||||
void DarwinGlxExtensionInit(void)
|
void DarwinGlxExtensionInit(void)
|
||||||
{
|
{
|
||||||
|
#ifndef INX11APP
|
||||||
if (!GlxExtensionInit)
|
if (!GlxExtensionInit)
|
||||||
LoadGlxBundle();
|
LoadGlxBundle();
|
||||||
|
#endif
|
||||||
GlxExtensionInit();
|
GlxExtensionInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,9 +308,10 @@ void DarwinGlxExtensionInit(void)
|
||||||
void DarwinGlxWrapInitVisuals(
|
void DarwinGlxWrapInitVisuals(
|
||||||
miInitVisualsProcPtr *procPtr)
|
miInitVisualsProcPtr *procPtr)
|
||||||
{
|
{
|
||||||
|
#ifndef INX11APP
|
||||||
if (!GlxWrapInitVisuals)
|
if (!GlxWrapInitVisuals)
|
||||||
LoadGlxBundle();
|
LoadGlxBundle();
|
||||||
|
#endif
|
||||||
GlxWrapInitVisuals(procPtr);
|
GlxWrapInitVisuals(procPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user