diff options
Diffstat (limited to 'xorg-server/hw/xquartz')
88 files changed, 3111 insertions, 1673 deletions
diff --git a/xorg-server/hw/xquartz/GL/Makefile.am b/xorg-server/hw/xquartz/GL/Makefile.am index 8f4478fec..9b61305d6 100644 --- a/xorg-server/hw/xquartz/GL/Makefile.am +++ b/xorg-server/hw/xquartz/GL/Makefile.am @@ -3,8 +3,6 @@ AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS) AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/glx \ - -I$(top_srcdir)/GL/include \ - -I$(top_srcdir)/GL/mesa/glapi \ -I$(top_srcdir)/hw/xquartz \ -I$(top_srcdir)/hw/xquartz/xpr \ -I$(top_srcdir)/miext/damage diff --git a/xorg-server/hw/xquartz/GL/Makefile.in b/xorg-server/hw/xquartz/GL/Makefile.in index a401c73c2..0f18cf3ef 100644 --- a/xorg-server/hw/xquartz/GL/Makefile.in +++ b/xorg-server/hw/xquartz/GL/Makefile.in @@ -37,8 +37,11 @@ host_triplet = @host@ subdir = hw/xquartz/GL DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -48,7 +51,8 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) @@ -76,6 +80,7 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_MAKEFLAGS = @AM_MAKEFLAGS@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ @@ -96,9 +101,12 @@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -127,7 +135,9 @@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -136,9 +146,13 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +F77 = @F77@ +FC = @FC@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -177,12 +191,13 @@ LTCOMPILE = @LTCOMPILE@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MAKE_HTML = @MAKE_HTML@ MAKE_PDF = @MAKE_PDF@ MAKE_PS = @MAKE_PS@ MAKE_TEXT = @MAKE_TEXT@ -MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ @@ -202,7 +217,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ @@ -212,6 +226,7 @@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PROJECTROOT = @PROJECTROOT@ PS2PDF = @PS2PDF@ +Q = @Q@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ @@ -225,11 +240,10 @@ STRIP = @STRIP@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ -VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@ -VENDOR_NAME = @VENDOR_NAME@ +V = @V@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ -VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -265,6 +279,7 @@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -289,7 +304,6 @@ YFLAGS = @YFLAGS@ __XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ -abi_font = @abi_font@ abi_videodrv = @abi_videodrv@ abi_xinput = @abi_xinput@ abs_builddir = @abs_builddir@ @@ -312,6 +326,7 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ +distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ driverdir = @driverdir@ dvidir = @dvidir@ @@ -343,7 +358,9 @@ psdir = @psdir@ sbindir = @sbindir@ sdkdir = @sdkdir@ sharedstatedir = @sharedstatedir@ +shavedir = @shavedir@ srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ @@ -354,8 +371,6 @@ AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS) AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/glx \ - -I$(top_srcdir)/GL/include \ - -I$(top_srcdir)/GL/mesa/glapi \ -I$(top_srcdir)/hw/xquartz \ -I$(top_srcdir)/hw/xquartz/xpr \ -I$(top_srcdir)/miext/damage diff --git a/xorg-server/hw/xquartz/GL/capabilities.c b/xorg-server/hw/xquartz/GL/capabilities.c index bc3966f4b..99b9eae61 100644 --- a/xorg-server/hw/xquartz/GL/capabilities.c +++ b/xorg-server/hw/xquartz/GL/capabilities.c @@ -425,7 +425,7 @@ static CGLError handleRendererDescriptions(CGLRendererInfoObj info, GLint r, handleAccumulationModes(c, flags); - return 0; + return kCGLNoError; } static void initCapabilities(struct glCapabilities *cap) { @@ -491,56 +491,36 @@ void freeGlCapabilities(struct glCapabilities *cap) { cap->configurations = NULL; } -enum { MAX_DISPLAYS = 3 }; - /*Return true if an error occured. */ bool getGlCapabilities(struct glCapabilities *cap) { - CGDirectDisplayID dspys[MAX_DISPLAYS]; - CGDisplayErr err; - CGOpenGLDisplayMask displayMask; - CGDisplayCount i, displayCount = 0; + CGLRendererInfoObj info; + CGLError err; + GLint numRenderers = 0, r; initCapabilities(cap); - - err = CGGetActiveDisplayList(MAX_DISPLAYS, dspys, &displayCount); - if(err) { - fprintf(stderr, "CGGetActiveDisplayList error: %s\n", CGLErrorString(err)); - return true; - } - - for(i = 0; i < displayCount; ++i) { - displayMask = CGDisplayIDToOpenGLDisplayMask(dspys[i]); - - CGLRendererInfoObj info; - GLint numRenderers = 0, r, renderCount = 0; - - err = CGLQueryRendererInfo(displayMask, &info, &numRenderers); - if(err) { + err = CGLQueryRendererInfo((GLuint)-1, &info, &numRenderers); + if(err) { fprintf(stderr, "CGLQueryRendererInfo error: %s\n", CGLErrorString(err)); - fprintf(stderr, "trying to continue...\n"); - continue; + return err; } - - CGLDescribeRenderer(info, 0, kCGLRPRendererCount, &renderCount); - for(r = 0; r < renderCount; ++r) { - CGLError derr; + for(r = 0; r < numRenderers; r++) { struct glCapabilitiesConfig tmpconf, *conf; initConfig(&tmpconf); - derr = handleRendererDescriptions(info, r, &tmpconf); - if(derr) { - fprintf(stderr, "error: %s\n", CGLErrorString(derr)); - fprintf(stderr, "trying to continue...\n"); - continue; + err = handleRendererDescriptions(info, r, &tmpconf); + if(err) { + fprintf(stderr, "handleRendererDescriptions returned error: %s\n", CGLErrorString(err)); + fprintf(stderr, "trying to continue...\n"); + continue; } conf = malloc(sizeof(*conf)); if(NULL == conf) { - perror("malloc"); - abort(); + perror("malloc"); + abort(); } /* Copy the struct. */ @@ -551,9 +531,8 @@ bool getGlCapabilities(struct glCapabilities *cap) { cap->configurations = conf; } - CGLDestroyRendererInfo(info); - } - + CGLDestroyRendererInfo(info); + /* No error occured. We are done. */ - return false; + return kCGLNoError; } diff --git a/xorg-server/hw/xquartz/GL/indirect.c b/xorg-server/hw/xquartz/GL/indirect.c index 0a60672b6..176282532 100644 --- a/xorg-server/hw/xquartz/GL/indirect.c +++ b/xorg-server/hw/xquartz/GL/indirect.c @@ -39,33 +39,92 @@ #include <AvailabilityMacros.h> -/* - * These define seem questionable to me, but I'm not sure why they were here - * in the first place. - */ -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 -#define GL_EXT_histogram 1 -#define GL_EXT_polygon_offset 1 -#define GL_SGIS_pixel_texture 1 -#define GL_SGIX_pixel_texture 1 -#define GL_EXT_multisample 1 -#define GL_SGIS_multisample 1 -#define GL_EXT_vertex_array 1 -#define GL_ARB_point_parameters 1 -#define GL_NV_vertex_array_range 1 -#define GL_MESA_resize_buffers 1 -#define GL_ARB_window_pos 1 -#define GL_EXT_cull_vertex 1 -#define GL_NV_vertex_program 1 -#define GL_APPLE_fence 1 -#define GL_IBM_multimode_draw_arrays 1 -#define GL_EXT_fragment_shader 1 -#endif +#define GL_GLEXT_WUNDEF_SUPPORT #include <OpenGL/OpenGL.h> #include <OpenGL/CGLContext.h> -#include <GL/gl.h> +/* These next few GL_EXT pre-processing blocks are to explicitly define + * these symbols to 0 if they are not set by OpenGL.framework. This + * prevents the X11 glext.h from setting them to 1. + */ + +#ifndef GL_EXT_fragment_shader +#define GL_EXT_fragment_shader 0 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 0 +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 0 +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 0 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 0 +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 0 +#endif + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 0 +#endif + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 0 +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 0 +#endif + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 0 +#endif + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 0 +#endif + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 0 +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 0 +#endif + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 0 +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 0 +#endif + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 0 +#endif + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 0 +#endif + +/* Tiger PPC doesn't have the associated symbols, but glext.h says it does. Liars! + * http://trac.macports.org/ticket/20638 + */ +#if defined(__ppc__) && MAC_OS_X_VERSION_MIN_REQUIRED == 1040 +#undef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 0 +#endif + #include <GL/glxproto.h> #include <windowstr.h> #include <resource.h> @@ -83,7 +142,8 @@ #include "x-hash.h" #include "x-list.h" -#include "capabilities.h" +//#include "capabilities.h" +#include "visualConfigs.h" typedef unsigned long long GLuint64EXT; typedef long long GLint64EXT; @@ -123,13 +183,6 @@ __GLXprovider __glXDRISWRastProvider = { NULL }; -__GLXprovider * -GlxGetDRISWRastProvider (void) -{ - GLAQUA_DEBUG_MSG("GlxGetDRISWRastProvider\n"); - return &__glXDRISWRastProvider; -} - typedef struct __GLXAquaScreen __GLXAquaScreen; typedef struct __GLXAquaContext __GLXAquaContext; typedef struct __GLXAquaDrawable __GLXAquaDrawable; @@ -167,7 +220,7 @@ __glXAquaScreenCreateContext(__GLXscreen *screen, GLAQUA_DEBUG_MSG("glXAquaScreenCreateContext\n"); - context = xalloc (sizeof (__GLXAquaContext)); + context = xcalloc(1, sizeof (__GLXAquaContext)); if (context == NULL) return NULL; @@ -418,7 +471,6 @@ static int __glXAquaContextForceCurrent(__GLXcontext *baseContext) } /* Drawing surface notification callbacks */ - static GLboolean __glXAquaDrawableSwapBuffers(__GLXdrawable *base) { CGLError err; __GLXAquaDrawable *drawable; @@ -515,190 +567,6 @@ static void __glXAquaScreenDestroy(__GLXscreen *screen) { xfree(screen); } -static __GLXconfig *CreateConfigs(int *numConfigsPtr, int screenNumber) { - __GLXconfig *c, *result; - struct glCapabilities cap; - struct glCapabilitiesConfig *conf = NULL; - int numConfigs = 0; - int i; - - if(getGlCapabilities(&cap)) - FatalError("error from getGlCapabilities() in %s\n", __func__); - - assert(NULL != cap.configurations); - - for(conf = cap.configurations; conf; conf = conf->next) { - if(conf->total_color_buffers <= 0) - continue; - - numConfigs += (conf->stereo ? 2 : 1) - * (conf->aux_buffers ? 2 : 1) - * conf->buffers - * ((conf->total_stencil_bit_depths > 0) ? - conf->total_stencil_bit_depths : 1) - * conf->total_color_buffers - * ((conf->total_accum_buffers > 0) ? conf->total_accum_buffers : 1) - * conf->total_depth_buffer_depths - * (conf->multisample_buffers + 1); - } - - *numConfigsPtr = numConfigs; - - c = xalloc(sizeof(*c) * numConfigs); - - if(NULL == c) - return NULL; - - - - result = c; - - memset(result, 0, sizeof(*c) * numConfigs); - - i = 0; - - for(conf = cap.configurations; conf; conf = conf->next) { - int stereo, aux, buffers, stencil, color, accum, depth, msample; - - for(stereo = 0; stereo < (conf->stereo ? 2 : 1); ++stereo) { - for(aux = 0; aux < (conf->aux_buffers ? 2 : 1); ++aux) { - for(buffers = 0; buffers < conf->buffers; ++buffers) { - for(stencil = 0; stencil < ((conf->total_stencil_bit_depths > 0) ? - conf->total_stencil_bit_depths : 1); ++stencil) { - for(color = 0; color < conf->total_color_buffers; ++color) { - for(accum = 0; accum < ((conf->total_accum_buffers > 0) ? - conf->total_accum_buffers : 1); ++accum) { - for(depth = 0; depth < conf->total_depth_buffer_depths; ++depth) { - for(msample = 0; msample < (conf->multisample_buffers + 1); ++msample) { - if((i + 1) < numConfigs) { - c->next = c + 1; - } else { - c->next = NULL; - } - - c->doubleBufferMode = buffers ? GL_TRUE : GL_FALSE; - c->stereoMode = stereo ? GL_TRUE : GL_FALSE; - - c->redBits = conf->color_buffers[color].r; - c->greenBits = conf->color_buffers[color].g; - c->blueBits = conf->color_buffers[color].b; - c->alphaBits = 0; - - if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->color_buffers[color].a) { - c->alphaBits = conf->color_buffers[color].a; - } - - c->redMask = -1; - c->greenMask = -1; - c->blueMask = -1; - c->alphaMask = -1; - - c->rgbBits = c->redBits + c->greenBits + c->blueBits + c->alphaBits; - c->indexBits = 0; - - c->accumRedBits = 0; - c->accumGreenBits = 0; - c->accumBlueBits = 0; - c->accumAlphaBits = 0; - - if(conf->total_accum_buffers > 0) { - c->accumRedBits = conf->accum_buffers[accum].r; - c->accumGreenBits = conf->accum_buffers[accum].g; - c->accumBlueBits = conf->accum_buffers[accum].b; - if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->accum_buffers[accum].a) { - c->accumAlphaBits = conf->accum_buffers[accum].a; - } - } - - c->depthBits = conf->depth_buffers[depth]; - - c->stencilBits = 0; - - if(conf->total_stencil_bit_depths > 0) { - c->stencilBits = conf->stencil_bit_depths[stencil]; - } - - - c->numAuxBuffers = aux ? conf->aux_buffers : 0; - - c->level = 0; - /*TODO what should this be? */ - c->pixmapMode = 0; - - c->visualID = -1; - c->visualType = GLX_TRUE_COLOR; - - if(conf->accelerated) { - c->visualRating = GLX_NONE; - } else { - c->visualRating = GLX_SLOW_VISUAL_EXT; - } - - c->transparentPixel = GLX_NONE; - c->transparentRed = GLX_NONE; - c->transparentGreen = GLX_NONE; - c->transparentAlpha = GLX_NONE; - c->transparentIndex = GLX_NONE; - - c->sampleBuffers = 0; - c->samples = 0; - - if(msample > 0) { - c->sampleBuffers = conf->multisample_buffers; - c->samples = conf->multisample_samples; - } - - /* SGIX_fbconfig / GLX 1.3 */ - c->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT; - c->renderType = GLX_RGBA_BIT; - c->xRenderable = GL_TRUE; - c->fbconfigID = -1; - - /*TODO add querying code to capabilities.c for the Pbuffer maximums. - *I'm not sure we can even use CGL for Pbuffers yet... - */ - /* SGIX_pbuffer / GLX 1.3 */ - c->maxPbufferWidth = 0; - c->maxPbufferHeight = 0; - c->maxPbufferPixels = 0; - c->optimalPbufferWidth = 0; - c->optimalPbufferHeight = 0; - c->visualSelectGroup = 0; - - c->swapMethod = GLX_SWAP_UNDEFINED_OML; - - c->screen = screenNumber; - - /* EXT_texture_from_pixmap */ - c->bindToTextureRgb = 0; - c->bindToTextureRgba = 0; - c->bindToMipmapTexture = 0; - c->bindToTextureTargets = 0; - c->yInverted = 0; - - if(c->next) - c = c->next; - - ++i; - } - } - } - } - } - } - } - } - } - - if(i != numConfigs) - FatalError("The number of __GLXconfig generated does not match the initial calculation!\n"); - - - freeGlCapabilities(&cap); - - return result; -} - /* This is called by __glXInitScreens(). */ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) { __GLXAquaScreen *screen; @@ -708,7 +576,8 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) { if (pScreen == NULL) return NULL; - screen = xalloc(sizeof *screen); + screen = xcalloc(1, sizeof *screen); + if(NULL == screen) return NULL; @@ -720,14 +589,10 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) { screen->base.swapBarrierFuncs = NULL; screen->base.pScreen = pScreen; - screen->base.fbconfigs = CreateConfigs(&screen->base.numFBConfigs, - pScreen->myNum); - + screen->base.fbconfigs = __glXAquaCreateVisualConfigs(&screen->base.numFBConfigs, pScreen->myNum); + __glXScreenInit(&screen->base, pScreen); - /* __glXScreenInit initializes these, so the order here is important, if we need these... */ - // screen->base.GLextensions = ""; - // screen->base.GLXvendor = "Apple"; screen->base.GLXversion = xstrdup("1.4"); screen->base.GLXextensions = xstrdup("GLX_SGIX_fbconfig " "GLX_SGIS_multisample " @@ -740,11 +605,12 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) { return &screen->base; } +#if 0 // unused static void __glXAquaDrawableCopySubBuffer (__GLXdrawable *drawable, int x, int y, int w, int h) { /*TODO finish me*/ } - +#endif static void __glXAquaDrawableDestroy(__GLXdrawable *base) { /* gstaplin: base is the head of the structure, so it's at the same @@ -815,735 +681,957 @@ GLuint __glFloorLog2(GLuint val) } void warn_func(void * p1, char *format, ...) { - va_list v; - va_start(v, format); - vfprintf(stderr, format, v); - va_end(v); + va_list v; + va_start(v, format); + vfprintf(stderr, format, v); + va_end(v); } static void setup_dispatch_table(void) { - struct _glapi_table *disp=_glapi_get_dispatch(); - _glapi_set_warning_func((_glapi_warning_func)warn_func); - _glapi_noop_enable_warnings(TRUE); - - SET_Accum(disp, glAccum); - SET_ActiveStencilFaceEXT(disp, glActiveStencilFaceEXT); - SET_ActiveTextureARB(disp, glActiveTextureARB); -//SET_AlphaFragmentOp1ATI(disp, glAlphaFragmentOp1EXT); // <-- EXT -> ATI -//SET_AlphaFragmentOp2ATI(disp, glAlphaFragmentOp2EXT); -//SET_AlphaFragmentOp3ATI(disp, glAlphaFragmentOp3EXT); - SET_AlphaFunc(disp, glAlphaFunc); -//SET_AreProgramsResidentNV(disp, glAreProgramsResidentNV); - SET_AreTexturesResident(disp, glAreTexturesResident); - SET_ArrayElement(disp, glArrayElement); - SET_AttachObjectARB(disp, glAttachObjectARB); - SET_Begin(disp, glBegin); -//SET_BeginFragmentShaderATI(disp, glBeginFragmentShaderEXT); // <-- EXT -> ATI - SET_BeginQueryARB(disp, glBeginQueryARB); - SET_BindAttribLocationARB(disp, glBindAttribLocationARB); - SET_BindBufferARB(disp, glBindBufferARB); -//SET_BindFragmentShaderATI(disp, glBindFragmentShaderEXT); // <-- EXT -> ATI - SET_BindFramebufferEXT(disp, glBindFramebufferEXT); -//SET_BindProgramNV(disp, glBindProgramNV); - SET_BindRenderbufferEXT(disp, glBindRenderbufferEXT); - SET_BindTexture(disp, glBindTexture); - SET_Bitmap(disp, glBitmap); - SET_BlendColor(disp, glBlendColor); - SET_BlendEquation(disp, glBlendEquation); - SET_BlendEquationSeparateEXT(disp, glBlendEquationSeparateEXT); - SET_BlendFunc(disp, glBlendFunc); - SET_BlendFuncSeparateEXT(disp, glBlendFuncSeparateEXT); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 - SET_BlitFramebufferEXT(disp, glBlitFramebufferEXT); -#endif - SET_BufferDataARB(disp, glBufferDataARB); - SET_BufferSubDataARB(disp, glBufferSubDataARB); - SET_CallList(disp, glCallList); - SET_CallLists(disp, glCallLists); - SET_CheckFramebufferStatusEXT(disp, glCheckFramebufferStatusEXT); - SET_Clear(disp, glClear); - SET_ClearAccum(disp, glClearAccum); - SET_ClearColor(disp, glClearColor); - SET_ClearDepth(disp, glClearDepth); - SET_ClearIndex(disp, glClearIndex); - SET_ClearStencil(disp, glClearStencil); - SET_ClientActiveTextureARB(disp, glClientActiveTextureARB); - SET_ClipPlane(disp, glClipPlane); - SET_Color3b(disp, glColor3b); - SET_Color3bv(disp, glColor3bv); - SET_Color3d(disp, glColor3d); - SET_Color3dv(disp, glColor3dv); - SET_Color3f(disp, glColor3f); - SET_Color3fv(disp, glColor3fv); - SET_Color3i(disp, glColor3i); - SET_Color3iv(disp, glColor3iv); - SET_Color3s(disp, glColor3s); - SET_Color3sv(disp, glColor3sv); - SET_Color3ub(disp, glColor3ub); - SET_Color3ubv(disp, glColor3ubv); - SET_Color3ui(disp, glColor3ui); - SET_Color3uiv(disp, glColor3uiv); - SET_Color3us(disp, glColor3us); - SET_Color3usv(disp, glColor3usv); - SET_Color4b(disp, glColor4b); - SET_Color4bv(disp, glColor4bv); - SET_Color4d(disp, glColor4d); - SET_Color4dv(disp, glColor4dv); - SET_Color4f(disp, glColor4f); - SET_Color4fv(disp, glColor4fv); - SET_Color4i(disp, glColor4i); - SET_Color4iv(disp, glColor4iv); - SET_Color4s(disp, glColor4s); - SET_Color4sv(disp, glColor4sv); - SET_Color4ub(disp, glColor4ub); - SET_Color4ubv(disp, glColor4ubv); - SET_Color4ui(disp, glColor4ui); - SET_Color4uiv(disp, glColor4uiv); - SET_Color4us(disp, glColor4us); - SET_Color4usv(disp, glColor4usv); -//SET_ColorFragmentOp1ATI(disp, glColorFragmentOp1EXT); // <-- EXT -> ATI -//SET_ColorFragmentOp2ATI(disp, glColorFragmentOp2EXT); -//SET_ColorFragmentOp3ATI(disp, glColorFragmentOp3EXT); - SET_ColorMask(disp, glColorMask); - SET_ColorMaterial(disp, glColorMaterial); - SET_ColorPointer(disp, glColorPointer); -//SET_ColorPointerEXT(disp, glColorPointerEXT); - SET_ColorSubTable(disp, glColorSubTable); - SET_ColorTable(disp, glColorTable); - SET_ColorTableParameterfv(disp, glColorTableParameterfv); - SET_ColorTableParameteriv(disp, glColorTableParameteriv); - - -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 - SET_CombinerInputNV(disp, glCombinerInputNV); - SET_CombinerOutputNV(disp, glCombinerOutputNV); - SET_CombinerParameterfNV(disp, glCombinerParameterfNV); - SET_CombinerParameterfvNV(disp, glCombinerParameterfvNV); - SET_CombinerParameteriNV(disp, glCombinerParameteriNV); - SET_CombinerParameterivNV(disp, glCombinerParameterivNV); -#endif - SET_CompileShaderARB(disp, glCompileShaderARB); - SET_CompressedTexImage1DARB(disp, glCompressedTexImage1DARB); - SET_CompressedTexImage2DARB(disp, glCompressedTexImage2DARB); - SET_CompressedTexImage3DARB(disp, glCompressedTexImage3DARB); - SET_CompressedTexSubImage1DARB(disp, glCompressedTexSubImage1DARB); - SET_CompressedTexSubImage2DARB(disp, glCompressedTexSubImage2DARB); - SET_CompressedTexSubImage3DARB(disp, glCompressedTexSubImage3DARB); - SET_ConvolutionFilter1D(disp, glConvolutionFilter1D); - SET_ConvolutionFilter2D(disp, glConvolutionFilter2D); - SET_ConvolutionParameterf(disp, glConvolutionParameterf); - SET_ConvolutionParameterfv(disp, glConvolutionParameterfv); - SET_ConvolutionParameteri(disp, glConvolutionParameteri); - SET_ConvolutionParameteriv(disp, glConvolutionParameteriv); - SET_CopyColorSubTable(disp, glCopyColorSubTable); - SET_CopyColorTable(disp, glCopyColorTable); - SET_CopyConvolutionFilter1D(disp, glCopyConvolutionFilter1D); - SET_CopyConvolutionFilter2D(disp, glCopyConvolutionFilter2D); - SET_CopyPixels(disp, glCopyPixels); - SET_CopyTexImage1D(disp, glCopyTexImage1D); - SET_CopyTexImage2D(disp, glCopyTexImage2D); - SET_CopyTexSubImage1D(disp, glCopyTexSubImage1D); - SET_CopyTexSubImage2D(disp, glCopyTexSubImage2D); - SET_CopyTexSubImage3D(disp, glCopyTexSubImage3D); - SET_CreateProgramObjectARB(disp, glCreateProgramObjectARB); - SET_CreateShaderObjectARB(disp, glCreateShaderObjectARB); - SET_CullFace(disp, glCullFace); -//SET_CullParameterdvEXT(disp, glCullParameterdvEXT); -//SET_CullParameterfvEXT(disp, glCullParameterfvEXT); - SET_DeleteBuffersARB(disp, glDeleteBuffersARB); - SET_DeleteFencesNV(disp, glDeleteFencesAPPLE); -//SET_DeleteFragmentShaderATI(disp, glDeleteFragmentShaderEXT); // <-- EXT -> ATI - SET_DeleteFramebuffersEXT(disp, glDeleteFramebuffersEXT); - SET_DeleteLists(disp, glDeleteLists); - SET_DeleteObjectARB(disp, glDeleteObjectARB); -//SET_DeleteProgramsNV(disp, glDeleteProgramsNV); - SET_DeleteQueriesARB(disp, glDeleteQueriesARB); - SET_DeleteRenderbuffersEXT(disp, glDeleteRenderbuffersEXT); - SET_DeleteTextures(disp, glDeleteTextures); - SET_DepthBoundsEXT(disp, glDepthBoundsEXT); - SET_DepthFunc(disp, glDepthFunc); - SET_DepthMask(disp, glDepthMask); - SET_DepthRange(disp, glDepthRange); - SET_DetachObjectARB(disp, glDetachObjectARB); - SET_Disable(disp, glDisable); - SET_DisableClientState(disp, glDisableClientState); - SET_DisableVertexAttribArrayARB(disp, glDisableVertexAttribArrayARB); - SET_DrawArrays(disp, glDrawArrays); - SET_DrawBuffer(disp, glDrawBuffer); - SET_DrawBuffersARB(disp, glDrawBuffersARB); - SET_DrawElements(disp, glDrawElements); - SET_DrawPixels(disp, glDrawPixels); - SET_DrawRangeElements(disp, glDrawRangeElements); - SET_EdgeFlag(disp, glEdgeFlag); - SET_EdgeFlagPointer(disp, glEdgeFlagPointer); -//SET_EdgeFlagPointerEXT(disp, glEdgeFlagPointerEXT); - SET_EdgeFlagv(disp, glEdgeFlagv); - SET_Enable(disp, glEnable); - SET_EnableClientState(disp, glEnableClientState); - SET_EnableVertexAttribArrayARB(disp, glEnableVertexAttribArrayARB); - SET_End(disp, glEnd); -//SET_EndFragmentShaderATI(disp, glEndFragmentShaderEXT); // <-- EXT -> ATI - SET_EndList(disp, glEndList); - SET_EndQueryARB(disp, glEndQueryARB); - SET_EvalCoord1d(disp, glEvalCoord1d); - SET_EvalCoord1dv(disp, glEvalCoord1dv); - SET_EvalCoord1f(disp, glEvalCoord1f); - SET_EvalCoord1fv(disp, glEvalCoord1fv); - SET_EvalCoord2d(disp, glEvalCoord2d); - SET_EvalCoord2dv(disp, glEvalCoord2dv); - SET_EvalCoord2f(disp, glEvalCoord2f); - SET_EvalCoord2fv(disp, glEvalCoord2fv); - SET_EvalMesh1(disp, glEvalMesh1); - SET_EvalMesh2(disp, glEvalMesh2); - SET_EvalPoint1(disp, glEvalPoint1); - SET_EvalPoint2(disp, glEvalPoint2); -//SET_ExecuteProgramNV(disp, glExecuteProgramNV); - SET_FeedbackBuffer(disp, glFeedbackBuffer); - -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 - SET_FinalCombinerInputNV(disp, glFinalCombinerInputNV); -#endif - SET_Finish(disp, glFinish); - SET_FinishFenceNV(disp, glFinishFenceAPPLE); // <-- APPLE -> NV - SET_Flush(disp, glFlush); -//SET_FlushVertexArrayRangeNV(disp, glFlushVertexArrayRangeNV); - SET_FogCoordPointerEXT(disp, glFogCoordPointerEXT); - SET_FogCoorddEXT(disp, glFogCoorddEXT); - SET_FogCoorddvEXT(disp, glFogCoorddvEXT); - SET_FogCoordfEXT(disp, glFogCoordfEXT); - SET_FogCoordfvEXT(disp, glFogCoordfvEXT); - SET_Fogf(disp, glFogf); - SET_Fogfv(disp, glFogfv); - SET_Fogi(disp, glFogi); - SET_Fogiv(disp, glFogiv); - SET_FramebufferRenderbufferEXT(disp, glFramebufferRenderbufferEXT); - SET_FramebufferTexture1DEXT(disp, glFramebufferTexture1DEXT); - SET_FramebufferTexture2DEXT(disp, glFramebufferTexture2DEXT); - SET_FramebufferTexture3DEXT(disp, glFramebufferTexture3DEXT); - SET_FrontFace(disp, glFrontFace); - SET_Frustum(disp, glFrustum); - SET_GenBuffersARB(disp, glGenBuffersARB); - SET_GenFencesNV(disp, glGenFencesAPPLE); // <-- APPLE -> NV -//SET_GenFragmentShadersATI(disp, glGenFragmentShadersEXT); // <-- EXT -> ATI - SET_GenFramebuffersEXT(disp, glGenFramebuffersEXT); - SET_GenLists(disp, glGenLists); -//SET_GenProgramsNV(disp, glGenProgramsNV); - SET_GenQueriesARB(disp, glGenQueriesARB); - SET_GenRenderbuffersEXT(disp, glGenRenderbuffersEXT); - SET_GenTextures(disp, glGenTextures); - SET_GenerateMipmapEXT(disp, glGenerateMipmapEXT); - SET_GetActiveAttribARB(disp, glGetActiveAttribARB); - SET_GetActiveUniformARB(disp, glGetActiveUniformARB); - SET_GetAttachedObjectsARB(disp, glGetAttachedObjectsARB); - SET_GetAttribLocationARB(disp, glGetAttribLocationARB); - SET_GetBooleanv(disp, glGetBooleanv); - SET_GetBufferParameterivARB(disp, glGetBufferParameterivARB); - SET_GetBufferPointervARB(disp, glGetBufferPointervARB); - SET_GetBufferSubDataARB(disp, glGetBufferSubDataARB); - SET_GetClipPlane(disp, glGetClipPlane); - SET_GetColorTable(disp, glGetColorTable); - SET_GetColorTableParameterfv(disp, glGetColorTableParameterfv); - SET_GetColorTableParameteriv(disp, glGetColorTableParameteriv); -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 - SET_GetCombinerInputParameterfvNV(disp, glGetCombinerInputParameterfvNV); - SET_GetCombinerInputParameterivNV(disp, glGetCombinerInputParameterivNV); - SET_GetCombinerOutputParameterfvNV(disp, glGetCombinerOutputParameterfvNV); - SET_GetCombinerOutputParameterivNV(disp, glGetCombinerOutputParameterivNV); -#endif - SET_GetCompressedTexImageARB(disp, glGetCompressedTexImageARB); - SET_GetConvolutionFilter(disp, glGetConvolutionFilter); - SET_GetConvolutionParameterfv(disp, glGetConvolutionParameterfv); - SET_GetConvolutionParameteriv(disp, glGetConvolutionParameteriv); - SET_GetDoublev(disp, glGetDoublev); - SET_GetError(disp, glGetError); -//SET_GetFenceivNV(disp, glGetFenceivNV); -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 - SET_GetFinalCombinerInputParameterfvNV(disp, glGetFinalCombinerInputParameterfvNV); - SET_GetFinalCombinerInputParameterivNV(disp, glGetFinalCombinerInputParameterivNV); -#endif - SET_GetFloatv(disp, glGetFloatv); - SET_GetFramebufferAttachmentParameterivEXT(disp, glGetFramebufferAttachmentParameterivEXT); - SET_GetHandleARB(disp, glGetHandleARB); - SET_GetHistogram(disp, glGetHistogram); - SET_GetHistogramParameterfv(disp, glGetHistogramParameterfv); - SET_GetHistogramParameteriv(disp, glGetHistogramParameteriv); - SET_GetInfoLogARB(disp, glGetInfoLogARB); - SET_GetIntegerv(disp, glGetIntegerv); - SET_GetLightfv(disp, glGetLightfv); - SET_GetLightiv(disp, glGetLightiv); - SET_GetMapdv(disp, glGetMapdv); - SET_GetMapfv(disp, glGetMapfv); - SET_GetMapiv(disp, glGetMapiv); - SET_GetMaterialfv(disp, glGetMaterialfv); - SET_GetMaterialiv(disp, glGetMaterialiv); - SET_GetMinmax(disp, glGetMinmax); - SET_GetMinmaxParameterfv(disp, glGetMinmaxParameterfv); - SET_GetMinmaxParameteriv(disp, glGetMinmaxParameteriv); - SET_GetObjectParameterfvARB(disp, glGetObjectParameterfvARB); - SET_GetObjectParameterivARB(disp, glGetObjectParameterivARB); - SET_GetPixelMapfv(disp, glGetPixelMapfv); - SET_GetPixelMapuiv(disp, glGetPixelMapuiv); - SET_GetPixelMapusv(disp, glGetPixelMapusv); -//SET_GetPixelTexGenParameterfvSGIS(disp, glGetPixelTexGenParameterfvSGIS); -//SET_GetPixelTexGenParameterivSGIS(disp, glGetPixelTexGenParameterivSGIS); - SET_GetPointerv(disp, glGetPointerv); - SET_GetPolygonStipple(disp, glGetPolygonStipple); - SET_GetProgramEnvParameterdvARB(disp, glGetProgramEnvParameterdvARB); - SET_GetProgramEnvParameterfvARB(disp, glGetProgramEnvParameterfvARB); - SET_GetProgramLocalParameterdvARB(disp, glGetProgramLocalParameterdvARB); - SET_GetProgramLocalParameterfvARB(disp, glGetProgramLocalParameterfvARB); -//SET_GetProgramNamedParameterdvNV(disp, glGetProgramNamedParameterdvNV); -//SET_GetProgramNamedParameterfvNV(disp, glGetProgramNamedParameterfvNV); -//SET_GetProgramParameterdvNV(disp, glGetProgramParameterdvNV); -//SET_GetProgramParameterfvNV(disp, glGetProgramParameterfvNV); - SET_GetProgramStringARB(disp, glGetProgramStringARB); -//SET_GetProgramStringNV(disp, glGetProgramStringNV); - SET_GetProgramivARB(disp, glGetProgramivARB); -//SET_GetProgramivNV(disp, glGetProgramivNV); -//SET_GetQueryObjecti64vEXT(disp, glGetQueryObjecti64vEXT); - SET_GetQueryObjectivARB(disp, glGetQueryObjectivARB); -//SET_GetQueryObjectui64vEXT(disp, glGetQueryObjectui64vEXT); - SET_GetQueryObjectuivARB(disp, glGetQueryObjectuivARB); - SET_GetQueryivARB(disp, glGetQueryivARB); - SET_GetRenderbufferParameterivEXT(disp, glGetRenderbufferParameterivEXT); - SET_GetSeparableFilter(disp, glGetSeparableFilter); - SET_GetShaderSourceARB(disp, glGetShaderSourceARB); - SET_GetString(disp, glGetString); - SET_GetTexEnvfv(disp, glGetTexEnvfv); - SET_GetTexEnviv(disp, glGetTexEnviv); - SET_GetTexGendv(disp, glGetTexGendv); - SET_GetTexGenfv(disp, glGetTexGenfv); - SET_GetTexGeniv(disp, glGetTexGeniv); - SET_GetTexImage(disp, glGetTexImage); - SET_GetTexLevelParameterfv(disp, glGetTexLevelParameterfv); - SET_GetTexLevelParameteriv(disp, glGetTexLevelParameteriv); - SET_GetTexParameterfv(disp, glGetTexParameterfv); - SET_GetTexParameteriv(disp, glGetTexParameteriv); -//SET_GetTrackMatrixivNV(disp, glGetTrackMatrixivNV); - SET_GetUniformLocationARB(disp, glGetUniformLocationARB); - SET_GetUniformfvARB(disp, glGetUniformfvARB); - SET_GetUniformivARB(disp, glGetUniformivARB); -//SET_GetVertexAttribPointervNV(disp, glGetVertexAttribPointervNV); - SET_GetVertexAttribdvARB(disp, glGetVertexAttribdvARB); -//SET_GetVertexAttribdvNV(disp, glGetVertexAttribdvNV); - SET_GetVertexAttribfvARB(disp, glGetVertexAttribfvARB); -//SET_GetVertexAttribfvNV(disp, glGetVertexAttribfvNV); - SET_GetVertexAttribivARB(disp, glGetVertexAttribivARB); -//SET_GetVertexAttribivNV(disp, glGetVertexAttribivNV); - SET_Hint(disp, glHint); - SET_Histogram(disp, glHistogram); - SET_IndexMask(disp, glIndexMask); - SET_IndexPointer(disp, glIndexPointer); -//SET_IndexPointerEXT(disp, glIndexPointerEXT); - SET_Indexd(disp, glIndexd); - SET_Indexdv(disp, glIndexdv); - SET_Indexf(disp, glIndexf); - SET_Indexfv(disp, glIndexfv); - SET_Indexi(disp, glIndexi); - SET_Indexiv(disp, glIndexiv); - SET_Indexs(disp, glIndexs); - SET_Indexsv(disp, glIndexsv); - SET_Indexub(disp, glIndexub); - SET_Indexubv(disp, glIndexubv); - SET_InitNames(disp, glInitNames); - SET_InterleavedArrays(disp, glInterleavedArrays); - SET_IsBufferARB(disp, glIsBufferARB); - SET_IsEnabled(disp, glIsEnabled); - SET_IsFenceNV(disp, glIsFenceAPPLE); // <-- APPLE -> NV - SET_IsFramebufferEXT(disp, glIsFramebufferEXT); - SET_IsList(disp, glIsList); -//SET_IsProgramNV(disp, glIsProgramNV); - SET_IsQueryARB(disp, glIsQueryARB); - SET_IsRenderbufferEXT(disp, glIsRenderbufferEXT); - SET_IsTexture(disp, glIsTexture); - SET_LightModelf(disp, glLightModelf); - SET_LightModelfv(disp, glLightModelfv); - SET_LightModeli(disp, glLightModeli); - SET_LightModeliv(disp, glLightModeliv); - SET_Lightf(disp, glLightf); - SET_Lightfv(disp, glLightfv); - SET_Lighti(disp, glLighti); - SET_Lightiv(disp, glLightiv); - SET_LineStipple(disp, glLineStipple); - SET_LineWidth(disp, glLineWidth); - SET_LinkProgramARB(disp, glLinkProgramARB); - SET_ListBase(disp, glListBase); - SET_LoadIdentity(disp, glLoadIdentity); - SET_LoadMatrixd(disp, glLoadMatrixd); - SET_LoadMatrixf(disp, glLoadMatrixf); - SET_LoadName(disp, glLoadName); -//SET_LoadProgramNV(disp, glLoadProgramNV); - SET_LoadTransposeMatrixdARB(disp, glLoadTransposeMatrixdARB); - SET_LoadTransposeMatrixfARB(disp, glLoadTransposeMatrixfARB); - SET_LockArraysEXT(disp, glLockArraysEXT); - SET_LogicOp(disp, glLogicOp); - SET_Map1d(disp, glMap1d); - SET_Map1f(disp, glMap1f); - SET_Map2d(disp, glMap2d); - SET_Map2f(disp, glMap2f); - SET_MapBufferARB(disp, glMapBufferARB); - SET_MapGrid1d(disp, glMapGrid1d); - SET_MapGrid1f(disp, glMapGrid1f); - SET_MapGrid2d(disp, glMapGrid2d); - SET_MapGrid2f(disp, glMapGrid2f); - SET_Materialf(disp, glMaterialf); - SET_Materialfv(disp, glMaterialfv); - SET_Materiali(disp, glMateriali); - SET_Materialiv(disp, glMaterialiv); - SET_MatrixMode(disp, glMatrixMode); - SET_Minmax(disp, glMinmax); - SET_MultMatrixd(disp, glMultMatrixd); - SET_MultMatrixf(disp, glMultMatrixf); - SET_MultTransposeMatrixdARB(disp, glMultTransposeMatrixdARB); - SET_MultTransposeMatrixfARB(disp, glMultTransposeMatrixfARB); - SET_MultiDrawArraysEXT(disp, glMultiDrawArraysEXT); - SET_MultiDrawElementsEXT(disp, glMultiDrawElementsEXT); -//SET_MultiModeDrawArraysIBM(disp, glMultiModeDrawArraysIBM); -//SET_MultiModeDrawElementsIBM(disp, glMultiModeDrawElementsIBM); - SET_MultiTexCoord1dARB(disp, glMultiTexCoord1dARB); - SET_MultiTexCoord1dvARB(disp, glMultiTexCoord1dvARB); - SET_MultiTexCoord1fARB(disp, glMultiTexCoord1fARB); - SET_MultiTexCoord1fvARB(disp, glMultiTexCoord1fvARB); - SET_MultiTexCoord1iARB(disp, glMultiTexCoord1iARB); - SET_MultiTexCoord1ivARB(disp, glMultiTexCoord1ivARB); - SET_MultiTexCoord1sARB(disp, glMultiTexCoord1sARB); - SET_MultiTexCoord1svARB(disp, glMultiTexCoord1svARB); - SET_MultiTexCoord2dARB(disp, glMultiTexCoord2dARB); - SET_MultiTexCoord2dvARB(disp, glMultiTexCoord2dvARB); - SET_MultiTexCoord2fARB(disp, glMultiTexCoord2fARB); - SET_MultiTexCoord2fvARB(disp, glMultiTexCoord2fvARB); - SET_MultiTexCoord2iARB(disp, glMultiTexCoord2iARB); - SET_MultiTexCoord2ivARB(disp, glMultiTexCoord2ivARB); - SET_MultiTexCoord2sARB(disp, glMultiTexCoord2sARB); - SET_MultiTexCoord2svARB(disp, glMultiTexCoord2svARB); - SET_MultiTexCoord3dARB(disp, glMultiTexCoord3dARB); - SET_MultiTexCoord3dvARB(disp, glMultiTexCoord3dvARB); - SET_MultiTexCoord3fARB(disp, glMultiTexCoord3fARB); - SET_MultiTexCoord3fvARB(disp, glMultiTexCoord3fvARB); - SET_MultiTexCoord3iARB(disp, glMultiTexCoord3iARB); - SET_MultiTexCoord3ivARB(disp, glMultiTexCoord3ivARB); - SET_MultiTexCoord3sARB(disp, glMultiTexCoord3sARB); - SET_MultiTexCoord3svARB(disp, glMultiTexCoord3svARB); - SET_MultiTexCoord4dARB(disp, glMultiTexCoord4dARB); - SET_MultiTexCoord4dvARB(disp, glMultiTexCoord4dvARB); - SET_MultiTexCoord4fARB(disp, glMultiTexCoord4fARB); - SET_MultiTexCoord4fvARB(disp, glMultiTexCoord4fvARB); - SET_MultiTexCoord4iARB(disp, glMultiTexCoord4iARB); - SET_MultiTexCoord4ivARB(disp, glMultiTexCoord4ivARB); - SET_MultiTexCoord4sARB(disp, glMultiTexCoord4sARB); - SET_MultiTexCoord4svARB(disp, glMultiTexCoord4svARB); - SET_NewList(disp, glNewList); - SET_Normal3b(disp, glNormal3b); - SET_Normal3bv(disp, glNormal3bv); - SET_Normal3d(disp, glNormal3d); - SET_Normal3dv(disp, glNormal3dv); - SET_Normal3f(disp, glNormal3f); - SET_Normal3fv(disp, glNormal3fv); - SET_Normal3i(disp, glNormal3i); - SET_Normal3iv(disp, glNormal3iv); - SET_Normal3s(disp, glNormal3s); - SET_Normal3sv(disp, glNormal3sv); - SET_NormalPointer(disp, glNormalPointer); -//SET_NormalPointerEXT(disp, glNormalPointerEXT); - SET_Ortho(disp, glOrtho); -//SET_PassTexCoordATI(disp, glPassTexCoordEXT); // <-- EXT -> ATI - SET_PassThrough(disp, glPassThrough); - SET_PixelMapfv(disp, glPixelMapfv); - SET_PixelMapuiv(disp, glPixelMapuiv); - SET_PixelMapusv(disp, glPixelMapusv); - SET_PixelStoref(disp, glPixelStoref); - SET_PixelStorei(disp, glPixelStorei); -//SET_PixelTexGenParameterfSGIS(disp, glPixelTexGenParameterfSGIS); -//SET_PixelTexGenParameterfvSGIS(disp, glPixelTexGenParameterfvSGIS); -//SET_PixelTexGenParameteriSGIS(disp, glPixelTexGenParameteriSGIS); -//SET_PixelTexGenParameterivSGIS(disp, glPixelTexGenParameterivSGIS); -// SET_PixelTexGenSGIX(disp, glPixelTexGenSGIX); - SET_PixelTransferf(disp, glPixelTransferf); - SET_PixelTransferi(disp, glPixelTransferi); - SET_PixelZoom(disp, glPixelZoom); - SET_PointParameterfEXT(disp, glPointParameterfARB); // <-- ARB -> EXT - SET_PointParameterfvEXT(disp, glPointParameterfvARB); // <-- ARB -> EXT - SET_PointParameteriNV(disp, glPointParameteriNV); - SET_PointParameterivNV(disp, glPointParameterivNV); - SET_PointSize(disp, glPointSize); - SET_PolygonMode(disp, glPolygonMode); - SET_PolygonOffset(disp, glPolygonOffset); -//SET_PolygonOffsetEXT(disp, glPolygonOffsetEXT); - SET_PolygonStipple(disp, glPolygonStipple); - SET_PopAttrib(disp, glPopAttrib); - SET_PopClientAttrib(disp, glPopClientAttrib); - SET_PopMatrix(disp, glPopMatrix); - SET_PopName(disp, glPopName); - SET_PrioritizeTextures(disp, glPrioritizeTextures); - SET_ProgramEnvParameter4dARB(disp, glProgramEnvParameter4dARB); - SET_ProgramEnvParameter4dvARB(disp, glProgramEnvParameter4dvARB); - SET_ProgramEnvParameter4fARB(disp, glProgramEnvParameter4fARB); - SET_ProgramEnvParameter4fvARB(disp, glProgramEnvParameter4fvARB); - SET_ProgramLocalParameter4dARB(disp, glProgramLocalParameter4dARB); - SET_ProgramLocalParameter4dvARB(disp, glProgramLocalParameter4dvARB); - SET_ProgramLocalParameter4fARB(disp, glProgramLocalParameter4fARB); - SET_ProgramLocalParameter4fvARB(disp, glProgramLocalParameter4fvARB); -//SET_ProgramNamedParameter4dNV(disp, glProgramNamedParameter4dNV); -//SET_ProgramNamedParameter4dvNV(disp, glProgramNamedParameter4dvNV); -//SET_ProgramNamedParameter4fNV(disp, glProgramNamedParameter4fNV); -//SET_ProgramNamedParameter4fvNV(disp, glProgramNamedParameter4fvNV); -//SET_ProgramParameter4dNV(disp, glProgramParameter4dNV); -//SET_ProgramParameter4dvNV(disp, glProgramParameter4dvNV); -//SET_ProgramParameter4fNV(disp, glProgramParameter4fNV); -//SET_ProgramParameter4fvNV(disp, glProgramParameter4fvNV); -//SET_ProgramParameters4dvNV(disp, glProgramParameters4dvNV); -//SET_ProgramParameters4fvNV(disp, glProgramParameters4fvNV); - SET_ProgramStringARB(disp, glProgramStringARB); - SET_PushAttrib(disp, glPushAttrib); - SET_PushClientAttrib(disp, glPushClientAttrib); - SET_PushMatrix(disp, glPushMatrix); - SET_PushName(disp, glPushName); - SET_RasterPos2d(disp, glRasterPos2d); - SET_RasterPos2dv(disp, glRasterPos2dv); - SET_RasterPos2f(disp, glRasterPos2f); - SET_RasterPos2fv(disp, glRasterPos2fv); - SET_RasterPos2i(disp, glRasterPos2i); - SET_RasterPos2iv(disp, glRasterPos2iv); - SET_RasterPos2s(disp, glRasterPos2s); - SET_RasterPos2sv(disp, glRasterPos2sv); - SET_RasterPos3d(disp, glRasterPos3d); - SET_RasterPos3dv(disp, glRasterPos3dv); - SET_RasterPos3f(disp, glRasterPos3f); - SET_RasterPos3fv(disp, glRasterPos3fv); - SET_RasterPos3i(disp, glRasterPos3i); - SET_RasterPos3iv(disp, glRasterPos3iv); - SET_RasterPos3s(disp, glRasterPos3s); - SET_RasterPos3sv(disp, glRasterPos3sv); - SET_RasterPos4d(disp, glRasterPos4d); - SET_RasterPos4dv(disp, glRasterPos4dv); - SET_RasterPos4f(disp, glRasterPos4f); - SET_RasterPos4fv(disp, glRasterPos4fv); - SET_RasterPos4i(disp, glRasterPos4i); - SET_RasterPos4iv(disp, glRasterPos4iv); - SET_RasterPos4s(disp, glRasterPos4s); - SET_RasterPos4sv(disp, glRasterPos4sv); - SET_ReadBuffer(disp, glReadBuffer); - SET_ReadPixels(disp, glReadPixels); - SET_Rectd(disp, glRectd); - SET_Rectdv(disp, glRectdv); - SET_Rectf(disp, glRectf); - SET_Rectfv(disp, glRectfv); - SET_Recti(disp, glRecti); - SET_Rectiv(disp, glRectiv); - SET_Rects(disp, glRects); - SET_Rectsv(disp, glRectsv); - SET_RenderMode(disp, glRenderMode); - SET_RenderbufferStorageEXT(disp, glRenderbufferStorageEXT); -//SET_RequestResidentProgramsNV(disp, glRequestResidentProgramsNV); - SET_ResetHistogram(disp, glResetHistogram); - SET_ResetMinmax(disp, glResetMinmax); -//SET_ResizeBuffersMESA(disp, glResizeBuffersMESA); - SET_Rotated(disp, glRotated); - SET_Rotatef(disp, glRotatef); - SET_SampleCoverageARB(disp, glSampleCoverageARB); -//SET_SampleMapATI(disp, glSampleMapEXT); // <-- EXT -> ATI -//SET_SampleMaskSGIS(disp, glSampleMaskSGIS); -//SET_SamplePatternSGIS(disp, glSamplePatternSGIS); - SET_Scaled(disp, glScaled); - SET_Scalef(disp, glScalef); - SET_Scissor(disp, glScissor); - SET_SecondaryColor3bEXT(disp, glSecondaryColor3bEXT); - SET_SecondaryColor3bvEXT(disp, glSecondaryColor3bvEXT); - SET_SecondaryColor3dEXT(disp, glSecondaryColor3dEXT); - SET_SecondaryColor3dvEXT(disp, glSecondaryColor3dvEXT); - SET_SecondaryColor3fEXT(disp, glSecondaryColor3fEXT); - SET_SecondaryColor3fvEXT(disp, glSecondaryColor3fvEXT); - SET_SecondaryColor3iEXT(disp, glSecondaryColor3iEXT); - SET_SecondaryColor3ivEXT(disp, glSecondaryColor3ivEXT); - SET_SecondaryColor3sEXT(disp, glSecondaryColor3sEXT); - SET_SecondaryColor3svEXT(disp, glSecondaryColor3svEXT); - SET_SecondaryColor3ubEXT(disp, glSecondaryColor3ubEXT); - SET_SecondaryColor3ubvEXT(disp, glSecondaryColor3ubvEXT); - SET_SecondaryColor3uiEXT(disp, glSecondaryColor3uiEXT); - SET_SecondaryColor3uivEXT(disp, glSecondaryColor3uivEXT); - SET_SecondaryColor3usEXT(disp, glSecondaryColor3usEXT); - SET_SecondaryColor3usvEXT(disp, glSecondaryColor3usvEXT); - SET_SecondaryColorPointerEXT(disp, glSecondaryColorPointerEXT); - SET_SelectBuffer(disp, glSelectBuffer); - SET_SeparableFilter2D(disp, glSeparableFilter2D); - SET_SetFenceNV(disp, glSetFenceAPPLE); // <-- APPLE -> NV -//SET_SetFragmentShaderConstantATI(disp, glSetFragmentShaderConstantEXT); // <-- EXT -> ATI - SET_ShadeModel(disp, glShadeModel); - SET_ShaderSourceARB(disp, glShaderSourceARB); - SET_StencilFunc(disp, glStencilFunc); - SET_StencilFuncSeparate(disp, glStencilFuncSeparate); - SET_StencilMask(disp, glStencilMask); - SET_StencilMaskSeparate(disp, glStencilMaskSeparate); - SET_StencilOp(disp, glStencilOp); - SET_StencilOpSeparate(disp, glStencilOpSeparate); - SET_TestFenceNV(disp, glTestFenceAPPLE); // <-- APPLE -> NV - SET_TexCoord1d(disp, glTexCoord1d); - SET_TexCoord1dv(disp, glTexCoord1dv); - SET_TexCoord1f(disp, glTexCoord1f); - SET_TexCoord1fv(disp, glTexCoord1fv); - SET_TexCoord1i(disp, glTexCoord1i); - SET_TexCoord1iv(disp, glTexCoord1iv); - SET_TexCoord1s(disp, glTexCoord1s); - SET_TexCoord1sv(disp, glTexCoord1sv); - SET_TexCoord2d(disp, glTexCoord2d); - SET_TexCoord2dv(disp, glTexCoord2dv); - SET_TexCoord2f(disp, glTexCoord2f); - SET_TexCoord2fv(disp, glTexCoord2fv); - SET_TexCoord2i(disp, glTexCoord2i); - SET_TexCoord2iv(disp, glTexCoord2iv); - SET_TexCoord2s(disp, glTexCoord2s); - SET_TexCoord2sv(disp, glTexCoord2sv); - SET_TexCoord3d(disp, glTexCoord3d); - SET_TexCoord3dv(disp, glTexCoord3dv); - SET_TexCoord3f(disp, glTexCoord3f); - SET_TexCoord3fv(disp, glTexCoord3fv); - SET_TexCoord3i(disp, glTexCoord3i); - SET_TexCoord3iv(disp, glTexCoord3iv); - SET_TexCoord3s(disp, glTexCoord3s); - SET_TexCoord3sv(disp, glTexCoord3sv); - SET_TexCoord4d(disp, glTexCoord4d); - SET_TexCoord4dv(disp, glTexCoord4dv); - SET_TexCoord4f(disp, glTexCoord4f); - SET_TexCoord4fv(disp, glTexCoord4fv); - SET_TexCoord4i(disp, glTexCoord4i); - SET_TexCoord4iv(disp, glTexCoord4iv); - SET_TexCoord4s(disp, glTexCoord4s); - SET_TexCoord4sv(disp, glTexCoord4sv); - SET_TexCoordPointer(disp, glTexCoordPointer); -//SET_TexCoordPointerEXT(disp, glTexCoordPointerEXT); - SET_TexEnvf(disp, glTexEnvf); - SET_TexEnvfv(disp, glTexEnvfv); - SET_TexEnvi(disp, glTexEnvi); - SET_TexEnviv(disp, glTexEnviv); - SET_TexGend(disp, glTexGend); - SET_TexGendv(disp, glTexGendv); - SET_TexGenf(disp, glTexGenf); - SET_TexGenfv(disp, glTexGenfv); - SET_TexGeni(disp, glTexGeni); - SET_TexGeniv(disp, glTexGeniv); - SET_TexImage1D(disp, glTexImage1D); - SET_TexImage2D(disp, glTexImage2D); - SET_TexImage3D(disp, glTexImage3D); - SET_TexParameterf(disp, glTexParameterf); - SET_TexParameterfv(disp, glTexParameterfv); - SET_TexParameteri(disp, glTexParameteri); - SET_TexParameteriv(disp, glTexParameteriv); - SET_TexSubImage1D(disp, glTexSubImage1D); - SET_TexSubImage2D(disp, glTexSubImage2D); - SET_TexSubImage3D(disp, glTexSubImage3D); -//SET_TrackMatrixNV(disp, glTrackMatrixNV); - SET_Translated(disp, glTranslated); - SET_Translatef(disp, glTranslatef); - SET_Uniform1fARB(disp, glUniform1fARB); - SET_Uniform1fvARB(disp, glUniform1fvARB); - SET_Uniform1iARB(disp, glUniform1iARB); - SET_Uniform1ivARB(disp, glUniform1ivARB); - SET_Uniform2fARB(disp, glUniform2fARB); - SET_Uniform2fvARB(disp, glUniform2fvARB); - SET_Uniform2iARB(disp, glUniform2iARB); - SET_Uniform2ivARB(disp, glUniform2ivARB); - SET_Uniform3fARB(disp, glUniform3fARB); - SET_Uniform3fvARB(disp, glUniform3fvARB); - SET_Uniform3iARB(disp, glUniform3iARB); - SET_Uniform3ivARB(disp, glUniform3ivARB); - SET_Uniform4fARB(disp, glUniform4fARB); - SET_Uniform4fvARB(disp, glUniform4fvARB); - SET_Uniform4iARB(disp, glUniform4iARB); - SET_Uniform4ivARB(disp, glUniform4ivARB); - SET_UniformMatrix2fvARB(disp, glUniformMatrix2fvARB); - SET_UniformMatrix3fvARB(disp, glUniformMatrix3fvARB); - SET_UniformMatrix4fvARB(disp, glUniformMatrix4fvARB); - SET_UnlockArraysEXT(disp, glUnlockArraysEXT); - SET_UnmapBufferARB(disp, glUnmapBufferARB); - SET_UseProgramObjectARB(disp, glUseProgramObjectARB); - SET_ValidateProgramARB(disp, glValidateProgramARB); - SET_Vertex2d(disp, glVertex2d); - SET_Vertex2dv(disp, glVertex2dv); - SET_Vertex2f(disp, glVertex2f); - SET_Vertex2fv(disp, glVertex2fv); - SET_Vertex2i(disp, glVertex2i); - SET_Vertex2iv(disp, glVertex2iv); - SET_Vertex2s(disp, glVertex2s); - SET_Vertex2sv(disp, glVertex2sv); - SET_Vertex3d(disp, glVertex3d); - SET_Vertex3dv(disp, glVertex3dv); - SET_Vertex3f(disp, glVertex3f); - SET_Vertex3fv(disp, glVertex3fv); - SET_Vertex3i(disp, glVertex3i); - SET_Vertex3iv(disp, glVertex3iv); - SET_Vertex3s(disp, glVertex3s); - SET_Vertex3sv(disp, glVertex3sv); - SET_Vertex4d(disp, glVertex4d); - SET_Vertex4dv(disp, glVertex4dv); - SET_Vertex4f(disp, glVertex4f); - SET_Vertex4fv(disp, glVertex4fv); - SET_Vertex4i(disp, glVertex4i); - SET_Vertex4iv(disp, glVertex4iv); - SET_Vertex4s(disp, glVertex4s); - SET_Vertex4sv(disp, glVertex4sv); -//SET_VertexArrayRangeNV(disp, glVertexArrayRangeNV); - SET_VertexAttrib1dARB(disp, glVertexAttrib1dARB); - SET_VertexAttrib1dvARB(disp, glVertexAttrib1dvARB); - SET_VertexAttrib1fARB(disp, glVertexAttrib1fARB); - SET_VertexAttrib1fvARB(disp, glVertexAttrib1fvARB); - SET_VertexAttrib1sARB(disp, glVertexAttrib1sARB); - SET_VertexAttrib1svARB(disp, glVertexAttrib1svARB); - SET_VertexAttrib2dARB(disp, glVertexAttrib2dARB); - SET_VertexAttrib2dvARB(disp, glVertexAttrib2dvARB); - SET_VertexAttrib2fARB(disp, glVertexAttrib2fARB); - SET_VertexAttrib2fvARB(disp, glVertexAttrib2fvARB); - SET_VertexAttrib2sARB(disp, glVertexAttrib2sARB); - SET_VertexAttrib2svARB(disp, glVertexAttrib2svARB); - SET_VertexAttrib3dARB(disp, glVertexAttrib3dARB); - SET_VertexAttrib3dvARB(disp, glVertexAttrib3dvARB); - SET_VertexAttrib3fARB(disp, glVertexAttrib3fARB); - SET_VertexAttrib3fvARB(disp, glVertexAttrib3fvARB); - SET_VertexAttrib3sARB(disp, glVertexAttrib3sARB); - SET_VertexAttrib3svARB(disp, glVertexAttrib3svARB); - SET_VertexAttrib4NbvARB(disp, glVertexAttrib4NbvARB); - SET_VertexAttrib4NivARB(disp, glVertexAttrib4NivARB); - SET_VertexAttrib4NsvARB(disp, glVertexAttrib4NsvARB); - SET_VertexAttrib4NubARB(disp, glVertexAttrib4NubARB); - SET_VertexAttrib4NubvARB(disp, glVertexAttrib4NubvARB); - SET_VertexAttrib4NuivARB(disp, glVertexAttrib4NuivARB); - SET_VertexAttrib4NusvARB(disp, glVertexAttrib4NusvARB); - SET_VertexAttrib4bvARB(disp, glVertexAttrib4bvARB); - SET_VertexAttrib4dARB(disp, glVertexAttrib4dARB); - SET_VertexAttrib4dvARB(disp, glVertexAttrib4dvARB); - SET_VertexAttrib4fARB(disp, glVertexAttrib4fARB); - SET_VertexAttrib4fvARB(disp, glVertexAttrib4fvARB); - SET_VertexAttrib4ivARB(disp, glVertexAttrib4ivARB); - SET_VertexAttrib4sARB(disp, glVertexAttrib4sARB); - SET_VertexAttrib4svARB(disp, glVertexAttrib4svARB); - SET_VertexAttrib4ubvARB(disp, glVertexAttrib4ubvARB); - SET_VertexAttrib4uivARB(disp, glVertexAttrib4uivARB); - SET_VertexAttrib4usvARB(disp, glVertexAttrib4usvARB); - SET_VertexAttribPointerARB(disp, glVertexAttribPointerARB); - SET_VertexPointer(disp, glVertexPointer); -// SET_VertexPointerEXT(disp, glVertexPointerEXT); - SET_Viewport(disp, glViewport); - SET_WindowPos2dMESA(disp, glWindowPos2dARB); - SET_WindowPos2dvMESA(disp, glWindowPos2dvARB); - SET_WindowPos2fMESA(disp, glWindowPos2fARB); - SET_WindowPos2fvMESA(disp, glWindowPos2fvARB); - SET_WindowPos2iMESA(disp, glWindowPos2iARB); - SET_WindowPos2ivMESA(disp, glWindowPos2ivARB); - SET_WindowPos2sMESA(disp, glWindowPos2sARB); - SET_WindowPos2svMESA(disp, glWindowPos2svARB); - SET_WindowPos3dMESA(disp, glWindowPos3dARB); - SET_WindowPos3dvMESA(disp, glWindowPos3dvARB); - SET_WindowPos3fMESA(disp, glWindowPos3fARB); - SET_WindowPos3fvMESA(disp, glWindowPos3fvARB); - SET_WindowPos3iMESA(disp, glWindowPos3iARB); - SET_WindowPos3ivMESA(disp, glWindowPos3ivARB); - SET_WindowPos3sMESA(disp, glWindowPos3sARB); - SET_WindowPos3svMESA(disp, glWindowPos3svARB); -//SET_WindowPos4dMESA(disp, glWindowPos4dMESA); -//SET_WindowPos4dvMESA(disp, glWindowPos4dvMESA); -//SET_WindowPos4fMESA(disp, glWindowPos4fMESA); -//SET_WindowPos4fvMESA(disp, glWindowPos4fvMESA); -//SET_WindowPos4iMESA(disp, glWindowPos4iMESA); -//SET_WindowPos4ivMESA(disp, glWindowPos4ivMESA); -//SET_WindowPos4sMESA(disp, glWindowPos4sMESA); -//SET_WindowPos4svMESA(disp, glWindowPos4svMESA); + struct _glapi_table *disp=_glapi_get_dispatch(); + _glapi_set_warning_func((_glapi_warning_func)warn_func); + _glapi_noop_enable_warnings(TRUE); + + /* to update: + * for f in $(grep 'define SET_' ../../../glx/dispatch.h | cut -f2 -d' ' | cut -f1 -d\( | sort -u); do grep -q $f indirect.c || echo $f ; done | grep -v by_offset | sed 's:SET_\(.*\)$:SET_\1(disp, gl\1)\;:' | pbcopy + */ + + SET_Accum(disp, glAccum); + SET_AlphaFunc(disp, glAlphaFunc); + SET_AreTexturesResident(disp, glAreTexturesResident); + SET_ArrayElement(disp, glArrayElement); + SET_Begin(disp, glBegin); + SET_BindTexture(disp, glBindTexture); + SET_Bitmap(disp, glBitmap); + SET_BlendColor(disp, glBlendColor); + SET_BlendEquation(disp, glBlendEquation); + SET_BlendFunc(disp, glBlendFunc); + SET_CallList(disp, glCallList); + SET_CallLists(disp, glCallLists); + SET_Clear(disp, glClear); + SET_ClearAccum(disp, glClearAccum); + SET_ClearColor(disp, glClearColor); + SET_ClearDepth(disp, glClearDepth); + SET_ClearIndex(disp, glClearIndex); + SET_ClearStencil(disp, glClearStencil); + SET_ClipPlane(disp, glClipPlane); + SET_Color3b(disp, glColor3b); + SET_Color3bv(disp, glColor3bv); + SET_Color3d(disp, glColor3d); + SET_Color3dv(disp, glColor3dv); + SET_Color3f(disp, glColor3f); + SET_Color3fv(disp, glColor3fv); + SET_Color3i(disp, glColor3i); + SET_Color3iv(disp, glColor3iv); + SET_Color3s(disp, glColor3s); + SET_Color3sv(disp, glColor3sv); + SET_Color3ub(disp, glColor3ub); + SET_Color3ubv(disp, glColor3ubv); + SET_Color3ui(disp, glColor3ui); + SET_Color3uiv(disp, glColor3uiv); + SET_Color3us(disp, glColor3us); + SET_Color3usv(disp, glColor3usv); + SET_Color4b(disp, glColor4b); + SET_Color4bv(disp, glColor4bv); + SET_Color4d(disp, glColor4d); + SET_Color4dv(disp, glColor4dv); + SET_Color4f(disp, glColor4f); + SET_Color4fv(disp, glColor4fv); + SET_Color4i(disp, glColor4i); + SET_Color4iv(disp, glColor4iv); + SET_Color4s(disp, glColor4s); + SET_Color4sv(disp, glColor4sv); + SET_Color4ub(disp, glColor4ub); + SET_Color4ubv(disp, glColor4ubv); + SET_Color4ui(disp, glColor4ui); + SET_Color4uiv(disp, glColor4uiv); + SET_Color4us(disp, glColor4us); + SET_Color4usv(disp, glColor4usv); + SET_ColorMask(disp, glColorMask); + SET_ColorMaterial(disp, glColorMaterial); + SET_ColorPointer(disp, glColorPointer); + SET_ColorSubTable(disp, glColorSubTable); + SET_ColorTable(disp, glColorTable); + SET_ColorTableParameterfv(disp, glColorTableParameterfv); + SET_ColorTableParameteriv(disp, glColorTableParameteriv); + SET_ConvolutionFilter1D(disp, glConvolutionFilter1D); + SET_ConvolutionFilter2D(disp, glConvolutionFilter2D); + SET_ConvolutionParameterf(disp, glConvolutionParameterf); + SET_ConvolutionParameterfv(disp, glConvolutionParameterfv); + SET_ConvolutionParameteri(disp, glConvolutionParameteri); + SET_ConvolutionParameteriv(disp, glConvolutionParameteriv); + SET_CopyColorSubTable(disp, glCopyColorSubTable); + SET_CopyColorTable(disp, glCopyColorTable); + SET_CopyConvolutionFilter1D(disp, glCopyConvolutionFilter1D); + SET_CopyConvolutionFilter2D(disp, glCopyConvolutionFilter2D); + SET_CopyPixels(disp, glCopyPixels); + SET_CopyTexImage1D(disp, glCopyTexImage1D); + SET_CopyTexImage2D(disp, glCopyTexImage2D); + SET_CopyTexSubImage1D(disp, glCopyTexSubImage1D); + SET_CopyTexSubImage2D(disp, glCopyTexSubImage2D); + SET_CopyTexSubImage3D(disp, glCopyTexSubImage3D); + SET_CullFace(disp, glCullFace); + SET_DeleteLists(disp, glDeleteLists); + SET_DeleteTextures(disp, glDeleteTextures); + SET_DepthFunc(disp, glDepthFunc); + SET_DepthMask(disp, glDepthMask); + SET_DepthRange(disp, glDepthRange); + SET_Disable(disp, glDisable); + SET_DisableClientState(disp, glDisableClientState); + SET_DrawArrays(disp, glDrawArrays); + SET_DrawBuffer(disp, glDrawBuffer); + SET_DrawElements(disp, glDrawElements); + SET_DrawPixels(disp, glDrawPixels); + SET_DrawRangeElements(disp, glDrawRangeElements); + SET_EdgeFlag(disp, glEdgeFlag); + SET_EdgeFlagPointer(disp, glEdgeFlagPointer); + SET_EdgeFlagv(disp, glEdgeFlagv); + SET_Enable(disp, glEnable); + SET_EnableClientState(disp, glEnableClientState); + SET_End(disp, glEnd); + SET_EndList(disp, glEndList); + SET_EvalCoord1d(disp, glEvalCoord1d); + SET_EvalCoord1dv(disp, glEvalCoord1dv); + SET_EvalCoord1f(disp, glEvalCoord1f); + SET_EvalCoord1fv(disp, glEvalCoord1fv); + SET_EvalCoord2d(disp, glEvalCoord2d); + SET_EvalCoord2dv(disp, glEvalCoord2dv); + SET_EvalCoord2f(disp, glEvalCoord2f); + SET_EvalCoord2fv(disp, glEvalCoord2fv); + SET_EvalMesh1(disp, glEvalMesh1); + SET_EvalMesh2(disp, glEvalMesh2); + SET_EvalPoint1(disp, glEvalPoint1); + SET_EvalPoint2(disp, glEvalPoint2); + SET_FeedbackBuffer(disp, glFeedbackBuffer); + SET_Finish(disp, glFinish); + SET_Flush(disp, glFlush); + SET_Fogf(disp, glFogf); + SET_Fogfv(disp, glFogfv); + SET_Fogi(disp, glFogi); + SET_Fogiv(disp, glFogiv); + SET_FrontFace(disp, glFrontFace); + SET_Frustum(disp, glFrustum); + SET_GenLists(disp, glGenLists); + SET_GenTextures(disp, glGenTextures); + SET_GetBooleanv(disp, glGetBooleanv); + SET_GetClipPlane(disp, glGetClipPlane); + SET_GetColorTable(disp, glGetColorTable); + SET_GetColorTableParameterfv(disp, glGetColorTableParameterfv); + SET_GetColorTableParameteriv(disp, glGetColorTableParameteriv); + SET_GetConvolutionFilter(disp, glGetConvolutionFilter); + SET_GetConvolutionParameterfv(disp, glGetConvolutionParameterfv); + SET_GetConvolutionParameteriv(disp, glGetConvolutionParameteriv); + SET_GetDoublev(disp, glGetDoublev); + SET_GetError(disp, glGetError); + SET_GetFloatv(disp, glGetFloatv); + SET_GetHistogram(disp, glGetHistogram); + SET_GetHistogramParameterfv(disp, glGetHistogramParameterfv); + SET_GetHistogramParameteriv(disp, glGetHistogramParameteriv); + SET_GetIntegerv(disp, glGetIntegerv); + SET_GetLightfv(disp, glGetLightfv); + SET_GetLightiv(disp, glGetLightiv); + SET_GetMapdv(disp, glGetMapdv); + SET_GetMapfv(disp, glGetMapfv); + SET_GetMapiv(disp, glGetMapiv); + SET_GetMaterialfv(disp, glGetMaterialfv); + SET_GetMaterialiv(disp, glGetMaterialiv); + SET_GetMinmax(disp, glGetMinmax); + SET_GetMinmaxParameterfv(disp, glGetMinmaxParameterfv); + SET_GetMinmaxParameteriv(disp, glGetMinmaxParameteriv); + SET_GetPixelMapfv(disp, glGetPixelMapfv); + SET_GetPixelMapuiv(disp, glGetPixelMapuiv); + SET_GetPixelMapusv(disp, glGetPixelMapusv); + SET_GetPointerv(disp, glGetPointerv); + SET_GetPolygonStipple(disp, glGetPolygonStipple); + SET_GetSeparableFilter(disp, glGetSeparableFilter); + SET_GetString(disp, glGetString); + SET_GetTexEnvfv(disp, glGetTexEnvfv); + SET_GetTexEnviv(disp, glGetTexEnviv); + SET_GetTexGendv(disp, glGetTexGendv); + SET_GetTexGenfv(disp, glGetTexGenfv); + SET_GetTexGeniv(disp, glGetTexGeniv); + SET_GetTexImage(disp, glGetTexImage); + SET_GetTexLevelParameterfv(disp, glGetTexLevelParameterfv); + SET_GetTexLevelParameteriv(disp, glGetTexLevelParameteriv); + SET_GetTexParameterfv(disp, glGetTexParameterfv); + SET_GetTexParameteriv(disp, glGetTexParameteriv); + SET_Hint(disp, glHint); + SET_Histogram(disp, glHistogram); + SET_IndexMask(disp, glIndexMask); + SET_IndexPointer(disp, glIndexPointer); + SET_Indexd(disp, glIndexd); + SET_Indexdv(disp, glIndexdv); + SET_Indexf(disp, glIndexf); + SET_Indexfv(disp, glIndexfv); + SET_Indexi(disp, glIndexi); + SET_Indexiv(disp, glIndexiv); + SET_Indexs(disp, glIndexs); + SET_Indexsv(disp, glIndexsv); + SET_Indexub(disp, glIndexub); + SET_Indexubv(disp, glIndexubv); + SET_InitNames(disp, glInitNames); + SET_InterleavedArrays(disp, glInterleavedArrays); + SET_IsEnabled(disp, glIsEnabled); + SET_IsList(disp, glIsList); + SET_IsTexture(disp, glIsTexture); + SET_LightModelf(disp, glLightModelf); + SET_LightModelfv(disp, glLightModelfv); + SET_LightModeli(disp, glLightModeli); + SET_LightModeliv(disp, glLightModeliv); + SET_Lightf(disp, glLightf); + SET_Lightfv(disp, glLightfv); + SET_Lighti(disp, glLighti); + SET_Lightiv(disp, glLightiv); + SET_LineStipple(disp, glLineStipple); + SET_LineWidth(disp, glLineWidth); + SET_ListBase(disp, glListBase); + SET_LoadIdentity(disp, glLoadIdentity); + SET_LoadMatrixd(disp, glLoadMatrixd); + SET_LoadMatrixf(disp, glLoadMatrixf); + SET_LoadName(disp, glLoadName); + SET_LogicOp(disp, glLogicOp); + SET_Map1d(disp, glMap1d); + SET_Map1f(disp, glMap1f); + SET_Map2d(disp, glMap2d); + SET_Map2f(disp, glMap2f); + SET_MapGrid1d(disp, glMapGrid1d); + SET_MapGrid1f(disp, glMapGrid1f); + SET_MapGrid2d(disp, glMapGrid2d); + SET_MapGrid2f(disp, glMapGrid2f); + SET_Materialf(disp, glMaterialf); + SET_Materialfv(disp, glMaterialfv); + SET_Materiali(disp, glMateriali); + SET_Materialiv(disp, glMaterialiv); + SET_MatrixMode(disp, glMatrixMode); + SET_Minmax(disp, glMinmax); + SET_MultMatrixd(disp, glMultMatrixd); + SET_MultMatrixf(disp, glMultMatrixf); + SET_NewList(disp, glNewList); + SET_Normal3b(disp, glNormal3b); + SET_Normal3bv(disp, glNormal3bv); + SET_Normal3d(disp, glNormal3d); + SET_Normal3dv(disp, glNormal3dv); + SET_Normal3f(disp, glNormal3f); + SET_Normal3fv(disp, glNormal3fv); + SET_Normal3i(disp, glNormal3i); + SET_Normal3iv(disp, glNormal3iv); + SET_Normal3s(disp, glNormal3s); + SET_Normal3sv(disp, glNormal3sv); + SET_NormalPointer(disp, glNormalPointer); + SET_Ortho(disp, glOrtho); + SET_PassThrough(disp, glPassThrough); + SET_PixelMapfv(disp, glPixelMapfv); + SET_PixelMapuiv(disp, glPixelMapuiv); + SET_PixelMapusv(disp, glPixelMapusv); + SET_PixelStoref(disp, glPixelStoref); + SET_PixelStorei(disp, glPixelStorei); + SET_PixelTransferf(disp, glPixelTransferf); + SET_PixelTransferi(disp, glPixelTransferi); + SET_PixelZoom(disp, glPixelZoom); + SET_PointSize(disp, glPointSize); + SET_PolygonMode(disp, glPolygonMode); + SET_PolygonOffset(disp, glPolygonOffset); + SET_PolygonStipple(disp, glPolygonStipple); + SET_PopAttrib(disp, glPopAttrib); + SET_PopClientAttrib(disp, glPopClientAttrib); + SET_PopMatrix(disp, glPopMatrix); + SET_PopName(disp, glPopName); + SET_PrioritizeTextures(disp, glPrioritizeTextures); + SET_PushAttrib(disp, glPushAttrib); + SET_PushClientAttrib(disp, glPushClientAttrib); + SET_PushMatrix(disp, glPushMatrix); + SET_PushName(disp, glPushName); + SET_RasterPos2d(disp, glRasterPos2d); + SET_RasterPos2dv(disp, glRasterPos2dv); + SET_RasterPos2f(disp, glRasterPos2f); + SET_RasterPos2fv(disp, glRasterPos2fv); + SET_RasterPos2i(disp, glRasterPos2i); + SET_RasterPos2iv(disp, glRasterPos2iv); + SET_RasterPos2s(disp, glRasterPos2s); + SET_RasterPos2sv(disp, glRasterPos2sv); + SET_RasterPos3d(disp, glRasterPos3d); + SET_RasterPos3dv(disp, glRasterPos3dv); + SET_RasterPos3f(disp, glRasterPos3f); + SET_RasterPos3fv(disp, glRasterPos3fv); + SET_RasterPos3i(disp, glRasterPos3i); + SET_RasterPos3iv(disp, glRasterPos3iv); + SET_RasterPos3s(disp, glRasterPos3s); + SET_RasterPos3sv(disp, glRasterPos3sv); + SET_RasterPos4d(disp, glRasterPos4d); + SET_RasterPos4dv(disp, glRasterPos4dv); + SET_RasterPos4f(disp, glRasterPos4f); + SET_RasterPos4fv(disp, glRasterPos4fv); + SET_RasterPos4i(disp, glRasterPos4i); + SET_RasterPos4iv(disp, glRasterPos4iv); + SET_RasterPos4s(disp, glRasterPos4s); + SET_RasterPos4sv(disp, glRasterPos4sv); + SET_ReadBuffer(disp, glReadBuffer); + SET_ReadPixels(disp, glReadPixels); + SET_Rectd(disp, glRectd); + SET_Rectdv(disp, glRectdv); + SET_Rectf(disp, glRectf); + SET_Rectfv(disp, glRectfv); + SET_Recti(disp, glRecti); + SET_Rectiv(disp, glRectiv); + SET_Rects(disp, glRects); + SET_Rectsv(disp, glRectsv); + SET_RenderMode(disp, glRenderMode); + SET_ResetHistogram(disp, glResetHistogram); + SET_ResetMinmax(disp, glResetMinmax); + SET_Rotated(disp, glRotated); + SET_Rotatef(disp, glRotatef); + SET_Scaled(disp, glScaled); + SET_Scalef(disp, glScalef); + SET_Scissor(disp, glScissor); + SET_SelectBuffer(disp, glSelectBuffer); + SET_SeparableFilter2D(disp, glSeparableFilter2D); + SET_ShadeModel(disp, glShadeModel); + SET_StencilFunc(disp, glStencilFunc); + SET_StencilMask(disp, glStencilMask); + SET_StencilOp(disp, glStencilOp); + SET_TexCoord1d(disp, glTexCoord1d); + SET_TexCoord1dv(disp, glTexCoord1dv); + SET_TexCoord1f(disp, glTexCoord1f); + SET_TexCoord1fv(disp, glTexCoord1fv); + SET_TexCoord1i(disp, glTexCoord1i); + SET_TexCoord1iv(disp, glTexCoord1iv); + SET_TexCoord1s(disp, glTexCoord1s); + SET_TexCoord1sv(disp, glTexCoord1sv); + SET_TexCoord2d(disp, glTexCoord2d); + SET_TexCoord2dv(disp, glTexCoord2dv); + SET_TexCoord2f(disp, glTexCoord2f); + SET_TexCoord2fv(disp, glTexCoord2fv); + SET_TexCoord2i(disp, glTexCoord2i); + SET_TexCoord2iv(disp, glTexCoord2iv); + SET_TexCoord2s(disp, glTexCoord2s); + SET_TexCoord2sv(disp, glTexCoord2sv); + SET_TexCoord3d(disp, glTexCoord3d); + SET_TexCoord3dv(disp, glTexCoord3dv); + SET_TexCoord3f(disp, glTexCoord3f); + SET_TexCoord3fv(disp, glTexCoord3fv); + SET_TexCoord3i(disp, glTexCoord3i); + SET_TexCoord3iv(disp, glTexCoord3iv); + SET_TexCoord3s(disp, glTexCoord3s); + SET_TexCoord3sv(disp, glTexCoord3sv); + SET_TexCoord4d(disp, glTexCoord4d); + SET_TexCoord4dv(disp, glTexCoord4dv); + SET_TexCoord4f(disp, glTexCoord4f); + SET_TexCoord4fv(disp, glTexCoord4fv); + SET_TexCoord4i(disp, glTexCoord4i); + SET_TexCoord4iv(disp, glTexCoord4iv); + SET_TexCoord4s(disp, glTexCoord4s); + SET_TexCoord4sv(disp, glTexCoord4sv); + SET_TexCoordPointer(disp, glTexCoordPointer); + SET_TexEnvf(disp, glTexEnvf); + SET_TexEnvfv(disp, glTexEnvfv); + SET_TexEnvi(disp, glTexEnvi); + SET_TexEnviv(disp, glTexEnviv); + SET_TexGend(disp, glTexGend); + SET_TexGendv(disp, glTexGendv); + SET_TexGenf(disp, glTexGenf); + SET_TexGenfv(disp, glTexGenfv); + SET_TexGeni(disp, glTexGeni); + SET_TexGeniv(disp, glTexGeniv); + + /* Pointer Incompatability: + * internalformat is a GLenum according to /System/Library/Frameworks/OpenGL.framework/Headers/gl.h + * extern void glTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); + * extern void glTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); + * extern void glTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); + * + * and it's a GLint in glx/glapitable.h and according to the man page + * void ( * TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); + * void ( * TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); + * void ( * TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); + * + * <rdar://problem/6953344> gl.h contains incorrect prototypes for glTexImage[123]D + */ + + SET_TexImage1D(disp, (void *)glTexImage1D); + SET_TexImage2D(disp, (void *)glTexImage2D); + SET_TexImage3D(disp, (void *)glTexImage3D); + SET_TexParameterf(disp, glTexParameterf); + SET_TexParameterfv(disp, glTexParameterfv); + SET_TexParameteri(disp, glTexParameteri); + SET_TexParameteriv(disp, glTexParameteriv); + SET_TexSubImage1D(disp, glTexSubImage1D); + SET_TexSubImage2D(disp, glTexSubImage2D); + SET_TexSubImage3D(disp, glTexSubImage3D); + SET_Translated(disp, glTranslated); + SET_Translatef(disp, glTranslatef); + SET_Vertex2d(disp, glVertex2d); + SET_Vertex2dv(disp, glVertex2dv); + SET_Vertex2f(disp, glVertex2f); + SET_Vertex2fv(disp, glVertex2fv); + SET_Vertex2i(disp, glVertex2i); + SET_Vertex2iv(disp, glVertex2iv); + SET_Vertex2s(disp, glVertex2s); + SET_Vertex2sv(disp, glVertex2sv); + SET_Vertex3d(disp, glVertex3d); + SET_Vertex3dv(disp, glVertex3dv); + SET_Vertex3f(disp, glVertex3f); + SET_Vertex3fv(disp, glVertex3fv); + SET_Vertex3i(disp, glVertex3i); + SET_Vertex3iv(disp, glVertex3iv); + SET_Vertex3s(disp, glVertex3s); + SET_Vertex3sv(disp, glVertex3sv); + SET_Vertex4d(disp, glVertex4d); + SET_Vertex4dv(disp, glVertex4dv); + SET_Vertex4f(disp, glVertex4f); + SET_Vertex4fv(disp, glVertex4fv); + SET_Vertex4i(disp, glVertex4i); + SET_Vertex4iv(disp, glVertex4iv); + SET_Vertex4s(disp, glVertex4s); + SET_Vertex4sv(disp, glVertex4sv); + SET_VertexPointer(disp, glVertexPointer); + SET_Viewport(disp, glViewport); + +#if GL_VERSION_2_0 + SET_AttachShader(disp, glAttachShader); + SET_DeleteShader(disp, glDeleteShader); + SET_DetachShader(disp, glDetachShader); + SET_GetAttachedShaders(disp, glGetAttachedShaders); + SET_GetProgramInfoLog(disp, glGetProgramInfoLog); + SET_GetShaderInfoLog(disp, glGetShaderInfoLog); + SET_GetShaderiv(disp, glGetShaderiv); + SET_IsShader(disp, glIsShader); + SET_StencilFuncSeparate(disp, glStencilFuncSeparate); + SET_StencilMaskSeparate(disp, glStencilMaskSeparate); + SET_StencilOpSeparate(disp, glStencilOpSeparate); +#endif + +#if GL_VERSION_2_1 + SET_UniformMatrix2x3fv(disp, glUniformMatrix2x3fv); + SET_UniformMatrix2x4fv(disp, glUniformMatrix2x4fv); + SET_UniformMatrix3x2fv(disp, glUniformMatrix3x2fv); + SET_UniformMatrix3x4fv(disp, glUniformMatrix3x4fv); + SET_UniformMatrix4x2fv(disp, glUniformMatrix4x2fv); + SET_UniformMatrix4x3fv(disp, glUniformMatrix4x3fv); +#endif + +#if GL_APPLE_vertex_array_object + SET_BindVertexArrayAPPLE(disp, glBindVertexArrayAPPLE); + SET_DeleteVertexArraysAPPLE(disp, glDeleteVertexArraysAPPLE); + SET_GenVertexArraysAPPLE(disp, glGenVertexArraysAPPLE); + SET_IsVertexArrayAPPLE(disp, glIsVertexArrayAPPLE); +#endif + +#if GL_ARB_draw_buffers + SET_DrawBuffersARB(disp, glDrawBuffersARB); +#endif + +#if GL_ARB_multisample + SET_SampleCoverageARB(disp, glSampleCoverageARB); +#endif + +#if GL_ARB_multitexture + SET_ActiveTextureARB(disp, glActiveTextureARB); + SET_ClientActiveTextureARB(disp, glClientActiveTextureARB); + SET_MultiTexCoord1dARB(disp, glMultiTexCoord1dARB); + SET_MultiTexCoord1dvARB(disp, glMultiTexCoord1dvARB); + SET_MultiTexCoord1fARB(disp, glMultiTexCoord1fARB); + SET_MultiTexCoord1fvARB(disp, glMultiTexCoord1fvARB); + SET_MultiTexCoord1iARB(disp, glMultiTexCoord1iARB); + SET_MultiTexCoord1ivARB(disp, glMultiTexCoord1ivARB); + SET_MultiTexCoord1sARB(disp, glMultiTexCoord1sARB); + SET_MultiTexCoord1svARB(disp, glMultiTexCoord1svARB); + SET_MultiTexCoord2dARB(disp, glMultiTexCoord2dARB); + SET_MultiTexCoord2dvARB(disp, glMultiTexCoord2dvARB); + SET_MultiTexCoord2fARB(disp, glMultiTexCoord2fARB); + SET_MultiTexCoord2fvARB(disp, glMultiTexCoord2fvARB); + SET_MultiTexCoord2iARB(disp, glMultiTexCoord2iARB); + SET_MultiTexCoord2ivARB(disp, glMultiTexCoord2ivARB); + SET_MultiTexCoord2sARB(disp, glMultiTexCoord2sARB); + SET_MultiTexCoord2svARB(disp, glMultiTexCoord2svARB); + SET_MultiTexCoord3dARB(disp, glMultiTexCoord3dARB); + SET_MultiTexCoord3dvARB(disp, glMultiTexCoord3dvARB); + SET_MultiTexCoord3fARB(disp, glMultiTexCoord3fARB); + SET_MultiTexCoord3fvARB(disp, glMultiTexCoord3fvARB); + SET_MultiTexCoord3iARB(disp, glMultiTexCoord3iARB); + SET_MultiTexCoord3ivARB(disp, glMultiTexCoord3ivARB); + SET_MultiTexCoord3sARB(disp, glMultiTexCoord3sARB); + SET_MultiTexCoord3svARB(disp, glMultiTexCoord3svARB); + SET_MultiTexCoord4dARB(disp, glMultiTexCoord4dARB); + SET_MultiTexCoord4dvARB(disp, glMultiTexCoord4dvARB); + SET_MultiTexCoord4fARB(disp, glMultiTexCoord4fARB); + SET_MultiTexCoord4fvARB(disp, glMultiTexCoord4fvARB); + SET_MultiTexCoord4iARB(disp, glMultiTexCoord4iARB); + SET_MultiTexCoord4ivARB(disp, glMultiTexCoord4ivARB); + SET_MultiTexCoord4sARB(disp, glMultiTexCoord4sARB); + SET_MultiTexCoord4svARB(disp, glMultiTexCoord4svARB); +#endif + +#if GL_ARB_occlusion_query + SET_BeginQueryARB(disp, glBeginQueryARB); + SET_DeleteQueriesARB(disp, glDeleteQueriesARB); + SET_EndQueryARB(disp, glEndQueryARB); + SET_GenQueriesARB(disp, glGenQueriesARB); + SET_GetQueryObjectivARB(disp, glGetQueryObjectivARB); + SET_GetQueryObjectuivARB(disp, glGetQueryObjectuivARB); + SET_GetQueryivARB(disp, glGetQueryivARB); + SET_IsQueryARB(disp, glIsQueryARB); +#endif + +#if GL_ARB_shader_objects + SET_AttachObjectARB(disp, glAttachObjectARB); + SET_CompileShaderARB(disp, glCompileShaderARB); + SET_DeleteObjectARB(disp, glDeleteObjectARB); + SET_GetHandleARB(disp, glGetHandleARB); + SET_DetachObjectARB(disp, glDetachObjectARB); + SET_CreateProgramObjectARB(disp, glCreateProgramObjectARB); + SET_CreateShaderObjectARB(disp, glCreateShaderObjectARB); + SET_GetInfoLogARB(disp, glGetInfoLogARB); + SET_GetActiveUniformARB(disp, glGetActiveUniformARB); + SET_GetAttachedObjectsARB(disp, glGetAttachedObjectsARB); + SET_GetObjectParameterfvARB(disp, glGetObjectParameterfvARB); + SET_GetObjectParameterivARB(disp, glGetObjectParameterivARB); + SET_GetShaderSourceARB(disp, glGetShaderSourceARB); + SET_GetUniformLocationARB(disp, glGetUniformLocationARB); + SET_GetUniformfvARB(disp, glGetUniformfvARB); + SET_GetUniformivARB(disp, glGetUniformivARB); + SET_LinkProgramARB(disp, glLinkProgramARB); + SET_ShaderSourceARB(disp, glShaderSourceARB); + SET_Uniform1fARB(disp, glUniform1fARB); + SET_Uniform1fvARB(disp, glUniform1fvARB); + SET_Uniform1iARB(disp, glUniform1iARB); + SET_Uniform1ivARB(disp, glUniform1ivARB); + SET_Uniform2fARB(disp, glUniform2fARB); + SET_Uniform2fvARB(disp, glUniform2fvARB); + SET_Uniform2iARB(disp, glUniform2iARB); + SET_Uniform2ivARB(disp, glUniform2ivARB); + SET_Uniform3fARB(disp, glUniform3fARB); + SET_Uniform3fvARB(disp, glUniform3fvARB); + SET_Uniform3iARB(disp, glUniform3iARB); + SET_Uniform3ivARB(disp, glUniform3ivARB); + SET_Uniform4fARB(disp, glUniform4fARB); + SET_Uniform4fvARB(disp, glUniform4fvARB); + SET_Uniform4iARB(disp, glUniform4iARB); + SET_Uniform4ivARB(disp, glUniform4ivARB); + SET_UniformMatrix2fvARB(disp, glUniformMatrix2fvARB); + SET_UniformMatrix3fvARB(disp, glUniformMatrix3fvARB); + SET_UniformMatrix4fvARB(disp, glUniformMatrix4fvARB); + SET_UseProgramObjectARB(disp, glUseProgramObjectARB); + SET_ValidateProgramARB(disp, glValidateProgramARB); +#endif + +#if GL_ARB_texture_compression + SET_CompressedTexImage1DARB(disp, glCompressedTexImage1DARB); + SET_CompressedTexImage2DARB(disp, glCompressedTexImage2DARB); + SET_CompressedTexImage3DARB(disp, glCompressedTexImage3DARB); + SET_CompressedTexSubImage1DARB(disp, glCompressedTexSubImage1DARB); + SET_CompressedTexSubImage2DARB(disp, glCompressedTexSubImage2DARB); + SET_CompressedTexSubImage3DARB(disp, glCompressedTexSubImage3DARB); + SET_GetCompressedTexImageARB(disp, glGetCompressedTexImageARB); +#endif + +#if GL_ARB_transpose_matrix + SET_LoadTransposeMatrixdARB(disp, glLoadTransposeMatrixdARB); + SET_LoadTransposeMatrixfARB(disp, glLoadTransposeMatrixfARB); + SET_MultTransposeMatrixdARB(disp, glMultTransposeMatrixdARB); + SET_MultTransposeMatrixfARB(disp, glMultTransposeMatrixfARB); +#endif + +#if GL_ARB_vertex_buffer_object + SET_BindBufferARB(disp, glBindBufferARB); + SET_BufferDataARB(disp, glBufferDataARB); + SET_BufferSubDataARB(disp, glBufferSubDataARB); + SET_DeleteBuffersARB(disp, glDeleteBuffersARB); + SET_GenBuffersARB(disp, glGenBuffersARB); + SET_GetBufferParameterivARB(disp, glGetBufferParameterivARB); + SET_GetBufferPointervARB(disp, glGetBufferPointervARB); + SET_GetBufferSubDataARB(disp, glGetBufferSubDataARB); + SET_IsBufferARB(disp, glIsBufferARB); + SET_MapBufferARB(disp, glMapBufferARB); + SET_UnmapBufferARB(disp, glUnmapBufferARB); +#endif + +#if GL_ARB_vertex_program + SET_DisableVertexAttribArrayARB(disp, glDisableVertexAttribArrayARB); + SET_EnableVertexAttribArrayARB(disp, glEnableVertexAttribArrayARB); + SET_GetProgramEnvParameterdvARB(disp, glGetProgramEnvParameterdvARB); + SET_GetProgramEnvParameterfvARB(disp, glGetProgramEnvParameterfvARB); + SET_GetProgramLocalParameterdvARB(disp, glGetProgramLocalParameterdvARB); + SET_GetProgramLocalParameterfvARB(disp, glGetProgramLocalParameterfvARB); + SET_GetProgramStringARB(disp, glGetProgramStringARB); + SET_GetProgramivARB(disp, glGetProgramivARB); + SET_GetVertexAttribdvARB(disp, glGetVertexAttribdvARB); + SET_GetVertexAttribfvARB(disp, glGetVertexAttribfvARB); + SET_GetVertexAttribivARB(disp, glGetVertexAttribivARB); + SET_ProgramEnvParameter4dARB(disp, glProgramEnvParameter4dARB); + SET_ProgramEnvParameter4dvARB(disp, glProgramEnvParameter4dvARB); + SET_ProgramEnvParameter4fARB(disp, glProgramEnvParameter4fARB); + SET_ProgramEnvParameter4fvARB(disp, glProgramEnvParameter4fvARB); + SET_ProgramLocalParameter4dARB(disp, glProgramLocalParameter4dARB); + SET_ProgramLocalParameter4dvARB(disp, glProgramLocalParameter4dvARB); + SET_ProgramLocalParameter4fARB(disp, glProgramLocalParameter4fARB); + SET_ProgramLocalParameter4fvARB(disp, glProgramLocalParameter4fvARB); + SET_ProgramStringARB(disp, glProgramStringARB); + SET_VertexAttrib1dARB(disp, glVertexAttrib1dARB); + SET_VertexAttrib1dvARB(disp, glVertexAttrib1dvARB); + SET_VertexAttrib1fARB(disp, glVertexAttrib1fARB); + SET_VertexAttrib1fvARB(disp, glVertexAttrib1fvARB); + SET_VertexAttrib1sARB(disp, glVertexAttrib1sARB); + SET_VertexAttrib1svARB(disp, glVertexAttrib1svARB); + SET_VertexAttrib2dARB(disp, glVertexAttrib2dARB); + SET_VertexAttrib2dvARB(disp, glVertexAttrib2dvARB); + SET_VertexAttrib2fARB(disp, glVertexAttrib2fARB); + SET_VertexAttrib2fvARB(disp, glVertexAttrib2fvARB); + SET_VertexAttrib2sARB(disp, glVertexAttrib2sARB); + SET_VertexAttrib2svARB(disp, glVertexAttrib2svARB); + SET_VertexAttrib3dARB(disp, glVertexAttrib3dARB); + SET_VertexAttrib3dvARB(disp, glVertexAttrib3dvARB); + SET_VertexAttrib3fARB(disp, glVertexAttrib3fARB); + SET_VertexAttrib3fvARB(disp, glVertexAttrib3fvARB); + SET_VertexAttrib3sARB(disp, glVertexAttrib3sARB); + SET_VertexAttrib3svARB(disp, glVertexAttrib3svARB); + SET_VertexAttrib4NbvARB(disp, glVertexAttrib4NbvARB); + SET_VertexAttrib4NivARB(disp, glVertexAttrib4NivARB); + SET_VertexAttrib4NsvARB(disp, glVertexAttrib4NsvARB); + SET_VertexAttrib4NubARB(disp, glVertexAttrib4NubARB); + SET_VertexAttrib4NubvARB(disp, glVertexAttrib4NubvARB); + SET_VertexAttrib4NuivARB(disp, glVertexAttrib4NuivARB); + SET_VertexAttrib4NusvARB(disp, glVertexAttrib4NusvARB); + SET_VertexAttrib4bvARB(disp, glVertexAttrib4bvARB); + SET_VertexAttrib4dARB(disp, glVertexAttrib4dARB); + SET_VertexAttrib4dvARB(disp, glVertexAttrib4dvARB); + SET_VertexAttrib4fARB(disp, glVertexAttrib4fARB); + SET_VertexAttrib4fvARB(disp, glVertexAttrib4fvARB); + SET_VertexAttrib4ivARB(disp, glVertexAttrib4ivARB); + SET_VertexAttrib4sARB(disp, glVertexAttrib4sARB); + SET_VertexAttrib4svARB(disp, glVertexAttrib4svARB); + SET_VertexAttrib4ubvARB(disp, glVertexAttrib4ubvARB); + SET_VertexAttrib4uivARB(disp, glVertexAttrib4uivARB); + SET_VertexAttrib4usvARB(disp, glVertexAttrib4usvARB); + SET_VertexAttribPointerARB(disp, glVertexAttribPointerARB); +#endif + +#if GL_ARB_vertex_shader + SET_BindAttribLocationARB(disp, glBindAttribLocationARB); + SET_GetActiveAttribARB(disp, glGetActiveAttribARB); + SET_GetAttribLocationARB(disp, glGetAttribLocationARB); +#endif + +#if GL_ARB_window_pos + SET_WindowPos2dMESA(disp, glWindowPos2dARB); + SET_WindowPos2dvMESA(disp, glWindowPos2dvARB); + SET_WindowPos2fMESA(disp, glWindowPos2fARB); + SET_WindowPos2fvMESA(disp, glWindowPos2fvARB); + SET_WindowPos2iMESA(disp, glWindowPos2iARB); + SET_WindowPos2ivMESA(disp, glWindowPos2ivARB); + SET_WindowPos2sMESA(disp, glWindowPos2sARB); + SET_WindowPos2svMESA(disp, glWindowPos2svARB); + SET_WindowPos3dMESA(disp, glWindowPos3dARB); + SET_WindowPos3dvMESA(disp, glWindowPos3dvARB); + SET_WindowPos3fMESA(disp, glWindowPos3fARB); + SET_WindowPos3fvMESA(disp, glWindowPos3fvARB); + SET_WindowPos3iMESA(disp, glWindowPos3iARB); + SET_WindowPos3ivMESA(disp, glWindowPos3ivARB); + SET_WindowPos3sMESA(disp, glWindowPos3sARB); + SET_WindowPos3svMESA(disp, glWindowPos3svARB); +#endif + +#if GL_ATI_fragment_shader + SET_AlphaFragmentOp1ATI(disp, glAlphaFragmentOp1ATI); + SET_AlphaFragmentOp2ATI(disp, glAlphaFragmentOp2ATI); + SET_AlphaFragmentOp3ATI(disp, glAlphaFragmentOp3ATI); + SET_BeginFragmentShaderATI(disp, glBeginFragmentShaderATI); + SET_BindFragmentShaderATI(disp, glBindFragmentShaderATI); + SET_ColorFragmentOp1ATI(disp, glColorFragmentOp1ATI); + SET_ColorFragmentOp2ATI(disp, glColorFragmentOp2ATI); + SET_ColorFragmentOp3ATI(disp, glColorFragmentOp3ATI); + SET_DeleteFragmentShaderATI(disp, glDeleteFragmentShaderATI); + SET_EndFragmentShaderATI(disp, glEndFragmentShaderATI); + SET_GenFragmentShadersATI(disp, glGenFragmentShadersATI); + SET_PassTexCoordATI(disp, glPassTexCoordATI); + SET_SampleMapATI(disp, glSampleMapATI); + SET_SetFragmentShaderConstantATI(disp, glSetFragmentShaderConstantATI); +#elif GL_EXT_fragment_shader + SET_AlphaFragmentOp1ATI(disp, glAlphaFragmentOp1EXT); + SET_AlphaFragmentOp2ATI(disp, glAlphaFragmentOp2EXT); + SET_AlphaFragmentOp3ATI(disp, glAlphaFragmentOp3EXT); + SET_BeginFragmentShaderATI(disp, glBeginFragmentShaderEXT); + SET_BindFragmentShaderATI(disp, glBindFragmentShaderEXT); + SET_ColorFragmentOp1ATI(disp, glColorFragmentOp1EXT); + SET_ColorFragmentOp2ATI(disp, glColorFragmentOp2EXT); + SET_ColorFragmentOp3ATI(disp, glColorFragmentOp3EXT); + SET_DeleteFragmentShaderATI(disp, glDeleteFragmentShaderEXT); + SET_EndFragmentShaderATI(disp, glEndFragmentShaderEXT); + SET_GenFragmentShadersATI(disp, glGenFragmentShadersEXT); + SET_PassTexCoordATI(disp, glPassTexCoordEXT); + SET_SampleMapATI(disp, glSampleMapEXT); + SET_SetFragmentShaderConstantATI(disp, glSetFragmentShaderConstantEXT); +#endif + +#if GL_ATI_separate_stencil + SET_StencilFuncSeparateATI(disp, glStencilFuncSeparateATI); +#endif + +#if GL_EXT_blend_equation_separate + SET_BlendEquationSeparateEXT(disp, glBlendEquationSeparateEXT); +#endif + +#if GL_EXT_blend_func_separate + SET_BlendFuncSeparateEXT(disp, glBlendFuncSeparateEXT); +#endif + +#if GL_EXT_depth_bounds_test + SET_DepthBoundsEXT(disp, glDepthBoundsEXT); +#endif + +#if GL_EXT_compiled_vertex_array + SET_LockArraysEXT(disp, glLockArraysEXT); + SET_UnlockArraysEXT(disp, glUnlockArraysEXT); +#endif + +#if GL_EXT_cull_vertex + SET_CullParameterdvEXT(disp, glCullParameterdvEXT); + SET_CullParameterfvEXT(disp, glCullParameterfvEXT); +#endif + +#if GL_EXT_fog_coord + SET_FogCoordPointerEXT(disp, glFogCoordPointerEXT); + SET_FogCoorddEXT(disp, glFogCoorddEXT); + SET_FogCoorddvEXT(disp, glFogCoorddvEXT); + SET_FogCoordfEXT(disp, glFogCoordfEXT); + SET_FogCoordfvEXT(disp, glFogCoordfvEXT); +#endif + +#if GL_EXT_framebuffer_blit + SET_BlitFramebufferEXT(disp, glBlitFramebufferEXT); +#endif + +#if GL_EXT_framebuffer_object + SET_BindFramebufferEXT(disp, glBindFramebufferEXT); + SET_BindRenderbufferEXT(disp, glBindRenderbufferEXT); + SET_CheckFramebufferStatusEXT(disp, glCheckFramebufferStatusEXT); + SET_DeleteFramebuffersEXT(disp, glDeleteFramebuffersEXT); + SET_DeleteRenderbuffersEXT(disp, glDeleteRenderbuffersEXT); + SET_FramebufferRenderbufferEXT(disp, glFramebufferRenderbufferEXT); + SET_FramebufferTexture1DEXT(disp, glFramebufferTexture1DEXT); + SET_FramebufferTexture2DEXT(disp, glFramebufferTexture2DEXT); + SET_FramebufferTexture3DEXT(disp, glFramebufferTexture3DEXT); + SET_GenerateMipmapEXT(disp, glGenerateMipmapEXT); + SET_GenFramebuffersEXT(disp, glGenFramebuffersEXT); + SET_GenRenderbuffersEXT(disp, glGenRenderbuffersEXT); + SET_GetFramebufferAttachmentParameterivEXT(disp, glGetFramebufferAttachmentParameterivEXT); + SET_GetRenderbufferParameterivEXT(disp, glGetRenderbufferParameterivEXT); + SET_IsFramebufferEXT(disp, glIsFramebufferEXT); + SET_IsRenderbufferEXT(disp, glIsRenderbufferEXT); + SET_RenderbufferStorageEXT(disp, glRenderbufferStorageEXT); +#endif + +#if GL_EXT_gpu_program_parameters + SET_ProgramEnvParameters4fvEXT(disp, glProgramEnvParameters4fvEXT); + SET_ProgramLocalParameters4fvEXT(disp, glProgramLocalParameters4fvEXT); +#endif + +#if GL_EXT_multi_draw_arrays + /* Pointer Incompatability: + * This warning can be safely ignored. OpenGL.framework adds const to the + * two pointers. + * + * extern void glMultiDrawArraysEXT (GLenum, const GLint *, const GLsizei *, GLsizei); + * + * void ( * MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); + */ + SET_MultiDrawArraysEXT(disp, (void *)glMultiDrawArraysEXT); + SET_MultiDrawElementsEXT(disp, glMultiDrawElementsEXT); +#endif + +#if GL_EXT_point_parameters + SET_PointParameterfEXT(disp, glPointParameterfEXT); + SET_PointParameterfvEXT(disp, glPointParameterfvEXT); +#elif GL_ARB_point_parameters + SET_PointParameterfEXT(disp, glPointParameterfARB); + SET_PointParameterfvEXT(disp, glPointParameterfvARB); +#endif + +#if GL_EXT_polygon_offset + SET_PolygonOffsetEXT(disp, glPolygonOffsetEXT); +#endif + +#if GL_EXT_secondary_color + SET_SecondaryColor3bEXT(disp, glSecondaryColor3bEXT); + SET_SecondaryColor3bvEXT(disp, glSecondaryColor3bvEXT); + SET_SecondaryColor3dEXT(disp, glSecondaryColor3dEXT); + SET_SecondaryColor3dvEXT(disp, glSecondaryColor3dvEXT); + SET_SecondaryColor3fEXT(disp, glSecondaryColor3fEXT); + SET_SecondaryColor3fvEXT(disp, glSecondaryColor3fvEXT); + SET_SecondaryColor3iEXT(disp, glSecondaryColor3iEXT); + SET_SecondaryColor3ivEXT(disp, glSecondaryColor3ivEXT); + SET_SecondaryColor3sEXT(disp, glSecondaryColor3sEXT); + SET_SecondaryColor3svEXT(disp, glSecondaryColor3svEXT); + SET_SecondaryColor3ubEXT(disp, glSecondaryColor3ubEXT); + SET_SecondaryColor3ubvEXT(disp, glSecondaryColor3ubvEXT); + SET_SecondaryColor3uiEXT(disp, glSecondaryColor3uiEXT); + SET_SecondaryColor3uivEXT(disp, glSecondaryColor3uivEXT); + SET_SecondaryColor3usEXT(disp, glSecondaryColor3usEXT); + SET_SecondaryColor3usvEXT(disp, glSecondaryColor3usvEXT); + SET_SecondaryColorPointerEXT(disp, glSecondaryColorPointerEXT); +#endif + +#if GL_EXT_stencil_two_side + SET_ActiveStencilFaceEXT(disp, glActiveStencilFaceEXT); +#endif + +#if GL_EXT_timer_query + SET_GetQueryObjecti64vEXT(disp, glGetQueryObjecti64vEXT); + SET_GetQueryObjectui64vEXT(disp, glGetQueryObjectui64vEXT); +#endif + +#if GL_EXT_vertex_array + SET_ColorPointerEXT(disp, glColorPointerEXT); + SET_EdgeFlagPointerEXT(disp, glEdgeFlagPointerEXT); + SET_IndexPointerEXT(disp, glIndexPointerEXT); + SET_NormalPointerEXT(disp, glNormalPointerEXT); + SET_TexCoordPointerEXT(disp, glTexCoordPointerEXT); + SET_VertexPointerEXT(disp, glVertexPointerEXT); +#endif + +#if GL_IBM_multimode_draw_arrays + SET_MultiModeDrawArraysIBM(disp, glMultiModeDrawArraysIBM); + SET_MultiModeDrawElementsIBM(disp, glMultiModeDrawElementsIBM); +#endif + +#if GL_MESA_resize_buffers + SET_ResizeBuffersMESA(disp, glResizeBuffersMESA); +#endif + +#if GL_MESA_window_pos + SET_WindowPos4dMESA(disp, glWindowPos4dMESA); + SET_WindowPos4dvMESA(disp, glWindowPos4dvMESA); + SET_WindowPos4fMESA(disp, glWindowPos4fMESA); + SET_WindowPos4fvMESA(disp, glWindowPos4fvMESA); + SET_WindowPos4iMESA(disp, glWindowPos4iMESA); + SET_WindowPos4ivMESA(disp, glWindowPos4ivMESA); + SET_WindowPos4sMESA(disp, glWindowPos4sMESA); + SET_WindowPos4svMESA(disp, glWindowPos4svMESA); +#endif + +#if GL_NV_fence + SET_DeleteFencesNV(disp, glDeleteFencesNV); + SET_FinishFenceNV(disp, glFinishFenceNV); + SET_GenFencesNV(disp, glGenFencesNV); + SET_GetFenceivNV(disp, glGetFenceivNV); + SET_IsFenceNV(disp, glIsFenceNV); + SET_SetFenceNV(disp, glSetFenceNV); + SET_TestFenceNV(disp, glTestFenceNV); +#endif + +#if GL_NV_fragment_program + SET_GetProgramNamedParameterdvNV(disp, glGetProgramNamedParameterdvNV); + SET_GetProgramNamedParameterfvNV(disp, glGetProgramNamedParameterfvNV); + SET_ProgramNamedParameter4dNV(disp, glProgramNamedParameter4dNV); + SET_ProgramNamedParameter4dvNV(disp, glProgramNamedParameter4dvNV); + SET_ProgramNamedParameter4fNV(disp, glProgramNamedParameter4fNV); + SET_ProgramNamedParameter4fvNV(disp, glProgramNamedParameter4fvNV); +#endif + +#if GL_NV_geometry_program4 + SET_FramebufferTextureLayerEXT(disp, glFramebufferTextureLayerEXT); +#endif + +#if GL_NV_point_sprite + SET_PointParameteriNV(disp, glPointParameteriNV); + SET_PointParameterivNV(disp, glPointParameterivNV); +#endif + +#if GL_NV_register_combiners + SET_CombinerInputNV(disp, glCombinerInputNV); + SET_CombinerOutputNV(disp, glCombinerOutputNV); + SET_CombinerParameterfNV(disp, glCombinerParameterfNV); + SET_CombinerParameterfvNV(disp, glCombinerParameterfvNV); + SET_CombinerParameteriNV(disp, glCombinerParameteriNV); + SET_CombinerParameterivNV(disp, glCombinerParameterivNV); + SET_FinalCombinerInputNV(disp, glFinalCombinerInputNV); + SET_GetCombinerInputParameterfvNV(disp, glGetCombinerInputParameterfvNV); + SET_GetCombinerInputParameterivNV(disp, glGetCombinerInputParameterivNV); + SET_GetCombinerOutputParameterfvNV(disp, glGetCombinerOutputParameterfvNV); + SET_GetCombinerOutputParameterivNV(disp, glGetCombinerOutputParameterivNV); + SET_GetFinalCombinerInputParameterfvNV(disp, glGetFinalCombinerInputParameterfvNV); + SET_GetFinalCombinerInputParameterivNV(disp, glGetFinalCombinerInputParameterivNV); +#endif + +#if GL_NV_vertex_array_range + SET_FlushVertexArrayRangeNV(disp, glFlushVertexArrayRangeNV); + SET_VertexArrayRangeNV(disp, glVertexArrayRangeNV); +#endif + +#if GL_NV_vertex_program + SET_AreProgramsResidentNV(disp, glAreProgramsResidentNV); + SET_BindProgramNV(disp, glBindProgramNV); + SET_DeleteProgramsNV(disp, glDeleteProgramsNV); + SET_ExecuteProgramNV(disp, glExecuteProgramNV); + SET_GenProgramsNV(disp, glGenProgramsNV); + SET_GetProgramParameterdvNV(disp, glGetProgramParameterdvNV); + SET_GetProgramParameterfvNV(disp, glGetProgramParameterfvNV); + SET_GetProgramStringNV(disp, glGetProgramStringNV); + SET_GetProgramivNV(disp, glGetProgramivNV); + SET_GetTrackMatrixivNV(disp, glGetTrackMatrixivNV); + SET_GetVertexAttribPointervNV(disp, glGetVertexAttribPointervNV); + SET_GetVertexAttribdvNV(disp, glGetVertexAttribdvNV); + SET_GetVertexAttribfvNV(disp, glGetVertexAttribfvNV); + SET_GetVertexAttribivNV(disp, glGetVertexAttribivNV); + SET_IsProgramNV(disp, glIsProgramNV); + SET_LoadProgramNV(disp, glLoadProgramNV); + SET_ProgramParameters4dvNV(disp, glProgramParameters4dvNV); + SET_ProgramParameters4fvNV(disp, glProgramParameters4fvNV); + SET_RequestResidentProgramsNV(disp, glRequestResidentProgramsNV); + SET_TrackMatrixNV(disp, glTrackMatrixNV); + SET_VertexAttrib1dNV(disp, glVertexAttrib1dNV) + SET_VertexAttrib1dvNV(disp, glVertexAttrib1dvNV) + SET_VertexAttrib1fNV(disp, glVertexAttrib1fNV) + SET_VertexAttrib1fvNV(disp, glVertexAttrib1fvNV) + SET_VertexAttrib1sNV(disp, glVertexAttrib1sNV) + SET_VertexAttrib1svNV(disp, glVertexAttrib1svNV) + SET_VertexAttrib2dNV(disp, glVertexAttrib2dNV) + SET_VertexAttrib2dvNV(disp, glVertexAttrib2dvNV) + SET_VertexAttrib2fNV(disp, glVertexAttrib2fNV) + SET_VertexAttrib2fvNV(disp, glVertexAttrib2fvNV) + SET_VertexAttrib2sNV(disp, glVertexAttrib2sNV) + SET_VertexAttrib2svNV(disp, glVertexAttrib2svNV) + SET_VertexAttrib3dNV(disp, glVertexAttrib3dNV) + SET_VertexAttrib3dvNV(disp, glVertexAttrib3dvNV) + SET_VertexAttrib3fNV(disp, glVertexAttrib3fNV) + SET_VertexAttrib3fvNV(disp, glVertexAttrib3fvNV) + SET_VertexAttrib3sNV(disp, glVertexAttrib3sNV) + SET_VertexAttrib3svNV(disp, glVertexAttrib3svNV) + SET_VertexAttrib4dNV(disp, glVertexAttrib4dNV) + SET_VertexAttrib4dvNV(disp, glVertexAttrib4dvNV) + SET_VertexAttrib4fNV(disp, glVertexAttrib4fNV) + SET_VertexAttrib4fvNV(disp, glVertexAttrib4fvNV) + SET_VertexAttrib4sNV(disp, glVertexAttrib4sNV) + SET_VertexAttrib4svNV(disp, glVertexAttrib4svNV) + SET_VertexAttrib4ubNV(disp, glVertexAttrib4ubNV) + SET_VertexAttrib4ubvNV(disp, glVertexAttrib4ubvNV) + SET_VertexAttribPointerNV(disp, glVertexAttribPointerNV) + SET_VertexAttribs1dvNV(disp, glVertexAttribs1dvNV) + SET_VertexAttribs1fvNV(disp, glVertexAttribs1fvNV) + SET_VertexAttribs1svNV(disp, glVertexAttribs1svNV) + SET_VertexAttribs2dvNV(disp, glVertexAttribs2dvNV) + SET_VertexAttribs2fvNV(disp, glVertexAttribs2fvNV) + SET_VertexAttribs2svNV(disp, glVertexAttribs2svNV) + SET_VertexAttribs3dvNV(disp, glVertexAttribs3dvNV) + SET_VertexAttribs3fvNV(disp, glVertexAttribs3fvNV) + SET_VertexAttribs3svNV(disp, glVertexAttribs3svNV) + SET_VertexAttribs4dvNV(disp, glVertexAttribs4dvNV) + SET_VertexAttribs4fvNV(disp, glVertexAttribs4fvNV) + SET_VertexAttribs4svNV(disp, glVertexAttribs4svNV) + SET_VertexAttribs4ubvNV(disp, glVertexAttribs4ubvNV) +#endif + +#if GL_SGIS_multisample + SET_SampleMaskSGIS(disp, glSampleMaskSGIS); + SET_SamplePatternSGIS(disp, glSamplePatternSGIS); +#endif + +#if GL_SGIS_pixel_texture + SET_GetPixelTexGenParameterfvSGIS(disp, glGetPixelTexGenParameterfvSGIS); + SET_GetPixelTexGenParameterivSGIS(disp, glGetPixelTexGenParameterivSGIS); + SET_PixelTexGenParameterfSGIS(disp, glPixelTexGenParameterfSGIS); + SET_PixelTexGenParameterfvSGIS(disp, glPixelTexGenParameterfvSGIS); + SET_PixelTexGenParameteriSGIS(disp, glPixelTexGenParameteriSGIS); + SET_PixelTexGenParameterivSGIS(disp, glPixelTexGenParameterivSGIS); + SET_PixelTexGenSGIX(disp, glPixelTexGenSGIX); +#endif } diff --git a/xorg-server/hw/xquartz/GL/visualConfigs.c b/xorg-server/hw/xquartz/GL/visualConfigs.c index 81f88fb3c..fee665d1d 100644 --- a/xorg-server/hw/xquartz/GL/visualConfigs.c +++ b/xorg-server/hw/xquartz/GL/visualConfigs.c @@ -55,55 +55,54 @@ #include "capabilities.h" #include "visualConfigs.h" +#include "darwinfb.h" /* Based originally on code from indirect.c which was based on code from i830_dri.c. */ -void setVisualConfigs(void) { +__GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber) { int numConfigs = 0; - __GLXvisualConfig *visualConfigs = NULL; - void **visualPrivates = NULL; + __GLXconfig *visualConfigs, *c; struct glCapabilities caps; struct glCapabilitiesConfig *conf = NULL; int stereo, depth, aux, buffers, stencil, accum, color, msample; - int i = 0; if(getGlCapabilities(&caps)) { - ErrorF("error from getGlCapabilities()!\n"); - return; + ErrorF("error from getGlCapabilities()!\n"); + return NULL; } /* - conf->stereo is 0 or 1, but we need at least 1 iteration of the loop, - so we treat a true conf->stereo as 2. - - The depth size is 0 or 24. Thus we do 2 iterations for that. - - conf->aux_buffers (when available/non-zero) result in 2 iterations instead of 1. - - conf->buffers indicates whether we have single or double buffering. + conf->stereo is 0 or 1, but we need at least 1 iteration of the loop, + so we treat a true conf->stereo as 2. + + The depth size is 0 or 24. Thus we do 2 iterations for that. + + conf->aux_buffers (when available/non-zero) result in 2 iterations instead of 1. + + conf->buffers indicates whether we have single or double buffering. + + conf->total_stencil_bit_depths + + conf->total_color_buffers indicates the RGB/RGBA color depths. + + conf->total_accum_buffers iterations for accum (with at least 1 if equal to 0) + + conf->total_depth_buffer_depths + + conf->multisample_buffers iterations (with at least 1 if equal to 0). We add 1 + for the 0 multisampling config. - conf->total_stencil_bit_depths - - conf->total_color_buffers indicates the RGB/RGBA color depths. - - conf->total_accum_buffers iterations for accum (with at least 1 if equal to 0) - - conf->total_depth_buffer_depths - - conf->multisample_buffers iterations (with at least 1 if equal to 0). We add 1 - for the 0 multisampling config. - */ - + assert(NULL != caps.configurations); conf = caps.configurations; - + numConfigs = 0; - + for(conf = caps.configurations; conf; conf = conf->next) { - if(conf->total_color_buffers <= 0) - continue; - - numConfigs += (conf->stereo ? 2 : 1) + if(conf->total_color_buffers <= 0) + continue; + + numConfigs += (conf->stereo ? 2 : 1) * (conf->aux_buffers ? 2 : 1) * conf->buffers * ((conf->total_stencil_bit_depths > 0) ? conf->total_stencil_bit_depths : 1) @@ -112,144 +111,175 @@ void setVisualConfigs(void) { * conf->total_depth_buffer_depths * (conf->multisample_buffers + 1); } - + + if(numConfigsPtr) + *numConfigsPtr = numConfigs; + visualConfigs = xcalloc(sizeof(*visualConfigs), numConfigs); - - if(NULL == visualConfigs) { - ErrorF("xcalloc failure when allocating visualConfigs\n"); - freeGlCapabilities(&caps); - return; - } - visualPrivates = xcalloc(sizeof(void *), numConfigs); - - if(NULL == visualPrivates) { - ErrorF("xcalloc failure when allocating visualPrivates"); - freeGlCapabilities(&caps); - xfree(visualConfigs); - return; + if(NULL == visualConfigs) { + ErrorF("xcalloc failure when allocating visualConfigs\n"); + freeGlCapabilities(&caps); + return NULL; } - i = 0; /* current buffer */ + c = visualConfigs; /* current buffer */ for(conf = caps.configurations; conf; conf = conf->next) { - for(stereo = 0; stereo < (conf->stereo ? 2 : 1); ++stereo) { - for(aux = 0; aux < (conf->aux_buffers ? 2 : 1); ++aux) { - for(buffers = 0; buffers < conf->buffers; ++buffers) { - for(stencil = 0; stencil < ((conf->total_stencil_bit_depths > 0) ? - conf->total_stencil_bit_depths : 1); ++stencil) { - for(color = 0; color < conf->total_color_buffers; ++color) { - for(accum = 0; accum < ((conf->total_accum_buffers > 0) ? - conf->total_accum_buffers : 1); ++accum) { - for(depth = 0; depth < conf->total_depth_buffer_depths; ++depth) { - for(msample = 0; msample < (conf->multisample_buffers + 1); ++msample) { - visualConfigs[i].vid = (VisualID)(-1); - visualConfigs[i].class = TrueColor; - - visualConfigs[i].rgba = true; - visualConfigs[i].redSize = conf->color_buffers[color].r; - visualConfigs[i].greenSize = conf->color_buffers[color].g; - visualConfigs[i].blueSize = conf->color_buffers[color].b; + for(stereo = 0; stereo < (conf->stereo ? 2 : 1); ++stereo) { + for(aux = 0; aux < (conf->aux_buffers ? 2 : 1); ++aux) { + for(buffers = 0; buffers < conf->buffers; ++buffers) { + for(stencil = 0; stencil < ((conf->total_stencil_bit_depths > 0) ? + conf->total_stencil_bit_depths : 1); ++stencil) { + for(color = 0; color < conf->total_color_buffers; ++color) { + for(accum = 0; accum < ((conf->total_accum_buffers > 0) ? + conf->total_accum_buffers : 1); ++accum) { + for(depth = 0; depth < conf->total_depth_buffer_depths; ++depth) { + for(msample = 0; msample < (conf->multisample_buffers + 1); ++msample) { + + // Global + c->visualID = -1; + c->visualType = GLX_TRUE_COLOR; + c->next = c + 1; + + c->screen = screenNumber; + + c->level = 0; + c->indexBits = 0; + c->pixmapMode = 0; // TODO: What should this be? + + if(conf->accelerated) { + c->visualRating = GLX_NONE; + } else { + c->visualRating = GLX_SLOW_VISUAL_EXT; + } + + c->transparentPixel = GLX_NONE; + c->transparentRed = GLX_NONE; + c->transparentGreen = GLX_NONE; + c->transparentBlue = GLX_NONE; + c->transparentAlpha = GLX_NONE; + c->transparentIndex = GLX_NONE; + + c->visualSelectGroup = 0; + + c->swapMethod = GLX_SWAP_UNDEFINED_OML; + + // Stereo + c->stereoMode = stereo ? TRUE : FALSE; + + // Aux buffers + c->numAuxBuffers = aux ? conf->aux_buffers : 0; + + // Double Buffered + c->doubleBufferMode = buffers ? TRUE : FALSE; - if(GLCAPS_COLOR_BUF_INVALID_VALUE == conf->color_buffers[color].a) { - /* This visual has no alpha. */ - visualConfigs[i].alphaSize = 0; - } else { - visualConfigs[i].alphaSize = conf->color_buffers[color].a; - } - - /* - * If the .a/alpha value is unset, then don't add it to the - * bufferSize specification. The INVALID_VALUE indicates that it - * was unset. - * - * This prevents odd bufferSizes, such as 14. - */ - if(GLCAPS_COLOR_BUF_INVALID_VALUE == conf->color_buffers[color].a) { - visualConfigs[i].bufferSize = conf->color_buffers[color].r + - conf->color_buffers[color].g + conf->color_buffers[color].b; - } else { - visualConfigs[i].bufferSize = conf->color_buffers[color].r + - conf->color_buffers[color].g + conf->color_buffers[color].b + - conf->color_buffers[color].a; - } + // Stencil Buffer + if(conf->total_stencil_bit_depths > 0) { + c->stencilBits = conf->stencil_bit_depths[stencil]; + } else { + c->stencilBits = 0; + } + + // Color + if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->color_buffers[color].a) { + c->alphaBits = conf->color_buffers[color].a; + } else { + c->alphaBits = 0; + } + c->redBits = conf->color_buffers[color].r; + c->greenBits = conf->color_buffers[color].g; + c->blueBits = conf->color_buffers[color].b; + + c->rgbBits = c->alphaBits + c->redBits + c->greenBits + c->blueBits; - /* - * I'm uncertain about these masks. - * I don't think we actually care what the values are in our - * libGL, so it doesn't seem to make a difference. - */ - visualConfigs[i].redMask = -1; - visualConfigs[i].greenMask = -1; - visualConfigs[i].blueMask = -1; - visualConfigs[i].alphaMask = -1; - - if(conf->total_accum_buffers > 0) { - visualConfigs[i].accumRedSize = conf->accum_buffers[accum].r; - visualConfigs[i].accumGreenSize = conf->accum_buffers[accum].g; - visualConfigs[i].accumBlueSize = conf->accum_buffers[accum].b; - if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->accum_buffers[accum].a) { - visualConfigs[i].accumAlphaSize = conf->accum_buffers[accum].a; - } else { - visualConfigs[i].accumAlphaSize = 0; - } - } else { - visualConfigs[i].accumRedSize = 0; - visualConfigs[i].accumGreenSize = 0; - visualConfigs[i].accumBlueSize = 0; - visualConfigs[i].accumAlphaSize = 0; - } - - visualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE; - visualConfigs[i].stereo = stereo ? TRUE : FALSE; + c->alphaMask = AM_ARGB(c->alphaBits, c->redBits, c->greenBits, c->blueBits); + c->redMask = RM_ARGB(c->alphaBits, c->redBits, c->greenBits, c->blueBits); + c->greenMask = GM_ARGB(c->alphaBits, c->redBits, c->greenBits, c->blueBits); + c->blueMask = BM_ARGB(c->alphaBits, c->redBits, c->greenBits, c->blueBits); + + // Accumulation Buffers + if(conf->total_accum_buffers > 0) { + c->accumRedBits = conf->accum_buffers[accum].r; + c->accumGreenBits = conf->accum_buffers[accum].g; + c->accumBlueBits = conf->accum_buffers[accum].b; + if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->accum_buffers[accum].a) { + c->accumAlphaBits = conf->accum_buffers[accum].a; + } else { + c->accumAlphaBits = 0; + } + } else { + c->accumRedBits = 0; + c->accumGreenBits = 0; + c->accumBlueBits = 0; + c->accumAlphaBits = 0; + } - visualConfigs[i].depthSize = conf->depth_buffers[depth]; - - if(conf->total_stencil_bit_depths > 0) { - visualConfigs[i].stencilSize = conf->stencil_bit_depths[stencil]; - } else { - visualConfigs[i].stencilSize = 0; - } - visualConfigs[i].auxBuffers = aux ? conf->aux_buffers : 0; - visualConfigs[i].level = 0; - - if(conf->accelerated) { - visualConfigs[i].visualRating = GLX_NONE; - } else { - visualConfigs[i].visualRating = GLX_SLOW_VISUAL_EXT; - } - - visualConfigs[i].transparentPixel = GLX_NONE; - visualConfigs[i].transparentRed = GLX_NONE; - visualConfigs[i].transparentGreen = GLX_NONE; - visualConfigs[i].transparentBlue = GLX_NONE; - visualConfigs[i].transparentAlpha = GLX_NONE; - visualConfigs[i].transparentIndex = GLX_NONE; - - if(msample > 0) { - visualConfigs[i].multiSampleSize = conf->multisample_samples; - visualConfigs[i].nMultiSampleBuffers = conf->multisample_buffers; - } else { - visualConfigs[i].multiSampleSize = 0; - visualConfigs[i].nMultiSampleBuffers = 0; - } + // Depth + c->depthBits = conf->depth_buffers[depth]; + + // MultiSample + if(msample > 0) { + c->samples = conf->multisample_samples; + c->sampleBuffers = conf->multisample_buffers; + } else { + c->samples = 0; + c->sampleBuffers = 0; + } - ++i; - } - } - } - } - } - } - } - } + /* + * The Apple libGL supports GLXPixmaps and + * GLXPbuffers in direct mode. + */ + /* SGIX_fbconfig / GLX 1.3 */ + c->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT; + c->renderType = GLX_RGBA_BIT; + c->xRenderable = GL_TRUE; + c->fbconfigID = -1; + + /* SGIX_pbuffer / GLX 1.3 */ + + /* + * The CGL layer provides a way of retrieving + * the maximum pbuffer width/height, but only + * if we create a context and call glGetIntegerv. + * + * The following values are from a test program + * that does so. + */ + c->maxPbufferWidth = 8192; + c->maxPbufferHeight = 8192; + c->maxPbufferPixels = /*Do we need this?*/ 0; + /* + * There is no introspection for this sort of thing + * with CGL. What should we do realistically? + */ + c->optimalPbufferWidth = 0; + c->optimalPbufferHeight = 0; + + /* EXT_texture_from_pixmap */ + c->bindToTextureRgb = 0; + c->bindToTextureRgba = 0; + c->bindToMipmapTexture = 0; + c->bindToTextureTargets = 0; + c->yInverted = 0; + + c = c->next; + } + } + } + } + } + } + } + } } - if (i != numConfigs) { - ErrorF("numConfigs calculation error in setVisualConfigs! numConfigs is %d i is %d\n", numConfigs, i); - abort(); - } + (c-1)->next = NULL; + if (c - visualConfigs != numConfigs) { + FatalError("numConfigs calculation error in setVisualConfigs! numConfigs is %d i is %d\n", numConfigs, c - visualConfigs); + } + freeGlCapabilities(&caps); - - GlxSetVisualConfigs(numConfigs, visualConfigs, visualPrivates); + return visualConfigs; } diff --git a/xorg-server/hw/xquartz/GL/visualConfigs.h b/xorg-server/hw/xquartz/GL/visualConfigs.h index b9e6ae756..2e1a1b3fd 100644 --- a/xorg-server/hw/xquartz/GL/visualConfigs.h +++ b/xorg-server/hw/xquartz/GL/visualConfigs.h @@ -23,6 +23,6 @@ #ifndef VISUAL_CONFIGS_H #define VISUAL_CONFIGS_H -void setVisualConfigs(void); +__GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber); #endif diff --git a/xorg-server/hw/xquartz/Makefile.am b/xorg-server/hw/xquartz/Makefile.am index e5e2e9e37..ae8aa7f53 100644 --- a/xorg-server/hw/xquartz/Makefile.am +++ b/xorg-server/hw/xquartz/Makefile.am @@ -41,8 +41,8 @@ EXTRA_DIST = \ X11Application.h \ X11Controller.h \ applewmExt.h \ - darwinClut8.h \ darwin.h \ + darwinfb.h \ darwinEvents.h \ keysym2ucs.h \ pseudoramiX.h \ diff --git a/xorg-server/hw/xquartz/Makefile.in b/xorg-server/hw/xquartz/Makefile.in index 639385400..20c13af9b 100644 --- a/xorg-server/hw/xquartz/Makefile.in +++ b/xorg-server/hw/xquartz/Makefile.in @@ -37,8 +37,11 @@ host_triplet = @host@ subdir = hw/xquartz DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -48,7 +51,8 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) @@ -122,6 +126,7 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_MAKEFLAGS = @AM_MAKEFLAGS@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ @@ -142,9 +147,12 @@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -173,7 +181,9 @@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -182,9 +192,13 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +F77 = @F77@ +FC = @FC@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -223,12 +237,13 @@ LTCOMPILE = @LTCOMPILE@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MAKE_HTML = @MAKE_HTML@ MAKE_PDF = @MAKE_PDF@ MAKE_PS = @MAKE_PS@ MAKE_TEXT = @MAKE_TEXT@ -MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ @@ -248,7 +263,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ @@ -258,6 +272,7 @@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PROJECTROOT = @PROJECTROOT@ PS2PDF = @PS2PDF@ +Q = @Q@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ @@ -271,11 +286,10 @@ STRIP = @STRIP@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ -VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@ -VENDOR_NAME = @VENDOR_NAME@ +V = @V@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ -VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -311,6 +325,7 @@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -335,7 +350,6 @@ YFLAGS = @YFLAGS@ __XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ -abi_font = @abi_font@ abi_videodrv = @abi_videodrv@ abi_xinput = @abi_xinput@ abs_builddir = @abs_builddir@ @@ -358,6 +372,7 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ +distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ driverdir = @driverdir@ dvidir = @dvidir@ @@ -389,7 +404,9 @@ psdir = @psdir@ sbindir = @sbindir@ sdkdir = @sdkdir@ sharedstatedir = @sharedstatedir@ +shavedir = @shavedir@ srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ @@ -433,8 +450,8 @@ EXTRA_DIST = \ X11Application.h \ X11Controller.h \ applewmExt.h \ - darwinClut8.h \ darwin.h \ + darwinfb.h \ darwinEvents.h \ keysym2ucs.h \ pseudoramiX.h \ diff --git a/xorg-server/hw/xquartz/X11Application.h b/xorg-server/hw/xquartz/X11Application.h index 80aee5932..5e828a440 100644 --- a/xorg-server/hw/xquartz/X11Application.h +++ b/xorg-server/hw/xquartz/X11Application.h @@ -47,6 +47,7 @@ - (const char *) prefs_get_string:(NSString *)key default:(const char *)def; - (float) prefs_get_float:(NSString *)key default:(float)def; - (int) prefs_get_boolean:(NSString *)key default:(int)def; +- (NSURL *) prefs_copy_url:(NSString *)key default:(NSURL *)def; - (NSArray *) prefs_get_array:(NSString *)key; - (void) prefs_set_integer:(NSString *)key value:(int)value; - (void) prefs_set_float:(NSString *)key value:(float)value; @@ -55,6 +56,7 @@ - (void) prefs_set_string:(NSString *)key value:(NSString *)value; - (void) prefs_synchronize; +- (X11Controller *) controller; - (OSX_BOOL) x_active; @end @@ -95,6 +97,7 @@ extern int quartzHasRoot, quartzEnableRootless, quartzFullscreenMenu; #define PREFS_TEST_EXTENSIONS "enable_test_extensions" #define PREFS_XP_OPTIONS "xp_options" #define PREFS_LOGIN_SHELL "login_shell" +#define PREFS_UPDATE_FEED "update_feed" #define PREFS_CLICK_THROUGH "wm_click_through" #define PREFS_FFM "wm_ffm" #define PREFS_FOCUS_ON_NEW_WINDOW "wm_focus_on_new_window" diff --git a/xorg-server/hw/xquartz/X11Application.m b/xorg-server/hw/xquartz/X11Application.m index 9f4738c47..9fb192648 100644 --- a/xorg-server/hw/xquartz/X11Application.m +++ b/xorg-server/hw/xquartz/X11Application.m @@ -41,9 +41,9 @@ #include "darwinEvents.h" #include "quartzKeyboard.h" #include "quartz.h" -#define _APPLEWM_SERVER_ -#include "X11/extensions/applewm.h" +#include <X11/extensions/applewmconst.h> #include "micmap.h" +#include "exglobals.h" #include <mach/mach.h> #include <unistd.h> @@ -60,12 +60,8 @@ extern BOOL xpbproxy_init (void); #define XSERVER_VERSION "?" #endif -#define ProximityIn 0 -#define ProximityOut 1 - /* Stuck modifier / button state... force release when we context switch */ static NSEventType keyState[NUM_KEYCODES]; -static int modifierFlagsMask; int X11EnableKeyEquivalents = TRUE, quartzFullscreenMenu = FALSE; int quartzHasRoot = FALSE, quartzEnableRootless = TRUE; @@ -80,6 +76,12 @@ static KeyboardLayoutRef last_key_layout; extern int darwinFakeButtons; +/* Store the mouse location while in the background, and update X11's pointer + * location when we become the foreground application + */ +static NSPoint bgMouseLocation; +static BOOL bgMouseLocationUpdated = FALSE; + X11Application *X11App; CFStringRef app_prefs_domain_cfstr = NULL; @@ -188,6 +190,10 @@ static void message_kit_thread (SEL selector, NSObject *arg) { size_t i; DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active) if (state) { + if(bgMouseLocationUpdated) { + DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, bgMouseLocation.x, bgMouseLocation.y, 0.0, 0.0, 0.0); + bgMouseLocationUpdated = FALSE; + } DarwinSendDDXEvent(kXquartzActivate, 0); if (!_x_active) { @@ -201,7 +207,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) { } } else { - if(darwin_modifier_flags) + if(darwin_all_modifier_flags) DarwinUpdateModKeys(0); for(i=0; i < NUM_KEYCODES; i++) { if(keyState[i] == NSKeyDown) { @@ -359,7 +365,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) { if(!ok) switch_on_activate = YES; - if ([e data2] & 0x10 && switch_on_activate) + if ([e data2] & 0x10 && switch_on_activate) // 0x10 is set when we use cmd-tab or the dock icon DarwinSendDDXEvent(kXquartzBringAllToFront, 0); } break; @@ -578,6 +584,23 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) { return ret != NULL ? ret : def; } +- (NSURL *) prefs_copy_url:(NSString *)key default:(NSURL *)def { + CFPropertyListRef value; + NSURL *ret = NULL; + + value = [self prefs_get:key]; + + if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ()) { + NSString *s = (NSString *) value; + + ret = [NSURL URLWithString:s]; + } + + if (value != NULL) CFRelease (value); + + return ret != NULL ? ret : def; +} + - (float) prefs_get_float:(NSString *)key default:(float)def { CFPropertyListRef value; float ret = def; @@ -739,6 +762,14 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) { noTestExtensions = ![self prefs_get_boolean:@PREFS_TEST_EXTENSIONS default:FALSE]; + +#if XQUARTZ_SPARKLE + NSURL *url = [self prefs_copy_url:@PREFS_UPDATE_FEED default:nil]; + if(url) { + [[SUUpdater sharedUpdater] setFeedURL:url]; + CFRelease(url); + } +#endif } /* This will end up at the end of the responder chain. */ @@ -747,6 +778,10 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) { AppleWMCopyToPasteboard); } +- (X11Controller *) controller { + return _controller; +} + - (OSX_BOOL) x_active { return _x_active; } @@ -874,7 +909,6 @@ environment the next time you start X11?", @"Startup xinitrc dialog"); void X11ApplicationMain (int argc, char **argv, char **envp) { NSAutoreleasePool *pool; - int *p; #ifdef DEBUG while (access ("/tmp/x11-block", F_OK) == 0) sleep (1); @@ -919,10 +953,6 @@ void X11ApplicationMain (int argc, char **argv, char **envp) { fprintf(stderr, "X11ApplicationMain: Could not build a valid keymap.\n"); } - for(p=darwin_modifier_mask_list, modifierFlagsMask=0; *p; p++) { - modifierFlagsMask |= *p; - } - /* Tell the server thread that it can proceed */ QuartzInitServer(argc, argv, envp); @@ -933,7 +963,13 @@ void X11ApplicationMain (int argc, char **argv, char **envp) { if(!xpbproxy_init()) fprintf(stderr, "Error initializing xpbproxy\n"); - + +#if XQUARTZ_SPARKLE + [[X11App controller] setup_sparkle]; + [[SUUpdater sharedUpdater] resetUpdateCycle]; +// [[SUUpdater sharedUpdater] checkForUpdates:X11App]; +#endif + [NSApp run]; /* not reached */ } @@ -953,33 +989,49 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe #endif - (void) sendX11NSEvent:(NSEvent *)e { - NSRect screen; - NSPoint location; - NSWindow *window; + NSPoint location = NSZeroPoint, tilt = NSZeroPoint; int ev_button, ev_type; - float pointer_x, pointer_y, pressure, tilt_x, tilt_y; + float pressure = 0.0; DeviceIntPtr pDev; int modifierFlags; - - /* convert location to be relative to top-left of primary display */ - location = [e locationInWindow]; - window = [e window]; - screen = [[[NSScreen screens] objectAtIndex:0] frame]; - - if (window != nil) { - NSRect frame = [window frame]; - pointer_x = location.x + frame.origin.x; - pointer_y = (screen.origin.y + screen.size.height) - - (location.y + frame.origin.y); - } else { - pointer_x = location.x; - pointer_y = (screen.origin.y + screen.size.height) - location.y; + BOOL isMouseOrTabletEvent, isTabletEvent; + + isMouseOrTabletEvent = [e type] == NSLeftMouseDown || [e type] == NSOtherMouseDown || [e type] == NSRightMouseDown || + [e type] == NSLeftMouseUp || [e type] == NSOtherMouseUp || [e type] == NSRightMouseUp || + [e type] == NSLeftMouseDragged || [e type] == NSOtherMouseDragged || [e type] == NSRightMouseDragged || + [e type] == NSMouseMoved || [e type] == NSTabletPoint; + + isTabletEvent = ([e type] == NSTabletPoint) || + (isMouseOrTabletEvent && ([e subtype] == NSTabletPointEventSubtype || [e subtype] == NSTabletProximityEventSubtype)); + + if(isMouseOrTabletEvent) { + static NSPoint lastpt; + NSWindow *window = [e window]; + NSRect screen = [[[NSScreen screens] objectAtIndex:0] frame];; + + if (window != nil) { + NSRect frame = [window frame]; + location = [e locationInWindow]; + location.x += frame.origin.x; + location.y += frame.origin.y; + lastpt = location; + } else if(isTabletEvent) { + // NSEvents for tablets are not consistent wrt deltaXY between events, so we cannot rely on that + // Thus tablets will be subject to the warp-pointer bug worked around by the delta, but tablets + // are not normally used in cases where that bug would present itself, so this is a fair tradeoff + // <rdar://problem/7111003> deltaX and deltaY are incorrect for NSMouseMoved, NSTabletPointEventSubtype + // http://xquartz.macosforge.org/trac/ticket/288 + location = [e locationInWindow]; + lastpt = location; + } else { + location.x = lastpt.x + [e deltaX]; + location.y = lastpt.y - [e deltaY]; + lastpt = [e locationInWindow]; + } + + /* Convert coordinate system */ + location.y = (screen.origin.y + screen.size.height) - location.y; } - - /* Setup our valuators. These will range from 0 to 1 */ - pressure = 0; - tilt_x = 0; - tilt_y = 0; modifierFlags = [e modifierFlags]; @@ -993,14 +1045,14 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe modifierFlags = ensure_flag(modifierFlags, NX_ALTERNATEMASK, NX_DEVICELALTKEYMASK | NX_DEVICERALTKEYMASK, NX_DEVICELALTKEYMASK); #endif - modifierFlags &= modifierFlagsMask; + modifierFlags &= darwin_all_modifier_mask; /* We don't receive modifier key events while out of focus, and 3button * emulation mucks this up, so we need to check our modifier flag state * on every event... ugg */ - if(darwin_modifier_flags != modifierFlags) + if(darwin_all_modifier_flags != modifierFlags) DarwinUpdateModKeys(modifierFlags); switch ([e type]) { @@ -1042,46 +1094,54 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe * NSTabletProximityEventSubtype will come from NSTabletPoint * rather than NSMouseMoved. pressure = [e pressure]; - tilt_x = [e tilt].x; - tilt_y = [e tilt].y; + tilt = [e tilt]; pDev = darwinTabletCurrent; */ - DarwinSendProximityEvents([e isEnteringProximity]?ProximityIn:ProximityOut, - pointer_x, pointer_y); + DarwinSendProximityEvents([e isEnteringProximity] ? ProximityIn : ProximityOut, + location.x, location.y); } if ([e type] == NSTabletPoint || [e subtype] == NSTabletPointEventSubtype) { pressure = [e pressure]; - tilt_x = [e tilt].x; - tilt_y = [e tilt].y; + tilt = [e tilt]; pDev = darwinTabletCurrent; } + if(!quartzServerVisible && noTestExtensions) { +#if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION > 0 /* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, so we can't call xp_find_window from the Appkit thread */ -#ifdef XPLUGIN_VERSION -#if XPLUGIN_VERSION > 0 - if(!quartzServerVisible) { - xp_window_id wid; + xp_window_id wid = 0; + xp_error e; /* Sigh. Need to check that we're really over one of * our windows. (We need to receive pointer events while * not in the foreground, but we don't want to receive them * when another window is over us or we might show a tooltip) */ - - wid = 0; - - if (xp_find_window(pointer_x, pointer_y, 0, &wid) == XP_Success && - wid == 0) - return; - } -#endif + + e = xp_find_window(location.x, location.y, 0, &wid); + + if (e != XP_Success || (e == XP_Success && wid == 0)) #endif + { + bgMouseLocation = location; + bgMouseLocationUpdated = TRUE; + return; + } + } - DarwinSendPointerEvents(pDev, ev_type, ev_button, pointer_x, pointer_y, - pressure, tilt_x, tilt_y); + if(bgMouseLocationUpdated) { + if(!(ev_type == MotionNotify && ev_button == 0)) { + DarwinSendPointerEvents(pDev, MotionNotify, 0, location.x, + location.y, pressure, tilt.x, tilt.y); + } + bgMouseLocationUpdated = FALSE; + } + + DarwinSendPointerEvents(pDev, ev_type, ev_button, location.x, location.y, + pressure, tilt.x, tilt.y); break; @@ -1100,13 +1160,23 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe break; } - DarwinSendProximityEvents([e isEnteringProximity]?ProximityIn:ProximityOut, - pointer_x, pointer_y); + DarwinSendProximityEvents([e isEnteringProximity] ? ProximityIn : ProximityOut, + location.x, location.y); break; case NSScrollWheel: - DarwinSendScrollEvents([e deltaX], [e deltaY], pointer_x, pointer_y, - pressure, tilt_x, tilt_y); +#if !defined(XPLUGIN_VERSION) || XPLUGIN_VERSION == 0 + /* If we're in the background, we need to send a MotionNotify event + * first, since we aren't getting them on background mouse motion + */ + if(!quartzServerVisible && noTestExtensions) { + bgMouseLocationUpdated = FALSE; + DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, location.x, + location.y, pressure, tilt.x, tilt.y); + } +#endif + DarwinSendScrollEvents([e deltaX], [e deltaY], location.x, location.y, + pressure, tilt.x, tilt.y); break; case NSKeyDown: case NSKeyUp: diff --git a/xorg-server/hw/xquartz/X11Controller.h b/xorg-server/hw/xquartz/X11Controller.h index bb9adb1ce..a86b20f17 100644 --- a/xorg-server/hw/xquartz/X11Controller.h +++ b/xorg-server/hw/xquartz/X11Controller.h @@ -30,11 +30,31 @@ #ifndef X11CONTROLLER_H #define X11CONTROLLER_H 1 +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + #if __OBJC__ #include "sanitizedCocoa.h" #include "xpr/x-list.h" +#ifdef XQUARTZ_SPARKLE +#define BOOL OSX_BOOL +#include <Sparkle/SUUpdater.h> +#undef BOOL +#endif + +#ifndef NSINTEGER_DEFINED +#if __LP64__ || NS_BUILD_32_LIKE_64 +typedef long NSInteger; +typedef unsigned long NSUInteger; +#else +typedef int NSInteger; +typedef unsigned int NSUInteger; +#endif +#endif + @interface X11Controller : NSObject { IBOutlet NSPanel *prefs_panel; @@ -59,11 +79,19 @@ IBOutlet NSTextField *sync_text2; IBOutlet NSPopUpButton *depth; - IBOutlet NSMenuItem *x11_about_item; IBOutlet NSMenuItem *window_separator; + // window_separator is DEPRECATED due to this radar: + // <rdar://problem/7088335> NSApplication releases the separator in the Windows menu even though it's an IBOutlet + // It is kept around for localization compatability and is subject to removal "eventually" + // If it is !NULL (meaning it is in the nib), it is removed from the menu and released + + IBOutlet NSMenuItem *x11_about_item; IBOutlet NSMenuItem *dock_window_separator; IBOutlet NSMenuItem *apps_separator; IBOutlet NSMenuItem *toggle_fullscreen_item; +#ifdef XQUARTZ_SPARKLE + NSMenuItem *check_for_updates_item; // Programatically enabled +#endif IBOutlet NSMenuItem *copy_menu_item; IBOutlet NSMenu *dock_apps_menu; IBOutlet NSTableView *apps_table; @@ -72,6 +100,9 @@ NSMutableArray *table_apps; IBOutlet NSMenu *dock_menu; + + // This is where in the Windows menu we'll start (this will be the index of the separator) + NSInteger windows_menu_start; int checked_window_item; x_list *pending_apps; @@ -83,6 +114,10 @@ - (void) set_window_menu:(NSArray *)list; - (void) set_window_menu_check:(NSNumber *)n; - (void) set_apps_menu:(NSArray *)list; +#ifdef XQUARTZ_SPARKLE +- (void) setup_sparkle; +- (void) updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update; +#endif - (void) set_can_quit:(OSX_BOOL)state; - (void) server_ready; diff --git a/xorg-server/hw/xquartz/X11Controller.m b/xorg-server/hw/xquartz/X11Controller.m index adf861ca9..f58747e15 100644 --- a/xorg-server/hw/xquartz/X11Controller.m +++ b/xorg-server/hw/xquartz/X11Controller.m @@ -43,8 +43,7 @@ #include "darwin.h" #include "darwinEvents.h" #include "quartz.h" -#define _APPLEWM_SERVER_ -#include "X11/extensions/applewm.h" +#include <X11/extensions/applewmconst.h> #include "applewmExt.h" #include <stdio.h> @@ -103,7 +102,14 @@ BOOL xquartz_resetenv_display = NO; selector: @selector(apps_table_done:) name: NSWindowWillCloseNotification object: [apps_table window]]; + + // Setup data about our Windows menu + if(window_separator) { + [[window_separator menu] removeItem:window_separator]; + window_separator = nil; + } + windows_menu_start = [[X11App windowsMenu] numberOfItems]; } - (void) item_selected:sender @@ -117,17 +123,15 @@ BOOL xquartz_resetenv_display = NO; - (void) remove_window_menu { NSMenu *menu; - int first, count, i; - + int count, i; + /* Work backwards so we don't mess up the indices */ - menu = [window_separator menu]; - first = [menu indexOfItem:window_separator] + 1; + menu = [X11App windowsMenu]; count = [menu numberOfItems]; - for (i = count - 1; i >= first; i--) + for (i = count - 1; i >= windows_menu_start; i--) [menu removeItemAtIndex:i]; - menu = [dock_window_separator menu]; - count = [menu indexOfItem:dock_window_separator]; + count = [dock_menu indexOfItem:dock_window_separator]; for (i = 0; i < count; i++) [dock_menu removeItemAtIndex:0]; } @@ -138,9 +142,15 @@ BOOL xquartz_resetenv_display = NO; NSMenuItem *item; int first, count, i; - menu = [window_separator menu]; - first = [menu indexOfItem:window_separator] + 1; + menu = [X11App windowsMenu]; + first = windows_menu_start + 1; count = [list count]; + + // Push a Separator + if(count) { + [menu addItem:[NSMenuItem separatorItem]]; + } + for (i = 0; i < count; i++) { NSString *name, *shortcut; @@ -153,11 +163,7 @@ BOOL xquartz_resetenv_display = NO; item = (NSMenuItem *) [menu addItemWithTitle:name action:@selector (item_selected:) keyEquivalent:shortcut]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 [item setKeyEquivalentModifierMask:(NSUInteger) windowItemModMask]; -#else - [item setKeyEquivalentModifierMask:windowItemModMask]; -#endif [item setTarget:self]; [item setTag:i]; [item setEnabled:YES]; @@ -166,11 +172,7 @@ BOOL xquartz_resetenv_display = NO; action:@selector (item_selected:) keyEquivalent:shortcut atIndex:i]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 [item setKeyEquivalentModifierMask:(NSUInteger) windowItemModMask]; -#else - [item setKeyEquivalentModifierMask:windowItemModMask]; -#endif [item setTarget:self]; [item setTag:i]; [item setEnabled:YES]; @@ -285,8 +287,8 @@ BOOL xquartz_resetenv_display = NO; int first, count; int n = [nn intValue]; - menu = [window_separator menu]; - first = [menu indexOfItem:window_separator] + 1; + menu = [X11App windowsMenu]; + first = windows_menu_start + 1; count = [menu numberOfItems] - first; if (checked_window_item >= 0 && checked_window_item < count) @@ -312,6 +314,31 @@ BOOL xquartz_resetenv_display = NO; [self install_apps_menu:list]; } +#ifdef XQUARTZ_SPARKLE +- (void) setup_sparkle { + if(check_for_updates_item) + return; // already did it... + + NSMenu *menu = [x11_about_item menu]; + + check_for_updates_item = [menu insertItemWithTitle:NSLocalizedString(@"Check for X11 Updates...", @"Check for X11 Updates...") + action:@selector (checkForUpdates:) + keyEquivalent:@"" + atIndex:1]; + [check_for_updates_item setTarget:[SUUpdater sharedUpdater]]; + [check_for_updates_item setEnabled:YES]; + + // Set X11Controller as the delegate for the updater. + [[SUUpdater sharedUpdater] setDelegate:self]; +} + +// Sent immediately before installing the specified update. +- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update { + //[self set_can_quit:YES]; +} + +#endif + - (void) launch_client:(NSString *)filename { int child1, child2 = 0; @@ -704,9 +731,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row if (item == toggle_fullscreen_item) return !quartzEnableRootless; - else if (item == copy_menu_item) // For some reason, this isn't working... - return NO; - else if (menu == [window_separator menu] || menu == dock_menu + else if (menu == [X11App windowsMenu] || menu == dock_menu || (menu == [x11_about_item menu] && [item tag] == 42)) return (AppleWMSelectedEvents () & AppleWMControllerNotifyMask) != 0; else @@ -747,13 +772,16 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row - (void) applicationWillTerminate:(NSNotification *)aNotification { + unsigned remain; [X11App prefs_synchronize]; /* shutdown the X server, it will exit () for us. */ DarwinSendDDXEvent(kXquartzQuit, 0); /* In case it doesn't, exit anyway after a while. */ - while (sleep (10) != 0) ; + remain = 10000000; + while((remain = usleep(remain)) > 0); + exit (1); } diff --git a/xorg-server/hw/xquartz/applewm.c b/xorg-server/hw/xquartz/applewm.c index c72540ace..330bac4a4 100644 --- a/xorg-server/hw/xquartz/applewm.c +++ b/xorg-server/hw/xquartz/applewm.c @@ -33,8 +33,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "quartzCommon.h" -#define NEED_REPLIES -#define NEED_EVENTS #include "misc.h" #include "dixstruct.h" #include "globals.h" @@ -49,7 +47,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <X11/Xatom.h> #include "darwin.h" #define _APPLEWM_SERVER_ -#include "X11/extensions/applewmstr.h" +#include <X11/extensions/applewmproto.h> #include "applewmExt.h" #include "X11Application.h" @@ -139,7 +137,7 @@ AppleWMSetScreenOrigin( WindowPtr pWin ) { - long data[2]; + int32_t data[2]; data[0] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].x + darwinMainScreenX); @@ -495,6 +493,55 @@ ProcAppleWMSetWindowLevel(register ClientPtr client) } static int +ProcAppleWMSendPSN(register ClientPtr client) +{ + REQUEST(xAppleWMSendPSNReq); + int err; + + REQUEST_SIZE_MATCH(xAppleWMSendPSNReq); + + if(!appleWMProcs->SendPSN) + return BadRequest; + + err = appleWMProcs->SendPSN(stuff->psn_hi, stuff->psn_lo); + if (err != Success) { + return err; + } + + return (client->noClientException); +} + +static int +ProcAppleWMAttachTransient(register ClientPtr client) +{ + WindowPtr pWinChild, pWinParent; + REQUEST(xAppleWMAttachTransientReq); + int err; + + REQUEST_SIZE_MATCH(xAppleWMAttachTransientReq); + + if(!appleWMProcs->AttachTransient) + return BadRequest; + + if (Success != dixLookupWindow(&pWinChild, stuff->child, client, DixReadAccess)) + return BadValue; + + if(stuff->parent) { + if(Success != dixLookupWindow(&pWinParent, stuff->parent, client, DixReadAccess)) + return BadValue; + } else { + pWinParent = NULL; + } + + err = appleWMProcs->AttachTransient(pWinChild, pWinParent); + if (err != Success) { + return err; + } + + return (client->noClientException); +} + +static int ProcAppleWMSetCanQuit( register ClientPtr client ) @@ -654,6 +701,10 @@ ProcAppleWMDispatch ( return ProcAppleWMFrameHitTest(client); case X_AppleWMFrameDraw: return ProcAppleWMFrameDraw(client); + case X_AppleWMSendPSN: + return ProcAppleWMSendPSN(client); + case X_AppleWMAttachTransient: + return ProcAppleWMAttachTransient(client); default: return BadRequest; } diff --git a/xorg-server/hw/xquartz/applewmExt.h b/xorg-server/hw/xquartz/applewmExt.h index 60d49ef59..5ef8b5496 100644 --- a/xorg-server/hw/xquartz/applewmExt.h +++ b/xorg-server/hw/xquartz/applewmExt.h @@ -45,6 +45,8 @@ typedef int (*FrameDrawProc)(WindowPtr pWin, int class, unsigned int attr, const BoxRec *outer, const BoxRec *inner, unsigned int title_len, const unsigned char *title_bytes); +typedef int (*SendPSNProc)(uint32_t hi, uint32_t lo); +typedef int (*AttachTransientProc)(WindowPtr pWinChild, WindowPtr pWinParent); /* * AppleWM implementation function list @@ -56,6 +58,8 @@ typedef struct _AppleWMProcs { FrameGetRectProc FrameGetRect; FrameHitTestProc FrameHitTest; FrameDrawProc FrameDraw; + SendPSNProc SendPSN; + AttachTransientProc AttachTransient; } AppleWMProcsRec, *AppleWMProcsPtr; void AppleWMExtensionInit( diff --git a/xorg-server/hw/xquartz/bundle/Info.plist.cpp b/xorg-server/hw/xquartz/bundle/Info.plist.cpp index 47018fdf3..6d951ada8 100644 --- a/xorg-server/hw/xquartz/bundle/Info.plist.cpp +++ b/xorg-server/hw/xquartz/bundle/Info.plist.cpp @@ -19,17 +19,25 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>2.3.2</string> + <string>2.4.0</string> <key>CFBundleVersion</key> - <string>2.3.2</string> + <string>2.4.0</string> <key>CFBundleSignature</key> <string>x11a</string> <key>CSResourcesFileMapped</key> <true/> +#ifdef XQUARTZ_SPARKLE + <key>SUEnableAutomaticChecks</key> + <true/> + <key>SUPublicDSAKeyFile</key> + <string>sparkle.pem</string> + <key>SUFeedURL</key> + <string>http://xquartz.macosforge.org/downloads/sparkle/release.xml</string> +#endif <key>NSHumanReadableCopyright</key> - <string>Copyright © 2003-2009, Apple Inc. -Copyright © 2003, XFree86 Project, Inc. -Copyright © 2003-2009, X.org Foundation, Inc. + <string>© 2003-2009 Apple Inc. +© 2003 XFree86 Project, Inc. +© 2003-2009 X.org Foundation, Inc. </string> <key>NSMainNibFile</key> <string>main</string> diff --git a/xorg-server/hw/xquartz/bundle/Makefile.am b/xorg-server/hw/xquartz/bundle/Makefile.am index 963327bb9..ea02cd620 100644 --- a/xorg-server/hw/xquartz/bundle/Makefile.am +++ b/xorg-server/hw/xquartz/bundle/Makefile.am @@ -4,6 +4,10 @@ CPP_FILES_FLAGS = \ -DAPPLE_APPLICATION_ID="$(APPLE_APPLICATION_ID)" \ -DAPPLE_APPLICATION_NAME="$(APPLE_APPLICATION_NAME)" +if XQUARTZ_SPARKLE +CPP_FILES_FLAGS += -DXQUARTZ_SPARKLE +endif + install-data-hook: $(srcdir)/mk_bundke.sh $(srcdir) $(builddir) $(DESTDIR)$(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app install diff --git a/xorg-server/hw/xquartz/bundle/Makefile.in b/xorg-server/hw/xquartz/bundle/Makefile.in index ca5d994f9..b6b69c6bd 100644 --- a/xorg-server/hw/xquartz/bundle/Makefile.in +++ b/xorg-server/hw/xquartz/bundle/Makefile.in @@ -43,10 +43,14 @@ build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/cpprules.in +@XQUARTZ_SPARKLE_TRUE@am__append_1 = -DXQUARTZ_SPARKLE subdir = hw/xquartz/bundle ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -56,7 +60,8 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = @@ -90,6 +95,7 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_MAKEFLAGS = @AM_MAKEFLAGS@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ @@ -110,9 +116,12 @@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -141,7 +150,9 @@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -150,9 +161,13 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +F77 = @F77@ +FC = @FC@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -191,12 +206,13 @@ LTCOMPILE = @LTCOMPILE@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MAKE_HTML = @MAKE_HTML@ MAKE_PDF = @MAKE_PDF@ MAKE_PS = @MAKE_PS@ MAKE_TEXT = @MAKE_TEXT@ -MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ @@ -216,7 +232,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ @@ -226,6 +241,7 @@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PROJECTROOT = @PROJECTROOT@ PS2PDF = @PS2PDF@ +Q = @Q@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ @@ -239,11 +255,10 @@ STRIP = @STRIP@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ -VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@ -VENDOR_NAME = @VENDOR_NAME@ +V = @V@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ -VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -279,6 +294,7 @@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -303,7 +319,6 @@ YFLAGS = @YFLAGS@ __XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ -abi_font = @abi_font@ abi_videodrv = @abi_videodrv@ abi_xinput = @abi_xinput@ abs_builddir = @abs_builddir@ @@ -326,6 +341,7 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ +distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ driverdir = @driverdir@ dvidir = @dvidir@ @@ -357,7 +373,9 @@ psdir = @psdir@ sbindir = @sbindir@ sdkdir = @sdkdir@ sharedstatedir = @sharedstatedir@ +shavedir = @shavedir@ srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ @@ -387,10 +405,9 @@ MANDEFS = \ -DSHELL_CMD=$(SHELL_CMD) $(ARCHMANDEFS) SUFFIXES = .$(APP_MAN_SUFFIX) .man .cpp -CPP_FILES_FLAGS = \ - -DAPPLE_APPLICATION_ID="$(APPLE_APPLICATION_ID)" \ - -DAPPLE_APPLICATION_NAME="$(APPLE_APPLICATION_NAME)" - +CPP_FILES_FLAGS = -DAPPLE_APPLICATION_ID="$(APPLE_APPLICATION_ID)" \ + -DAPPLE_APPLICATION_NAME="$(APPLE_APPLICATION_NAME)" \ + $(am__append_1) noinst_PRE = Info.plist.cpp noinst_DATA = $(noinst_PRE:plist.cpp=plist) CLEANFILES = $(noinst_DATA) diff --git a/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/Localizable.strings Binary files differindex 1ff39fe67..40a843ee7 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/keyedobjects.nib Binary files differindex 95c26d7b3..9209e81fa 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/Dutch.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings Binary files differindex 001227afe..03415026e 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib b/xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib index d27162539..94d01047c 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib @@ -2,9 +2,9 @@ <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03"> <data> <int key="IBDocument.SystemTarget">1050</int> - <string key="IBDocument.SystemVersion">9G55</string> + <string key="IBDocument.SystemVersion">9L29</string> <string key="IBDocument.InterfaceBuilderVersion">677</string> - <string key="IBDocument.AppKitVersion">949.43</string> + <string key="IBDocument.AppKitVersion">949.54</string> <string key="IBDocument.HIToolboxVersion">353.00</string> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -341,17 +341,6 @@ <reference key="NSOnImage" ref="531645050"/> <reference key="NSMixedImage" ref="351811234"/> </object> - <object class="NSMenuItem" id="444952046"> - <reference key="NSMenu" ref="96874957"/> - <bool key="NSIsDisabled">YES</bool> - <bool key="NSIsSeparator">YES</bool> - <string key="NSTitle"/> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="531645050"/> - <reference key="NSMixedImage" ref="351811234"/> - </object> </object> <string key="NSName">_NSWindowsMenu</string> </object> @@ -857,7 +846,7 @@ Lg</string> <object class="NSButtonCell" key="NSCell" id="501304422"> <int key="NSCellFlags">67239424</int> <int key="NSCellFlags2">0</int> - <string key="NSContents">Update CLIPBOARD when Pasteboard changes.</string> + <string key="NSContents">Update CLIPBOARD when Pasteboard changes</string> <reference key="NSSupport" ref="463863101"/> <reference key="NSControlView" ref="477050998"/> <int key="NSButtonFlags">1211912703</int> @@ -878,7 +867,7 @@ Lg</string> <object class="NSButtonCell" key="NSCell" id="510771323"> <int key="NSCellFlags">67239424</int> <int key="NSCellFlags2">0</int> - <string key="NSContents">Update PRIMARY (middle-click) when Pasteboard changes.</string> + <string key="NSContents">Update PRIMARY (middle-click) when Pasteboard changes</string> <reference key="NSSupport" ref="463863101"/> <reference key="NSControlView" ref="765780304"/> <int key="NSButtonFlags">1211912703</int> @@ -899,7 +888,7 @@ Lg</string> <object class="NSButtonCell" key="NSCell" id="897099877"> <int key="NSCellFlags">67239424</int> <int key="NSCellFlags2">0</int> - <string key="NSContents">Update Pasteboard immediately when new text is selected.</string> + <string key="NSContents">Update Pasteboard immediately when new text is selected</string> <reference key="NSSupport" ref="463863101"/> <reference key="NSControlView" ref="1002778833"/> <int key="NSButtonFlags">1211912703</int> @@ -920,7 +909,7 @@ Lg</string> <object class="NSButtonCell" key="NSCell" id="619977658"> <int key="NSCellFlags">67239424</int> <int key="NSCellFlags2">0</int> - <string key="NSContents">Update Pasteboard when CLIPBOARD changes.</string> + <string key="NSContents">Update Pasteboard when CLIPBOARD changes</string> <reference key="NSSupport" ref="463863101"/> <reference key="NSControlView" ref="487809555"/> <int key="NSButtonFlags">1211912703</int> @@ -1955,14 +1944,6 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> - <string key="label">window_separator</string> - <reference key="source" ref="485884620"/> - <reference key="destination" ref="444952046"/> - </object> - <int key="connectionID">300331</int> - </object> - <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> <string key="label">menu</string> <reference key="source" ref="815810918"/> <reference key="destination" ref="524015605"/> @@ -2209,7 +2190,6 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string> <reference ref="1036389925"/> <reference ref="369641893"/> <reference ref="155085383"/> - <reference ref="444952046"/> <reference ref="984461797"/> <reference ref="280172320"/> </object> @@ -3014,11 +2994,6 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string> <reference key="parent" ref="492358940"/> </object> <object class="IBObjectRecord"> - <int key="objectID">300330</int> - <reference key="object" ref="444952046"/> - <reference key="parent" ref="96874957"/> - </object> - <object class="IBObjectRecord"> <int key="objectID">300337</int> <reference key="object" ref="10973343"/> <object class="NSMutableArray" key="children"> @@ -3401,8 +3376,6 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string> <string>298.ImportedFromIB2</string> <string>300295.IBPluginDependency</string> <string>300295.IBShouldRemoveOnLegacySave</string> - <string>300330.IBPluginDependency</string> - <string>300330.ImportedFromIB2</string> <string>300337.IBPluginDependency</string> <string>300337.ImportedFromIB2</string> <string>300338.IBPluginDependency</string> @@ -3638,7 +3611,7 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string> <reference ref="9"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> - <string>{{349, 858}, {315, 153}}</string> + <string>{{349, 868}, {315, 143}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> <string>{{271, 666}, {301, 153}}</string> @@ -3699,8 +3672,6 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <reference ref="9"/> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <reference ref="9"/> diff --git a/xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib Binary files differindex ee6cdf25e..fee8f1ce9 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/French.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/French.lproj/Localizable.strings Binary files differindex 2770dfb8c..1dd2e0601 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/French.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/French.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/French.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/French.lproj/main.nib/keyedobjects.nib Binary files differindex 9f9a7da67..9c65224a7 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/French.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/French.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/German.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/German.lproj/Localizable.strings Binary files differindex a5489ab5c..48c4e29c4 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/German.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/German.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/German.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/German.lproj/main.nib/keyedobjects.nib Binary files differindex 19532a9c2..1cc64172e 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/German.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/German.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/Localizable.strings Binary files differindex d05d73d44..560a1fe40 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/keyedobjects.nib Binary files differindex b6e2e1bb1..3c95f407b 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/Italian.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/Localizable.strings Binary files differindex 99821ea1f..23c1879a7 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/keyedobjects.nib Binary files differindex 523fd0856..7c96bfaec 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/Japanese.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/Localizable.strings Binary files differindex 652f432a5..156f61841 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/keyedobjects.nib Binary files differindex 029349dd0..7e584058b 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/Spanish.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/da.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/da.lproj/Localizable.strings Binary files differindex 9608a2e6b..dfe842313 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/da.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/da.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/da.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/da.lproj/main.nib/keyedobjects.nib Binary files differindex 4a2bd4bde..df8c01bf4 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/da.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/da.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/Localizable.strings Binary files differindex e8420fbaa..7135063cc 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/main.nib/keyedobjects.nib Binary files differindex b5039fd44..e444ebf40 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/fi.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/Localizable.strings Binary files differindex 56a335859..33e0da528 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/main.nib/keyedobjects.nib Binary files differindex 925945c4d..f8d3ac4b0 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/ko.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/no.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/no.lproj/Localizable.strings Binary files differindex 5157a67de..68d86fd78 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/no.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/no.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/no.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/no.lproj/main.nib/keyedobjects.nib Binary files differindex ca25327f5..562302f71 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/no.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/no.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/Localizable.strings Binary files differindex 4ae12d77f..9a709d306 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/main.nib/keyedobjects.nib Binary files differindex e9ca5404b..d9aedb230 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/pl.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/Localizable.strings Binary files differindex 23ea96847..8cd9fecef 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/main.nib/keyedobjects.nib Binary files differindex e88cccdba..3dbd44f7a 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/pt.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/Localizable.strings Binary files differindex 71c33ad14..72d22b5d6 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/keyedobjects.nib Binary files differindex a61933475..e48620b80 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/pt_PT.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/Localizable.strings Binary files differindex 3b3811234..f172a8f72 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/main.nib/keyedobjects.nib Binary files differindex 9354e0264..5e11dcc78 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/ru.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/InfoPlist.strings b/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/InfoPlist.strings Binary files differindex 655d5ff63..1522655dd 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/InfoPlist.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/InfoPlist.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/Localizable.strings Binary files differindex 796f06c21..ccd68d059 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/main.nib/keyedobjects.nib Binary files differindex bd01c2dac..897aefa80 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/sv.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/Localizable.strings Binary files differindex f88a6da4b..8be59dade 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/keyedobjects.nib Binary files differindex e36c15fb6..663ae241e 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/zh_CN.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/Localizable.strings b/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/Localizable.strings Binary files differindex f009302c2..ba09668c0 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/Localizable.strings +++ b/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/Localizable.strings diff --git a/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/keyedobjects.nib b/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/keyedobjects.nib Binary files differindex 36602c53e..12c5a14e8 100644 --- a/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/keyedobjects.nib +++ b/xorg-server/hw/xquartz/bundle/Resources/zh_TW.lproj/main.nib/keyedobjects.nib diff --git a/xorg-server/hw/xquartz/darwin.c b/xorg-server/hw/xquartz/darwin.c index f01668201..7129ac61f 100644 --- a/xorg-server/hw/xquartz/darwin.c +++ b/xorg-server/hw/xquartz/darwin.c @@ -51,6 +51,8 @@ #include "exevents.h" #include "extinit.h" +#include "xserver-properties.h" + #include <sys/types.h> #include <sys/time.h> #include <sys/syslimits.h> @@ -73,10 +75,6 @@ #include "darwinEvents.h" #include "quartzKeyboard.h" #include "quartz.h" -//#include "darwinClut8.h" - -#include "GL/visualConfigs.h" - #ifdef ENABLE_DEBUG_LOG FILE *debug_log_fp = NULL; @@ -155,10 +153,6 @@ const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]); #define XORG_RELEASE "?" #endif -void DDXRingBell(int volume, int pitch, int duration) { - // FIXME -- make some noise, yo -} - void DarwinPrintBanner(void) { @@ -183,18 +177,23 @@ static Bool DarwinSaveScreen(ScreenPtr pScreen, int on) } /* - * DarwinAddScreen + * DarwinScreenInit * This is a callback from dix during AddScreen() from InitOutput(). * Initialize the screen and communicate information about it back to dix. */ -static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv) { +static Bool DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) { int dpi; static int foundIndex = 0; Bool ret; DarwinFramebufferPtr dfb; // reset index of found screens for each server generation - if (index == 0) foundIndex = 0; + if (index == 0) { + foundIndex = 0; + + // reset the visual list + miClearVisualTypes(); + } // allocate space for private per screen storage dfb = xalloc(sizeof(DarwinFramebufferRec)); @@ -208,9 +207,6 @@ static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv) if (! ret) return FALSE; - // reset the visual list - miClearVisualTypes(); - // setup a single visual appropriate for our pixel type if(!miSetVisualTypesAndMasks(dfb->depth, dfb->visuals, dfb->bitsPerRGB, dfb->preferredCVC, dfb->redMask, @@ -221,17 +217,10 @@ static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv) // TODO: Make PseudoColor visuals not suck in TrueColor mode // if(dfb->depth > 8) // miSetVisualTypesAndMasks(8, PseudoColorMask, 8, PseudoColor, 0, 0, 0); - -#if 0 - /* - * These aren't used anymore. xpr/xprScreen.c initializes the dfb struct - * above based on the display properties. - */ if(dfb->depth > 15) - miSetVisualTypesAndMasks(15, LARGE_VISUALS, 5, TrueColor, 0x7c00, 0x03e0, 0x001f); + miSetVisualTypesAndMasks(15, TrueColorMask, 5, TrueColor, RM_ARGB(0,5,5,5), GM_ARGB(0,5,5,5), BM_ARGB(0,5,5,5)); if(dfb->depth > 24) - miSetVisualTypesAndMasks(24, LARGE_VISUALS, 8, TrueColor, 0x00ff0000, 0x0000ff00, 0x000000ff); -#endif + miSetVisualTypesAndMasks(24, TrueColorMask, 8, TrueColor, RM_ARGB(0,8,8,8), GM_ARGB(0,8,8,8), BM_ARGB(0,8,8,8)); miSetPixmapDepths(); @@ -253,29 +242,6 @@ static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv) return FALSE; } -// ErrorF("Screen type: %d, %d=%d, %d=%d, %d=%d, %x=%x=%x, %x=%x=%x, %x=%x=%x\n", pScreen->visuals->class, -// pScreen->visuals->offsetRed, dfb->bitsPerRGB * 2, -// pScreen->visuals->offsetGreen, dfb->bitsPerRGB, -// pScreen->visuals->offsetBlue, 0, -// pScreen->visuals->redMask, dfb->redMask, ((1<<dfb->bitsPerRGB)-1) << pScreen->visuals->offsetRed, -// pScreen->visuals->greenMask, dfb->greenMask, ((1<<dfb->bitsPerRGB)-1) << pScreen->visuals->offsetGreen, -// pScreen->visuals->blueMask, dfb->blueMask, ((1<<dfb->bitsPerRGB)-1) << pScreen->visuals->offsetBlue); - - // set the RGB order correctly for TrueColor -// if (dfb->bitsPerPixel > 8) { -// for (i = 0, visual = pScreen->visuals; // someday we may have more than 1 -// i < pScreen->numVisuals; i++, visual++) { -// if (visual->class == TrueColor) { -// visual->offsetRed = bitsPerRGB * 2; -// visual->offsetGreen = bitsPerRGB; -// visual->offsetBlue = 0; -// visual->redMask = ((1<<bitsPerRGB)-1) << visual->offsetRed; -// visual->greenMask = ((1<<bitsPerRGB)-1) << visual->offsetGreen; -// visual->blueMask = ((1<<bitsPerRGB)-1) << visual->offsetBlue; -// } -// } -// } - #ifdef RENDER if (! fbPictureInit(pScreen, 0, 0)) { return FALSE; @@ -300,21 +266,6 @@ static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv) return FALSE; } - /* Set the colormap to the statically defined one if we're in 8 bit - * mode and we're using a fixed color map. Essentially this translates - * to Darwin/x86 in 8-bit mode. - */ -// if(dfb->depth == 8) { -// ColormapPtr map = RootlessGetColormap (pScreen); -// for( i = 0; i < map->pVisual->ColormapEntries; i++ ) { -// Entry *ent = map->red + i; -// ErrorF("Setting lo %d -> r: %04x g: %04x b: %04x\n", i, darwinClut8[i].red, darwinClut8[i].green, darwinClut8[i].blue); -// ent->co.local.red = darwinClut8[i].red; -// ent->co.local.green = darwinClut8[i].green; -// ent->co.local.blue = darwinClut8[i].blue; -// } -// } - dixScreenOrigins[index].x = dfb->x; dixScreenOrigins[index].y = dfb->y; @@ -336,17 +287,35 @@ static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv) * DarwinMouseProc: Handle the initialization, etc. of a mouse */ static int DarwinMouseProc(DeviceIntPtr pPointer, int what) { +#define NBUTTONS 7 +#define NAXES 2 // 7 buttons: left, right, middle, then four scroll wheel "buttons" - CARD8 map[8] = {0, 1, 2, 3, 4, 5, 6, 7}; - + CARD8 map[NBUTTONS + 1] = {0, 1, 2, 3, 4, 5, 6, 7}; + Atom btn_labels[NAXES] = {0}; + Atom axes_labels[NBUTTONS] = {0}; + switch (what) { case DEVICE_INIT: pPointer->public.on = FALSE; - + + btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); + btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); + btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); + btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP); + btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN); + btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT); + btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT); + + axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); + axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); + + // Set button map. - InitPointerDeviceStruct((DevicePtr)pPointer, map, 7, + InitPointerDeviceStruct((DevicePtr)pPointer, map, NBUTTONS, + btn_labels, (PtrCtrlProcPtr)NoopDDA, - GetMotionHistorySize(), 2); + GetMotionHistorySize(), NAXES, + axes_labels); pPointer->valuator->mode = Absolute; // Relative InitAbsoluteClassDeviceStruct(pPointer); // InitValuatorAxisStruct(pPointer, 0, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); @@ -364,28 +333,43 @@ static int DarwinMouseProc(DeviceIntPtr pPointer, int what) { } return Success; +#undef NBUTTONS +#undef NAXES } static int DarwinTabletProc(DeviceIntPtr pPointer, int what) { - CARD8 map[4] = {0, 1, 2, 3}; - +#define NBUTTONS 3 +#define NAXES 5 + CARD8 map[NBUTTONS + 1] = {0, 1, 2, 3}; + Atom axes_labels[NAXES] = {0}; + Atom btn_labels[NBUTTONS] = {0}; + switch (what) { case DEVICE_INIT: pPointer->public.on = FALSE; - + + btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); + btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); + btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); + + axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X); + axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y); + // Set button map. - InitPointerDeviceStruct((DevicePtr)pPointer, map, 3, + InitPointerDeviceStruct((DevicePtr)pPointer, map, NBUTTONS, + btn_labels, (PtrCtrlProcPtr)NoopDDA, - GetMotionHistorySize(), 5); + GetMotionHistorySize(), NAXES, + axes_labels); pPointer->valuator->mode = Absolute; // Relative InitProximityClassDeviceStruct(pPointer); InitAbsoluteClassDeviceStruct(pPointer); - InitValuatorAxisStruct(pPointer, 0, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); - InitValuatorAxisStruct(pPointer, 1, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); - InitValuatorAxisStruct(pPointer, 2, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); - InitValuatorAxisStruct(pPointer, 3, -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); - InitValuatorAxisStruct(pPointer, 4, -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); + InitValuatorAxisStruct(pPointer, 0, axes_labels[0], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); + InitValuatorAxisStruct(pPointer, 1, axes_labels[1], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); + InitValuatorAxisStruct(pPointer, 2, axes_labels[2], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); + InitValuatorAxisStruct(pPointer, 3, axes_labels[3], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); + InitValuatorAxisStruct(pPointer, 4, axes_labels[4], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1); // pPointer->use = IsXExtensionDevice; break; case DEVICE_ON: @@ -399,6 +383,8 @@ static int DarwinTabletProc(DeviceIntPtr pPointer, int what) { return Success; } return Success; +#undef NBUTTONS +#undef NAXES } /* @@ -577,7 +563,7 @@ DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo) * The display mode dependent code gets called three times. The mode * specific InitOutput routines are expected to discover the number * of potentially useful screens and cache routes to them internally. - * Inside DarwinAddScreen are two other mode specific calls. + * Inside DarwinScreenInit are two other mode specific calls. * A mode specific AddScreen routine is called for each screen to * actually initialize the screen with the ScreenPtr structure. * After other screen setup has been done, a mode specific @@ -597,16 +583,12 @@ void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv ) for (i = 0; i < NUMFORMATS; i++) pScreenInfo->formats[i] = formats[i]; -#ifdef GLXEXT - setVisualConfigs(); -#endif - // Discover screens and do mode specific initialization QuartzInitOutput(argc, argv); // Add screens for (i = 0; i < darwinScreensFound; i++) { - AddScreen( DarwinAddScreen, argc, argv ); + AddScreen(DarwinScreenInit, argc, argv); } DarwinAdjustScreenOrigins(pScreenInfo); diff --git a/xorg-server/hw/xquartz/darwin.h b/xorg-server/hw/xquartz/darwin.h index 7fb9396e5..586044fba 100644 --- a/xorg-server/hw/xquartz/darwin.h +++ b/xorg-server/hw/xquartz/darwin.h @@ -36,22 +36,7 @@ #include "threadSafety.h" -typedef struct { - void *framebuffer; - int x; - int y; - int width; - int height; - int pitch; - int depth; - int visuals; - int bitsPerRGB; - int bitsPerPixel; - int preferredCVC; - Pixel redMask; - Pixel greenMask; - Pixel blueMask; -} DarwinFramebufferRec, *DarwinFramebufferPtr; +#include "darwinfb.h" // From darwin.c void DarwinPrintBanner(void); diff --git a/xorg-server/hw/xquartz/darwinEvents.c b/xorg-server/hw/xquartz/darwinEvents.c index 374c4e07e..4822af479 100644 --- a/xorg-server/hw/xquartz/darwinEvents.c +++ b/xorg-server/hw/xquartz/darwinEvents.c @@ -36,7 +36,6 @@ in this Software without prior written authorization from The Open Group. #include <dix-config.h> #endif -#define NEED_EVENTS #include <X11/X.h> #include <X11/Xmd.h> #include <X11/Xproto.h> @@ -68,14 +67,15 @@ in this Software without prior written authorization from The Open Group. #define SCROLLWHEELLEFTFAKE 6 #define SCROLLWHEELRIGHTFAKE 7 -#define _APPLEWM_SERVER_ +#include <X11/extensions/applewmconst.h> #include "applewmExt.h" -#include <X11/extensions/applewm.h> /* FIXME: Abstract this better */ void QuartzModeEQInit(void); -int darwin_modifier_flags = 0; // last known modifier state +int darwin_all_modifier_flags = 0; // last known modifier state +int darwin_all_modifier_mask = 0; +int darwin_x11_modifier_mask = 0; #define FD_ADD_MAX 128 static int fd_add[FD_ADD_MAX]; @@ -146,7 +146,7 @@ static void DarwinPressModifierKey(int pressed, int key) { * Send events to update the modifier state. */ -int darwin_modifier_mask_list[] = { +static int darwin_x11_modifier_mask_list[] = { #ifdef NX_DEVICELCMDKEYMASK NX_DEVICELCTLKEYMASK, NX_DEVICERCTLKEYMASK, NX_DEVICELSHIFTKEYMASK, NX_DEVICERSHIFTKEYMASK, @@ -159,6 +159,8 @@ int darwin_modifier_mask_list[] = { 0 }; +static int darwin_all_modifier_mask_additions[] = { NX_SECONDARYFNMASK, }; + static void DarwinUpdateModifiers( int pressed, // KeyPress or KeyRelease int flags ) // modifier flags that have changed @@ -174,7 +176,7 @@ static void DarwinUpdateModifiers( DarwinPressModifierKey(KeyRelease, NX_MODIFIERKEY_ALPHALOCK); } - for(f=darwin_modifier_mask_list; *f; f++) + for(f=darwin_x11_modifier_mask_list; *f; f++) if(*f & flags && *f != NX_ALPHASHIFTMASK) { key = DarwinModifierNXMaskToNXKey(*f); if(key == -1) @@ -307,6 +309,16 @@ static void kXquartzListenOnOpenFDHandler(int screenNum, xEventPtr xe, DeviceInt } Bool DarwinEQInit(void) { + int *p; + + for(p=darwin_x11_modifier_mask_list, darwin_all_modifier_mask=0; *p; p++) { + darwin_x11_modifier_mask |= *p; + } + + for(p=darwin_all_modifier_mask_additions, darwin_all_modifier_mask= darwin_x11_modifier_mask; *p; p++) { + darwin_all_modifier_mask |= *p; + } + mieqInit(); mieqSetHandler(kXquartzReloadKeymap, DarwinKeyboardReloadHandler); mieqSetHandler(kXquartzActivate, DarwinEventHandler); @@ -435,14 +447,14 @@ void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, floa DarwinSendPointerEvents(pDev, ButtonRelease, darwinFakeMouseButtonDown, pointer_x, pointer_y, pressure, tilt_x, tilt_y); darwinFakeMouseButtonDown=0; } - if (darwin_modifier_flags & darwinFakeMouse2Mask) { + if (darwin_all_modifier_flags & darwinFakeMouse2Mask) { ev_button = 2; darwinFakeMouseButtonDown = 2; - DarwinUpdateModKeys(darwin_modifier_flags & ~darwinFakeMouse2Mask); - } else if (darwin_modifier_flags & darwinFakeMouse3Mask) { + DarwinUpdateModKeys(darwin_all_modifier_flags & ~darwinFakeMouse2Mask); + } else if (darwin_all_modifier_flags & darwinFakeMouse3Mask) { ev_button = 3; darwinFakeMouseButtonDown = 3; - DarwinUpdateModKeys(darwin_modifier_flags & ~darwinFakeMouse3Mask); + DarwinUpdateModKeys(darwin_all_modifier_flags & ~darwinFakeMouse3Mask); } } @@ -452,9 +464,9 @@ void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, floa } if(darwinFakeMouseButtonDown == 2) { - DarwinUpdateModKeys(darwin_modifier_flags & ~darwinFakeMouse2Mask); + DarwinUpdateModKeys(darwin_all_modifier_flags & ~darwinFakeMouse2Mask); } else if(darwinFakeMouseButtonDown == 3) { - DarwinUpdateModKeys(darwin_modifier_flags & ~darwinFakeMouse3Mask); + DarwinUpdateModKeys(darwin_all_modifier_flags & ~darwinFakeMouse3Mask); } darwinFakeMouseButtonDown = 0; @@ -465,7 +477,7 @@ void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, floa num_events = GetPointerEvents(darwinEvents, pDev, ev_type, ev_button, POINTER_ABSOLUTE, 0, pDev==darwinTabletCurrent?5:2, valuators); for(i=0; i<num_events; i++) mieqEnqueue (pDev, darwinEvents[i].event); - DarwinPokeEQ(); + if(num_events > 0) DarwinPokeEQ(); } darwinEvents_unlock(); } @@ -480,7 +492,7 @@ void DarwinSendKeyboardEvents(int ev_type, int keycode) { darwinEvents_lock(); { num_events = GetKeyboardEvents(darwinEvents, darwinKeyboard, ev_type, keycode + MIN_KEYCODE); for(i=0; i<num_events; i++) mieqEnqueue(darwinKeyboard,darwinEvents[i].event); - DarwinPokeEQ(); + if(num_events > 0) DarwinPokeEQ(); } darwinEvents_unlock(); } @@ -508,7 +520,7 @@ void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y) { num_events = GetProximityEvents(darwinEvents, pDev, ev_type, 0, 5, valuators); for(i=0; i<num_events; i++) mieqEnqueue (pDev,darwinEvents[i].event); - DarwinPokeEQ(); + if(num_events > 0) DarwinPokeEQ(); } darwinEvents_unlock(); } @@ -544,9 +556,9 @@ void DarwinSendScrollEvents(float count_x, float count_y, /* Send the appropriate KeyPress/KeyRelease events to GetKeyboardEvents to reflect changing modifier flags (alt, control, meta, etc) */ void DarwinUpdateModKeys(int flags) { - DarwinUpdateModifiers(KeyRelease, darwin_modifier_flags & ~flags); - DarwinUpdateModifiers(KeyPress, ~darwin_modifier_flags & flags); - darwin_modifier_flags = flags; + DarwinUpdateModifiers(KeyRelease, darwin_all_modifier_flags & ~flags & darwin_x11_modifier_mask); + DarwinUpdateModifiers(KeyPress, ~darwin_all_modifier_flags & flags & darwin_x11_modifier_mask); + darwin_all_modifier_flags = flags; } /* @@ -574,7 +586,7 @@ void DarwinSendDDXEvent(int type, int argc, ...) { } darwinEvents_lock(); { - mieqEnqueue(darwinPointer, &xe); + mieqEnqueue(NULL, &xe); DarwinPokeEQ(); } darwinEvents_unlock(); } diff --git a/xorg-server/hw/xquartz/darwinEvents.h b/xorg-server/hw/xquartz/darwinEvents.h index 9ec3bda2f..126851422 100644 --- a/xorg-server/hw/xquartz/darwinEvents.h +++ b/xorg-server/hw/xquartz/darwinEvents.h @@ -78,7 +78,15 @@ enum { /* Send one of the above events to the server thread. */ void DarwinSendDDXEvent(int type, int argc, ...); -extern int darwin_modifier_mask_list[]; -extern int darwin_modifier_flags; +/* A mask of the modifiers that are in our X11 keyboard layout: + * (Fn for example is just useful for 3button mouse emulation) */ +extern int darwin_all_modifier_mask; + +/* A mask of the modifiers that are in our X11 keyboard layout: + * (Fn for example is just useful for 3button mouse emulation) */ +extern int darwin_x11_modifier_mask; + +/* The current state of the above listed modifiers */ +extern int darwin_all_modifier_flags; #endif /* _DARWIN_EVENTS_H */ diff --git a/xorg-server/hw/xquartz/darwinXinput.c b/xorg-server/hw/xquartz/darwinXinput.c index 59bae6fde..8af9fc740 100644 --- a/xorg-server/hw/xquartz/darwinXinput.c +++ b/xorg-server/hw/xquartz/darwinXinput.c @@ -51,7 +51,6 @@ SOFTWARE. ********************************************************/ -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif diff --git a/xorg-server/hw/xquartz/darwinfb.h b/xorg-server/hw/xquartz/darwinfb.h new file mode 100644 index 000000000..dab6d4b86 --- /dev/null +++ b/xorg-server/hw/xquartz/darwinfb.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2009 Apple, Inc. + * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in this Software without prior written authorization. + */ + +#ifndef _DARWIN_FB_H +#define _DARWIN_DB_H + +#include "scrnintstr.h" + +typedef struct { + void *framebuffer; + int x; + int y; + int width; + int height; + int pitch; + int depth; + int visuals; + int bitsPerRGB; + int bitsPerPixel; + int preferredCVC; + Pixel redMask; + Pixel greenMask; + Pixel blueMask; +} DarwinFramebufferRec, *DarwinFramebufferPtr; + +#define MASK_LH(l,h) (((1 << (1 + (h) - (l))) - 1) << (l)) +#define BM_ARGB(a,r,g,b) MASK_LH(0, (b) - 1) +#define GM_ARGB(a,r,g,b) MASK_LH(b, (b) + (g) - 1) +#define RM_ARGB(a,r,g,b) MASK_LH((b) + (g), (b) + (g) + (r) - 1) +#define AM_ARGB(a,r,g,b) MASK_LH((b) + (g) + (r), (b) + (g) + (r) + (a) - 1) + +#endif /* _DARWIN_FB_H */ diff --git a/xorg-server/hw/xquartz/doc/Makefile.in b/xorg-server/hw/xquartz/doc/Makefile.in index 7f0cc8d07..a41fd9fc2 100644 --- a/xorg-server/hw/xquartz/doc/Makefile.in +++ b/xorg-server/hw/xquartz/doc/Makefile.in @@ -42,8 +42,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/cpprules.in subdir = hw/xquartz/doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -53,7 +56,8 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = @@ -87,6 +91,7 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_MAKEFLAGS = @AM_MAKEFLAGS@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ @@ -107,9 +112,12 @@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -138,7 +146,9 @@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -147,9 +157,13 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +F77 = @F77@ +FC = @FC@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -188,12 +202,13 @@ LTCOMPILE = @LTCOMPILE@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MAKE_HTML = @MAKE_HTML@ MAKE_PDF = @MAKE_PDF@ MAKE_PS = @MAKE_PS@ MAKE_TEXT = @MAKE_TEXT@ -MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ @@ -213,7 +228,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ @@ -223,6 +237,7 @@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PROJECTROOT = @PROJECTROOT@ PS2PDF = @PS2PDF@ +Q = @Q@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ @@ -236,11 +251,10 @@ STRIP = @STRIP@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ -VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@ -VENDOR_NAME = @VENDOR_NAME@ +V = @V@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ -VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -276,6 +290,7 @@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -300,7 +315,6 @@ YFLAGS = @YFLAGS@ __XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ -abi_font = @abi_font@ abi_videodrv = @abi_videodrv@ abi_xinput = @abi_xinput@ abs_builddir = @abs_builddir@ @@ -323,6 +337,7 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ +distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ driverdir = @driverdir@ dvidir = @dvidir@ @@ -354,7 +369,9 @@ psdir = @psdir@ sbindir = @sbindir@ sdkdir = @sdkdir@ sharedstatedir = @sharedstatedir@ +shavedir = @shavedir@ srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ diff --git a/xorg-server/hw/xquartz/mach-startup/Makefile.am b/xorg-server/hw/xquartz/mach-startup/Makefile.am index b0112949d..2901b6559 100644 --- a/xorg-server/hw/xquartz/mach-startup/Makefile.am +++ b/xorg-server/hw/xquartz/mach-startup/Makefile.am @@ -19,7 +19,7 @@ X11_bin_LDADD = \ $(top_builddir)/dix/dixfonts.lo \ $(top_builddir)/miext/rootless/librootless.la \ $(top_builddir)/hw/xquartz/pbproxy/libxpbproxy.la \ - $(DARWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lXplugin + $(DARWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lXplugin X11_bin_LDFLAGS = \ -XCClinker -Objc \ @@ -39,6 +39,11 @@ X11_bin_LDFLAGS += \ -Wl,-framework,OpenGL endif +if XQUARTZ_SPARKLE +X11_bin_LDFLAGS += \ + -Wl,-framework,Sparkle +endif + if RECORD X11_bin_LDADD += \ $(top_builddir)/record/librecord.la diff --git a/xorg-server/hw/xquartz/mach-startup/Makefile.in b/xorg-server/hw/xquartz/mach-startup/Makefile.in index 20e1243a1..80720c35c 100644 --- a/xorg-server/hw/xquartz/mach-startup/Makefile.in +++ b/xorg-server/hw/xquartz/mach-startup/Makefile.in @@ -43,15 +43,21 @@ x11app_PROGRAMS = X11.bin$(EXEEXT) @GLX_TRUE@ -L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL \ @GLX_TRUE@ -Wl,-framework,OpenGL -@RECORD_TRUE@am__append_3 = \ +@XQUARTZ_SPARKLE_TRUE@am__append_3 = \ +@XQUARTZ_SPARKLE_TRUE@ -Wl,-framework,Sparkle + +@RECORD_TRUE@am__append_4 = \ @RECORD_TRUE@ $(top_builddir)/record/librecord.la bin_PROGRAMS = Xquartz$(EXEEXT) subdir = hw/xquartz/mach-startup DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -61,7 +67,8 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(x11appdir)" @@ -77,7 +84,8 @@ X11_bin_DEPENDENCIES = $(top_builddir)/hw/xquartz/libXquartz.la \ $(top_builddir)/miext/rootless/librootless.la \ $(top_builddir)/hw/xquartz/pbproxy/libxpbproxy.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__append_1) $(am__append_3) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__append_1) \ + $(am__append_4) X11_bin_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(X11_bin_LDFLAGS) \ $(LDFLAGS) -o $@ @@ -109,6 +117,7 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_MAKEFLAGS = @AM_MAKEFLAGS@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ @@ -129,9 +138,12 @@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -160,7 +172,9 @@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -169,9 +183,13 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +F77 = @F77@ +FC = @FC@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -210,12 +228,13 @@ LTCOMPILE = @LTCOMPILE@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MAKE_HTML = @MAKE_HTML@ MAKE_PDF = @MAKE_PDF@ MAKE_PS = @MAKE_PS@ MAKE_TEXT = @MAKE_TEXT@ -MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ @@ -235,7 +254,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ @@ -245,6 +263,7 @@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PROJECTROOT = @PROJECTROOT@ PS2PDF = @PS2PDF@ +Q = @Q@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ @@ -258,11 +277,10 @@ STRIP = @STRIP@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ -VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@ -VENDOR_NAME = @VENDOR_NAME@ +V = @V@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ -VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -298,6 +316,7 @@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -322,7 +341,6 @@ YFLAGS = @YFLAGS@ __XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ -abi_font = @abi_font@ abi_videodrv = @abi_videodrv@ abi_xinput = @abi_xinput@ abs_builddir = @abs_builddir@ @@ -345,6 +363,7 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ +distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ driverdir = @driverdir@ dvidir = @dvidir@ @@ -376,7 +395,9 @@ psdir = @psdir@ sbindir = @sbindir@ sdkdir = @sdkdir@ sharedstatedir = @sharedstatedir@ +shavedir = @shavedir@ srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ @@ -400,11 +421,12 @@ X11_bin_LDADD = $(top_builddir)/hw/xquartz/libXquartz.la \ $(top_builddir)/dix/dixfonts.lo \ $(top_builddir)/miext/rootless/librootless.la \ $(top_builddir)/hw/xquartz/pbproxy/libxpbproxy.la \ - $(DARWIN_LIBS) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lXplugin \ - $(am__append_1) $(am__append_3) + $(DARWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) \ + -lXplugin $(am__append_1) $(am__append_4) X11_bin_LDFLAGS = -XCClinker -Objc -Wl,-u,_miDCInitialize \ -Wl,-framework,Carbon -Wl,-framework,Cocoa \ - -Wl,-framework,CoreAudio -Wl,-framework,IOKit $(am__append_2) + -Wl,-framework,CoreAudio -Wl,-framework,IOKit $(am__append_2) \ + $(am__append_3) dist_Xquartz_SOURCES = \ stub.c \ launchd_fd.c diff --git a/xorg-server/hw/xquartz/mach-startup/bundle-main.c b/xorg-server/hw/xquartz/mach-startup/bundle-main.c index fd70f26ed..ef5d75700 100644 --- a/xorg-server/hw/xquartz/mach-startup/bundle-main.c +++ b/xorg-server/hw/xquartz/mach-startup/bundle-main.c @@ -44,6 +44,7 @@ #include <sys/un.h> #include <sys/time.h> +#include <fcntl.h> #include <mach/mach.h> #include <mach/mach_error.h> @@ -514,8 +515,43 @@ int main(int argc, char **argv, char **envp) { * thread handle it. */ if(!listenOnly) { - if(fork() == 0) { - return startup_trigger(argc, argv, envp); + pid_t child1, child2; + int status; + + /* Do the fork-twice trick to avoid having to reap zombies */ + child1 = fork(); + switch (child1) { + case -1: /* error */ + break; + + case 0: /* child1 */ + child2 = fork(); + + switch (child2) { + int max_files, i; + + case -1: /* error */ + break; + + case 0: /* child2 */ + /* close all open files except for standard streams */ + max_files = sysconf(_SC_OPEN_MAX); + for(i = 3; i < max_files; i++) + close(i); + + /* ensure stdin is on /dev/null */ + close(0); + open("/dev/null", O_RDONLY); + + return startup_trigger(argc, argv, envp); + + default: /* parent (child1) */ + _exit(0); + } + break; + + default: /* parent */ + waitpid(child1, &status, 0); } } diff --git a/xorg-server/hw/xquartz/mach-startup/stub.c b/xorg-server/hw/xquartz/mach-startup/stub.c index 893d19c8d..cee811695 100644 --- a/xorg-server/hw/xquartz/mach-startup/stub.c +++ b/xorg-server/hw/xquartz/mach-startup/stub.c @@ -101,7 +101,7 @@ static void set_x11_path() { } ver = CFBundleGetVersionNumber(bundle); - if(ver < 0x02308000) { + if( !(ver >= 0x02308000 || (ver >= 0x02168000 && ver < 0x02208000))) { CFStringRef versionStr = CFBundleGetValueForInfoDictionaryKey(bundle, kCFBundleVersionKey); const char * versionCStr = "Unknown"; @@ -110,7 +110,7 @@ static void set_x11_path() { fprintf(stderr, "Xquartz: Could not find a new enough X11.app LSFindApplicationForInfo() returned\n"); fprintf(stderr, " X11.app = %s\n", x11_path); - fprintf(stderr, " Version = %s (%x), Expected Version > 2.3.0\n", versionCStr, (unsigned)ver); + fprintf(stderr, " Version = %s (%x), Expected Version > 2.3.0 or 2.1.6\n", versionCStr, (unsigned)ver); exit(9); } @@ -222,7 +222,7 @@ int main(int argc, char **argv, char **envp) { sig_t handler; if(argc == 2 && !strcmp(argv[1], "-version")) { - fprintf(stderr, "X.org Release 7.3\n"); + fprintf(stderr, "X.org Release 7.4\n"); fprintf(stderr, "X.Org X Server %s\n", XSERVER_VERSION); fprintf(stderr, "Build Date: %s\n", BUILD_DATE); return EXIT_SUCCESS; diff --git a/xorg-server/hw/xquartz/pbproxy/Makefile.in b/xorg-server/hw/xquartz/pbproxy/Makefile.in index 12365fb16..4d029ac8a 100644 --- a/xorg-server/hw/xquartz/pbproxy/Makefile.in +++ b/xorg-server/hw/xquartz/pbproxy/Makefile.in @@ -39,8 +39,11 @@ host_triplet = @host@ subdir = hw/xquartz/pbproxy DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -50,7 +53,8 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) @@ -93,6 +97,7 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_MAKEFLAGS = @AM_MAKEFLAGS@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ @@ -113,9 +118,12 @@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -144,7 +152,9 @@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -153,9 +163,13 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +F77 = @F77@ +FC = @FC@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -194,12 +208,13 @@ LTCOMPILE = @LTCOMPILE@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MAKE_HTML = @MAKE_HTML@ MAKE_PDF = @MAKE_PDF@ MAKE_PS = @MAKE_PS@ MAKE_TEXT = @MAKE_TEXT@ -MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ @@ -219,7 +234,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ @@ -229,6 +243,7 @@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PROJECTROOT = @PROJECTROOT@ PS2PDF = @PS2PDF@ +Q = @Q@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ @@ -242,11 +257,10 @@ STRIP = @STRIP@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ -VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@ -VENDOR_NAME = @VENDOR_NAME@ +V = @V@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ -VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -282,6 +296,7 @@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -306,7 +321,6 @@ YFLAGS = @YFLAGS@ __XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ -abi_font = @abi_font@ abi_videodrv = @abi_videodrv@ abi_xinput = @abi_xinput@ abs_builddir = @abs_builddir@ @@ -329,6 +343,7 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ +distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ driverdir = @driverdir@ dvidir = @dvidir@ @@ -360,7 +375,9 @@ psdir = @psdir@ sbindir = @sbindir@ sdkdir = @sdkdir@ sharedstatedir = @sharedstatedir@ +shavedir = @shavedir@ srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ diff --git a/xorg-server/hw/xquartz/pbproxy/app-main.m b/xorg-server/hw/xquartz/pbproxy/app-main.m index cb0fa5744..d4b43c6ae 100644 --- a/xorg-server/hw/xquartz/pbproxy/app-main.m +++ b/xorg-server/hw/xquartz/pbproxy/app-main.m @@ -50,6 +50,9 @@ static void signal_handler (int sig) { } int main (int argc, const char *argv[]) { + const char *s; + int i; + #ifdef DEBUG printf("pid: %u\n", getpid()); #endif diff --git a/xorg-server/hw/xquartz/pseudoramiX.c b/xorg-server/hw/xquartz/pseudoramiX.c index f4ceff32b..1de7af6dc 100644 --- a/xorg-server/hw/xquartz/pseudoramiX.c +++ b/xorg-server/hw/xquartz/pseudoramiX.c @@ -307,7 +307,7 @@ static int ProcPseudoramiXQueryScreens(ClientPtr client) rep.type = X_Reply; rep.sequenceNumber = client->sequence; rep.number = noPseudoramiXExtension ? 0 : pseudoramiXNumScreens; - rep.length = rep.number * sz_XineramaScreenInfo >> 2; + rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo); if (client->swapped) { register int n; swaps (&rep.sequenceNumber, n); diff --git a/xorg-server/hw/xquartz/quartz.c b/xorg-server/hw/xquartz/quartz.c index 1f0b0048b..ca8b24595 100644 --- a/xorg-server/hw/xquartz/quartz.c +++ b/xorg-server/hw/xquartz/quartz.c @@ -45,7 +45,7 @@ #include "X11Application.h" -#include <X11/extensions/applewm.h> +#include <X11/extensions/applewmconst.h> #include <X11/extensions/randr.h> // X headers @@ -179,7 +179,7 @@ void QuartzInitInput( int argc, char **argv ) { - X11ApplicationSetCanQuit(1); + X11ApplicationSetCanQuit(0); X11ApplicationServerReady(); // Do final display mode specific initialization before handling events if (quartzProcs->InitInput) @@ -276,7 +276,9 @@ static void QuartzUpdateScreens(void) { pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL); //pScreen->PaintWindowBackground (pRoot, &pRoot->borderClip, PW_BACKGROUND); miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); - DefineInitialRootWindow(pRoot); + +// TODO: This is a noop in 1.6 and nuked in master... we may need to do something else now to handle it +// DefineInitialRootWindow(pRoot); DEBUG_LOG("Root Window: %dx%d @ (%d, %d) darwinMainScreen (%d, %d) xy (%d, %d) dixScreenOrigins (%d, %d)\n", width, height, x - sx, y - sy, darwinMainScreenX, darwinMainScreenY, x, y, dixScreenOrigins[pScreen->myNum].x, dixScreenOrigins[pScreen->myNum].y); @@ -350,13 +352,20 @@ void QuartzSetRootless(Bool state) { /* When in rootless, the menubar is not part of the screen, so we need to update our screens on toggle */ QuartzUpdateScreens(); - if (!quartzEnableRootless && !quartzHasRoot) { - RootlessHideAllWindows(); - } else if (quartzEnableRootless && !quartzHasRoot) { - RootlessShowAllWindows(); + if(!quartzHasRoot) { + if(!quartzEnableRootless) { + RootlessHideAllWindows(); + } else { + RootlessShowAllWindows(); + } } + X11ApplicationShowHideMenubar(!quartzHasRoot); + xp_reenable_update(); + + if (!quartzEnableRootless && quartzFullscreenDisableHotkeys) + xp_disable_hot_keys(quartzHasRoot); } /* diff --git a/xorg-server/hw/xquartz/quartzAudio.c b/xorg-server/hw/xquartz/quartzAudio.c index 21232665a..8cf241738 100644 --- a/xorg-server/hw/xquartz/quartzAudio.c +++ b/xorg-server/hw/xquartz/quartzAudio.c @@ -211,14 +211,20 @@ QuartzAudioIOProc( /* - * QuartzCoreAudioBell - * Play a tone using the CoreAudio API + * DDXRingBell + * Play a tone using the CoreAudio API */ -static void QuartzCoreAudioBell( +void DDXRingBell( int volume, // volume is % of max int pitch, // pitch is Hz int duration ) // duration is milliseconds { + if (quartzUseSysBeep) { + if (volume) + NSBeep(); + return; + } + if (quartzAudioDevice == kAudioDeviceUnknown) return; pthread_mutex_lock(&data.lock); @@ -239,7 +245,7 @@ static void QuartzCoreAudioBell( OSStatus status; status = AudioDeviceStart(quartzAudioDevice, QuartzAudioIOProc); if (status) { - ErrorF("QuartzAudioBell: AudioDeviceStart returned %ld\n", (long)status); + ErrorF("DDXRingBell: AudioDeviceStart returned %ld\n", (long)status); } else { data.playing = TRUE; } @@ -247,40 +253,6 @@ static void QuartzCoreAudioBell( pthread_mutex_unlock(&data.lock); } - -/* - * QuartzBell - * Ring the bell - */ -void QuartzBell( - int volume, // volume in percent of max - DeviceIntPtr pDevice, - pointer ctrl, - int class ) -{ - int pitch; // pitch in Hz - int duration; // duration in milliseconds - - if (class == BellFeedbackClass) { - pitch = ((BellCtrl*)ctrl)->pitch; - duration = ((BellCtrl*)ctrl)->duration; - } else if (class == KbdFeedbackClass) { - pitch = ((KeybdCtrl*)ctrl)->bell_pitch; - duration = ((KeybdCtrl*)ctrl)->bell_duration; - } else { - ErrorF("QuartzBell: bad bell class %d\n", class); - return; - } - - if (quartzUseSysBeep) { - if (volume) - NSBeep(); - } else { - QuartzCoreAudioBell(volume, pitch, duration); - } -} - - /* * QuartzAudioInit * Prepare to play the bell with the CoreAudio API diff --git a/xorg-server/hw/xquartz/quartzAudio.h b/xorg-server/hw/xquartz/quartzAudio.h index c406bbc2a..2a78b3957 100644 --- a/xorg-server/hw/xquartz/quartzAudio.h +++ b/xorg-server/hw/xquartz/quartzAudio.h @@ -32,9 +32,6 @@ #ifndef _QUARTZAUDIO_H #define _QUARTZAUDIO_H -#include "input.h" - void QuartzAudioInit(void); -void QuartzBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class); #endif diff --git a/xorg-server/hw/xquartz/quartzKeyboard.c b/xorg-server/hw/xquartz/quartzKeyboard.c index 72f94b443..4abf4af7f 100644 --- a/xorg-server/hw/xquartz/quartzKeyboard.c +++ b/xorg-server/hw/xquartz/quartzKeyboard.c @@ -68,6 +68,9 @@ #include "X11/keysym.h" #include "keysym2ucs.h" +extern void +CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master); + enum { MOD_COMMAND = 256, MOD_SHIFT = 512, @@ -148,6 +151,7 @@ const static struct { {XK_apostrophe, XK_dead_acute}, /* US:"=" on a Czech keyboard */ {XK_acute, XK_dead_acute}, {UKEYSYM (0x384), XK_dead_acute}, /* US:";" on a Greek keyboard */ +// {XK_Greek_accentdieresis, XK_dead_diaeresis}, /* US:"opt+;" on a Greek keyboard ... replace with dead_accentdieresis if there is one */ {XK_asciicircum, XK_dead_circumflex}, {UKEYSYM (0x2c6), XK_dead_circumflex}, /* MODIFIER LETTER CIRCUMFLEX ACCENT */ {XK_asciitilde, XK_dead_tilde}, @@ -276,43 +280,29 @@ static void DarwinBuildModifierMaps(darwinKeyboardInfo *info) { * Load the keyboard map from a file or system and convert * it to an equivalent X keyboard map and modifier map. */ -static void DarwinLoadKeyboardMapping(KeySymsRec *keySyms) { - pthread_mutex_lock(&keyInfo_mutex); - +static void DarwinLoadKeyboardMapping(KeySymsRec *keySyms) { DarwinBuildModifierMaps(&keyInfo); keySyms->map = keyInfo.keyMap; keySyms->mapWidth = GLYPHS_PER_KEY; keySyms->minKeyCode = MIN_KEYCODE; keySyms->maxKeyCode = MAX_KEYCODE; - - pthread_mutex_unlock(&keyInfo_mutex); } /* * DarwinKeyboardSetDeviceKeyMap * Load a keymap into the keyboard device */ -static void DarwinKeyboardSetDeviceKeyMap(KeySymsRec *keySyms) { +static void DarwinKeyboardSetDeviceKeyMap(KeySymsRec *keySyms, CARD8 *modmap) { DeviceIntPtr pDev; - /* From ProcSetModifierMapping */ - SendMappingNotify(darwinKeyboard, MappingModifier, 0, 0, serverClient); - for (pDev = inputInfo.devices; pDev; pDev = pDev->next) - if (pDev->key && pDev->coreEvents) - SendDeviceMappingNotify(serverClient, MappingModifier, 0, 0, pDev); - - /* From ProcChangeKeyboardMapping */ + pthread_mutex_lock(&keyInfo_mutex); for (pDev = inputInfo.devices; pDev; pDev = pDev->next) if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key) - assert(SetKeySymsMap(&pDev->key->curKeySyms, keySyms)); - - SendMappingNotify(darwinKeyboard, MappingKeyboard, keySyms->minKeyCode, - keySyms->maxKeyCode - keySyms->minKeyCode + 1, serverClient); - for (pDev = inputInfo.devices; pDev; pDev = pDev->next) - if (pDev->key && pDev->coreEvents) - SendDeviceMappingNotify(serverClient, MappingKeyboard, keySyms->minKeyCode, - keySyms->maxKeyCode - keySyms->minKeyCode + 1, pDev); + XkbApplyMappingChange(pDev, keySyms, keySyms->minKeyCode, + keySyms->maxKeyCode - keySyms->minKeyCode + 1, + modmap, serverClient); + pthread_mutex_unlock(&keyInfo_mutex); } /* @@ -332,16 +322,16 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) { // for a kIOHIDParamConnectType connection. assert(darwinParamConnect = NXOpenEventStatus()); - DarwinLoadKeyboardMapping(&keySyms); - bzero(&names, sizeof(names)); /* We need to really have rules... or something... */ //XkbSetRulesDflts("base", "pc105", "us", NULL, NULL); - - pthread_mutex_lock(&keyInfo_mutex); - assert(XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, keyInfo.modMap, - QuartzBell, DarwinChangeKeyboardControl)); + + InitKeyboardDeviceStruct(pDev, NULL, NULL, DarwinChangeKeyboardControl); + + pthread_mutex_lock(&keyInfo_mutex); + DarwinLoadKeyboardMapping(&keySyms); + DarwinKeyboardSetDeviceKeyMap(&keySyms, keyInfo.modMap); pthread_mutex_unlock(&keyInfo_mutex); /* Get our key repeat settings from GlobalPreferences */ @@ -363,16 +353,23 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) { XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOn); } - DarwinKeyboardSetDeviceKeyMap(&keySyms); + CopyKeyClass(pDev, inputInfo.keyboard); } void DarwinKeyboardReloadHandler(int screenNum, xEventPtr xe, DeviceIntPtr pDev, int nevents) { KeySymsRec keySyms; DEBUG_LOG("DarwinKeyboardReloadHandler\n"); +// if (pDev->key) { +// if (pDev->key->curKeySyms.map) xfree(pDev->key->curKeySyms.map); +// xfree(pDev->key); +// } + + pthread_mutex_lock(&keyInfo_mutex); DarwinLoadKeyboardMapping(&keySyms); - DarwinKeyboardSetDeviceKeyMap(&keySyms); + DarwinKeyboardSetDeviceKeyMap(&keySyms, keyInfo.modMap); + pthread_mutex_unlock(&keyInfo_mutex); } //----------------------------------------------------------------------------- @@ -408,21 +405,22 @@ int DarwinModifierNXKeyToNXKeycode(int key, int side) { int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide) { int key, side; - pthread_mutex_lock(&keyInfo_mutex); keycode += MIN_KEYCODE; + // search modifierKeycodes for this keycode+side + pthread_mutex_lock(&keyInfo_mutex); for (key = 0; key < NX_NUMMODIFIERS; key++) { for (side = 0; side <= 1; side++) { if (keyInfo.modifierKeycodes[key][side] == keycode) break; } } + pthread_mutex_unlock(&keyInfo_mutex); + if (key == NX_NUMMODIFIERS) { - pthread_mutex_unlock(&keyInfo_mutex); return -1; } if (outSide) *outSide = side; - pthread_mutex_unlock(&keyInfo_mutex); return key; } @@ -718,9 +716,8 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) { } #endif } - + if (k[3] == k[2]) k[3] = NoSymbol; - if (k[2] == k[1]) k[2] = NoSymbol; if (k[1] == k[0]) k[1] = NoSymbol; if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol; } diff --git a/xorg-server/hw/xquartz/xpr/Makefile.am b/xorg-server/hw/xquartz/xpr/Makefile.am index e74580f73..ba7b25890 100644 --- a/xorg-server/hw/xquartz/xpr/Makefile.am +++ b/xorg-server/hw/xquartz/xpr/Makefile.am @@ -9,6 +9,7 @@ AM_CPPFLAGS = \ libXquartzXpr_la_SOURCES = \ appledri.c \ dri.c \ + driWrap.c \ xprAppleWM.c \ xprCursor.c \ xprEvent.c \ @@ -20,6 +21,7 @@ libXquartzXpr_la_SOURCES = \ EXTRA_DIST = \ dri.h \ + driWrap.h \ dristruct.h \ appledri.h \ appledristr.h \ diff --git a/xorg-server/hw/xquartz/xpr/Makefile.in b/xorg-server/hw/xquartz/xpr/Makefile.in index 3eaafdd17..0137c8bed 100644 --- a/xorg-server/hw/xquartz/xpr/Makefile.in +++ b/xorg-server/hw/xquartz/xpr/Makefile.in @@ -37,8 +37,11 @@ host_triplet = @host@ subdir = hw/xquartz/xpr DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -48,14 +51,15 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h + $(top_builddir)/include/kdrive-config.h \ + $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libXquartzXpr_la_LIBADD = -am_libXquartzXpr_la_OBJECTS = appledri.lo dri.lo xprAppleWM.lo \ - xprCursor.lo xprEvent.lo xprFrame.lo xprScreen.lo x-hash.lo \ - x-hook.lo x-list.lo +am_libXquartzXpr_la_OBJECTS = appledri.lo dri.lo driWrap.lo \ + xprAppleWM.lo xprCursor.lo xprEvent.lo xprFrame.lo \ + xprScreen.lo x-hash.lo x-hook.lo x-list.lo libXquartzXpr_la_OBJECTS = $(am_libXquartzXpr_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -77,6 +81,7 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ +AM_MAKEFLAGS = @AM_MAKEFLAGS@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ @@ -97,9 +102,12 @@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CXX = @CXX@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -128,7 +136,9 @@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -137,9 +147,13 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +F77 = @F77@ +FC = @FC@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -178,12 +192,13 @@ LTCOMPILE = @LTCOMPILE@ LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAIN_LIB = @MAIN_LIB@ +MAKEFLAGS = @MAKEFLAGS@ MAKEINFO = @MAKEINFO@ MAKE_HTML = @MAKE_HTML@ MAKE_PDF = @MAKE_PDF@ MAKE_PS = @MAKE_PS@ MAKE_TEXT = @MAKE_TEXT@ -MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ @@ -203,7 +218,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ @@ -213,6 +227,7 @@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PROJECTROOT = @PROJECTROOT@ PS2PDF = @PS2PDF@ +Q = @Q@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ @@ -226,11 +241,10 @@ STRIP = @STRIP@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ -VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@ -VENDOR_NAME = @VENDOR_NAME@ +V = @V@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ -VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ +WINDRES = @WINDRES@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -266,6 +280,7 @@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ XPBPROXY_LIBS = @XPBPROXY_LIBS@ +XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -290,7 +305,6 @@ YFLAGS = @YFLAGS@ __XCONFIGFILE__ = @__XCONFIGFILE__@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ -abi_font = @abi_font@ abi_videodrv = @abi_videodrv@ abi_xinput = @abi_xinput@ abs_builddir = @abs_builddir@ @@ -313,6 +327,7 @@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ +distcleancheck_listfiles = @distcleancheck_listfiles@ docdir = @docdir@ driverdir = @driverdir@ dvidir = @dvidir@ @@ -344,7 +359,9 @@ psdir = @psdir@ sbindir = @sbindir@ sdkdir = @sdkdir@ sharedstatedir = @sharedstatedir@ +shavedir = @shavedir@ srcdir = @srcdir@ +symbol_visibility = @symbol_visibility@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ @@ -360,6 +377,7 @@ AM_CPPFLAGS = \ libXquartzXpr_la_SOURCES = \ appledri.c \ dri.c \ + driWrap.c \ xprAppleWM.c \ xprCursor.c \ xprEvent.c \ @@ -371,6 +389,7 @@ libXquartzXpr_la_SOURCES = \ EXTRA_DIST = \ dri.h \ + driWrap.h \ dristruct.h \ appledri.h \ appledristr.h \ @@ -434,6 +453,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/appledri.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driWrap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x-hash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x-hook.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x-list.Plo@am__quote@ diff --git a/xorg-server/hw/xquartz/xpr/appledri.c b/xorg-server/hw/xquartz/xpr/appledri.c index 3667c0dea..4d1a82fcc 100644 --- a/xorg-server/hw/xquartz/xpr/appledri.c +++ b/xorg-server/hw/xquartz/xpr/appledri.c @@ -2,7 +2,7 @@ Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. Copyright 2000 VA Linux Systems, Inc. -Copyright (c) 2002 Apple Computer, Inc. +Copyright (c) 2002, 2009 Apple Computer, Inc. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a @@ -39,8 +39,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <dix-config.h> #endif -#define NEED_REPLIES -#define NEED_EVENTS #include <X11/X.h> #include <X11/Xproto.h> #include "misc.h" @@ -64,6 +62,7 @@ static DISPATCH_PROC(ProcAppleDRIDispatch); static DISPATCH_PROC(SProcAppleDRIDispatch); static void AppleDRIResetProc(ExtensionEntry* extEntry); +static int ProcAppleDRICreatePixmap(ClientPtr client); static unsigned char DRIReqCode = 0; static int DRIEventBase = 0; @@ -274,6 +273,76 @@ ProcAppleDRIDestroySurface( return (client->noClientException); } +static int +ProcAppleDRICreatePixmap(ClientPtr client) +{ + REQUEST(xAppleDRICreatePixmapReq); + DrawablePtr pDrawable; + int rc; + char path[PATH_MAX]; + xAppleDRICreatePixmapReply rep; + int width, height, pitch, bpp; + void *ptr; + + REQUEST_SIZE_MATCH(xAppleDRICreatePixmapReq); + + rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0, + DixReadAccess); + + if(rc != Success) + return rc; + + if(!DRICreatePixmap(screenInfo.screens[stuff->screen], + (Drawable)stuff->drawable, + pDrawable, + path, PATH_MAX)) { + return BadValue; + } + + if(!DRIGetPixmapData(pDrawable, &width, &height, + &pitch, &bpp, &ptr)) { + return BadValue; + } + + rep.stringLength = strlen(path) + 1; + + /* No need for swapping, because this only runs if LocalClient is true. */ + rep.type = X_Reply; + rep.length = sizeof(rep) + rep.stringLength; + rep.sequenceNumber = client->sequence; + rep.width = width; + rep.height = height; + rep.pitch = pitch; + rep.bpp = bpp; + rep.size = pitch * height; + + if(sizeof(rep) != sz_xAppleDRICreatePixmapReply) + ErrorF("error sizeof(rep) is %zu\n", sizeof(rep)); + + WriteReplyToClient(client, sizeof(rep), &rep); + (void)WriteToClient(client, rep.stringLength, path); + + return (client->noClientException); +} + +static int +ProcAppleDRIDestroyPixmap(ClientPtr client) +{ + DrawablePtr pDrawable; + int rc; + REQUEST(xAppleDRIDestroyPixmapReq); + REQUEST_SIZE_MATCH(xAppleDRIDestroyPixmapReq); + + rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0, + DixReadAccess); + + if(rc != Success) + return rc; + + DRIDestroyPixmap(pDrawable); + + return (client->noClientException); +} /* dispatch */ @@ -303,6 +372,11 @@ ProcAppleDRIDispatch ( return ProcAppleDRICreateSurface(client); case X_AppleDRIDestroySurface: return ProcAppleDRIDestroySurface(client); + case X_AppleDRICreatePixmap: + return ProcAppleDRICreatePixmap(client); + case X_AppleDRIDestroyPixmap: + return ProcAppleDRIDestroyPixmap(client); + default: return BadRequest; } diff --git a/xorg-server/hw/xquartz/xpr/appledri.h b/xorg-server/hw/xquartz/xpr/appledri.h index c4e43be12..36964c6cd 100644 --- a/xorg-server/hw/xquartz/xpr/appledri.h +++ b/xorg-server/hw/xquartz/xpr/appledri.h @@ -1,8 +1,9 @@ +/* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.7 2000/12/07 20:26:02 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. Copyright 2000 VA Linux Systems, Inc. -Copyright (c) 2002 Apple Computer, Inc. +Copyright (c) 2002, 2008, 2009 Apple Computer, Inc. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a @@ -45,6 +46,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define X_AppleDRICreateSurface 2 #define X_AppleDRIDestroySurface 3 #define X_AppleDRIAuthConnection 4 +#define X_AppleDRICreateSharedBuffer 5 +#define X_AppleDRISwapBuffers 6 +#define X_AppleDRICreatePixmap 7 +#define X_AppleDRIDestroyPixmap 8 + /* Requests up to and including 18 were used in a previous version */ /* Events */ @@ -99,8 +105,19 @@ Bool XAppleDRIDestroySurface (Display *dpy, int screen, Drawable drawable); Bool XAppleDRISynchronizeSurfaces (Display *dpy); +Bool XAppleDRICreateSharedBuffer(Display *dpy, int screen, Drawable drawable, + Bool doubleSwap, char *path, size_t pathlen, + int *width, int *height); + +Bool XAppleDRISwapBuffers(Display *dpy, int screen, Drawable drawable); + +Bool XAppleDRICreatePixmap(Display *dpy, int screen, Drawable drawable, + int *width, int *height, int *pitch, int *bpp, + size_t *size, char *bufname, size_t bufnamesize); + +Bool XAppleDRIDestroyPixmap(Display *dpy, Pixmap pixmap); + _XFUNCPROTOEND #endif /* _APPLEDRI_SERVER_ */ #endif /* _APPLEDRI_H_ */ - diff --git a/xorg-server/hw/xquartz/xpr/appledristr.h b/xorg-server/hw/xquartz/xpr/appledristr.h index 8649fd329..c569719b7 100644 --- a/xorg-server/hw/xquartz/xpr/appledristr.h +++ b/xorg-server/hw/xquartz/xpr/appledristr.h @@ -2,7 +2,7 @@ Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. Copyright 2000 VA Linux Systems, Inc. -Copyright (c) 2002 Apple Computer, Inc. +Copyright (c) 2002, 2008, 2009 Apple Computer, Inc. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a @@ -153,12 +153,87 @@ typedef struct _AppleDRINotify { BYTE type; /* always eventBase + event type */ BYTE kind; CARD16 sequenceNumber B16; - Time time B32; /* time of change */ - CARD16 pad1 B16; + CARD32 time B32; /* time of change */ + CARD32 pad1 B32; CARD32 arg B32; CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; } xAppleDRINotifyEvent; -#define sz_xAppleDRINotifyEvent 20 +#define sz_xAppleDRINotifyEvent 32 + + +typedef struct { + CARD8 reqType; + CARD8 driReqType; + CARD16 length B16; + CARD32 screen B32; + CARD32 drawable B32; + BOOL doubleSwap; + CARD8 pad1, pad2, pad3; +} xAppleDRICreateSharedBufferReq; + +#define sz_xAppleDRICreateSharedBufferReq 16 + +typedef struct { + BYTE type; + BYTE data1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 stringLength B32; /* 0 on error */ + CARD32 width B32; + CARD32 height B32; + CARD32 pad1 B32; + CARD32 pad2 B32; + CARD32 pad3 B32; +} xAppleDRICreateSharedBufferReply; + +#define sz_xAppleDRICreateSharedBufferReply 32 + +typedef struct { + CARD8 reqType; + CARD8 driReqType; + CARD16 length B16; + CARD32 screen B32; + CARD32 drawable B32; +} xAppleDRISwapBuffersReq; + +#define sz_xAppleDRISwapBuffersReq 12 + +typedef struct { + CARD8 reqType; /*1*/ + CARD8 driReqType; /*2*/ + CARD16 length B16; /*4*/ + CARD32 screen B32; /*8*/ + CARD32 drawable B32; /*12*/ +} xAppleDRICreatePixmapReq; + +#define sz_xAppleDRICreatePixmapReq 12 + +typedef struct { + BYTE type; /*1*/ + BOOL pad1; /*2*/ + CARD16 sequenceNumber B16; /*4*/ + CARD32 length B32; /*8*/ + CARD32 width B32; /*12*/ + CARD32 height B32; /*16*/ + CARD32 pitch B32; /*20*/ + CARD32 bpp B32; /*24*/ + CARD32 size B32; /*28*/ + CARD32 stringLength B32; /*32*/ +} xAppleDRICreatePixmapReply; + +#define sz_xAppleDRICreatePixmapReply 32 + +typedef struct { + CARD8 reqType; /*1*/ + CARD8 driReqType; /*2*/ + CARD16 length B16; /*4*/ + CARD32 drawable B32; /*8*/ +} xAppleDRIDestroyPixmapReq; + +#define sz_xAppleDRIDestroyPixmapReq 8 #ifdef _APPLEDRI_SERVER_ diff --git a/xorg-server/hw/xquartz/xpr/dri.c b/xorg-server/hw/xquartz/xpr/dri.c index 50b478b9c..f570bee5d 100644 --- a/xorg-server/hw/xquartz/xpr/dri.c +++ b/xorg-server/hw/xquartz/xpr/dri.c @@ -2,7 +2,7 @@ Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. Copyright 2000 VA Linux Systems, Inc. -Copyright (c) 2002 Apple Computer, Inc. +Copyright (c) 2002, 2009 Apple Computer, Inc. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a @@ -46,10 +46,12 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <unistd.h> #endif -#define NEED_REPLIES -#define NEED_EVENTS #include <X11/X.h> #include <X11/Xproto.h> +#include <fcntl.h> +#include <sys/mman.h> +#include <sys/types.h> +#include <sys/stat.h> #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" @@ -68,6 +70,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "rootless.h" #include "x-hash.h" #include "x-hook.h" +#include "driWrap.h" #include <AvailabilityMacros.h> @@ -77,11 +80,15 @@ static int DRIWindowPrivKeyIndex; static DevPrivateKey DRIWindowPrivKey = &DRIWindowPrivKeyIndex; static int DRIPixmapPrivKeyIndex; static DevPrivateKey DRIPixmapPrivKey = &DRIPixmapPrivKeyIndex; +static int DRIPixmapBufferPrivKeyIndex; +static DevPrivateKey DRIPixmapBufferPrivKey = &DRIPixmapBufferPrivKeyIndex; static RESTYPE DRIDrawablePrivResType; static x_hash_table *surface_hash; /* maps surface ids -> drawablePrivs */ +static Bool DRIFreePixmapImp(DrawablePtr pDrawable); + /* FIXME: don't hardcode this? */ #define CG_INFO_FILE "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Resources/Info-macos.plist" @@ -90,6 +97,18 @@ static x_hash_table *surface_hash; /* maps surface ids -> drawablePrivs */ #define CG_REQUIRED_MINOR 157 #define CG_REQUIRED_MICRO 11 +typedef struct { + DrawablePtr pDrawable; + int refCount; + int bytesPerPixel; + int width; + int height; + char shmPath[PATH_MAX]; + int fd; /* From shm_open (for now) */ + size_t length; /* length of buffer */ + void *buffer; +} DRIPixmapBuffer, *DRIPixmapBufferPtr; + /* Returns version as major.minor.micro in 10.10.10 fixed form */ static unsigned int get_cg_version (void) @@ -241,7 +260,7 @@ DRIFinishScreenInit(ScreenPtr pScreen) // ErrorF("[DRI] screen %d installation complete\n", pScreen->myNum); - return TRUE; + return DRIWrapInit(pScreen); } void @@ -408,7 +427,7 @@ CreateSurfaceForWindow(ScreenPtr pScreen, WindowPtr pWin, xp_window_id *widPtr) return pDRIDrawablePriv; } -/* Return FALSE if an error occurs. */ +/* Return NULL if an error occurs. */ static DRIDrawablePrivPtr CreateSurfaceForPixmap(ScreenPtr pScreen, PixmapPtr pPix) { DRIDrawablePrivPtr pDRIDrawablePriv; @@ -417,7 +436,6 @@ CreateSurfaceForPixmap(ScreenPtr pScreen, PixmapPtr pPix) { if (pDRIDrawablePriv == NULL) { xp_error err; - xp_window_changes wc; /* allocate a DRI Window Private record */ if (!(pDRIDrawablePriv = xcalloc(1, sizeof(*pDRIDrawablePriv)))) { @@ -439,18 +457,10 @@ CreateSurfaceForPixmap(ScreenPtr pScreen, PixmapPtr pPix) { return NULL; } - wc.x = 0; - wc.y = 0; - wc.width = pPix->drawable.width; - wc.height = pPix->drawable.height; - - err = xp_configure_surface(pDRIDrawablePriv->sid, XP_BOUNDS, &wc); - - if(err != Success) { - xp_destroy_surface(pDRIDrawablePriv->sid); - xfree(pDRIDrawablePriv); - return NULL; - } + /* + * The DRIUpdateSurface will be called to resize the surface + * after this function, if the export is successful. + */ /* save private off of preallocated index */ dixSetPrivate(&pPix->devPrivates, DRIPixmapPrivKey, @@ -491,21 +501,39 @@ DRICreateSurface(ScreenPtr pScreen, Drawable id, /* NOT_DONE */ return FALSE; } - - + /* Finish initialization of new surfaces */ if (pDRIDrawablePriv->refCount == 0) { unsigned int key[2] = {0}; xp_error err; /* try to give the client access to the surface */ - if (client_id != 0 && wid != 0) { + if (client_id != 0) { + /* + * Xplugin accepts a 0 wid if the surface id is offscreen, such + * as for a pixmap. + */ err = xp_export_surface(wid, pDRIDrawablePriv->sid, client_id, key); if (err != Success) { xp_destroy_surface(pDRIDrawablePriv->sid); xfree(pDRIDrawablePriv); + + /* + * Now set the dix privates to NULL that were previously set. + * This prevents reusing an invalid pointer. + */ + if(pDrawable->type == DRAWABLE_WINDOW) { + WindowPtr pWin = (WindowPtr)pDrawable; + + dixSetPrivate(&pWin->devPrivates, DRIWindowPrivKey, NULL); + } else if(pDrawable->type == DRAWABLE_PIXMAP) { + PixmapPtr pPix = (PixmapPtr)pDrawable; + + dixSetPrivate(&pPix->devPrivates, DRIPixmapPrivKey, NULL); + } + return FALSE; } } @@ -591,8 +619,9 @@ DRIDrawablePrivDelete(pointer pResource, XID id) pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix); } - if (pDRIDrawablePriv == NULL) - return FALSE; + if (pDRIDrawablePriv == NULL) { + return DRIFreePixmapImp(pDrawable); + } if (pDRIDrawablePriv->drawableIndex != -1) { /* release drawable table entry */ @@ -785,3 +814,139 @@ DRISurfaceNotify(xp_surface_id id, int kind) DRIDrawablePrivResType, FALSE); } } + +Bool DRICreatePixmap(ScreenPtr pScreen, Drawable id, + DrawablePtr pDrawable, char *path, + size_t pathmax) +{ + DRIPixmapBufferPtr shared; + PixmapPtr pPix; + + if(pDrawable->type != DRAWABLE_PIXMAP) + return FALSE; + + pPix = (PixmapPtr)pDrawable; + + shared = xalloc(sizeof(*shared)); + if(NULL == shared) { + FatalError("failed to allocate DRIPixmapBuffer in %s\n", __func__); + } + + shared->pDrawable = pDrawable; + shared->refCount = 1; + + if(pDrawable->bitsPerPixel >= 24) { + shared->bytesPerPixel = 4; + } else if(pDrawable->bitsPerPixel <= 16) { + shared->bytesPerPixel = 2; + } + + shared->width = pDrawable->width; + shared->height = pDrawable->height; + + if(-1 == snprintf(shared->shmPath, sizeof(shared->shmPath), + "%d_0x%lx", getpid(), + (unsigned long)id)) { + FatalError("buffer overflow in %s\n", __func__); + } + + shared->fd = shm_open(shared->shmPath, + O_RDWR | O_EXCL | O_CREAT, + S_IRUSR | S_IWUSR | S_IROTH | S_IWOTH); + + if(-1 == shared->fd) { + xfree(shared); + return FALSE; + } + + shared->length = shared->width * shared->height * shared->bytesPerPixel; + + if(-1 == ftruncate(shared->fd, shared->length)) { + ErrorF("failed to ftruncate (extend) file."); + shm_unlink(shared->shmPath); + close(shared->fd); + xfree(shared); + return FALSE; + } + + shared->buffer = mmap(NULL, shared->length, + PROT_READ | PROT_WRITE, + MAP_FILE | MAP_SHARED, shared->fd, 0); + + if(MAP_FAILED == shared->buffer) { + ErrorF("failed to mmap shared memory."); + shm_unlink(shared->shmPath); + close(shared->fd); + xfree(shared); + return FALSE; + } + + strncpy(path, shared->shmPath, pathmax); + path[pathmax - 1] = '\0'; + + dixSetPrivate(&pPix->devPrivates, DRIPixmapBufferPrivKey, shared); + + AddResource(id, DRIDrawablePrivResType, (pointer)pDrawable); + + return TRUE; +} + + +Bool DRIGetPixmapData(DrawablePtr pDrawable, int *width, int *height, + int *pitch, int *bpp, void **ptr) { + PixmapPtr pPix; + DRIPixmapBufferPtr shared; + + if(pDrawable->type != DRAWABLE_PIXMAP) + return FALSE; + + pPix = (PixmapPtr)pDrawable; + + shared = dixLookupPrivate(&pPix->devPrivates, DRIPixmapBufferPrivKey); + + if(NULL == shared) + return FALSE; + + assert(pDrawable->width == shared->width); + assert(pDrawable->height == shared->height); + + *width = shared->width; + *height = shared->height; + *bpp = shared->bytesPerPixel; + *pitch = shared->width * shared->bytesPerPixel; + *ptr = shared->buffer; + + return TRUE; +} + +static Bool +DRIFreePixmapImp(DrawablePtr pDrawable) { + DRIPixmapBufferPtr shared; + PixmapPtr pPix; + + if(pDrawable->type != DRAWABLE_PIXMAP) + return FALSE; + + pPix = (PixmapPtr)pDrawable; + + shared = dixLookupPrivate(&pPix->devPrivates, DRIPixmapBufferPrivKey); + + if(NULL == shared) + return FALSE; + + close(shared->fd); + munmap(shared->buffer, shared->length); + shm_unlink(shared->shmPath); + xfree(shared); + + dixSetPrivate(&pPix->devPrivates, DRIPixmapBufferPrivKey, (pointer)NULL); + + return TRUE; +} + +void +DRIDestroyPixmap(DrawablePtr pDrawable) { + if(DRIFreePixmapImp(pDrawable)) + FreeResourceByType(pDrawable->id, DRIDrawablePrivResType, FALSE); + +} diff --git a/xorg-server/hw/xquartz/xpr/dri.h b/xorg-server/hw/xquartz/xpr/dri.h index 8bb2e9e80..48fea3668 100644 --- a/xorg-server/hw/xquartz/xpr/dri.h +++ b/xorg-server/hw/xquartz/xpr/dri.h @@ -1,7 +1,7 @@ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -Copyright (c) 2002 Apple Computer, Inc. +Copyright (c) 2002, 2009 Apple Computer, Inc. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a @@ -125,4 +125,14 @@ extern void DRIQueryVersion(int *majorVersion, int *minorVersion, int *patchVersion); +extern Bool DRICreatePixmap(ScreenPtr pScreen, Drawable id, + DrawablePtr pDrawable, char *path, + size_t pathmax); + +extern Bool DRIGetPixmapData(DrawablePtr pDrawable, int *width, int *height, + int *pitch, int *bpp, void **ptr); + + +extern void DRIDestroyPixmap(DrawablePtr pDrawable); + #endif diff --git a/xorg-server/hw/xquartz/xpr/driWrap.c b/xorg-server/hw/xquartz/xpr/driWrap.c new file mode 100644 index 000000000..8c57fd4bd --- /dev/null +++ b/xorg-server/hw/xquartz/xpr/driWrap.c @@ -0,0 +1,547 @@ +/* +Copyright (c) 2009 Apple Computer, Inc. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include <stddef.h> +#include "mi.h" +#include "scrnintstr.h" +#include "gcstruct.h" +#include "pixmapstr.h" +#include "windowstr.h" +#include "dixfontstr.h" +#include "mivalidate.h" +#include "driWrap.h" +#include "dri.h" + +#include <OpenGL/OpenGL.h> + +typedef struct { + GCOps *originalOps; + GCOps *driOps; +} DRIGCRec; + +typedef struct { + GCOps *originalOps; + CreateGCProcPtr CreateGC; +} DRIWrapScreenRec; + +typedef struct { + Bool didSave; + int devKind; + DevUnion devPrivate; +} DRISavedDrawableState; + +static int driGCKeyIndex; +static DevPrivateKey driGCKey = &driGCKeyIndex; + +static int driWrapScreenKeyIndex; +static DevPrivateKey driWrapScreenKey = &driWrapScreenKeyIndex; + +static GCOps driGCOps; + +#define wrap(priv, real, member, func) { \ + priv->member = real->member; \ + real->member = func; \ + } + +#define unwrap(priv, real, member) { \ + real->member = priv->member; \ + } + +static DRIGCRec * +DRIGetGCPriv(GCPtr pGC) { + return dixLookupPrivate(&pGC->devPrivates, driGCKey); +} + +static void +DRIUnwrapGC(GCPtr pGC) { + DRIGCRec *pGCPriv = DRIGetGCPriv(pGC); + + pGC->ops = pGCPriv->originalOps; +} + +static void +DRIWrapGC(GCPtr pGC) { + DRIGCRec *pGCPriv = DRIGetGCPriv(pGC); + + pGC->ops = pGCPriv->driOps; +} + +static void +DRISurfaceSetDrawable(DrawablePtr pDraw, + DRISavedDrawableState *saved) { + saved->didSave = FALSE; + + if(pDraw->type == DRAWABLE_PIXMAP) { + int pitch, width, height, bpp; + void *buffer; + + if(DRIGetPixmapData(pDraw, &width, &height, &pitch, &bpp, &buffer)) { + PixmapPtr pPix = (PixmapPtr)pDraw; + + saved->devKind = pPix->devKind; + saved->devPrivate.ptr = pPix->devPrivate.ptr; + saved->didSave = TRUE; + + pPix->devKind = pitch; + pPix->devPrivate.ptr = buffer; + } + } +} + +static void +DRISurfaceRestoreDrawable(DrawablePtr pDraw, + DRISavedDrawableState *saved) { + PixmapPtr pPix = (PixmapPtr)pDraw; + + if(!saved->didSave) + return; + + pPix->devKind = saved->devKind; + pPix->devPrivate.ptr = saved->devPrivate.ptr; +} + +static void +DRIFillSpans(DrawablePtr dst, GCPtr pGC, int nInit, + DDXPointPtr pptInit, int *pwidthInit, + int sorted) { + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + pGC->ops->FillSpans(dst, pGC, nInit, pptInit, pwidthInit, sorted); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); +} + +static void +DRISetSpans(DrawablePtr dst, GCPtr pGC, char *pSrc, + DDXPointPtr pptInit, int *pwidthInit, + int nspans, int sorted) { + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + pGC->ops->SetSpans(dst, pGC, pSrc, pptInit, pwidthInit, nspans, sorted); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); +} + +static void +DRIPutImage(DrawablePtr dst, GCPtr pGC, + int depth, int x, int y, int w, int h, + int leftPad, int format, char *pBits) { + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + pGC->ops->PutImage(dst, pGC, depth, x, y, w, h, leftPad, format, pBits); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); +} + +static RegionPtr +DRICopyArea(DrawablePtr pSrc, DrawablePtr dst, GCPtr pGC, + int srcx, int srcy, int w, int h, + int dstx, int dsty) { + RegionPtr pReg; + DRISavedDrawableState pSrcSaved, dstSaved; + + DRISurfaceSetDrawable(pSrc, &pSrcSaved); + DRISurfaceSetDrawable(dst, &dstSaved); + + DRIUnwrapGC(pGC); + + pReg = pGC->ops->CopyArea(pSrc, dst, pGC, srcx, srcy, w, h, dstx, dsty); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(pSrc, &pSrcSaved); + DRISurfaceRestoreDrawable(dst, &dstSaved); + + return pReg; +} + +static RegionPtr +DRICopyPlane(DrawablePtr pSrc, DrawablePtr dst, + GCPtr pGC, int srcx, int srcy, + int w, int h, int dstx, int dsty, + unsigned long plane) { + RegionPtr pReg; + DRISavedDrawableState pSrcSaved, dstSaved; + + DRISurfaceSetDrawable(pSrc, &pSrcSaved); + DRISurfaceSetDrawable(dst, &dstSaved); + + + DRIUnwrapGC(pGC); + + pReg = pGC->ops->CopyPlane(pSrc, dst, pGC, srcx, srcy, w, h, dstx, dsty, + plane); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(pSrc, &pSrcSaved); + DRISurfaceRestoreDrawable(dst, &dstSaved); + + return pReg; +} + +static void +DRIPolyPoint(DrawablePtr dst, GCPtr pGC, + int mode, int npt, DDXPointPtr pptInit) { + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + pGC->ops->PolyPoint(dst, pGC, mode, npt, pptInit); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); +} + +static void +DRIPolylines(DrawablePtr dst, GCPtr pGC, + int mode, int npt, DDXPointPtr pptInit) { + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + pGC->ops->Polylines(dst, pGC, mode, npt, pptInit); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); +} + +static void +DRIPolySegment(DrawablePtr dst, GCPtr pGC, + int nseg, xSegment *pSeg) { + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + pGC->ops->PolySegment(dst, pGC, nseg, pSeg); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); +} + +static void +DRIPolyRectangle(DrawablePtr dst, GCPtr pGC, + int nRects, xRectangle *pRects) { + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + pGC->ops->PolyRectangle(dst, pGC, nRects, pRects); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); +} +static void +DRIPolyArc(DrawablePtr dst, GCPtr pGC, int narcs, xArc *parcs) { + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + pGC->ops->PolyArc(dst, pGC, narcs, parcs); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); +} + +static void +DRIFillPolygon(DrawablePtr dst, GCPtr pGC, + int shape, int mode, int count, + DDXPointPtr pptInit) { + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + pGC->ops->FillPolygon(dst, pGC, shape, mode, count, pptInit); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); +} + +static void +DRIPolyFillRect(DrawablePtr dst, GCPtr pGC, + int nRectsInit, xRectangle *pRectsInit) { + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + pGC->ops->PolyFillRect(dst, pGC, nRectsInit, pRectsInit); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); +} + +static void +DRIPolyFillArc(DrawablePtr dst, GCPtr pGC, + int narcsInit, xArc *parcsInit) { + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + pGC->ops->PolyFillArc(dst, pGC, narcsInit, parcsInit); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); +} + +static int +DRIPolyText8(DrawablePtr dst, GCPtr pGC, + int x, int y, int count, char *chars) { + int ret; + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + ret = pGC->ops->PolyText8(dst, pGC, x, y, count, chars); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); + + return ret; +} + +static int +DRIPolyText16(DrawablePtr dst, GCPtr pGC, + int x, int y, int count, unsigned short *chars) { + int ret; + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + ret = pGC->ops->PolyText16(dst, pGC, x, y, count, chars); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); + + return ret; +} + +static void +DRIImageText8(DrawablePtr dst, GCPtr pGC, + int x, int y, int count, char *chars) { + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + pGC->ops->ImageText8(dst, pGC, x, y, count, chars); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); +} + +static void +DRIImageText16(DrawablePtr dst, GCPtr pGC, + int x, int y, int count, unsigned short *chars) { + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + pGC->ops->ImageText16(dst, pGC, x, y, count, chars); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); +} + +static void +DRIImageGlyphBlt(DrawablePtr dst, GCPtr pGC, + int x, int y, unsigned int nglyphInit, + CharInfoPtr *ppciInit, pointer unused) { + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + pGC->ops->ImageGlyphBlt(dst, pGC, x, y, nglyphInit, ppciInit, unused); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); +} + +static void DRIPolyGlyphBlt(DrawablePtr dst, GCPtr pGC, + int x, int y, unsigned int nglyph, + CharInfoPtr *ppci, pointer pglyphBase) { + DRISavedDrawableState saved; + + DRISurfaceSetDrawable(dst, &saved); + + DRIUnwrapGC(pGC); + + pGC->ops->PolyGlyphBlt(dst, pGC, x, y, nglyph, ppci, pglyphBase); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(dst, &saved); +} + +static void +DRIPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr dst, + int dx, int dy, int xOrg, int yOrg) { + DRISavedDrawableState bitMapSaved, dstSaved; + + DRISurfaceSetDrawable(&pBitMap->drawable, &bitMapSaved); + DRISurfaceSetDrawable(dst, &dstSaved); + + DRIUnwrapGC(pGC); + + pGC->ops->PushPixels(pGC, pBitMap, dst, dx, dy, xOrg, yOrg); + + DRIWrapGC(pGC); + + DRISurfaceRestoreDrawable(&pBitMap->drawable, &bitMapSaved); + DRISurfaceRestoreDrawable(dst, &dstSaved); +} + + +static GCOps driGCOps = { + DRIFillSpans, + DRISetSpans, + DRIPutImage, + DRICopyArea, + DRICopyPlane, + DRIPolyPoint, + DRIPolylines, + DRIPolySegment, + DRIPolyRectangle, + DRIPolyArc, + DRIFillPolygon, + DRIPolyFillRect, + DRIPolyFillArc, + DRIPolyText8, + DRIPolyText16, + DRIImageText8, + DRIImageText16, + DRIImageGlyphBlt, + DRIPolyGlyphBlt, + DRIPushPixels +}; + + +static Bool +DRICreateGC(GCPtr pGC) { + ScreenPtr pScreen = pGC->pScreen; + DRIWrapScreenRec *pScreenPriv; + DRIGCRec *pGCPriv; + Bool ret; + + pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, driWrapScreenKey); + + pGCPriv = DRIGetGCPriv(pGC); + + unwrap(pScreenPriv, pScreen, CreateGC); + ret = pScreen->CreateGC(pGC); + + if(ret) { + pGCPriv->originalOps = pGC->ops; + pGC->ops = &driGCOps; + pGCPriv->driOps = &driGCOps; + } + + wrap(pScreenPriv, pScreen, CreateGC, DRICreateGC); + + return ret; +} + + +/* Return false if an error occurred. */ +Bool +DRIWrapInit(ScreenPtr pScreen) { + DRIWrapScreenRec *pScreenPriv; + + if(!dixRequestPrivate(driGCKey, sizeof(DRIGCRec))) + return FALSE; + + if(!dixRequestPrivate(driWrapScreenKey, sizeof(DRIWrapScreenRec))) + return FALSE; + + pScreenPriv = xalloc(sizeof(*pScreenPriv)); + + if(NULL == pScreenPriv) + return FALSE; + + pScreenPriv->CreateGC = pScreen->CreateGC; + pScreen->CreateGC = DRICreateGC; + + dixSetPrivate(&pScreen->devPrivates, driWrapScreenKey, pScreenPriv); + + return TRUE; +} diff --git a/xorg-server/hw/xquartz/xpr/driWrap.h b/xorg-server/hw/xquartz/xpr/driWrap.h new file mode 100644 index 000000000..d31d5ddaf --- /dev/null +++ b/xorg-server/hw/xquartz/xpr/driWrap.h @@ -0,0 +1,31 @@ +/* +Copyright (c) 2009 Apple Computer, Inc. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef DRIWRAP_H +#include "scrnintstr.h" + +Bool DRIWrapInit(ScreenPtr pScreen); + +#endif /*DRIWRAP_H*/ diff --git a/xorg-server/hw/xquartz/xpr/xpr.h b/xorg-server/hw/xquartz/xpr/xpr.h index ab79a42cd..c657e1586 100644 --- a/xorg-server/hw/xquartz/xpr/xpr.h +++ b/xorg-server/hw/xquartz/xpr/xpr.h @@ -47,4 +47,18 @@ Bool QuartzInitCursor(ScreenPtr pScreen); void QuartzSuspendXCursor(ScreenPtr pScreen); void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y); +/* If we are rooted, we need the root window and desktop levels to be below + * the menubar (24) but above native windows. Normal window level is 0. + * Floating window level is 3. The rest are filled in as appropriate. + * See CGWindowLevel.h + */ + +#include <X11/extensions/applewmconst.h> +static const int normal_window_levels[AppleWMNumWindowLevels+1] = { +0, 3, 4, 5, INT_MIN + 30, INT_MIN + 29, +}; +static const int rooted_window_levels[AppleWMNumWindowLevels+1] = { +20, 21, 22, 23, 19, 18, +}; + #endif /* XPR_H */ diff --git a/xorg-server/hw/xquartz/xpr/xprAppleWM.c b/xorg-server/hw/xquartz/xpr/xprAppleWM.c index fae9a0422..4b31e3a11 100644 --- a/xorg-server/hw/xquartz/xpr/xprAppleWM.c +++ b/xorg-server/hw/xquartz/xpr/xprAppleWM.c @@ -33,41 +33,41 @@ #include "xpr.h" -#define _APPLEWM_SERVER_ -#include <X11/extensions/applewmstr.h> +#include <X11/extensions/applewmproto.h> #include "applewmExt.h" #include "rootless.h" +#include "rootlessCommon.h" #include <Xplugin.h> #include <X11/X.h> #include "quartz.h" #include "x-hash.h" -/* This lookup table came straight from the Tiger X11 source. I tried to figure - * it out based on CGWindowLevel.h, but I dunno... -JH - */ -static const int normal_window_levels[AppleWMNumWindowLevels+1] = { -0, 3, 4, 5, INT_MIN + 30, INT_MIN + 29, -}; -static const int rooted_window_levels[AppleWMNumWindowLevels+1] = { -202, 203, 204, 205, 201, 200 -}; - static int xprSetWindowLevel( WindowPtr pWin, int level) { xp_window_id wid; xp_window_changes wc; + RootlessWindowRec *winRec; + // AppleWMNumWindowLevels is allowed, but is only set by the server + // for the root window. + if (level < 0 || level >= AppleWMNumWindowLevels) { + return BadValue; + } + wid = x_cvt_vptr_to_uint(RootlessFrameForWindow (pWin, TRUE)); if (wid == 0) return BadWindow; RootlessStopDrawing (pWin, FALSE); - - //if (WINREC(WindowTable[pWin->drawable.pScreen->myNum]) == NULL) - if (quartzHasRoot) + winRec = WINREC(pWin); + + if(!winRec) + return BadWindow; + + if(quartzEnableRootless) wc.window_level = normal_window_levels[level]; else wc.window_level = rooted_window_levels[level]; @@ -76,9 +76,39 @@ static int xprSetWindowLevel( return BadValue; } + winRec->level = level; + return Success; } +#if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 3 +static int xprAttachTransient(WindowPtr pWinChild, WindowPtr pWinParent) { + xp_window_id child_wid, parent_wid; + xp_window_changes wc; + + child_wid = x_cvt_vptr_to_uint(RootlessFrameForWindow(pWinChild, TRUE)); + if (child_wid == 0) + return BadWindow; + + if(pWinParent) { + parent_wid = x_cvt_vptr_to_uint(RootlessFrameForWindow(pWinParent, TRUE)); + if (parent_wid == 0) + return BadWindow; + } else { + parent_wid = 0; + } + + wc.transient_for = parent_wid; + + RootlessStopDrawing (pWinChild, FALSE); + + if (xp_configure_window(child_wid, XP_ATTACH_TRANSIENT, &wc) != Success) { + return BadValue; + } + + return Success; +} +#endif static int xprFrameDraw( WindowPtr pWin, @@ -104,14 +134,23 @@ static int xprFrameDraw( return Success; } - static AppleWMProcsRec xprAppleWMProcs = { xp_disable_update, xp_reenable_update, xprSetWindowLevel, xp_frame_get_rect, xp_frame_hit_test, - xprFrameDraw + xprFrameDraw, +#if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 3 + xp_set_dock_proxy, + xprAttachTransient +#elif defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 2 + xp_set_dock_proxy, + NULL +#else + NULL, + NULL +#endif }; diff --git a/xorg-server/hw/xquartz/xpr/xprCursor.c b/xorg-server/hw/xquartz/xpr/xprCursor.c index 4345beea4..8c47b671c 100644 --- a/xorg-server/hw/xquartz/xpr/xprCursor.c +++ b/xorg-server/hw/xquartz/xpr/xprCursor.c @@ -128,7 +128,7 @@ load_cursor(CursorPtr src, int screen) while (ycount-- > 0) { - xcount = (src->bits->width + 7) / 8; + xcount = bits_to_bytes(src->bits->width); sptr = srow; mptr = mrow; dptr = drow; diff --git a/xorg-server/hw/xquartz/xpr/xprEvent.c b/xorg-server/hw/xquartz/xpr/xprEvent.c index 08581c0e3..f8e985aba 100644 --- a/xorg-server/hw/xquartz/xpr/xprEvent.c +++ b/xorg-server/hw/xquartz/xpr/xprEvent.c @@ -32,7 +32,6 @@ #include "xpr.h" -#define NEED_EVENTS #include <X11/X.h> #include <X11/Xmd.h> #include <X11/Xproto.h> diff --git a/xorg-server/hw/xquartz/xpr/xprFrame.c b/xorg-server/hw/xquartz/xpr/xprFrame.c index 9a143ade0..6635f08d8 100644 --- a/xorg-server/hw/xquartz/xpr/xprFrame.c +++ b/xorg-server/hw/xquartz/xpr/xprFrame.c @@ -42,6 +42,7 @@ #include "dix.h" #include <X11/Xatom.h> #include "windowstr.h" +#include "quartz.h" #include "threadSafety.h" @@ -120,7 +121,7 @@ xprSetNativeProperty(RootlessWindowPtr pFrame) /* * Create and display a new frame. */ -Bool +static Bool xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, int newX, int newY, RegionPtr pShape) { @@ -161,6 +162,14 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, mask |= XP_SHAPE; } + pFrame->level = !IsRoot (pWin) ? AppleWMWindowLevelNormal : AppleWMNumWindowLevels; + + if(quartzEnableRootless) + wc.window_level = normal_window_levels[pFrame->level]; + else + wc.window_level = rooted_window_levels[pFrame->level]; + mask |= XP_WINDOW_LEVEL; + err = xp_create_window(mask, &wc, (xp_window_id *) &pFrame->wid); if (err != Success) @@ -187,7 +196,7 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, /* * Destroy a frame. */ -void +static void xprDestroyFrame(RootlessFrameID wid) { TA_SERVER(); @@ -203,7 +212,7 @@ xprDestroyFrame(RootlessFrameID wid) /* * Move a frame on screen. */ -void +static void xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY) { TA_SERVER(); @@ -220,7 +229,7 @@ xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY) /* * Resize and move a frame. */ -void +static void xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY, unsigned int newW, unsigned int newH, unsigned int gravity) @@ -245,35 +254,43 @@ xprResizeFrame(RootlessFrameID wid, ScreenPtr pScreen, /* * Change frame stacking. */ -void -xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) -{ +static void xprRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid) { xp_window_changes wc; + unsigned int mask = XP_STACKING; TA_SERVER(); - /* Stack frame below nextWid it if it exists, or raise + /* Stack frame below nextWid it if it exists, or raise frame above everything otherwise. */ - if (nextWid == NULL) - { + if(nextWid == NULL) { wc.stack_mode = XP_MAPPED_ABOVE; wc.sibling = 0; - } - else - { + } else { wc.stack_mode = XP_MAPPED_BELOW; wc.sibling = x_cvt_vptr_to_uint(nextWid); } - xprConfigureWindow(x_cvt_vptr_to_uint(wid), XP_STACKING, &wc); + if(window_hash) { + RootlessWindowRec *winRec = x_hash_table_lookup(window_hash, x_cvt_uint_to_vptr((xp_window_id)wid), NULL); + + if(winRec) { + if(quartzEnableRootless) + wc.window_level = normal_window_levels[winRec->level]; + else + wc.window_level = rooted_window_levels[winRec->level]; + mask |= XP_WINDOW_LEVEL; + } + } + + xprConfigureWindow(x_cvt_vptr_to_uint(wid), mask, &wc); } /* * Change the frame's shape. */ -void +static void xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape) { xp_window_changes wc; @@ -300,7 +317,7 @@ xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape) /* * Unmap a frame. */ -void +static void xprUnmapFrame(RootlessFrameID wid) { xp_window_changes wc; @@ -318,7 +335,7 @@ xprUnmapFrame(RootlessFrameID wid) * Start drawing to a frame. * Prepare for direct access to its backing buffer. */ -void +static void xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow) { void *data[2]; @@ -339,7 +356,7 @@ xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow) /* * Stop drawing to a frame. */ -void +static void xprStopDrawing(RootlessFrameID wid, Bool flush) { TA_SERVER(); @@ -351,7 +368,7 @@ xprStopDrawing(RootlessFrameID wid, Bool flush) /* * Flush drawing updates to the screen. */ -void +static void xprUpdateRegion(RootlessFrameID wid, RegionPtr pDamage) { TA_SERVER(); @@ -363,7 +380,7 @@ xprUpdateRegion(RootlessFrameID wid, RegionPtr pDamage) /* * Mark damaged rectangles as requiring redisplay to screen. */ -void +static void xprDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects, int shift_x, int shift_y) { @@ -377,7 +394,7 @@ xprDamageRects(RootlessFrameID wid, int nrects, const BoxRec *rects, * Called after the window associated with a frame has been switched * to a new top-level parent. */ -void +static void xprSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin) { DeleteProperty(serverClient, oldWin, xa_native_window_id()); @@ -391,7 +408,7 @@ xprSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin) /* * Called to check if the frame should be reordered when it is restacked. */ -Bool xprDoReorderWindow(RootlessWindowPtr pFrame) +static Bool xprDoReorderWindow(RootlessWindowPtr pFrame) { WindowPtr pWin = pFrame->win; @@ -405,7 +422,7 @@ Bool xprDoReorderWindow(RootlessWindowPtr pFrame) * Copy area in frame to another part of frame. * Used to accelerate scrolling. */ -void +static void xprCopyWindow(RootlessFrameID wid, int dstNrects, const BoxRec *dstRects, int dx, int dy) { @@ -473,6 +490,7 @@ xprGetXWindow(xp_window_id wid) return winRec != NULL ? winRec->win : NULL; } +#ifdef UNUSED_CODE /* * Given the id of a physical window, try to find the top-level (or root) * X window that it represents. @@ -503,7 +521,7 @@ xprGetXWindowFromAppKit(int windowNumber) return winRec != NULL ? winRec->win : NULL; } - +#endif /* * The windowNumber is an AppKit window number. Returns TRUE if xpr is diff --git a/xorg-server/hw/xquartz/xpr/xprScreen.c b/xorg-server/hw/xquartz/xpr/xprScreen.c index da262f654..3387ecf0a 100644 --- a/xorg-server/hw/xquartz/xpr/xprScreen.c +++ b/xorg-server/hw/xquartz/xpr/xprScreen.c @@ -48,6 +48,8 @@ #include "applewmExt.h" #include "micmap.h" +#include "rootlessCommon.h" + #ifdef DAMAGE # include "damage.h" #endif @@ -256,6 +258,9 @@ xprDisplayInit(void) AppleDRIExtensionInit(); xprAppleWMInit(); + + if (!quartzEnableRootless) + RootlessHideAllWindows(); } /* @@ -272,22 +277,9 @@ xprAddScreen(int index, ScreenPtr pScreen) if(depth == -1) { depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay); - //dfb->depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) * CGDisplayBitsPerSample(kCGDirectMainDisplay); - //dfb->bitsPerRGB = CGDisplayBitsPerSample(kCGDirectMainDisplay); - //dfb->bitsPerPixel = CGDisplayBitsPerPixel(kCGDirectMainDisplay); } switch(depth) { -// case -8: // broken -// dfb->visuals = (1 << StaticGray) | (1 << GrayScale); -// dfb->preferredCVC = GrayScale; -// dfb->depth = 8; -// dfb->bitsPerRGB = 8; -// dfb->bitsPerPixel = 8; -// dfb->redMask = 0; -// dfb->greenMask = 0; -// dfb->blueMask = 0; -// break; case 8: // pseudo-working dfb->visuals = PseudoColorMask; dfb->preferredCVC = PseudoColor; @@ -299,27 +291,27 @@ xprAddScreen(int index, ScreenPtr pScreen) dfb->blueMask = 0; break; case 15: - dfb->visuals = LARGE_VISUALS; + dfb->visuals = TrueColorMask; //LARGE_VISUALS; dfb->preferredCVC = TrueColor; dfb->depth = 15; dfb->bitsPerRGB = 5; dfb->bitsPerPixel = 16; - dfb->redMask = 0x7c00; - dfb->greenMask = 0x03e0; - dfb->blueMask = 0x001f; + dfb->redMask = RM_ARGB(0,5,5,5); + dfb->greenMask = GM_ARGB(0,5,5,5); + dfb->blueMask = BM_ARGB(0,5,5,5); break; // case 24: default: if(depth != 24) ErrorF("Unsupported color depth requested. Defaulting to 24bit. (depth=%d darwinDesiredDepth=%d CGDisplaySamplesPerPixel=%d CGDisplayBitsPerSample=%d)\n", darwinDesiredDepth, depth, (int)CGDisplaySamplesPerPixel(kCGDirectMainDisplay), (int)CGDisplayBitsPerSample(kCGDirectMainDisplay)); - dfb->visuals = LARGE_VISUALS; + dfb->visuals = TrueColorMask; //LARGE_VISUALS; dfb->preferredCVC = TrueColor; dfb->depth = 24; dfb->bitsPerRGB = 8; dfb->bitsPerPixel = 32; - dfb->redMask = 0x00ff0000; - dfb->greenMask = 0x0000ff00; - dfb->blueMask = 0x000000ff; + dfb->redMask = RM_ARGB(0,8,8,8); + dfb->greenMask = GM_ARGB(0,8,8,8); + dfb->blueMask = BM_ARGB(0,8,8,8); break; } |