2008-07-29 16:28:21 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/osx/cocoa/private.h
|
|
|
|
// Purpose: Private declarations: as this header is only included by
|
|
|
|
// wxWidgets itself, it may contain identifiers which don't start
|
|
|
|
// with "wx".
|
|
|
|
// Author: Stefan Csomor
|
|
|
|
// Modified by:
|
|
|
|
// Created: 1998-01-01
|
|
|
|
// Copyright: (c) Stefan Csomor
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_PRIVATE_COCOA_H_
|
|
|
|
#define _WX_PRIVATE_COCOA_H_
|
|
|
|
|
2008-09-06 12:30:42 -04:00
|
|
|
#include <ApplicationServices/ApplicationServices.h>
|
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
#ifdef __OBJC__
|
|
|
|
#import <Cocoa/Cocoa.h>
|
2009-01-13 13:35:23 -05:00
|
|
|
#endif
|
2008-07-29 16:28:21 -04:00
|
|
|
|
2008-09-02 12:53:23 -04:00
|
|
|
//
|
|
|
|
// shared between Cocoa and Carbon
|
|
|
|
//
|
|
|
|
|
2009-09-18 12:16:30 -04:00
|
|
|
// bring in theming types without pulling in the headers
|
2008-09-02 12:53:23 -04:00
|
|
|
|
2008-09-06 12:30:42 -04:00
|
|
|
#if wxUSE_GUI
|
2008-09-02 12:53:23 -04:00
|
|
|
typedef SInt16 ThemeBrush;
|
2008-09-07 10:44:54 -04:00
|
|
|
CGColorRef WXDLLIMPEXP_CORE wxMacCreateCGColorFromHITheme( ThemeBrush brush ) ;
|
2008-09-02 12:53:23 -04:00
|
|
|
OSStatus WXDLLIMPEXP_CORE wxMacDrawCGImage(
|
|
|
|
CGContextRef inContext,
|
|
|
|
const CGRect * inBounds,
|
|
|
|
CGImageRef inImage) ;
|
2013-06-27 03:24:15 -04:00
|
|
|
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromCGImage( CGImageRef image, double scale = 1.0 );
|
2014-02-23 14:02:58 -05:00
|
|
|
WX_NSImage WXDLLIMPEXP_CORE wxOSXGetNSImageFromIconRef( WXHICON iconref );
|
2013-06-27 03:24:15 -04:00
|
|
|
CGImageRef WXDLLIMPEXP_CORE wxOSXCreateCGImageFromNSImage( WX_NSImage nsimage, double *scale = NULL );
|
2014-02-23 14:02:58 -05:00
|
|
|
CGImageRef WXDLLIMPEXP_CORE wxOSXGetCGImageFromNSImage( const WX_NSImage nsimage, CGRect* r, CGContextRef cg);
|
2013-06-27 03:24:15 -04:00
|
|
|
CGContextRef WXDLLIMPEXP_CORE wxOSXCreateBitmapContextFromNSImage( WX_NSImage nsimage);
|
|
|
|
|
2011-01-26 11:15:39 -05:00
|
|
|
wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxString &client, const wxSize& size);
|
2012-06-13 18:32:07 -04:00
|
|
|
WXWindow WXDLLIMPEXP_CORE wxOSXGetMainWindow();
|
2008-09-02 12:53:23 -04:00
|
|
|
|
2010-01-27 23:06:23 -05:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxDialog;
|
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxWidgetCocoaImpl : public wxWidgetImpl
|
|
|
|
{
|
|
|
|
public :
|
2011-03-18 11:45:51 -04:00
|
|
|
wxWidgetCocoaImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false, bool isUserPane = false ) ;
|
2009-08-21 06:41:26 -04:00
|
|
|
wxWidgetCocoaImpl() ;
|
|
|
|
~wxWidgetCocoaImpl();
|
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
void Init();
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual bool IsVisible() const ;
|
2008-09-02 12:53:23 -04:00
|
|
|
virtual void SetVisibility(bool);
|
|
|
|
|
2009-10-05 18:57:59 -04:00
|
|
|
// we provide a static function which can be reused from
|
|
|
|
// wxNonOwnedWindowCocoaImpl too
|
|
|
|
static bool ShowViewOrWindowWithEffect(wxWindow *win,
|
|
|
|
bool show,
|
|
|
|
wxShowEffect effect,
|
|
|
|
unsigned timeout);
|
|
|
|
|
|
|
|
virtual bool ShowWithEffect(bool show,
|
|
|
|
wxShowEffect effect,
|
|
|
|
unsigned timeout);
|
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual void Raise();
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual void Lower();
|
|
|
|
|
|
|
|
virtual void ScrollRect( const wxRect *rect, int dx, int dy );
|
|
|
|
|
|
|
|
virtual WXWidget GetWXWidget() const { return m_osxView; }
|
|
|
|
|
2008-09-02 12:53:23 -04:00
|
|
|
virtual void SetBackgroundColour(const wxColour&);
|
2010-04-16 02:18:16 -04:00
|
|
|
virtual bool SetBackgroundStyle(wxBackgroundStyle style);
|
2008-09-02 12:53:23 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual void GetContentArea( int &left , int &top , int &width , int &height ) const;
|
|
|
|
virtual void Move(int x, int y, int width, int height);
|
|
|
|
virtual void GetPosition( int &x, int &y ) const;
|
|
|
|
virtual void GetSize( int &width, int &height ) const;
|
2008-09-02 12:53:23 -04:00
|
|
|
virtual void SetControlSize( wxWindowVariant variant );
|
2008-07-29 16:28:21 -04:00
|
|
|
|
|
|
|
virtual void SetNeedsDisplay( const wxRect* where = NULL );
|
|
|
|
virtual bool GetNeedsDisplay() const;
|
|
|
|
|
2012-11-08 10:46:23 -05:00
|
|
|
virtual void SetDrawingEnabled(bool enabled);
|
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual bool CanFocus() const;
|
|
|
|
// return true if successful
|
|
|
|
virtual bool SetFocus();
|
|
|
|
virtual bool HasFocus() const;
|
|
|
|
|
|
|
|
void RemoveFromParent();
|
|
|
|
void Embed( wxWidgetImpl *parent );
|
2008-09-02 12:53:23 -04:00
|
|
|
|
|
|
|
void SetDefaultButton( bool isDefault );
|
|
|
|
void PerformClick();
|
2009-03-11 00:50:51 -04:00
|
|
|
virtual void SetLabel(const wxString& title, wxFontEncoding encoding);
|
2008-09-02 12:53:23 -04:00
|
|
|
|
2009-01-18 11:10:46 -05:00
|
|
|
void SetCursor( const wxCursor & cursor );
|
|
|
|
void CaptureMouse();
|
|
|
|
void ReleaseMouse();
|
2014-04-11 00:48:37 -04:00
|
|
|
#if wxUSE_DRAG_AND_DROP
|
2012-07-01 11:46:56 -04:00
|
|
|
void SetDropTarget(wxDropTarget* target);
|
2014-04-11 00:48:37 -04:00
|
|
|
#endif
|
2008-09-02 12:53:23 -04:00
|
|
|
wxInt32 GetValue() const;
|
|
|
|
void SetValue( wxInt32 v );
|
2009-06-20 23:01:53 -04:00
|
|
|
wxBitmap GetBitmap() const;
|
2008-09-02 12:53:23 -04:00
|
|
|
void SetBitmap( const wxBitmap& bitmap );
|
2009-06-20 23:01:53 -04:00
|
|
|
void SetBitmapPosition( wxDirection dir );
|
2008-09-02 12:53:23 -04:00
|
|
|
void SetupTabs( const wxNotebook ¬ebook );
|
|
|
|
void GetBestRect( wxRect *r ) const;
|
|
|
|
bool IsEnabled() const;
|
|
|
|
void Enable( bool enable );
|
|
|
|
bool ButtonClickDidStateChange() { return true ;}
|
|
|
|
void SetMinimum( wxInt32 v );
|
|
|
|
void SetMaximum( wxInt32 v );
|
2009-01-20 09:27:26 -05:00
|
|
|
wxInt32 GetMinimum() const;
|
|
|
|
wxInt32 GetMaximum() const;
|
2008-09-02 12:53:23 -04:00
|
|
|
void PulseGauge();
|
|
|
|
void SetScrollThumb( wxInt32 value, wxInt32 thumbSize );
|
|
|
|
|
2008-09-05 10:41:11 -04:00
|
|
|
void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );
|
2010-02-13 01:30:06 -05:00
|
|
|
void SetToolTip( wxToolTip* tooltip );
|
2008-09-05 10:41:11 -04:00
|
|
|
|
2008-10-10 15:01:32 -04:00
|
|
|
void InstallEventHandler( WXWidget control = NULL );
|
2009-08-21 06:41:26 -04:00
|
|
|
|
|
|
|
virtual bool DoHandleMouseEvent(NSEvent *event);
|
2009-02-22 13:25:36 -05:00
|
|
|
virtual bool DoHandleKeyEvent(NSEvent *event);
|
|
|
|
virtual bool DoHandleCharEvent(NSEvent *event, NSString *text);
|
2009-08-21 06:41:26 -04:00
|
|
|
virtual void DoNotifyFocusEvent(bool receivedFocus, wxWidgetImpl* otherWindow);
|
2009-12-01 11:47:33 -05:00
|
|
|
|
2009-09-26 06:39:26 -04:00
|
|
|
virtual void SetupKeyEvent(wxKeyEvent &wxevent, NSEvent * nsEvent, NSString* charString = NULL);
|
|
|
|
virtual void SetupMouseEvent(wxMouseEvent &wxevent, NSEvent * nsEvent);
|
2013-03-02 08:01:57 -05:00
|
|
|
void SetupCoordinates(wxCoord &x, wxCoord &y, NSEvent *nsEvent);
|
|
|
|
virtual bool SetupCursor(NSEvent* event);
|
2009-09-26 06:39:26 -04:00
|
|
|
|
2009-01-13 13:35:23 -05:00
|
|
|
|
2012-12-23 06:50:33 -05:00
|
|
|
#if !wxOSX_USE_NATIVE_FLIPPED
|
2009-02-07 08:25:58 -05:00
|
|
|
void SetFlipped(bool flipped);
|
2009-03-30 03:30:26 -04:00
|
|
|
virtual bool IsFlipped() const { return m_isFlipped; }
|
2012-12-23 06:50:33 -05:00
|
|
|
#endif
|
2009-02-09 12:53:02 -05:00
|
|
|
|
2013-06-19 16:28:01 -04:00
|
|
|
virtual double GetContentScaleFactor() const;
|
|
|
|
|
2009-02-09 12:53:02 -05:00
|
|
|
// cocoa thunk connected calls
|
2009-02-07 08:25:58 -05:00
|
|
|
|
2014-04-11 00:48:37 -04:00
|
|
|
#if wxUSE_DRAG_AND_DROP
|
2009-02-07 08:25:58 -05:00
|
|
|
virtual unsigned int draggingEntered(void* sender, WXWidget slf, void* _cmd);
|
|
|
|
virtual void draggingExited(void* sender, WXWidget slf, void* _cmd);
|
|
|
|
virtual unsigned int draggingUpdated(void* sender, WXWidget slf, void* _cmd);
|
|
|
|
virtual bool performDragOperation(void* sender, WXWidget slf, void* _cmd);
|
2014-04-11 00:48:37 -04:00
|
|
|
#endif
|
2009-02-07 08:25:58 -05:00
|
|
|
virtual void mouseEvent(WX_NSEvent event, WXWidget slf, void* _cmd);
|
2012-03-10 08:13:51 -05:00
|
|
|
virtual void cursorUpdate(WX_NSEvent event, WXWidget slf, void* _cmd);
|
2009-02-07 08:25:58 -05:00
|
|
|
virtual void keyEvent(WX_NSEvent event, WXWidget slf, void* _cmd);
|
2009-02-22 13:25:36 -05:00
|
|
|
virtual void insertText(NSString* text, WXWidget slf, void* _cmd);
|
2013-10-05 19:30:45 -04:00
|
|
|
virtual void doCommandBySelector(void* sel, WXWidget slf, void* _cmd);
|
2009-02-07 08:25:58 -05:00
|
|
|
virtual bool performKeyEquivalent(WX_NSEvent event, WXWidget slf, void* _cmd);
|
2009-03-07 23:15:58 -05:00
|
|
|
virtual bool acceptsFirstResponder(WXWidget slf, void* _cmd);
|
2009-02-07 08:25:58 -05:00
|
|
|
virtual bool becomeFirstResponder(WXWidget slf, void* _cmd);
|
|
|
|
virtual bool resignFirstResponder(WXWidget slf, void* _cmd);
|
2012-12-23 06:50:33 -05:00
|
|
|
#if !wxOSX_USE_NATIVE_FLIPPED
|
2009-02-07 08:25:58 -05:00
|
|
|
virtual bool isFlipped(WXWidget slf, void* _cmd);
|
2012-12-23 06:50:33 -05:00
|
|
|
#endif
|
2009-02-07 08:25:58 -05:00
|
|
|
virtual void drawRect(void* rect, WXWidget slf, void* _cmd);
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2009-02-12 02:17:46 -05:00
|
|
|
virtual void controlAction(WXWidget slf, void* _cmd, void* sender);
|
|
|
|
virtual void controlDoubleAction(WXWidget slf, void* _cmd, void *sender);
|
2010-09-30 07:44:45 -04:00
|
|
|
|
2010-02-06 12:00:38 -05:00
|
|
|
// for wxTextCtrl-derived classes, put here since they don't all derive
|
|
|
|
// from the same pimpl class.
|
|
|
|
virtual void controlTextDidChange();
|
2009-02-07 08:25:58 -05:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
protected:
|
|
|
|
WXWidget m_osxView;
|
2009-02-22 13:25:36 -05:00
|
|
|
NSEvent* m_lastKeyDownEvent;
|
2012-12-23 06:50:33 -05:00
|
|
|
#if !wxOSX_USE_NATIVE_FLIPPED
|
2009-02-07 08:25:58 -05:00
|
|
|
bool m_isFlipped;
|
2012-12-23 06:50:33 -05:00
|
|
|
#endif
|
2009-06-11 02:40:24 -04:00
|
|
|
// if it the control has an editor, that editor will already send some
|
2009-08-21 06:41:26 -04:00
|
|
|
// events, don't resend them
|
2009-06-11 02:40:24 -04:00
|
|
|
bool m_hasEditor;
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxWidgetCocoaImpl)
|
|
|
|
};
|
|
|
|
|
2009-01-14 08:56:05 -05:00
|
|
|
DECLARE_WXCOCOA_OBJC_CLASS( wxNSWindow );
|
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
class wxNonOwnedWindowCocoaImpl : public wxNonOwnedWindowImpl
|
|
|
|
{
|
|
|
|
public :
|
|
|
|
wxNonOwnedWindowCocoaImpl( wxNonOwnedWindow* nonownedwnd) ;
|
|
|
|
wxNonOwnedWindowCocoaImpl();
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual ~wxNonOwnedWindowCocoaImpl();
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2009-12-25 04:47:30 -05:00
|
|
|
virtual void WillBeDestroyed() ;
|
2008-07-29 16:28:21 -04:00
|
|
|
void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
|
|
|
|
long style, long extraStyle, const wxString& name ) ;
|
2010-04-13 16:24:59 -04:00
|
|
|
void Create( wxWindow* parent, WXWindow nativeWindow );
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
WXWindow GetWXWindow() const;
|
2009-08-21 06:41:26 -04:00
|
|
|
void Raise();
|
2008-07-29 16:28:21 -04:00
|
|
|
void Lower();
|
2009-08-21 06:41:26 -04:00
|
|
|
bool Show(bool show);
|
2009-10-05 18:57:59 -04:00
|
|
|
|
|
|
|
virtual bool ShowWithEffect(bool show,
|
|
|
|
wxShowEffect effect,
|
|
|
|
unsigned timeout);
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
void Update();
|
|
|
|
bool SetTransparent(wxByte alpha);
|
|
|
|
bool SetBackgroundColour(const wxColour& col );
|
2009-08-21 06:41:26 -04:00
|
|
|
void SetExtraStyle( long exStyle );
|
2009-11-07 22:03:06 -05:00
|
|
|
void SetWindowStyleFlag( long style );
|
2009-08-21 06:41:26 -04:00
|
|
|
bool SetBackgroundStyle(wxBackgroundStyle style);
|
2008-07-29 16:28:21 -04:00
|
|
|
bool CanSetTransparent();
|
|
|
|
|
|
|
|
void MoveWindow(int x, int y, int width, int height);
|
|
|
|
void GetPosition( int &x, int &y ) const;
|
|
|
|
void GetSize( int &width, int &height ) const;
|
|
|
|
|
2009-08-21 06:41:26 -04:00
|
|
|
void GetContentArea( int &left , int &top , int &width , int &height ) const;
|
2008-07-29 16:28:21 -04:00
|
|
|
bool SetShape(const wxRegion& region);
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual void SetTitle( const wxString& title, wxFontEncoding encoding ) ;
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual bool IsMaximized() const;
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual bool IsIconized() const;
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual void Iconize( bool iconize );
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual void Maximize(bool maximize);
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual bool IsFullScreen() const;
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual bool ShowFullScreen(bool show, long style);
|
2009-12-01 11:47:33 -05:00
|
|
|
|
2009-10-30 01:04:47 -04:00
|
|
|
virtual void ShowWithoutActivating();
|
2008-07-29 16:28:21 -04:00
|
|
|
|
|
|
|
virtual void RequestUserAttention(int flags);
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual void ScreenToWindow( int *x, int *y );
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual void WindowToScreen( int *x, int *y );
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2009-10-30 01:04:47 -04:00
|
|
|
virtual bool IsActive();
|
2010-09-30 07:44:45 -04:00
|
|
|
|
2009-12-06 20:54:21 -05:00
|
|
|
virtual void SetModified(bool modified);
|
2009-12-09 00:25:32 -05:00
|
|
|
virtual bool IsModified() const;
|
2009-12-01 11:47:33 -05:00
|
|
|
|
2012-01-08 09:52:47 -05:00
|
|
|
virtual void SetRepresentedFilename(const wxString& filename);
|
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
|
2011-03-07 14:04:55 -05:00
|
|
|
|
|
|
|
CGWindowLevel GetWindowLevel() const { return m_macWindowLevel; }
|
|
|
|
void RestoreWindowLevel();
|
2013-06-03 06:37:01 -04:00
|
|
|
|
|
|
|
static WX_NSResponder GetNextFirstResponder() ;
|
2008-07-29 16:28:21 -04:00
|
|
|
protected :
|
2011-03-07 14:04:55 -05:00
|
|
|
CGWindowLevel m_macWindowLevel;
|
2010-04-20 10:55:10 -04:00
|
|
|
WXWindow m_macWindow;
|
|
|
|
void * m_macFullScreenData ;
|
2008-07-29 16:28:21 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowCocoaImpl)
|
2009-08-21 06:41:26 -04:00
|
|
|
};
|
2008-07-29 16:28:21 -04:00
|
|
|
|
2012-11-02 06:06:06 -04:00
|
|
|
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;
|
2012-11-02 13:02:15 -04:00
|
|
|
void SetAcceleratorFromLabel(const wxString& label);
|
|
|
|
|
2012-11-02 06:06:06 -04:00
|
|
|
NSButton *GetNSButton() const;
|
|
|
|
};
|
|
|
|
|
2009-01-13 13:35:23 -05:00
|
|
|
#ifdef __OBJC__
|
2013-06-12 16:41:04 -04:00
|
|
|
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);
|
|
|
|
|
2009-01-13 13:35:23 -05:00
|
|
|
|
2010-09-11 05:20:28 -04:00
|
|
|
WXDLLIMPEXP_CORE NSScreen* wxOSXGetMenuScreen();
|
2009-05-10 15:43:39 -04:00
|
|
|
WXDLLIMPEXP_CORE NSRect wxToNSRect( NSView* parent, const wxRect& r );
|
|
|
|
WXDLLIMPEXP_CORE wxRect wxFromNSRect( NSView* parent, const NSRect& rect );
|
|
|
|
WXDLLIMPEXP_CORE NSPoint wxToNSPoint( NSView* parent, const wxPoint& p );
|
|
|
|
WXDLLIMPEXP_CORE wxPoint wxFromNSPoint( NSView* parent, const NSPoint& p );
|
2009-08-21 06:41:26 -04:00
|
|
|
|
|
|
|
NSRect WXDLLIMPEXP_CORE wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const wxSize &size ,
|
2009-01-13 13:35:23 -05:00
|
|
|
bool adjustForOrigin = true );
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2013-06-04 03:06:19 -04:00
|
|
|
WXDLLIMPEXP_CORE NSView* wxOSXGetViewFromResponder( NSResponder* responder );
|
|
|
|
|
2009-01-14 03:58:59 -05:00
|
|
|
// used for many wxControls
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2009-01-14 03:58:59 -05:00
|
|
|
@interface wxNSButton : NSButton
|
|
|
|
{
|
2009-10-08 14:38:43 -04:00
|
|
|
NSTrackingRectTag rectTag;
|
2009-01-14 03:58:59 -05:00
|
|
|
}
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2009-01-14 03:58:59 -05:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface wxNSBox : NSBox
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2009-06-11 02:40:24 -04:00
|
|
|
@interface wxNSTextFieldEditor : NSTextView
|
|
|
|
{
|
|
|
|
NSEvent* lastKeyDownEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2010-01-11 09:19:28 -05:00
|
|
|
@interface wxNSTextField : NSTextField wxOSX_10_6_AND_LATER(<NSTextFieldDelegate>)
|
2009-06-11 02:40:24 -04:00
|
|
|
{
|
|
|
|
wxNSTextFieldEditor* fieldEditor;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (wxNSTextFieldEditor*) fieldEditor;
|
|
|
|
- (void) setFieldEditor:(wxNSTextFieldEditor*) fieldEditor;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2010-01-11 09:19:28 -05:00
|
|
|
@interface wxNSSecureTextField : NSSecureTextField wxOSX_10_6_AND_LATER(<NSTextFieldDelegate>)
|
2009-01-14 03:58:59 -05:00
|
|
|
{
|
|
|
|
}
|
2009-06-11 02:40:24 -04:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
2009-12-01 11:47:33 -05:00
|
|
|
@interface wxNSTextView : NSTextView wxOSX_10_6_AND_LATER(<NSTextViewDelegate>)
|
2009-06-11 02:40:24 -04:00
|
|
|
{
|
|
|
|
}
|
2009-12-01 11:47:33 -05:00
|
|
|
|
2009-11-26 16:52:42 -05:00
|
|
|
- (void)textDidChange:(NSNotification *)aNotification;
|
2009-12-01 11:47:33 -05:00
|
|
|
|
2009-01-14 03:58:59 -05:00
|
|
|
@end
|
|
|
|
|
2013-05-10 14:31:51 -04:00
|
|
|
@interface wxNSComboBox : NSComboBox
|
|
|
|
{
|
|
|
|
wxNSTextFieldEditor* fieldEditor;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (wxNSTextFieldEditor*) fieldEditor;
|
|
|
|
- (void) setFieldEditor:(wxNSTextFieldEditor*) fieldEditor;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-14 08:56:05 -05:00
|
|
|
@interface wxNSMenu : NSMenu
|
|
|
|
{
|
|
|
|
wxMenuImpl* impl;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setImplementation:(wxMenuImpl*) item;
|
|
|
|
- (wxMenuImpl*) implementation;
|
|
|
|
|
2009-08-21 06:41:26 -04:00
|
|
|
@end
|
2009-01-14 08:56:05 -05:00
|
|
|
|
|
|
|
@interface wxNSMenuItem : NSMenuItem
|
|
|
|
{
|
|
|
|
wxMenuItemImpl* impl;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setImplementation:(wxMenuItemImpl*) item;
|
|
|
|
- (wxMenuItemImpl*) implementation;
|
|
|
|
|
|
|
|
- (void)clickedAction:(id)sender;
|
|
|
|
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem;
|
|
|
|
|
2009-08-21 06:41:26 -04:00
|
|
|
@end
|
|
|
|
|
2009-02-07 18:17:52 -05:00
|
|
|
void WXDLLIMPEXP_CORE wxOSXCocoaClassAddWXMethods(Class c);
|
2009-01-14 03:58:59 -05:00
|
|
|
|
2009-03-05 14:19:28 -05:00
|
|
|
/*
|
|
|
|
We need this for ShowModal, as the sheet just disables the parent window and
|
|
|
|
returns control to the app, whereas we don't want to return from ShowModal
|
|
|
|
until the sheet has been dismissed.
|
|
|
|
*/
|
|
|
|
@interface ModalDialogDelegate : NSObject
|
|
|
|
{
|
|
|
|
BOOL sheetFinished;
|
|
|
|
int resultCode;
|
2010-01-27 23:06:23 -05:00
|
|
|
wxDialog* impl;
|
2009-03-05 14:19:28 -05:00
|
|
|
}
|
|
|
|
|
2010-01-27 23:06:23 -05:00
|
|
|
- (void)setImplementation: (wxDialog *)dialog;
|
2009-03-05 14:19:28 -05:00
|
|
|
- (BOOL)finished;
|
|
|
|
- (int)code;
|
|
|
|
- (void)waitForSheetToFinish;
|
|
|
|
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo;
|
|
|
|
@end
|
|
|
|
|
2011-08-22 08:38:36 -04:00
|
|
|
// This interface must be exported in shared 64 bit multilib build but
|
|
|
|
// using WXEXPORT with Objective C interfaces doesn't work with old (4.0.1)
|
|
|
|
// gcc when using 10.4 SDK. It does work with newer gcc even in 32 bit
|
|
|
|
// builds but seems to be unnecessary there so to avoid the expense of a
|
|
|
|
// configure check verifying if this does work or not with the current
|
|
|
|
// compiler we just only use it for 64 bit builds where this is always
|
|
|
|
// supported.
|
|
|
|
//
|
|
|
|
// NB: Currently this is the only place where we need to export an
|
|
|
|
// interface but if we need to do it elsewhere we should define a
|
|
|
|
// WXEXPORT_OBJC macro once and reuse it in all places it's needed
|
|
|
|
// instead of duplicating this preprocessor check.
|
|
|
|
#ifdef __LP64__
|
|
|
|
WXEXPORT
|
|
|
|
#endif // 64 bit builds
|
|
|
|
@interface wxNSAppController : NSObject wxOSX_10_6_AND_LATER(<NSApplicationDelegate>)
|
2011-02-28 05:10:08 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
2009-03-05 14:19:28 -05:00
|
|
|
|
2009-01-13 13:35:23 -05:00
|
|
|
#endif // __OBJC__
|
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
// NSCursor
|
|
|
|
|
|
|
|
WX_NSCursor wxMacCocoaCreateStockCursor( int cursor_type );
|
|
|
|
WX_NSCursor wxMacCocoaCreateCursorFromCGImage( CGImageRef cgImageRef, float hotSpotX, float hotSpotY );
|
|
|
|
void wxMacCocoaSetCursor( WX_NSCursor cursor );
|
|
|
|
void wxMacCocoaHideCursor();
|
|
|
|
void wxMacCocoaShowCursor();
|
|
|
|
|
|
|
|
typedef struct tagClassicCursor
|
|
|
|
{
|
|
|
|
wxUint16 bits[16];
|
|
|
|
wxUint16 mask[16];
|
|
|
|
wxInt16 hotspot[2];
|
|
|
|
}ClassicCursor;
|
|
|
|
|
2008-09-02 12:53:23 -04:00
|
|
|
const short kwxCursorBullseye = 0;
|
|
|
|
const short kwxCursorBlank = 1;
|
|
|
|
const short kwxCursorPencil = 2;
|
|
|
|
const short kwxCursorMagnifier = 3;
|
|
|
|
const short kwxCursorNoEntry = 4;
|
|
|
|
const short kwxCursorPaintBrush = 5;
|
|
|
|
const short kwxCursorPointRight = 6;
|
|
|
|
const short kwxCursorPointLeft = 7;
|
|
|
|
const short kwxCursorQuestionArrow = 8;
|
|
|
|
const short kwxCursorRightArrow = 9;
|
|
|
|
const short kwxCursorSizeNS = 10;
|
|
|
|
const short kwxCursorSize = 11;
|
|
|
|
const short kwxCursorSizeNESW = 12;
|
|
|
|
const short kwxCursorSizeNWSE = 13;
|
|
|
|
const short kwxCursorRoller = 14;
|
2011-02-28 08:44:25 -05:00
|
|
|
const short kwxCursorWatch = 15;
|
|
|
|
const short kwxCursorLast = kwxCursorWatch;
|
2008-09-02 12:53:23 -04:00
|
|
|
|
|
|
|
// exposing our fallback cursor map
|
|
|
|
|
|
|
|
extern ClassicCursor gMacCursors[];
|
|
|
|
|
2012-08-29 08:15:50 -04:00
|
|
|
extern NSLayoutManager* gNSLayoutManager;
|
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_PRIVATE_COCOA_H_
|
|
|
|
|