Darwin: Misc cleanups to line up with xorg-server-1.2-apple
This commit is contained in:
parent
5e950123da
commit
4d9cef197b
|
@ -14,6 +14,7 @@
|
||||||
527F241F0B5D938C007840A7 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50F4F0A7039D6ACA0E82C0CB /* CoreFoundation.framework */; };
|
527F241F0B5D938C007840A7 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50F4F0A7039D6ACA0E82C0CB /* CoreFoundation.framework */; };
|
||||||
527F24200B5D938C007840A7 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 570C5748047186C400ACF82F /* SystemConfiguration.framework */; };
|
527F24200B5D938C007840A7 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 570C5748047186C400ACF82F /* SystemConfiguration.framework */; };
|
||||||
527F24370B5D9D89007840A7 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 527F24260B5D938C007840A7 /* Info.plist */; };
|
527F24370B5D9D89007840A7 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 527F24260B5D938C007840A7 /* Info.plist */; };
|
||||||
|
52D9C0ED0BCDDF6B00CD2AFC /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 52D9C0EB0BCDDF6B00CD2AFC /* Localizable.strings */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
|
@ -24,6 +25,7 @@
|
||||||
50F4F0A7039D6ACA0E82C0CB /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
|
50F4F0A7039D6ACA0E82C0CB /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
|
||||||
527F24260B5D938C007840A7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; };
|
527F24260B5D938C007840A7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
527F24270B5D938C007840A7 /* X11.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = X11.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
527F24270B5D938C007840A7 /* X11.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = X11.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
52D9C0EC0BCDDF6B00CD2AFC /* English */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||||
570C5748047186C400ACF82F /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = /System/Library/Frameworks/SystemConfiguration.framework; sourceTree = "<absolute>"; };
|
570C5748047186C400ACF82F /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = /System/Library/Frameworks/SystemConfiguration.framework; sourceTree = "<absolute>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
@ -71,6 +73,7 @@
|
||||||
20286C2CFDCF999611CA2CEA /* Resources */ = {
|
20286C2CFDCF999611CA2CEA /* Resources */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
52D9C0EB0BCDDF6B00CD2AFC /* Localizable.strings */,
|
||||||
50459C5F038587C60ECA21EC /* X11.icns */,
|
50459C5F038587C60ECA21EC /* X11.icns */,
|
||||||
0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */,
|
0867D6AAFE840B52C02AAC07 /* InfoPlist.strings */,
|
||||||
02345980000FD03B11CA0E72 /* main.nib */,
|
02345980000FD03B11CA0E72 /* main.nib */,
|
||||||
|
@ -146,6 +149,7 @@
|
||||||
527F24190B5D938C007840A7 /* InfoPlist.strings in Resources */,
|
527F24190B5D938C007840A7 /* InfoPlist.strings in Resources */,
|
||||||
527F241A0B5D938C007840A7 /* main.nib in Resources */,
|
527F241A0B5D938C007840A7 /* main.nib in Resources */,
|
||||||
527F241B0B5D938C007840A7 /* X11.icns in Resources */,
|
527F241B0B5D938C007840A7 /* X11.icns in Resources */,
|
||||||
|
52D9C0ED0BCDDF6B00CD2AFC /* Localizable.strings in Resources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
@ -189,6 +193,14 @@
|
||||||
name = InfoPlist.strings;
|
name = InfoPlist.strings;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
52D9C0EB0BCDDF6B00CD2AFC /* Localizable.strings */ = {
|
||||||
|
isa = PBXVariantGroup;
|
||||||
|
children = (
|
||||||
|
52D9C0EC0BCDDF6B00CD2AFC /* English */,
|
||||||
|
);
|
||||||
|
name = Localizable.strings;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
/* End PBXVariantGroup section */
|
/* End PBXVariantGroup section */
|
||||||
|
|
||||||
/* Begin XCBuildConfiguration section */
|
/* Begin XCBuildConfiguration section */
|
||||||
|
@ -219,7 +231,7 @@
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
FRAMEWORK_SEARCH_PATHS = "";
|
FRAMEWORK_SEARCH_PATHS = "";
|
||||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||||
HEADER_SEARCH_PATHS = "";
|
HEADER_SEARCH_PATHS = /usr/X11/include;
|
||||||
INFOPLIST_FILE = Info.plist;
|
INFOPLIST_FILE = Info.plist;
|
||||||
INSTALL_PATH = /usr/X11;
|
INSTALL_PATH = /usr/X11;
|
||||||
LIBRARY_SEARCH_PATHS = /usr/X11/lib;
|
LIBRARY_SEARCH_PATHS = /usr/X11/lib;
|
||||||
|
@ -247,7 +259,7 @@
|
||||||
COPY_PHASE_STRIP = YES;
|
COPY_PHASE_STRIP = YES;
|
||||||
FRAMEWORK_SEARCH_PATHS = "";
|
FRAMEWORK_SEARCH_PATHS = "";
|
||||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||||
HEADER_SEARCH_PATHS = "";
|
HEADER_SEARCH_PATHS = /usr/X11/include;
|
||||||
INFOPLIST_FILE = Info.plist;
|
INFOPLIST_FILE = Info.plist;
|
||||||
INSTALL_PATH = /usr/X11;
|
INSTALL_PATH = /usr/X11;
|
||||||
LIBRARY_SEARCH_PATHS = /usr/X11/lib;
|
LIBRARY_SEARCH_PATHS = /usr/X11/lib;
|
||||||
|
@ -274,7 +286,7 @@
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
FRAMEWORK_SEARCH_PATHS = "";
|
FRAMEWORK_SEARCH_PATHS = "";
|
||||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||||
HEADER_SEARCH_PATHS = "";
|
HEADER_SEARCH_PATHS = /usr/X11/include;
|
||||||
INFOPLIST_FILE = Info.plist;
|
INFOPLIST_FILE = Info.plist;
|
||||||
INSTALL_PATH = /usr/X11;
|
INSTALL_PATH = /usr/X11;
|
||||||
LIBRARY_SEARCH_PATHS = /usr/X11/lib;
|
LIBRARY_SEARCH_PATHS = /usr/X11/lib;
|
||||||
|
|
|
@ -217,7 +217,7 @@ static void DarwinChangeKeyboardControl( DeviceIntPtr device, KeybdCtrl *ctrl )
|
||||||
// keyclick, bell volume / pitch, autorepead, LED's
|
// keyclick, bell volume / pitch, autorepead, LED's
|
||||||
}
|
}
|
||||||
|
|
||||||
static darwinKeyboardInfo keyInfo;
|
darwinKeyboardInfo keyInfo;
|
||||||
static FILE *fref = NULL;
|
static FILE *fref = NULL;
|
||||||
static char *inBuffer = NULL;
|
static char *inBuffer = NULL;
|
||||||
|
|
||||||
|
@ -816,7 +816,7 @@ void DarwinKeyboardInit(
|
||||||
assert( darwinParamConnect = NXOpenEventStatus() );
|
assert( darwinParamConnect = NXOpenEventStatus() );
|
||||||
|
|
||||||
DarwinLoadKeyboardMapping(&keySyms);
|
DarwinLoadKeyboardMapping(&keySyms);
|
||||||
|
// DarwinKeyboardReload(pDev);
|
||||||
/* Initialize the seed, so we don't reload the keymap unnecessarily
|
/* Initialize the seed, so we don't reload the keymap unnecessarily
|
||||||
(and possibly overwrite xinitrc changes) */
|
(and possibly overwrite xinitrc changes) */
|
||||||
DarwinModeSystemKeymapSeed();
|
DarwinModeSystemKeymapSeed();
|
||||||
|
@ -835,6 +835,7 @@ InitModMap(register KeyClassPtr keyc)
|
||||||
CARD8 keysPerModifier[8];
|
CARD8 keysPerModifier[8];
|
||||||
CARD8 mask;
|
CARD8 mask;
|
||||||
|
|
||||||
|
// darwinKeyc = keyc;
|
||||||
if (keyc->modifierKeyMap != NULL)
|
if (keyc->modifierKeyMap != NULL)
|
||||||
xfree (keyc->modifierKeyMap);
|
xfree (keyc->modifierKeyMap);
|
||||||
|
|
||||||
|
@ -886,7 +887,7 @@ DarwinKeyboardReload(DeviceIntPtr pDev)
|
||||||
|
|
||||||
memmove(pDev->key->modifierMap, keyInfo.modMap, MAP_LENGTH);
|
memmove(pDev->key->modifierMap, keyInfo.modMap, MAP_LENGTH);
|
||||||
InitModMap(pDev->key);
|
InitModMap(pDev->key);
|
||||||
}
|
} else DEBUG_LOG("SetKeySymsMap=0\n");
|
||||||
|
|
||||||
SendMappingNotify(MappingKeyboard, MIN_KEYCODE, NUM_KEYCODES, 0);
|
SendMappingNotify(MappingKeyboard, MIN_KEYCODE, NUM_KEYCODES, 0);
|
||||||
SendMappingNotify(MappingModifier, 0, 0, 0);
|
SendMappingNotify(MappingModifier, 0, 0, 0);
|
||||||
|
@ -935,6 +936,32 @@ int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide)
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DarwinModifierNXMaskToNXKeyCode
|
||||||
|
* Returns 0 if mask is not a known modifier mask.
|
||||||
|
*/
|
||||||
|
int DarwinModifierNXMaskToNXKeyCode(int mask)
|
||||||
|
{
|
||||||
|
switch (mask) {
|
||||||
|
case NX_ALPHASHIFTMASK: return XK_Caps_Lock;
|
||||||
|
case NX_SHIFTMASK: ErrorF("Warning: Received NX_SHIFTMASK, treating as NX_DEVICELSHIFTKEYMASK\n");
|
||||||
|
case NX_DEVICELSHIFTKEYMASK: return NX_MODIFIERKEY_SHIFT; //XK_Shift_L;
|
||||||
|
case NX_DEVICERSHIFTKEYMASK: return NX_MODIFIERKEY_RSHIFT; //XK_Shift_R;
|
||||||
|
case NX_CONTROLMASK: ErrorF("Warning: Received NX_CONTROLMASK, treating as NX_DEVICELCTLKEYMASK\n");
|
||||||
|
case NX_DEVICELCTLKEYMASK: return XK_Control_L;
|
||||||
|
case NX_DEVICERCTLKEYMASK: return XK_Control_R;
|
||||||
|
case NX_ALTERNATEMASK: ErrorF("Warning: Received NX_ALTERNATEMASK, treating as NX_DEVICELALTKEYMASK\n");
|
||||||
|
case NX_DEVICELALTKEYMASK: return XK_Alt_L;
|
||||||
|
case NX_DEVICERALTKEYMASK: return XK_Alt_R;
|
||||||
|
case NX_COMMANDMASK: ErrorF("Warning: Received NX_COMMANDMASK, treating as NX_DEVICELCMDKEYMASK\n");
|
||||||
|
case NX_DEVICELCMDKEYMASK: return XK_Meta_L;
|
||||||
|
case NX_DEVICERCMDKEYMASK: return XK_Meta_R;
|
||||||
|
case NX_NUMERICPADMASK: return XK_Num_Lock;
|
||||||
|
case NX_HELPMASK: return XK_Help;
|
||||||
|
case NX_SECONDARYFNMASK: return XK_Control_L; // this seems very wrong, but is what the old code did
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DarwinModifierNXMaskToNXKey
|
* DarwinModifierNXMaskToNXKey
|
||||||
* Returns -1 if mask is not a known modifier mask.
|
* Returns -1 if mask is not a known modifier mask.
|
||||||
|
@ -970,6 +997,29 @@ int DarwinModifierNXMaskToNXKey(int mask)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char * DarwinModifierNXMaskTostring(int mask)
|
||||||
|
{
|
||||||
|
switch (mask) {
|
||||||
|
case NX_ALPHASHIFTMASK: return "NX_ALPHASHIFTMASK";
|
||||||
|
case NX_SHIFTMASK: return "NX_SHIFTMASK";
|
||||||
|
case NX_DEVICELSHIFTKEYMASK: return "NX_DEVICELSHIFTKEYMASK";
|
||||||
|
case NX_DEVICERSHIFTKEYMASK: return "NX_DEVICERSHIFTKEYMASK";
|
||||||
|
case NX_CONTROLMASK: return "NX_CONTROLMASK";
|
||||||
|
case NX_DEVICELCTLKEYMASK: return "NX_DEVICELCTLKEYMASK";
|
||||||
|
case NX_DEVICERCTLKEYMASK: return "NX_DEVICERCTLKEYMASK";
|
||||||
|
case NX_ALTERNATEMASK: return "NX_ALTERNATEMASK";
|
||||||
|
case NX_DEVICELALTKEYMASK: return "NX_DEVICELALTKEYMASK";
|
||||||
|
case NX_DEVICERALTKEYMASK: return "NX_DEVICERALTKEYMASK";
|
||||||
|
case NX_COMMANDMASK: return "NX_COMMANDMASK";
|
||||||
|
case NX_DEVICELCMDKEYMASK: return "NX_DEVICELCMDKEYMASK";
|
||||||
|
case NX_DEVICERCMDKEYMASK: return "NX_DEVICERCMDKEYMASK";
|
||||||
|
case NX_NUMERICPADMASK: return "NX_NUMERICPADMASK";
|
||||||
|
case NX_HELPMASK: return "NX_HELPMASK";
|
||||||
|
case NX_SECONDARYFNMASK: return "NX_SECONDARYFNMASK";
|
||||||
|
}
|
||||||
|
return "unknown mask";
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DarwinModifierNXKeyToNXMask
|
* DarwinModifierNXKeyToNXMask
|
||||||
* Returns 0 if key is not a known modifier key.
|
* Returns 0 if key is not a known modifier key.
|
||||||
|
@ -1020,7 +1070,7 @@ int DarwinModifierStringToNXKey(const char *str)
|
||||||
* This allows the ddx layer to prevent some keys from being remapped
|
* This allows the ddx layer to prevent some keys from being remapped
|
||||||
* as modifier keys.
|
* as modifier keys.
|
||||||
*/
|
*/
|
||||||
Bool LegalModifier(unsigned int key, DeviceIntPtr pDev)
|
Bool LegalModifier(unsigned int key, DevicePtr pDev)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
|
||||||
};
|
|
|
@ -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
|
|
|
@ -27,7 +27,7 @@
|
||||||
promote the sale, use or other dealings in this Software without
|
promote the sale, use or other dealings in this Software without
|
||||||
prior written authorization. */
|
prior written authorization. */
|
||||||
|
|
||||||
#include "../quartz/quartzCommon.h"
|
#include "quartzCommon.h"
|
||||||
|
|
||||||
#import "X11Application.h"
|
#import "X11Application.h"
|
||||||
#include <Carbon/Carbon.h>
|
#include <Carbon/Carbon.h>
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
/* ouch! */
|
/* ouch! */
|
||||||
#define BOOL X_BOOL
|
#define BOOL X_BOOL
|
||||||
# include "darwin.h"
|
# include "darwin.h"
|
||||||
# include "../quartz/quartz.h"
|
# include "quartz.h"
|
||||||
# define _APPLEWM_SERVER_
|
# define _APPLEWM_SERVER_
|
||||||
# include "X11/extensions/applewm.h"
|
# include "X11/extensions/applewm.h"
|
||||||
# include "micmap.h"
|
# include "micmap.h"
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#if __OBJC__
|
#if __OBJC__
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#include "../quartz/xpr/x-list.h"
|
#include "xpr/x-list.h"
|
||||||
|
|
||||||
@interface X11Controller : NSObject
|
@interface X11Controller : NSObject
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
#define DEFAULT_PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11/bin"
|
#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 "X11Controller.h"
|
||||||
#import "X11Application.h"
|
#import "X11Application.h"
|
||||||
|
@ -39,10 +39,10 @@
|
||||||
#define BOOL X_BOOL
|
#define BOOL X_BOOL
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
# include "darwin.h"
|
# include "darwin.h"
|
||||||
# include "../quartz/quartz.h"
|
# include "quartz.h"
|
||||||
# define _APPLEWM_SERVER_
|
# define _APPLEWM_SERVER_
|
||||||
# include "X11/extensions/applewm.h"
|
# include "X11/extensions/applewm.h"
|
||||||
# include "../quartz/applewmExt.h"
|
# include "applewmExt.h"
|
||||||
#undef BOOL
|
#undef BOOL
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -51,8 +51,6 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
|
||||||
#define TRACE() fprintf (stderr, "%s\n", __FUNCTION__)
|
|
||||||
|
|
||||||
@implementation X11Controller
|
@implementation X11Controller
|
||||||
|
|
||||||
- (void) awakeFromNib
|
- (void) awakeFromNib
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Internal definitions of the Cocoa rootless implementation
|
* Internal definitions of the Cocoa rootless implementation
|
||||||
*/
|
*
|
||||||
/*
|
|
||||||
* Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
|
* Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
*
|
*
|
||||||
* Support for using the Quartz Window Manager cursor
|
* Support for using the Quartz Window Manager cursor
|
||||||
*
|
*
|
||||||
**************************************************************/
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker.
|
* Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker.
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
|
|
|
@ -504,18 +504,6 @@ void DarwinModeProcessEvent(
|
||||||
RootlessOrderAllWindows();
|
RootlessOrderAllWindows();
|
||||||
break;
|
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:
|
default:
|
||||||
ErrorF("Unknown application defined event type %d.\n", xe->u.u.type);
|
ErrorF("Unknown application defined event type %d.\n", xe->u.u.type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
*
|
*
|
||||||
* Support for using the Quartz Window Manager cursor
|
* Support for using the Quartz Window Manager cursor
|
||||||
*
|
*
|
||||||
**************************************************************/
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker.
|
* Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker.
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
|
@ -92,9 +90,7 @@ static pthread_cond_t cursorCondition;
|
||||||
/* Acquire lock and tell the main thread to change cursor */ \
|
/* Acquire lock and tell the main thread to change cursor */ \
|
||||||
pthread_mutex_lock(&cursorMutex); \
|
pthread_mutex_lock(&cursorMutex); \
|
||||||
currentCursor = (CCrsrHandle) (cursorH); \
|
currentCursor = (CCrsrHandle) (cursorH); \
|
||||||
#ifndef INXQUARTZ
|
|
||||||
QuartzMessageMainThread(kQuartzCursorUpdate, NULL, 0); \
|
QuartzMessageMainThread(kQuartzCursorUpdate, NULL, 0); \
|
||||||
#endif
|
|
||||||
\
|
\
|
||||||
/* Wait for the main thread to change the cursor */ \
|
/* Wait for the main thread to change the cursor */ \
|
||||||
pthread_cond_wait(&cursorCondition, &cursorMutex); \
|
pthread_cond_wait(&cursorCondition, &cursorMutex); \
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
Code to build a keymap using the Carbon Keyboard Layout API.
|
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
|
Permission is hereby granted, free of charge, to any person
|
||||||
obtaining a copy of this software and associated documentation files
|
obtaining a copy of this software and associated documentation files
|
||||||
|
@ -34,6 +34,7 @@
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "quartzCommon.h"
|
#include "quartzCommon.h"
|
||||||
|
|
||||||
#include <CoreServices/CoreServices.h>
|
#include <CoreServices/CoreServices.h>
|
||||||
#include <Carbon/Carbon.h>
|
#include <Carbon/Carbon.h>
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "quartzPasteboard.h"
|
#include "quartzPasteboard.h"
|
||||||
|
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "propertyst.h"
|
#include "propertyst.h"
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
*
|
*
|
||||||
* Startup code for the Quartz Darwin X Server
|
* Startup code for the Quartz Darwin X Server
|
||||||
*
|
*
|
||||||
**************************************************************/
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved.
|
* Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
|
|
@ -36,8 +36,13 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
|
#ifdef XFree86LOADER
|
||||||
|
#include "xf86.h"
|
||||||
|
#include "xf86_ansic.h"
|
||||||
|
#else
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NEED_REPLIES
|
#define NEED_REPLIES
|
||||||
#define NEED_EVENTS
|
#define NEED_EVENTS
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Xplugin rootless implementation
|
* Xplugin rootless implementation
|
||||||
*/
|
*
|
||||||
/*
|
|
||||||
* Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
|
* Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Xplugin rootless implementation functions for AppleWM extension
|
* Xplugin rootless implementation functions for AppleWM extension
|
||||||
*/
|
*
|
||||||
/*
|
|
||||||
* Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
|
* Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
|
||||||
* Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
|
* Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
|
||||||
*
|
*
|
||||||
|
|
|
@ -117,7 +117,7 @@ eventHandler(unsigned int type, const void *arg,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* displayScreenBounds
|
* displayAtIndex
|
||||||
* Return the display ID for a particular display index.
|
* Return the display ID for a particular display index.
|
||||||
*/
|
*/
|
||||||
static CGDirectDisplayID
|
static CGDirectDisplayID
|
||||||
|
@ -233,7 +233,6 @@ xprDisplayInit(void)
|
||||||
darwinScreensFound = 1;
|
darwinScreensFound = 1;
|
||||||
|
|
||||||
if (xp_init(XP_BACKGROUND_EVENTS | XP_NO_DEFERRED_UPDATES) != Success)
|
if (xp_init(XP_BACKGROUND_EVENTS | XP_NO_DEFERRED_UPDATES) != Success)
|
||||||
{
|
|
||||||
FatalError("Could not initialize the Xplugin library.");
|
FatalError("Could not initialize the Xplugin library.");
|
||||||
|
|
||||||
xp_select_events(XP_EVENT_DISPLAY_CHANGED
|
xp_select_events(XP_EVENT_DISPLAY_CHANGED
|
||||||
|
@ -324,6 +323,9 @@ static Bool
|
||||||
xprSetupScreen(int index, ScreenPtr pScreen)
|
xprSetupScreen(int index, ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
// Add alpha protecting replacements for fb screen functions
|
// Add alpha protecting replacements for fb screen functions
|
||||||
|
pScreen->PaintWindowBackground = SafeAlphaPaintWindow;
|
||||||
|
pScreen->PaintWindowBorder = SafeAlphaPaintWindow;
|
||||||
|
|
||||||
#ifdef RENDER
|
#ifdef RENDER
|
||||||
{
|
{
|
||||||
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
||||||
|
|
|
@ -105,7 +105,3 @@ The implementation of dumpkeymap is based upon information gathered on
|
||||||
September 3, 1997 by Eric Sunshine <sunshine@sunshineco.com> and Paul S.
|
September 3, 1997 by Eric Sunshine <sunshine@sunshineco.com> and Paul S.
|
||||||
McCarthy <zarnuk@zarnuk.com> during an effort to reverse engineer the format
|
McCarthy <zarnuk@zarnuk.com> during an effort to reverse engineer the format
|
||||||
of the NeXT .keymapping file.
|
of the NeXT .keymapping file.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$XFree86: xc/programs/Xserver/hw/darwin/utils/README.txt,v 1.1 2000/12/01 19:47:39 dawes Exp $
|
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
//
|
//
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
//
|
//
|
||||||
// $XFree86$
|
|
||||||
//
|
|
||||||
..
|
..
|
||||||
.ig
|
.ig
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue