kicad/patches/wxwidgets-3.0.2_macosx_magn...

122 lines
4.7 KiB
Diff

diff -rupN include/wx/event.h include/wx/event.h
--- include/wx/event.h 2015-05-21 23:18:15.126136156 +0200
+++ include/wx/event.h 2015-05-21 23:20:35.112797127 +0200
@@ -11,6 +11,8 @@
#ifndef _WX_EVENT_H_
#define _WX_EVENT_H_
+#define USE_OSX_MAGNIFY_EVENT
+
#include "wx/defs.h"
#include "wx/cpp.h"
#include "wx/object.h"
@@ -716,6 +718,7 @@ wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_COR
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX2_DOWN, wxMouseEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX2_UP, wxMouseEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX2_DCLICK, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MAGNIFY, wxMouseEvent);
// Character input event type
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CHAR, wxKeyEvent);
@@ -1751,6 +1754,8 @@ public:
bool Aux1DClick() const { return (m_eventType == wxEVT_AUX1_DCLICK); }
bool Aux2DClick() const { return (m_eventType == wxEVT_AUX2_DCLICK); }
+ bool Magnify() const { return (m_eventType == wxEVT_MAGNIFY); }
+
// True if a button is down and the mouse is moving
bool Dragging() const
{
@@ -1805,6 +1810,8 @@ public:
// Is the system set to do page scrolling?
bool IsPageScroll() const { return ((unsigned int)m_linesPerAction == UINT_MAX); }
+ float GetMagnification() const { return m_magnification; }
+
virtual wxEvent *Clone() const { return new wxMouseEvent(*this); }
virtual wxEventCategory GetEventCategory() const { return wxEVT_CATEGORY_USER_INPUT; }
@@ -1824,6 +1831,8 @@ public:
int m_linesPerAction;
int m_columnsPerAction;
+ float m_magnification;
+
protected:
void Assign(const wxMouseEvent& evt);
@@ -4218,6 +4227,7 @@ typedef void (wxEvtHandler::*wxClipboard
#define EVT_MOUSE_AUX2_DOWN(func) wx__DECLARE_EVT0(wxEVT_AUX2_DOWN, wxMouseEventHandler(func))
#define EVT_MOUSE_AUX2_UP(func) wx__DECLARE_EVT0(wxEVT_AUX2_UP, wxMouseEventHandler(func))
#define EVT_MOUSE_AUX2_DCLICK(func) wx__DECLARE_EVT0(wxEVT_AUX2_DCLICK, wxMouseEventHandler(func))
+#define EVT_MAGNIFY(func) wx__DECLARE_EVT0(wxEVT_MAGNIFY, wxMouseEventHandler(func))
// All mouse events
#define EVT_MOUSE_EVENTS(func) \
@@ -4239,7 +4249,8 @@ typedef void (wxEvtHandler::*wxClipboard
EVT_MOTION(func) \
EVT_LEAVE_WINDOW(func) \
EVT_ENTER_WINDOW(func) \
- EVT_MOUSEWHEEL(func)
+ EVT_MOUSEWHEEL(func) \
+ EVT_MAGNIFY(func)
// Scrolling from wxWindow (sent to wxScrolledWindow)
#define EVT_SCROLLWIN_TOP(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_TOP, wxScrollWinEventHandler(func))
diff -rupN src/common/event.cpp src/common/event.cpp
--- src/common/event.cpp 2015-05-21 23:18:15.049469492 +0200
+++ src/common/event.cpp 2015-05-21 23:18:23.566135812 +0200
@@ -208,6 +208,7 @@ wxDEFINE_EVENT( wxEVT_AUX1_DCLICK, wxMou
wxDEFINE_EVENT( wxEVT_AUX2_DOWN, wxMouseEvent );
wxDEFINE_EVENT( wxEVT_AUX2_UP, wxMouseEvent );
wxDEFINE_EVENT( wxEVT_AUX2_DCLICK, wxMouseEvent );
+wxDEFINE_EVENT( wxEVT_MAGNIFY, wxMouseEvent );
// Character input event type
wxDEFINE_EVENT( wxEVT_CHAR, wxKeyEvent );
@@ -576,6 +577,8 @@ wxMouseEvent::wxMouseEvent(wxEventType c
m_wheelDelta = 0;
m_linesPerAction = 0;
m_columnsPerAction = 0;
+
+ m_magnification = 0.0f;
}
void wxMouseEvent::Assign(const wxMouseEvent& event)
@@ -600,6 +603,8 @@ void wxMouseEvent::Assign(const wxMouseE
m_linesPerAction = event.m_linesPerAction;
m_columnsPerAction = event.m_columnsPerAction;
m_wheelAxis = event.m_wheelAxis;
+
+ m_magnification = event.m_magnification;
}
// return true if was a button dclick event
diff -rupN src/osx/cocoa/window.mm src/osx/cocoa/window.mm
--- src/osx/cocoa/window.mm 2015-05-21 23:18:15.032802826 +0200
+++ src/osx/cocoa/window.mm 2015-05-21 23:18:23.566135812 +0200
@@ -741,6 +741,12 @@ void wxWidgetCocoaImpl::SetupMouseEvent(
case NSMouseMoved :
wxevent.SetEventType( wxEVT_MOTION ) ;
break;
+
+ case NSEventTypeMagnify:
+ wxevent.SetEventType( wxEVT_MAGNIFY );
+ wxevent.m_magnification = [nsEvent magnification];
+ break;
+
default :
break ;
}
@@ -1773,6 +1779,10 @@ void wxOSXCocoaClassAddWXMethods(Class c
wxOSX_CLASS_ADD_METHOD(c, @selector(mouseEntered:), (IMP) wxOSX_mouseEvent, "v@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(mouseExited:), (IMP) wxOSX_mouseEvent, "v@:@" )
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+ wxOSX_CLASS_ADD_METHOD(c, @selector(magnifyWithEvent:), (IMP)wxOSX_mouseEvent, "v@:@")
+#endif
+
wxOSX_CLASS_ADD_METHOD(c, @selector(cursorUpdate:), (IMP) wxOSX_cursorUpdate, "v@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(keyDown:), (IMP) wxOSX_keyEvent, "v@:@" )