ui/cocoa: Correct typos in comments and variable names

Fix various non-user-visible typos in comments and variable names.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Message-id: 1386543546-31919-3-git-send-email-peter.maydell@linaro.org
This commit is contained in:
Peter Maydell 2013-12-08 22:59:03 +00:00
parent 8895919a04
commit 49b9bd4dcc

View File

@ -52,7 +52,7 @@
#define COCOA_MOUSE_EVENT \ #define COCOA_MOUSE_EVENT \
if (isTabletEnabled) { \ if (isTabletEnabled) { \
kbd_mouse_event((int)(p.x * 0x7FFF / (screen.width - 1)), (int)((screen.height - p.y) * 0x7FFF / (screen.height - 1)), 0, buttons); \ kbd_mouse_event((int)(p.x * 0x7FFF / (screen.width - 1)), (int)((screen.height - p.y) * 0x7FFF / (screen.height - 1)), 0, buttons); \
} else if (isMouseGrabed) { \ } else if (isMouseGrabbed) { \
kbd_mouse_event((int)[event deltaX], (int)[event deltaY], 0, buttons); \ kbd_mouse_event((int)[event deltaX], (int)[event deltaY], 0, buttons); \
} else { \ } else { \
[NSApp sendEvent:event]; \ [NSApp sendEvent:event]; \
@ -204,7 +204,7 @@ int keymap[] =
200,// 126 0x7E 0xc8 E0,48 U ARROW QZ_UP 200,// 126 0x7E 0xc8 E0,48 U ARROW QZ_UP
/* completed according to http://www.libsdl.org/cgi/cvsweb.cgi/SDL12/src/video/quartz/SDL_QuartzKeys.h?rev=1.6&content-type=text/x-cvsweb-markup */ /* completed according to http://www.libsdl.org/cgi/cvsweb.cgi/SDL12/src/video/quartz/SDL_QuartzKeys.h?rev=1.6&content-type=text/x-cvsweb-markup */
/* Aditional 104 Key XP-Keyboard Scancodes from http://www.computer-engineering.org/ps2keyboard/scancodes1.html */ /* Additional 104 Key XP-Keyboard Scancodes from http://www.computer-engineering.org/ps2keyboard/scancodes1.html */
/* /*
221 // 0xdd e0,5d APPS 221 // 0xdd e0,5d APPS
// E0,2A,E0,37 PRNT SCRN // E0,2A,E0,37 PRNT SCRN
@ -259,7 +259,7 @@ static int cocoa_keycode_to_qemu(int keycode)
float cx,cy,cw,ch,cdx,cdy; float cx,cy,cw,ch,cdx,cdy;
CGDataProviderRef dataProviderRef; CGDataProviderRef dataProviderRef;
int modifiers_state[256]; int modifiers_state[256];
BOOL isMouseGrabed; BOOL isMouseGrabbed;
BOOL isFullscreen; BOOL isFullscreen;
BOOL isAbsoluteEnabled; BOOL isAbsoluteEnabled;
BOOL isTabletEnabled; BOOL isTabletEnabled;
@ -270,7 +270,7 @@ static int cocoa_keycode_to_qemu(int keycode)
- (void) toggleFullScreen:(id)sender; - (void) toggleFullScreen:(id)sender;
- (void) handleEvent:(NSEvent *)event; - (void) handleEvent:(NSEvent *)event;
- (void) setAbsoluteEnabled:(BOOL)tIsAbsoluteEnabled; - (void) setAbsoluteEnabled:(BOOL)tIsAbsoluteEnabled;
- (BOOL) isMouseGrabed; - (BOOL) isMouseGrabbed;
- (BOOL) isAbsoluteEnabled; - (BOOL) isAbsoluteEnabled;
- (float) cdx; - (float) cdx;
- (float) cdy; - (float) cdy;
@ -492,7 +492,7 @@ QemuCocoaView *cocoaView;
case NSFlagsChanged: case NSFlagsChanged:
keycode = cocoa_keycode_to_qemu([event keyCode]); keycode = cocoa_keycode_to_qemu([event keyCode]);
if ((keycode == 219 || keycode == 220) && !isMouseGrabed) { if ((keycode == 219 || keycode == 220) && !isMouseGrabbed) {
/* Don't pass command key changes to guest unless mouse is grabbed */ /* Don't pass command key changes to guest unless mouse is grabbed */
keycode = 0; keycode = 0;
} }
@ -523,7 +523,7 @@ QemuCocoaView *cocoaView;
keycode = cocoa_keycode_to_qemu([event keyCode]); keycode = cocoa_keycode_to_qemu([event keyCode]);
// forward command key combos to the host UI unless the mouse is grabbed // forward command key combos to the host UI unless the mouse is grabbed
if (!isMouseGrabed && ([event modifierFlags] & NSCommandKeyMask)) { if (!isMouseGrabbed && ([event modifierFlags] & NSCommandKeyMask)) {
[NSApp sendEvent:event]; [NSApp sendEvent:event];
return; return;
} }
@ -587,7 +587,7 @@ QemuCocoaView *cocoaView;
// don't pass the guest a spurious key-up if we treated this // don't pass the guest a spurious key-up if we treated this
// command-key combo as a host UI action // command-key combo as a host UI action
if (!isMouseGrabed && ([event modifierFlags] & NSCommandKeyMask)) { if (!isMouseGrabbed && ([event modifierFlags] & NSCommandKeyMask)) {
return; return;
} }
@ -648,7 +648,7 @@ QemuCocoaView *cocoaView;
case NSLeftMouseUp: case NSLeftMouseUp:
if (isTabletEnabled) { if (isTabletEnabled) {
COCOA_MOUSE_EVENT COCOA_MOUSE_EVENT
} else if (!isMouseGrabed) { } else if (!isMouseGrabbed) {
if (p.x > -1 && p.x < screen.width && p.y > -1 && p.y < screen.height) { if (p.x > -1 && p.x < screen.width && p.y > -1 && p.y < screen.height) {
[self grabMouse]; [self grabMouse];
} else { } else {
@ -665,7 +665,7 @@ QemuCocoaView *cocoaView;
COCOA_MOUSE_EVENT COCOA_MOUSE_EVENT
break; break;
case NSScrollWheel: case NSScrollWheel:
if (isTabletEnabled || isMouseGrabed) { if (isTabletEnabled || isMouseGrabbed) {
kbd_mouse_event(0, 0, -[event deltaY], 0); kbd_mouse_event(0, 0, -[event deltaY], 0);
} else { } else {
[NSApp sendEvent:event]; [NSApp sendEvent:event];
@ -688,7 +688,7 @@ QemuCocoaView *cocoaView;
} }
[NSCursor hide]; [NSCursor hide];
CGAssociateMouseAndMouseCursorPosition(FALSE); CGAssociateMouseAndMouseCursorPosition(FALSE);
isMouseGrabed = TRUE; // while isMouseGrabed = TRUE, QemuCocoaApp sends all events to [cocoaView handleEvent:] isMouseGrabbed = TRUE; // while isMouseGrabbed = TRUE, QemuCocoaApp sends all events to [cocoaView handleEvent:]
} }
- (void) ungrabMouse - (void) ungrabMouse
@ -703,11 +703,11 @@ QemuCocoaView *cocoaView;
} }
[NSCursor unhide]; [NSCursor unhide];
CGAssociateMouseAndMouseCursorPosition(TRUE); CGAssociateMouseAndMouseCursorPosition(TRUE);
isMouseGrabed = FALSE; isMouseGrabbed = FALSE;
} }
- (void) setAbsoluteEnabled:(BOOL)tIsAbsoluteEnabled {isAbsoluteEnabled = tIsAbsoluteEnabled;} - (void) setAbsoluteEnabled:(BOOL)tIsAbsoluteEnabled {isAbsoluteEnabled = tIsAbsoluteEnabled;}
- (BOOL) isMouseGrabed {return isMouseGrabed;} - (BOOL) isMouseGrabbed {return isMouseGrabbed;}
- (BOOL) isAbsoluteEnabled {return isAbsoluteEnabled;} - (BOOL) isAbsoluteEnabled {return isAbsoluteEnabled;}
- (float) cdx {return cdx;} - (float) cdx {return cdx;}
- (float) cdy {return cdy;} - (float) cdy {return cdy;}
@ -778,7 +778,7 @@ QemuCocoaView *cocoaView;
{ {
COCOA_DEBUG("QemuCocoaAppController: applicationDidFinishLaunching\n"); COCOA_DEBUG("QemuCocoaAppController: applicationDidFinishLaunching\n");
// Display an open dialog box if no argument were passed or // Display an open dialog box if no arguments were passed or
// if qemu was launched from the finder ( the Finder passes "-psn" ) // if qemu was launched from the finder ( the Finder passes "-psn" )
if( gArgc <= 1 || strncmp ((char *)gArgv[1], "-psn", 4) == 0) { if( gArgc <= 1 || strncmp ((char *)gArgv[1], "-psn", 4) == 0) {
NSOpenPanel *op = [[NSOpenPanel alloc] init]; NSOpenPanel *op = [[NSOpenPanel alloc] init];
@ -1010,7 +1010,7 @@ static void cocoa_refresh(DisplayChangeListener *dcl)
if (kbd_mouse_is_absolute()) { if (kbd_mouse_is_absolute()) {
if (![cocoaView isAbsoluteEnabled]) { if (![cocoaView isAbsoluteEnabled]) {
if ([cocoaView isMouseGrabed]) { if ([cocoaView isMouseGrabbed]) {
[cocoaView ungrabMouse]; [cocoaView ungrabMouse];
} }
} }