[Bf-blender-cvs] [2ebb367] master: cleanup: spacing & alignment

Mike Erwin noreply at git.blender.org
Tue Sep 27 14:57:15 CEST 2016


Commit: 2ebb367b0f3428b79c7517f22db9d03ac791501b
Author: Mike Erwin
Date:   Tue Sep 27 14:56:58 2016 +0200
Branches: master
https://developer.blender.org/rB2ebb367b0f3428b79c7517f22db9d03ac791501b

cleanup: spacing & alignment

===================================================================

M	intern/ghost/intern/GHOST_SystemCocoa.mm

===================================================================

diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index f31cba4..880cb07 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -90,8 +90,7 @@ static GHOST_TButtonMask convertButton(int button)
  * \return Ghost key code
  */
 static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction) 
-{	
-	
+{
 	//printf("\nrecvchar %c 0x%x",recvChar,recvChar);
 	switch (rawCode) {
 		/*Physical keycodes not used due to map changes in int'l keyboards
@@ -121,7 +120,7 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction)
 		case kVK_ANSI_X:	return GHOST_kKeyX;
 		case kVK_ANSI_Y:	return GHOST_kKeyY;
 		case kVK_ANSI_Z:	return GHOST_kKeyZ;*/
-		
+
 		/* Numbers keys mapped to handle some int'l keyboard (e.g. French)*/
 		case kVK_ISO_Section: return	GHOST_kKeyUnknown;
 		case kVK_ANSI_1:	return GHOST_kKey1;
@@ -134,7 +133,7 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction)
 		case kVK_ANSI_8:	return GHOST_kKey8;
 		case kVK_ANSI_9:	return GHOST_kKey9;
 		case kVK_ANSI_0:	return GHOST_kKey0;
-	
+
 		case kVK_ANSI_Keypad0:			return GHOST_kKeyNumpad0;
 		case kVK_ANSI_Keypad1:			return GHOST_kKeyNumpad1;
 		case kVK_ANSI_Keypad2:			return GHOST_kKeyNumpad2;
@@ -173,24 +172,24 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction)
 		case kVK_F18:				return GHOST_kKeyF18;
 		case kVK_F19:				return GHOST_kKeyF19;
 		case kVK_F20:				return GHOST_kKeyF20;
-			
+
 		case kVK_UpArrow:			return GHOST_kKeyUpArrow;
 		case kVK_DownArrow:			return GHOST_kKeyDownArrow;
 		case kVK_LeftArrow:			return GHOST_kKeyLeftArrow;
 		case kVK_RightArrow:		return GHOST_kKeyRightArrow;
-			
+
 		case kVK_Return:			return GHOST_kKeyEnter;
 		case kVK_Delete:			return GHOST_kKeyBackSpace;
 		case kVK_ForwardDelete:		return GHOST_kKeyDelete;
 		case kVK_Escape:			return GHOST_kKeyEsc;
 		case kVK_Tab:				return GHOST_kKeyTab;
 		case kVK_Space:				return GHOST_kKeySpace;
-			
+
 		case kVK_Home:				return GHOST_kKeyHome;
 		case kVK_End:				return GHOST_kKeyEnd;
 		case kVK_PageUp:			return GHOST_kKeyUpPage;
 		case kVK_PageDown:			return GHOST_kKeyDownPage;
-			
+
 		/*case kVK_ANSI_Minus:		return GHOST_kKeyMinus;
 		case kVK_ANSI_Equal:		return GHOST_kKeyEqual;
 		case kVK_ANSI_Comma:		return GHOST_kKeyComma;
@@ -202,12 +201,12 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction)
 		case kVK_ANSI_LeftBracket: 	return GHOST_kKeyLeftBracket;
 		case kVK_ANSI_RightBracket:	return GHOST_kKeyRightBracket;
 		case kVK_ANSI_Grave:		return GHOST_kKeyAccentGrave;*/
-			
+
 		case kVK_VolumeUp:
 		case kVK_VolumeDown:
 		case kVK_Mute:
 			return GHOST_kKeyUnknown;
-			
+
 		default:
 		{
 			/* alphanumerical or punctuation key that is remappable in int'l keyboards */
@@ -221,11 +220,11 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction)
 				/* Leopard and Snow Leopard 64bit compatible API*/
 				CFDataRef uchrHandle; /*the keyboard layout*/
 				TISInputSourceRef kbdTISHandle;
-				
+
 				kbdTISHandle = TISCopyCurrentKeyboardLayoutInputSource();
 				uchrHandle = (CFDataRef)TISGetInputSourceProperty(kbdTISHandle,kTISPropertyUnicodeKeyLayoutData);
 				CFRelease(kbdTISHandle);
-				
+
 				/*get actual character value of the "remappable" keys in int'l keyboards,
 				if keyboard layout is not correctly reported (e.g. some non Apple keyboards in Tiger),
 				then fallback on using the received charactersIgnoringModifiers */
@@ -235,7 +234,6 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction)
 					
 					UCKeyTranslate((UCKeyboardLayout*)CFDataGetBytePtr(uchrHandle), rawCode, keyAction, 0,
 					               LMGetKbdType(), kUCKeyTranslateNoDeadKeysBit, &deadKeyState, 1, &actualStrLength, &recvChar);
-					
 				}
 
 				switch (recvChar) {
@@ -321,7 +319,7 @@ extern "C" int GHOST_HACK_getFirstFile(char buf[FIRSTFILEBUFLG])
 {
 	//TODO: implement graceful termination through Cocoa mechanism to avoid session log off to be canceled
 	//Note that Cmd+Q is already handled by keyhandler
-    if (systemCocoa->handleQuitRequest() == GHOST_kExitNow)
+	if (systemCocoa->handleQuitRequest() == GHOST_kExitNow)
 		return NSTerminateCancel;//NSTerminateNow;
 	else
 		return NSTerminateCancel;
@@ -356,7 +354,7 @@ GHOST_SystemCocoa::GHOST_SystemCocoa()
 	struct timeval boottime;
 	size_t len;
 	char *rstring = NULL;
-	
+
 	m_modifierMask =0;
 	m_cursorDelta_x=0;
 	m_cursorDelta_y=0;
@@ -370,20 +368,20 @@ GHOST_SystemCocoa::GHOST_SystemCocoa()
 	mib[0] = CTL_KERN;
 	mib[1] = KERN_BOOTTIME;
 	len = sizeof(struct timeval);
-	
+
 	sysctl(mib, 2, &boottime, &len, NULL, 0);
 	m_start_time = ((boottime.tv_sec*1000)+(boottime.tv_usec/1000));
-	
+
 	//Detect multitouch trackpad
 	mib[0] = CTL_HW;
 	mib[1] = HW_MODEL;
 	sysctl( mib, 2, NULL, &len, NULL, 0 );
 	rstring = (char*)malloc( len );
 	sysctl( mib, 2, rstring, &len, NULL, 0 );
-	
+
 	free( rstring );
 	rstring = NULL;
-	
+
 	m_ignoreWindowSizedMessages = false;
 	m_ignoreMomentumScroll = false;
 	m_multiTouchScroll = false;
@@ -404,67 +402,67 @@ GHOST_TSuccess GHOST_SystemCocoa::init()
 #endif
 
 		//ProcessSerialNumber psn;
-		
+
 		//Carbon stuff to move window & menu to foreground
 		/*if (!GetCurrentProcess(&psn)) {
 			TransformProcessType(&psn, kProcessTransformToForegroundApplication);
 			SetFrontProcess(&psn);
 		}*/
-		
+
 		NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 		[NSApplication sharedApplication]; // initializes	NSApp
-		
+
 		if ([NSApp mainMenu] == nil) {
 			NSMenu *mainMenubar = [[NSMenu alloc] init];
 			NSMenuItem *menuItem;
 			NSMenu *windowMenu;
 			NSMenu *appMenu;
-			
+
 			//Create the application menu
 			appMenu = [[NSMenu alloc] initWithTitle:@"Blender"];
-			
+
 			[appMenu addItemWithTitle:@"About Blender" action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
 			[appMenu addItem:[NSMenuItem separatorItem]];
-			
+
 			menuItem = [appMenu addItemWithTitle:@"Hide Blender" action:@selector(hide:) keyEquivalent:@"h"];
 			[menuItem setKeyEquivalentModifierMask:NSCommandKeyMask];
-			 
+
 			menuItem = [appMenu addItemWithTitle:@"Hide others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
 			[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask | NSCommandKeyMask)];
-			
+
 			[appMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
-			
+
 			menuItem = [appMenu addItemWithTitle:@"Quit Blender" action:@selector(terminate:) keyEquivalent:@"q"];
 			[menuItem setKeyEquivalentModifierMask:NSCommandKeyMask];
-			
+
 			menuItem = [[NSMenuItem alloc] init];
 			[menuItem setSubmenu:appMenu];
-			
+
 			[mainMenubar addItem:menuItem];
 			[menuItem release];
 			[NSApp performSelector:@selector(setAppleMenu:) withObject:appMenu]; //Needed for 10.5
 			[appMenu release];
-			
+
 			//Create the window menu
 			windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
-			
+
 			menuItem = [windowMenu addItemWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
 			[menuItem setKeyEquivalentModifierMask:NSCommandKeyMask];
-			
+
 			[windowMenu addItemWithTitle:@"Zoom" action:@selector(performZoom:) keyEquivalent:@""];
-			
+
 			menuItem = [windowMenu addItemWithTitle:@"Enter Full Screen" action:@selector(toggleFullScreen:) keyEquivalent:@"f" ];
 			[menuItem setKeyEquivalentModifierMask:NSControlKeyMask | NSCommandKeyMask];
 
 			menuItem = [windowMenu addItemWithTitle:@"Close" action:@selector(performClose:) keyEquivalent:@"w"];
 			[menuItem setKeyEquivalentModifierMask:NSCommandKeyMask];
-			
+
 			menuItem = [[NSMenuItem	alloc] init];
 			[menuItem setSubmenu:windowMenu];
-			
+
 			[mainMenubar addItem:menuItem];
 			[menuItem release];
-			
+
 			[NSApp setMainMenu:mainMenubar];
 			[NSApp setWindowsMenu:windowMenu];
 			[windowMenu release];
@@ -475,7 +473,7 @@ GHOST_TSuccess GHOST_SystemCocoa::init()
 			[appDelegate setSystemCocoa:this];
 			[NSApp setDelegate:appDelegate];
 		}
-		
+
 		[NSApp finishLaunching];
 		
 		[pool drain];
@@ -490,11 +488,11 @@ GHOST_TUns64 GHOST_SystemCocoa::getMilliSeconds() const
 {
 	//Cocoa equivalent exists in 10.6 ([[NSProcessInfo processInfo] systemUptime])
 	struct timeval currentTime;
-	
+
 	gettimeofday(&currentTime, NULL);
-	
+
 	//Return timestamp of system uptime
-	
+
 	return ((currentTime.tv_sec*1000)+(currentTime.tv_usec/1000)-m_start_time);
 }
 
@@ -517,11 +515,11 @@ void GHOST_SystemCocoa::getMainDisplayDimensions(GHOST_TUns32& width, GHOST_TUns
 	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 	//Get visible frame, that is frame excluding dock and top menu bar
 	NSRect frame = [[NSScreen mainScreen] visibleFrame];
-	
+
 	//Returns max window contents (excluding title bar...)
 	NSRect contentRect = [NSWindow contentRectForFrameRect:frame
 												 styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask)];
-	
+
 	width = contentRect.size.width;
 	height = contentRect.size.height;
 
@@ -549,12 +547,12 @@ GHOST_IWindow* GHOST_SystemCocoa::createWindow(
 {
 	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 	GHOST_IWindow* window = NULL;
-	
+
 	//Get the available rect for including window contents
 	NSRect frame = [[NSScreen mainScreen] visibleFrame];
 	NSRect contentRect = [NSWindow contentRectForFrameRect:frame
 												 styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask)];
-	
+
 	GHOST_TInt32 bottom = (contentRect.size.height - 1) - height - top;
 
 	//Ensures window top left is inside this available rect
@@ -578,7 +576,7 @@ GHOST_IWindow* GHOST_SystemCocoa::createWindow(
 		delete window;
 		window = NULL;
 	}
-	
+
 	[pool drain];
 	return window;
 }
@@ -589,7 +587,7 @@ GHOST_IWindow* GHOST_SystemCocoa::createWindow(
 GHOST_TSuccess GHOST_SystemCocoa::getCursorPosition(GHOST_TInt32& x, GHOST_TInt32& y) const
 {
 	NSPoint mouseLoc = [NSEvent mouseLocation];
-	
+
 	// Returns the mouse location in screen coordinates
 	x = (GHOST_TInt32)mouseLoc.x;
 	y = (GHOST_TInt32)mouseLoc.y;
@@ -609,11 +607,11 

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list