]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/mac/carbon/private.h
minor cleanup
[wxWidgets.git] / include / wx / mac / carbon / private.h
index 88f511356413ceac0911e9eb434a98948e5f38a6..9e57b5f43a1d4518e7556fb7f846d061d8c17c8d 100644 (file)
@@ -216,6 +216,10 @@ template<> inline EventParamType wxMacGetEventParamType<EventRef>() { return typ
 template<> inline EventParamType wxMacGetEventParamType<Point>() { return typeQDPoint ; }
 template<> inline EventParamType wxMacGetEventParamType<Rect>() { return typeQDRectangle ; }
 template<> inline EventParamType wxMacGetEventParamType<Boolean>() { return typeBoolean ; }
+template<> inline EventParamType wxMacGetEventParamType<SInt16>() { return typeSInt16 ; }
+template<> inline EventParamType wxMacGetEventParamType<SInt32>() { return typeSInt32 ; }
+template<> inline EventParamType wxMacGetEventParamType<UInt32>() { return typeUInt32 ; }
+template<> inline EventParamType wxMacGetEventParamType<RGBColor>() { return typeRGBColor ; }
 #if TARGET_API_MAC_OSX
 template<> inline EventParamType wxMacGetEventParamType<HICommand>() { return typeHICommand ; }
 template<> inline EventParamType wxMacGetEventParamType<HIPoint>() { return typeHIPoint ; }
@@ -223,6 +227,7 @@ template<> inline EventParamType wxMacGetEventParamType<HISize>() { return typeH
 template<> inline EventParamType wxMacGetEventParamType<HIRect>() { return typeHIRect ; }
 template<> inline EventParamType wxMacGetEventParamType<void*>() { return typeVoidPtr ; }
 #endif
+template<> inline EventParamType wxMacGetEventParamType<CFDictionaryRef>() { return typeCFDictionaryRef ; }
 template<> inline EventParamType wxMacGetEventParamType<Collection>() { return typeCollection ; }
 template<> inline EventParamType wxMacGetEventParamType<CGContextRef>() { return typeCGContextRef ; }
 /*
@@ -463,6 +468,10 @@ wxWindow *              wxFindControlFromMacControl(ControlRef inControl ) ;
 wxTopLevelWindowMac*    wxFindWinFromMacWindow( WindowRef inWindow ) ;
 wxMenu*                 wxFindMenuFromMacMenu(MenuRef inMenuRef) ;
 
+int                     wxMacCommandToId( UInt32 macCommandId ) ;
+UInt32                  wxIdToMacCommand( int wxId ) ;
+wxMenu*                 wxFindMenuFromMacCommand( const HICommand &macCommandId , wxMenuItem* &item ) ;
+
 extern wxWindow* g_MacLastWindow ;
 pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) ;
 Rect wxMacGetBoundsForControl( wxWindow* window , const wxPoint& pos , const wxSize &size , bool adjustForOrigin = true ) ;
@@ -534,6 +543,14 @@ public :
     {
         return SetData( inPartCode , inTag , sizeof( T ) , &data ) ;
     }
+    template <typename T> OSStatus SetData( ResType inTag , const T *data )
+    {
+        return SetData( kControlEntireControl , inTag , sizeof( T ) , data ) ;
+    }
+    template <typename T> OSStatus SetData( ResType inTag , const T& data )
+    {
+        return SetData( kControlEntireControl , inTag , sizeof( T ) , &data ) ;
+    }
     template <typename T> OSStatus GetData( ControlPartCode inPartCode , ResType inTag , T *data ) const
     {
         Size dummy ;
@@ -545,7 +562,18 @@ public :
         verify_noerr( GetData<T>( inPartCode , inTag , &value ) ) ;
         return value ;
     }
-
+    template <typename T> OSStatus GetData( ResType inTag , T *data ) const
+    {
+        Size dummy ;
+        return GetData( kControlEntireControl , inTag , sizeof( T ) , data , &dummy ) ;
+    }
+    template <typename T> T GetData( ResType inTag ) const
+    {
+        T value ;
+        verify_noerr( GetData<T>( kControlEntireControl , inTag , &value ) ) ;
+        return value ;
+    }
+    
     // Flash the control for the specified amount of time
     virtual void Flash( ControlPartCode part , UInt32 ticks = 8 ) ;
 
@@ -807,6 +835,19 @@ private :
 
 ControlRef wxMacFindControlUnderMouse( wxTopLevelWindowMac* toplevelWindow, const Point& location , WindowRef window , ControlPartCode *outPart ) ;
 
+#if WORDS_BIGENDIAN
+    inline Rect* wxMacGetPictureBounds( PicHandle pict , Rect* rect ) 
+    { 
+       *rect = (**pict).picFrame ; 
+        return rect ;
+    }
+#else
+    inline Rect* wxMacGetPictureBounds( PicHandle pict , Rect* rect ) 
+    {   
+        return QDGetPictureBounds( pict , rect ) ;
+    }
+#endif
+
 #endif // wxUSE_GUI
 
 #define wxMAC_DEFINE_PROC_GETTER( UPP , x ) \