summaryrefslogtreecommitdiff
path: root/hw/darwin/quartz
diff options
context:
space:
mode:
authorBen Byer <bbyer@bbyer.(none)>2007-02-17 00:22:39 -0800
committerBen Byer <bbyer@bbyer.(none)>2007-02-17 00:22:39 -0800
commit93777c7b96e560da087963040e372aecbfca7bbc (patch)
tree82f7d7cf4863646b5ef7e8d1250c110997c8d2d5 /hw/darwin/quartz
parent612144c811fdf06b7c03cf48a321388fe411acd4 (diff)
downloadxserver-93777c7b96e560da087963040e372aecbfca7bbc.tar.gz
more patches to make the Quartz part of XDarwin work again
(thanks Peter and Torrey!)
Diffstat (limited to 'hw/darwin/quartz')
-rw-r--r--hw/darwin/quartz/Makefile.am56
-rw-r--r--hw/darwin/quartz/Preferences.m6
-rw-r--r--hw/darwin/quartz/XDarwin.pbproj/project.pbxproj2
-rw-r--r--hw/darwin/quartz/XDarwinStartup.c4
-rw-r--r--hw/darwin/quartz/XServer.m18
-rw-r--r--hw/darwin/quartz/applewm.c6
-rw-r--r--hw/darwin/quartz/pseudoramiX.c4
-rw-r--r--hw/darwin/quartz/quartz.c6
-rw-r--r--hw/darwin/quartz/quartzAudio.c5
-rw-r--r--hw/darwin/quartz/quartzCocoa.m3
-rw-r--r--hw/darwin/quartz/quartzCursor.c3
-rw-r--r--hw/darwin/quartz/quartzCursor.h1
-rw-r--r--hw/darwin/quartz/quartzKeyboard.c5
-rw-r--r--hw/darwin/quartz/quartzPasteboard.c3
-rw-r--r--hw/darwin/quartz/quartzStartup.c27
15 files changed, 127 insertions, 22 deletions
diff --git a/hw/darwin/quartz/Makefile.am b/hw/darwin/quartz/Makefile.am
new file mode 100644
index 000000000..978933013
--- /dev/null
+++ b/hw/darwin/quartz/Makefile.am
@@ -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
diff --git a/hw/darwin/quartz/Preferences.m b/hw/darwin/quartz/Preferences.m
index 6c14f4982..eb78fd32a 100644
--- a/hw/darwin/quartz/Preferences.m
+++ b/hw/darwin/quartz/Preferences.m
@@ -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)
diff --git a/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj b/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
index 90002db56..0ad831423 100644
--- a/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
+++ b/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
@@ -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>
diff --git a/hw/darwin/quartz/XDarwinStartup.c b/hw/darwin/quartz/XDarwinStartup.c
index 8697776bf..8041e32d5 100644
--- a/hw/darwin/quartz/XDarwinStartup.c
+++ b/hw/darwin/quartz/XDarwinStartup.c
@@ -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);
diff --git a/hw/darwin/quartz/XServer.m b/hw/darwin/quartz/XServer.m
index a5a1011e9..32bfbf58f 100644
--- a/hw/darwin/quartz/XServer.m
+++ b/hw/darwin/quartz/XServer.m
@@ -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);
diff --git a/hw/darwin/quartz/applewm.c b/hw/darwin/quartz/applewm.c
index 224d6c5e0..869f7a92f 100644
--- a/hw/darwin/quartz/applewm.c
+++ b/hw/darwin/quartz/applewm.c
@@ -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) \
diff --git a/hw/darwin/quartz/pseudoramiX.c b/hw/darwin/quartz/pseudoramiX.c
index a003daf43..7ba6d5a15 100644
--- a/hw/darwin/quartz/pseudoramiX.c
+++ b/hw/darwin/quartz/pseudoramiX.c
@@ -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"
diff --git a/hw/darwin/quartz/quartz.c b/hw/darwin/quartz/quartz.c
index 36a8bea08..913ea7252 100644
--- a/hw/darwin/quartz/quartz.c
+++ b/hw/darwin/quartz/quartz.c
@@ -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
diff --git a/hw/darwin/quartz/quartzAudio.c b/hw/darwin/quartz/quartzAudio.c
index b477b037b..16b9c2ba8 100644
--- a/hw/darwin/quartz/quartzAudio.c
+++ b/hw/darwin/quartz/quartzAudio.c
@@ -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();
diff --git a/hw/darwin/quartz/quartzCocoa.m b/hw/darwin/quartz/quartzCocoa.m
index 3cb191f22..c54c18acb 100644
--- a/hw/darwin/quartz/quartzCocoa.m
+++ b/hw/darwin/quartz/quartzCocoa.m
@@ -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"
diff --git a/hw/darwin/quartz/quartzCursor.c b/hw/darwin/quartz/quartzCursor.c
index e2333e2ea..1e618e37d 100644
--- a/hw/darwin/quartz/quartzCursor.c
+++ b/hw/darwin/quartz/quartzCursor.c
@@ -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"
diff --git a/hw/darwin/quartz/quartzCursor.h b/hw/darwin/quartz/quartzCursor.h
index 56cc94d49..57fac68a5 100644
--- a/hw/darwin/quartz/quartzCursor.h
+++ b/hw/darwin/quartz/quartzCursor.h
@@ -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);
diff --git a/hw/darwin/quartz/quartzKeyboard.c b/hw/darwin/quartz/quartzKeyboard.c
index fc12522be..bd2cc25ea 100644
--- a/hw/darwin/quartz/quartzKeyboard.c
+++ b/hw/darwin/quartz/quartzKeyboard.c
@@ -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
diff --git a/hw/darwin/quartz/quartzPasteboard.c b/hw/darwin/quartz/quartzPasteboard.c
index e92fe5c79..a3536fc56 100644
--- a/hw/darwin/quartz/quartzPasteboard.c
+++ b/hw/darwin/quartz/quartzPasteboard.c
@@ -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>
diff --git a/hw/darwin/quartz/quartzStartup.c b/hw/darwin/quartz/quartzStartup.c
index 277e5935f..38fde3cbe 100644
--- a/hw/darwin/quartz/quartzStartup.c
+++ b/hw/darwin/quartz/quartzStartup.c
@@ -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"));
@@ -233,6 +244,18 @@ static void LoadGlxBundle(void)
* DarwinGlxExtensionInit
* Initialize the GLX extension.
*/
+void DarwinGlxPushProvider(void *impl)
+{
+ if (!GlxExtensionInit)
+ LoadGlxBundle();
+
+ GlxPushProvider(impl);
+}
+
+/*
+ * DarwinGlxExtensionInit
+ * Initialize the GLX extension.
+ */
void DarwinGlxExtensionInit(void)
{
if (!GlxExtensionInit)