Last active
September 15, 2016 10:51
-
-
Save metacollin/b6bbb5d54734bea3dcaca1ff22668016 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== modified file 'Makefile.in' | |
--- Makefile.in 2014-06-08 14:30:42 +0000 | |
+++ Makefile.in 2014-06-08 14:30:57 +0000 | |
@@ -14619,7 +14619,7 @@ | |
monodll_carbon_frame.o \ | |
monodll_carbon_mdi.o \ | |
monodll_carbon_metafile.o \ | |
- monodll_carbon_overlay.o \ | |
+ monodll_osx_cocoa_overlay.o \ | |
monodll_carbon_popupwin.o \ | |
monodll_carbon_renderer.o \ | |
monodll_carbon_settings.o \ | |
@@ -14766,7 +14766,7 @@ | |
monolib_carbon_frame.o \ | |
monolib_carbon_mdi.o \ | |
monolib_carbon_metafile.o \ | |
- monolib_carbon_overlay.o \ | |
+ monolib_osx_cocoa_overlay.o \ | |
monolib_carbon_popupwin.o \ | |
monolib_carbon_renderer.o \ | |
monolib_carbon_settings.o \ | |
@@ -14913,7 +14913,7 @@ | |
coredll_carbon_frame.o \ | |
coredll_carbon_mdi.o \ | |
coredll_carbon_metafile.o \ | |
- coredll_carbon_overlay.o \ | |
+ coredll_osx_cocoa_overlay.o \ | |
coredll_carbon_popupwin.o \ | |
coredll_carbon_renderer.o \ | |
coredll_carbon_settings.o \ | |
@@ -15045,7 +15045,7 @@ | |
corelib_carbon_frame.o \ | |
corelib_carbon_mdi.o \ | |
corelib_carbon_metafile.o \ | |
- corelib_carbon_overlay.o \ | |
+ corelib_osx_cocoa_overlay.o \ | |
corelib_carbon_popupwin.o \ | |
corelib_carbon_renderer.o \ | |
corelib_carbon_settings.o \ | |
@@ -17792,6 +17792,9 @@ | |
monodll_osx_cocoa_notebook.o: $(srcdir)/src/osx/cocoa/notebook.mm $(MONODLL_ODEP) | |
$(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/notebook.mm | |
+monodll_osx_cocoa_overlay.o: $(srcdir)/src/osx/cocoa/overlay.mm $(MONODLL_ODEP) | |
+ $(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/overlay.mm | |
+ | |
monodll_osx_cocoa_radiobut.o: $(srcdir)/src/osx/cocoa/radiobut.mm $(MONODLL_ODEP) | |
$(CXXC) -c -o $@ $(MONODLL_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/radiobut.mm | |
@@ -23666,6 +23669,9 @@ | |
monolib_osx_cocoa_notebook.o: $(srcdir)/src/osx/cocoa/notebook.mm $(MONOLIB_ODEP) | |
$(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/notebook.mm | |
+monolib_osx_cocoa_overlay.o: $(srcdir)/src/osx/cocoa/overlay.mm $(MONOLIB_ODEP) | |
+ $(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/overlay.mm | |
+ | |
monolib_osx_cocoa_radiobut.o: $(srcdir)/src/osx/cocoa/radiobut.mm $(MONOLIB_ODEP) | |
$(CXXC) -c -o $@ $(MONOLIB_OBJCXXFLAGS) $(srcdir)/src/osx/cocoa/radiobut.mm | |
@@ -33620,8 +33626,8 @@ | |
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@coredll_carbon_overlay.o: $(srcdir)/src/osx/carbon/overlay.cpp $(COREDLL_ODEP) | |
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/carbon/overlay.cpp | |
-@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@coredll_carbon_overlay.o: $(srcdir)/src/osx/carbon/overlay.cpp $(COREDLL_ODEP) | |
-@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/carbon/overlay.cpp | |
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@coredll_osx_cocoa_overlay.o: $(srcdir)/src/osx/cocoa/overlay.mm $(COREDLL_ODEP) | |
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/cocoa/overlay.mm | |
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@coredll_carbon_overlay.o: $(srcdir)/src/osx/carbon/overlay.cpp $(COREDLL_ODEP) | |
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/osx/carbon/overlay.cpp | |
@@ -38003,8 +38009,8 @@ | |
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@corelib_carbon_overlay.o: $(srcdir)/src/osx/carbon/overlay.cpp $(CORELIB_ODEP) | |
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_CARBON_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/carbon/overlay.cpp | |
-@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@corelib_carbon_overlay.o: $(srcdir)/src/osx/carbon/overlay.cpp $(CORELIB_ODEP) | |
-@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/carbon/overlay.cpp | |
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@corelib_osx_cocoa_overlay.o: $(srcdir)/src/osx/cocoa/overlay.mm $(CORELIB_ODEP) | |
+@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_COCOA_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/cocoa/overlay.mm | |
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@corelib_carbon_overlay.o: $(srcdir)/src/osx/carbon/overlay.cpp $(CORELIB_ODEP) | |
@COND_PLATFORM_MACOSX_1_TOOLKIT_OSX_IPHONE_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/osx/carbon/overlay.cpp | |
=== modified file 'include/wx/osx/cocoa/private/overlay.h' | |
--- include/wx/osx/cocoa/private/overlay.h 2014-06-08 14:30:42 +0000 | |
+++ include/wx/osx/cocoa/private/overlay.h 2014-06-11 12:07:05 +0000 | |
@@ -41,15 +41,8 @@ | |
void CreateOverlayWindow(); | |
WXWindow m_overlayWindow; | |
- WXWindow m_overlayParentWindow; | |
- CGContextRef m_overlayContext ; | |
// we store the window in case we would have to issue a Refresh() | |
wxWindow* m_window ; | |
- | |
- int m_x ; | |
- int m_y ; | |
- int m_width ; | |
- int m_height ; | |
} ; | |
#endif // _WX_MAC_CARBON_PRIVATE_OVERLAY_H_ | |
=== modified file 'include/wx/overlay.h' | |
--- include/wx/overlay.h 2014-06-08 14:30:42 +0000 | |
+++ include/wx/overlay.h 2014-06-08 14:30:57 +0000 | |
@@ -13,7 +13,7 @@ | |
#include "wx/defs.h" | |
-#if defined(__WXMAC__) && wxOSX_USE_CARBON | |
+#if defined(__WXMAC__) && wxOSX_USE_COCOA_OR_CARBON | |
#define wxHAS_NATIVE_OVERLAY 1 | |
#elif defined(__WXDFB__) | |
#define wxHAS_NATIVE_OVERLAY 1 | |
=== modified file 'include/wx/private/overlay.h' | |
--- include/wx/private/overlay.h 2014-06-08 14:30:42 +0000 | |
+++ include/wx/private/overlay.h 2014-06-08 14:30:57 +0000 | |
@@ -16,7 +16,11 @@ | |
#ifdef wxHAS_NATIVE_OVERLAY | |
#if defined(__WXMAC__) | |
+#if wxOSX_USE_CARBON | |
#include "wx/osx/carbon/private/overlay.h" | |
+#else | |
+ #include "wx/osx/cocoa/private/overlay.h" | |
+#endif | |
#elif defined(__WXDFB__) | |
#include "wx/dfb/private/overlay.h" | |
#else | |
=== modified file 'src/osx/cocoa/overlay.mm' | |
--- src/osx/cocoa/overlay.mm 2014-06-08 14:30:42 +0000 | |
+++ src/osx/cocoa/overlay.mm 2014-06-11 12:06:53 +0000 | |
@@ -34,6 +34,7 @@ | |
#include "wx/private/overlay.h" | |
#ifdef wxHAS_NATIVE_OVERLAY | |
+#import <Foundation/NSGeometry.h> | |
// ============================================================================ | |
// implementation | |
@@ -42,7 +43,6 @@ | |
wxOverlayImpl::wxOverlayImpl() | |
{ | |
m_window = NULL ; | |
- m_overlayContext = NULL ; | |
m_overlayWindow = NULL ; | |
} | |
@@ -58,48 +58,6 @@ | |
void wxOverlayImpl::CreateOverlayWindow() | |
{ | |
- if ( m_window ) | |
- { | |
- m_overlayParentWindow = m_window->MacGetTopLevelWindowRef(); | |
- [m_overlayParentWindow makeKeyAndOrderFront:nil]; | |
- | |
- NSView* view = m_window->GetHandle(); | |
- | |
- NSPoint viewOriginBase, viewOriginScreen; | |
- viewOriginBase = [view convertPoint:NSMakePoint(0, 0) toView:nil]; | |
- viewOriginScreen = [m_overlayParentWindow convertBaseToScreen:viewOriginBase]; | |
- | |
- NSSize viewSize = [view frame].size; | |
- if ( [view isFlipped] ) | |
- viewOriginScreen.y -= viewSize.height; | |
- | |
- m_overlayWindow=[[NSWindow alloc] initWithContentRect:NSMakeRect(viewOriginScreen.x,viewOriginScreen.y, | |
- viewSize.width, | |
- viewSize.height) | |
- styleMask:NSBorderlessWindowMask | |
- backing:NSBackingStoreBuffered | |
- defer:YES]; | |
- | |
- [m_overlayParentWindow addChildWindow:m_overlayWindow ordered:NSWindowAbove]; | |
- } | |
- else | |
- { | |
- m_overlayParentWindow = NULL ; | |
- CGRect cgbounds ; | |
- cgbounds = CGDisplayBounds(CGMainDisplayID()); | |
- | |
- m_overlayWindow=[[NSWindow alloc] initWithContentRect:NSMakeRect(cgbounds.origin.x,cgbounds.origin.y, | |
- cgbounds.size.width, | |
- cgbounds.size.height) | |
- styleMask:NSBorderlessWindowMask | |
- backing:NSBackingStoreBuffered | |
- defer:YES]; | |
- } | |
- [m_overlayWindow setOpaque:NO]; | |
- [m_overlayWindow setIgnoresMouseEvents:YES]; | |
- [m_overlayWindow setAlphaValue:1.0]; | |
- | |
- [m_overlayWindow orderFront:nil]; | |
} | |
void wxOverlayImpl::Init( wxDC* dc, int x , int y , int width , int height ) | |
@@ -107,84 +65,49 @@ | |
wxASSERT_MSG( !IsOk() , _("You cannot Init an overlay twice") ); | |
m_window = dc->GetWindow(); | |
- m_x = x ; | |
- m_y = y ; | |
- if ( dc->IsKindOf( CLASSINFO( wxClientDC ) )) | |
- { | |
- wxPoint origin = m_window->GetClientAreaOrigin(); | |
- m_x += origin.x; | |
- m_y += origin.y; | |
- } | |
- m_width = width ; | |
- m_height = height ; | |
- | |
- CreateOverlayWindow(); | |
- wxASSERT_MSG( m_overlayWindow != NULL , _("Couldn't create the overlay window") ); | |
- m_overlayContext = (CGContextRef) [[m_overlayWindow graphicsContext] graphicsPort]; | |
- wxASSERT_MSG( m_overlayContext != NULL , _("Couldn't init the context on the overlay window") ); | |
- | |
- int ySize = 0; | |
- if ( m_window ) | |
- { | |
- NSView* view = m_window->GetHandle(); | |
- NSSize viewSize = [view frame].size; | |
- ySize = viewSize.height; | |
- } | |
- else | |
- { | |
- CGRect cgbounds ; | |
- cgbounds = CGDisplayBounds(CGMainDisplayID()); | |
- ySize = cgbounds.size.height; | |
- | |
- | |
- | |
- } | |
- CGContextTranslateCTM( m_overlayContext, 0, ySize ); | |
- CGContextScaleCTM( m_overlayContext, 1, -1 ); | |
- CGContextTranslateCTM( m_overlayContext, -m_x , -m_y ); | |
+ m_overlayWindow = m_window->MacGetTopLevelWindowRef(); | |
+ | |
+ NSRect box = [m_overlayWindow frame]; | |
+ box.origin.x = 0; | |
+ box.origin.y = 0; | |
+ | |
+ if( [m_overlayWindow isVisible] ) | |
+ { | |
+ [m_overlayWindow discardCachedImage]; | |
+ [m_overlayWindow cacheImageInRect:box]; | |
+ } | |
} | |
void wxOverlayImpl::BeginDrawing( wxDC* dc) | |
{ | |
- wxDCImpl *impl = dc->GetImpl(); | |
- wxGCDCImpl *win_impl = wxDynamicCast(impl,wxGCDCImpl); | |
- if (win_impl) | |
- { | |
- win_impl->SetGraphicsContext( wxGraphicsContext::CreateFromNative( m_overlayContext ) ); | |
- dc->SetClippingRegion( m_x , m_y , m_width , m_height ) ; | |
- } | |
} | |
void wxOverlayImpl::EndDrawing( wxDC* dc) | |
{ | |
- wxDCImpl *impl = dc->GetImpl(); | |
- wxGCDCImpl *win_impl = wxDynamicCast(impl,wxGCDCImpl); | |
- if (win_impl) | |
- win_impl->SetGraphicsContext(NULL); | |
- | |
- CGContextFlush( m_overlayContext ); | |
} | |
-void wxOverlayImpl::Clear(wxDC* WXUNUSED(dc)) | |
+void wxOverlayImpl::Clear( wxDC* WXUNUSED(dc) ) | |
{ | |
wxASSERT_MSG( IsOk() , _("You cannot Clear an overlay that is not inited") ); | |
- CGRect box = CGRectMake( m_x - 1, m_y - 1 , m_width + 2 , m_height + 2 ); | |
- CGContextClearRect( m_overlayContext, box ); | |
+ | |
+ if( [m_overlayWindow isVisible] ) | |
+ { | |
+ [m_overlayWindow restoreCachedImage]; | |
+// [m_overlayWindow flushWindow]; | |
+ } | |
} | |
void wxOverlayImpl::Reset() | |
{ | |
- if ( m_overlayContext ) | |
- { | |
- m_overlayContext = NULL ; | |
- } | |
- | |
// todo : don't dispose, only hide and reposition on next run | |
- if (m_overlayWindow) | |
+ if (m_overlayWindow && [m_overlayWindow isVisible]) | |
{ | |
- [m_overlayParentWindow removeChildWindow:m_overlayWindow]; | |
- [m_overlayWindow release]; | |
- m_overlayWindow = NULL ; | |
+ NSRect box = [m_overlayWindow frame]; | |
+ box.origin.x = 0; | |
+ box.origin.y = 0; | |
+ | |
+ [m_overlayWindow discardCachedImage]; | |
+ [m_overlayWindow cacheImageInRect:box]; | |
} | |
} | |
=== modified file 'src/common/translation.cpp' | |
--- src/common/translation.cpp 2014-01-26 13:59:40 +0000 | |
+++ src/common/translation.cpp 2014-01-26 15:18:47 +0000 | |
@@ -1611,6 +1611,9 @@ | |
/* static */ | |
const wxString& wxTranslations::GetUntranslatedString(const wxString& str) | |
{ | |
+ // Marco Serantoni - Dirty Patch | |
+ // Awaiting for http://trac.wxwidgets.org/ticket/15908 | |
+ if( gs_translationsOwned == false) return str; | |
wxLocaleUntranslatedStrings& strings = wxThreadInfo.untranslatedStrings; | |
wxLocaleUntranslatedStrings::iterator i = strings.find(str); | |
=== modified file 'src/generic/scrlwing.cpp' | |
--- src/generic/scrlwing.cpp 2013-12-16 05:42:30 -0800 | |
+++ src/generic/scrlwing.cpp 2014-10-21 01:19:02 -0700 | |
@@ -214,9 +214,6 @@ | |
return true; | |
} | |
- if ( processed && event.IsCommandEvent()) | |
- return true; | |
- | |
// For wxEVT_PAINT the user code can either handle this event as usual or | |
// override virtual OnDraw(), so if the event hasn't been handled we need | |
// to call this virtual function ourselves. | |
@@ -235,6 +232,11 @@ | |
return true; | |
} | |
+ // If the user code handled this event, it should prevent the default | |
+ // handling from taking place, so don't do anything else in this case. | |
+ if ( processed ) | |
+ return true; | |
+ | |
if ( evType == wxEVT_CHILD_FOCUS ) | |
{ | |
m_scrollHelper->HandleOnChildFocus((wxChildFocusEvent &)event); | |
=== modified file 'src/generic/vscroll.cpp' | |
--- src/generic/vscroll.cpp 2013-12-16 05:42:30 -0800 | |
+++ src/generic/vscroll.cpp 2014-10-21 01:19:09 -0700 | |
@@ -89,9 +89,6 @@ | |
return true; | |
} | |
- if ( processed && event.IsCommandEvent()) | |
- return true; | |
- | |
// For wxEVT_PAINT the user code can either handle this event as usual or | |
// override virtual OnDraw(), so if the event hasn't been handled we need | |
// to call this virtual function ourselves. | |
@@ -110,6 +107,11 @@ | |
return true; | |
} | |
+ // If the user code handled this event, it should prevent the default | |
+ // handling from taking place, so don't do anything else in this case. | |
+ if ( processed ) | |
+ return true; | |
+ | |
// reset the skipped flag (which might have been set to true in | |
// ProcessEvent() above) to be able to test it below | |
bool wasSkipped = event.GetSkipped(); | |
Index: configure | |
=================================================================== | |
--- configure (revision 77757) | |
+++ configure (working copy) | |
@@ -29176,7 +29176,7 @@ | |
*-*-darwin* ) | |
install_name_tool=`which ${HOST_PREFIX}install_name_tool` | |
if test "$install_name_tool" -a -x "$install_name_tool"; then | |
- DYLIB_RPATH_POSTLINK="${HOST_PREFIX}install_name_tool -id \$@ \$@" | |
+ DYLIB_RPATH_POSTLINK="" | |
cat <<EOF >change-install-names | |
#!/bin/sh | |
libnames=\`cd \${1} ; ls -1 | grep '\.[0-9][0-9]*\.dylib\$'\` | |
@@ -29189,7 +29189,7 @@ | |
done | |
EOF | |
chmod +x change-install-names | |
- DYLIB_RPATH_INSTALL="\$(wx_top_builddir)/change-install-names \${DESTDIR}\${libdir} \${DESTDIR}\${bindir} \${libdir} \$(wx_top_builddir)/lib" | |
+ DYLIB_RPATH_INSTALL="" | |
fi | |
HEADER_PAD_OPTION="-headerpad_max_install_names" | |
Index: configure.in | |
=================================================================== | |
--- configure.in (revision 77757) | |
+++ configure.in (working copy) | |
@@ -3772,7 +3772,7 @@ | |
*-*-darwin* ) | |
install_name_tool=`which ${HOST_PREFIX}install_name_tool` | |
if test "$install_name_tool" -a -x "$install_name_tool"; then | |
- DYLIB_RPATH_POSTLINK="${HOST_PREFIX}install_name_tool -id \$@ \$@" | |
+ DYLIB_RPATH_POSTLINK="" | |
cat <<EOF >change-install-names | |
#!/bin/sh | |
libnames=\`cd \${1} ; ls -1 | grep '\.[[0-9]][[0-9]]*\.dylib\$'\` | |
@@ -3785,7 +3785,7 @@ | |
done | |
EOF | |
chmod +x change-install-names | |
- DYLIB_RPATH_INSTALL="\$(wx_top_builddir)/change-install-names \${DESTDIR}\${libdir} \${DESTDIR}\${bindir} \${libdir} \$(wx_top_builddir)/lib" | |
+ DYLIB_RPATH_INSTALL="" | |
fi | |
dnl the HEADER_PAD_OPTION is required by some wx samples to avoid the error: | |
diff --git a/src/osx/dataview_osx.cpp b/src/osx/dataview_osx.cpp | |
index 332d375..492b237 100644 | |
--- src/osx/dataview_osx.cpp | |
+++ src/osx/dataview_osx.cpp | |
@@ -378,7 +378,6 @@ bool wxDataViewCtrl::Create(wxWindow *parent, | |
const wxValidator& validator, | |
const wxString& name) | |
{ | |
- DontCreatePeer(); | |
if (!(wxControl::Create(parent,id,pos,size,style,validator,name))) | |
return false; | |
SetPeer(::CreateDataView(this,parent,id,pos,size,style,GetExtraStyle())); | |
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@:@" ) | |
diff -rupN include/wx/glcanvas.h include/wx/glcanvas.h | |
--- include/wx/glcanvas.h 2015-05-21 00:36:27.406145182 +0200 | |
+++ include/wx/glcanvas.h 2015-05-21 00:37:59.169474782 +0200 | |
@@ -19,6 +19,8 @@ | |
#include "wx/palette.h" | |
#include "wx/window.h" | |
+#define RETINA_OPENGL_PATCH | |
+ | |
class WXDLLIMPEXP_FWD_GL wxGLCanvas; | |
class WXDLLIMPEXP_FWD_GL wxGLContext; | |
diff -rupN include/wx/osx/glcanvas.h include/wx/osx/glcanvas.h | |
--- include/wx/osx/glcanvas.h 2015-05-21 00:36:27.419478515 +0200 | |
+++ include/wx/osx/glcanvas.h 2015-05-21 00:36:37.319478112 +0200 | |
@@ -88,6 +88,9 @@ public: | |
// update the view port of the current context to match this window | |
void SetViewport(); | |
+ void SetViewWantsBestResolution( bool aValue ); | |
+ bool GetViewWantsBestResolution(); | |
+ float GetBackingScaleFactor(); | |
// deprecated methods | |
// ------------------ | |
diff -rupN src/osx/cocoa/glcanvas.mm src/osx/cocoa/glcanvas.mm | |
--- src/osx/cocoa/glcanvas.mm 2015-05-21 00:36:27.542811843 +0200 | |
+++ src/osx/cocoa/glcanvas.mm 2015-05-21 00:36:37.322811445 +0200 | |
@@ -313,6 +313,22 @@ bool wxGLCanvas::SwapBuffers() | |
return true; | |
} | |
+void wxGLCanvas::SetViewWantsBestResolution( bool aValue ) | |
+{ | |
+ [GetHandle() setWantsBestResolutionOpenGLSurface:aValue]; | |
+} | |
+ | |
+bool wxGLCanvas::GetViewWantsBestResolution() | |
+{ | |
+ return [GetHandle() wantsBestResolutionOpenGLSurface]; | |
+} | |
+ | |
+float wxGLCanvas::GetBackingScaleFactor() | |
+{ | |
+ return [[GetHandle() window] backingScaleFactor]; | |
+} | |
+ | |
+ | |
bool wxGLContext::SetCurrent(const wxGLCanvas& win) const | |
{ | |
if ( !m_glContext ) | |
=== modified file 'src/osx/webview_webkit.mm' | |
--- src/osx/webview_webkit.mm 2014-09-16 07:27:52.000000000 -0600 | |
+++ src/osx/webview_webkit.mm 2014-09-16 07:28:12.000000000 -0600 | |
@@ -28,7 +28,7 @@ | |
#include "wx/hashmap.h" | |
#include "wx/filesys.h" | |
-#include <WebKit/WebKit.h> | |
+#include <WebKit/WebKitLegacy.h> | |
#include <WebKit/HIWebView.h> | |
#include <WebKit/CarbonUtils.h> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment