Index: src/video/cocoa/event.mm =================================================================== --- src/video/cocoa/event.mm (revision 22894) +++ src/video/cocoa/event.mm (working copy) @@ -35,6 +35,9 @@ #include "../../network/network.h" #include "../../core/random_func.hpp" #include "../../texteff.hpp" +#include "../../window_func.h" +#include "../../viewport_type.h" +#include "../../viewport_func.h" #import /* gettimeofday */ @@ -58,6 +61,9 @@ static unsigned int _current_mods; static bool _tab_is_down; static bool _emulating_right_button; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +static float _current_magnification; +#endif #ifdef _DEBUG static uint32 _tEvent; #endif @@ -486,6 +492,28 @@ QZ_MouseButtonEvent([ event buttonNumber ], NO); break; #endif + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + case NSEventTypeMagnify: { + Window *w = FindWindowById(WC_MAIN_WINDOW, 0); + CGFloat mag = [event magnification] * 5.f; + _current_magnification += mag; + + while(_current_magnification > 1.f) { + _current_magnification -= 1.f; + DoZoomInOutWindow(ZOOM_IN, w); + } + + while(_current_magnification < -1.f) { + _current_magnification += 1.f; + DoZoomInOutWindow(ZOOM_OUT, w); + } + } + break; + case NSEventTypeEndGesture: + _current_magnification = 0; + break; +#endif case NSKeyDown: /* Quit, hide and minimize */