From aa6208d975c3757d75d780c661b4d7918236f4fb Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 24 Mar 2009 07:56:17 +0000 Subject: [PATCH] conforming to new naming convention of starting all port specific methods with the port prefix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59804 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/fontutil.h | 2 +- include/wx/osx/font.h | 17 ++++++++++------- src/generic/graphicc.cpp | 2 +- src/osx/carbon/font.cpp | 16 ++++++++-------- src/osx/carbon/fontdlg.cpp | 2 +- src/osx/carbon/graphics.cpp | 10 +++++----- src/osx/carbon/listctrl_mac.cpp | 2 +- src/osx/carbon/utilscocoa.mm | 6 +++--- src/osx/carbon/window.cpp | 2 +- src/osx/cocoa/window.mm | 2 +- 10 files changed, 32 insertions(+), 29 deletions(-) diff --git a/include/wx/fontutil.h b/include/wx/fontutil.h index 050e470fa0..e12c021a34 100644 --- a/include/wx/fontutil.h +++ b/include/wx/fontutil.h @@ -172,7 +172,7 @@ public: #if wxOSX_USE_COCOA WX_NSFontDescriptor m_nsFontDescriptor; - void ValidateNSFontDescriptor(); + void OSXValidateNSFontDescriptor(); #endif #if wxOSX_USE_IPHONE #endif diff --git a/include/wx/osx/font.h b/include/wx/osx/font.h index f3410c1fbb..03352c0144 100644 --- a/include/wx/osx/font.h +++ b/include/wx/osx/font.h @@ -128,22 +128,25 @@ public: #if wxOSX_USE_CARBON && wxOSX_USE_ATSU_TEXT wxUint16 MacGetThemeFontID() const ; + // 'old' Quickdraw accessors short MacGetFontNum() const; wxByte MacGetFontStyle() const; #endif #if wxOSX_USE_COCOA_OR_CARBON - CGFontRef GetCGFont() const; + CGFontRef OSXGetCGFont() const; #endif #if wxOSX_USE_CORE_TEXT - CTFontRef GetCTFont() const; + CTFontRef OSXGetCTFont() const; #endif #if wxOSX_USE_ATSU_TEXT // Returns an ATSUStyle not ATSUStyle* void* MacGetATSUStyle() const ; + void* OSXGetATSUStyle() const { return MacGetATSUStyle() ; } + #if WXWIN_COMPATIBILITY_2_8 wxDEPRECATED( wxUint32 MacGetATSUFontID() const ); wxDEPRECATED( wxUint32 MacGetATSUAdditionalQDStyles() const ); @@ -151,14 +154,14 @@ public: #endif #if wxOSX_USE_COCOA - WX_NSFont GetNSFont() const; - static WX_NSFont CreateNSFont(wxOSXSystemFont font, wxNativeFontInfo* info); - static WX_NSFont CreateNSFont(const wxNativeFontInfo* info); + WX_NSFont OSXGetNSFont() const; + static WX_NSFont OSXCreateNSFont(wxOSXSystemFont font, wxNativeFontInfo* info); + static WX_NSFont OSXCreateNSFont(const wxNativeFontInfo* info); #endif #if wxOSX_USE_IPHONE - WX_UIFont GetUIFont() const; - static WX_NSFont CreateUIFont(wxOSXSystemFont font, wxNativeFontInfo* info); + WX_UIFont OSXGetUIFont() const; + static WX_NSFont OSXCreateUIFont(wxOSXSystemFont font, wxNativeFontInfo* info); #endif protected: diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index 3a1c5bc01b..e2e63d632f 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -692,7 +692,7 @@ wxCairoFontData::wxCairoFontData( wxGraphicsRenderer* renderer, const wxFont &fo m_underlined = font.GetUnderlined(); #ifdef __WXMAC__ - m_font = cairo_quartz_font_face_create_for_cgfont( font.GetCGFont() ); + m_font = cairo_quartz_font_face_create_for_cgfont( font.OSXGetCGFont() ); #elif defined(__WXGTK__) m_font = pango_font_description_copy( font.GetNativeFontInfo()->description ); #else diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index d4925a90a3..f9b5bc90d2 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -384,10 +384,10 @@ wxFontRefData::wxFontRefData(wxOSXSystemFont font, int size) } #endif #if wxOSX_USE_COCOA - m_nsFont = wxFont::CreateNSFont( font, &m_info ); + m_nsFont = wxFont::OSXCreateNSFont( font, &m_info ); #endif #if wxOSX_USE_IPHONE - m_uiFont = wxFont::CreateUIFont( font, &m_info ); + m_uiFont = wxFont::OSXCreateUIFont( font, &m_info ); #endif } @@ -483,10 +483,10 @@ void wxFontRefData::MacFindFont() } #endif #if wxOSX_USE_COCOA - m_nsFont = wxFont::CreateNSFont( &m_info ); + m_nsFont = wxFont::OSXCreateNSFont( &m_info ); #endif #if wxOSX_USE_IPHONE - m_uiFont = wxFont::CreateUIFont( &m_info ); + m_uiFont = wxFont::OSXCreateUIFont( &m_info ); #endif m_fontValid = true; } @@ -799,7 +799,7 @@ wxUint32 wxFont::MacGetATSUAdditionalQDStyles() const #if wxOSX_USE_CORE_TEXT -CTFontRef wxFont::GetCTFont() const +CTFontRef wxFont::OSXGetCTFont() const { wxCHECK_MSG( M_FONTDATA != NULL , 0, wxT("invalid font") ); @@ -813,7 +813,7 @@ CTFontRef wxFont::GetCTFont() const #if wxOSX_USE_COCOA_OR_CARBON -CGFontRef wxFont::GetCGFont() const +CGFontRef wxFont::OSXGetCGFont() const { wxCHECK_MSG( M_FONTDATA != NULL , 0, wxT("invalid font") ); @@ -828,7 +828,7 @@ CGFontRef wxFont::GetCGFont() const #if wxOSX_USE_COCOA -NSFont* wxFont::GetNSFont() const +NSFont* wxFont::OSXGetNSFont() const { wxCHECK_MSG( M_FONTDATA != NULL , 0, wxT("invalid font") ); @@ -1057,7 +1057,7 @@ void wxNativeFontInfo::EnsureValid() #endif #if wxOSX_USE_COCOA if ( m_nsFontDescriptor == NULL ) - ValidateNSFontDescriptor(); + OSXValidateNSFontDescriptor(); #endif #if wxOSX_USE_IPHONE // TODO diff --git a/src/osx/carbon/fontdlg.cpp b/src/osx/carbon/fontdlg.cpp index 9846fffdc1..279c1370c7 100644 --- a/src/osx/carbon/fontdlg.cpp +++ b/src/osx/carbon/fontdlg.cpp @@ -232,7 +232,7 @@ int wxFontDialog::ShowModal() #if wxOSX_USE_CORE_TEXT if ( UMAGetSystemVersion() >= 0x1050 ) { - CTFontDescriptorRef descr = (CTFontDescriptorRef) CTFontCopyFontDescriptor( (CTFontRef) font.GetCTFont() ); + CTFontDescriptorRef descr = (CTFontDescriptorRef) CTFontCopyFontDescriptor( (CTFontRef) font.OSXGetCTFont() ); err = SetFontInfoForSelection (kFontSelectionCoreTextType,1, &descr , NULL); CFRelease( descr ); setup = true; diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index e81a541cb5..4bf733644a 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -171,7 +171,7 @@ CGColorRef wxMacCreateCGColor( const wxColour& col ) CTFontRef wxMacCreateCTFont( const wxFont& font ) { #ifdef __WXMAC__ - return wxCFRetain((CTFontRef) font.GetCTFont()); + return wxCFRetain((CTFontRef) font.OSXGetCTFont()); #else return CTFontCreateWithName( wxCFStringRef( font.GetFaceName(), wxLocale::GetSystemEncoding() ) , font.GetPointSize() , NULL ); #endif @@ -815,7 +815,7 @@ public: virtual ATSUStyle GetATSUStyle() { return m_macATSUIStyle; } #endif #if wxOSX_USE_CORE_TEXT - CTFontRef GetCTFont() const { return m_ctFont ; } + CTFontRef OSXGetCTFont() const { return m_ctFont ; } #endif wxColour GetColour() const { return m_colour ; } @@ -2165,7 +2165,7 @@ void wxMacCoreGraphicsContext::DoDrawText( const wxString &str, wxDouble x, wxDo { wxMacCoreGraphicsFontData* fref = (wxMacCoreGraphicsFontData*)m_font.GetRefData(); wxCFStringRef text(str, wxLocale::GetSystemEncoding() ); - CTFontRef font = fref->GetCTFont(); + CTFontRef font = fref->OSXGetCTFont(); CGColorRef col = wxMacCreateCGColor( fref->GetColour() ); CTUnderlineStyle ustyle = fref->GetUnderlined() ? kCTUnderlineStyleSingle : kCTUnderlineStyleNone ; wxCFRef underlined( CFNumberCreate(NULL, kCFNumberSInt32Type, &ustyle) ); @@ -2342,7 +2342,7 @@ void wxMacCoreGraphicsContext::GetTextExtent( const wxString &str, wxDouble *wid if ( UMAGetSystemVersion() >= 0x1050 ) { wxMacCoreGraphicsFontData* fref = (wxMacCoreGraphicsFontData*)m_font.GetRefData(); - CTFontRef font = fref->GetCTFont(); + CTFontRef font = fref->OSXGetCTFont(); wxCFStringRef text(str, wxLocale::GetSystemEncoding() ); CFStringRef keys[] = { kCTFontAttributeName }; @@ -2437,7 +2437,7 @@ void wxMacCoreGraphicsContext::GetPartialTextExtents(const wxString& text, wxArr #if wxOSX_USE_CORE_TEXT { wxMacCoreGraphicsFontData* fref = (wxMacCoreGraphicsFontData*)m_font.GetRefData(); - CTFontRef font = fref->GetCTFont(); + CTFontRef font = fref->OSXGetCTFont(); wxCFStringRef t(text, wxLocale::GetSystemEncoding() ); CFStringRef keys[] = { kCTFontAttributeName }; diff --git a/src/osx/carbon/listctrl_mac.cpp b/src/osx/carbon/listctrl_mac.cpp index 2f5c444d6d..58acffcf18 100644 --- a/src/osx/carbon/listctrl_mac.cpp +++ b/src/osx/carbon/listctrl_mac.cpp @@ -2853,7 +2853,7 @@ void wxMacDataBrowserListCtrlControl::DrawItem( if (font.Ok()) { info.fontID = kThemeSpecifiedFont; - info.font = (CTFontRef) font.GetCTFont(); + info.font = (CTFontRef) font.OSXGetCTFont(); setup = true; } } diff --git a/src/osx/carbon/utilscocoa.mm b/src/osx/carbon/utilscocoa.mm index 0b8eaa3618..aa7468ef84 100644 --- a/src/osx/carbon/utilscocoa.mm +++ b/src/osx/carbon/utilscocoa.mm @@ -93,7 +93,7 @@ void* wxMacCocoaRetain( void* obj ) #if wxOSX_USE_COCOA -WX_NSFont wxFont::CreateNSFont(wxOSXSystemFont font, wxNativeFontInfo* info) +WX_NSFont wxFont::OSXCreateNSFont(wxOSXSystemFont font, wxNativeFontInfo* info) { NSFont* nsfont = nil; switch( font ) @@ -154,7 +154,7 @@ WX_NSFont wxFont::CreateNSFont(wxOSXSystemFont font, wxNativeFontInfo* info) return nsfont; } -void wxNativeFontInfo::ValidateNSFontDescriptor() +void wxNativeFontInfo::OSXValidateNSFontDescriptor() { NSFontDescriptor* desc = [NSFontDescriptor fontDescriptorWithName:wxCFStringRef(m_faceName).AsNSString() size:m_pointSize]; NSFontSymbolicTraits traits = 0; @@ -172,7 +172,7 @@ void wxNativeFontInfo::ValidateNSFontDescriptor() m_nsFontDescriptor = desc; } -WX_NSFont wxFont::CreateNSFont(const wxNativeFontInfo* info) +WX_NSFont wxFont::OSXCreateNSFont(const wxNativeFontInfo* info) { NSFont* nsFont; nsFont = [NSFont fontWithDescriptor:info->m_nsFontDescriptor size:info->m_pointSize]; diff --git a/src/osx/carbon/window.cpp b/src/osx/carbon/window.cpp index af31a5cce9..e4ff772b8f 100644 --- a/src/osx/carbon/window.cpp +++ b/src/osx/carbon/window.cpp @@ -1228,7 +1228,7 @@ void wxMacControl::SetFont( const wxFont & font , const wxColour& foreground , l flush = kHIThemeTextHorizontalFlushCenter; else if ( ( windowStyle & wxALIGN_MASK ) & wxALIGN_RIGHT ) flush = kHIThemeTextHorizontalFlushRight; - HIViewSetTextFont( m_controlRef , part , (CTFontRef) font.GetCTFont() ); + HIViewSetTextFont( m_controlRef , part , (CTFontRef) font.OSXGetCTFont() ); HIViewSetTextHorizontalFlush( m_controlRef, part, flush ); if ( foreground != *wxBLACK || ignoreBlack == false ) diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 88eb273c59..399db3f0df 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -1352,7 +1352,7 @@ void wxWidgetCocoaImpl::SetControlSize( wxWindowVariant variant ) void wxWidgetCocoaImpl::SetFont(wxFont const& font, wxColour const&, long, bool) { if ([m_osxView respondsToSelector:@selector(setFont:)]) - [m_osxView setFont: font.GetNSFont()]; + [m_osxView setFont: font.OSXGetNSFont()]; } void wxWidgetCocoaImpl::InstallEventHandler( WXWidget control ) -- 2.45.2