more patches to make the Quartz part of XDarwin work again

(thanks Peter and Torrey!)
This commit is contained in:
Ben Byer 2007-02-17 00:22:39 -08:00
parent 612144c811
commit 93777c7b96
15 changed files with 127 additions and 22 deletions

View File

@ -0,0 +1,56 @@
noinst_LIBRARIES = libXQuartz.a
AM_CFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@
AM_OBJCFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@
INCLUDES = -I$(srcdir) -I$(srcdir)/.. @XORG_INCS@
AM_DEFS = -DHAS_CG_MACH_PORT -DHAS_KL_API
if HAVE_X_PLUGIN
AM_DEFS += -DBUILD_XPR
XPR = xpr
endif
DEFS = @DEFS@ $(AM_DEFS) -DXBINDIR=\"${bindir}\"
SUBDIRS = cr fullscreen $(XPR)
libXQuartz_a_SOURCES = \
Preferences.m \
XApplication.m \
XServer.m \
applewm.c \
keysym2ucs.c \
quartz.c \
quartzAudio.c \
quartzCocoa.m \
quartzPasteboard.c \
quartzKeyboard.c \
quartzStartup.c \
pseudoramiX.c
bin_PROGRAMS = XDarwinStartup
XDarwinStartup_SOURCES = XDarwinStartup.c
XDarwinStartup_LDFLAGS = -Wl,-framework,CoreFoundation \
-Wl,-framework,ApplicationServices
XDarwinStartupCFLAGS = -DXBINDIR="${bindir}"
XDARWINROOT = @APPLE_APPLICATIONS_DIR@
BINDIR = $(bindir)
install-exec-local:
-(cd $(DESTDIR)$(BINDIR); rm X; $(LN_S) XDarwinStartup X)
man1_MANS = XDarwinStartup.man
EXTRA_DIST = \
applewmExt.h \
keysym2ucs.h \
Preferences.h \
pseudoramiX.h \
quartzAudio.h \
quartzCommon.h \
quartzCursor.c \
quartzCursor.h \
quartz.h \
quartzPasteboard.h \
XApplication.h \
XDarwin.pbproj/project.pbxproj \
XServer.h \
XDarwinStartup.man

View File

@ -31,7 +31,9 @@
* authorization.
*/
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.m,v 1.5 2004/06/08 22:58:10 torrey Exp $ */
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#import "quartzCommon.h"
#define BOOL xBOOL
@ -44,7 +46,7 @@
// Macros to build the path name
#ifndef XBINDIR
#define XBINDIR /usr/X11R6/bin
#define XBINDIR /usr/X11/bin
#endif
#define STR(s) #s
#define XSTRPATH(s) STR(s)

View File

@ -387,7 +387,7 @@
<key>CFBundleIconFile</key>
<string>XDarwin.icns</string>
<key>CFBundleIdentifier</key>
<string>org.xfree86.XDarwin</string>
<string>org.x.x11</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

View File

@ -48,7 +48,7 @@
// Macros to build the path name
#ifndef XBINDIR
#define XBINDIR /usr/X11R6/bin
#define XBINDIR /usr/X11/bin
#endif
#define STR(s) #s
#define XSTRPATH(s) STR(s) "/"
@ -124,7 +124,7 @@ int main(
// Otherwise query LaunchServices for the location of the XDarwin application
theStatus = LSFindApplicationForInfo(kLSUnknownCreator,
CFSTR("org.xfree86.XDarwin"),
CFSTR("org.x.x11"),
NULL, NULL, &appURL);
if (theStatus) {
fprintf(stderr, "Could not find the XDarwin application. (Error = 0x%lx)\n", theStatus);

View File

@ -36,18 +36,20 @@
*/
/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.3 2004/07/30 19:12:17 torrey Exp $ */
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.19 2003/11/24 05:39:01 torrey Exp $ */
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "quartzCommon.h"
#define BOOL xBOOL
#include "X.h"
#include "Xproto.h"
#include "X11/X.h"
#include "X11/Xproto.h"
#include "os.h"
#include "opaque.h"
#include "darwin.h"
#include "quartz.h"
#define _APPLEWM_SERVER_
#include "applewm.h"
#include "X11/extensions/applewm.h"
#include "applewmExt.h"
#undef BOOL
@ -830,13 +832,13 @@ static io_connect_t root_port;
chdir(tem);
/* Setup environment */
snprintf(buf, sizeof(buf), ":%s", display);
setenv("DISPLAY", buf, TRUE);
// snprintf(buf, sizeof(buf), ":%s", display);
// setenv("DISPLAY", buf, TRUE);
tem = getenv("PATH");
if (tem != NULL && tem[0] != NULL)
snprintf(buf, sizeof(buf), "%s:/usr/X11R6/bin", tem);
snprintf(buf, sizeof(buf), "%s:/usr/X11/bin", tem);
else
snprintf(buf, sizeof(buf), "/bin:/usr/bin:/usr/X11R6/bin");
snprintf(buf, sizeof(buf), "/bin:/usr/bin:/usr/X11/bin");
setenv("PATH", buf, TRUE);
execvp(argv[0], (char **const) argv);

View File

@ -24,7 +24,9 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "quartzCommon.h"
#define NEED_REPLIES
@ -43,7 +45,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <X11/Xatom.h>
#include "darwin.h"
#define _APPLEWM_SERVER_
#include "applewmstr.h"
#include "X11/extensions/applewmstr.h"
#include "applewmExt.h"
#define DEFINE_ATOM_HELPER(func,atom_name) \

View File

@ -34,7 +34,9 @@ Equipment Corporation.
******************************************************************/
#include "pseudoramiX.h"
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "extnsionst.h"
#include "dixstruct.h"
#include "window.h"

View File

@ -29,14 +29,16 @@
* 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_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "quartzCommon.h"
#include "quartz.h"
#include "darwin.h"
#include "quartzAudio.h"
#include "pseudoramiX.h"
#define _APPLEWM_SERVER_
#include "applewm.h"
#include "X11/extensions/applewm.h"
#include "applewmExt.h"
// X headers

View File

@ -35,7 +35,9 @@
* 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_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "quartzCommon.h"
#include "quartzAudio.h"
@ -44,6 +46,7 @@
#include "inputstr.h"
#include <X11/extensions/XI.h>
#include <assert.h>
void NSBeep();

View File

@ -35,6 +35,9 @@
* use or other dealings in this Software without prior written authorization.
*/
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.5 2004/06/08 22:58:10 torrey Exp $ */
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "quartzCommon.h"

View File

@ -30,6 +30,9 @@
* use or other dealings in this Software without prior written authorization.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "quartzCommon.h"
#include "quartzCursor.h"
#include "darwin.h"

View File

@ -36,6 +36,7 @@
#include "screenint.h"
Bool QuartzInitCursor(ScreenPtr pScreen);
void QuartzReallySetCursor(void);
void QuartzSuspendXCursor(ScreenPtr pScreen);
void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y);

View File

@ -33,13 +33,16 @@
prior written authorization.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "quartzCommon.h"
#include <CoreServices/CoreServices.h>
#include <Carbon/Carbon.h>
#include "darwinKeyboard.h"
#include "keysym.h"
#include "X11/keysym.h"
#include "keysym2ucs.h"
#ifdef HAS_KL_API

View File

@ -30,6 +30,9 @@
* use or other dealings in this Software without prior written authorization.
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "quartzPasteboard.h"
#include <X11/Xatom.h>

View File

@ -37,7 +37,7 @@
#include "quartz.h"
#include "opaque.h"
#include "micmap.h"
#include <assert.h>
int NSApplicationMain(int argc, char *argv[]);
char **envpGlobal; // argcGlobal and argvGlobal
@ -52,6 +52,9 @@ static GlxWrapInitVisualsPtr GlxWrapInitVisuals = NULL;
typedef Bool (*QuartzModeBundleInitPtr)(void);
void * __DarwinglXMesaProvider = NULL;
typedef void (*GlxPushProviderPtr)(void *);
GlxPushProviderPtr GlxPushProvider = NULL;
/*
* DarwinHandleGUI
@ -186,7 +189,7 @@ static void LoadGlxBundle(void)
// Choose the bundle to load
ErrorF("Loading GLX bundle ");
if (quartzUseAGL) {
if (/*quartzUseAGL*/0) {
bundleName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault,
quartzOpenGLBundle,
kCFStringEncodingASCII,
@ -213,6 +216,14 @@ static void LoadGlxBundle(void)
}
// Find the GLX init functions
__DarwinglXMesaProvider = (void *) CFBundleGetDataPointerForName(
glxBundle, CFSTR("__glXMesaProvider"));
GlxPushProvider = (void *) CFBundleGetFunctionPointerForName(
glxBundle, CFSTR("GlxPushProvider"));
GlxExtensionInit = (void *) CFBundleGetFunctionPointerForName(
glxBundle, CFSTR("GlxExtensionInit"));
@ -229,6 +240,18 @@ static void LoadGlxBundle(void)
}
/*
* DarwinGlxExtensionInit
* Initialize the GLX extension.
*/
void DarwinGlxPushProvider(void *impl)
{
if (!GlxExtensionInit)
LoadGlxBundle();
GlxPushProvider(impl);
}
/*
* DarwinGlxExtensionInit
* Initialize the GLX extension.