making NSString conversion functions available in private.h
This commit is contained in:
@@ -500,6 +500,11 @@ extern ClassicCursor gMacCursors[];
|
|||||||
|
|
||||||
extern NSLayoutManager* gNSLayoutManager;
|
extern NSLayoutManager* gNSLayoutManager;
|
||||||
|
|
||||||
|
// NSString<->wxString
|
||||||
|
|
||||||
|
wxString wxStringWithNSString(NSString *nsstring);
|
||||||
|
NSString* wxNSStringWithWxString(const wxString &wxstring);
|
||||||
|
|
||||||
#endif // wxUSE_GUI
|
#endif // wxUSE_GUI
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -93,30 +93,6 @@ wxWebKitNewWindowEvent::wxWebKitNewWindowEvent( wxWindow* win )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// helper functions for NSString<->wxString conversion
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
inline wxString wxStringWithNSString(NSString *nsstring)
|
|
||||||
{
|
|
||||||
#if wxUSE_UNICODE
|
|
||||||
return wxString([nsstring UTF8String], wxConvUTF8);
|
|
||||||
#else
|
|
||||||
return wxString([nsstring lossyCString]);
|
|
||||||
#endif // wxUSE_UNICODE
|
|
||||||
}
|
|
||||||
|
|
||||||
inline NSString* wxNSStringWithWxString(const wxString &wxstring)
|
|
||||||
{
|
|
||||||
#if wxUSE_UNICODE
|
|
||||||
return [NSString stringWithUTF8String: wxstring.mb_str(wxConvUTF8)];
|
|
||||||
#else
|
|
||||||
return [NSString stringWithCString: wxstring.c_str() length:wxstring.Len()];
|
|
||||||
#endif // wxUSE_UNICODE
|
|
||||||
}
|
|
||||||
|
|
||||||
inline int wxNavTypeFromWebNavType(int type){
|
inline int wxNavTypeFromWebNavType(int type){
|
||||||
if (type == WebNavigationTypeLinkClicked)
|
if (type == WebNavigationTypeLinkClicked)
|
||||||
return wxWEBKIT_NAV_LINK_CLICKED;
|
return wxWEBKIT_NAV_LINK_CLICKED;
|
||||||
|
@@ -562,5 +562,27 @@ void wxMacCocoaShowCursor()
|
|||||||
[NSCursor unhide];
|
[NSCursor unhide];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------
|
||||||
|
// helper functions for NSString<->wxString conversion
|
||||||
|
//---------------------------------------------------------
|
||||||
|
|
||||||
|
wxString wxStringWithNSString(NSString *nsstring)
|
||||||
|
{
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
return wxString([nsstring UTF8String], wxConvUTF8);
|
||||||
|
#else
|
||||||
|
return wxString([nsstring lossyCString]);
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
|
}
|
||||||
|
|
||||||
|
NSString* wxNSStringWithWxString(const wxString &wxstring)
|
||||||
|
{
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
return [NSString stringWithUTF8String: wxstring.mb_str(wxConvUTF8)];
|
||||||
|
#else
|
||||||
|
return [NSString stringWithCString: wxstring.c_str() length:wxstring.Len()];
|
||||||
|
#endif // wxUSE_UNICODE
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user