X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c16b215350e25bf65a36323d5ba0d9ecdeffa03c..b3cec67186d678d2c3985923bdb8c787455cf369:/src/osx/iphone/utils.mm diff --git a/src/osx/iphone/utils.mm b/src/osx/iphone/utils.mm index ba3bcf967c..565f345f3d 100644 --- a/src/osx/iphone/utils.mm +++ b/src/osx/iphone/utils.mm @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/mac/cocoa/utils.mm +// Name: src/osx/cocoa/utils.mm // Purpose: various cocoa utility functions // Author: Stefan Csomor // Modified by: @@ -82,6 +82,15 @@ int wxApp::OnRun() return 1; } +bool wxApp::DoInitGui() +{ + return true; +} + +void wxApp::DoCleanUp() +{ +} + void wxMacWakeUp() { // TODO @@ -136,7 +145,7 @@ void wxClientDisplayRect(int *x, int *y, int *width, int *height) *width = r.size.width; if ( height ) *height = r.size.height; - + } void wxGetMousePosition( int* x, int* y ) @@ -154,7 +163,7 @@ int wxDisplayDepth() void wxDisplaySize(int *width, int *height) { CGRect bounds = [[UIScreen mainScreen] bounds]; - + if ( width ) *width = (int)bounds.size.width ; if ( height ) @@ -215,21 +224,21 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const // call this method when a Blit is performed with it as a source. if (!m_window) return wxNullBitmap; - + wxSize sz = m_window->GetSize(); - + int left = subrect != NULL ? subrect->x : 0 ; int top = subrect != NULL ? subrect->y : 0 ; int width = subrect != NULL ? subrect->width : sz.x; int height = subrect != NULL ? subrect->height : sz.y ; - + wxBitmap bmp = wxBitmap(width, height, 32); - + CGContextRef context = (CGContextRef)bmp.GetHBITMAP(); - + CGContextSaveGState(context); - - + + CGContextTranslateCTM( context, 0, height ); CGContextScaleCTM( context, 1, -1 ); @@ -251,10 +260,11 @@ wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin) // get OS version int major, minor; - wxString release = wxCFStringRef( [ [UIDevice currentDevice] systemVersion] ).AsString() ; + wxString release = wxCFStringRef( wxCFRetain( [ [UIDevice currentDevice] systemVersion] ) ).AsString() ; if ( release.empty() || - wxSscanf(release.c_str(), wxT("%d.%d"), &major, &minor) != 2 ) + // TODO use wx method + scanf(release.c_str(), wxT("%d.%d"), &major, &minor) != 2 ) { // failed to get version string or unrecognized format major = @@ -271,7 +281,7 @@ wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin) wxString wxGetOsDescription() { - wxString release = wxCFStringRef( [ [UIDevice currentDevice] systemName] ).AsString() ; + wxString release = wxCFStringRef( wxCFRetain([ [UIDevice currentDevice] systemName] )).AsString() ; return release; }