Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_SystemCocoa.mm
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| NSPoint delta = [[cocoawindow contentView] convertPointToBacking:NSMakePoint(dx, dy)]; | NSPoint delta = [[cocoawindow contentView] convertPointToBacking:NSMakePoint(dx, dy)]; | ||||
| pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, | pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, | ||||
| window, | window, | ||||
| GHOST_kTrackpadEventScroll, | GHOST_kTrackpadEventScroll, | ||||
| x, | x, | ||||
| y, | y, | ||||
| delta.x, | delta.x, | ||||
| delta.y, | delta.y, | ||||
| [event isDirectionInvertedFromDevice])); | [event isDirectionInvertedFromDevice], | ||||
| 0)); | |||||
| } | } | ||||
| } break; | } break; | ||||
| case NSEventTypeMagnify: { | case NSEventTypeMagnify: { | ||||
| NSPoint mousePos = [event locationInWindow]; | NSPoint mousePos = [event locationInWindow]; | ||||
| int32_t x, y; | int32_t x, y; | ||||
| window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); | window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); | ||||
| pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, | pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, | ||||
| window, | window, | ||||
| GHOST_kTrackpadEventMagnify, | GHOST_kTrackpadEventMagnify, | ||||
| x, | x, | ||||
| y, | y, | ||||
| [event magnification] * 125.0 + 0.1, | |||||
| 0, | 0, | ||||
| false)); | 0, | ||||
| false, | |||||
| [event magnification])); | |||||
| } break; | } break; | ||||
| case NSEventTypeSmartMagnify: { | case NSEventTypeSmartMagnify: { | ||||
| NSPoint mousePos = [event locationInWindow]; | NSPoint mousePos = [event locationInWindow]; | ||||
| int32_t x, y; | int32_t x, y; | ||||
| window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); | window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); | ||||
| pushEvent(new GHOST_EventTrackpad( | pushEvent(new GHOST_EventTrackpad( | ||||
| [event timestamp] * 1000, window, GHOST_kTrackpadEventSmartMagnify, x, y, 0, 0, false)); | [event timestamp] * 1000, window, GHOST_kTrackpadEventSmartMagnify, x, y, 0, 0, false, 0)); | ||||
| } break; | } break; | ||||
| case NSEventTypeRotate: { | case NSEventTypeRotate: { | ||||
| NSPoint mousePos = [event locationInWindow]; | NSPoint mousePos = [event locationInWindow]; | ||||
| int32_t x, y; | int32_t x, y; | ||||
| window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); | window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); | ||||
| pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, | pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, | ||||
| window, | window, | ||||
| GHOST_kTrackpadEventRotate, | GHOST_kTrackpadEventRotate, | ||||
| x, | x, | ||||
| y, | y, | ||||
| [event rotation] * -5.0, | |||||
| 0, | 0, | ||||
| false)); | 0, | ||||
| false, | |||||
| [event rotation])); | |||||
| } | } | ||||
| default: | default: | ||||
| return GHOST_kFailure; | return GHOST_kFailure; | ||||
| break; | break; | ||||
| } | } | ||||
| return GHOST_kSuccess; | return GHOST_kSuccess; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||