diff options
Diffstat (limited to 'hw/darwin/quartz')
-rw-r--r-- | hw/darwin/quartz/Preferences.h | 137 | ||||
-rw-r--r-- | hw/darwin/quartz/Preferences.m | 598 | ||||
-rw-r--r-- | hw/darwin/quartz/X11Application.m | 4 | ||||
-rw-r--r-- | hw/darwin/quartz/X11Controller.h | 2 | ||||
-rw-r--r-- | hw/darwin/quartz/X11Controller.m | 8 | ||||
-rw-r--r-- | hw/darwin/quartz/cr/cr.h | 3 | ||||
-rw-r--r-- | hw/darwin/quartz/fullscreen/quartzCursor.c | 2 | ||||
-rw-r--r-- | hw/darwin/quartz/quartz.c | 12 | ||||
-rw-r--r-- | hw/darwin/quartz/quartzCursor.c | 4 | ||||
-rw-r--r-- | hw/darwin/quartz/quartzKeyboard.c | 3 | ||||
-rw-r--r-- | hw/darwin/quartz/quartzPasteboard.c | 1 | ||||
-rw-r--r-- | hw/darwin/quartz/quartzStartup.c | 2 | ||||
-rw-r--r-- | hw/darwin/quartz/xpr/dri.c | 5 | ||||
-rw-r--r-- | hw/darwin/quartz/xpr/xpr.h | 3 | ||||
-rw-r--r-- | hw/darwin/quartz/xpr/xprAppleWM.c | 3 | ||||
-rw-r--r-- | hw/darwin/quartz/xpr/xprScreen.c | 6 |
16 files changed, 21 insertions, 772 deletions
diff --git a/hw/darwin/quartz/Preferences.h b/hw/darwin/quartz/Preferences.h deleted file mode 100644 index cf43758e7..000000000 --- a/hw/darwin/quartz/Preferences.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2002-2003 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. - */ - -#import <Cocoa/Cocoa.h> - -@interface Preferences : NSObject -{ - IBOutlet NSPanel *window; - IBOutlet id displayField; - IBOutlet id dockSwitchButton; - IBOutlet id fakeButton; - IBOutlet id button2ModifiersMatrix; - IBOutlet id button3ModifiersMatrix; - IBOutlet id switchKeyButton; - IBOutlet id keymapFileField; - IBOutlet id modeMatrix; - IBOutlet id modeWindowButton; - IBOutlet id startupHelpButton; - IBOutlet id systemBeepButton; - IBOutlet id mouseAccelChangeButton; - IBOutlet id useXineramaButton; - IBOutlet id addToPathButton; - IBOutlet id addToPathField; - IBOutlet id useDefaultShellMatrix; - IBOutlet id useOtherShellField; - IBOutlet id depthButton; - - BOOL isGettingKeyCode; - int keyCode; - int modifiers; - NSMutableString *switchString; -} - -- (IBAction)close:(id)sender; -- (IBAction)pickFile:(id)sender; -- (IBAction)saveChanges:(id)sender; -- (IBAction)setKey:(id)sender; - -- (BOOL)sendEvent:(NSEvent *)anEvent; - -- (void)awakeFromNib; -- (void)windowWillClose:(NSNotification *)aNotification; - -+ (void)setUseKeymapFile:(BOOL)newUseKeymapFile; -+ (void)setKeymapFile:(NSString *)newFile; -+ (void)setSwitchString:(NSString *)newString; -+ (void)setKeyCode:(int)newKeyCode; -+ (void)setModifiers:(int)newModifiers; -+ (void)setDisplay:(int)newDisplay; -+ (void)setDockSwitch:(BOOL)newDockSwitch; -+ (void)setFakeButtons:(BOOL)newFakeButtons; -+ (void)setButton2Mask:(int)newFakeMask; -+ (void)setButton3Mask:(int)newFakeMask; -+ (void)setMouseAccelChange:(BOOL)newMouseAccelChange; -+ (void)setUseQDCursor:(int)newUseQDCursor; -+ (void)setRootless:(BOOL)newRootless; -+ (void)setUseAGL:(BOOL)newUseAGL; -+ (void)setModeWindow:(BOOL)newModeWindow; -+ (void)setStartupHelp:(BOOL)newStartupHelp; -+ (void)setSystemBeep:(BOOL)newSystemBeep; -+ (void)setEnableKeyEquivalents:(BOOL)newKeyEquivs; -+ (void)setXinerama:(BOOL)newXinerama; -+ (void)setAddToPath:(BOOL)newAddToPath; -+ (void)setAddToPathString:(NSString *)newAddToPathString; -+ (void)setUseDefaultShell:(BOOL)newUseDefaultShell; -+ (void)setShellString:(NSString *)newShellString; -+ (void)setDepth:(int)newDepth; -+ (void)setDisplayModeBundles:(NSArray *)newBundles; -+ (void)saveToDisk; - -+ (BOOL)useKeymapFile; -+ (NSString *)keymapFile; -+ (NSString *)switchString; -+ (unsigned int)keyCode; -+ (unsigned int)modifiers; -+ (int)display; -+ (BOOL)dockSwitch; -+ (BOOL)fakeButtons; -+ (int)button2Mask; -+ (int)button3Mask; -+ (BOOL)mouseAccelChange; -+ (int)useQDCursor; -+ (BOOL)rootless; -+ (BOOL)useAGL; -+ (BOOL)modeWindow; -+ (BOOL)startupHelp; -+ (BOOL)systemBeep; -+ (BOOL)enableKeyEquivalents; -+ (BOOL)xinerama; -+ (BOOL)addToPath; -+ (NSString *)addToPathString; -+ (BOOL)useDefaultShell; -+ (NSString *)shellString; -+ (int)depth; -+ (NSArray *)displayModeBundles; - -@end - -// Possible settings for useQDCursor -enum { - qdCursor_Never, // never use QuickDraw cursor - qdCursor_Not8Bit, // don't try to use QuickDraw with 8-bit depth - qdCursor_Always // always try to use QuickDraw cursor -}; - -// Possible settings for depth -enum { - depth_Current, - depth_8Bit, - depth_15Bit, - depth_24Bit -}; diff --git a/hw/darwin/quartz/Preferences.m b/hw/darwin/quartz/Preferences.m deleted file mode 100644 index 0425392ae..000000000 --- a/hw/darwin/quartz/Preferences.m +++ /dev/null @@ -1,598 +0,0 @@ -// -// Preferences.m -// -// This class keeps track of the user preferences. -// -/* - * Copyright (c) 2002-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. - */ - -#include <dix-config.h> - -#import "quartzCommon.h" - -#define BOOL xBOOL -#include "darwin.h" -#undef BOOL - -#import "Preferences.h" - -#include <IOKit/hidsystem/IOLLEvent.h> // for modifier masks - -// Macros to build the path name -#ifndef XBINDIR -#define XBINDIR /usr/X11/bin -#endif -#define STR(s) #s -#define XSTRPATH(s) STR(s) - -// Keys for user defaults dictionary -static NSString *X11EnableKeyEquivalentsKey = @"EnableKeyEquivalents"; - - -@implementation Preferences - -+ (void)initialize -{ - // Provide user defaults if needed - NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInt:0], @"Display", - @"YES", @"FakeButtons", - [NSNumber numberWithInt:NX_COMMANDMASK], @"Button2Mask", - [NSNumber numberWithInt:NX_ALTERNATEMASK], @"Button3Mask", - NSLocalizedString(@"USA.keymapping",@""), @"KeymappingFile", - @"YES", @"UseKeymappingFile", - NSLocalizedString(@"Cmd-Opt-a",@""), @"SwitchString", - @"YES", @"UseRootlessMode", - @"YES", @"UseAGLforGLX", - @"YES", @"ShowModePickWindow", - @"YES", @"ShowStartupHelp", - [NSNumber numberWithInt:0], @"SwitchKeyCode", - [NSNumber numberWithInt:(NSCommandKeyMask | NSAlternateKeyMask)], - @"SwitchModifiers", @"NO", @"UseSystemBeep", - @"YES", X11EnableKeyEquivalentsKey, - @"YES", @"DockSwitch", - @"NO", @"AllowMouseAccelChange", - [NSNumber numberWithInt:qdCursor_Not8Bit], @"UseQDCursor", - @"YES", @"Xinerama", - @"YES", @"AddToPath", - [NSString stringWithCString:XSTRPATH(XBINDIR)], @"AddToPathString", - @"YES", @"UseDefaultShell", - @"/bin/tcsh", @"Shell", - [NSNumber numberWithInt:depth_Current], @"Depth", -#ifdef BUILD_XPR - [NSArray arrayWithObjects:@"xpr.bundle", @"cr.bundle", nil], -#else - [NSArray arrayWithObjects:@"cr.bundle", nil], -#endif - @"DisplayModeBundles", nil]; - - [super initialize]; - [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults]; -} - -// Initialize internal state info of switch key button -- (void)initSwitchKey -{ - keyCode = [Preferences keyCode]; - modifiers = [Preferences modifiers]; - [switchString setString:[Preferences switchString]]; -} - -- (id)init -{ - self = [super init]; - - isGettingKeyCode=NO; - switchString=[[NSMutableString alloc] init]; - [self initSwitchKey]; - - return self; -} - -// Set a modifiers checkbox matrix to match a modifier mask -- (void)resetMatrix:(NSMatrix *)aMatrix withMask:(int)aMask -{ - [aMatrix setState:(aMask & NX_SHIFTMASK) atRow:0 column:0]; - [aMatrix setState:(aMask & NX_CONTROLMASK) atRow:1 column:0]; - [aMatrix setState:(aMask & NX_COMMANDMASK) atRow:2 column:0]; - [aMatrix setState:(aMask & NX_ALTERNATEMASK) atRow:3 column:0]; - [aMatrix setState:(aMask & NX_SECONDARYFNMASK) atRow:4 column:0]; -} - -// Generate a modifiers mask from a modifiers checkbox matrix -- (int)getMaskFromMatrix:(NSMatrix *)aMatrix -{ - int theMask = 0; - - if ([[aMatrix cellAtRow:0 column:0] state]) - theMask |= NX_SHIFTMASK; - if ([[aMatrix cellAtRow:1 column:0] state]) - theMask |= NX_CONTROLMASK; - if ([[aMatrix cellAtRow:2 column:0] state]) - theMask |= NX_COMMANDMASK; - if ([[aMatrix cellAtRow:3 column:0] state]) - theMask |= NX_ALTERNATEMASK; - if ([[aMatrix cellAtRow:4 column:0] state]) - theMask |= NX_SECONDARYFNMASK; - - return theMask; -} - -// Set the window controls to the state in user defaults -- (void)resetWindow -{ - if ([Preferences keymapFile] == nil) - [keymapFileField setStringValue:@" "]; - else - [keymapFileField setStringValue:[Preferences keymapFile]]; - - if ([Preferences switchString] == nil) - [switchKeyButton setTitle:@"--"]; - else - [switchKeyButton setTitle:[Preferences switchString]]; - - [displayField setIntValue:[Preferences display]]; - [dockSwitchButton setIntValue:[Preferences dockSwitch]]; - [fakeButton setIntValue:[Preferences fakeButtons]]; - [self resetMatrix:button2ModifiersMatrix - withMask:[Preferences button2Mask]]; - [self resetMatrix:button3ModifiersMatrix - withMask:[Preferences button3Mask]]; - [modeMatrix setState:[Preferences rootless] atRow:0 column:1]; - [startupHelpButton setIntValue:[Preferences startupHelp]]; - [modeWindowButton setIntValue:[Preferences modeWindow]]; - [systemBeepButton setIntValue:[Preferences systemBeep]]; - [mouseAccelChangeButton setIntValue:[Preferences mouseAccelChange]]; - [useXineramaButton setIntValue:[Preferences xinerama]]; - [addToPathButton setIntValue:[Preferences addToPath]]; - [addToPathField setStringValue:[Preferences addToPathString]]; - [useDefaultShellMatrix setState:![Preferences useDefaultShell] - atRow:1 column:0]; - [useOtherShellField setStringValue:[Preferences shellString]]; - [depthButton selectItemAtIndex:[Preferences depth]]; -} - -- (void)awakeFromNib -{ - [self resetWindow]; -} - -// Preference window delegate -- (void)windowWillClose:(NSNotification *)aNotification -{ - [self resetWindow]; - [self initSwitchKey]; -} - -// User cancelled the changes -- (IBAction)close:(id)sender -{ - [window orderOut:nil]; - [self resetWindow]; // reset window controls - [self initSwitchKey]; // reset switch key state -} - -// Pick keymapping file -- (IBAction)pickFile:(id)sender -{ - int result; - NSArray *fileTypes = [NSArray arrayWithObject:@"keymapping"]; - NSOpenPanel *oPanel = [NSOpenPanel openPanel]; - - [oPanel setAllowsMultipleSelection:NO]; - result = [oPanel runModalForDirectory:@"/System/Library/Keyboards" - file:nil types:fileTypes]; - if (result == NSOKButton) { - [keymapFileField setStringValue:[oPanel filename]]; - } -} - -// User saved changes -- (IBAction)saveChanges:(id)sender -{ - [Preferences setKeyCode:keyCode]; - [Preferences setModifiers:modifiers]; - [Preferences setSwitchString:switchString]; - [Preferences setKeymapFile:[keymapFileField stringValue]]; - [Preferences setUseKeymapFile:YES]; - [Preferences setDisplay:[displayField intValue]]; - [Preferences setDockSwitch:[dockSwitchButton intValue]]; - [Preferences setFakeButtons:[fakeButton intValue]]; - [Preferences setButton2Mask: - [self getMaskFromMatrix:button2ModifiersMatrix]]; - [Preferences setButton3Mask: - [self getMaskFromMatrix:button3ModifiersMatrix]]; - [Preferences setRootless:[[modeMatrix cellAtRow:0 column:1] state]]; - [Preferences setModeWindow:[modeWindowButton intValue]]; - [Preferences setStartupHelp:[startupHelpButton intValue]]; - [Preferences setSystemBeep:[systemBeepButton intValue]]; - [Preferences setMouseAccelChange:[mouseAccelChangeButton intValue]]; - [Preferences setXinerama:[useXineramaButton intValue]]; - [Preferences setAddToPath:[addToPathButton intValue]]; - [Preferences setAddToPathString:[addToPathField stringValue]]; - [Preferences setUseDefaultShell: - [[useDefaultShellMatrix cellAtRow:0 column:0] state]]; - [Preferences setShellString:[useOtherShellField stringValue]]; - [Preferences setDepth:[depthButton indexOfSelectedItem]]; - [Preferences saveToDisk]; - - [window orderOut:nil]; -} - -- (IBAction)setKey:(id)sender -{ - [switchKeyButton setTitle:NSLocalizedString(@"Press key",@"")]; - isGettingKeyCode=YES; - [switchString setString:@""]; -} - -- (BOOL)sendEvent:(NSEvent *)anEvent -{ - if(isGettingKeyCode) { - if([anEvent type]==NSKeyDown) // wait for keyup - return YES; - if([anEvent type]!=NSKeyUp) - return NO; - - if([anEvent modifierFlags] & NSCommandKeyMask) - [switchString appendString:@"Cmd-"]; - if([anEvent modifierFlags] & NSControlKeyMask) - [switchString appendString:@"Ctrl-"]; - if([anEvent modifierFlags] & NSAlternateKeyMask) - [switchString appendString:@"Opt-"]; - if([anEvent modifierFlags] & NSNumericPadKeyMask) // doesn't work - [switchString appendString:@"Num-"]; - if([anEvent modifierFlags] & NSHelpKeyMask) - [switchString appendString:@"Help-"]; - if([anEvent modifierFlags] & NSFunctionKeyMask) // powerbooks only - [switchString appendString:@"Fn-"]; - - [switchString appendString:[anEvent charactersIgnoringModifiers]]; - [switchKeyButton setTitle:switchString]; - - keyCode = [anEvent keyCode]; - modifiers = [anEvent modifierFlags]; - isGettingKeyCode=NO; - - return YES; - } - return NO; -} - -+ (void)setKeymapFile:(NSString *)newFile -{ - [[NSUserDefaults standardUserDefaults] setObject:newFile - forKey:@"KeymappingFile"]; -} - -+ (void)setUseKeymapFile:(BOOL)newUseKeymapFile -{ - [[NSUserDefaults standardUserDefaults] setBool:newUseKeymapFile - forKey:@"UseKeymappingFile"]; -} - -+ (void)setSwitchString:(NSString *)newString -{ - [[NSUserDefaults standardUserDefaults] setObject:newString - forKey:@"SwitchString"]; -} - -+ (void)setKeyCode:(int)newKeyCode -{ - [[NSUserDefaults standardUserDefaults] setInteger:newKeyCode - forKey:@"SwitchKeyCode"]; -} - -+ (void)setModifiers:(int)newModifiers -{ - [[NSUserDefaults standardUserDefaults] setInteger:newModifiers - forKey:@"SwitchModifiers"]; -} - -+ (void)setDisplay:(int)newDisplay -{ - [[NSUserDefaults standardUserDefaults] setInteger:newDisplay - forKey:@"Display"]; -} - -+ (void)setDockSwitch:(BOOL)newDockSwitch -{ - [[NSUserDefaults standardUserDefaults] setBool:newDockSwitch - forKey:@"DockSwitch"]; -} - -+ (void)setFakeButtons:(BOOL)newFakeButtons -{ - [[NSUserDefaults standardUserDefaults] setBool:newFakeButtons - forKey:@"FakeButtons"]; - // Update the setting used by the X server thread - darwinFakeButtons = newFakeButtons; -} - -+ (void)setButton2Mask:(int)newFakeMask -{ - [[NSUserDefaults standardUserDefaults] setInteger:newFakeMask - forKey:@"Button2Mask"]; - // Update the setting used by the X server thread - darwinFakeMouse2Mask = newFakeMask; -} - -+ (void)setButton3Mask:(int)newFakeMask -{ - [[NSUserDefaults standardUserDefaults] setInteger:newFakeMask - forKey:@"Button3Mask"]; - // Update the setting used by the X server thread - darwinFakeMouse3Mask = newFakeMask; -} - -+ (void)setMouseAccelChange:(BOOL)newMouseAccelChange -{ - [[NSUserDefaults standardUserDefaults] setBool:newMouseAccelChange - forKey:@"AllowMouseAccelChange"]; - // Update the setting used by the X server thread - // darwinMouseAccelChange = newMouseAccelChange; -} - -+ (void)setUseQDCursor:(int)newUseQDCursor -{ - [[NSUserDefaults standardUserDefaults] setInteger:newUseQDCursor - forKey:@"UseQDCursor"]; -} - -+ (void)setModeWindow:(BOOL)newModeWindow -{ - [[NSUserDefaults standardUserDefaults] setBool:newModeWindow - forKey:@"ShowModePickWindow"]; -} - -+ (void)setRootless:(BOOL)newRootless -{ - [[NSUserDefaults standardUserDefaults] setBool:newRootless - forKey:@"UseRootlessMode"]; -} - -+ (void)setUseAGL:(BOOL)newUseAGL -{ - [[NSUserDefaults standardUserDefaults] setBool:newUseAGL - forKey:@"UseAGLforGLX"]; -} - -+ (void)setStartupHelp:(BOOL)newStartupHelp -{ - [[NSUserDefaults standardUserDefaults] setBool:newStartupHelp - forKey:@"ShowStartupHelp"]; -} - -+ (void)setSystemBeep:(BOOL)newSystemBeep -{ - [[NSUserDefaults standardUserDefaults] setBool:newSystemBeep - forKey:@"UseSystemBeep"]; - // Update the setting used by the X server thread - quartzUseSysBeep = newSystemBeep; -} - -+ (void)setEnableKeyEquivalents:(BOOL)newKeyEquivs -{ - [[NSUserDefaults standardUserDefaults] setBool:newKeyEquivs - forKey:X11EnableKeyEquivalentsKey]; - // Update the setting used by the X server thread - quartzEnableKeyEquivalents = newKeyEquivs; -} - -+ (void)setXinerama:(BOOL)newXinerama -{ - [[NSUserDefaults standardUserDefaults] setBool:newXinerama - forKey:@"Xinerama"]; -} - -+ (void)setAddToPath:(BOOL)newAddToPath -{ - [[NSUserDefaults standardUserDefaults] setBool:newAddToPath - forKey:@"AddToPath"]; -} - -+ (void)setAddToPathString:(NSString *)newAddToPathString -{ - [[NSUserDefaults standardUserDefaults] setObject:newAddToPathString - forKey:@"AddToPathString"]; -} - -+ (void)setUseDefaultShell:(BOOL)newUseDefaultShell -{ - [[NSUserDefaults standardUserDefaults] setBool:newUseDefaultShell - forKey:@"UseDefaultShell"]; -} - -+ (void)setShellString:(NSString *)newShellString -{ - [[NSUserDefaults standardUserDefaults] setObject:newShellString - forKey:@"Shell"]; -} - -+ (void)setDepth:(int)newDepth -{ - [[NSUserDefaults standardUserDefaults] setInteger:newDepth - forKey:@"Depth"]; -} - -+ (void)setDisplayModeBundles:(NSArray *)newBundles -{ - [[NSUserDefaults standardUserDefaults] setObject:newBundles - forKey:@"DisplayModeBundles"]; -} - -+ (void)saveToDisk -{ - [[NSUserDefaults standardUserDefaults] synchronize]; -} - -+ (BOOL)useKeymapFile -{ - return [[NSUserDefaults standardUserDefaults] - boolForKey:@"UseKeymappingFile"]; -} - -+ (NSString *)keymapFile -{ - return [[NSUserDefaults standardUserDefaults] - stringForKey:@"KeymappingFile"]; -} - -+ (NSString *)switchString -{ - return [[NSUserDefaults standardUserDefaults] - stringForKey:@"SwitchString"]; -} - -+ (unsigned int)keyCode -{ - return [[NSUserDefaults standardUserDefaults] - integerForKey:@"SwitchKeyCode"]; -} - -+ (unsigned int)modifiers -{ - return [[NSUserDefaults standardUserDefaults] - integerForKey:@"SwitchModifiers"]; -} - -+ (int)display -{ - return [[NSUserDefaults standardUserDefaults] - integerForKey:@"Display"]; -} - -+ (BOOL)dockSwitch -{ - return [[NSUserDefaults standardUserDefaults] boolForKey:@"DockSwitch"]; -} - -+ (BOOL)fakeButtons -{ - return [[NSUserDefaults standardUserDefaults] boolForKey:@"FakeButtons"]; -} - -+ (int)button2Mask -{ - return [[NSUserDefaults standardUserDefaults] - integerForKey:@"Button2Mask"]; -} - -+ (int)button3Mask -{ - return [[NSUserDefaults standardUserDefaults] - integerForKey:@"Button3Mask"]; -} - -+ (BOOL)mouseAccelChange -{ - return [[NSUserDefaults standardUserDefaults] - boolForKey:@"AllowMouseAccelChange"]; -} - -+ (int)useQDCursor -{ - return [[NSUserDefaults standardUserDefaults] - integerForKey:@"UseQDCursor"]; -} - -+ (BOOL)rootless -{ - return [[NSUserDefaults standardUserDefaults] - boolForKey:@"UseRootlessMode"]; -} - -+ (BOOL)useAGL -{ - return [[NSUserDefaults standardUserDefaults] - boolForKey:@"UseAGLforGLX"]; -} - -+ (BOOL)modeWindow -{ - return [[NSUserDefaults standardUserDefaults] - boolForKey:@"ShowModePickWindow"]; -} - -+ (BOOL)startupHelp -{ - return [[NSUserDefaults standardUserDefaults] - boolForKey:@"ShowStartupHelp"]; -} - -+ (BOOL)systemBeep -{ - return [[NSUserDefaults standardUserDefaults] boolForKey:@"UseSystemBeep"]; -} - -+ (BOOL)enableKeyEquivalents -{ - return [[NSUserDefaults standardUserDefaults] boolForKey:X11EnableKeyEquivalentsKey]; -} - -+ (BOOL)xinerama -{ - return [[NSUserDefaults standardUserDefaults] boolForKey:@"Xinerama"]; -} - -+ (BOOL)addToPath -{ - return [[NSUserDefaults standardUserDefaults] boolForKey:@"AddToPath"]; -} - -+ (NSString *)addToPathString -{ - return [[NSUserDefaults standardUserDefaults] - stringForKey:@"AddToPathString"]; -} - -+ (BOOL)useDefaultShell -{ - return [[NSUserDefaults standardUserDefaults] - boolForKey:@"UseDefaultShell"]; -} - -+ (NSString *)shellString -{ - return [[NSUserDefaults standardUserDefaults] - stringForKey:@"Shell"]; -} - -+ (int)depth -{ - return [[NSUserDefaults standardUserDefaults] - integerForKey:@"Depth"]; -} - -+ (NSArray *)displayModeBundles -{ - return [[NSUserDefaults standardUserDefaults] - objectForKey:@"DisplayModeBundles"]; -} - -@end diff --git a/hw/darwin/quartz/X11Application.m b/hw/darwin/quartz/X11Application.m index 6d079ee4a..60d11c5ed 100644 --- a/hw/darwin/quartz/X11Application.m +++ b/hw/darwin/quartz/X11Application.m @@ -27,7 +27,7 @@ promote the sale, use or other dealings in this Software without prior written authorization. */ -#include "../quartz/quartzCommon.h" +#include "quartzCommon.h" #import "X11Application.h" #include <Carbon/Carbon.h> @@ -35,7 +35,7 @@ /* ouch! */ #define BOOL X_BOOL # include "darwin.h" -# include "../quartz/quartz.h" +# include "quartz.h" # define _APPLEWM_SERVER_ # include "X11/extensions/applewm.h" # include "micmap.h" diff --git a/hw/darwin/quartz/X11Controller.h b/hw/darwin/quartz/X11Controller.h index 8d17fd9c3..f1399dc49 100644 --- a/hw/darwin/quartz/X11Controller.h +++ b/hw/darwin/quartz/X11Controller.h @@ -33,7 +33,7 @@ #if __OBJC__ #import <Cocoa/Cocoa.h> -#include "../quartz/xpr/x-list.h" +#include "xpr/x-list.h" @interface X11Controller : NSObject { diff --git a/hw/darwin/quartz/X11Controller.m b/hw/darwin/quartz/X11Controller.m index fbc9c7402..6929566f7 100644 --- a/hw/darwin/quartz/X11Controller.m +++ b/hw/darwin/quartz/X11Controller.m @@ -29,7 +29,7 @@ #define DEFAULT_PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11/bin" -#include "../quartz/quartzCommon.h" +#include "quartzCommon.h" #import "X11Controller.h" #import "X11Application.h" @@ -39,10 +39,10 @@ #define BOOL X_BOOL #include "opaque.h" # include "darwin.h" -# include "../quartz/quartz.h" +# include "quartz.h" # define _APPLEWM_SERVER_ # include "X11/extensions/applewm.h" -# include "../quartz/applewmExt.h" +# include "applewmExt.h" #undef BOOL #include <stdio.h> @@ -51,8 +51,6 @@ #include <sys/types.h> #include <sys/wait.h> -#define TRACE() fprintf (stderr, "%s\n", __FUNCTION__) - @implementation X11Controller - (void) awakeFromNib diff --git a/hw/darwin/quartz/cr/cr.h b/hw/darwin/quartz/cr/cr.h index d6779ae7d..0ebad5da0 100644 --- a/hw/darwin/quartz/cr/cr.h +++ b/hw/darwin/quartz/cr/cr.h @@ -1,7 +1,6 @@ /* * Internal definitions of the Cocoa rootless implementation - */ -/* + * * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/hw/darwin/quartz/fullscreen/quartzCursor.c b/hw/darwin/quartz/fullscreen/quartzCursor.c index a97a36d88..52477817e 100644 --- a/hw/darwin/quartz/fullscreen/quartzCursor.c +++ b/hw/darwin/quartz/fullscreen/quartzCursor.c @@ -2,8 +2,6 @@ * * Support for using the Quartz Window Manager cursor * - **************************************************************/ -/* * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker. * All Rights Reserved. * diff --git a/hw/darwin/quartz/quartz.c b/hw/darwin/quartz/quartz.c index 8565e347e..23707a071 100644 --- a/hw/darwin/quartz/quartz.c +++ b/hw/darwin/quartz/quartz.c @@ -504,18 +504,6 @@ void DarwinModeProcessEvent( RootlessOrderAllWindows(); break; - case kXDarwinWindowState: - ErrorF("kXDarwinWindowState\n"); - break; - case kXDarwinWindowMoved: { - WindowPtr pWin = (WindowPtr)xe->u.clientMessage.u.l.longs0; - short x = xe->u.clientMessage.u.l.longs1, - y = xe->u.clientMessage.u.l.longs2; - ErrorF("kXDarwinWindowMoved(%p, %hd, %hd)\n", pWin, x, y); - RootlessMoveWindow(pWin, x, y, pWin->nextSib, VTMove); - } - break; - default: ErrorF("Unknown application defined event type %d.\n", xe->u.u.type); } diff --git a/hw/darwin/quartz/quartzCursor.c b/hw/darwin/quartz/quartzCursor.c index 0fa04e677..15f555302 100644 --- a/hw/darwin/quartz/quartzCursor.c +++ b/hw/darwin/quartz/quartzCursor.c @@ -2,8 +2,6 @@ * * Support for using the Quartz Window Manager cursor * - **************************************************************/ -/* * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker. * All Rights Reserved. * @@ -92,9 +90,7 @@ static pthread_cond_t cursorCondition; /* Acquire lock and tell the main thread to change cursor */ \ pthread_mutex_lock(&cursorMutex); \ currentCursor = (CCrsrHandle) (cursorH); \ -#ifndef INXQUARTZ QuartzMessageMainThread(kQuartzCursorUpdate, NULL, 0); \ -#endif \ /* Wait for the main thread to change the cursor */ \ pthread_cond_wait(&cursorCondition, &cursorMutex); \ diff --git a/hw/darwin/quartz/quartzKeyboard.c b/hw/darwin/quartz/quartzKeyboard.c index b40d81e21..49c5bfdcd 100644 --- a/hw/darwin/quartz/quartzKeyboard.c +++ b/hw/darwin/quartz/quartzKeyboard.c @@ -3,7 +3,7 @@ Code to build a keymap using the Carbon Keyboard Layout API. - Copyright (c) 2003, 2007 Apple Inc. + Copyright (c) 2003-2007 Apple Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files @@ -34,6 +34,7 @@ #include <dix-config.h> #include "quartzCommon.h" + #include <CoreServices/CoreServices.h> #include <Carbon/Carbon.h> diff --git a/hw/darwin/quartz/quartzPasteboard.c b/hw/darwin/quartz/quartzPasteboard.c index af25fc892..213019747 100644 --- a/hw/darwin/quartz/quartzPasteboard.c +++ b/hw/darwin/quartz/quartzPasteboard.c @@ -33,6 +33,7 @@ #include <dix-config.h> #include "quartzPasteboard.h" + #include <X11/Xatom.h> #include "windowstr.h" #include "propertyst.h" diff --git a/hw/darwin/quartz/quartzStartup.c b/hw/darwin/quartz/quartzStartup.c index 0381a9f6a..6f45949be 100644 --- a/hw/darwin/quartz/quartzStartup.c +++ b/hw/darwin/quartz/quartzStartup.c @@ -2,8 +2,6 @@ * * Startup code for the Quartz Darwin X Server * - **************************************************************/ -/* * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/hw/darwin/quartz/xpr/dri.c b/hw/darwin/quartz/xpr/dri.c index fd0bff1a9..4ade24916 100644 --- a/hw/darwin/quartz/xpr/dri.c +++ b/hw/darwin/quartz/xpr/dri.c @@ -36,8 +36,13 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <dix-config.h> +#ifdef XFree86LOADER +#include "xf86.h" +#include "xf86_ansic.h" +#else #include <sys/time.h> #include <unistd.h> +#endif #define NEED_REPLIES #define NEED_EVENTS diff --git a/hw/darwin/quartz/xpr/xpr.h b/hw/darwin/quartz/xpr/xpr.h index bd8e63e61..ddc6d0cb1 100644 --- a/hw/darwin/quartz/xpr/xpr.h +++ b/hw/darwin/quartz/xpr/xpr.h @@ -1,7 +1,6 @@ /* * Xplugin rootless implementation - */ -/* + * * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a diff --git a/hw/darwin/quartz/xpr/xprAppleWM.c b/hw/darwin/quartz/xpr/xprAppleWM.c index 1573d215b..f639b55fe 100644 --- a/hw/darwin/quartz/xpr/xprAppleWM.c +++ b/hw/darwin/quartz/xpr/xprAppleWM.c @@ -1,7 +1,6 @@ /* * Xplugin rootless implementation functions for AppleWM extension - */ -/* + * * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. * diff --git a/hw/darwin/quartz/xpr/xprScreen.c b/hw/darwin/quartz/xpr/xprScreen.c index 57a60a20b..aff190155 100644 --- a/hw/darwin/quartz/xpr/xprScreen.c +++ b/hw/darwin/quartz/xpr/xprScreen.c @@ -117,7 +117,7 @@ eventHandler(unsigned int type, const void *arg, } /* - * displayScreenBounds + * displayAtIndex * Return the display ID for a particular display index. */ static CGDirectDisplayID @@ -233,7 +233,6 @@ xprDisplayInit(void) darwinScreensFound = 1; if (xp_init(XP_BACKGROUND_EVENTS | XP_NO_DEFERRED_UPDATES) != Success) - { FatalError("Could not initialize the Xplugin library."); xp_select_events(XP_EVENT_DISPLAY_CHANGED @@ -324,6 +323,9 @@ static Bool xprSetupScreen(int index, ScreenPtr pScreen) { // Add alpha protecting replacements for fb screen functions + pScreen->PaintWindowBackground = SafeAlphaPaintWindow; + pScreen->PaintWindowBorder = SafeAlphaPaintWindow; + #ifdef RENDER { PictureScreenPtr ps = GetPictureScreen(pScreen); |