From cf4ce62c26bcbd5a707e3054f611d0164617b012 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 10 Jul 2009 17:46:05 +0000 Subject: [PATCH] adapting init sequence for different osx platforms git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61380 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/osx/app.h | 4 ++++ src/osx/carbon/app.cpp | 2 ++ src/osx/carbon/utilscocoa.mm | 13 ++++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/include/wx/osx/app.h b/include/wx/osx/app.h index 02710e57b1..d075cb8431 100644 --- a/include/wx/osx/app.h +++ b/include/wx/osx/app.h @@ -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 diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index 6acca9a02d..8b8345022c 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -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() { diff --git a/src/osx/carbon/utilscocoa.mm b/src/osx/carbon/utilscocoa.mm index 25ec0b1e7e..1c2ec0dc70 100644 --- a/src/osx/carbon/utilscocoa.mm +++ b/src/osx/carbon/utilscocoa.mm @@ -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" -- 2.45.2