2008-07-29 16:28:21 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/osx/iphone/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
|
|
|
|
// RCS-ID: $Id: private.h 53819 2008-05-29 14:11:45Z SC $
|
|
|
|
// Copyright: (c) Stefan Csomor
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_PRIVATE_IPHONE_H_
|
|
|
|
#define _WX_PRIVATE_IPHONE_H_
|
|
|
|
|
|
|
|
#include "wx/osx/core/private.h"
|
|
|
|
|
|
|
|
#ifdef __OBJC__
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if wxUSE_GUI
|
|
|
|
|
2009-07-10 13:41:13 -04:00
|
|
|
OSStatus WXDLLIMPEXP_CORE wxMacDrawCGImage(
|
|
|
|
CGContextRef inContext,
|
|
|
|
const CGRect * inBounds,
|
|
|
|
CGImageRef inImage) ;
|
|
|
|
|
2010-04-12 12:29:35 -04:00
|
|
|
WX_UIImage WXDLLIMPEXP_CORE wxOSXGetUIImageFromCGImage( CGImageRef image );
|
2009-07-10 13:41:13 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxWidgetIPhoneImpl : public wxWidgetImpl
|
|
|
|
{
|
|
|
|
public :
|
2009-08-21 06:41:26 -04:00
|
|
|
wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false ) ;
|
|
|
|
wxWidgetIPhoneImpl() ;
|
|
|
|
~wxWidgetIPhoneImpl();
|
|
|
|
|
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 ;
|
|
|
|
virtual void SetVisibility( bool visible );
|
2009-08-21 06:41:26 -04:00
|
|
|
|
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; }
|
|
|
|
|
|
|
|
virtual void SetBackgroundColour( const wxColour& col ) ;
|
2010-04-30 14:29:43 -04:00
|
|
|
virtual bool SetBackgroundStyle(wxBackgroundStyle style) ;
|
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;
|
2009-07-10 13:41:13 -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;
|
|
|
|
|
|
|
|
virtual bool CanFocus() const;
|
|
|
|
// return true if successful
|
|
|
|
virtual bool SetFocus();
|
|
|
|
virtual bool HasFocus() const;
|
|
|
|
|
|
|
|
void RemoveFromParent();
|
|
|
|
void Embed( wxWidgetImpl *parent );
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2009-07-10 13:41:13 -04:00
|
|
|
void SetDefaultButton( bool isDefault );
|
|
|
|
void PerformClick();
|
|
|
|
virtual void SetLabel(const wxString& title, wxFontEncoding encoding);
|
|
|
|
|
|
|
|
void SetCursor( const wxCursor & cursor );
|
|
|
|
void CaptureMouse();
|
|
|
|
void ReleaseMouse();
|
|
|
|
|
|
|
|
wxInt32 GetValue() const;
|
|
|
|
void SetValue( wxInt32 v );
|
2009-07-10 15:19:36 -04:00
|
|
|
|
|
|
|
virtual wxBitmap GetBitmap() const;
|
|
|
|
virtual void SetBitmap( const wxBitmap& bitmap );
|
|
|
|
virtual void SetBitmapPosition( wxDirection dir );
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2009-07-10 13:41:13 -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 );
|
|
|
|
wxInt32 GetMinimum() const;
|
|
|
|
wxInt32 GetMaximum() const;
|
|
|
|
void PulseGauge();
|
|
|
|
void SetScrollThumb( wxInt32 value, wxInt32 thumbSize );
|
|
|
|
|
|
|
|
void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );
|
|
|
|
|
|
|
|
void InstallEventHandler( WXWidget control = NULL );
|
2009-08-21 06:41:26 -04:00
|
|
|
|
|
|
|
virtual void DoNotifyFocusEvent(bool receivedFocus, wxWidgetImpl* otherWindow);
|
2009-07-10 13:41:13 -04:00
|
|
|
|
|
|
|
// thunk connected calls
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2009-07-10 13:41:13 -04:00
|
|
|
virtual void drawRect(CGRect* rect, WXWidget slf, void* _cmd);
|
|
|
|
virtual void touchEvent(WX_NSSet touches, WX_UIEvent event, WXWidget slf, void* _cmd);
|
|
|
|
virtual bool becomeFirstResponder(WXWidget slf, void* _cmd);
|
|
|
|
virtual bool resignFirstResponder(WXWidget slf, void* _cmd);
|
|
|
|
|
|
|
|
// action
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2010-04-30 14:29:43 -04:00
|
|
|
virtual void controlAction(void* sender, wxUint32 controlEvent, WX_UIEvent rawEvent);
|
|
|
|
virtual void controlTextDidChange();
|
2008-07-29 16:28:21 -04:00
|
|
|
protected:
|
|
|
|
WXWidget m_osxView;
|
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxWidgetIPhoneImpl)
|
|
|
|
};
|
|
|
|
|
|
|
|
class wxNonOwnedWindowIPhoneImpl : public wxNonOwnedWindowImpl
|
|
|
|
{
|
|
|
|
public :
|
|
|
|
wxNonOwnedWindowIPhoneImpl( wxNonOwnedWindow* nonownedwnd) ;
|
|
|
|
wxNonOwnedWindowIPhoneImpl();
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
virtual ~wxNonOwnedWindowIPhoneImpl();
|
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-30 14:29:43 -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);
|
2008-07-29 16:28:21 -04:00
|
|
|
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 );
|
|
|
|
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);
|
|
|
|
|
|
|
|
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
|
|
|
// FIXME: Does iPhone have a concept of inactive windows?
|
|
|
|
virtual bool IsActive() { return true; }
|
2010-09-30 07:44:45 -04:00
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
|
2010-03-03 11:33:12 -05:00
|
|
|
|
|
|
|
virtual bool InitialShowEventSent() { return m_initialShowSent; }
|
2008-07-29 16:28:21 -04:00
|
|
|
protected :
|
|
|
|
WX_UIWindow m_macWindow;
|
|
|
|
void * m_macFullScreenData ;
|
2010-03-03 11:33:12 -05:00
|
|
|
bool m_initialShowSent;
|
2008-07-29 16:28:21 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowIPhoneImpl)
|
2009-08-21 06:41:26 -04:00
|
|
|
};
|
2008-07-29 16:28:21 -04:00
|
|
|
|
2009-07-10 13:41:13 -04:00
|
|
|
#ifdef __OBJC__
|
|
|
|
|
|
|
|
WXDLLIMPEXP_CORE CGRect wxToNSRect( UIView* parent, const wxRect& r );
|
|
|
|
WXDLLIMPEXP_CORE wxRect wxFromNSRect( UIView* parent, const CGRect& rect );
|
|
|
|
WXDLLIMPEXP_CORE CGPoint wxToNSPoint( UIView* parent, const wxPoint& p );
|
|
|
|
WXDLLIMPEXP_CORE wxPoint wxFromNSPoint( UIView* parent, const CGPoint& p );
|
2009-08-21 06:41:26 -04:00
|
|
|
|
|
|
|
CGRect WXDLLIMPEXP_CORE wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const wxSize &size ,
|
2009-07-10 13:41:13 -04:00
|
|
|
bool adjustForOrigin = true );
|
|
|
|
|
|
|
|
@interface wxUIButton : UIButton
|
|
|
|
{
|
|
|
|
}
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2009-07-10 13:41:13 -04:00
|
|
|
@end
|
|
|
|
|
2009-12-12 09:01:28 -05:00
|
|
|
@interface wxUIView : UIView
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
@end // wxUIView
|
|
|
|
|
2010-04-30 14:29:43 -04:00
|
|
|
|
2009-07-10 13:41:13 -04:00
|
|
|
void WXDLLIMPEXP_CORE wxOSXIPhoneClassAddWXMethods(Class c);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2008-07-29 16:28:21 -04:00
|
|
|
#endif // wxUSE_GUI
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_PRIVATE_IPHONE_H_
|