diff options
Diffstat (limited to 'hw/darwin/darwin.c')
-rw-r--r-- | hw/darwin/darwin.c | 159 |
1 files changed, 28 insertions, 131 deletions
diff --git a/hw/darwin/darwin.c b/hw/darwin/darwin.c index 7da8626ab..c32cd5461 100644 --- a/hw/darwin/darwin.c +++ b/hw/darwin/darwin.c @@ -3,9 +3,8 @@ * Shared code for the Darwin X Server * running with Quartz or IOKit display mode * - **************************************************************/ -/* * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. + * Copyright (c) 2007 Apple Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -30,9 +29,7 @@ * use or other dealings in this Software without prior written authorization. */ -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif +#include <dix-config.h> #include <X11/X.h> #include <X11/Xproto.h> @@ -46,8 +43,6 @@ #include "fb.h" // fb framebuffer code #include "site.h" #include "globals.h" -#include "xorgVersion.h" -#include "xf86Date.h" #include "dix.h" #ifdef XINPUT @@ -83,7 +78,7 @@ int darwinScreenIndex = 0; io_connect_t darwinParamConnect = 0; int darwinEventReadFD = -1; int darwinEventWriteFD = -1; -int darwinMouseAccelChange = 1; +// int darwinMouseAccelChange = 1; int darwinFakeButtons = 0; // location of X11's (0,0) point in global screen coordinates @@ -127,86 +122,23 @@ const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]); #ifndef PRE_RELEASE #define PRE_RELEASE XORG_VERSION_SNAP #endif - -void -DarwinPrintBanner() -{ -#if PRE_RELEASE - ErrorF("\n" - "This is a pre-release version of the " XVENDORNAME " X11.\n" - "Portions of this release are based on XFree86 4.4RC2 and selected\n" - "files from XFree86 4.4RC3. It is not supported in any way.\n" - "Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.\n" - "Select the \"xorg\" product for bugs you find in this release.\n" - "Before reporting bugs in pre-release versions please check the\n" - "latest version in the " XVENDORNAME " \"monolithic tree\" CVS\n" - "repository hosted at http://www.freedesktop.org/Software/xorg/"); -#endif -#if XORG_VERSION_SNAP > 0 - ErrorF(".%d", XORG_VERSION_SNAP); +#ifndef BUILD_DATE +#define BUILD_DATE "" #endif - -#if XORG_VERSION_SNAP >= 900 - ErrorF(" (%d.%d.0 RC %d)", XORG_VERSION_MAJOR, XORG_VERSION_MINOR + 1, - XORG_VERSION_SNAP - 900); +#ifndef XORG_RELEASE +#define XORG_RELEASE "?" #endif -#ifdef XORG_CUSTOM_VERSION - ErrorF(" (%s)", XF86_CUSTOM_VERSION); -#endif - ErrorF("\nRelease Date: %s\n", XF86_DATE); - ErrorF("X Protocol Version %d, Revision %d, %s\n", - X_PROTOCOL, X_PROTOCOL_REVISION, XORG_RELEASE ); - ErrorF("Build Operating System: %s %s\n", OSNAME, OSVENDOR); -#ifdef HAS_UTSNAME - { - struct utsname name; - - if (uname(&name) == 0) { - ErrorF("Current Operating System: %s %s %s %s %s\n", - name.sysname, name.nodename, name.release, name.version, name.machine); - } - } -#endif -#if defined(BUILD_DATE) && (BUILD_DATE > 19000000) - { - struct tm t; - char buf[100]; - - bzero(&t, sizeof(t)); - bzero(buf, sizeof(buf)); - t.tm_mday = BUILD_DATE % 100; - t.tm_mon = (BUILD_DATE / 100) % 100 - 1; - t.tm_year = BUILD_DATE / 10000 - 1900; - if (strftime(buf, sizeof(buf), "%d %B %Y", &t)) - ErrorF("Build Date: %s\n", buf); - } -#endif -#if defined(CLOG_DATE) && (CLOG_DATE > 19000000) - { - struct tm t; - char buf[100]; - - bzero(&t, sizeof(t)); - bzero(buf, sizeof(buf)); - t.tm_mday = CLOG_DATE % 100; - t.tm_mon = (CLOG_DATE / 100) % 100 - 1; - t.tm_year = CLOG_DATE / 10000 - 1900; - if (strftime(buf, sizeof(buf), "%d %B %Y", &t)) - ErrorF("Changelog Date: %s\n", buf); - } -#endif -#if defined(BUILDERSTRING) - ErrorF("%s \n",BUILDERSTRING); -#endif - ErrorF("\tBefore reporting problems, check "__VENDORDWEBSUPPORT__"\n" - "\tto make sure that you have the latest version.\n"); +void DDXRingBell(int volume, int pitch, int duration) { + // FIXME -- make some noise, yo } - -void DDXRingBell(int volume, int pitch, int duration) -{ - // FIXME -- make some noise, yo +void +DarwinPrintBanner(void) +{ + // this should change depending on which specific server we are building + ErrorF("X11.app starting:\n"); + ErrorF("Xquartz server based on X.org %s, built on %s\n", XORG_RELEASE, BUILD_DATE ); } @@ -359,8 +291,8 @@ static Bool DarwinAddScreen( dixScreenOrigins[index].x = dfb->x; dixScreenOrigins[index].y = dfb->y; - ErrorF("Screen %d added: %dx%d @ (%d,%d)\n", - index, dfb->width, dfb->height, dfb->x, dfb->y); + /* ErrorF("Screen %d added: %dx%d @ (%d,%d)\n", + index, dfb->width, dfb->height, dfb->x, dfb->y); */ return TRUE; } @@ -373,6 +305,7 @@ static Bool DarwinAddScreen( ============================================================================= */ +#if 0 /* * DarwinChangePointerControl * Set mouse acceleration and thresholding @@ -393,7 +326,7 @@ static void DarwinChangePointerControl( if (kr != KERN_SUCCESS) ErrorF( "Could not set mouse acceleration with kernel return = 0x%x.\n", kr ); } - +#endif /* * DarwinMouseProc @@ -416,12 +349,11 @@ static int DarwinMouseProc( map[3] = 3; map[4] = 4; map[5] = 5; - InitPointerDeviceStruct( (DevicePtr)pPointer, - map, - 5, // numbuttons (4 & 5 are scroll wheel) - GetMotionHistory, - DarwinChangePointerControl, - GetMotionHistorySize(), 2 ); + InitPointerDeviceStruct( (DevicePtr)pPointer, map, 5, + GetMotionHistory, + (PtrCtrlProcPtr)NoopDDA, + GetMotionHistorySize(), 2); + #ifdef XINPUT InitValuatorAxisStruct( pPointer, 0, // X axis @@ -643,8 +575,8 @@ DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo) for (i = 0; i < pScreenInfo->numScreens; i++) { dixScreenOrigins[i].x -= darwinMainScreenX; dixScreenOrigins[i].y -= darwinMainScreenY; - ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n", - i, dixScreenOrigins[i].x, dixScreenOrigins[i].y); + /* ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n", + i, dixScreenOrigins[i].x, dixScreenOrigins[i].y); */ } } } @@ -725,10 +657,6 @@ void OsVendorInit(void) } darwinKeymapFile = tempStr; } - - if ( !darwinKeymapFile ) { - ErrorF("Reading keymap from the system.\n"); - } } @@ -926,7 +854,7 @@ void ddxUseMsg( void ) */ void ddxGiveUp( void ) { - ErrorF( "Quitting XDarwin...\n" ); + ErrorF( "Quitting XQuartz...\n" ); DarwinModeGiveUp(); } @@ -949,7 +877,6 @@ void AbortDDX( void ) } -#ifdef DPMSExtension /* * DPMS extension stubs */ @@ -966,8 +893,6 @@ int DPMSGet(int *level) { return -1; } -#endif - #include "mivalidate.h" // for union _Validate used by windowstr.h #include "windowstr.h" // for struct _Window @@ -992,7 +917,7 @@ xf86SetRootClip (ScreenPtr pScreen, BOOL enable) WindowPtr pChild; Bool WasViewable = (Bool)(pWin->viewable); Bool anyMarked = TRUE; - RegionPtr pOldClip = NULL, bsExposed; + RegionPtr pOldClip = NULL; #ifdef DO_SAVE_UNDERS Bool dosave = FALSE; #endif @@ -1048,12 +973,6 @@ xf86SetRootClip (ScreenPtr pScreen, BOOL enable) if (WasViewable) { - if (pWin->backStorage) - { - pOldClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, pOldClip, &pWin->clipList); - } - if (pWin->firstChild) { anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild, @@ -1077,28 +996,6 @@ xf86SetRootClip (ScreenPtr pScreen, BOOL enable) (*pScreen->ValidateTree)(pWin, NullWindow, VTOther); } - if (pWin->backStorage && - ((pWin->backingStore == Always) || WasViewable)) - { - if (!WasViewable) - pOldClip = &pWin->clipList; /* a convenient empty region */ - bsExposed = (*pScreen->TranslateBackingStore) - (pWin, 0, 0, pOldClip, - pWin->drawable.x, pWin->drawable.y); - if (WasViewable) - REGION_DESTROY(pScreen, pOldClip); - if (bsExposed) - { - RegionPtr valExposed = NullRegion; - - if (pWin->valdata) - valExposed = &pWin->valdata->after.exposed; - (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); - if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); - } - } if (WasViewable) { if (anyMarked) |