2003-11-14 17:48:57 +01:00
|
|
|
/**************************************************************
|
|
|
|
*
|
2008-04-30 08:37:58 +02:00
|
|
|
* Xquartz initialization code
|
2003-11-14 17:48:57 +01:00
|
|
|
*
|
2012-03-24 03:58:49 +01:00
|
|
|
* Copyright (c) 2007-2012 Apple Inc.
|
2004-04-23 21:54:30 +02:00
|
|
|
* Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved.
|
2003-11-14 17:48:57 +01:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2007-11-29 11:19:22 +01:00
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
2007-09-19 14:58:22 +02:00
|
|
|
#include <dix-config.h>
|
2007-11-29 11:19:22 +01:00
|
|
|
#endif
|
2007-02-15 14:22:21 +01:00
|
|
|
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xproto.h>
|
2005-07-03 10:53:54 +02:00
|
|
|
#include "os.h"
|
2003-11-14 17:48:57 +01:00
|
|
|
#include "servermd.h"
|
|
|
|
#include "inputstr.h"
|
|
|
|
#include "scrnintstr.h"
|
2012-03-21 20:55:09 +01:00
|
|
|
#include "mipointer.h" // mi software cursor
|
|
|
|
#include "micmap.h" // mi colormap code
|
|
|
|
#include "fb.h" // fb framebuffer code
|
2003-11-14 17:48:57 +01:00
|
|
|
#include "site.h"
|
|
|
|
#include "globals.h"
|
|
|
|
#include "dix.h"
|
2010-02-11 00:52:14 +01:00
|
|
|
#include "xkbsrv.h"
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2008-10-22 13:59:54 +02:00
|
|
|
#include <X11/extensions/XI.h>
|
|
|
|
#include <X11/extensions/XIproto.h>
|
|
|
|
#include "exevents.h"
|
|
|
|
#include "extinit.h"
|
2004-07-30 20:22:13 +02:00
|
|
|
|
2009-06-16 08:38:11 +02:00
|
|
|
#include "xserver-properties.h"
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/time.h>
|
2012-03-13 08:25:53 +01:00
|
|
|
#include <sys/stat.h>
|
2003-11-14 17:48:57 +01:00
|
|
|
#include <sys/syslimits.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <fcntl.h>
|
2003-11-25 20:29:01 +01:00
|
|
|
#include <unistd.h>
|
2011-05-19 23:34:39 +02:00
|
|
|
#include <stdarg.h>
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2004-04-23 21:54:30 +02:00
|
|
|
#define HAS_UTSNAME 1
|
|
|
|
#include <sys/utsname.h>
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
#define NO_CFPLUGIN
|
|
|
|
#include <IOKit/hidsystem/IOHIDLib.h>
|
|
|
|
|
2007-11-22 04:51:14 +01:00
|
|
|
#ifdef MITSHM
|
2009-08-07 09:02:21 +02:00
|
|
|
#include "shmint.h"
|
2007-11-22 04:51:14 +01:00
|
|
|
#endif
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
#include "darwin.h"
|
2007-12-06 06:23:36 +01:00
|
|
|
#include "darwinEvents.h"
|
2008-04-17 20:03:31 +02:00
|
|
|
#include "quartzKeyboard.h"
|
2007-12-06 06:23:36 +01:00
|
|
|
#include "quartz.h"
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-02-17 22:15:12 +01:00
|
|
|
#include "X11Application.h"
|
|
|
|
|
2011-05-19 23:34:39 +02:00
|
|
|
aslclient aslc;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
void
|
|
|
|
xq_asl_log(int level, const char *subsystem, const char *file,
|
2012-03-24 03:58:49 +01:00
|
|
|
const char *function, int line, const char *fmt,
|
|
|
|
...)
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
2011-05-19 23:34:39 +02:00
|
|
|
va_list args;
|
|
|
|
aslmsg msg = asl_new(ASL_TYPE_MSG);
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (msg) {
|
2011-05-19 23:34:39 +02:00
|
|
|
char *_line;
|
|
|
|
|
|
|
|
asl_set(msg, "File", file);
|
|
|
|
asl_set(msg, "Function", function);
|
|
|
|
asprintf(&_line, "%d", line);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (_line) {
|
2011-05-19 23:34:39 +02:00
|
|
|
asl_set(msg, "Line", _line);
|
|
|
|
free(_line);
|
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
if (subsystem)
|
2011-06-02 05:45:58 +02:00
|
|
|
asl_set(msg, "Subsystem", subsystem);
|
2011-05-19 23:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
va_start(args, fmt);
|
2011-06-02 05:45:58 +02:00
|
|
|
asl_vlog(aslc, msg, level, fmt, args);
|
2011-05-19 23:34:39 +02:00
|
|
|
va_end(args);
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (msg)
|
2011-05-19 23:34:39 +02:00
|
|
|
asl_free(msg);
|
|
|
|
}
|
2007-11-15 11:25:50 +01:00
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
/*
|
|
|
|
* X server shared global variables
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
int darwinScreensFound = 0;
|
|
|
|
DevPrivateKeyRec darwinScreenKeyRec;
|
|
|
|
io_connect_t darwinParamConnect = 0;
|
|
|
|
int darwinEventReadFD = -1;
|
|
|
|
int darwinEventWriteFD = -1;
|
2007-09-07 03:52:26 +02:00
|
|
|
// int darwinMouseAccelChange = 1;
|
2012-03-21 20:55:09 +01:00
|
|
|
int darwinFakeButtons = 0;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
// location of X11's (0,0) point in global screen coordinates
|
2012-03-21 20:55:09 +01:00
|
|
|
int darwinMainScreenX = 0;
|
|
|
|
int darwinMainScreenY = 0;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
// parameters read from the command line or user preferences
|
2012-03-21 20:55:09 +01:00
|
|
|
int darwinDesiredDepth = -1;
|
|
|
|
int darwinSyncKeymap = FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2008-08-20 18:21:44 +02:00
|
|
|
// modifier masks for faking mouse buttons - ANY of these bits trigger it (not all)
|
2008-08-20 18:56:06 +02:00
|
|
|
#ifdef NX_DEVICELCMDKEYMASK
|
2012-03-21 20:55:09 +01:00
|
|
|
int darwinFakeMouse2Mask = NX_DEVICELALTKEYMASK | NX_DEVICERALTKEYMASK;
|
|
|
|
int darwinFakeMouse3Mask = NX_DEVICELCMDKEYMASK | NX_DEVICERCMDKEYMASK;
|
2008-08-20 18:56:06 +02:00
|
|
|
#else
|
2012-03-21 20:55:09 +01:00
|
|
|
int darwinFakeMouse2Mask = NX_ALTERNATEMASK;
|
|
|
|
int darwinFakeMouse3Mask = NX_COMMANDMASK;
|
2008-08-20 18:56:06 +02:00
|
|
|
#endif
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2008-08-19 11:02:11 +02:00
|
|
|
// Modifier mask for overriding event delivery to appkit (might be useful to set this to rcommand for input menu
|
2012-03-24 03:58:49 +01:00
|
|
|
unsigned int darwinAppKitModMask = 0; // Any of these bits
|
2008-08-20 18:21:44 +02:00
|
|
|
|
|
|
|
// Modifier mask for items in the Window menu (0 and -1 cause shortcuts to be disabled)
|
2012-03-21 20:55:09 +01:00
|
|
|
unsigned int windowItemModMask = NX_COMMANDMASK;
|
2008-08-19 11:02:11 +02:00
|
|
|
|
2004-09-23 01:38:33 +02:00
|
|
|
// devices
|
2012-03-21 20:55:09 +01:00
|
|
|
DeviceIntPtr darwinKeyboard = NULL;
|
|
|
|
DeviceIntPtr darwinPointer = NULL;
|
|
|
|
DeviceIntPtr darwinTabletStylus = NULL;
|
|
|
|
DeviceIntPtr darwinTabletCursor = NULL;
|
|
|
|
DeviceIntPtr darwinTabletEraser = NULL;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
// Common pixmap formats
|
|
|
|
static PixmapFormatRec formats[] = {
|
2012-03-24 03:58:49 +01:00
|
|
|
{ 1, 1, BITMAP_SCANLINE_PAD },
|
|
|
|
{ 4, 8, BITMAP_SCANLINE_PAD },
|
|
|
|
{ 8, 8, BITMAP_SCANLINE_PAD },
|
|
|
|
{ 15, 16, BITMAP_SCANLINE_PAD },
|
|
|
|
{ 16, 16, BITMAP_SCANLINE_PAD },
|
|
|
|
{ 24, 32, BITMAP_SCANLINE_PAD },
|
|
|
|
{ 32, 32, BITMAP_SCANLINE_PAD }
|
2003-11-14 17:48:57 +01:00
|
|
|
};
|
2012-03-21 20:55:09 +01:00
|
|
|
const int NUMFORMATS = sizeof(formats) / sizeof(formats[0]);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2007-09-07 03:52:26 +02:00
|
|
|
void
|
|
|
|
DarwinPrintBanner(void)
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
|
|
|
ErrorF("Xquartz starting:\n");
|
|
|
|
ErrorF("X.Org X Server %s\n", XSERVER_VERSION);
|
|
|
|
ErrorF("Build Date: %s\n", BUILD_DATE);
|
2007-02-17 11:23:11 +01:00
|
|
|
}
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
/*
|
|
|
|
* DarwinSaveScreen
|
|
|
|
* X screensaver support. Not implemented.
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
static Bool
|
|
|
|
DarwinSaveScreen(ScreenPtr pScreen, int on)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
// FIXME
|
2012-03-24 03:58:49 +01:00
|
|
|
if (on == SCREEN_SAVER_FORCER) {}
|
|
|
|
else if (on == SCREEN_SAVER_ON) {}
|
|
|
|
else {}
|
2003-11-14 17:48:57 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2009-07-26 11:32:17 +02:00
|
|
|
* DarwinScreenInit
|
2003-11-14 17:48:57 +01:00
|
|
|
* This is a callback from dix during AddScreen() from InitOutput().
|
|
|
|
* Initialize the screen and communicate information about it back to dix.
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
static Bool
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
DarwinScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
|
|
|
int dpi;
|
|
|
|
static int foundIndex = 0;
|
|
|
|
Bool ret;
|
2003-11-14 17:48:57 +01:00
|
|
|
DarwinFramebufferPtr dfb;
|
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
if (!dixRegisterPrivateKey(&darwinScreenKeyRec, PRIVATE_SCREEN, 0))
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2010-04-27 02:22:21 +02:00
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
// reset index of found screens for each server generation
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
if (pScreen->myNum == 0) {
|
2009-07-26 11:32:17 +02:00
|
|
|
foundIndex = 0;
|
|
|
|
|
|
|
|
// reset the visual list
|
|
|
|
miClearVisualTypes();
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
// allocate space for private per screen storage
|
2010-05-05 20:44:06 +02:00
|
|
|
dfb = malloc(sizeof(DarwinFramebufferRec));
|
2007-11-22 04:51:14 +01:00
|
|
|
|
|
|
|
// SCREEN_PRIV(pScreen) = dfb;
|
2007-12-14 00:38:25 +01:00
|
|
|
dixSetPrivate(&pScreen->devPrivates, darwinScreenKey, dfb);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
// setup hardware/mode specific details
|
2007-12-06 06:23:36 +01:00
|
|
|
ret = QuartzAddScreen(foundIndex, pScreen);
|
2003-11-14 17:48:57 +01:00
|
|
|
foundIndex++;
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!ret)
|
2003-11-14 17:48:57 +01:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
// setup a single visual appropriate for our pixel type
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!miSetVisualTypesAndMasks(dfb->depth, dfb->visuals, dfb->bitsPerRGB,
|
|
|
|
dfb->preferredCVC, dfb->redMask,
|
|
|
|
dfb->greenMask, dfb->blueMask)) {
|
2003-11-14 17:48:57 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2012-03-24 03:58:49 +01:00
|
|
|
// TODO: Make PseudoColor visuals not suck in TrueColor mode
|
2012-12-18 10:29:12 +01:00
|
|
|
// if(dfb->depth > 8)
|
|
|
|
// miSetVisualTypesAndMasks(8, PseudoColorMask, 8, PseudoColor, 0, 0, 0);
|
|
|
|
//
|
|
|
|
// TODO: Re-add support for 15bit
|
|
|
|
// if (dfb->depth > 15)
|
|
|
|
// miSetVisualTypesAndMasks(15, TrueColorMask, 5, TrueColor,
|
|
|
|
// RM_ARGB(0, 5, 5, 5), GM_ARGB(0, 5, 5,
|
|
|
|
// 5),
|
|
|
|
// BM_ARGB(0, 5, 5, 5));
|
2012-03-21 20:55:09 +01:00
|
|
|
if (dfb->depth > 24)
|
|
|
|
miSetVisualTypesAndMasks(24, TrueColorMask, 8, TrueColor,
|
2012-03-24 03:58:49 +01:00
|
|
|
RM_ARGB(0, 8, 8, 8), GM_ARGB(0, 8, 8,
|
|
|
|
8),
|
2012-03-21 20:55:09 +01:00
|
|
|
BM_ARGB(0, 8, 8, 8));
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
miSetPixmapDepths();
|
|
|
|
|
|
|
|
// machine independent screen init
|
|
|
|
// setup _Screen structure in pScreen
|
|
|
|
if (monitorResolution)
|
|
|
|
dpi = monitorResolution;
|
|
|
|
else
|
2008-10-21 20:23:42 +02:00
|
|
|
dpi = 96;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
// initialize fb
|
2012-03-24 03:58:49 +01:00
|
|
|
if (!fbScreenInit(pScreen,
|
|
|
|
dfb->framebuffer, // pointer to screen bitmap
|
|
|
|
dfb->width, dfb->height, // screen size in pixels
|
|
|
|
dpi, dpi, // dots per inch
|
|
|
|
dfb->pitch / (dfb->bitsPerPixel / 8), // pixel width of framebuffer
|
|
|
|
dfb->bitsPerPixel)) { // bits per pixel for screen
|
2003-11-14 17:48:57 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!fbPictureInit(pScreen, 0, 0)) {
|
2003-11-14 17:48:57 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef MITSHM
|
|
|
|
ShmRegisterFbFuncs(pScreen);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// this must be initialized (why doesn't X have a default?)
|
|
|
|
pScreen->SaveScreen = DarwinSaveScreen;
|
|
|
|
|
|
|
|
// finish mode dependent screen setup including cursor support
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
if (!QuartzSetupScreen(pScreen->myNum, pScreen)) {
|
2003-11-25 20:29:01 +01:00
|
|
|
return FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// create and install the default colormap and
|
|
|
|
// set pScreen->blackPixel / pScreen->white
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!miCreateDefColormap(pScreen)) {
|
2003-11-14 17:48:57 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2010-05-23 19:11:47 +02:00
|
|
|
pScreen->x = dfb->x;
|
|
|
|
pScreen->y = dfb->y;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2007-09-07 03:52:26 +02:00
|
|
|
/* ErrorF("Screen %d added: %dx%d @ (%d,%d)\n",
|
2012-03-21 20:55:09 +01:00
|
|
|
index, dfb->width, dfb->height, dfb->x, dfb->y); */
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2012-03-24 03:58:49 +01:00
|
|
|
=============================================================================
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-24 03:58:49 +01:00
|
|
|
mouse and keyboard callbacks
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-24 03:58:49 +01:00
|
|
|
=============================================================================
|
|
|
|
*/
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
/*
|
2008-04-30 08:37:58 +02:00
|
|
|
* DarwinMouseProc: Handle the initialization, etc. of a mouse
|
2003-11-14 17:48:57 +01:00
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
static int
|
|
|
|
DarwinMouseProc(DeviceIntPtr pPointer, int what)
|
|
|
|
{
|
2012-03-26 08:33:54 +02:00
|
|
|
#define NBUTTONS 3
|
2012-04-20 01:38:06 +02:00
|
|
|
#define NAXES 6
|
2012-03-26 08:33:54 +02:00
|
|
|
// 3 buttons: left, middle, right
|
|
|
|
CARD8 map[NBUTTONS + 1] = { 0, 1, 2, 3};
|
2012-03-21 20:55:09 +01:00
|
|
|
Atom btn_labels[NBUTTONS] = { 0 };
|
|
|
|
Atom axes_labels[NAXES] = { 0 };
|
2009-06-16 08:38:11 +02:00
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
switch (what) {
|
2012-03-21 20:55:09 +01:00
|
|
|
case DEVICE_INIT:
|
|
|
|
pPointer->public.on = FALSE;
|
|
|
|
|
|
|
|
btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
|
|
|
|
btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
|
|
|
|
btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
|
|
|
|
|
2012-04-20 01:38:06 +02:00
|
|
|
axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X);
|
|
|
|
axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y);
|
|
|
|
axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
|
|
|
|
axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
|
|
|
|
axes_labels[4] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_WHEEL);
|
|
|
|
axes_labels[5] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HWHEEL);
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
// Set button map.
|
2012-03-24 03:58:49 +01:00
|
|
|
InitPointerDeviceStruct((DevicePtr)pPointer, map, NBUTTONS,
|
2012-03-21 20:55:09 +01:00
|
|
|
btn_labels,
|
2012-03-24 03:58:49 +01:00
|
|
|
(PtrCtrlProcPtr)NoopDDA,
|
|
|
|
GetMotionHistorySize(), NAXES,
|
|
|
|
axes_labels);
|
2012-04-20 01:38:06 +02:00
|
|
|
InitValuatorAxisStruct(pPointer, 0, axes_labels[0],
|
2012-03-26 08:33:54 +02:00
|
|
|
NO_AXIS_LIMITS, NO_AXIS_LIMITS,
|
2012-04-20 01:38:06 +02:00
|
|
|
0, 0, 0, Absolute);
|
|
|
|
InitValuatorAxisStruct(pPointer, 1, axes_labels[1],
|
2012-03-26 08:33:54 +02:00
|
|
|
NO_AXIS_LIMITS, NO_AXIS_LIMITS,
|
2012-04-20 01:38:06 +02:00
|
|
|
0, 0, 0, Absolute);
|
2012-03-26 08:33:54 +02:00
|
|
|
InitValuatorAxisStruct(pPointer, 2, axes_labels[2],
|
|
|
|
NO_AXIS_LIMITS, NO_AXIS_LIMITS,
|
|
|
|
1, 0, 1, Relative);
|
|
|
|
InitValuatorAxisStruct(pPointer, 3, axes_labels[3],
|
|
|
|
NO_AXIS_LIMITS, NO_AXIS_LIMITS,
|
|
|
|
1, 0, 1, Relative);
|
2012-04-20 01:38:06 +02:00
|
|
|
InitValuatorAxisStruct(pPointer, 4, axes_labels[4],
|
|
|
|
NO_AXIS_LIMITS, NO_AXIS_LIMITS,
|
|
|
|
1, 0, 1, Relative);
|
|
|
|
InitValuatorAxisStruct(pPointer, 5, axes_labels[5],
|
|
|
|
NO_AXIS_LIMITS, NO_AXIS_LIMITS,
|
|
|
|
1, 0, 1, Relative);
|
2012-03-26 08:33:54 +02:00
|
|
|
|
2012-04-20 01:38:06 +02:00
|
|
|
SetScrollValuator(pPointer, 4, SCROLL_TYPE_VERTICAL, -1.0, SCROLL_FLAG_PREFERRED);
|
|
|
|
SetScrollValuator(pPointer, 5, SCROLL_TYPE_HORIZONTAL, -1.0, SCROLL_FLAG_NONE);
|
2012-03-21 20:55:09 +01:00
|
|
|
break;
|
2012-03-24 03:58:49 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
case DEVICE_ON:
|
|
|
|
pPointer->public.on = TRUE;
|
|
|
|
AddEnabledDevice(darwinEventReadFD);
|
|
|
|
return Success;
|
2012-03-24 03:58:49 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
case DEVICE_CLOSE:
|
|
|
|
case DEVICE_OFF:
|
|
|
|
pPointer->public.on = FALSE;
|
|
|
|
RemoveEnabledDevice(darwinEventReadFD);
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
return Success;
|
2009-06-16 08:38:11 +02:00
|
|
|
#undef NBUTTONS
|
|
|
|
#undef NAXES
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static int
|
|
|
|
DarwinTabletProc(DeviceIntPtr pPointer, int what)
|
|
|
|
{
|
2009-06-16 08:38:11 +02:00
|
|
|
#define NBUTTONS 3
|
2012-03-24 03:58:49 +01:00
|
|
|
#define NAXES 5
|
2012-03-21 20:55:09 +01:00
|
|
|
CARD8 map[NBUTTONS + 1] = { 0, 1, 2, 3 };
|
|
|
|
Atom btn_labels[NBUTTONS] = { 0 };
|
|
|
|
Atom axes_labels[NAXES] = { 0 };
|
2009-06-16 08:38:11 +02:00
|
|
|
|
2008-04-30 08:37:58 +02:00
|
|
|
switch (what) {
|
2012-03-21 20:55:09 +01:00
|
|
|
case DEVICE_INIT:
|
|
|
|
pPointer->public.on = FALSE;
|
|
|
|
|
|
|
|
btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
|
|
|
|
btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
|
|
|
|
btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
|
|
|
|
|
|
|
|
axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X);
|
|
|
|
axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y);
|
|
|
|
axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE);
|
|
|
|
axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_X);
|
|
|
|
axes_labels[4] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_Y);
|
|
|
|
|
|
|
|
// Set button map.
|
2012-03-24 03:58:49 +01:00
|
|
|
InitPointerDeviceStruct((DevicePtr)pPointer, map, NBUTTONS,
|
2012-03-21 20:55:09 +01:00
|
|
|
btn_labels,
|
2012-03-24 03:58:49 +01:00
|
|
|
(PtrCtrlProcPtr)NoopDDA,
|
|
|
|
GetMotionHistorySize(), NAXES,
|
|
|
|
axes_labels);
|
2012-03-21 20:55:09 +01:00
|
|
|
InitProximityClassDeviceStruct(pPointer);
|
|
|
|
|
2012-04-20 01:38:06 +02:00
|
|
|
InitValuatorAxisStruct(pPointer, 0, axes_labels[0],
|
|
|
|
0, XQUARTZ_VALUATOR_LIMIT,
|
|
|
|
1, 0, 1, Absolute);
|
|
|
|
InitValuatorAxisStruct(pPointer, 1, axes_labels[1],
|
|
|
|
0, XQUARTZ_VALUATOR_LIMIT,
|
|
|
|
1, 0, 1, Absolute);
|
|
|
|
InitValuatorAxisStruct(pPointer, 2, axes_labels[2],
|
|
|
|
0, XQUARTZ_VALUATOR_LIMIT,
|
|
|
|
1, 0, 1, Absolute);
|
2012-03-21 20:55:09 +01:00
|
|
|
InitValuatorAxisStruct(pPointer, 3, axes_labels[3],
|
2012-03-24 03:58:49 +01:00
|
|
|
-XQUARTZ_VALUATOR_LIMIT,
|
2012-04-20 01:38:06 +02:00
|
|
|
XQUARTZ_VALUATOR_LIMIT,
|
|
|
|
1, 0, 1, Absolute);
|
2012-03-21 20:55:09 +01:00
|
|
|
InitValuatorAxisStruct(pPointer, 4, axes_labels[4],
|
2012-03-24 03:58:49 +01:00
|
|
|
-XQUARTZ_VALUATOR_LIMIT,
|
2012-04-20 01:38:06 +02:00
|
|
|
XQUARTZ_VALUATOR_LIMIT,
|
|
|
|
1, 0, 1, Absolute);
|
|
|
|
|
2012-03-24 03:58:49 +01:00
|
|
|
// pPointer->use = IsXExtensionDevice;
|
2012-03-21 20:55:09 +01:00
|
|
|
break;
|
2012-03-24 03:58:49 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
case DEVICE_ON:
|
|
|
|
pPointer->public.on = TRUE;
|
|
|
|
AddEnabledDevice(darwinEventReadFD);
|
|
|
|
return Success;
|
2012-03-24 03:58:49 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
case DEVICE_CLOSE:
|
|
|
|
case DEVICE_OFF:
|
|
|
|
pPointer->public.on = FALSE;
|
|
|
|
RemoveEnabledDevice(darwinEventReadFD);
|
|
|
|
return Success;
|
2008-04-30 08:37:58 +02:00
|
|
|
}
|
|
|
|
return Success;
|
2009-06-16 08:38:11 +02:00
|
|
|
#undef NBUTTONS
|
|
|
|
#undef NAXES
|
2008-04-30 08:37:58 +02:00
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* DarwinKeybdProc
|
|
|
|
* Callback from X
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
static int
|
|
|
|
DarwinKeybdProc(DeviceIntPtr pDev, int onoff)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
switch (onoff) {
|
|
|
|
case DEVICE_INIT:
|
|
|
|
DarwinKeyboardInit(pDev);
|
|
|
|
break;
|
2012-03-24 03:58:49 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
case DEVICE_ON:
|
|
|
|
pDev->public.on = TRUE;
|
|
|
|
AddEnabledDevice(darwinEventReadFD);
|
|
|
|
break;
|
2012-03-24 03:58:49 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
case DEVICE_OFF:
|
|
|
|
pDev->public.on = FALSE;
|
|
|
|
RemoveEnabledDevice(darwinEventReadFD);
|
|
|
|
break;
|
2012-03-24 03:58:49 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
case DEVICE_CLOSE:
|
|
|
|
break;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2012-03-24 03:58:49 +01:00
|
|
|
===========================================================================
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-24 03:58:49 +01:00
|
|
|
Utility routines
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-24 03:58:49 +01:00
|
|
|
===========================================================================
|
|
|
|
*/
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* DarwinParseModifierList
|
|
|
|
* Parse a list of modifier names and return a corresponding modifier mask
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
|
|
|
DarwinParseModifierList(const char *constmodifiers, int separatelr)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
int result = 0;
|
|
|
|
|
|
|
|
if (constmodifiers) {
|
|
|
|
char *modifiers = strdup(constmodifiers);
|
|
|
|
char *modifier;
|
|
|
|
int nxkey;
|
|
|
|
char *p = modifiers;
|
|
|
|
|
|
|
|
while (p) {
|
2012-03-24 03:58:49 +01:00
|
|
|
modifier = strsep(&p, " ,+&|/"); // allow lots of separators
|
2008-08-20 18:21:44 +02:00
|
|
|
nxkey = DarwinModifierStringToNXMask(modifier, separatelr);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (nxkey)
|
2008-08-20 18:56:06 +02:00
|
|
|
result |= nxkey;
|
2003-11-14 17:48:57 +01:00
|
|
|
else
|
|
|
|
ErrorF("fakebuttons: Unknown modifier \"%s\"\n", modifier);
|
|
|
|
}
|
|
|
|
free(modifiers);
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2012-03-24 03:58:49 +01:00
|
|
|
===========================================================================
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-24 03:58:49 +01:00
|
|
|
Functions needed to link against device independent X
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-24 03:58:49 +01:00
|
|
|
===========================================================================
|
|
|
|
*/
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* InitInput
|
|
|
|
* Register the keyboard and mouse devices
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
void
|
|
|
|
InitInput(int argc, char **argv)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-24 03:58:49 +01:00
|
|
|
XkbRMLVOSet rmlvo = {
|
|
|
|
.rules = "base", .model = "empty", .layout = "empty",
|
|
|
|
.variant = NULL, .options = NULL
|
2012-03-21 20:55:09 +01:00
|
|
|
};
|
2012-03-26 07:30:55 +02:00
|
|
|
|
2010-02-11 00:52:14 +01:00
|
|
|
/* We need to really have rules... or something... */
|
|
|
|
XkbSetRulesDflts(&rmlvo);
|
|
|
|
|
2012-03-26 07:30:55 +02:00
|
|
|
assert(Success == AllocDevicePair(serverClient, "xquartz virtual",
|
|
|
|
&darwinPointer, &darwinKeyboard,
|
|
|
|
DarwinMouseProc, DarwinKeybdProc, FALSE));
|
2008-09-30 22:54:08 +02:00
|
|
|
|
|
|
|
/* here's the snippet from the current gdk sources:
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!strcmp (tmp_name, "pointer"))
|
|
|
|
gdkdev->info.source = GDK_SOURCE_MOUSE;
|
|
|
|
else if (!strcmp (tmp_name, "wacom") ||
|
|
|
|
!strcmp (tmp_name, "pen"))
|
|
|
|
gdkdev->info.source = GDK_SOURCE_PEN;
|
|
|
|
else if (!strcmp (tmp_name, "eraser"))
|
|
|
|
gdkdev->info.source = GDK_SOURCE_ERASER;
|
|
|
|
else if (!strcmp (tmp_name, "cursor"))
|
|
|
|
gdkdev->info.source = GDK_SOURCE_CURSOR;
|
|
|
|
else
|
|
|
|
gdkdev->info.source = GDK_SOURCE_PEN;
|
|
|
|
*/
|
2008-09-03 18:11:25 +02:00
|
|
|
|
2012-04-05 23:03:35 +02:00
|
|
|
darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
|
2012-03-26 07:30:55 +02:00
|
|
|
assert(darwinTabletStylus);
|
2008-09-30 22:54:08 +02:00
|
|
|
darwinTabletStylus->name = strdup("pen");
|
2008-04-30 08:37:58 +02:00
|
|
|
|
2012-04-05 23:03:35 +02:00
|
|
|
darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
|
2012-03-26 07:30:55 +02:00
|
|
|
assert(darwinTabletCursor);
|
2008-09-03 18:11:25 +02:00
|
|
|
darwinTabletCursor->name = strdup("cursor");
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-04-05 23:03:35 +02:00
|
|
|
darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
|
2012-03-26 07:30:55 +02:00
|
|
|
assert(darwinTabletEraser);
|
2008-09-03 18:11:25 +02:00
|
|
|
darwinTabletEraser->name = strdup("eraser");
|
|
|
|
|
2008-04-30 08:00:09 +02:00
|
|
|
DarwinEQInit();
|
2003-11-25 20:29:01 +01:00
|
|
|
|
2007-12-06 06:23:36 +01:00
|
|
|
QuartzInitInput(argc, argv);
|
2003-11-25 20:29:01 +01:00
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
void
|
|
|
|
CloseInput(void)
|
2011-06-27 01:10:42 +02:00
|
|
|
{
|
|
|
|
DarwinEQFini();
|
|
|
|
}
|
2003-11-25 20:29:01 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* DarwinAdjustScreenOrigins
|
|
|
|
* Shift all screens so the X11 (0, 0) coordinate is at the top
|
|
|
|
* left of the global screen coordinates.
|
|
|
|
*
|
|
|
|
* Screens can be arranged so the top left isn't on any screen, so
|
|
|
|
* instead use the top left of the leftmost screen as (0,0). This
|
|
|
|
* may mean some screen space is in -y, but it's better that (0,0)
|
|
|
|
* be onscreen, or else default xterms disappear. It's better that
|
|
|
|
* -y be used than -x, because when popup menus are forced
|
|
|
|
* "onscreen" by dumb window managers like twm, they'll shift the
|
|
|
|
* menus down instead of left, which still looks funny but is an
|
|
|
|
* easier target to hit.
|
|
|
|
*/
|
|
|
|
void
|
2012-03-24 03:58:49 +01:00
|
|
|
DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo)
|
2003-11-25 20:29:01 +01:00
|
|
|
{
|
|
|
|
int i, left, top;
|
|
|
|
|
2010-05-23 19:11:47 +02:00
|
|
|
left = pScreenInfo->screens[0]->x;
|
2012-03-21 20:55:09 +01:00
|
|
|
top = pScreenInfo->screens[0]->y;
|
2003-11-25 20:29:01 +01:00
|
|
|
|
|
|
|
/* Find leftmost screen. If there's a tie, take the topmost of the two. */
|
|
|
|
for (i = 1; i < pScreenInfo->numScreens; i++) {
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pScreenInfo->screens[i]->x < left ||
|
|
|
|
(pScreenInfo->screens[i]->x == left &&
|
|
|
|
pScreenInfo->screens[i]->y < top)) {
|
2010-05-23 19:11:47 +02:00
|
|
|
left = pScreenInfo->screens[i]->x;
|
|
|
|
top = pScreenInfo->screens[i]->y;
|
2003-11-25 20:29:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
darwinMainScreenX = left;
|
|
|
|
darwinMainScreenY = top;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2008-04-25 08:48:11 +02:00
|
|
|
DEBUG_LOG("top = %d, left=%d\n", top, left);
|
2003-11-25 20:29:01 +01:00
|
|
|
|
|
|
|
/* Shift all screens so that there is a screen whose top left
|
2008-04-25 08:48:11 +02:00
|
|
|
* is at X11 (0,0) and at global screen coordinate
|
|
|
|
* (darwinMainScreenX, darwinMainScreenY).
|
|
|
|
*/
|
2003-11-25 20:29:01 +01:00
|
|
|
|
|
|
|
if (darwinMainScreenX != 0 || darwinMainScreenY != 0) {
|
|
|
|
for (i = 0; i < pScreenInfo->numScreens; i++) {
|
2010-05-23 19:11:47 +02:00
|
|
|
pScreenInfo->screens[i]->x -= darwinMainScreenX;
|
|
|
|
pScreenInfo->screens[i]->y -= darwinMainScreenY;
|
2008-04-25 08:48:11 +02:00
|
|
|
DEBUG_LOG("Screen %d placed at X11 coordinate (%d,%d).\n",
|
2012-03-21 20:55:09 +01:00
|
|
|
i, pScreenInfo->screens[i]->x,
|
|
|
|
pScreenInfo->screens[i]->y);
|
2003-11-25 20:29:01 +01:00
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-26 07:16:22 +02:00
|
|
|
|
|
|
|
/* Update screenInfo.x/y */
|
|
|
|
update_desktop_dimensions();
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* InitOutput
|
|
|
|
* Initialize screenInfo for all actually accessible framebuffers.
|
|
|
|
*
|
|
|
|
* The display mode dependent code gets called three times. The mode
|
|
|
|
* specific InitOutput routines are expected to discover the number
|
|
|
|
* of potentially useful screens and cache routes to them internally.
|
2009-07-26 11:32:17 +02:00
|
|
|
* Inside DarwinScreenInit are two other mode specific calls.
|
2003-11-14 17:48:57 +01:00
|
|
|
* A mode specific AddScreen routine is called for each screen to
|
|
|
|
* actually initialize the screen with the ScreenPtr structure.
|
|
|
|
* After other screen setup has been done, a mode specific
|
|
|
|
* SetupScreen function can be called to finalize screen setup.
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
void
|
2012-03-24 03:58:49 +01:00
|
|
|
InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2003-11-25 20:29:01 +01:00
|
|
|
int i;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
|
|
|
|
pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
|
|
|
|
pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
|
|
|
|
pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
|
|
|
|
|
|
|
|
// List how we want common pixmap formats to be padded
|
|
|
|
pScreenInfo->numPixmapFormats = NUMFORMATS;
|
|
|
|
for (i = 0; i < NUMFORMATS; i++)
|
|
|
|
pScreenInfo->formats[i] = formats[i];
|
|
|
|
|
|
|
|
// Discover screens and do mode specific initialization
|
2007-12-06 06:23:36 +01:00
|
|
|
QuartzInitOutput(argc, argv);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
// Add screens
|
|
|
|
for (i = 0; i < darwinScreensFound; i++) {
|
2009-07-26 11:32:17 +02:00
|
|
|
AddScreen(DarwinScreenInit, argc, argv);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
DarwinAdjustScreenOrigins(pScreenInfo);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2010-03-28 01:35:10 +01:00
|
|
|
* OsVendorFatalError
|
2003-11-14 17:48:57 +01:00
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
void
|
2012-02-17 21:35:02 +01:00
|
|
|
OsVendorFatalError(const char *f, va_list args)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-02-17 22:15:12 +01:00
|
|
|
X11ApplicationFatalError(f, args);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* OsVendorInit
|
|
|
|
* Initialization of Darwin OS support.
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
void
|
|
|
|
OsVendorInit(void)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
if (serverGeneration == 1) {
|
2011-04-25 07:01:48 +02:00
|
|
|
char *lf;
|
|
|
|
char *home = getenv("HOME");
|
|
|
|
assert(home);
|
2012-03-24 03:58:49 +01:00
|
|
|
assert(0 < asprintf(&lf, "%s/Library/Logs/X11", home));
|
2012-03-13 08:25:53 +01:00
|
|
|
|
|
|
|
/* Ignore errors. If EEXIST, we don't care. If anything else,
|
|
|
|
* LogInit will handle it for us.
|
|
|
|
*/
|
|
|
|
(void)mkdir(lf, S_IRWXU | S_IRWXG | S_IRWXO);
|
|
|
|
free(lf);
|
|
|
|
|
2012-03-24 03:58:49 +01:00
|
|
|
assert(0 <
|
|
|
|
asprintf(&lf, "%s/Library/Logs/X11/%s.log", home,
|
|
|
|
bundle_id_prefix));
|
2011-04-25 07:01:48 +02:00
|
|
|
LogInit(lf, ".old");
|
|
|
|
free(lf);
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
DarwinPrintBanner();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2004-07-30 20:22:13 +02:00
|
|
|
* ddxProcessArgument
|
2003-11-14 17:48:57 +01:00
|
|
|
* Process device-dependent command line args. Returns 0 if argument is
|
|
|
|
* not device dependent, otherwise Count of number of elements of argv
|
|
|
|
* that are part of a device dependent commandline option.
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
|
|
|
ddxProcessArgument(int argc, char *argv[], int i)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-24 03:58:49 +01:00
|
|
|
// if ( !strcmp( argv[i], "-fullscreen" ) ) {
|
|
|
|
// ErrorF( "Running full screen in parallel with Mac OS X Quartz window server.\n" );
|
|
|
|
// return 1;
|
|
|
|
// }
|
2007-11-22 04:51:14 +01:00
|
|
|
|
2012-03-24 03:58:49 +01:00
|
|
|
// if ( !strcmp( argv[i], "-rootless" ) ) {
|
|
|
|
// ErrorF( "Running rootless inside Mac OS X window server.\n" );
|
|
|
|
// return 1;
|
|
|
|
// }
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2007-11-22 04:51:14 +01:00
|
|
|
// This command line arg is passed when launched from the Aqua GUI.
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!strncmp(argv[i], "-psn_", 5)) {
|
2007-11-22 04:51:14 +01:00
|
|
|
return 1;
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!strcmp(argv[i], "-fakebuttons")) {
|
2003-11-14 17:48:57 +01:00
|
|
|
darwinFakeButtons = TRUE;
|
2012-03-21 20:55:09 +01:00
|
|
|
ErrorF("Faking a three button mouse\n");
|
2003-11-14 17:48:57 +01:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!strcmp(argv[i], "-nofakebuttons")) {
|
2003-11-14 17:48:57 +01:00
|
|
|
darwinFakeButtons = FALSE;
|
2012-03-21 20:55:09 +01:00
|
|
|
ErrorF("Not faking a three button mouse\n");
|
2003-11-14 17:48:57 +01:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!strcmp(argv[i], "-fakemouse2")) {
|
|
|
|
if (i == argc - 1) {
|
|
|
|
FatalError("-fakemouse2 must be followed by a modifer list\n");
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!strcasecmp(argv[i + 1], "none") || !strcmp(argv[i + 1], ""))
|
2003-11-14 17:48:57 +01:00
|
|
|
darwinFakeMouse2Mask = 0;
|
|
|
|
else
|
2012-03-21 20:55:09 +01:00
|
|
|
darwinFakeMouse2Mask = DarwinParseModifierList(argv[i + 1], 1);
|
2003-11-14 17:48:57 +01:00
|
|
|
ErrorF("Modifier mask to fake mouse button 2 = 0x%x\n",
|
|
|
|
darwinFakeMouse2Mask);
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!strcmp(argv[i], "-fakemouse3")) {
|
|
|
|
if (i == argc - 1) {
|
|
|
|
FatalError("-fakemouse3 must be followed by a modifer list\n");
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!strcasecmp(argv[i + 1], "none") || !strcmp(argv[i + 1], ""))
|
2003-11-14 17:48:57 +01:00
|
|
|
darwinFakeMouse3Mask = 0;
|
|
|
|
else
|
2012-03-21 20:55:09 +01:00
|
|
|
darwinFakeMouse3Mask = DarwinParseModifierList(argv[i + 1], 1);
|
2003-11-14 17:48:57 +01:00
|
|
|
ErrorF("Modifier mask to fake mouse button 3 = 0x%x\n",
|
|
|
|
darwinFakeMouse3Mask);
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!strcmp(argv[i], "+synckeymap")) {
|
2004-09-23 01:38:33 +02:00
|
|
|
darwinSyncKeymap = TRUE;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!strcmp(argv[i], "-synckeymap")) {
|
2004-09-23 01:38:33 +02:00
|
|
|
darwinSyncKeymap = FALSE;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!strcmp(argv[i], "-depth")) {
|
|
|
|
if (i == argc - 1) {
|
|
|
|
FatalError("-depth must be followed by a number\n");
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
darwinDesiredDepth = atoi(argv[i + 1]);
|
|
|
|
if (darwinDesiredDepth != -1 &&
|
|
|
|
darwinDesiredDepth != 8 &&
|
2012-03-24 03:58:49 +01:00
|
|
|
darwinDesiredDepth != 15 &&
|
|
|
|
darwinDesiredDepth != 24) {
|
2012-03-21 20:55:09 +01:00
|
|
|
FatalError("Unsupported pixel depth. Use 8, 15, or 24 bits\n");
|
2007-12-23 00:09:12 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
ErrorF("Attempting to use pixel depth of %i\n", darwinDesiredDepth);
|
2003-11-14 17:48:57 +01:00
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!strcmp(argv[i], "-showconfig") || !strcmp(argv[i], "-version")) {
|
2003-11-14 17:48:57 +01:00
|
|
|
DarwinPrintBanner();
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ddxUseMsg --
|
|
|
|
* Print out correct use of device dependent commandline options.
|
|
|
|
* Maybe the user now knows what really to do ...
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
void
|
|
|
|
ddxUseMsg(void)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
ErrorF("\n");
|
|
|
|
ErrorF("\n");
|
|
|
|
ErrorF("Device Dependent Usage:\n");
|
|
|
|
ErrorF("\n");
|
2010-01-28 02:12:12 +01:00
|
|
|
ErrorF("-depth <8,15,24> : use this bit depth.\n");
|
2012-03-24 03:58:49 +01:00
|
|
|
ErrorF(
|
|
|
|
"-fakebuttons : fake a three button mouse with Command and Option keys.\n");
|
2003-11-14 17:48:57 +01:00
|
|
|
ErrorF("-nofakebuttons : don't fake a three button mouse.\n");
|
2012-03-24 03:58:49 +01:00
|
|
|
ErrorF(
|
|
|
|
"-fakemouse2 <modifiers> : fake middle mouse button with modifier keys.\n");
|
|
|
|
ErrorF(
|
|
|
|
"-fakemouse3 <modifiers> : fake right mouse button with modifier keys.\n");
|
|
|
|
ErrorF(
|
|
|
|
" ex: -fakemouse2 \"option,shift\" = option-shift-click is middle button.\n");
|
2003-11-14 17:48:57 +01:00
|
|
|
ErrorF("-version : show the server version.\n");
|
|
|
|
ErrorF("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ddxGiveUp --
|
|
|
|
* Device dependent cleanup. Called by dix before normal server death.
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
void
|
|
|
|
ddxGiveUp(enum ExitCode error)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2011-07-20 05:09:05 +02:00
|
|
|
LogClose(error);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* AbortDDX --
|
|
|
|
* DDX - specific abort routine. Called by AbortServer(). The attempt is
|
|
|
|
* made to restore all original setting of the displays. Also all devices
|
|
|
|
* are closed.
|
|
|
|
*/
|
2012-03-24 03:58:49 +01:00
|
|
|
_X_NORETURN
|
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
AbortDDX(enum ExitCode error)
|
|
|
|
{
|
|
|
|
ErrorF(" AbortDDX\n");
|
2010-03-28 01:35:10 +01:00
|
|
|
OsAbort();
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|