]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/utils.cpp
Enable graphics context by default
[wxWidgets.git] / src / osx / carbon / utils.cpp
index 70304470394b2d1ac226d2a7b3b37b4d6431e016..a1015f90c20d5768c8ab30adc1784a24d70695bc 100644 (file)
@@ -259,6 +259,27 @@ void wxMacNativeToPoint( const Point *n , wxPoint* wx )
     wx->y = n->v;
 }
 
     wx->y = n->v;
 }
 
+//---------------------------------------------------------------------------
+// wxMac Specific string utility functions
+//---------------------------------------------------------------------------
+
+void wxMacStringToPascal( const wxString&from , StringPtr to )
+{
+    wxCharBuffer buf = from.mb_str( wxConvLocal );
+    int len = strlen(buf);
+
+    if ( len > 255 )
+        len = 255;
+    to[0] = len;
+    memcpy( (char*) &to[1] , buf , len );
+}
+
+wxString wxMacMakeStringFromPascal( ConstStringPtr from )
+{
+    return wxString( (char*) &from[1] , wxConvLocal , from[0] );
+}
+
+
 // ----------------------------------------------------------------------------
 // Carbon Event Support
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // Carbon Event Support
 // ----------------------------------------------------------------------------