Darwin: Renamed DarwinModeBlah to QuartzBlah

(cherry picked from commit 08ebf86d379b1ddfb08df65d29aea5df66de4327)
This commit is contained in:
Jeremy Huddleston 2007-12-05 21:23:36 -08:00
parent 540439a966
commit 8a8239f2e2
11 changed files with 83 additions and 51 deletions

View File

@ -39,6 +39,7 @@
/* ouch! */ /* ouch! */
#define BOOL X_BOOL #define BOOL X_BOOL
# include "darwin.h" # include "darwin.h"
# include "darwinEvents.h"
# include "quartz.h" # include "quartz.h"
# define _APPLEWM_SERVER_ # define _APPLEWM_SERVER_
# include "X11/extensions/applewm.h" # include "X11/extensions/applewm.h"

View File

@ -75,6 +75,9 @@
#endif #endif
#include "darwin.h" #include "darwin.h"
#include "darwinEvents.h"
#include "darwinKeyboard.h"
#include "quartz.h"
#include "darwinClut8.h" #include "darwinClut8.h"
#ifdef ENABLE_DEBUG_LOG #ifdef ENABLE_DEBUG_LOG
@ -195,7 +198,7 @@ static Bool DarwinAddScreen(
pScreen->devPrivates[darwinScreenIndex].ptr = dfb; pScreen->devPrivates[darwinScreenIndex].ptr = dfb;
// setup hardware/mode specific details // setup hardware/mode specific details
ret = DarwinModeAddScreen(foundIndex, pScreen); ret = QuartzAddScreen(foundIndex, pScreen);
foundIndex++; foundIndex++;
if (! ret) if (! ret)
return FALSE; return FALSE;
@ -274,7 +277,7 @@ static Bool DarwinAddScreen(
pScreen->SaveScreen = DarwinSaveScreen; pScreen->SaveScreen = DarwinSaveScreen;
// finish mode dependent screen setup including cursor support // finish mode dependent screen setup including cursor support
if (!DarwinModeSetupScreen(index, pScreen)) { if (!QuartzSetupScreen(index, pScreen)) {
return FALSE; return FALSE;
} }
@ -539,7 +542,7 @@ void InitInput( int argc, char **argv )
DarwinEQInit( (DevicePtr)darwinKeyboard, (DevicePtr)darwinPointer ); DarwinEQInit( (DevicePtr)darwinKeyboard, (DevicePtr)darwinPointer );
DarwinModeInitInput(argc, argv); QuartzInitInput(argc, argv);
} }
@ -629,7 +632,7 @@ void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv )
} }
// Discover screens and do mode specific initialization // Discover screens and do mode specific initialization
DarwinModeInitOutput(argc, argv); QuartzInitOutput(argc, argv);
// Add screens // Add screens
for (i = 0; i < darwinScreensFound; i++) { for (i = 0; i < darwinScreensFound; i++) {
@ -895,7 +898,7 @@ void ddxGiveUp( void )
{ {
ErrorF( "Quitting XQuartz...\n" ); ErrorF( "Quitting XQuartz...\n" );
DarwinModeGiveUp(); QuartzGiveUp();
} }

View File

@ -52,26 +52,6 @@ int DarwinParseModifierList(const char *constmodifiers);
void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo); void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo);
void xf86SetRootClip (ScreenPtr pScreen, BOOL enable); void xf86SetRootClip (ScreenPtr pScreen, BOOL enable);
// From darwinEvents.c
Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr);
void DarwinEQEnqueue(const xEvent *e);
void DarwinEQPointerPost(xEvent *e);
void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
void DarwinPokeEQ(void);
void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y);
void DarwinSendKeyboardEvents(int ev_type, int keycode);
void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y);
// Mode specific functions
Bool DarwinModeAddScreen(int index, ScreenPtr pScreen);
Bool DarwinModeSetupScreen(int index, ScreenPtr pScreen);
void DarwinModeInitOutput(int argc,char **argv);
void DarwinModeInitInput(int argc, char **argv);
void DarwinModeProcessEvent(xEvent *xe);
void DarwinModeGiveUp(void);
void DarwinModeBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class);
#undef assert #undef assert
#define assert(x) { if ((x) == 0) \ #define assert(x) { if ((x) == 0) \
FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); } FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); }
@ -81,10 +61,6 @@ void DarwinModeBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class);
#define SCREEN_PRIV(pScreen) \ #define SCREEN_PRIV(pScreen) \
((DarwinFramebufferPtr)pScreen->devPrivates[darwinScreenIndex].ptr) ((DarwinFramebufferPtr)pScreen->devPrivates[darwinScreenIndex].ptr)
#define MIN_KEYCODE XkbMinLegalKeyCode // unfortunately, this isn't 0...
/* /*
* Global variables from darwin.c * Global variables from darwin.c
*/ */

View File

@ -43,6 +43,7 @@ in this Software without prior written authorization from The Open Group.
#include "mipointer.h" #include "mipointer.h"
#include "darwin.h" #include "darwin.h"
#include "quartz.h"
#include "darwinKeyboard.h" #include "darwinKeyboard.h"
#include <sys/types.h> #include <sys/types.h>
@ -361,7 +362,7 @@ void ProcessInputEvents(void) {
// fall through // fall through
default: default:
// Check for mode specific event // Check for mode specific event
DarwinModeProcessEvent(&xe); QuartzProcessEvent(&xe);
} }
} }
} }

39
hw/xquartz/darwinEvents.h Normal file
View File

@ -0,0 +1,39 @@
/*
* Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
#ifndef _DARWIN_EVENTS_H
#define _DARWIN_EVENTS_H
Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr);
void DarwinEQEnqueue(const xEvent *e);
void DarwinEQPointerPost(xEvent *e);
void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
void DarwinPokeEQ(void);
void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y);
void DarwinSendKeyboardEvents(int ev_type, int keycode);
void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y);
#endif /* _DARWIN_EVENTS_H */

View File

@ -73,6 +73,8 @@
#include <architecture/byte_order.h> // For the NXSwap* #include <architecture/byte_order.h> // For the NXSwap*
#include "darwin.h" #include "darwin.h"
#include "darwinKeyboard.h" #include "darwinKeyboard.h"
#include "quartzKeyboard.h"
#include "quartzAudio.h"
#ifdef NDEBUG #ifdef NDEBUG
#undef NDEBUG #undef NDEBUG
@ -791,7 +793,7 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
DarwinModeSystemKeymapSeed(); DarwinModeSystemKeymapSeed();
assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms, assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms,
keyInfo.modMap, DarwinModeBell, keyInfo.modMap, QuartzBell,
DarwinChangeKeyboardControl )); DarwinChangeKeyboardControl ));
} }

View File

@ -35,6 +35,7 @@
#include "quartzCommon.h" #include "quartzCommon.h"
#include "quartz.h" #include "quartz.h"
#include "darwin.h" #include "darwin.h"
#include "darwinEvents.h"
#include "quartzAudio.h" #include "quartzAudio.h"
#include "pseudoramiX.h" #include "pseudoramiX.h"
#define _APPLEWM_SERVER_ #define _APPLEWM_SERVER_
@ -74,25 +75,25 @@ QuartzModeProcsPtr quartzProcs = NULL;
const char *quartzOpenGLBundle = NULL; const char *quartzOpenGLBundle = NULL;
#if defined(RANDR) && !defined(FAKE_RANDR) #if defined(RANDR) && !defined(FAKE_RANDR)
Bool DarwinModeRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) { Bool QuartzRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) {
return FALSE; return FALSE;
} }
Bool DarwinModeRandRSetConfig (ScreenPtr pScreen, Bool QuartzRandRSetConfig (ScreenPtr pScreen,
Rotation randr, Rotation randr,
int rate, int rate,
RRScreenSizePtr pSize) { RRScreenSizePtr pSize) {
return FALSE; return FALSE;
} }
Bool DarwinModeRandRInit (ScreenPtr pScreen) { Bool QuartzRandRInit (ScreenPtr pScreen) {
rrScrPrivPtr pScrPriv; rrScrPrivPtr pScrPriv;
if (!RRScreenInit (pScreen)) return FALSE; if (!RRScreenInit (pScreen)) return FALSE;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
pScrPriv->rrGetInfo = DarwinModeRandRGetInfo; pScrPriv->rrGetInfo = QuartzRandRGetInfo;
pScrPriv->rrSetConfig = DarwinModeRandRSetConfig; pScrPriv->rrSetConfig = QuartzRandRSetConfig;
return TRUE; return TRUE;
} }
#endif #endif
@ -106,10 +107,10 @@ Bool DarwinModeRandRInit (ScreenPtr pScreen) {
*/ */
/* /*
* DarwinModeAddScreen * QuartzAddScreen
* Do mode dependent initialization of each screen for Quartz. * Do mode dependent initialization of each screen for Quartz.
*/ */
Bool DarwinModeAddScreen( Bool QuartzAddScreen(
int index, int index,
ScreenPtr pScreen) ScreenPtr pScreen)
{ {
@ -125,10 +126,10 @@ Bool DarwinModeAddScreen(
/* /*
* DarwinModeSetupScreen * QuartzSetupScreen
* Finalize mode specific setup of each screen. * Finalize mode specific setup of each screen.
*/ */
Bool DarwinModeSetupScreen( Bool QuartzSetupScreen(
int index, int index,
ScreenPtr pScreen) ScreenPtr pScreen)
{ {
@ -145,10 +146,10 @@ Bool DarwinModeSetupScreen(
/* /*
* DarwinModeInitOutput * QuartzInitOutput
* Quartz display initialization. * Quartz display initialization.
*/ */
void DarwinModeInitOutput( void QuartzInitOutput(
int argc, int argc,
char **argv ) char **argv )
{ {
@ -184,10 +185,10 @@ void DarwinModeInitOutput(
/* /*
* DarwinModeInitInput * QuartzInitInput
* Inform the main thread the X server is ready to handle events. * Inform the main thread the X server is ready to handle events.
*/ */
void DarwinModeInitInput( void QuartzInitInput(
int argc, int argc,
char **argv ) char **argv )
{ {
@ -279,7 +280,7 @@ static void QuartzUpdateScreens(void)
pScreen->height = height; pScreen->height = height;
#ifndef FAKE_RANDR #ifndef FAKE_RANDR
if(!DarwinModeRandRInit(pScreen)) if(!QuartzRandRInit(pScreen))
FatalError("Failed to init RandR extension.\n"); FatalError("Failed to init RandR extension.\n");
#endif #endif
@ -412,10 +413,10 @@ QuartzMessageServerThread(
/* /*
* DarwinModeProcessEvent * QuartzProcessEvent
* Process Quartz specific events. * Process Quartz specific events.
*/ */
void DarwinModeProcessEvent( void QuartzProcessEvent(
xEvent *xe) xEvent *xe)
{ {
switch (xe->u.u.type) { switch (xe->u.u.type) {
@ -516,11 +517,11 @@ void DarwinModeProcessEvent(
/* /*
* DarwinModeGiveUp * QuartzGiveUp
* Cleanup before X server shutdown * Cleanup before X server shutdown
* Release the screen and restore the Aqua cursor. * Release the screen and restore the Aqua cursor.
*/ */
void DarwinModeGiveUp(void) void QuartzGiveUp(void)
{ {
#if 0 #if 0
// Trying to switch cursors when quitting causes deadlock // Trying to switch cursors when quitting causes deadlock

View File

@ -124,4 +124,11 @@ typedef struct _QuartzModeProcs {
extern QuartzModeProcsPtr quartzProcs; extern QuartzModeProcsPtr quartzProcs;
extern int quartzHasRoot, quartzEnableRootless; extern int quartzHasRoot, quartzEnableRootless;
Bool QuartzAddScreen(int index, ScreenPtr pScreen);
Bool QuartzSetupScreen(int index, ScreenPtr pScreen);
void QuartzInitOutput(int argc,char **argv);
void QuartzInitInput(int argc, char **argv);
void QuartzGiveUp(void);
void QuartzProcessEvent(xEvent *xe);
#endif #endif

View File

@ -246,10 +246,10 @@ static void QuartzCoreAudioBell(
/* /*
* DarwinModeBell * QuartzBell
* Ring the bell * Ring the bell
*/ */
void DarwinModeBell( void QuartzBell(
int volume, // volume in percent of max int volume, // volume in percent of max
DeviceIntPtr pDevice, DeviceIntPtr pDevice,
pointer ctrl, pointer ctrl,

View File

@ -36,6 +36,7 @@
// unshifted, shifted, modeswitch unshifted, modeswitch shifted // unshifted, shifted, modeswitch unshifted, modeswitch shifted
#define GLYPHS_PER_KEY 4 #define GLYPHS_PER_KEY 4
#define NUM_KEYCODES 248 // NX_NUMKEYCODES might be better #define NUM_KEYCODES 248 // NX_NUMKEYCODES might be better
#define MIN_KEYCODE XkbMinLegalKeyCode // unfortunately, this isn't 0...
#define MAX_KEYCODE NUM_KEYCODES + MIN_KEYCODE - 1 #define MAX_KEYCODE NUM_KEYCODES + MIN_KEYCODE - 1
typedef struct darwinKeyboardInfo_struct { typedef struct darwinKeyboardInfo_struct {

View File

@ -36,6 +36,7 @@
#include "quartzCommon.h" #include "quartzCommon.h"
#include "xpr.h" #include "xpr.h"
#include "darwin.h" #include "darwin.h"
#include "darwinEvents.h"
#include "Xplugin.h" #include "Xplugin.h"
#include "mi.h" #include "mi.h"