diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-18 11:41:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-18 11:42:59 +0300 |
commit | 086ae3ea0401e9d6c39c31abc4a3ab96c285f1b6 (patch) | |
tree | 8df32dce52d62ece781c138b6bec24b7cc95b009 /intern/ghost | |
parent | 752eb64d6025dac88a2cdd8fd423b70c97e3ab1d (diff) |
Cleanup: whitespace, wrong indent level
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 113 |
1 files changed, 56 insertions, 57 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index bdcaadba2f3..50d3cc25c09 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -796,58 +796,57 @@ GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType, if (!validWindow(window)) { return GHOST_kFailure; } - switch (eventType) { - case GHOST_kEventWindowClose: - // check for index of mainwindow as it would quit blender without dialog and discard - if ([windowsList count] > 1 && window->getCocoaWindow() != [windowsList objectAtIndex:[windowsList count] - 1]) { - pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowClose, window) ); - } - else { - handleQuitRequest(); // -> quit dialog - } - break; - case GHOST_kEventWindowActivate: - m_windowManager->setActiveWindow(window); - window->loadCursor(window->getCursorVisibility(), window->getCursorShape()); - pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowActivate, window) ); - break; - case GHOST_kEventWindowDeactivate: - m_windowManager->setWindowInactive(window); - pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowDeactivate, window) ); - break; - case GHOST_kEventWindowUpdate: - if (m_nativePixel) { - window->setNativePixelSize(); - pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventNativeResolutionChange, window) ); - } - pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowUpdate, window) ); - break; - case GHOST_kEventWindowMove: - pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowMove, window) ); - break; - case GHOST_kEventWindowSize: - if (!m_ignoreWindowSizedMessages) - { - //Enforce only one resize message per event loop (coalescing all the live resize messages) - window->updateDrawingContext(); - pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowSize, window) ); - //Mouse up event is trapped by the resizing event loop, so send it anyway to the window manager - pushEvent(new GHOST_EventButton(getMilliSeconds(), GHOST_kEventButtonUp, window, convertButton(0))); - //m_ignoreWindowSizedMessages = true; - } - break; - case GHOST_kEventNativeResolutionChange: - - if (m_nativePixel) { - window->setNativePixelSize(); - pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventNativeResolutionChange, window) ); - } + switch (eventType) { + case GHOST_kEventWindowClose: + // check for index of mainwindow as it would quit blender without dialog and discard + if ([windowsList count] > 1 && window->getCocoaWindow() != [windowsList objectAtIndex:[windowsList count] - 1]) { + pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowClose, window) ); + } + else { + handleQuitRequest(); // -> quit dialog + } + break; + case GHOST_kEventWindowActivate: + m_windowManager->setActiveWindow(window); + window->loadCursor(window->getCursorVisibility(), window->getCursorShape()); + pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowActivate, window) ); + break; + case GHOST_kEventWindowDeactivate: + m_windowManager->setWindowInactive(window); + pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowDeactivate, window) ); + break; + case GHOST_kEventWindowUpdate: + if (m_nativePixel) { + window->setNativePixelSize(); + pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventNativeResolutionChange, window) ); + } + pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowUpdate, window) ); + break; + case GHOST_kEventWindowMove: + pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowMove, window) ); + break; + case GHOST_kEventWindowSize: + if (!m_ignoreWindowSizedMessages) { + //Enforce only one resize message per event loop (coalescing all the live resize messages) + window->updateDrawingContext(); + pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowSize, window) ); + //Mouse up event is trapped by the resizing event loop, so send it anyway to the window manager + pushEvent(new GHOST_EventButton(getMilliSeconds(), GHOST_kEventButtonUp, window, convertButton(0))); + //m_ignoreWindowSizedMessages = true; + } + break; + case GHOST_kEventNativeResolutionChange: + + if (m_nativePixel) { + window->setNativePixelSize(); + pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventNativeResolutionChange, window) ); + } + + default: + return GHOST_kFailure; + break; + } - default: - return GHOST_kFailure; - break; - } - m_outsideLoopEventProcessed = true; return GHOST_kSuccess; } @@ -1238,12 +1237,12 @@ bool GHOST_SystemCocoa::handleTabletEvent(void *eventPtr) #if MAC_OS_X_VERSION_MAX_ALLOWED < 1070 enum { - NSEventPhaseNone = 0, - NSEventPhaseBegan = 0x1 << 0, - NSEventPhaseStationary = 0x1 << 1, - NSEventPhaseChanged = 0x1 << 2, - NSEventPhaseEnded = 0x1 << 3, - NSEventPhaseCancelled = 0x1 << 4, + NSEventPhaseNone = 0, + NSEventPhaseBegan = 0x1 << 0, + NSEventPhaseStationary = 0x1 << 1, + NSEventPhaseChanged = 0x1 << 2, + NSEventPhaseEnded = 0x1 << 3, + NSEventPhaseCancelled = 0x1 << 4, }; typedef NSUInteger NSEventPhase; |