From b46f221ff3a68c8f3a14ac6a67eb4923c266faf8 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 30 Jul 2008 15:01:58 +0000 Subject: [PATCH] OSX reshuffling git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/osx/carbon/chkconf.h | 220 ++------------------------------ include/wx/osx/carbon/colour.h | 6 +- include/wx/osx/carbon/evtloop.h | 6 +- include/wx/osx/carbon/font.h | 8 +- include/wx/osx/carbon/fontdlg.h | 15 ++- include/wx/osx/carbon/toolbar.h | 4 +- 6 files changed, 37 insertions(+), 222 deletions(-) diff --git a/include/wx/osx/carbon/chkconf.h b/include/wx/osx/carbon/chkconf.h index 0eb63ba884..14673bf987 100644 --- a/include/wx/osx/carbon/chkconf.h +++ b/include/wx/osx/carbon/chkconf.h @@ -1,5 +1,5 @@ /* - * Name: wx/mac/chkconf.h + * Name: wx/osx/carbon/chkconf.h * Purpose: Compiler-specific configuration checking * Author: Julian Smart * Modified by: @@ -9,236 +9,44 @@ * Licence: wxWindows licence */ -#ifndef _WX_MAC_CHKCONF_H_ -#define _WX_MAC_CHKCONF_H_ - -/* - * disable the settings which don't work for some compilers - */ - -#if defined(__MWERKS__) - #undef wxUSE_DEBUG_NEW_ALWAYS - #define wxUSE_DEBUG_NEW_ALWAYS 0 - - /* DS: Fixes compilation when wxUSE_ON_FATAL_EXCEPTION is 1 */ - #ifndef wxTYPE_SA_HANDLER - #define wxTYPE_SA_HANDLER int - #endif -#endif - -/* - * use OS X CoreGraphics (1) or QuickDraw (0) for rendering - */ - -#ifndef wxOSX_USE_CORE_GRAPHICS - #define wxOSX_USE_CORE_GRAPHICS 1 -#endif - -/* - * wxOSX_USE_CORE_GRAPHICS is now implemented in terms of wxUSE_GRAPHICS_CONTEXT - */ - -#if wxOSX_USE_CORE_GRAPHICS - #undef wxUSE_GRAPHICS_CONTEXT - #define wxUSE_GRAPHICS_CONTEXT 1 -#endif - -/* - * check graphics context option - */ -#if wxUSE_GRAPHICS_CONTEXT && !wxOSX_USE_CORE_GRAPHICS -# error "wxUSE_GRAPHICS_CONTEXT on wxMac requires wxOSX_USE_CORE_GRAPHICS" -#endif +#ifndef _WX_OSX_CARBON_CHKCONF_H_ +#define _WX_OSX_CARBON_CHKCONF_H_ /* * native (1) or emulated (0) toolbar + * also support old notation wxMAC_USE_NATIVE_TOOLBAR */ -#ifndef wxMAC_USE_NATIVE_TOOLBAR - #define wxMAC_USE_NATIVE_TOOLBAR 1 -#endif - -/* - * using mixins of cocoa functionality - */ - -#ifndef wxOSX_USE_COCOA - #define wxOSX_USE_COCOA 0 -#endif -/* - * setting flags according to the platform - */ - -#ifdef __LP64__ - #if wxOSX_USE_COCOA == 0 - #undef wxOSX_USE_COCOA - #define wxOSX_USE_COCOA 1 - #endif - #define wxOSX_USE_QUICKDRAW 0 - #define wxOSX_USE_CARBON 0 - #define wxOSX_USE_IPHONE 0 -#else - #ifdef __WXOSX_IPHONE__ - #define wxOSX_USE_QUICKDRAW 0 - #define wxOSX_USE_CARBON 0 - #define wxOSX_USE_IPHONE 1 - #else - #define wxOSX_USE_IPHONE 0 - #if wxOSX_USE_COCOA - #define wxOSX_USE_QUICKDRAW 0 - #define wxOSX_USE_CARBON 0 - #else - #define wxOSX_USE_QUICKDRAW 1 - #define wxOSX_USE_CARBON 1 - #endif - #endif -#endif -#if wxOSX_USE_COCOA || wxOSX_USE_CARBON - #define wxOSX_USE_COCOA_OR_CARBON 1 -#else - #define wxOSX_USE_COCOA_OR_CARBON 0 +#ifdef wxMAC_USE_NATIVE_TOOLBAR + #define wxOSX_USE_NATIVE_TOOLBAR wxMAC_USE_NATIVE_TOOLBAR #endif -#if wxOSX_USE_COCOA || wxOSX_USE_IPHONE - #define wxOSX_USE_COCOA_OR_IPHONE 1 -#else - #define wxOSX_USE_COCOA_OR_IPHONE 0 +#ifndef wxOSX_USE_NATIVE_TOOLBAR + #define wxOSX_USE_NATIVE_TOOLBAR 1 #endif /* * text rendering system */ -/* we have different options and we turn on all that make sense - * under a certain platform - */ - -#ifdef __WXOSX_IPHONE__ - #define wxMAC_USE_CG_TEXT 1 - #define wxMAC_USE_CORE_TEXT 0 - #define wxMAC_USE_ATSU_TEXT 0 -#else // !__WXOSX_IPHONE__ - #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 - #define wxMAC_USE_CORE_TEXT 1 - #define wxMAC_USE_ATSU_TEXT 0 - #define wxMAC_USE_CG_TEXT 0 + #define wxOSX_USE_CORE_TEXT 1 + #define wxOSX_USE_ATSU_TEXT 0 #else // platform < 10.5 - #define wxMAC_USE_CG_TEXT 0 - #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 - #define wxMAC_USE_CORE_TEXT 1 + #define wxOSX_USE_CORE_TEXT 1 #else - #define wxMAC_USE_CORE_TEXT 0 + #define wxOSX_USE_CORE_TEXT 0 #endif - #define wxMAC_USE_ATSU_TEXT 1 + #define wxOSX_USE_ATSU_TEXT 1 #endif -#endif // !__WXOSX_IPHONE__ - -/* - * turning off capabilities that don't work under 64 bit yet - */ - -#if wxOSX_USE_COCOA_OR_IPHONE - -#if wxUSE_MDI -#undef wxUSE_MDI -#define wxUSE_MDI 0 -#endif - -#if wxUSE_MDI_ARCHITECTURE -#undef wxUSE_MDI_ARCHITECTURE -#define wxUSE_MDI_ARCHITECTURE 0 -#endif - -#if wxUSE_DRAG_AND_DROP -#undef wxUSE_DRAG_AND_DROP -#define wxUSE_DRAG_AND_DROP 0 -#endif - -#if wxUSE_TASKBARICON -#undef wxUSE_TASKBARICON -#define wxUSE_TASKBARICON 0 -#endif - -#if wxUSE_TOOLTIPS -#undef wxUSE_TOOLTIPS -#define wxUSE_TOOLTIPS 0 -#endif - -#if wxUSE_DATAVIEWCTRL -#undef wxUSE_DATAVIEWCTRL -#define wxUSE_DATAVIEWCTRL 0 -#endif - -#if wxUSE_DRAG_AND_DROP -#undef wxUSE_DRAG_AND_DROP -#define wxUSE_DRAG_AND_DROP 0 -#endif - -#if wxUSE_TASKBARICON -#undef wxUSE_TASKBARICON -#define wxUSE_TASKBARICON 0 -#endif - -/* -#if wxUSE_POPUPWIN -#undef wxUSE_POPUPWIN -#define wxUSE_POPUPWIN 0 -#endif - -#if wxUSE_COMBOBOX -#undef wxUSE_COMBOBOX -#define wxUSE_COMBOBOX 0 -#endif - - -#if wxUSE_MENUS -#undef wxUSE_MENUS -#define wxUSE_MENUS 0 -#endif - -#if wxUSE_CALENDARCTRL -#undef wxUSE_CALENDARCTRL -#define wxUSE_CALENDARCTRL 0 -#endif - -#if wxUSE_WXHTML_HELP -#undef wxUSE_WXHTML_HELP -#define wxUSE_WXHTML_HELP 0 -#endif - -#if wxUSE_DOC_VIEW_ARCHITECTURE -#undef wxUSE_DOC_VIEW_ARCHITECTURE -#define wxUSE_DOC_VIEW_ARCHITECTURE 0 -#endif - -#if wxUSE_PRINTING_ARCHITECTURE -#undef wxUSE_PRINTING_ARCHITECTURE -#define wxUSE_PRINTING_ARCHITECTURE 0 -#endif - -*/ - - -#endif // wxOSX_USE_COCOA_OR_IPHON - -#if wxOSX_USE_IPHONE - -#if wxUSE_CLIPBOARD -#undef wxUSE_CLIPBOARD -#define wxUSE_CLIPBOARD 0 -#endif // wxUSE_CLIPBOARD - -#endif //wxOSX_USE_IPHONE - #endif - /* _WX_MAC_CHKCONF_H_ */ + /* _WX_OSX_CARBON_CHKCONF_H_ */ diff --git a/include/wx/osx/carbon/colour.h b/include/wx/osx/carbon/colour.h index 1cc69f3984..c24aedc939 100644 --- a/include/wx/osx/carbon/colour.h +++ b/include/wx/osx/carbon/colour.h @@ -47,14 +47,14 @@ public: CGColorRef GetCGColor() const { return m_cgColour; }; CGColorRef CreateCGColor() const { return wxCFRetain( (CGColorRef)m_cgColour ); }; -#if wxOSX_USE_QUICKDRAW +#if wxOSX_USE_CARBON void GetRGBColor( RGBColor *col ) const; #endif // Mac-specific ctor and assignment operator from the native colour // assumes ownership of CGColorRef wxColour( CGColorRef col ); -#if wxOSX_USE_QUICKDRAW +#if wxOSX_USE_CARBON wxColour(const RGBColor& col); wxColour& operator=(const RGBColor& col); #endif @@ -64,7 +64,7 @@ public: protected : virtual void InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a); -#if wxOSX_USE_QUICKDRAW +#if wxOSX_USE_CARBON void InitRGBColor( const RGBColor& col ); #endif void InitCGColorRef( CGColorRef col ); diff --git a/include/wx/osx/carbon/evtloop.h b/include/wx/osx/carbon/evtloop.h index 5cf323876d..dd8a6b448a 100644 --- a/include/wx/osx/carbon/evtloop.h +++ b/include/wx/osx/carbon/evtloop.h @@ -12,7 +12,7 @@ #ifndef _WX_MAC_CARBON_EVTLOOP_H_ #define _WX_MAC_CARBON_EVTLOOP_H_ -// set wxMAC_USE_RUN_APP_EVENT_LOOP to 1 if the standard +// set wxOSX_USE_RUN_APP_EVENT_LOOP to 1 if the standard // RunApplicationEventLoop function should be used, otherwise // the lower level CarbonEventLoop will be used // @@ -21,13 +21,13 @@ // events etc and perhaps we will also have to pipe events through an // ueber-event-handler to make sure we have one place to do all these // house-keeping functions -#define wxMAC_USE_RUN_APP_EVENT_LOOP 0 +#define wxOSX_USE_RUN_APP_EVENT_LOOP 0 // ---------------------------------------------------------------------------- // wxEventLoop // ---------------------------------------------------------------------------- -#if wxMAC_USE_RUN_APP_EVENT_LOOP +#if wxOSX_USE_RUN_APP_EVENT_LOOP class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxEventLoopBase { diff --git a/include/wx/osx/carbon/font.h b/include/wx/osx/carbon/font.h index 3962e4b287..a9f62f22c9 100644 --- a/include/wx/osx/carbon/font.h +++ b/include/wx/osx/carbon/font.h @@ -51,7 +51,7 @@ public: bool Create(const wxNativeFontInfo& info); bool MacCreateFromThemeFont( wxUint16 themeFontID ) ; -#if wxMAC_USE_CORE_TEXT +#if wxOSX_USE_CORE_TEXT bool MacCreateFromUIFont( wxUint32 coreTextFontType ); bool MacCreateFromCTFontDescriptor( const void * ctFontDescriptor, int pointSize = 0 ); bool MacCreateFromCTFont( const void * ctFont ); @@ -89,7 +89,7 @@ public: // Mac-specific, risks to change, don't use in portable code -#if wxMAC_USE_ATSU_TEXT +#if wxOSX_USE_ATSU_TEXT // 'old' Quickdraw accessors short MacGetFontNum() const; short MacGetFontSize() const; @@ -102,11 +102,11 @@ public: // Returns an ATSUStyle not ATSUStyle* #endif -#if wxMAC_USE_CORE_TEXT +#if wxOSX_USE_CORE_TEXT const void * MacGetCTFont() const; const void * MacGetCTFontDescriptor() const; #endif -#if wxMAC_USE_CORE_TEXT || wxMAC_USE_ATSU_TEXT +#if wxOSX_USE_CORE_TEXT || wxOSX_USE_ATSU_TEXT void* MacGetATSUStyle() const ; #endif diff --git a/include/wx/osx/carbon/fontdlg.h b/include/wx/osx/carbon/fontdlg.h index 48af50e871..ca96ff10c9 100644 --- a/include/wx/osx/carbon/fontdlg.h +++ b/include/wx/osx/carbon/fontdlg.h @@ -19,11 +19,18 @@ * Font dialog */ -#ifndef wxMAC_USE_EXPERIMENTAL_FONTDIALOG -#define wxMAC_USE_EXPERIMENTAL_FONTDIALOG 1 +/* + * support old notation + */ +#ifdef wxMAC_USE_EXPERIMENTAL_FONTDIALOG +#define wxOSX_USE_EXPERIMENTAL_FONTDIALOG wxMAC_USE_EXPERIMENTAL_FONTDIALOG +#endif + +#ifndef wxOSX_USE_EXPERIMENTAL_FONTDIALOG +#define wxOSX_USE_EXPERIMENTAL_FONTDIALOG 1 #endif -#if wxMAC_USE_EXPERIMENTAL_FONTDIALOG +#if wxOSX_USE_EXPERIMENTAL_FONTDIALOG class WXDLLIMPEXP_CORE wxFontDialog : public wxDialog { @@ -45,7 +52,7 @@ protected: extern "C" int RunMixedFontDialog(wxFontDialog* dialog) ; -#else // wxMAC_USE_EXPERIMENTAL_FONTDIALOG +#else // wxOSX_USE_EXPERIMENTAL_FONTDIALOG #if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX diff --git a/include/wx/osx/carbon/toolbar.h b/include/wx/osx/carbon/toolbar.h index efe961cdff..9646b8e249 100644 --- a/include/wx/osx/carbon/toolbar.h +++ b/include/wx/osx/carbon/toolbar.h @@ -67,7 +67,7 @@ class WXDLLIMPEXP_CORE wxToolBar: public wxToolBarBase void OnMouse(wxMouseEvent& event) ; virtual void MacSuperChangedPosition() ; -#if wxMAC_USE_NATIVE_TOOLBAR +#if wxOSX_USE_NATIVE_TOOLBAR bool MacInstallNativeToolbar(bool usesNative); bool MacWantsNativeToolbar(); bool MacTopLevelHasNativeToolbar(bool *ownToolbarInstalled) const; @@ -97,7 +97,7 @@ protected: const wxString& label); DECLARE_EVENT_TABLE() -#if wxMAC_USE_NATIVE_TOOLBAR +#if wxOSX_USE_NATIVE_TOOLBAR bool m_macUsesNativeToolbar ; void* m_macHIToolbarRef ; #endif -- 2.45.2