Drop Xquartz DDX
This commit is contained in:
parent
f8a6a7b265
commit
6cae4b397d
26
.travis.yml
26
.travis.yml
|
@ -1,26 +0,0 @@
|
|||
language: c
|
||||
cache:
|
||||
ccache: true
|
||||
directories:
|
||||
- $HOME/Library/Caches/Homebrew
|
||||
branches:
|
||||
except:
|
||||
- /appveyor.*/
|
||||
|
||||
os: osx
|
||||
osx_image: xcode9.2
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- env: TOOL=meson
|
||||
|
||||
install:
|
||||
- brew update
|
||||
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache meson
|
||||
|
||||
script:
|
||||
- ./test/scripts/build-travis-osx.sh $TOOL
|
||||
- ccache -s
|
||||
|
||||
before_cache:
|
||||
- brew cleanup
|
|
@ -14,10 +14,6 @@ if build_xorg
|
|||
subdir('xfree86')
|
||||
endif
|
||||
|
||||
if build_xquartz
|
||||
subdir('xquartz')
|
||||
endif
|
||||
|
||||
if build_xwayland
|
||||
subdir('xwayland')
|
||||
endif
|
||||
|
|
|
@ -1,571 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2008-2012 Apple Inc.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define Cursor Mac_Cursor
|
||||
#define BOOL Mac_BOOL
|
||||
#include <OpenGL/OpenGL.h>
|
||||
#include <OpenGL/gl.h>
|
||||
#include <OpenGL/glu.h>
|
||||
#include <OpenGL/glext.h>
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#undef Cursor
|
||||
#undef BOOL
|
||||
|
||||
#include "capabilities.h"
|
||||
|
||||
#include "os.h"
|
||||
|
||||
static void
|
||||
handleBufferModes(struct glCapabilitiesConfig *c, GLint bufferModes)
|
||||
{
|
||||
if (bufferModes & kCGLStereoscopicBit) {
|
||||
c->stereo = true;
|
||||
}
|
||||
|
||||
if (bufferModes & kCGLDoubleBufferBit) {
|
||||
c->buffers = 2;
|
||||
}
|
||||
else {
|
||||
c->buffers = 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handleStencilModes(struct glCapabilitiesConfig *c, GLint smodes)
|
||||
{
|
||||
int offset = 0;
|
||||
|
||||
if (kCGL0Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 0;
|
||||
|
||||
if (kCGL1Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 1;
|
||||
|
||||
if (kCGL2Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 2;
|
||||
|
||||
if (kCGL3Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 3;
|
||||
|
||||
if (kCGL4Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 4;
|
||||
|
||||
if (kCGL5Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 5;
|
||||
|
||||
if (kCGL6Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 6;
|
||||
|
||||
if (kCGL8Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 8;
|
||||
|
||||
if (kCGL10Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 10;
|
||||
|
||||
if (kCGL12Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 12;
|
||||
|
||||
if (kCGL16Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 16;
|
||||
|
||||
if (kCGL24Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 24;
|
||||
|
||||
if (kCGL32Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 32;
|
||||
|
||||
if (kCGL48Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 48;
|
||||
|
||||
if (kCGL64Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 64;
|
||||
|
||||
if (kCGL96Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 96;
|
||||
|
||||
if (kCGL128Bit & smodes)
|
||||
c->stencil_bit_depths[offset++] = 128;
|
||||
|
||||
assert(offset < GLCAPS_STENCIL_BIT_DEPTH_BUFFERS);
|
||||
|
||||
c->total_stencil_bit_depths = offset;
|
||||
}
|
||||
|
||||
static int
|
||||
handleColorAndAccumulation(struct glColorBufCapabilities *c,
|
||||
GLint cmodes, int forAccum)
|
||||
{
|
||||
int offset = 0;
|
||||
|
||||
/*1*/
|
||||
if (kCGLRGB444Bit & cmodes) {
|
||||
c[offset].r = 4;
|
||||
c[offset].g = 4;
|
||||
c[offset].b = 4;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*2*/
|
||||
if (kCGLARGB4444Bit & cmodes) {
|
||||
c[offset].a = 4;
|
||||
c[offset].r = 4;
|
||||
c[offset].g = 4;
|
||||
c[offset].b = 4;
|
||||
c[offset].is_argb = true;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*3*/
|
||||
if (kCGLRGB444A8Bit & cmodes) {
|
||||
c[offset].r = 4;
|
||||
c[offset].g = 4;
|
||||
c[offset].b = 4;
|
||||
c[offset].a = 8;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*4*/
|
||||
if (kCGLRGB555Bit & cmodes) {
|
||||
c[offset].r = 5;
|
||||
c[offset].g = 5;
|
||||
c[offset].b = 5;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*5*/
|
||||
if (kCGLARGB1555Bit & cmodes) {
|
||||
c[offset].a = 1;
|
||||
c[offset].r = 5;
|
||||
c[offset].g = 5;
|
||||
c[offset].b = 5;
|
||||
c[offset].is_argb = true;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*6*/
|
||||
if (kCGLRGB555A8Bit & cmodes) {
|
||||
c[offset].r = 5;
|
||||
c[offset].g = 5;
|
||||
c[offset].b = 5;
|
||||
c[offset].a = 8;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*7*/
|
||||
if (kCGLRGB565Bit & cmodes) {
|
||||
c[offset].r = 5;
|
||||
c[offset].g = 6;
|
||||
c[offset].b = 5;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*8*/
|
||||
if (kCGLRGB565A8Bit & cmodes) {
|
||||
c[offset].r = 5;
|
||||
c[offset].g = 6;
|
||||
c[offset].b = 5;
|
||||
c[offset].a = 8;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*9*/
|
||||
if (kCGLRGB888Bit & cmodes) {
|
||||
c[offset].r = 8;
|
||||
c[offset].g = 8;
|
||||
c[offset].b = 8;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*10*/
|
||||
if (kCGLARGB8888Bit & cmodes) {
|
||||
c[offset].a = 8;
|
||||
c[offset].r = 8;
|
||||
c[offset].g = 8;
|
||||
c[offset].b = 8;
|
||||
c[offset].is_argb = true;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*11*/
|
||||
if (kCGLRGB888A8Bit & cmodes) {
|
||||
c[offset].r = 8;
|
||||
c[offset].g = 8;
|
||||
c[offset].b = 8;
|
||||
c[offset].a = 8;
|
||||
++offset;
|
||||
}
|
||||
|
||||
if (forAccum) {
|
||||
//#if 0
|
||||
/* FIXME
|
||||
* Disable this path, because some part of libGL, X, or Xplugin
|
||||
* doesn't work with sizes greater than 8.
|
||||
* When this is enabled and visuals are chosen using depths
|
||||
* such as 16, the result is that the windows don't redraw
|
||||
* and are often white, until a resize.
|
||||
*/
|
||||
|
||||
/*12*/
|
||||
if (kCGLRGB101010Bit & cmodes) {
|
||||
c[offset].r = 10;
|
||||
c[offset].g = 10;
|
||||
c[offset].b = 10;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*13*/
|
||||
if (kCGLARGB2101010Bit & cmodes) {
|
||||
c[offset].a = 2;
|
||||
c[offset].r = 10;
|
||||
c[offset].g = 10;
|
||||
c[offset].b = 10;
|
||||
c[offset].is_argb = true;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*14*/
|
||||
if (kCGLRGB101010_A8Bit & cmodes) {
|
||||
c[offset].r = 10;
|
||||
c[offset].g = 10;
|
||||
c[offset].b = 10;
|
||||
c[offset].a = 8;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*15*/
|
||||
if (kCGLRGB121212Bit & cmodes) {
|
||||
c[offset].r = 12;
|
||||
c[offset].g = 12;
|
||||
c[offset].b = 12;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*16*/
|
||||
if (kCGLARGB12121212Bit & cmodes) {
|
||||
c[offset].a = 12;
|
||||
c[offset].r = 12;
|
||||
c[offset].g = 12;
|
||||
c[offset].b = 12;
|
||||
c[offset].is_argb = true;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*17*/
|
||||
if (kCGLRGB161616Bit & cmodes) {
|
||||
c[offset].r = 16;
|
||||
c[offset].g = 16;
|
||||
c[offset].b = 16;
|
||||
++offset;
|
||||
}
|
||||
|
||||
/*18*/
|
||||
if (kCGLRGBA16161616Bit & cmodes) {
|
||||
c[offset].r = 16;
|
||||
c[offset].g = 16;
|
||||
c[offset].b = 16;
|
||||
c[offset].a = 16;
|
||||
++offset;
|
||||
}
|
||||
}
|
||||
//#endif
|
||||
|
||||
/* FIXME should we handle the floating point color modes, and if so, how? */
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
static void
|
||||
handleColorModes(struct glCapabilitiesConfig *c, GLint cmodes)
|
||||
{
|
||||
c->total_color_buffers = handleColorAndAccumulation(c->color_buffers,
|
||||
cmodes, 0);
|
||||
|
||||
assert(c->total_color_buffers < GLCAPS_COLOR_BUFFERS);
|
||||
}
|
||||
|
||||
static void
|
||||
handleAccumulationModes(struct glCapabilitiesConfig *c, GLint cmodes)
|
||||
{
|
||||
c->total_accum_buffers = handleColorAndAccumulation(c->accum_buffers,
|
||||
cmodes, 1);
|
||||
assert(c->total_accum_buffers < GLCAPS_COLOR_BUFFERS);
|
||||
}
|
||||
|
||||
static void
|
||||
handleDepthModes(struct glCapabilitiesConfig *c, GLint dmodes)
|
||||
{
|
||||
int offset = 0;
|
||||
#define DEPTH(flag, value) do { \
|
||||
if (dmodes & flag) { \
|
||||
c->depth_buffers[offset++] = value; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*1*/
|
||||
DEPTH(kCGL0Bit, 0);
|
||||
/*2*/
|
||||
DEPTH(kCGL1Bit, 1);
|
||||
/*3*/
|
||||
DEPTH(kCGL2Bit, 2);
|
||||
/*4*/
|
||||
DEPTH(kCGL3Bit, 3);
|
||||
/*5*/
|
||||
DEPTH(kCGL4Bit, 4);
|
||||
/*6*/
|
||||
DEPTH(kCGL5Bit, 5);
|
||||
/*7*/
|
||||
DEPTH(kCGL6Bit, 6);
|
||||
/*8*/
|
||||
DEPTH(kCGL8Bit, 8);
|
||||
/*9*/
|
||||
DEPTH(kCGL10Bit, 10);
|
||||
/*10*/
|
||||
DEPTH(kCGL12Bit, 12);
|
||||
/*11*/
|
||||
DEPTH(kCGL16Bit, 16);
|
||||
/*12*/
|
||||
DEPTH(kCGL24Bit, 24);
|
||||
/*13*/
|
||||
DEPTH(kCGL32Bit, 32);
|
||||
/*14*/
|
||||
DEPTH(kCGL48Bit, 48);
|
||||
/*15*/
|
||||
DEPTH(kCGL64Bit, 64);
|
||||
/*16*/
|
||||
DEPTH(kCGL96Bit, 96);
|
||||
/*17*/
|
||||
DEPTH(kCGL128Bit, 128);
|
||||
|
||||
#undef DEPTH
|
||||
|
||||
c->total_depth_buffer_depths = offset;
|
||||
assert(c->total_depth_buffer_depths < GLCAPS_DEPTH_BUFFERS);
|
||||
}
|
||||
|
||||
/* Return non-zero if an error occurred. */
|
||||
static CGLError
|
||||
handleRendererDescriptions(CGLRendererInfoObj info, GLint r,
|
||||
struct glCapabilitiesConfig *c)
|
||||
{
|
||||
CGLError err;
|
||||
GLint accelerated = 0, flags = 0, aux = 0, samplebufs = 0, samples = 0;
|
||||
|
||||
err = CGLDescribeRenderer(info, r, kCGLRPAccelerated, &accelerated);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
c->accelerated = accelerated;
|
||||
|
||||
/* Buffering modes: single/double, stereo */
|
||||
err = CGLDescribeRenderer(info, r, kCGLRPBufferModes, &flags);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
handleBufferModes(c, flags);
|
||||
|
||||
/* AUX buffers */
|
||||
err = CGLDescribeRenderer(info, r, kCGLRPMaxAuxBuffers, &aux);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
c->aux_buffers = aux;
|
||||
|
||||
/* Depth buffer size */
|
||||
err = CGLDescribeRenderer(info, r, kCGLRPDepthModes, &flags);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
handleDepthModes(c, flags);
|
||||
|
||||
/* Multisample buffers */
|
||||
err = CGLDescribeRenderer(info, r, kCGLRPMaxSampleBuffers, &samplebufs);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
c->multisample_buffers = samplebufs;
|
||||
|
||||
/* Multisample samples per multisample buffer */
|
||||
err = CGLDescribeRenderer(info, r, kCGLRPMaxSamples, &samples);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
c->multisample_samples = samples;
|
||||
|
||||
/* Stencil bit depths */
|
||||
err = CGLDescribeRenderer(info, r, kCGLRPStencilModes, &flags);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
handleStencilModes(c, flags);
|
||||
|
||||
/* Color modes (RGB/RGBA depths supported */
|
||||
err = CGLDescribeRenderer(info, r, kCGLRPColorModes, &flags);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
handleColorModes(c, flags);
|
||||
|
||||
err = CGLDescribeRenderer(info, r, kCGLRPAccumModes, &flags);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
handleAccumulationModes(c, flags);
|
||||
|
||||
return kCGLNoError;
|
||||
}
|
||||
|
||||
static void
|
||||
initCapabilities(struct glCapabilities *cap)
|
||||
{
|
||||
cap->configurations = NULL;
|
||||
cap->total_configurations = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
initConfig(struct glCapabilitiesConfig *c)
|
||||
{
|
||||
int i;
|
||||
|
||||
c->accelerated = false;
|
||||
c->stereo = false;
|
||||
c->aux_buffers = 0;
|
||||
c->buffers = 0;
|
||||
|
||||
c->total_depth_buffer_depths = 0;
|
||||
|
||||
for (i = 0; i < GLCAPS_DEPTH_BUFFERS; ++i) {
|
||||
c->depth_buffers[i] = GLCAPS_INVALID_DEPTH_VALUE;
|
||||
}
|
||||
|
||||
c->multisample_buffers = 0;
|
||||
c->multisample_samples = 0;
|
||||
|
||||
c->total_stencil_bit_depths = 0;
|
||||
|
||||
for (i = 0; i < GLCAPS_STENCIL_BIT_DEPTH_BUFFERS; ++i) {
|
||||
c->stencil_bit_depths[i] = GLCAPS_INVALID_STENCIL_DEPTH;
|
||||
}
|
||||
|
||||
c->total_color_buffers = 0;
|
||||
|
||||
for (i = 0; i < GLCAPS_COLOR_BUFFERS; ++i) {
|
||||
c->color_buffers[i].r = c->color_buffers[i].g =
|
||||
c->color_buffers[i].b =
|
||||
c->color_buffers[i].a =
|
||||
GLCAPS_COLOR_BUF_INVALID_VALUE;
|
||||
c->color_buffers[i].is_argb = false;
|
||||
}
|
||||
|
||||
c->total_accum_buffers = 0;
|
||||
|
||||
for (i = 0; i < GLCAPS_COLOR_BUFFERS; ++i) {
|
||||
c->accum_buffers[i].r = c->accum_buffers[i].g =
|
||||
c->accum_buffers[i].b =
|
||||
c->accum_buffers[i].a =
|
||||
GLCAPS_COLOR_BUF_INVALID_VALUE;
|
||||
c->accum_buffers[i].is_argb = false;
|
||||
}
|
||||
|
||||
c->next = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
freeGlCapabilities(struct glCapabilities *cap)
|
||||
{
|
||||
struct glCapabilitiesConfig *conf, *next;
|
||||
|
||||
conf = cap->configurations;
|
||||
|
||||
while (conf) {
|
||||
next = conf->next;
|
||||
free(conf);
|
||||
conf = next;
|
||||
}
|
||||
|
||||
cap->configurations = NULL;
|
||||
}
|
||||
|
||||
/* Return true if an error occurred. */
|
||||
bool
|
||||
getGlCapabilities(struct glCapabilities *cap)
|
||||
{
|
||||
CGLRendererInfoObj info;
|
||||
CGLError err;
|
||||
GLint numRenderers = 0, r;
|
||||
|
||||
initCapabilities(cap);
|
||||
|
||||
err = CGLQueryRendererInfo((GLuint) - 1, &info, &numRenderers);
|
||||
if (err) {
|
||||
ErrorF("CGLQueryRendererInfo error: %s\n", CGLErrorString(err));
|
||||
return err;
|
||||
}
|
||||
|
||||
for (r = 0; r < numRenderers; r++) {
|
||||
struct glCapabilitiesConfig tmpconf, *conf;
|
||||
|
||||
initConfig(&tmpconf);
|
||||
|
||||
err = handleRendererDescriptions(info, r, &tmpconf);
|
||||
if (err) {
|
||||
ErrorF("handleRendererDescriptions returned error: %s\n",
|
||||
CGLErrorString(
|
||||
err));
|
||||
ErrorF("trying to continue...\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
conf = malloc(sizeof(*conf));
|
||||
if (NULL == conf) {
|
||||
FatalError("Unable to allocate memory for OpenGL capabilities\n");
|
||||
}
|
||||
|
||||
/* Copy the struct. */
|
||||
*conf = tmpconf;
|
||||
|
||||
/* Now link the configuration into the list. */
|
||||
conf->next = cap->configurations;
|
||||
cap->configurations = conf;
|
||||
}
|
||||
|
||||
CGLDestroyRendererInfo(info);
|
||||
|
||||
/* No error occurred. We are done. */
|
||||
return kCGLNoError;
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2008-2012 Apple Inc.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef CAPABILITIES_H
|
||||
#define CAPABILITIES_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
enum { GLCAPS_INVALID_STENCIL_DEPTH = -1 };
|
||||
enum { GLCAPS_COLOR_BUF_INVALID_VALUE = -1 };
|
||||
enum { GLCAPS_COLOR_BUFFERS = 20 };
|
||||
enum { GLCAPS_STENCIL_BIT_DEPTH_BUFFERS = 20 };
|
||||
enum { GLCAPS_DEPTH_BUFFERS = 20 };
|
||||
enum { GLCAPS_INVALID_DEPTH_VALUE = 1 };
|
||||
|
||||
struct glColorBufCapabilities {
|
||||
char r, g, b, a;
|
||||
bool is_argb;
|
||||
};
|
||||
|
||||
struct glCapabilitiesConfig {
|
||||
bool accelerated;
|
||||
bool stereo;
|
||||
int aux_buffers;
|
||||
int buffers;
|
||||
int total_depth_buffer_depths;
|
||||
int depth_buffers[GLCAPS_DEPTH_BUFFERS];
|
||||
int multisample_buffers;
|
||||
int multisample_samples;
|
||||
int total_stencil_bit_depths;
|
||||
char stencil_bit_depths[GLCAPS_STENCIL_BIT_DEPTH_BUFFERS];
|
||||
int total_color_buffers;
|
||||
struct glColorBufCapabilities color_buffers[GLCAPS_COLOR_BUFFERS];
|
||||
int total_accum_buffers;
|
||||
struct glColorBufCapabilities accum_buffers[GLCAPS_COLOR_BUFFERS];
|
||||
struct glCapabilitiesConfig *next;
|
||||
};
|
||||
|
||||
struct glCapabilities {
|
||||
struct glCapabilitiesConfig *configurations;
|
||||
int total_configurations;
|
||||
};
|
||||
|
||||
bool
|
||||
getGlCapabilities(struct glCapabilities *cap);
|
||||
void
|
||||
freeGlCapabilities(struct glCapabilities *cap);
|
||||
|
||||
#endif
|
|
@ -1,585 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright IBM Corporation 2003
|
||||
* 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
|
||||
* on 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
|
||||
* VA LINUX SYSTEM, IBM AND/OR THEIR 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file glcontextmodes.c
|
||||
* Utility routines for working with \c __GLcontextModes structures. At
|
||||
* some point most or all of these functions will be moved to the Mesa
|
||||
* code base.
|
||||
*
|
||||
* \author Ian Romanick <idr@us.ibm.com>
|
||||
*/
|
||||
|
||||
#if defined(IN_MINI_GLX)
|
||||
#include <GL/gl.h>
|
||||
#else
|
||||
#if defined(HAVE_DIX_CONFIG_H)
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
#include <X11/X.h>
|
||||
#include <GL/glx.h>
|
||||
#include "GL/glxint.h"
|
||||
#endif
|
||||
|
||||
/* Memory macros */
|
||||
#if defined(IN_MINI_GLX)
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define _mesa_malloc(b) malloc(b)
|
||||
#define _mesa_free(m) free(m)
|
||||
#define _mesa_memset memset
|
||||
#else
|
||||
#ifdef XFree86Server
|
||||
#include <os.h>
|
||||
#include <string.h>
|
||||
#define _mesa_malloc(b) malloc(b)
|
||||
#define _mesa_free(m) free(m)
|
||||
#define _mesa_memset memset
|
||||
#else
|
||||
#include <X11/Xlibint.h>
|
||||
#define _mesa_memset memset
|
||||
#define _mesa_malloc(b) Xmalloc(b)
|
||||
#define _mesa_free(m) free(m)
|
||||
#endif /* XFree86Server */
|
||||
#endif /* !defined(IN_MINI_GLX) */
|
||||
|
||||
#include "glcontextmodes.h"
|
||||
|
||||
#if !defined(IN_MINI_GLX)
|
||||
#define NUM_VISUAL_TYPES 6
|
||||
|
||||
/**
|
||||
* Convert an X visual type to a GLX visual type.
|
||||
*
|
||||
* \param visualType X visual type (i.e., \c TrueColor, \c StaticGray, etc.)
|
||||
* to be converted.
|
||||
* \return If \c visualType is a valid X visual type, a GLX visual type will
|
||||
* be returned. Otherwise \c GLX_NONE will be returned.
|
||||
*/
|
||||
GLint
|
||||
_gl_convert_from_x_visual_type(int visualType)
|
||||
{
|
||||
static const int glx_visual_types[NUM_VISUAL_TYPES] = {
|
||||
GLX_STATIC_GRAY, GLX_GRAY_SCALE,
|
||||
GLX_STATIC_COLOR, GLX_PSEUDO_COLOR,
|
||||
GLX_TRUE_COLOR, GLX_DIRECT_COLOR
|
||||
};
|
||||
|
||||
return ((unsigned)visualType < NUM_VISUAL_TYPES)
|
||||
? glx_visual_types[visualType] : GLX_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a GLX visual type to an X visual type.
|
||||
*
|
||||
* \param visualType GLX visual type (i.e., \c GLX_TRUE_COLOR,
|
||||
* \c GLX_STATIC_GRAY, etc.) to be converted.
|
||||
* \return If \c visualType is a valid GLX visual type, an X visual type will
|
||||
* be returned. Otherwise -1 will be returned.
|
||||
*/
|
||||
GLint
|
||||
_gl_convert_to_x_visual_type(int visualType)
|
||||
{
|
||||
static const int x_visual_types[NUM_VISUAL_TYPES] = {
|
||||
TrueColor, DirectColor,
|
||||
PseudoColor, StaticColor,
|
||||
GrayScale, StaticGray
|
||||
};
|
||||
|
||||
return ((unsigned)(visualType - GLX_TRUE_COLOR) < NUM_VISUAL_TYPES)
|
||||
? x_visual_types[visualType - GLX_TRUE_COLOR] : -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a GLX visual config structure to a GL context mode structure. All
|
||||
* of the fields in \c config are copied to \c mode. Additional fields in
|
||||
* \c mode that can be derived from the fields of \c config (i.e.,
|
||||
* \c haveDepthBuffer) are also filled in. The remaining fields in \c mode
|
||||
* that cannot be derived are set to default values.
|
||||
*
|
||||
* \param mode Destination GL context mode.
|
||||
* \param config Source GLX visual config.
|
||||
*
|
||||
* \note
|
||||
* The \c fbconfigID and \c visualID fields of the \c __GLcontextModes
|
||||
* structure will be set to the \c vid of the \c __GLXvisualConfig structure.
|
||||
*/
|
||||
void
|
||||
_gl_copy_visual_to_context_mode(__GLcontextModes * mode,
|
||||
const __GLXvisualConfig * config)
|
||||
{
|
||||
__GLcontextModes * const next = mode->next;
|
||||
|
||||
(void)_mesa_memset(mode, 0, sizeof(__GLcontextModes));
|
||||
mode->next = next;
|
||||
|
||||
mode->visualID = config->vid;
|
||||
mode->visualType = _gl_convert_from_x_visual_type(config->class);
|
||||
mode->fbconfigID = config->vid;
|
||||
mode->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT;
|
||||
|
||||
mode->rgbMode = (config->rgba != 0);
|
||||
mode->renderType = (mode->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT;
|
||||
|
||||
mode->colorIndexMode = !(mode->rgbMode);
|
||||
mode->doubleBufferMode = (config->doubleBuffer != 0);
|
||||
mode->stereoMode = (config->stereo != 0);
|
||||
|
||||
mode->haveAccumBuffer = ((config->accumRedSize +
|
||||
config->accumGreenSize +
|
||||
config->accumBlueSize +
|
||||
config->accumAlphaSize) > 0);
|
||||
mode->haveDepthBuffer = (config->depthSize > 0);
|
||||
mode->haveStencilBuffer = (config->stencilSize > 0);
|
||||
|
||||
mode->redBits = config->redSize;
|
||||
mode->greenBits = config->greenSize;
|
||||
mode->blueBits = config->blueSize;
|
||||
mode->alphaBits = config->alphaSize;
|
||||
mode->redMask = config->redMask;
|
||||
mode->greenMask = config->greenMask;
|
||||
mode->blueMask = config->blueMask;
|
||||
mode->alphaMask = config->alphaMask;
|
||||
mode->rgbBits = mode->rgbMode ? config->bufferSize : 0;
|
||||
mode->indexBits = mode->colorIndexMode ? config->bufferSize : 0;
|
||||
|
||||
mode->accumRedBits = config->accumRedSize;
|
||||
mode->accumGreenBits = config->accumGreenSize;
|
||||
mode->accumBlueBits = config->accumBlueSize;
|
||||
mode->accumAlphaBits = config->accumAlphaSize;
|
||||
mode->depthBits = config->depthSize;
|
||||
mode->stencilBits = config->stencilSize;
|
||||
|
||||
mode->numAuxBuffers = config->auxBuffers;
|
||||
mode->level = config->level;
|
||||
|
||||
mode->visualRating = config->visualRating;
|
||||
mode->transparentPixel = config->transparentPixel;
|
||||
mode->transparentRed = config->transparentRed;
|
||||
mode->transparentGreen = config->transparentGreen;
|
||||
mode->transparentBlue = config->transparentBlue;
|
||||
mode->transparentAlpha = config->transparentAlpha;
|
||||
mode->transparentIndex = config->transparentIndex;
|
||||
mode->samples = config->multiSampleSize;
|
||||
mode->sampleBuffers = config->nMultiSampleBuffers;
|
||||
/* mode->visualSelectGroup = config->visualSelectGroup; ? */
|
||||
|
||||
mode->swapMethod = GLX_SWAP_UNDEFINED_OML;
|
||||
|
||||
mode->bindToTextureRgb = (mode->rgbMode) ? GL_TRUE : GL_FALSE;
|
||||
mode->bindToTextureRgba = (mode->rgbMode && mode->alphaBits) ?
|
||||
GL_TRUE : GL_FALSE;
|
||||
mode->bindToMipmapTexture = mode->rgbMode ? GL_TRUE : GL_FALSE;
|
||||
mode->bindToTextureTargets = mode->rgbMode ?
|
||||
GLX_TEXTURE_1D_BIT_EXT |
|
||||
GLX_TEXTURE_2D_BIT_EXT |
|
||||
GLX_TEXTURE_RECTANGLE_BIT_EXT : 0;
|
||||
mode->yInverted = GL_FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get data from a GL context mode.
|
||||
*
|
||||
* \param mode GL context mode whose data is to be returned.
|
||||
* \param attribute Attribute of \c mode that is to be returned.
|
||||
* \param value_return Location to store the data member of \c mode.
|
||||
* \return If \c attribute is a valid attribute of \c mode, zero is
|
||||
* returned. Otherwise \c GLX_BAD_ATTRIBUTE is returned.
|
||||
*/
|
||||
int
|
||||
_gl_get_context_mode_data(const __GLcontextModes *mode, int attribute,
|
||||
int *value_return)
|
||||
{
|
||||
switch (attribute) {
|
||||
case GLX_USE_GL:
|
||||
*value_return = GL_TRUE;
|
||||
return 0;
|
||||
|
||||
case GLX_BUFFER_SIZE:
|
||||
*value_return = mode->rgbBits;
|
||||
return 0;
|
||||
|
||||
case GLX_RGBA:
|
||||
*value_return = mode->rgbMode;
|
||||
return 0;
|
||||
|
||||
case GLX_RED_SIZE:
|
||||
*value_return = mode->redBits;
|
||||
return 0;
|
||||
|
||||
case GLX_GREEN_SIZE:
|
||||
*value_return = mode->greenBits;
|
||||
return 0;
|
||||
|
||||
case GLX_BLUE_SIZE:
|
||||
*value_return = mode->blueBits;
|
||||
return 0;
|
||||
|
||||
case GLX_ALPHA_SIZE:
|
||||
*value_return = mode->alphaBits;
|
||||
return 0;
|
||||
|
||||
case GLX_DOUBLEBUFFER:
|
||||
*value_return = mode->doubleBufferMode;
|
||||
return 0;
|
||||
|
||||
case GLX_STEREO:
|
||||
*value_return = mode->stereoMode;
|
||||
return 0;
|
||||
|
||||
case GLX_AUX_BUFFERS:
|
||||
*value_return = mode->numAuxBuffers;
|
||||
return 0;
|
||||
|
||||
case GLX_DEPTH_SIZE:
|
||||
*value_return = mode->depthBits;
|
||||
return 0;
|
||||
|
||||
case GLX_STENCIL_SIZE:
|
||||
*value_return = mode->stencilBits;
|
||||
return 0;
|
||||
|
||||
case GLX_ACCUM_RED_SIZE:
|
||||
*value_return = mode->accumRedBits;
|
||||
return 0;
|
||||
|
||||
case GLX_ACCUM_GREEN_SIZE:
|
||||
*value_return = mode->accumGreenBits;
|
||||
return 0;
|
||||
|
||||
case GLX_ACCUM_BLUE_SIZE:
|
||||
*value_return = mode->accumBlueBits;
|
||||
return 0;
|
||||
|
||||
case GLX_ACCUM_ALPHA_SIZE:
|
||||
*value_return = mode->accumAlphaBits;
|
||||
return 0;
|
||||
|
||||
case GLX_LEVEL:
|
||||
*value_return = mode->level;
|
||||
return 0;
|
||||
|
||||
case GLX_TRANSPARENT_TYPE_EXT:
|
||||
*value_return = mode->transparentPixel;
|
||||
return 0;
|
||||
|
||||
case GLX_TRANSPARENT_RED_VALUE:
|
||||
*value_return = mode->transparentRed;
|
||||
return 0;
|
||||
|
||||
case GLX_TRANSPARENT_GREEN_VALUE:
|
||||
*value_return = mode->transparentGreen;
|
||||
return 0;
|
||||
|
||||
case GLX_TRANSPARENT_BLUE_VALUE:
|
||||
*value_return = mode->transparentBlue;
|
||||
return 0;
|
||||
|
||||
case GLX_TRANSPARENT_ALPHA_VALUE:
|
||||
*value_return = mode->transparentAlpha;
|
||||
return 0;
|
||||
|
||||
case GLX_TRANSPARENT_INDEX_VALUE:
|
||||
*value_return = mode->transparentIndex;
|
||||
return 0;
|
||||
|
||||
case GLX_X_VISUAL_TYPE:
|
||||
*value_return = mode->visualType;
|
||||
return 0;
|
||||
|
||||
case GLX_CONFIG_CAVEAT:
|
||||
*value_return = mode->visualRating;
|
||||
return 0;
|
||||
|
||||
case GLX_VISUAL_ID:
|
||||
*value_return = mode->visualID;
|
||||
return 0;
|
||||
|
||||
case GLX_DRAWABLE_TYPE:
|
||||
*value_return = mode->drawableType;
|
||||
return 0;
|
||||
|
||||
case GLX_RENDER_TYPE:
|
||||
*value_return = mode->renderType;
|
||||
return 0;
|
||||
|
||||
case GLX_X_RENDERABLE:
|
||||
*value_return = mode->xRenderable;
|
||||
return 0;
|
||||
|
||||
case GLX_FBCONFIG_ID:
|
||||
*value_return = mode->fbconfigID;
|
||||
return 0;
|
||||
|
||||
case GLX_MAX_PBUFFER_WIDTH:
|
||||
*value_return = mode->maxPbufferWidth;
|
||||
return 0;
|
||||
|
||||
case GLX_MAX_PBUFFER_HEIGHT:
|
||||
*value_return = mode->maxPbufferHeight;
|
||||
return 0;
|
||||
|
||||
case GLX_MAX_PBUFFER_PIXELS:
|
||||
*value_return = mode->maxPbufferPixels;
|
||||
return 0;
|
||||
|
||||
case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX:
|
||||
*value_return = mode->optimalPbufferWidth;
|
||||
return 0;
|
||||
|
||||
case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX:
|
||||
*value_return = mode->optimalPbufferHeight;
|
||||
return 0;
|
||||
|
||||
case GLX_SWAP_METHOD_OML:
|
||||
*value_return = mode->swapMethod;
|
||||
return 0;
|
||||
|
||||
case GLX_SAMPLE_BUFFERS_SGIS:
|
||||
*value_return = mode->sampleBuffers;
|
||||
return 0;
|
||||
|
||||
case GLX_SAMPLES_SGIS:
|
||||
*value_return = mode->samples;
|
||||
return 0;
|
||||
|
||||
case GLX_BIND_TO_TEXTURE_RGB_EXT:
|
||||
*value_return = mode->bindToTextureRgb;
|
||||
return 0;
|
||||
|
||||
case GLX_BIND_TO_TEXTURE_RGBA_EXT:
|
||||
*value_return = mode->bindToTextureRgba;
|
||||
return 0;
|
||||
|
||||
case GLX_BIND_TO_MIPMAP_TEXTURE_EXT:
|
||||
*value_return = mode->bindToMipmapTexture == GL_TRUE ? GL_TRUE :
|
||||
GL_FALSE;
|
||||
return 0;
|
||||
|
||||
case GLX_BIND_TO_TEXTURE_TARGETS_EXT:
|
||||
*value_return = mode->bindToTextureTargets;
|
||||
return 0;
|
||||
|
||||
case GLX_Y_INVERTED_EXT:
|
||||
*value_return = mode->yInverted;
|
||||
return 0;
|
||||
|
||||
/* Applications are NOT allowed to query GLX_VISUAL_SELECT_GROUP_SGIX.
|
||||
* It is ONLY for communication between the GLX client and the GLX
|
||||
* server.
|
||||
*/
|
||||
case GLX_VISUAL_SELECT_GROUP_SGIX:
|
||||
default:
|
||||
return GLX_BAD_ATTRIBUTE;
|
||||
}
|
||||
}
|
||||
#endif /* !defined(IN_MINI_GLX) */
|
||||
|
||||
/**
|
||||
* Allocate a linked list of \c __GLcontextModes structures. The fields of
|
||||
* each structure will be initialized to "reasonable" default values. In
|
||||
* most cases this is the default value defined by table 3.4 of the GLX
|
||||
* 1.3 specification. This means that most values are either initialized to
|
||||
* zero or \c GLX_DONT_CARE (which is -1). As support for additional
|
||||
* extensions is added, the new values will be initialized to appropriate
|
||||
* values from the extension specification.
|
||||
*
|
||||
* \param count Number of structures to allocate.
|
||||
* \param minimum_size Minimum size of a structure to allocate. This allows
|
||||
* for differences in the version of the
|
||||
* \c __GLcontextModes structure used in libGL and in a
|
||||
* DRI-based driver.
|
||||
* \returns A pointer to the first element in a linked list of \c count
|
||||
* structures on success, or \c NULL on failure.
|
||||
*
|
||||
* \warning Use of \c minimum_size does \b not guarantee binary compatibility.
|
||||
* The fundamental assumption is that if the \c minimum_size
|
||||
* specified by the driver and the size of the \c __GLcontextModes
|
||||
* structure in libGL is the same, then the meaning of each byte in
|
||||
* the structure is the same in both places. \b Be \b careful!
|
||||
* Basically this means that fields have to be added in libGL and
|
||||
* then propagated to drivers. Drivers should \b never arbitrarilly
|
||||
* extend the \c __GLcontextModes data-structure.
|
||||
*/
|
||||
__GLcontextModes *
|
||||
_gl_context_modes_create(unsigned count, size_t minimum_size)
|
||||
{
|
||||
const size_t size = (minimum_size > sizeof(__GLcontextModes))
|
||||
? minimum_size : sizeof(__GLcontextModes);
|
||||
__GLcontextModes * base = NULL;
|
||||
__GLcontextModes ** next;
|
||||
unsigned i;
|
||||
|
||||
next = &base;
|
||||
for (i = 0; i < count; i++) {
|
||||
*next = (__GLcontextModes *)_mesa_malloc(size);
|
||||
if (*next == NULL) {
|
||||
_gl_context_modes_destroy(base);
|
||||
base = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
(void)_mesa_memset(*next, 0, size);
|
||||
(*next)->visualID = GLX_DONT_CARE;
|
||||
(*next)->visualType = GLX_DONT_CARE;
|
||||
(*next)->visualRating = GLX_NONE;
|
||||
(*next)->transparentPixel = GLX_NONE;
|
||||
(*next)->transparentRed = GLX_DONT_CARE;
|
||||
(*next)->transparentGreen = GLX_DONT_CARE;
|
||||
(*next)->transparentBlue = GLX_DONT_CARE;
|
||||
(*next)->transparentAlpha = GLX_DONT_CARE;
|
||||
(*next)->transparentIndex = GLX_DONT_CARE;
|
||||
(*next)->xRenderable = GLX_DONT_CARE;
|
||||
(*next)->fbconfigID = GLX_DONT_CARE;
|
||||
(*next)->swapMethod = GLX_SWAP_UNDEFINED_OML;
|
||||
(*next)->bindToTextureRgb = GLX_DONT_CARE;
|
||||
(*next)->bindToTextureRgba = GLX_DONT_CARE;
|
||||
(*next)->bindToMipmapTexture = GLX_DONT_CARE;
|
||||
(*next)->bindToTextureTargets = GLX_DONT_CARE;
|
||||
(*next)->yInverted = GLX_DONT_CARE;
|
||||
|
||||
next = &((*next)->next);
|
||||
}
|
||||
|
||||
return base;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy a linked list of \c __GLcontextModes structures created by
|
||||
* \c _gl_context_modes_create.
|
||||
*
|
||||
* \param modes Linked list of structures to be destroyed. All structures
|
||||
* in the list will be freed.
|
||||
*/
|
||||
void
|
||||
_gl_context_modes_destroy(__GLcontextModes * modes)
|
||||
{
|
||||
while (modes != NULL) {
|
||||
__GLcontextModes * const next = modes->next;
|
||||
|
||||
_mesa_free(modes);
|
||||
modes = next;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a context mode matching a Visual ID.
|
||||
*
|
||||
* \param modes List list of context-mode structures to be searched.
|
||||
* \param vid Visual ID to be found.
|
||||
* \returns A pointer to a context-mode in \c modes if \c vid was found in
|
||||
* the list, or \c NULL if it was not.
|
||||
*/
|
||||
|
||||
__GLcontextModes *
|
||||
_gl_context_modes_find_visual(__GLcontextModes *modes, int vid)
|
||||
{
|
||||
__GLcontextModes *m;
|
||||
|
||||
for (m = modes; m != NULL; m = m->next)
|
||||
if (m->visualID == vid)
|
||||
return m;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
__GLcontextModes *
|
||||
_gl_context_modes_find_fbconfig(__GLcontextModes *modes, int fbid)
|
||||
{
|
||||
__GLcontextModes *m;
|
||||
|
||||
for (m = modes; m != NULL; m = m->next)
|
||||
if (m->fbconfigID == fbid)
|
||||
return m;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if two context-modes are the same. This is intended to be used
|
||||
* by libGL implementations to compare to sets of driver generated FBconfigs.
|
||||
*
|
||||
* \param a Context-mode to be compared.
|
||||
* \param b Context-mode to be compared.
|
||||
* \returns \c GL_TRUE if the two context-modes are the same. \c GL_FALSE is
|
||||
* returned otherwise.
|
||||
*/
|
||||
GLboolean
|
||||
_gl_context_modes_are_same(const __GLcontextModes * a,
|
||||
const __GLcontextModes * b)
|
||||
{
|
||||
return ((a->rgbMode == b->rgbMode) &&
|
||||
(a->floatMode == b->floatMode) &&
|
||||
(a->colorIndexMode == b->colorIndexMode) &&
|
||||
(a->doubleBufferMode == b->doubleBufferMode) &&
|
||||
(a->stereoMode == b->stereoMode) &&
|
||||
(a->redBits == b->redBits) &&
|
||||
(a->greenBits == b->greenBits) &&
|
||||
(a->blueBits == b->blueBits) &&
|
||||
(a->alphaBits == b->alphaBits) &&
|
||||
#if 0 /* For some reason these don't get set on the client-side in libGL. */
|
||||
(a->redMask == b->redMask) &&
|
||||
(a->greenMask == b->greenMask) &&
|
||||
(a->blueMask == b->blueMask) &&
|
||||
(a->alphaMask == b->alphaMask) &&
|
||||
#endif
|
||||
(a->rgbBits == b->rgbBits) &&
|
||||
(a->indexBits == b->indexBits) &&
|
||||
(a->accumRedBits == b->accumRedBits) &&
|
||||
(a->accumGreenBits == b->accumGreenBits) &&
|
||||
(a->accumBlueBits == b->accumBlueBits) &&
|
||||
(a->accumAlphaBits == b->accumAlphaBits) &&
|
||||
(a->depthBits == b->depthBits) &&
|
||||
(a->stencilBits == b->stencilBits) &&
|
||||
(a->numAuxBuffers == b->numAuxBuffers) &&
|
||||
(a->level == b->level) &&
|
||||
(a->visualRating == b->visualRating) &&
|
||||
|
||||
(a->transparentPixel == b->transparentPixel) &&
|
||||
|
||||
((a->transparentPixel != GLX_TRANSPARENT_RGB) ||
|
||||
((a->transparentRed == b->transparentRed) &&
|
||||
(a->transparentGreen == b->transparentGreen) &&
|
||||
(a->transparentBlue == b->transparentBlue) &&
|
||||
(a->transparentAlpha == b->transparentAlpha))) &&
|
||||
|
||||
((a->transparentPixel != GLX_TRANSPARENT_INDEX) ||
|
||||
(a->transparentIndex == b->transparentIndex)) &&
|
||||
|
||||
(a->sampleBuffers == b->sampleBuffers) &&
|
||||
(a->samples == b->samples) &&
|
||||
((a->drawableType & b->drawableType) != 0) &&
|
||||
(a->renderType == b->renderType) &&
|
||||
(a->maxPbufferWidth == b->maxPbufferWidth) &&
|
||||
(a->maxPbufferHeight == b->maxPbufferHeight) &&
|
||||
(a->maxPbufferPixels == b->maxPbufferPixels) &&
|
||||
(a->optimalPbufferWidth == b->optimalPbufferWidth) &&
|
||||
(a->optimalPbufferHeight == b->optimalPbufferHeight) &&
|
||||
(a->swapMethod == b->swapMethod) &&
|
||||
(a->bindToTextureRgb == b->bindToTextureRgb) &&
|
||||
(a->bindToTextureRgba == b->bindToTextureRgba) &&
|
||||
(a->bindToMipmapTexture == b->bindToMipmapTexture) &&
|
||||
(a->bindToTextureTargets == b->bindToTextureTargets) &&
|
||||
(a->yInverted == b->yInverted));
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright IBM Corporation 2003
|
||||
* 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
|
||||
* on 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
|
||||
* VA LINUX SYSTEM, IBM AND/OR THEIR 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file glcontextmodes.h
|
||||
* \author Ian Romanick <idr@us.ibm.com>
|
||||
*/
|
||||
|
||||
#ifndef GLCONTEXTMODES_H
|
||||
#define GLCONTEXTMODES_H
|
||||
|
||||
#if !defined(IN_MINI_GLX)
|
||||
extern GLint
|
||||
_gl_convert_from_x_visual_type(int visualType);
|
||||
extern GLint
|
||||
_gl_convert_to_x_visual_type(int visualType);
|
||||
extern void
|
||||
_gl_copy_visual_to_context_mode(__GLcontextModes * mode,
|
||||
const __GLXvisualConfig * config);
|
||||
extern int
|
||||
_gl_get_context_mode_data(const __GLcontextModes *mode, int attribute,
|
||||
int *value_return);
|
||||
#endif /* !defined(IN_MINI_GLX) */
|
||||
|
||||
extern __GLcontextModes *
|
||||
_gl_context_modes_create(unsigned count, size_t minimum_size);
|
||||
extern void
|
||||
_gl_context_modes_destroy(__GLcontextModes * modes);
|
||||
extern __GLcontextModes *
|
||||
_gl_context_modes_find_visual(__GLcontextModes *modes, int vid);
|
||||
extern __GLcontextModes *
|
||||
_gl_context_modes_find_fbconfig(__GLcontextModes *modes, int fbid);
|
||||
extern GLboolean
|
||||
_gl_context_modes_are_same(const __GLcontextModes * a,
|
||||
const __GLcontextModes * b);
|
||||
|
||||
#endif /* GLCONTEXTMODES_H */
|
|
@ -1,667 +0,0 @@
|
|||
/*
|
||||
* GLX implementation that uses Apple's OpenGL.framework
|
||||
* (Indirect rendering path -- it's also used for some direct mode code too)
|
||||
*
|
||||
* Copyright (c) 2007-2012 Apple Inc.
|
||||
* Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved.
|
||||
* Copyright (c) 2002 Greg Parker. All Rights Reserved.
|
||||
*
|
||||
* Portions of this file are copied from Mesa's xf86glx.c,
|
||||
* which contains the following copyright:
|
||||
*
|
||||
* Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include <OpenGL/OpenGL.h>
|
||||
#include <OpenGL/gl.h> /* Just to prevent glxserver.h from loading mesa's and colliding with OpenGL.h */
|
||||
|
||||
#include <X11/Xproto.h>
|
||||
#include <GL/glxproto.h>
|
||||
|
||||
#include <glxserver.h>
|
||||
#include <glxutil.h>
|
||||
|
||||
#include "x-hash.h"
|
||||
|
||||
#include "visualConfigs.h"
|
||||
#include "dri.h"
|
||||
#include "extension_string.h"
|
||||
|
||||
#include "darwin.h"
|
||||
#define GLAQUA_DEBUG_MSG(msg, args ...) ASL_LOG(ASL_LEVEL_DEBUG, "GLXAqua", \
|
||||
msg, \
|
||||
## args)
|
||||
|
||||
__GLXprovider *
|
||||
GlxGetDRISWrastProvider(void);
|
||||
|
||||
static void
|
||||
setup_dispatch_table(void);
|
||||
GLuint
|
||||
__glFloorLog2(GLuint val);
|
||||
void
|
||||
warn_func(void * p1, char *format, ...);
|
||||
|
||||
// some prototypes
|
||||
static __GLXscreen *
|
||||
__glXAquaScreenProbe(ScreenPtr pScreen);
|
||||
static __GLXdrawable *
|
||||
__glXAquaScreenCreateDrawable(ClientPtr client, __GLXscreen *screen,
|
||||
DrawablePtr pDraw, XID drawId, int type,
|
||||
XID glxDrawId,
|
||||
__GLXconfig *conf);
|
||||
|
||||
static void
|
||||
__glXAquaContextDestroy(__GLXcontext *baseContext);
|
||||
static int
|
||||
__glXAquaContextMakeCurrent(__GLXcontext *baseContext);
|
||||
static int
|
||||
__glXAquaContextLoseCurrent(__GLXcontext *baseContext);
|
||||
static int
|
||||
__glXAquaContextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc,
|
||||
unsigned long mask);
|
||||
|
||||
static CGLPixelFormatObj
|
||||
makeFormat(__GLXconfig *conf);
|
||||
|
||||
__GLXprovider __glXDRISWRastProvider = {
|
||||
__glXAquaScreenProbe,
|
||||
"Core OpenGL",
|
||||
NULL
|
||||
};
|
||||
|
||||
typedef struct __GLXAquaScreen __GLXAquaScreen;
|
||||
typedef struct __GLXAquaContext __GLXAquaContext;
|
||||
typedef struct __GLXAquaDrawable __GLXAquaDrawable;
|
||||
|
||||
/*
|
||||
* The following structs must keep the base as the first member.
|
||||
* It's used to treat the start of the struct as a different struct
|
||||
* in GLX.
|
||||
*
|
||||
* Note: these structs should be initialized with xcalloc or memset
|
||||
* prior to usage, and some of them require initializing
|
||||
* the base with function pointers.
|
||||
*/
|
||||
struct __GLXAquaScreen {
|
||||
__GLXscreen base;
|
||||
};
|
||||
|
||||
struct __GLXAquaContext {
|
||||
__GLXcontext base;
|
||||
CGLContextObj ctx;
|
||||
CGLPixelFormatObj pixelFormat;
|
||||
xp_surface_id sid;
|
||||
unsigned isAttached : 1;
|
||||
};
|
||||
|
||||
struct __GLXAquaDrawable {
|
||||
__GLXdrawable base;
|
||||
DrawablePtr pDraw;
|
||||
xp_surface_id sid;
|
||||
__GLXAquaContext *context;
|
||||
};
|
||||
|
||||
static __GLXcontext *
|
||||
__glXAquaScreenCreateContext(__GLXscreen *screen,
|
||||
__GLXconfig *conf,
|
||||
__GLXcontext *baseShareContext,
|
||||
unsigned num_attribs,
|
||||
const uint32_t *attribs,
|
||||
int *error)
|
||||
{
|
||||
__GLXAquaContext *context;
|
||||
__GLXAquaContext *shareContext = (__GLXAquaContext *)baseShareContext;
|
||||
CGLError gl_err;
|
||||
|
||||
/* Unused (for now?) */
|
||||
(void)num_attribs;
|
||||
(void)attribs;
|
||||
(void)error;
|
||||
|
||||
GLAQUA_DEBUG_MSG("glXAquaScreenCreateContext\n");
|
||||
|
||||
context = calloc(1, sizeof(__GLXAquaContext));
|
||||
|
||||
if (context == NULL)
|
||||
return NULL;
|
||||
|
||||
memset(context, 0, sizeof *context);
|
||||
|
||||
context->base.pGlxScreen = screen;
|
||||
context->base.config = conf;
|
||||
context->base.destroy = __glXAquaContextDestroy;
|
||||
context->base.makeCurrent = __glXAquaContextMakeCurrent;
|
||||
context->base.loseCurrent = __glXAquaContextLoseCurrent;
|
||||
context->base.copy = __glXAquaContextCopy;
|
||||
/*FIXME verify that the context->base is fully initialized. */
|
||||
|
||||
context->pixelFormat = makeFormat(conf);
|
||||
|
||||
if (!context->pixelFormat) {
|
||||
free(context);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
context->ctx = NULL;
|
||||
gl_err = CGLCreateContext(context->pixelFormat,
|
||||
shareContext ? shareContext->ctx : NULL,
|
||||
&context->ctx);
|
||||
|
||||
if (gl_err != 0) {
|
||||
ErrorF("CGLCreateContext error: %s\n", CGLErrorString(gl_err));
|
||||
CGLDestroyPixelFormat(context->pixelFormat);
|
||||
free(context);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
setup_dispatch_table();
|
||||
GLAQUA_DEBUG_MSG("glAquaCreateContext done\n");
|
||||
|
||||
return &context->base;
|
||||
}
|
||||
|
||||
/* maps from surface id -> list of __GLcontext */
|
||||
static x_hash_table *surface_hash;
|
||||
|
||||
static void
|
||||
__glXAquaContextDestroy(__GLXcontext *baseContext)
|
||||
{
|
||||
x_list *lst;
|
||||
|
||||
__GLXAquaContext *context = (__GLXAquaContext *)baseContext;
|
||||
|
||||
GLAQUA_DEBUG_MSG("glAquaContextDestroy (ctx %p)\n", baseContext);
|
||||
if (context != NULL) {
|
||||
if (context->sid != 0 && surface_hash != NULL) {
|
||||
lst =
|
||||
x_hash_table_lookup(surface_hash, x_cvt_uint_to_vptr(
|
||||
context->sid), NULL);
|
||||
lst = x_list_remove(lst, context);
|
||||
x_hash_table_insert(surface_hash, x_cvt_uint_to_vptr(
|
||||
context->sid), lst);
|
||||
}
|
||||
|
||||
if (context->ctx != NULL)
|
||||
CGLDestroyContext(context->ctx);
|
||||
|
||||
if (context->pixelFormat != NULL)
|
||||
CGLDestroyPixelFormat(context->pixelFormat);
|
||||
|
||||
free(context);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
__glXAquaContextLoseCurrent(__GLXcontext *baseContext)
|
||||
{
|
||||
CGLError gl_err;
|
||||
|
||||
GLAQUA_DEBUG_MSG("glAquaLoseCurrent (ctx 0x%p)\n", baseContext);
|
||||
|
||||
gl_err = CGLSetCurrentContext(NULL);
|
||||
if (gl_err != 0)
|
||||
ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
|
||||
|
||||
/*
|
||||
* There should be no need to set __glXLastContext to NULL here, because
|
||||
* glxcmds.c does it as part of the context cache flush after calling
|
||||
* this.
|
||||
*/
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
/* Called when a surface is destroyed as a side effect of destroying
|
||||
the window it's attached to. */
|
||||
static void
|
||||
surface_notify(void *_arg, void *data)
|
||||
{
|
||||
DRISurfaceNotifyArg *arg = (DRISurfaceNotifyArg *)_arg;
|
||||
__GLXAquaDrawable *draw = (__GLXAquaDrawable *)data;
|
||||
__GLXAquaContext *context;
|
||||
x_list *lst;
|
||||
if (_arg == NULL || data == NULL) {
|
||||
ErrorF("surface_notify called with bad params");
|
||||
return;
|
||||
}
|
||||
|
||||
GLAQUA_DEBUG_MSG("surface_notify(%p, %p)\n", _arg, data);
|
||||
switch (arg->kind) {
|
||||
case AppleDRISurfaceNotifyDestroyed:
|
||||
if (surface_hash != NULL)
|
||||
x_hash_table_remove(surface_hash, x_cvt_uint_to_vptr(arg->id));
|
||||
draw->pDraw = NULL;
|
||||
draw->sid = 0;
|
||||
break;
|
||||
|
||||
case AppleDRISurfaceNotifyChanged:
|
||||
if (surface_hash != NULL) {
|
||||
lst =
|
||||
x_hash_table_lookup(surface_hash, x_cvt_uint_to_vptr(
|
||||
arg->id), NULL);
|
||||
for (; lst != NULL; lst = lst->next) {
|
||||
context = lst->data;
|
||||
xp_update_gl_context(context->ctx);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ErrorF("surface_notify: unknown kind %d\n", arg->kind);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static BOOL
|
||||
attach(__GLXAquaContext *context, __GLXAquaDrawable *draw)
|
||||
{
|
||||
DrawablePtr pDraw;
|
||||
|
||||
GLAQUA_DEBUG_MSG("attach(%p, %p)\n", context, draw);
|
||||
|
||||
if (NULL == context || NULL == draw)
|
||||
return TRUE;
|
||||
|
||||
pDraw = draw->base.pDraw;
|
||||
|
||||
if (NULL == pDraw) {
|
||||
ErrorF("%s:%s() pDraw is NULL!\n", __FILE__, __func__);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (draw->sid == 0) {
|
||||
//if (!quartzProcs->CreateSurface(pDraw->pScreen, pDraw->id, pDraw,
|
||||
if (!DRICreateSurface(pDraw->pScreen, pDraw->id, pDraw,
|
||||
0, &draw->sid, NULL,
|
||||
surface_notify, draw))
|
||||
return TRUE;
|
||||
draw->pDraw = pDraw;
|
||||
}
|
||||
|
||||
if (!context->isAttached || context->sid != draw->sid) {
|
||||
x_list *lst;
|
||||
|
||||
if (xp_attach_gl_context(context->ctx, draw->sid) != Success) {
|
||||
//quartzProcs->DestroySurface(pDraw->pScreen, pDraw->id, pDraw,
|
||||
DRIDestroySurface(pDraw->pScreen, pDraw->id, pDraw,
|
||||
surface_notify, draw);
|
||||
if (surface_hash != NULL)
|
||||
x_hash_table_remove(surface_hash,
|
||||
x_cvt_uint_to_vptr(draw->sid));
|
||||
|
||||
draw->sid = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
context->isAttached = TRUE;
|
||||
context->sid = draw->sid;
|
||||
|
||||
if (surface_hash == NULL)
|
||||
surface_hash = x_hash_table_new(NULL, NULL, NULL, NULL);
|
||||
|
||||
lst =
|
||||
x_hash_table_lookup(surface_hash, x_cvt_uint_to_vptr(
|
||||
context->sid), NULL);
|
||||
if (x_list_find(lst, context) == NULL) {
|
||||
lst = x_list_prepend(lst, context);
|
||||
x_hash_table_insert(surface_hash, x_cvt_uint_to_vptr(
|
||||
context->sid), lst);
|
||||
}
|
||||
|
||||
GLAQUA_DEBUG_MSG("attached 0x%x to 0x%x\n", (unsigned int)pDraw->id,
|
||||
(unsigned int)draw->sid);
|
||||
}
|
||||
|
||||
draw->context = context;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if 0 // unused
|
||||
static void
|
||||
unattach(__GLXAquaContext *context)
|
||||
{
|
||||
x_list *lst;
|
||||
GLAQUA_DEBUG_MSG("unattach\n");
|
||||
if (context == NULL) {
|
||||
ErrorF("Tried to unattach a null context\n");
|
||||
return;
|
||||
}
|
||||
if (context->isAttached) {
|
||||
GLAQUA_DEBUG_MSG("unattaching\n");
|
||||
|
||||
if (surface_hash != NULL) {
|
||||
lst = x_hash_table_lookup(surface_hash, (void *)context->sid,
|
||||
NULL);
|
||||
lst = x_list_remove(lst, context);
|
||||
x_hash_table_insert(surface_hash, (void *)context->sid, lst);
|
||||
}
|
||||
|
||||
CGLClearDrawable(context->ctx);
|
||||
context->isAttached = FALSE;
|
||||
context->sid = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
__glXAquaContextMakeCurrent(__GLXcontext *baseContext)
|
||||
{
|
||||
CGLError gl_err;
|
||||
__GLXAquaContext *context = (__GLXAquaContext *)baseContext;
|
||||
__GLXAquaDrawable *drawPriv = (__GLXAquaDrawable *)context->base.drawPriv;
|
||||
|
||||
GLAQUA_DEBUG_MSG("glAquaMakeCurrent (ctx 0x%p)\n", baseContext);
|
||||
|
||||
if (context->base.drawPriv != context->base.readPriv)
|
||||
return 0;
|
||||
|
||||
if (attach(context, drawPriv))
|
||||
return /*error*/ 0;
|
||||
|
||||
gl_err = CGLSetCurrentContext(context->ctx);
|
||||
if (gl_err != 0)
|
||||
ErrorF("CGLSetCurrentContext error: %s\n", CGLErrorString(gl_err));
|
||||
|
||||
return gl_err == 0;
|
||||
}
|
||||
|
||||
static int
|
||||
__glXAquaContextCopy(__GLXcontext *baseDst, __GLXcontext *baseSrc,
|
||||
unsigned long mask)
|
||||
{
|
||||
CGLError gl_err;
|
||||
|
||||
__GLXAquaContext *dst = (__GLXAquaContext *)baseDst;
|
||||
__GLXAquaContext *src = (__GLXAquaContext *)baseSrc;
|
||||
|
||||
GLAQUA_DEBUG_MSG("GLXAquaContextCopy\n");
|
||||
|
||||
gl_err = CGLCopyContext(src->ctx, dst->ctx, mask);
|
||||
if (gl_err != 0)
|
||||
ErrorF("CGLCopyContext error: %s\n", CGLErrorString(gl_err));
|
||||
|
||||
return gl_err == 0;
|
||||
}
|
||||
|
||||
/* Drawing surface notification callbacks */
|
||||
static GLboolean
|
||||
__glXAquaDrawableSwapBuffers(ClientPtr client, __GLXdrawable *base)
|
||||
{
|
||||
CGLError err;
|
||||
__GLXAquaDrawable *drawable;
|
||||
|
||||
// GLAQUA_DEBUG_MSG("glAquaDrawableSwapBuffers(%p)\n",base);
|
||||
|
||||
if (!base) {
|
||||
ErrorF("%s passed NULL\n", __func__);
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
drawable = (__GLXAquaDrawable *)base;
|
||||
|
||||
if (NULL == drawable->context) {
|
||||
ErrorF("%s called with a NULL->context for drawable %p!\n",
|
||||
__func__, (void *)drawable);
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
err = CGLFlushDrawable(drawable->context->ctx);
|
||||
|
||||
if (kCGLNoError != err) {
|
||||
ErrorF("CGLFlushDrawable error: %s in %s\n", CGLErrorString(err),
|
||||
__func__);
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
static CGLPixelFormatObj
|
||||
makeFormat(__GLXconfig *conf)
|
||||
{
|
||||
CGLPixelFormatAttribute attr[64];
|
||||
CGLPixelFormatObj fobj;
|
||||
GLint formats;
|
||||
CGLError error;
|
||||
int i = 0;
|
||||
|
||||
if (conf->doubleBufferMode)
|
||||
attr[i++] = kCGLPFADoubleBuffer;
|
||||
|
||||
if (conf->stereoMode)
|
||||
attr[i++] = kCGLPFAStereo;
|
||||
|
||||
attr[i++] = kCGLPFAColorSize;
|
||||
attr[i++] = conf->redBits + conf->greenBits + conf->blueBits;
|
||||
attr[i++] = kCGLPFAAlphaSize;
|
||||
attr[i++] = conf->alphaBits;
|
||||
|
||||
if ((conf->accumRedBits + conf->accumGreenBits + conf->accumBlueBits +
|
||||
conf->accumAlphaBits) > 0) {
|
||||
|
||||
attr[i++] = kCGLPFAAccumSize;
|
||||
attr[i++] = conf->accumRedBits + conf->accumGreenBits
|
||||
+ conf->accumBlueBits + conf->accumAlphaBits;
|
||||
}
|
||||
|
||||
attr[i++] = kCGLPFADepthSize;
|
||||
attr[i++] = conf->depthBits;
|
||||
|
||||
if (conf->stencilBits) {
|
||||
attr[i++] = kCGLPFAStencilSize;
|
||||
attr[i++] = conf->stencilBits;
|
||||
}
|
||||
|
||||
if (conf->numAuxBuffers > 0) {
|
||||
attr[i++] = kCGLPFAAuxBuffers;
|
||||
attr[i++] = conf->numAuxBuffers;
|
||||
}
|
||||
|
||||
if (conf->sampleBuffers > 0) {
|
||||
attr[i++] = kCGLPFASampleBuffers;
|
||||
attr[i++] = conf->sampleBuffers;
|
||||
attr[i++] = kCGLPFASamples;
|
||||
attr[i++] = conf->samples;
|
||||
}
|
||||
|
||||
attr[i] = 0;
|
||||
|
||||
error = CGLChoosePixelFormat(attr, &fobj, &formats);
|
||||
if (error) {
|
||||
ErrorF("error: creating pixel format %s\n", CGLErrorString(error));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return fobj;
|
||||
}
|
||||
|
||||
static void
|
||||
__glXAquaScreenDestroy(__GLXscreen *screen)
|
||||
{
|
||||
|
||||
GLAQUA_DEBUG_MSG("glXAquaScreenDestroy(%p)\n", screen);
|
||||
__glXScreenDestroy(screen);
|
||||
|
||||
free(screen);
|
||||
}
|
||||
|
||||
/* This is called by __glXInitScreens(). */
|
||||
static __GLXscreen *
|
||||
__glXAquaScreenProbe(ScreenPtr pScreen)
|
||||
{
|
||||
__GLXAquaScreen *screen;
|
||||
|
||||
GLAQUA_DEBUG_MSG("glXAquaScreenProbe\n");
|
||||
|
||||
if (pScreen == NULL)
|
||||
return NULL;
|
||||
|
||||
screen = calloc(1, sizeof *screen);
|
||||
|
||||
if (NULL == screen)
|
||||
return NULL;
|
||||
|
||||
screen->base.destroy = __glXAquaScreenDestroy;
|
||||
screen->base.createContext = __glXAquaScreenCreateContext;
|
||||
screen->base.createDrawable = __glXAquaScreenCreateDrawable;
|
||||
screen->base.swapInterval = /*FIXME*/ NULL;
|
||||
screen->base.pScreen = pScreen;
|
||||
|
||||
screen->base.fbconfigs = __glXAquaCreateVisualConfigs(
|
||||
&screen->base.numFBConfigs, pScreen->myNum);
|
||||
|
||||
__glXInitExtensionEnableBits(screen->base.glx_enable_bits);
|
||||
__glXScreenInit(&screen->base, 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
|
||||
* offset in memory.
|
||||
* Is this safe with strict aliasing? I noticed that the other dri code
|
||||
* does this too...
|
||||
*/
|
||||
__GLXAquaDrawable *glxPriv = (__GLXAquaDrawable *)base;
|
||||
|
||||
GLAQUA_DEBUG_MSG("TRACE");
|
||||
|
||||
/* It doesn't work to call DRIDestroySurface here, the drawable's
|
||||
already gone.. But dri.c notices the window destruction and
|
||||
frees the surface itself. */
|
||||
|
||||
/*gstaplin: verify the statement above. The surface destroy
|
||||
*messages weren't making it through, and may still not be.
|
||||
*We need a good test case for surface creation and destruction.
|
||||
*We also need a good way to enable introspection on the server
|
||||
*to validate the test, beyond using gdb with print.
|
||||
*/
|
||||
|
||||
free(glxPriv);
|
||||
}
|
||||
|
||||
static __GLXdrawable *
|
||||
__glXAquaScreenCreateDrawable(ClientPtr client,
|
||||
__GLXscreen *screen,
|
||||
DrawablePtr pDraw,
|
||||
XID drawId,
|
||||
int type,
|
||||
XID glxDrawId,
|
||||
__GLXconfig *conf)
|
||||
{
|
||||
__GLXAquaDrawable *glxPriv;
|
||||
|
||||
glxPriv = malloc(sizeof *glxPriv);
|
||||
|
||||
if (glxPriv == NULL)
|
||||
return NULL;
|
||||
|
||||
memset(glxPriv, 0, sizeof *glxPriv);
|
||||
|
||||
if (!__glXDrawableInit(&glxPriv->base, screen, pDraw, type, glxDrawId,
|
||||
conf)) {
|
||||
free(glxPriv);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
glxPriv->base.destroy = __glXAquaDrawableDestroy;
|
||||
glxPriv->base.swapBuffers = __glXAquaDrawableSwapBuffers;
|
||||
glxPriv->base.copySubBuffer = NULL; /* __glXAquaDrawableCopySubBuffer; */
|
||||
|
||||
glxPriv->pDraw = pDraw;
|
||||
glxPriv->sid = 0;
|
||||
glxPriv->context = NULL;
|
||||
|
||||
return &glxPriv->base;
|
||||
}
|
||||
|
||||
// Extra goodies for glx
|
||||
|
||||
GLuint
|
||||
__glFloorLog2(GLuint val)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
while (val > 1) {
|
||||
c++;
|
||||
val >>= 1;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
#ifndef OPENGL_FRAMEWORK_PATH
|
||||
#define OPENGL_FRAMEWORK_PATH \
|
||||
"/System/Library/Frameworks/OpenGL.framework/OpenGL"
|
||||
#endif
|
||||
|
||||
static void *opengl_framework_handle;
|
||||
|
||||
static glx_func_ptr
|
||||
get_proc_address(const char *sym)
|
||||
{
|
||||
return (glx_func_ptr) dlsym(opengl_framework_handle, sym);
|
||||
}
|
||||
|
||||
static void
|
||||
setup_dispatch_table(void)
|
||||
{
|
||||
const char *opengl_framework_path;
|
||||
|
||||
if (opengl_framework_handle) {
|
||||
return;
|
||||
}
|
||||
|
||||
opengl_framework_path = getenv("OPENGL_FRAMEWORK_PATH");
|
||||
if (!opengl_framework_path) {
|
||||
opengl_framework_path = OPENGL_FRAMEWORK_PATH;
|
||||
}
|
||||
|
||||
(void)dlerror(); /*drain dlerror */
|
||||
opengl_framework_handle = dlopen(opengl_framework_path, RTLD_LOCAL);
|
||||
|
||||
if (!opengl_framework_handle) {
|
||||
ErrorF("unable to dlopen %s : %s, using RTLD_DEFAULT\n",
|
||||
opengl_framework_path, dlerror());
|
||||
opengl_framework_handle = RTLD_DEFAULT;
|
||||
}
|
||||
|
||||
__glXsetGetProcAddress(get_proc_address);
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
libcglcore = static_library('CGLCore',
|
||||
['indirect.c', 'capabilities.c', 'visualConfigs.c'],
|
||||
include_directories: [inc, glx_inc, '..', '../xpr'],
|
||||
dependencies: [xproto_dep, pixman_dep],
|
||||
)
|
|
@ -1,282 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2007, 2008 Apple Inc.
|
||||
* Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved.
|
||||
* Copyright (c) 2002 Greg Parker. All Rights Reserved.
|
||||
*
|
||||
* Portions of this file are copied from Mesa's xf86glx.c,
|
||||
* which contains the following copyright:
|
||||
*
|
||||
* Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "dri.h"
|
||||
|
||||
#include <OpenGL/OpenGL.h>
|
||||
#include <OpenGL/gl.h>
|
||||
#include <OpenGL/glext.h>
|
||||
#include <OpenGL/CGLContext.h>
|
||||
|
||||
#include <GL/glxproto.h>
|
||||
#include <windowstr.h>
|
||||
#include <resource.h>
|
||||
#include <GL/glxint.h>
|
||||
#include <GL/glxtokens.h>
|
||||
#include <scrnintstr.h>
|
||||
#include <glxserver.h>
|
||||
#include <glxscreens.h>
|
||||
#include <glxdrawable.h>
|
||||
#include <glxcontext.h>
|
||||
#include <glxext.h>
|
||||
#include <glxutil.h>
|
||||
|
||||
#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. */
|
||||
__GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber) {
|
||||
int numConfigs = 0;
|
||||
__GLXconfig *visualConfigs, *c;
|
||||
struct glCapabilities caps;
|
||||
struct glCapabilitiesConfig *conf;
|
||||
int stereo, depth, aux, buffers, stencil, accum, color, msample;
|
||||
|
||||
if(getGlCapabilities(&caps)) {
|
||||
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->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);
|
||||
|
||||
numConfigs = 0;
|
||||
|
||||
for(conf = caps.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);
|
||||
}
|
||||
|
||||
if(numConfigsPtr)
|
||||
*numConfigsPtr = numConfigs;
|
||||
|
||||
visualConfigs = calloc(sizeof(*visualConfigs), numConfigs);
|
||||
|
||||
if(NULL == visualConfigs) {
|
||||
ErrorF("xcalloc failure when allocating visualConfigs\n");
|
||||
freeGlCapabilities(&caps);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
// Global
|
||||
c->visualID = -1;
|
||||
c->visualType = GLX_TRUE_COLOR;
|
||||
c->next = c + 1;
|
||||
|
||||
c->level = 0;
|
||||
c->indexBits = 0;
|
||||
|
||||
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;
|
||||
|
||||
// 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;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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->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;
|
||||
|
||||
/* EXT_framebuffer_sRGB */
|
||||
c->sRGBCapable = GL_FALSE;
|
||||
|
||||
c = c->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
(c-1)->next = NULL;
|
||||
|
||||
if (c - visualConfigs != numConfigs) {
|
||||
FatalError("numConfigs calculation error in setVisualConfigs! numConfigs is %d i is %d\n", numConfigs, (int)(c - visualConfigs));
|
||||
}
|
||||
|
||||
freeGlCapabilities(&caps);
|
||||
return visualConfigs;
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2008 Apple Inc.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef VISUAL_CONFIGS_H
|
||||
#define VISUAL_CONFIGS_H
|
||||
|
||||
__GLXconfig *
|
||||
__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber);
|
||||
|
||||
#endif
|
|
@ -1,128 +0,0 @@
|
|||
/* X11Application.h -- subclass of NSApplication to multiplex events
|
||||
*
|
||||
* Copyright (c) 2002-2012 Apple 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, 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 X11APPLICATION_H
|
||||
#define X11APPLICATION_H 1
|
||||
|
||||
#if __OBJC__
|
||||
|
||||
#import "X11Controller.h"
|
||||
|
||||
@interface X11Application : NSApplication {
|
||||
X11Controller *_controller;
|
||||
|
||||
unsigned int _x_active : 1;
|
||||
}
|
||||
|
||||
- (void)set_controller:controller;
|
||||
- (void)set_window_menu:(NSArray *)list;
|
||||
|
||||
- (CFPropertyListRef)prefs_get_copy:(NSString *)key CF_RETURNS_RETAINED;
|
||||
- (int)prefs_get_integer:(NSString *)key default:(int)def;
|
||||
- (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
|
||||
NS_RETURNS_RETAINED;
|
||||
- (NSArray *)prefs_get_array:(NSString *)key;
|
||||
- (void)prefs_set_integer:(NSString *)key value:(int)value;
|
||||
- (void)prefs_set_float:(NSString *)key value:(float)value;
|
||||
- (void)prefs_set_boolean:(NSString *)key value:(int)value;
|
||||
- (void)prefs_set_array:(NSString *)key value:(NSArray *)value;
|
||||
- (void)prefs_set_string:(NSString *)key value:(NSString *)value;
|
||||
- (void)prefs_synchronize;
|
||||
|
||||
- (X11Controller *)controller;
|
||||
- (OSX_BOOL)x_active;
|
||||
@end
|
||||
|
||||
extern X11Application * X11App;
|
||||
|
||||
#endif /* __OBJC__ */
|
||||
|
||||
void
|
||||
X11ApplicationSetWindowMenu(int nitems, const char **items,
|
||||
const char *shortcuts);
|
||||
void
|
||||
X11ApplicationSetWindowMenuCheck(int idx);
|
||||
void
|
||||
X11ApplicationSetFrontProcess(void);
|
||||
void
|
||||
X11ApplicationSetCanQuit(int state);
|
||||
void
|
||||
X11ApplicationServerReady(void);
|
||||
void
|
||||
X11ApplicationShowHideMenubar(int state);
|
||||
void
|
||||
X11ApplicationLaunchClient(const char *cmd);
|
||||
|
||||
Bool
|
||||
X11ApplicationCanEnterRandR(void);
|
||||
|
||||
void
|
||||
X11ApplicationMain(int argc, char **argv, char **envp);
|
||||
|
||||
#define PREFS_APPSMENU "apps_menu"
|
||||
#define PREFS_FAKEBUTTONS "enable_fake_buttons"
|
||||
#define PREFS_KEYEQUIVS "enable_key_equivalents"
|
||||
#define PREFS_FULLSCREEN_HOTKEYS "fullscreen_hotkeys"
|
||||
#define PREFS_FULLSCREEN_MENU "fullscreen_menu"
|
||||
#define PREFS_SYNC_KEYMAP "sync_keymap"
|
||||
#define PREFS_DEPTH "depth"
|
||||
#define PREFS_NO_AUTH "no_auth"
|
||||
#define PREFS_NO_TCP "nolisten_tcp"
|
||||
#define PREFS_DONE_XINIT_CHECK "done_xinit_check"
|
||||
#define PREFS_NO_QUIT_ALERT "no_quit_alert"
|
||||
#define PREFS_NO_RANDR_ALERT "no_randr_alert"
|
||||
#define PREFS_OPTION_SENDS_ALT "option_sends_alt"
|
||||
#define PREFS_FAKE_BUTTON2 "fake_button2"
|
||||
#define PREFS_FAKE_BUTTON3 "fake_button3"
|
||||
#define PREFS_APPKIT_MODIFIERS "appkit_modifiers"
|
||||
#define PREFS_WINDOW_ITEM_MODIFIERS "window_item_modifiers"
|
||||
#define PREFS_ROOTLESS "rootless"
|
||||
#define PREFS_RENDER_EXTENSION "enable_render_extension"
|
||||
#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"
|
||||
|
||||
#define PREFS_SCROLL_IN_DEV_DIRECTION "scroll_in_device_direction"
|
||||
extern Bool XQuartzScrollInDeviceDirection;
|
||||
|
||||
#define PREFS_SYNC_PB "sync_pasteboard"
|
||||
#define PREFS_SYNC_PB_TO_CLIPBOARD "sync_pasteboard_to_clipboard"
|
||||
#define PREFS_SYNC_PB_TO_PRIMARY "sync_pasteboard_to_primary"
|
||||
#define PREFS_SYNC_CLIPBOARD_TO_PB "sync_clipboard_to_pasteboard"
|
||||
#define PREFS_SYNC_PRIMARY_ON_SELECT "sync_primary_on_select"
|
||||
|
||||
#endif /* X11APPLICATION_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -1,144 +0,0 @@
|
|||
/* X11Controller.h -- connect the IB ui
|
||||
*
|
||||
* Copyright (c) 2002-2012 Apple 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, 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 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
|
||||
|
||||
@interface X11Controller : NSObject <NSTableViewDataSource>
|
||||
{
|
||||
IBOutlet NSPanel *prefs_panel;
|
||||
|
||||
IBOutlet NSButton *fake_buttons;
|
||||
IBOutlet NSButton *enable_fullscreen;
|
||||
IBOutlet NSButton *enable_fullscreen_menu;
|
||||
IBOutlet NSTextField *enable_fullscreen_menu_text;
|
||||
IBOutlet NSButton *enable_keyequivs;
|
||||
IBOutlet NSButton *sync_keymap;
|
||||
IBOutlet NSButton *option_sends_alt;
|
||||
IBOutlet NSButton *scroll_in_device_direction;
|
||||
IBOutlet NSButton *click_through;
|
||||
IBOutlet NSButton *focus_follows_mouse;
|
||||
IBOutlet NSButton *focus_on_new_window;
|
||||
IBOutlet NSButton *enable_auth;
|
||||
IBOutlet NSButton *enable_tcp;
|
||||
IBOutlet NSButton *sync_pasteboard;
|
||||
IBOutlet NSButton *sync_pasteboard_to_clipboard;
|
||||
IBOutlet NSButton *sync_pasteboard_to_primary;
|
||||
IBOutlet NSButton *sync_clipboard_to_pasteboard;
|
||||
IBOutlet NSButton *sync_primary_immediately;
|
||||
IBOutlet NSTextField *sync_text1;
|
||||
IBOutlet NSTextField *sync_text2;
|
||||
IBOutlet NSPopUpButton *depth;
|
||||
|
||||
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 compatibility 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; // Programmatically enabled
|
||||
#endif
|
||||
IBOutlet NSMenuItem *copy_menu_item;
|
||||
IBOutlet NSMenu *dock_apps_menu;
|
||||
IBOutlet NSTableView *apps_table;
|
||||
|
||||
NSArray *apps;
|
||||
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;
|
||||
|
||||
OSX_BOOL finished_launching;
|
||||
OSX_BOOL can_quit;
|
||||
}
|
||||
|
||||
- (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;
|
||||
- (OSX_BOOL)application:(NSApplication *)app openFile:(NSString *)filename;
|
||||
|
||||
- (IBAction)apps_table_show:(id)sender;
|
||||
- (IBAction)apps_table_done:(id)sender;
|
||||
- (IBAction)apps_table_new:(id)sender;
|
||||
- (IBAction)apps_table_duplicate:(id)sender;
|
||||
- (IBAction)apps_table_delete:(id)sender;
|
||||
- (IBAction)bring_to_front:(id)sender;
|
||||
- (IBAction)close_window:(id)sender;
|
||||
- (IBAction)minimize_window:(id)sender;
|
||||
- (IBAction)zoom_window:(id)sender;
|
||||
- (IBAction)next_window:(id)sender;
|
||||
- (IBAction)previous_window:(id)sender;
|
||||
- (IBAction)enable_fullscreen_changed:(id)sender;
|
||||
- (IBAction)toggle_fullscreen:(id)sender;
|
||||
- (IBAction)prefs_changed:(id)sender;
|
||||
- (IBAction)prefs_show:(id)sender;
|
||||
- (IBAction)quit:(id)sender;
|
||||
- (IBAction)x11_help:(id)sender;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* __OBJC__ */
|
||||
|
||||
void
|
||||
X11ControllerMain(int argc, char **argv, char **envp);
|
||||
|
||||
#endif /* X11CONTROLLER_H */
|
|
@ -1,970 +0,0 @@
|
|||
/* X11Controller.m -- connect the IB ui, also the NSApp delegate
|
||||
*
|
||||
* Copyright (c) 2002-2012 Apple 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, 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.
|
||||
*/
|
||||
|
||||
#include "sanitizedCarbon.h"
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "quartzCommon.h"
|
||||
|
||||
#import "X11Controller.h"
|
||||
#import "X11Application.h"
|
||||
|
||||
#include "opaque.h"
|
||||
#include "darwin.h"
|
||||
#include "darwinEvents.h"
|
||||
#include "quartz.h"
|
||||
#include "quartzKeyboard.h"
|
||||
#include <X11/extensions/applewmconst.h>
|
||||
#include "applewmExt.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <asl.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
extern aslclient aslc;
|
||||
extern char *bundle_id_prefix;
|
||||
|
||||
@implementation X11Controller
|
||||
|
||||
- (void) awakeFromNib
|
||||
{
|
||||
X11Application *xapp = NSApp;
|
||||
NSArray *array;
|
||||
|
||||
/* Point X11Application at ourself. */
|
||||
[xapp set_controller:self];
|
||||
|
||||
array = [xapp prefs_get_array:@PREFS_APPSMENU];
|
||||
if (array != nil) {
|
||||
int count;
|
||||
|
||||
/* convert from [TITLE1 COMMAND1 TITLE2 COMMAND2 ...]
|
||||
to [[TITLE1 COMMAND1] [TITLE2 COMMAND2] ...] format. */
|
||||
|
||||
count = [array count];
|
||||
if (count > 0
|
||||
&& ![[array objectAtIndex:0] isKindOfClass:[NSArray class]]) {
|
||||
int i;
|
||||
NSMutableArray *copy, *sub;
|
||||
|
||||
copy = [NSMutableArray arrayWithCapacity:(count / 2)];
|
||||
|
||||
for (i = 0; i < count / 2; i++) {
|
||||
sub = [[NSMutableArray alloc] initWithCapacity:3];
|
||||
[sub addObject:[array objectAtIndex:i * 2]];
|
||||
[sub addObject:[array objectAtIndex:i * 2 + 1]];
|
||||
[sub addObject:@""];
|
||||
[copy addObject:sub];
|
||||
[sub release];
|
||||
}
|
||||
|
||||
array = copy;
|
||||
}
|
||||
|
||||
[self set_apps_menu:array];
|
||||
}
|
||||
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver: self
|
||||
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
|
||||
{
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
|
||||
DarwinSendDDXEvent(kXquartzControllerNotify, 2,
|
||||
AppleWMWindowMenuItem, [sender tag]);
|
||||
}
|
||||
|
||||
- (void) remove_window_menu
|
||||
{
|
||||
NSMenu *menu;
|
||||
int count, i;
|
||||
|
||||
/* Work backwards so we don't mess up the indices */
|
||||
menu = [X11App windowsMenu];
|
||||
count = [menu numberOfItems];
|
||||
for (i = count - 1; i >= windows_menu_start; i--)
|
||||
[menu removeItemAtIndex:i];
|
||||
|
||||
count = [dock_menu indexOfItem:dock_window_separator];
|
||||
for (i = 0; i < count; i++)
|
||||
[dock_menu removeItemAtIndex:0];
|
||||
}
|
||||
|
||||
- (void) install_window_menu:(NSArray *)list
|
||||
{
|
||||
NSMenu *menu;
|
||||
NSMenuItem *item;
|
||||
int first, count, i;
|
||||
|
||||
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;
|
||||
|
||||
name = [[list objectAtIndex:i] objectAtIndex:0];
|
||||
shortcut = [[list objectAtIndex:i] objectAtIndex:1];
|
||||
|
||||
if (windowItemModMask == 0 || windowItemModMask == -1)
|
||||
shortcut = @"";
|
||||
|
||||
item =
|
||||
(NSMenuItem *)[menu addItemWithTitle:name action:
|
||||
@selector
|
||||
(item_selected:) keyEquivalent:shortcut];
|
||||
[item setKeyEquivalentModifierMask:(NSUInteger)windowItemModMask];
|
||||
[item setTarget:self];
|
||||
[item setTag:i];
|
||||
[item setEnabled:YES];
|
||||
|
||||
item = (NSMenuItem *)[dock_menu insertItemWithTitle:name
|
||||
action:@selector
|
||||
(item_selected:) keyEquivalent:shortcut
|
||||
atIndex:i];
|
||||
[item setKeyEquivalentModifierMask:(NSUInteger)windowItemModMask];
|
||||
[item setTarget:self];
|
||||
[item setTag:i];
|
||||
[item setEnabled:YES];
|
||||
}
|
||||
|
||||
if (checked_window_item >= 0 && checked_window_item < count) {
|
||||
item = (NSMenuItem *)[menu itemAtIndex:first + checked_window_item];
|
||||
[item setState:NSOnState];
|
||||
item = (NSMenuItem *)[dock_menu itemAtIndex:checked_window_item];
|
||||
[item setState:NSOnState];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) remove_apps_menu
|
||||
{
|
||||
NSMenu *menu;
|
||||
NSMenuItem *item;
|
||||
int i;
|
||||
|
||||
if (apps == nil || apps_separator == nil) return;
|
||||
|
||||
menu = [apps_separator menu];
|
||||
|
||||
if (menu != nil) {
|
||||
for (i = [menu numberOfItems] - 1; i >= 0; i--) {
|
||||
item = (NSMenuItem *)[menu itemAtIndex:i];
|
||||
if ([item tag] != 0)
|
||||
[menu removeItemAtIndex:i];
|
||||
}
|
||||
}
|
||||
|
||||
if (dock_apps_menu != nil) {
|
||||
for (i = [dock_apps_menu numberOfItems] - 1; i >= 0; i--) {
|
||||
item = (NSMenuItem *)[dock_apps_menu itemAtIndex:i];
|
||||
if ([item tag] != 0)
|
||||
[dock_apps_menu removeItemAtIndex:i];
|
||||
}
|
||||
}
|
||||
|
||||
[apps release];
|
||||
apps = nil;
|
||||
}
|
||||
|
||||
- (void) prepend_apps_item:(NSArray *)list index:(int)i menu:(NSMenu *)menu
|
||||
{
|
||||
NSString *title, *shortcut = @"";
|
||||
NSArray *group;
|
||||
NSMenuItem *item;
|
||||
|
||||
group = [list objectAtIndex:i];
|
||||
title = [group objectAtIndex:0];
|
||||
if ([group count] >= 3)
|
||||
shortcut = [group objectAtIndex:2];
|
||||
|
||||
if ([title length] != 0) {
|
||||
item = (NSMenuItem *)[menu insertItemWithTitle:title
|
||||
action:@selector (
|
||||
app_selected:)
|
||||
keyEquivalent:shortcut atIndex:0];
|
||||
[item setTarget:self];
|
||||
[item setEnabled:YES];
|
||||
}
|
||||
else {
|
||||
item = (NSMenuItem *)[NSMenuItem separatorItem];
|
||||
[menu insertItem:item atIndex:0];
|
||||
}
|
||||
|
||||
[item setTag:i + 1]; /* can't be zero, so add one */
|
||||
}
|
||||
|
||||
- (void) install_apps_menu:(NSArray *)list
|
||||
{
|
||||
NSMenu *menu;
|
||||
int i, count;
|
||||
|
||||
count = [list count];
|
||||
|
||||
if (count == 0 || apps_separator == nil) return;
|
||||
|
||||
menu = [apps_separator menu];
|
||||
|
||||
for (i = count - 1; i >= 0; i--) {
|
||||
if (menu != nil)
|
||||
[self prepend_apps_item:list index:i menu:menu];
|
||||
if (dock_apps_menu != nil)
|
||||
[self prepend_apps_item:list index:i menu:dock_apps_menu];
|
||||
}
|
||||
|
||||
apps = [list retain];
|
||||
}
|
||||
|
||||
- (void) set_window_menu:(NSArray *)list
|
||||
{
|
||||
[self remove_window_menu];
|
||||
[self install_window_menu:list];
|
||||
|
||||
DarwinSendDDXEvent(kXquartzControllerNotify, 1,
|
||||
AppleWMWindowMenuNotify);
|
||||
}
|
||||
|
||||
- (void) set_window_menu_check:(NSNumber *)nn
|
||||
{
|
||||
NSMenu *menu;
|
||||
NSMenuItem *item;
|
||||
int first, count;
|
||||
int n = [nn intValue];
|
||||
|
||||
menu = [X11App windowsMenu];
|
||||
first = windows_menu_start + 1;
|
||||
count = [menu numberOfItems] - first;
|
||||
|
||||
if (checked_window_item >= 0 && checked_window_item < count) {
|
||||
item = (NSMenuItem *)[menu itemAtIndex:first + checked_window_item];
|
||||
[item setState:NSOffState];
|
||||
item = (NSMenuItem *)[dock_menu itemAtIndex:checked_window_item];
|
||||
[item setState:NSOffState];
|
||||
}
|
||||
if (n >= 0 && n < count) {
|
||||
item = (NSMenuItem *)[menu itemAtIndex:first + n];
|
||||
[item setState:NSOnState];
|
||||
item = (NSMenuItem *)[dock_menu itemAtIndex:n];
|
||||
[item setState:NSOnState];
|
||||
}
|
||||
checked_window_item = n;
|
||||
}
|
||||
|
||||
- (void) set_apps_menu:(NSArray *)list
|
||||
{
|
||||
[self remove_apps_menu];
|
||||
[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;
|
||||
int status;
|
||||
const char *newargv[4];
|
||||
char buf[128];
|
||||
char *s;
|
||||
int stdout_pipe[2];
|
||||
int stderr_pipe[2];
|
||||
|
||||
newargv[0] = [X11App prefs_get_string:@PREFS_LOGIN_SHELL default:"/bin/sh"];
|
||||
newargv[1] = "-c";
|
||||
newargv[2] = [filename UTF8String];
|
||||
newargv[3] = NULL;
|
||||
|
||||
s = getenv("DISPLAY");
|
||||
if (s == NULL || s[0] == 0) {
|
||||
snprintf(buf, sizeof(buf), ":%s", display);
|
||||
setenv("DISPLAY", buf, TRUE);
|
||||
}
|
||||
|
||||
if (&asl_log_descriptor) {
|
||||
char *asl_sender;
|
||||
aslmsg amsg = asl_new(ASL_TYPE_MSG);
|
||||
assert(amsg);
|
||||
|
||||
asprintf(&asl_sender, "%s.%s", bundle_id_prefix, newargv[2]);
|
||||
assert(asl_sender);
|
||||
for(s = asl_sender + strlen(bundle_id_prefix) + 1; *s; s++) {
|
||||
if(! ((*s >= 'a' && *s <= 'z') ||
|
||||
(*s >= 'A' && *s <= 'Z') ||
|
||||
(*s >= '0' && *s <= '9'))) {
|
||||
*s = '_';
|
||||
}
|
||||
}
|
||||
|
||||
(void)asl_set(amsg, ASL_KEY_SENDER, asl_sender);
|
||||
free(asl_sender);
|
||||
|
||||
assert(0 == pipe(stdout_pipe));
|
||||
fcntl(stdout_pipe[0], F_SETFD, FD_CLOEXEC);
|
||||
fcntl(stdout_pipe[0], F_SETFL, O_NONBLOCK);
|
||||
|
||||
assert(0 == pipe(stderr_pipe));
|
||||
fcntl(stderr_pipe[0], F_SETFD, FD_CLOEXEC);
|
||||
fcntl(stderr_pipe[0], F_SETFL, O_NONBLOCK);
|
||||
|
||||
asl_log_descriptor(aslc, amsg, ASL_LEVEL_INFO, stdout_pipe[0], ASL_LOG_DESCRIPTOR_READ);
|
||||
asl_log_descriptor(aslc, amsg, ASL_LEVEL_NOTICE, stderr_pipe[0], ASL_LOG_DESCRIPTOR_READ);
|
||||
|
||||
asl_free(amsg);
|
||||
}
|
||||
|
||||
/* 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 */
|
||||
_exit(1);
|
||||
|
||||
case 0: /* child2 */
|
||||
if (&asl_log_descriptor) {
|
||||
/* Replace our stdout/stderr */
|
||||
dup2(stdout_pipe[1], STDOUT_FILENO);
|
||||
dup2(stderr_pipe[1], STDERR_FILENO);
|
||||
}
|
||||
|
||||
/* 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);
|
||||
|
||||
execvp(newargv[0], (char * *const)newargv);
|
||||
_exit(2);
|
||||
|
||||
default: /* parent (child1) */
|
||||
_exit(0);
|
||||
}
|
||||
break;
|
||||
|
||||
default: /* parent */
|
||||
waitpid(child1, &status, 0);
|
||||
}
|
||||
|
||||
if (&asl_log_descriptor) {
|
||||
/* Close the write ends of the pipe */
|
||||
close(stdout_pipe[1]);
|
||||
close(stderr_pipe[1]);
|
||||
}
|
||||
}
|
||||
|
||||
- (void) app_selected:sender
|
||||
{
|
||||
int tag;
|
||||
NSString *item;
|
||||
|
||||
tag = [sender tag] - 1;
|
||||
if (apps == nil || tag < 0 || tag >= [apps count])
|
||||
return;
|
||||
|
||||
item = [[apps objectAtIndex:tag] objectAtIndex:1];
|
||||
|
||||
[self launch_client:item];
|
||||
}
|
||||
|
||||
- (IBAction) apps_table_show:sender
|
||||
{
|
||||
NSArray *columns;
|
||||
NSMutableArray *oldapps = nil;
|
||||
|
||||
if (table_apps != nil)
|
||||
oldapps = table_apps;
|
||||
|
||||
table_apps = [[NSMutableArray alloc] initWithCapacity:1];
|
||||
if (apps != nil)
|
||||
[table_apps addObjectsFromArray:apps];
|
||||
|
||||
columns = [apps_table tableColumns];
|
||||
[[columns objectAtIndex:0] setIdentifier:@"0"];
|
||||
[[columns objectAtIndex:1] setIdentifier:@"1"];
|
||||
[[columns objectAtIndex:2] setIdentifier:@"2"];
|
||||
|
||||
[apps_table setDataSource:self];
|
||||
[apps_table selectRowIndexes:[NSIndexSet indexSetWithIndex:0]
|
||||
byExtendingSelection:NO];
|
||||
|
||||
[[apps_table window] makeKeyAndOrderFront:sender];
|
||||
[apps_table reloadData];
|
||||
if (oldapps != nil)
|
||||
[oldapps release];
|
||||
}
|
||||
|
||||
- (IBAction) apps_table_done:sender
|
||||
{
|
||||
[apps_table deselectAll:sender]; /* flush edits? */
|
||||
|
||||
[self remove_apps_menu];
|
||||
[self install_apps_menu:table_apps];
|
||||
|
||||
[NSApp prefs_set_array:@PREFS_APPSMENU value:table_apps];
|
||||
[NSApp prefs_synchronize];
|
||||
|
||||
[[apps_table window] orderOut:sender];
|
||||
|
||||
[table_apps release];
|
||||
table_apps = nil;
|
||||
}
|
||||
|
||||
- (IBAction) apps_table_new:sender
|
||||
{
|
||||
NSMutableArray *item;
|
||||
|
||||
int row = [apps_table selectedRow], i;
|
||||
|
||||
if (row < 0) row = 0;
|
||||
else row = row + 1;
|
||||
|
||||
i = row;
|
||||
if (i > [table_apps count])
|
||||
return; /* avoid exceptions */
|
||||
|
||||
[apps_table deselectAll:sender];
|
||||
|
||||
item = [[NSMutableArray alloc] initWithCapacity:3];
|
||||
[item addObject:@""];
|
||||
[item addObject:@""];
|
||||
[item addObject:@""];
|
||||
|
||||
[table_apps insertObject:item atIndex:i];
|
||||
[item release];
|
||||
|
||||
[apps_table reloadData];
|
||||
[apps_table selectRowIndexes:[NSIndexSet indexSetWithIndex:row]
|
||||
byExtendingSelection:NO];
|
||||
}
|
||||
|
||||
- (IBAction) apps_table_duplicate:sender
|
||||
{
|
||||
int row = [apps_table selectedRow], i;
|
||||
NSObject *item;
|
||||
|
||||
if (row < 0) {
|
||||
[self apps_table_new:sender];
|
||||
return;
|
||||
}
|
||||
|
||||
i = row;
|
||||
if (i > [table_apps count] - 1) return; /* avoid exceptions */
|
||||
|
||||
[apps_table deselectAll:sender];
|
||||
|
||||
item = [[table_apps objectAtIndex:i] mutableCopy];
|
||||
[table_apps insertObject:item atIndex:i];
|
||||
[item release];
|
||||
|
||||
[apps_table reloadData];
|
||||
[apps_table selectRowIndexes:[NSIndexSet indexSetWithIndex:row +
|
||||
1] byExtendingSelection:NO];
|
||||
}
|
||||
|
||||
- (IBAction) apps_table_delete:sender
|
||||
{
|
||||
int row = [apps_table selectedRow];
|
||||
|
||||
if (row >= 0) {
|
||||
int i = row;
|
||||
|
||||
if (i > [table_apps count] - 1) return; /* avoid exceptions */
|
||||
|
||||
[apps_table deselectAll:sender];
|
||||
|
||||
[table_apps removeObjectAtIndex:i];
|
||||
}
|
||||
|
||||
[apps_table reloadData];
|
||||
|
||||
row = MIN(row, [table_apps count] - 1);
|
||||
if (row >= 0)
|
||||
[apps_table selectRowIndexes:[NSIndexSet indexSetWithIndex:row]
|
||||
byExtendingSelection:NO];
|
||||
}
|
||||
|
||||
- (NSInteger) numberOfRowsInTableView:(NSTableView *)tableView
|
||||
{
|
||||
if (table_apps == nil) return 0;
|
||||
|
||||
return [table_apps count];
|
||||
}
|
||||
|
||||
- (id) tableView:(NSTableView *)tableView
|
||||
objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
|
||||
{
|
||||
NSArray *item;
|
||||
int col;
|
||||
|
||||
if (table_apps == nil) return nil;
|
||||
|
||||
col = [[tableColumn identifier] intValue];
|
||||
|
||||
item = [table_apps objectAtIndex:row];
|
||||
if ([item count] > col)
|
||||
return [item objectAtIndex:col];
|
||||
else
|
||||
return @"";
|
||||
}
|
||||
|
||||
- (void) tableView:(NSTableView *)tableView setObjectValue:(id)object
|
||||
forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
|
||||
{
|
||||
NSMutableArray *item;
|
||||
int col;
|
||||
|
||||
if (table_apps == nil) return;
|
||||
|
||||
col = [[tableColumn identifier] intValue];
|
||||
|
||||
item = [table_apps objectAtIndex:row];
|
||||
[item replaceObjectAtIndex:col withObject:object];
|
||||
}
|
||||
|
||||
- (void) hide_window:sender
|
||||
{
|
||||
if ([X11App x_active])
|
||||
DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMHideWindow);
|
||||
else
|
||||
NSBeep(); /* FIXME: something here */
|
||||
}
|
||||
|
||||
- (IBAction)bring_to_front:sender
|
||||
{
|
||||
DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMBringAllToFront);
|
||||
}
|
||||
|
||||
- (IBAction)close_window:sender
|
||||
{
|
||||
if ([X11App x_active])
|
||||
DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMCloseWindow);
|
||||
else
|
||||
[[NSApp keyWindow] performClose:sender];
|
||||
}
|
||||
|
||||
- (IBAction)minimize_window:sender
|
||||
{
|
||||
if ([X11App x_active])
|
||||
DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMMinimizeWindow);
|
||||
else
|
||||
[[NSApp keyWindow] performMiniaturize:sender];
|
||||
}
|
||||
|
||||
- (IBAction)zoom_window:sender
|
||||
{
|
||||
if ([X11App x_active])
|
||||
DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMZoomWindow);
|
||||
else
|
||||
[[NSApp keyWindow] performZoom:sender];
|
||||
}
|
||||
|
||||
- (IBAction) next_window:sender
|
||||
{
|
||||
DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMNextWindow);
|
||||
}
|
||||
|
||||
- (IBAction) previous_window:sender
|
||||
{
|
||||
DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMPreviousWindow);
|
||||
}
|
||||
|
||||
- (IBAction) enable_fullscreen_changed:sender
|
||||
{
|
||||
XQuartzRootlessDefault = ![enable_fullscreen intValue];
|
||||
|
||||
[enable_fullscreen_menu setEnabled:!XQuartzRootlessDefault];
|
||||
[enable_fullscreen_menu_text setTextColor:XQuartzRootlessDefault ?[
|
||||
NSColor disabledControlTextColor] : [NSColor controlTextColor]];
|
||||
|
||||
DarwinSendDDXEvent(kXquartzSetRootless, 1, XQuartzRootlessDefault);
|
||||
|
||||
[NSApp prefs_set_boolean:@PREFS_ROOTLESS value:XQuartzRootlessDefault];
|
||||
[NSApp prefs_synchronize];
|
||||
}
|
||||
|
||||
- (IBAction) toggle_fullscreen:sender
|
||||
{
|
||||
DarwinSendDDXEvent(kXquartzToggleFullscreen, 0);
|
||||
}
|
||||
|
||||
- (void) set_can_quit:(OSX_BOOL)state
|
||||
{
|
||||
can_quit = state;
|
||||
}
|
||||
|
||||
- (IBAction)prefs_changed:sender
|
||||
{
|
||||
if (!sender)
|
||||
return;
|
||||
|
||||
if (sender == fake_buttons) {
|
||||
darwinFakeButtons = [fake_buttons intValue];
|
||||
[NSApp prefs_set_boolean:@PREFS_FAKEBUTTONS value:darwinFakeButtons];
|
||||
}
|
||||
else if (sender == enable_keyequivs) {
|
||||
XQuartzEnableKeyEquivalents = [enable_keyequivs intValue];
|
||||
[NSApp prefs_set_boolean:@PREFS_KEYEQUIVS value:
|
||||
XQuartzEnableKeyEquivalents];
|
||||
}
|
||||
else if (sender == sync_keymap) {
|
||||
darwinSyncKeymap = [sync_keymap intValue];
|
||||
[NSApp prefs_set_boolean:@PREFS_SYNC_KEYMAP value:darwinSyncKeymap];
|
||||
}
|
||||
else if (sender == enable_fullscreen_menu) {
|
||||
XQuartzFullscreenMenu = [enable_fullscreen_menu intValue];
|
||||
[NSApp prefs_set_boolean:@PREFS_FULLSCREEN_MENU value:
|
||||
XQuartzFullscreenMenu];
|
||||
}
|
||||
else if (sender == option_sends_alt) {
|
||||
BOOL prev_opt_sends_alt = XQuartzOptionSendsAlt;
|
||||
|
||||
XQuartzOptionSendsAlt = [option_sends_alt intValue];
|
||||
[NSApp prefs_set_boolean:@PREFS_OPTION_SENDS_ALT value:
|
||||
XQuartzOptionSendsAlt];
|
||||
|
||||
if (prev_opt_sends_alt != XQuartzOptionSendsAlt)
|
||||
QuartsResyncKeymap(TRUE);
|
||||
}
|
||||
else if (sender == click_through) {
|
||||
[NSApp prefs_set_boolean:@PREFS_CLICK_THROUGH value:[click_through
|
||||
intValue]];
|
||||
}
|
||||
else if (sender == focus_follows_mouse) {
|
||||
[NSApp prefs_set_boolean:@PREFS_FFM value:[focus_follows_mouse
|
||||
intValue]];
|
||||
}
|
||||
else if (sender == focus_on_new_window) {
|
||||
[NSApp prefs_set_boolean:@PREFS_FOCUS_ON_NEW_WINDOW value:[
|
||||
focus_on_new_window intValue]];
|
||||
}
|
||||
else if (sender == enable_auth) {
|
||||
[NSApp prefs_set_boolean:@PREFS_NO_AUTH value:![enable_auth intValue]
|
||||
];
|
||||
}
|
||||
else if (sender == enable_tcp) {
|
||||
[NSApp prefs_set_boolean:@PREFS_NO_TCP value:![enable_tcp intValue]];
|
||||
}
|
||||
else if (sender == depth) {
|
||||
[NSApp prefs_set_integer:@PREFS_DEPTH value:[depth selectedTag]];
|
||||
}
|
||||
else if (sender == sync_pasteboard) {
|
||||
BOOL pbproxy_active = [sync_pasteboard intValue];
|
||||
[NSApp prefs_set_boolean:@PREFS_SYNC_PB value:pbproxy_active];
|
||||
|
||||
[sync_pasteboard_to_clipboard setEnabled:pbproxy_active];
|
||||
[sync_pasteboard_to_primary setEnabled:pbproxy_active];
|
||||
[sync_clipboard_to_pasteboard setEnabled:pbproxy_active];
|
||||
[sync_primary_immediately setEnabled:pbproxy_active];
|
||||
|
||||
// setEnabled doesn't do this...
|
||||
[sync_text1 setTextColor:pbproxy_active ?[NSColor controlTextColor] :
|
||||
[NSColor disabledControlTextColor]];
|
||||
[sync_text2 setTextColor:pbproxy_active ?[NSColor controlTextColor] :
|
||||
[NSColor disabledControlTextColor]];
|
||||
}
|
||||
else if (sender == sync_pasteboard_to_clipboard) {
|
||||
[NSApp prefs_set_boolean:@PREFS_SYNC_PB_TO_CLIPBOARD value:[
|
||||
sync_pasteboard_to_clipboard intValue]];
|
||||
}
|
||||
else if (sender == sync_pasteboard_to_primary) {
|
||||
[NSApp prefs_set_boolean:@PREFS_SYNC_PB_TO_PRIMARY value:[
|
||||
sync_pasteboard_to_primary intValue]];
|
||||
}
|
||||
else if (sender == sync_clipboard_to_pasteboard) {
|
||||
[NSApp prefs_set_boolean:@PREFS_SYNC_CLIPBOARD_TO_PB value:[
|
||||
sync_clipboard_to_pasteboard intValue]];
|
||||
}
|
||||
else if (sender == sync_primary_immediately) {
|
||||
[NSApp prefs_set_boolean:@PREFS_SYNC_PRIMARY_ON_SELECT value:[
|
||||
sync_primary_immediately intValue]];
|
||||
}
|
||||
else if (sender == scroll_in_device_direction) {
|
||||
XQuartzScrollInDeviceDirection =
|
||||
[scroll_in_device_direction intValue];
|
||||
[NSApp prefs_set_boolean:@PREFS_SCROLL_IN_DEV_DIRECTION value:
|
||||
XQuartzScrollInDeviceDirection];
|
||||
}
|
||||
|
||||
[NSApp prefs_synchronize];
|
||||
|
||||
DarwinSendDDXEvent(kXquartzReloadPreferences, 0);
|
||||
}
|
||||
|
||||
- (IBAction) prefs_show:sender
|
||||
{
|
||||
BOOL pbproxy_active =
|
||||
[NSApp prefs_get_boolean:@PREFS_SYNC_PB default:YES];
|
||||
|
||||
// Remove preferences from the GUI which are not supported
|
||||
// TODO: Change 1117 to NSAppKitVersionNumber10_7 when it is defined
|
||||
if (scroll_in_device_direction && NSAppKitVersionNumber < 1117) {
|
||||
[scroll_in_device_direction removeFromSuperview];
|
||||
scroll_in_device_direction = nil;
|
||||
}
|
||||
else {
|
||||
[scroll_in_device_direction setIntValue:
|
||||
XQuartzScrollInDeviceDirection];
|
||||
}
|
||||
|
||||
[fake_buttons setIntValue:darwinFakeButtons];
|
||||
[enable_keyequivs setIntValue:XQuartzEnableKeyEquivalents];
|
||||
[sync_keymap setIntValue:darwinSyncKeymap];
|
||||
[option_sends_alt setIntValue:XQuartzOptionSendsAlt];
|
||||
[click_through setIntValue:[NSApp prefs_get_boolean:@PREFS_CLICK_THROUGH
|
||||
default:NO]];
|
||||
[focus_follows_mouse setIntValue:[NSApp prefs_get_boolean:@PREFS_FFM
|
||||
default:NO]];
|
||||
[focus_on_new_window setIntValue:[NSApp prefs_get_boolean:
|
||||
@PREFS_FOCUS_ON_NEW_WINDOW default:YES]
|
||||
];
|
||||
|
||||
[enable_auth setIntValue:![NSApp prefs_get_boolean:@PREFS_NO_AUTH default
|
||||
:NO]];
|
||||
[enable_tcp setIntValue:![NSApp prefs_get_boolean:@PREFS_NO_TCP default:
|
||||
NO]];
|
||||
|
||||
[depth selectItemAtIndex:[depth indexOfItemWithTag:[NSApp
|
||||
prefs_get_integer:
|
||||
@PREFS_DEPTH default:
|
||||
-1]]];
|
||||
|
||||
[sync_pasteboard setIntValue:pbproxy_active];
|
||||
[sync_pasteboard_to_clipboard setIntValue:[NSApp prefs_get_boolean:
|
||||
@PREFS_SYNC_PB_TO_CLIPBOARD
|
||||
default:YES]];
|
||||
[sync_pasteboard_to_primary setIntValue:[NSApp prefs_get_boolean:
|
||||
@PREFS_SYNC_PB_TO_PRIMARY
|
||||
default:YES]];
|
||||
[sync_clipboard_to_pasteboard setIntValue:[NSApp prefs_get_boolean:
|
||||
@PREFS_SYNC_CLIPBOARD_TO_PB
|
||||
default:YES]];
|
||||
[sync_primary_immediately setIntValue:[NSApp prefs_get_boolean:
|
||||
@PREFS_SYNC_PRIMARY_ON_SELECT
|
||||
default:NO]];
|
||||
|
||||
[sync_pasteboard_to_clipboard setEnabled:pbproxy_active];
|
||||
[sync_pasteboard_to_primary setEnabled:pbproxy_active];
|
||||
[sync_clipboard_to_pasteboard setEnabled:pbproxy_active];
|
||||
[sync_primary_immediately setEnabled:pbproxy_active];
|
||||
|
||||
// setEnabled doesn't do this...
|
||||
[sync_text1 setTextColor:pbproxy_active ?[NSColor controlTextColor] : [
|
||||
NSColor disabledControlTextColor]];
|
||||
[sync_text2 setTextColor:pbproxy_active ?[NSColor controlTextColor] : [
|
||||
NSColor disabledControlTextColor]];
|
||||
|
||||
[enable_fullscreen setIntValue:!XQuartzRootlessDefault];
|
||||
[enable_fullscreen_menu setIntValue:XQuartzFullscreenMenu];
|
||||
[enable_fullscreen_menu setEnabled:!XQuartzRootlessDefault];
|
||||
[enable_fullscreen_menu_text setTextColor:XQuartzRootlessDefault ?[
|
||||
NSColor disabledControlTextColor] : [NSColor controlTextColor]];
|
||||
|
||||
[prefs_panel makeKeyAndOrderFront:sender];
|
||||
}
|
||||
|
||||
- (IBAction) quit:sender
|
||||
{
|
||||
DarwinSendDDXEvent(kXquartzQuit, 0);
|
||||
}
|
||||
|
||||
- (IBAction) x11_help:sender
|
||||
{
|
||||
AHLookupAnchor(CFSTR("com.apple.machelp"), CFSTR("mchlp2276"));
|
||||
}
|
||||
|
||||
- (OSX_BOOL) validateMenuItem:(NSMenuItem *)item
|
||||
{
|
||||
NSMenu *menu = [item menu];
|
||||
|
||||
if (item == toggle_fullscreen_item)
|
||||
return !XQuartzIsRootless;
|
||||
else if (menu == [X11App windowsMenu] || menu == dock_menu
|
||||
|| (menu == [x11_about_item menu] && [item tag] == 42))
|
||||
return (AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
- (void) applicationDidHide:(NSNotification *)notify
|
||||
{
|
||||
DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMHideAll);
|
||||
|
||||
/* Toggle off fullscreen mode to leave our non-default video
|
||||
* mode and hide our guard window.
|
||||
*/
|
||||
if (!XQuartzIsRootless && XQuartzFullscreenVisible) {
|
||||
DarwinSendDDXEvent(kXquartzToggleFullscreen, 0);
|
||||
}
|
||||
}
|
||||
|
||||
- (void) applicationDidUnhide:(NSNotification *)notify
|
||||
{
|
||||
DarwinSendDDXEvent(kXquartzControllerNotify, 1, AppleWMShowAll);
|
||||
}
|
||||
|
||||
- (NSApplicationTerminateReply) applicationShouldTerminate:sender
|
||||
{
|
||||
NSString *msg;
|
||||
NSString *title;
|
||||
|
||||
if (can_quit ||
|
||||
[X11App prefs_get_boolean:@PREFS_NO_QUIT_ALERT default:NO])
|
||||
return NSTerminateNow;
|
||||
|
||||
/* Make sure we're frontmost. */
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
|
||||
title = NSLocalizedString(@"Do you really want to quit X11?",
|
||||
@"Dialog title when quitting");
|
||||
msg = NSLocalizedString(
|
||||
@"Any open X11 applications will stop immediately, and you will lose any unsaved changes.",
|
||||
@"Dialog when quitting");
|
||||
|
||||
/* FIXME: safe to run the alert in here? Or should we return Later
|
||||
* and then run the alert on a timer? It seems to work here, so..
|
||||
*/
|
||||
|
||||
NSInteger result = NSRunAlertPanel(title, @"%@", NSLocalizedString(@"Quit", @""),
|
||||
NSLocalizedString(@"Cancel", @""), nil, msg);
|
||||
return (result == NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel;
|
||||
}
|
||||
|
||||
- (void) applicationWillTerminate:(NSNotification *)aNotification _X_NORETURN
|
||||
{
|
||||
[X11App prefs_synchronize];
|
||||
|
||||
/* shutdown the X server, it will exit () for us. */
|
||||
DarwinSendDDXEvent(kXquartzQuit, 0);
|
||||
|
||||
/* In case it doesn't, exit anyway after 5s. */
|
||||
[NSThread sleepForTimeInterval:5.0];
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
- (void) server_ready
|
||||
{
|
||||
x_list *node;
|
||||
|
||||
finished_launching = YES;
|
||||
|
||||
for (node = pending_apps; node != NULL; node = node->next) {
|
||||
NSString *filename = node->data;
|
||||
[self launch_client:filename];
|
||||
[filename release];
|
||||
}
|
||||
|
||||
x_list_free(pending_apps);
|
||||
pending_apps = NULL;
|
||||
}
|
||||
|
||||
- (OSX_BOOL) application:(NSApplication *)app openFile:(NSString *)filename
|
||||
{
|
||||
const char *name = [filename UTF8String];
|
||||
|
||||
if (finished_launching)
|
||||
[self launch_client:filename];
|
||||
else if (name[0] != ':') /* ignore display names */
|
||||
pending_apps = x_list_prepend(pending_apps, [filename retain]);
|
||||
|
||||
/* FIXME: report failures. */
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
void
|
||||
X11ControllerMain(int argc, char **argv, char **envp)
|
||||
{
|
||||
X11ApplicationMain(argc, argv, envp);
|
||||
}
|
|
@ -1,741 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
|
||||
* Copyright (c) 2002-2012 Apple 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, 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.
|
||||
*/
|
||||
|
||||
#include "sanitizedCarbon.h"
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "quartzCommon.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "dixstruct.h"
|
||||
#include "globals.h"
|
||||
#include "extnsionst.h"
|
||||
#include "colormapst.h"
|
||||
#include "cursorstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "windowstr.h"
|
||||
#include "servermd.h"
|
||||
#include "swaprep.h"
|
||||
#include "propertyst.h"
|
||||
#include <X11/Xatom.h>
|
||||
#include "darwin.h"
|
||||
#define _APPLEWM_SERVER_
|
||||
#include <X11/extensions/applewmproto.h>
|
||||
#include "applewmExt.h"
|
||||
#include "X11Application.h"
|
||||
#include "protocol-versions.h"
|
||||
|
||||
#define DEFINE_ATOM_HELPER(func, atom_name) \
|
||||
static Atom func(void) { \
|
||||
static int generation; \
|
||||
static Atom atom; \
|
||||
if (generation != serverGeneration) { \
|
||||
generation = serverGeneration; \
|
||||
atom = MakeAtom(atom_name, strlen(atom_name), TRUE); \
|
||||
} \
|
||||
return atom; \
|
||||
}
|
||||
|
||||
DEFINE_ATOM_HELPER(xa_native_screen_origin, "_NATIVE_SCREEN_ORIGIN")
|
||||
DEFINE_ATOM_HELPER(xa_apple_no_order_in, "_APPLE_NO_ORDER_IN")
|
||||
|
||||
static AppleWMProcsPtr appleWMProcs;
|
||||
|
||||
static int WMErrorBase;
|
||||
|
||||
static unsigned char WMReqCode = 0;
|
||||
static int WMEventBase = 0;
|
||||
|
||||
static RESTYPE ClientType, EventType; /* resource types for event masks */
|
||||
static XID eventResource;
|
||||
|
||||
/* Currently selected events */
|
||||
static unsigned int eventMask = 0;
|
||||
|
||||
static int
|
||||
WMFreeClient(void *data, XID id);
|
||||
static int
|
||||
WMFreeEvents(void *data, XID id);
|
||||
static void
|
||||
SNotifyEvent(xAppleWMNotifyEvent *from, xAppleWMNotifyEvent *to);
|
||||
|
||||
typedef struct _WMEvent *WMEventPtr;
|
||||
typedef struct _WMEvent {
|
||||
WMEventPtr next;
|
||||
ClientPtr client;
|
||||
XID clientResource;
|
||||
unsigned int mask;
|
||||
} WMEventRec;
|
||||
|
||||
static inline BoxRec
|
||||
make_box(int x, int y, int w, int h)
|
||||
{
|
||||
BoxRec r;
|
||||
r.x1 = x;
|
||||
r.y1 = y;
|
||||
r.x2 = x + w;
|
||||
r.y2 = y + h;
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Updates the _NATIVE_SCREEN_ORIGIN property on the given root window. */
|
||||
void
|
||||
AppleWMSetScreenOrigin(WindowPtr pWin)
|
||||
{
|
||||
int32_t data[2];
|
||||
|
||||
data[0] = pWin->drawable.pScreen->x + darwinMainScreenX;
|
||||
data[1] = pWin->drawable.pScreen->y + darwinMainScreenY;
|
||||
|
||||
dixChangeWindowProperty(serverClient, pWin, xa_native_screen_origin(),
|
||||
XA_INTEGER, 32, PropModeReplace, 2, data, TRUE);
|
||||
}
|
||||
|
||||
/* Window managers can set the _APPLE_NO_ORDER_IN property on windows
|
||||
that are being genie-restored from the Dock. We want them to
|
||||
be mapped but remain ordered-out until the animation
|
||||
completes (when the Dock will order them in). */
|
||||
Bool
|
||||
AppleWMDoReorderWindow(WindowPtr pWin)
|
||||
{
|
||||
Atom atom;
|
||||
PropertyPtr prop;
|
||||
int rc;
|
||||
|
||||
atom = xa_apple_no_order_in();
|
||||
rc = dixLookupProperty(&prop, pWin, atom, serverClient, DixReadAccess);
|
||||
|
||||
if (Success == rc && prop->type == atom)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
ProcAppleWMQueryVersion(register ClientPtr client)
|
||||
{
|
||||
xAppleWMQueryVersionReply rep;
|
||||
|
||||
REQUEST_SIZE_MATCH(xAppleWMQueryVersionReq);
|
||||
rep.type = X_Reply;
|
||||
rep.length = 0;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
rep.majorVersion = SERVER_APPLEWM_MAJOR_VERSION;
|
||||
rep.minorVersion = SERVER_APPLEWM_MINOR_VERSION;
|
||||
rep.patchVersion = SERVER_APPLEWM_PATCH_VERSION;
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
WriteToClient(client, sizeof(xAppleWMQueryVersionReply),&rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/* events */
|
||||
|
||||
static inline void
|
||||
updateEventMask(WMEventPtr *pHead)
|
||||
{
|
||||
WMEventPtr pCur;
|
||||
|
||||
eventMask = 0;
|
||||
for (pCur = *pHead; pCur != NULL; pCur = pCur->next)
|
||||
eventMask |= pCur->mask;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static int
|
||||
WMFreeClient(void *data, XID id)
|
||||
{
|
||||
WMEventPtr pEvent;
|
||||
WMEventPtr *pHead, pCur, pPrev;
|
||||
int i;
|
||||
|
||||
pEvent = (WMEventPtr)data;
|
||||
i = dixLookupResourceByType(
|
||||
(void **)&pHead, eventResource, EventType, serverClient,
|
||||
DixReadAccess |
|
||||
DixWriteAccess | DixDestroyAccess);
|
||||
if (i == Success && pHead) {
|
||||
pPrev = 0;
|
||||
for (pCur = *pHead; pCur && pCur != pEvent; pCur = pCur->next)
|
||||
pPrev = pCur;
|
||||
if (pCur) {
|
||||
if (pPrev)
|
||||
pPrev->next = pEvent->next;
|
||||
else
|
||||
*pHead = pEvent->next;
|
||||
}
|
||||
updateEventMask(pHead);
|
||||
}
|
||||
free((void *)pEvent);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
static int
|
||||
WMFreeEvents(void *data, XID id)
|
||||
{
|
||||
WMEventPtr *pHead, pCur, pNext;
|
||||
|
||||
pHead = (WMEventPtr *)data;
|
||||
for (pCur = *pHead; pCur; pCur = pNext) {
|
||||
pNext = pCur->next;
|
||||
FreeResource(pCur->clientResource, ClientType);
|
||||
free((void *)pCur);
|
||||
}
|
||||
free((void *)pHead);
|
||||
eventMask = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
ProcAppleWMSelectInput(register ClientPtr client)
|
||||
{
|
||||
REQUEST(xAppleWMSelectInputReq);
|
||||
WMEventPtr pEvent, pNewEvent, *pHead;
|
||||
XID clientResource;
|
||||
int i;
|
||||
|
||||
REQUEST_SIZE_MATCH(xAppleWMSelectInputReq);
|
||||
i =
|
||||
dixLookupResourceByType((void **)&pHead, eventResource, EventType,
|
||||
client,
|
||||
DixWriteAccess);
|
||||
if (stuff->mask != 0) {
|
||||
if (i == Success && pHead) {
|
||||
/* check for existing entry. */
|
||||
for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
|
||||
if (pEvent->client == client) {
|
||||
pEvent->mask = stuff->mask;
|
||||
updateEventMask(pHead);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* build the entry */
|
||||
pNewEvent = (WMEventPtr)malloc(sizeof(WMEventRec));
|
||||
if (!pNewEvent)
|
||||
return BadAlloc;
|
||||
pNewEvent->next = 0;
|
||||
pNewEvent->client = client;
|
||||
pNewEvent->mask = stuff->mask;
|
||||
/*
|
||||
* add a resource that will be deleted when
|
||||
* the client goes away
|
||||
*/
|
||||
clientResource = FakeClientID(client->index);
|
||||
pNewEvent->clientResource = clientResource;
|
||||
if (!AddResource(clientResource, ClientType, (void *)pNewEvent))
|
||||
return BadAlloc;
|
||||
/*
|
||||
* create a resource to contain a pointer to the list
|
||||
* of clients selecting input. This must be indirect as
|
||||
* the list may be arbitrarily rearranged which cannot be
|
||||
* done through the resource database.
|
||||
*/
|
||||
if (i != Success || !pHead) {
|
||||
pHead = (WMEventPtr *)malloc(sizeof(WMEventPtr));
|
||||
if (!pHead ||
|
||||
!AddResource(eventResource, EventType, (void *)pHead)) {
|
||||
FreeResource(clientResource, RT_NONE);
|
||||
return BadAlloc;
|
||||
}
|
||||
*pHead = 0;
|
||||
}
|
||||
pNewEvent->next = *pHead;
|
||||
*pHead = pNewEvent;
|
||||
updateEventMask(pHead);
|
||||
}
|
||||
else if (stuff->mask == 0) {
|
||||
/* delete the interest */
|
||||
if (i == Success && pHead) {
|
||||
pNewEvent = 0;
|
||||
for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
|
||||
if (pEvent->client == client)
|
||||
break;
|
||||
pNewEvent = pEvent;
|
||||
}
|
||||
if (pEvent) {
|
||||
FreeResource(pEvent->clientResource, ClientType);
|
||||
if (pNewEvent)
|
||||
pNewEvent->next = pEvent->next;
|
||||
else
|
||||
*pHead = pEvent->next;
|
||||
free(pEvent);
|
||||
updateEventMask(pHead);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
client->errorValue = stuff->mask;
|
||||
return BadValue;
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
/*
|
||||
* deliver the event
|
||||
*/
|
||||
|
||||
void
|
||||
AppleWMSendEvent(int type, unsigned int mask, int which, int arg)
|
||||
{
|
||||
WMEventPtr *pHead, pEvent;
|
||||
xAppleWMNotifyEvent se;
|
||||
int i;
|
||||
|
||||
i =
|
||||
dixLookupResourceByType((void **)&pHead, eventResource, EventType,
|
||||
serverClient,
|
||||
DixReadAccess);
|
||||
if (i != Success || !pHead)
|
||||
return;
|
||||
for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
|
||||
if ((pEvent->mask & mask) == 0)
|
||||
continue;
|
||||
se.type = type + WMEventBase;
|
||||
se.kind = which;
|
||||
se.arg = arg;
|
||||
se.time = currentTime.milliseconds;
|
||||
WriteEventsToClient(pEvent->client, 1, (xEvent *)&se);
|
||||
}
|
||||
}
|
||||
|
||||
/* Safe to call from any thread. */
|
||||
unsigned int
|
||||
AppleWMSelectedEvents(void)
|
||||
{
|
||||
return eventMask;
|
||||
}
|
||||
|
||||
/* general utility functions */
|
||||
|
||||
static int
|
||||
ProcAppleWMDisableUpdate(register ClientPtr client)
|
||||
{
|
||||
REQUEST_SIZE_MATCH(xAppleWMDisableUpdateReq);
|
||||
|
||||
appleWMProcs->DisableUpdate();
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
ProcAppleWMReenableUpdate(register ClientPtr client)
|
||||
{
|
||||
REQUEST_SIZE_MATCH(xAppleWMReenableUpdateReq);
|
||||
|
||||
appleWMProcs->EnableUpdate();
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
/* window functions */
|
||||
|
||||
static int
|
||||
ProcAppleWMSetWindowMenu(register ClientPtr client)
|
||||
{
|
||||
const char *bytes, **items;
|
||||
char *shortcuts;
|
||||
int max_len, nitems, i, j;
|
||||
REQUEST(xAppleWMSetWindowMenuReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xAppleWMSetWindowMenuReq);
|
||||
|
||||
nitems = stuff->nitems;
|
||||
items = malloc(sizeof(char *) * nitems);
|
||||
shortcuts = malloc(sizeof(char) * nitems);
|
||||
|
||||
if (!items || !shortcuts) {
|
||||
free(items);
|
||||
free(shortcuts);
|
||||
|
||||
return BadAlloc;
|
||||
}
|
||||
|
||||
max_len = (stuff->length << 2) - sizeof(xAppleWMSetWindowMenuReq);
|
||||
bytes = (char *)&stuff[1];
|
||||
|
||||
for (i = j = 0; i < max_len && j < nitems;) {
|
||||
shortcuts[j] = bytes[i++];
|
||||
items[j++] = bytes + i;
|
||||
|
||||
while (i < max_len)
|
||||
{
|
||||
if (bytes[i++] == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check if we bailed out of the above loop due to a request that was too long */
|
||||
if (j < nitems) {
|
||||
free(items);
|
||||
free(shortcuts);
|
||||
|
||||
return BadRequest;
|
||||
}
|
||||
|
||||
X11ApplicationSetWindowMenu(nitems, items, shortcuts);
|
||||
free(items);
|
||||
free(shortcuts);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
ProcAppleWMSetWindowMenuCheck(register ClientPtr client)
|
||||
{
|
||||
REQUEST(xAppleWMSetWindowMenuCheckReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xAppleWMSetWindowMenuCheckReq);
|
||||
X11ApplicationSetWindowMenuCheck(stuff->index);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
ProcAppleWMSetFrontProcess(register ClientPtr client)
|
||||
{
|
||||
REQUEST_SIZE_MATCH(xAppleWMSetFrontProcessReq);
|
||||
|
||||
X11ApplicationSetFrontProcess();
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
ProcAppleWMSetWindowLevel(register ClientPtr client)
|
||||
{
|
||||
REQUEST(xAppleWMSetWindowLevelReq);
|
||||
WindowPtr pWin;
|
||||
int err;
|
||||
|
||||
REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq);
|
||||
|
||||
if (Success != dixLookupWindow(&pWin, stuff->window, client,
|
||||
DixReadAccess))
|
||||
return BadValue;
|
||||
|
||||
if (stuff->level >= AppleWMNumWindowLevels) {
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
err = appleWMProcs->SetWindowLevel(pWin, stuff->level);
|
||||
if (err != Success) {
|
||||
return err;
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
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 Success;
|
||||
}
|
||||
|
||||
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 Success;
|
||||
}
|
||||
|
||||
static int
|
||||
ProcAppleWMSetCanQuit(register ClientPtr client)
|
||||
{
|
||||
REQUEST(xAppleWMSetCanQuitReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xAppleWMSetCanQuitReq);
|
||||
|
||||
X11ApplicationSetCanQuit(stuff->state);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/* frame functions */
|
||||
|
||||
static int
|
||||
ProcAppleWMFrameGetRect(register ClientPtr client)
|
||||
{
|
||||
xAppleWMFrameGetRectReply rep;
|
||||
BoxRec ir, or, rr;
|
||||
REQUEST(xAppleWMFrameGetRectReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xAppleWMFrameGetRectReq);
|
||||
rep.type = X_Reply;
|
||||
rep.length = 0;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
|
||||
ir = make_box(stuff->ix, stuff->iy, stuff->iw, stuff->ih);
|
||||
or = make_box(stuff->ox, stuff->oy, stuff->ow, stuff->oh);
|
||||
|
||||
if (appleWMProcs->FrameGetRect(stuff->frame_rect,
|
||||
stuff->frame_class,
|
||||
&or, &ir, &rr) != Success) {
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
rep.x = rr.x1;
|
||||
rep.y = rr.y1;
|
||||
rep.w = rr.x2 - rr.x1;
|
||||
rep.h = rr.y2 - rr.y1;
|
||||
|
||||
WriteToClient(client, sizeof(xAppleWMFrameGetRectReply),&rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
ProcAppleWMFrameHitTest(register ClientPtr client)
|
||||
{
|
||||
xAppleWMFrameHitTestReply rep;
|
||||
BoxRec ir, or;
|
||||
int ret;
|
||||
REQUEST(xAppleWMFrameHitTestReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xAppleWMFrameHitTestReq);
|
||||
rep.type = X_Reply;
|
||||
rep.length = 0;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
|
||||
ir = make_box(stuff->ix, stuff->iy, stuff->iw, stuff->ih);
|
||||
or = make_box(stuff->ox, stuff->oy, stuff->ow, stuff->oh);
|
||||
|
||||
if (appleWMProcs->FrameHitTest(stuff->frame_class, stuff->px,
|
||||
stuff->py, &or, &ir, &ret) != Success) {
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
rep.ret = ret;
|
||||
|
||||
WriteToClient(client, sizeof(xAppleWMFrameHitTestReply),&rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
ProcAppleWMFrameDraw(register ClientPtr client)
|
||||
{
|
||||
BoxRec ir, or;
|
||||
unsigned int title_length, title_max;
|
||||
unsigned char *title_bytes;
|
||||
REQUEST(xAppleWMFrameDrawReq);
|
||||
WindowPtr pWin;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xAppleWMFrameDrawReq);
|
||||
|
||||
if (Success != dixLookupWindow(&pWin, stuff->window, client,
|
||||
DixReadAccess))
|
||||
return BadValue;
|
||||
|
||||
ir = make_box(stuff->ix, stuff->iy, stuff->iw, stuff->ih);
|
||||
or = make_box(stuff->ox, stuff->oy, stuff->ow, stuff->oh);
|
||||
|
||||
title_length = stuff->title_length;
|
||||
title_max = (stuff->length << 2) - sizeof(xAppleWMFrameDrawReq);
|
||||
|
||||
if (title_max < title_length)
|
||||
return BadValue;
|
||||
|
||||
title_bytes = (unsigned char *)&stuff[1];
|
||||
|
||||
errno = appleWMProcs->FrameDraw(pWin, stuff->frame_class,
|
||||
stuff->frame_attr, &or, &ir,
|
||||
title_length, title_bytes);
|
||||
if (errno != Success) {
|
||||
return errno;
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
/* dispatch */
|
||||
|
||||
static int
|
||||
ProcAppleWMDispatch(register ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
|
||||
switch (stuff->data) {
|
||||
case X_AppleWMQueryVersion:
|
||||
return ProcAppleWMQueryVersion(client);
|
||||
}
|
||||
|
||||
if (!client->local)
|
||||
return WMErrorBase + AppleWMClientNotLocal;
|
||||
|
||||
switch (stuff->data) {
|
||||
case X_AppleWMSelectInput:
|
||||
return ProcAppleWMSelectInput(client);
|
||||
|
||||
case X_AppleWMDisableUpdate:
|
||||
return ProcAppleWMDisableUpdate(client);
|
||||
|
||||
case X_AppleWMReenableUpdate:
|
||||
return ProcAppleWMReenableUpdate(client);
|
||||
|
||||
case X_AppleWMSetWindowMenu:
|
||||
return ProcAppleWMSetWindowMenu(client);
|
||||
|
||||
case X_AppleWMSetWindowMenuCheck:
|
||||
return ProcAppleWMSetWindowMenuCheck(client);
|
||||
|
||||
case X_AppleWMSetFrontProcess:
|
||||
return ProcAppleWMSetFrontProcess(client);
|
||||
|
||||
case X_AppleWMSetWindowLevel:
|
||||
return ProcAppleWMSetWindowLevel(client);
|
||||
|
||||
case X_AppleWMSetCanQuit:
|
||||
return ProcAppleWMSetCanQuit(client);
|
||||
|
||||
case X_AppleWMFrameGetRect:
|
||||
return ProcAppleWMFrameGetRect(client);
|
||||
|
||||
case X_AppleWMFrameHitTest:
|
||||
return ProcAppleWMFrameHitTest(client);
|
||||
|
||||
case X_AppleWMFrameDraw:
|
||||
return ProcAppleWMFrameDraw(client);
|
||||
|
||||
case X_AppleWMSendPSN:
|
||||
return ProcAppleWMSendPSN(client);
|
||||
|
||||
case X_AppleWMAttachTransient:
|
||||
return ProcAppleWMAttachTransient(client);
|
||||
|
||||
default:
|
||||
return BadRequest;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
SNotifyEvent(xAppleWMNotifyEvent *from, xAppleWMNotifyEvent *to)
|
||||
{
|
||||
to->type = from->type;
|
||||
to->kind = from->kind;
|
||||
cpswaps(from->sequenceNumber, to->sequenceNumber);
|
||||
cpswapl(from->time, to->time);
|
||||
cpswapl(from->arg, to->arg);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcAppleWMQueryVersion(register ClientPtr client)
|
||||
{
|
||||
REQUEST(xAppleWMQueryVersionReq);
|
||||
swaps(&stuff->length);
|
||||
return ProcAppleWMQueryVersion(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SProcAppleWMDispatch(register ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
|
||||
/* It is bound to be non-local when there is byte swapping */
|
||||
if (!client->local)
|
||||
return WMErrorBase + AppleWMClientNotLocal;
|
||||
|
||||
/* only local clients are allowed WM access */
|
||||
switch (stuff->data) {
|
||||
case X_AppleWMQueryVersion:
|
||||
return SProcAppleWMQueryVersion(client);
|
||||
|
||||
default:
|
||||
return BadRequest;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AppleWMExtensionInit(AppleWMProcsPtr procsPtr)
|
||||
{
|
||||
ExtensionEntry* extEntry;
|
||||
|
||||
ClientType = CreateNewResourceType(WMFreeClient, "WMClient");
|
||||
EventType = CreateNewResourceType(WMFreeEvents, "WMEvent");
|
||||
eventResource = FakeClientID(0);
|
||||
|
||||
if (ClientType && EventType &&
|
||||
(extEntry = AddExtension(APPLEWMNAME,
|
||||
AppleWMNumberEvents,
|
||||
AppleWMNumberErrors,
|
||||
ProcAppleWMDispatch,
|
||||
SProcAppleWMDispatch,
|
||||
NULL,
|
||||
StandardMinorOpcode))) {
|
||||
size_t i;
|
||||
WMReqCode = (unsigned char)extEntry->base;
|
||||
WMErrorBase = extEntry->errorBase;
|
||||
WMEventBase = extEntry->eventBase;
|
||||
for (i = 0; i < AppleWMNumberEvents; i++)
|
||||
EventSwapVector[WMEventBase + i] = (EventSwapPtr)SNotifyEvent;
|
||||
appleWMProcs = procsPtr;
|
||||
}
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
/* External interface for the server's AppleWM support
|
||||
*
|
||||
* Copyright (c) 2003-2004 Torrey T. Lyons. All Rights Reserved.
|
||||
* Copyright (c) 2002-2012 Apple 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, 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 _APPLEWMEXT_H_
|
||||
#define _APPLEWMEXT_H_
|
||||
|
||||
#include "window.h"
|
||||
#include <Xplugin.h>
|
||||
|
||||
typedef int (*DisableUpdateProc)(void);
|
||||
typedef int (*EnableUpdateProc)(void);
|
||||
typedef int (*SetWindowLevelProc)(WindowPtr pWin, int level);
|
||||
typedef int (*FrameGetRectProc)(xp_frame_rect type, xp_frame_class class,
|
||||
const BoxRec *outer,
|
||||
const BoxRec *inner, BoxRec *ret);
|
||||
typedef int (*FrameHitTestProc)(xp_frame_class class, int x, int y,
|
||||
const BoxRec *outer,
|
||||
const BoxRec *inner, int *ret);
|
||||
typedef int (*FrameDrawProc)(WindowPtr pWin, xp_frame_class class,
|
||||
xp_frame_attr 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
|
||||
*/
|
||||
typedef struct _AppleWMProcs {
|
||||
DisableUpdateProc DisableUpdate;
|
||||
EnableUpdateProc EnableUpdate;
|
||||
SetWindowLevelProc SetWindowLevel;
|
||||
FrameGetRectProc FrameGetRect;
|
||||
FrameHitTestProc FrameHitTest;
|
||||
FrameDrawProc FrameDraw;
|
||||
SendPSNProc SendPSN;
|
||||
AttachTransientProc AttachTransient;
|
||||
} AppleWMProcsRec, *AppleWMProcsPtr;
|
||||
|
||||
void
|
||||
AppleWMExtensionInit(AppleWMProcsPtr procsPtr);
|
||||
|
||||
void
|
||||
AppleWMSetScreenOrigin(WindowPtr pWin);
|
||||
|
||||
Bool
|
||||
AppleWMDoReorderWindow(WindowPtr pWin);
|
||||
|
||||
void
|
||||
AppleWMSendEvent(int /* type */, unsigned int /* mask */, int /* which */,
|
||||
int /* arg */
|
||||
);
|
||||
|
||||
unsigned int
|
||||
AppleWMSelectedEvents(void);
|
||||
|
||||
#endif /* _APPLEWMEXT_H_ */
|
|
@ -1 +0,0 @@
|
|||
Info.plist
|
|
@ -1,51 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>X11</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>BUNDLE_ID_PREFIX.X11</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>X11.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>BUNDLE_ID_PREFIX.X11</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>APPLE_APPLICATION_NAME</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>BUNDLE_VERSION_STRING</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>BUNDLE_VERSION</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>x11a</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
||||
<true/>
|
||||
#ifdef XQUARTZ_SPARKLE
|
||||
<key>SUEnableAutomaticChecks</key>
|
||||
<true/>
|
||||
<key>SUPublicDSAKeyFile</key>
|
||||
<string>sparkle.pem</string>
|
||||
<key>SUFeedURL</key>
|
||||
<string>XQUARTZ_SPARKLE_FEED_URL</string>
|
||||
#endif
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>© 2003-2016 Apple Inc.
|
||||
© 2003 XFree86 Project, Inc.
|
||||
© 2003-2016 X.org Foundation, Inc.
|
||||
</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>main</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>X11Application</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1 +0,0 @@
|
|||
APPLx11a
|
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.3</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>nl</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.3</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>105</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>en</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>105</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>fr</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>de</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.3</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>it</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.3</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.3</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>ja</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.3</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.3</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>es</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.3</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.3</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>ar</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.3</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.5</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>ca</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.5</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.5</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>cs</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.5</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.3</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>da</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.3</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.5</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>el</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.5</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.3</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>fi</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.3</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.5</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>he</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.5</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.5</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>hr</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.5</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.5</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>hu</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.5</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.3</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>ko</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.3</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.3</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>no</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.3</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.3</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>pl</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.3</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LprojCompatibleVersion</key>
|
||||
<string>106.3</string>
|
||||
<key>LprojLocale</key>
|
||||
<string>pt</string>
|
||||
<key>LprojRevisionLevel</key>
|
||||
<string>1</string>
|
||||
<key>LprojVersion</key>
|
||||
<string>106.3</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue