Upgrade WX to r74856, mainly to support @2x.

This commit is contained in:
comex
2013-09-22 18:44:55 -04:00
parent 0bdef3932f
commit 66ed9a1804
1935 changed files with 45373 additions and 22739 deletions

View File

@ -4,7 +4,6 @@
* Author: Stefan Csomor
* Modified by:
* Created: 2008-07-30
* RCS-ID: $Id: chkconf.h 67232 2011-03-18 15:10:15Z DS $
* Copyright: (c) Stefan Csomor
* Licence: wxWindows licence
*/
@ -12,6 +11,17 @@
#ifndef _WX_OSX_COCOA_CHKCONF_H_
#define _WX_OSX_COCOA_CHKCONF_H_
/* Many wchar functions (and also strnlen(), for some reason) are only
available since 10.7 so don't use them if we want to build the applications
that would run under 10.6 and earlier. */
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
#define HAVE_STRNLEN 1
#define HAVE_WCSDUP 1
#define HAVE_WCSNLEN 1
#define HAVE_WCSCASECMP 1
#define HAVE_WCSNCASECMP 1
#endif
/*
* native (1) or emulated (0) toolbar
*/
@ -20,6 +30,13 @@
#define wxOSX_USE_NATIVE_TOOLBAR 1
#endif
/*
* leave is isFlipped and don't override
*/
#ifndef wxOSX_USE_NATIVE_FLIPPED
#define wxOSX_USE_NATIVE_FLIPPED 1
#endif
/*
* text rendering system
*/

View File

@ -2,7 +2,6 @@
// Name: wx/osx/cocoa/dataview.h
// Purpose: wxDataViewCtrl native implementation header for carbon
// Author:
// Id: $Id: dataview.h 57374 2009-01-27
// Copyright: (c) 2009
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -3,7 +3,6 @@
// Purpose: declaration of wxGUIEventLoop for wxOSX/Cocoa
// Author: Vadim Zeitlin
// Created: 2008-12-28
// RCS-ID: $Id: evtloop.h 68301 2011-07-19 16:17:44Z SC $
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -23,12 +22,14 @@ public:
virtual void WakeUp();
void OSXUseLowLevelWakeup(bool useIt)
{ m_osxLowLevelWakeUp = useIt ; }
protected:
virtual int DoDispatchTimeout(unsigned long timeout);
virtual void DoRun();
virtual void DoStop();
virtual void OSXDoRun();
virtual void OSXDoStop();
virtual CFRunLoopRef CFGetCurrentRunLoop() const;
@ -39,6 +40,8 @@ protected:
WXWindow m_dummyWindow;
int m_modalNestedLevel;
bool m_osxLowLevelWakeUp;
};
#endif // _WX_OSX_COCOA_EVTLOOP_H_

View File

@ -6,7 +6,6 @@
// Author: Stefan Csomor
// Modified by:
// Created: 1998-01-01
// RCS-ID: $Id: private.h 70863 2012-03-10 13:13:51Z SC $
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -39,9 +38,12 @@ OSStatus WXDLLIMPEXP_CORE wxMacDrawCGImage(
CGContextRef inContext,
const CGRect * inBounds,
CGImageRef inImage) ;
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromCGImage( CGImageRef image );
CGImageRef WXDLLIMPEXP_CORE wxOSXCreateCGImageFromNSImage( WX_NSImage nsimage );
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromCGImage( CGImageRef image, double scale = 1.0 );
CGImageRef WXDLLIMPEXP_CORE wxOSXCreateCGImageFromNSImage( WX_NSImage nsimage, double *scale = NULL );
CGContextRef WXDLLIMPEXP_CORE wxOSXCreateBitmapContextFromNSImage( WX_NSImage nsimage);
wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxString &client, const wxSize& size);
WXWindow WXDLLIMPEXP_CORE wxOSXGetMainWindow();
class WXDLLIMPEXP_FWD_CORE wxDialog;
@ -88,6 +90,8 @@ public :
virtual void SetNeedsDisplay( const wxRect* where = NULL );
virtual bool GetNeedsDisplay() const;
virtual void SetDrawingEnabled(bool enabled);
virtual bool CanFocus() const;
// return true if successful
virtual bool SetFocus();
@ -104,6 +108,8 @@ public :
void CaptureMouse();
void ReleaseMouse();
void SetDropTarget(wxDropTarget* target);
wxInt32 GetValue() const;
void SetValue( wxInt32 v );
wxBitmap GetBitmap() const;
@ -133,11 +139,17 @@ public :
virtual void SetupKeyEvent(wxKeyEvent &wxevent, NSEvent * nsEvent, NSString* charString = NULL);
virtual void SetupMouseEvent(wxMouseEvent &wxevent, NSEvent * nsEvent);
void SetupCoordinates(wxCoord &x, wxCoord &y, NSEvent *nsEvent);
virtual bool SetupCursor(NSEvent* event);
#if !wxOSX_USE_NATIVE_FLIPPED
void SetFlipped(bool flipped);
virtual bool IsFlipped() const { return m_isFlipped; }
#endif
virtual double GetContentScaleFactor() const;
// cocoa thunk connected calls
virtual unsigned int draggingEntered(void* sender, WXWidget slf, void* _cmd);
@ -152,7 +164,9 @@ public :
virtual bool acceptsFirstResponder(WXWidget slf, void* _cmd);
virtual bool becomeFirstResponder(WXWidget slf, void* _cmd);
virtual bool resignFirstResponder(WXWidget slf, void* _cmd);
#if !wxOSX_USE_NATIVE_FLIPPED
virtual bool isFlipped(WXWidget slf, void* _cmd);
#endif
virtual void drawRect(void* rect, WXWidget slf, void* _cmd);
virtual void controlAction(WXWidget slf, void* _cmd, void* sender);
@ -165,7 +179,9 @@ public :
protected:
WXWidget m_osxView;
NSEvent* m_lastKeyDownEvent;
#if !wxOSX_USE_NATIVE_FLIPPED
bool m_isFlipped;
#endif
// if it the control has an editor, that editor will already send some
// events, don't resend them
bool m_hasEditor;
@ -245,6 +261,8 @@ public :
CGWindowLevel GetWindowLevel() const { return m_macWindowLevel; }
void RestoreWindowLevel();
static WX_NSResponder GetNextFirstResponder() ;
protected :
CGWindowLevel m_macWindowLevel;
WXWindow m_macWindow;
@ -252,7 +270,30 @@ protected :
DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowCocoaImpl)
};
DECLARE_WXCOCOA_OBJC_CLASS( wxNSButton );
class wxButtonCocoaImpl : public wxWidgetCocoaImpl, public wxButtonImpl
{
public:
wxButtonCocoaImpl(wxWindowMac *wxpeer, wxNSButton *v);
virtual void SetBitmap(const wxBitmap& bitmap);
#if wxUSE_MARKUP
virtual void SetLabelMarkup(const wxString& markup);
#endif // wxUSE_MARKUP
void SetPressedBitmap( const wxBitmap& bitmap );
void GetLayoutInset(int &left , int &top , int &right, int &bottom) const;
void SetAcceleratorFromLabel(const wxString& label);
NSButton *GetNSButton() const;
};
#ifdef __OBJC__
typedef void (*wxOSX_TextEventHandlerPtr)(NSView* self, SEL _cmd, NSString *event);
typedef void (*wxOSX_EventHandlerPtr)(NSView* self, SEL _cmd, NSEvent *event);
typedef BOOL (*wxOSX_PerformKeyEventHandlerPtr)(NSView* self, SEL _cmd, NSEvent *event);
typedef BOOL (*wxOSX_FocusHandlerPtr)(NSView* self, SEL _cmd);
WXDLLIMPEXP_CORE NSScreen* wxOSXGetMenuScreen();
WXDLLIMPEXP_CORE NSRect wxToNSRect( NSView* parent, const wxRect& r );
@ -263,6 +304,8 @@ protected :
NSRect WXDLLIMPEXP_CORE wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const wxSize &size ,
bool adjustForOrigin = true );
WXDLLIMPEXP_CORE NSView* wxOSXGetViewFromResponder( NSResponder* responder );
// used for many wxControls
@interface wxNSButton : NSButton
@ -310,6 +353,18 @@ protected :
@end
@interface wxNSComboBox : NSComboBox
{
wxNSTextFieldEditor* fieldEditor;
}
- (wxNSTextFieldEditor*) fieldEditor;
- (void) setFieldEditor:(wxNSTextFieldEditor*) fieldEditor;
@end
@interface wxNSMenu : NSMenu
{
wxMenuImpl* impl;
@ -414,6 +469,8 @@ const short kwxCursorLast = kwxCursorWatch;
extern ClassicCursor gMacCursors[];
extern NSLayoutManager* gNSLayoutManager;
#endif
#endif

View File

@ -3,7 +3,6 @@
// Purpose: NSDate-related helpers
// Author: Vadim Zeitlin
// Created: 2011-12-19
// RCS-ID: $Id: date.h 70070 2011-12-20 21:27:09Z VZ $
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -3,7 +3,6 @@
// Purpose: Class to convert markup to Cocoa attributed strings.
// Author: Vadim Zeitlin
// Created: 2011-02-22
// RCS-ID: $Id: markuptoattr.h 67069 2011-02-27 12:48:46Z VZ $
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Stefan Csomor
// Modified by:
// Created: 2006-10-20
// RCS-ID: $Id: overlay.h 67232 2011-03-18 15:10:15Z DS $
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Stefan Csomor
// Modified by:
// Created: 03/02/99
// RCS-ID: $Id: textimpl.h 70354 2012-01-15 15:53:56Z SC $
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -45,6 +44,10 @@ public :
virtual bool SetHint(const wxString& hint);
virtual void controlAction(WXWidget slf, void* _cmd, void *sender);
virtual bool becomeFirstResponder(WXWidget slf, void *_cmd);
virtual bool resignFirstResponder(WXWidget slf, void *_cmd);
virtual void SetInternalSelection( long from , long to );
protected :
NSTextField* m_textField;
@ -111,6 +114,10 @@ public :
virtual void Popup();
virtual void Dismiss();
virtual void SetEditable(bool editable);
virtual void mouseEvent(WX_NSEvent event, WXWidget slf, void *_cmd);
private:
NSComboBox* m_comboBox;
};