X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/524c47aa3adf2af11a3069fd5da035a604f08f66..032e024c1c6ab6a20226604baab9d00558620e72:/include/wx/osx/carbon/private.h?ds=sidebyside diff --git a/include/wx/osx/carbon/private.h b/include/wx/osx/carbon/private.h index 933bd32a3b..e63edd4891 100644 --- a/include/wx/osx/carbon/private.h +++ b/include/wx/osx/carbon/private.h @@ -28,9 +28,9 @@ typedef SInt32 SRefCon; #include "wx/osx/uma.h" #include "wx/listbox.h" -#include "wx/osx/carbon/dc.h" -#include "wx/osx/carbon/dcclient.h" -#include "wx/osx/carbon/dcmemory.h" +#include "wx/osx/dc.h" +#include "wx/osx/dcclient.h" +#include "wx/osx/dcmemory.h" // app.h @@ -38,7 +38,6 @@ typedef SInt32 SRefCon; bool wxMacConvertEventToRecord( EventRef event , EventRecord *rec); #endif -WXDLLIMPEXP_CORE wxWindowMac * wxFindWindowFromWXWidget(WXWidget inControl ); // TODO REMOVE WXDLLIMPEXP_CORE wxNonOwnedWindow* wxFindWindowFromWXWindow( WXWindow inWindow ); #endif // wxUSE_GUI @@ -56,6 +55,7 @@ WXDLLIMPEXP_BASE wxString wxMacFindFolder(short vRefNum, Boolean createFolder); template EventParamType wxMacGetEventParamType() { wxFAIL_MSG( wxT("Unknown Param Type") ); return 0; } +template<> inline EventParamType wxMacGetEventParamType() { return typeHIShapeRef; } template<> inline EventParamType wxMacGetEventParamType() { return typeQDRgnHandle; } template<> inline EventParamType wxMacGetEventParamType() { return typeControlRef; } template<> inline EventParamType wxMacGetEventParamType() { return typeWindowRef; } @@ -299,17 +299,15 @@ public : virtual WXWidget GetWXWidget() const { return (WXWidget) m_controlRef; } - virtual void SetReference( URefCon data ); - virtual bool IsVisible() const; virtual void Raise(); - + virtual void Lower(); virtual void ScrollRect( const wxRect *rect, int dx, int dy ); - virtual void GetContentArea( int &left , int &top , int &width , int &height ) const; + 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; @@ -318,7 +316,7 @@ public : // where is in native window relative coordinates virtual void SetNeedsDisplay( const wxRect* where = NULL ); virtual bool GetNeedsDisplay() const; - + virtual bool CanFocus() const; // return true if successful virtual bool SetFocus(); @@ -326,14 +324,20 @@ public : void RemoveFromParent(); void Embed( wxWidgetImpl *parent ); - + void SetDefaultButton( bool isDefault ); void PerformClick(); void SetLabel( const wxString& title, wxFontEncoding encoding ); + void SetCursor( const wxCursor & cursor ); + void CaptureMouse(); + void ReleaseMouse(); + wxInt32 GetValue() const; void SetValue( wxInt32 v ); + wxBitmap GetBitmap() const; void SetBitmap( const wxBitmap& bitmap ); + void SetBitmapPosition( wxDirection dir ); void SetupTabs( const wxNotebook ¬ebook ); void GetBestRect( wxRect *r ) const; @@ -363,8 +367,9 @@ public : virtual OSStatus SendHICommand( UInt32 commandID , OptionBits inOptions = 0 ); - virtual SInt32 GetMaximum() const; - + virtual wxInt32 GetMaximum() const; + virtual wxInt32 GetMinimum() const; + virtual void SetValueAndRange( SInt32 value , SInt32 minimum , SInt32 maximum ); virtual void SetRange( SInt32 minimum , SInt32 maximum ); @@ -426,7 +431,7 @@ public : virtual void SuperChangedPosition(); - virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle ); + virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true ); virtual void SetBackgroundColour( const wxColour& col ); virtual ControlPartCode HandleKey( SInt16 keyCode, SInt16 charCode, EventModifiers modifiers ); void SetActionProc( ControlActionUPP actionProc ); @@ -446,18 +451,12 @@ public : virtual void GetFeatures( UInt32 *features ); - virtual OSStatus GetRegion( ControlPartCode partCode , RgnHandle region ); - + // to be moved into a tab control class virtual OSStatus SetTabEnabled( SInt16 tabNo , bool enable ); - void InstallEventHandler() - { - MacInstallEventHandler( m_controlRef, m_wxPeer ); - } - - static void MacInstallEventHandler( ControlRef control, wxWindowMac* wxPeer ); + virtual void InstallEventHandler( WXWidget control = NULL ); protected : WXEVENTHANDLERREF m_macControlEventHandler ; ControlRef m_controlRef; @@ -567,6 +566,8 @@ public : OSStatus SetHeaderDesc( DataBrowserPropertyID property, DataBrowserListViewHeaderDesc *desc ); OSStatus SetDisclosureColumn( DataBrowserPropertyID property , Boolean expandableRows ); + + OSStatus GetItemPartBounds( DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserPropertyPart part, Rect * bounds ); protected : static pascal void DataBrowserItemNotificationProc( @@ -641,7 +642,7 @@ public : } ; */ -class WXDLLIMPEXP_CORE wxMacDataItem +class WXDLLIMPEXP_CORE wxMacDataItem { public : wxMacDataItem(); @@ -736,22 +737,6 @@ public : public : - // item aware methods, to be used in subclasses - - virtual Boolean CompareItems(const wxMacDataItem* itemOneID, - const wxMacDataItem* itemTwoID, - DataBrowserPropertyID sortProperty); - - virtual OSStatus GetSetItemData(wxMacDataItem* itemID, - DataBrowserPropertyID property, - DataBrowserItemDataRef itemData, - Boolean changeValue ); - - virtual void ItemNotification( - const wxMacDataItem* itemID, - DataBrowserItemNotification message, - DataBrowserItemDataRef itemData); - // as we are getting the same events for human and API selection we have to suppress // events in the latter case, since this will be used from many subclasses we keep it here @@ -834,7 +819,7 @@ protected : class WXDLLIMPEXP_CORE wxMacDataBrowserColumn : public wxListWidgetColumn { public : - wxMacDataBrowserColumn( DataBrowserPropertyID propertyId, DataBrowserPropertyType colType, bool editable ) + wxMacDataBrowserColumn( DataBrowserPropertyID propertyId, DataBrowserPropertyType colType, bool editable ) : m_property(propertyId), m_editable(editable), m_type( colType ) { } @@ -842,9 +827,9 @@ public : { } DataBrowserPropertyID GetProperty() const { return m_property ; } - + bool IsEditable() const { return m_editable; } - + DataBrowserPropertyType GetType() const { return m_type; } protected : @@ -861,11 +846,12 @@ class WXDLLIMPEXP_CORE wxMacDataBrowserCellValue : public wxListWidgetCellValue public : wxMacDataBrowserCellValue(DataBrowserItemDataRef data) : m_data(data) {} virtual ~wxMacDataBrowserCellValue() {} - - virtual void Set( CFStringRef value ); + + virtual void Set( CFStringRef value ); virtual void Set( const wxString& value ); virtual void Set( int value ) ; - + virtual void Check( bool check ); + virtual int GetIntValue() const ; virtual wxString GetStringValue() const ; protected : @@ -884,10 +870,10 @@ public: wxListWidgetColumn* InsertTextColumn( unsigned int pos, const wxString& title, bool editable = false, wxAlignment just = wxALIGN_LEFT , int defaultWidth = -1) ; - wxListWidgetColumn* InsertCheckColumn( unsigned int pos , const wxString& title, bool editable = false, + wxListWidgetColumn* InsertCheckColumn( unsigned int pos , const wxString& title, bool editable = false, wxAlignment just = wxALIGN_LEFT , int defaultWidth = -1) ; - wxMacDataBrowserColumn* DoInsertColumn( unsigned int pos, DataBrowserPropertyID property, + wxMacDataBrowserColumn* DoInsertColumn( unsigned int pos, DataBrowserPropertyID property, const wxString& title, bool editable, DataBrowserPropertyType colType, SInt16 just, int width ); // add and remove @@ -915,14 +901,16 @@ public: virtual void UpdateLine( unsigned int n, wxListWidgetColumn* col = NULL ); virtual void UpdateLineToEnd( unsigned int n) ; + // pointing back + + wxMacDataBrowserColumn* GetColumnFromProperty( DataBrowserPropertyID ); + +protected: virtual void ItemNotification( - const wxMacDataItem* itemID, + DataBrowserItemID itemID, DataBrowserItemNotification message, DataBrowserItemDataRef itemData); - // pointing back - - wxMacDataBrowserColumn* GetColumnFromProperty( DataBrowserPropertyID ); private: wxArrayMacDataBrowserColumns m_columns; int m_nextColumnId ; @@ -961,8 +949,7 @@ UPP Get##x() \ void wxMacSetupConverters(); void wxMacCleanupConverters(); -WXDLLIMPEXP_BASE void wxMacStringToPascal( const wxString&from , StringPtr to ); -WXDLLIMPEXP_BASE wxString wxMacMakeStringFromPascal( ConstStringPtr from ); +// utils.cpp // filefn.cpp @@ -1017,51 +1004,54 @@ public : wxNonOwnedWindowCarbonImpl( wxNonOwnedWindow* nonownedwnd) ; wxNonOwnedWindowCarbonImpl(); virtual ~wxNonOwnedWindowCarbonImpl(); - + virtual void Destroy() ; void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size, long style, long extraStyle, const wxString& name ) ; - + WXWindow GetWXWindow() const; - void Raise(); + void Raise(); void Lower(); - bool Show(bool show); + bool Show(bool show); bool ShowWithEffect(bool show, wxShowEffect effect, unsigned timeout); - + void Update(); bool SetTransparent(wxByte alpha); bool SetBackgroundColour(const wxColour& col ); - void SetExtraStyle( long exStyle ); - bool SetBackgroundStyle(wxBackgroundStyle style); + void SetExtraStyle( long exStyle ); + bool SetBackgroundStyle(wxBackgroundStyle style); 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; - void GetContentArea( int &left , int &top , int &width , int &height ) const; + void GetContentArea( int &left , int &top , int &width , int &height ) const; bool SetShape(const wxRegion& region); virtual void SetTitle( const wxString& title, wxFontEncoding encoding ) ; - + virtual bool IsMaximized() const; - + virtual bool IsIconized() const; - + virtual void Iconize( bool iconize ); - + virtual void Maximize(bool maximize); - + virtual bool IsFullScreen() const; - + virtual bool ShowFullScreen(bool show, long style); + + virtual void ShowWithoutActivating(); virtual void RequestUserAttention(int flags); - + virtual void ScreenToWindow( int *x, int *y ); - + virtual void WindowToScreen( int *x, int *y ); - + virtual bool IsActive(); + bool MacGetUnifiedAppearance() const ; void MacChangeWindowAttributes( wxUint32 attributesToSet , wxUint32 attributesToClear ) ; @@ -1069,18 +1059,18 @@ public : void MacSetMetalAppearance( bool set ) ; bool MacGetMetalAppearance() const ; void MacSetUnifiedAppearance( bool set ); - + WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; } wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; } protected : void MacInstallTopLevelWindowEventHandler(); - + WXEVENTHANDLERREF m_macEventHandler ; WindowRef m_macWindow; void * m_macFullScreenData ; - DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowCarbonImpl) -}; + DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowCarbonImpl) +}; #endif // wxUSE_GUI