]> git.saurik.com Git - wxWidgets.git/commitdiff
adapting init sequence for different osx platforms
authorStefan Csomor <csomor@advancedconcepts.ch>
Fri, 10 Jul 2009 17:46:05 +0000 (17:46 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Fri, 10 Jul 2009 17:46:05 +0000 (17:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61380 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/app.h
src/osx/carbon/app.cpp
src/osx/carbon/utilscocoa.mm

index 02710e57b1999bbf99c7649ebacfe5bb77a636c6..d075cb84315bdd51999b55bf03c410b4708924ad 100644 (file)
@@ -50,6 +50,10 @@ class WXDLLIMPEXP_CORE wxApp: public wxAppBase
     virtual bool OnInitGui();
 #endif // wxUSE_GUI
 
+#ifdef __WXOSX_IPHONE__
+    virtual int OnRun();
+#endif
+
     virtual bool ProcessIdle();
 
     // implementation only
index 6acca9a02d731e8ff27dae809adab4fbbe8d01be..8b8345022c19b46de977a617cf6b5c6bef9388a7 100644 (file)
@@ -841,11 +841,13 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
     return true;
 }
 
+#if wxOSX_USE_COCOA_OR_CARBON
 bool wxApp::CallOnInit()
 {
     wxMacAutoreleasePool autoreleasepool;
     return OnInit();
 }
+#endif
 
 bool wxApp::OnInitGui()
 {
index 25ec0b1e7eb8f8aceeb147ff9cdac820a3f0d2c0..1c2ec0dc70fc6a4c044e02b09f76afd19e20e7cc 100644 (file)
@@ -249,7 +249,7 @@ WX_UIFont wxFont::OSXCreateUIFont(wxOSXSystemFont font, wxNativeFontInfo* info)
         if ( traits & NSFontItalicTrait )
             fontstyle = wxFONTSTYLE_ITALIC ;
         */
-        wxCFStringRef fontname( [uifont familyName] );
+        wxCFStringRef fontname( wxCFRetain([uifont familyName]) );
         info->Init(size,wxFONTFAMILY_DEFAULT,fontstyle,fontweight,underlined,
             fontname.AsString(), wxFONTENCODING_DEFAULT);
         
@@ -270,6 +270,17 @@ WX_UIFont wxFont::OSXCreateUIFont(const wxNativeFontInfo* info)
 // NSImage Utils
 // ----------------------------------------------------------------------------
 
+#if wxOSX_USE_IPHONE
+
+WX_UIImage  wxOSXCreateUIImageFromCGImage( CGImageRef image )
+{
+    UIImage  *newImage = [UIImage imageWithCGImage:image]; 
+    [newImage autorelease];
+    return( newImage );
+}
+
+#endif
+
 #if wxOSX_USE_COCOA
 
 //  From "Cocoa Drawing Guide:Working with Images"