fix the incoherence pointed out by ifacecheck between wx docs, that documents usage...
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Mon, 3 Nov 2008 17:02:25 +0000 (17:02 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Mon, 3 Nov 2008 17:02:25 +0000 (17:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56664 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

26 files changed:
include/wx/cocoa/font.h
include/wx/defs.h
include/wx/dfb/font.h
include/wx/font.h
include/wx/gtk/font.h
include/wx/gtk1/font.h
include/wx/mgl/font.h
include/wx/motif/font.h
include/wx/msw/font.h
include/wx/os2/font.h
include/wx/osx/carbon/font.h
include/wx/palmos/font.h
include/wx/x11/font.h
src/cocoa/font.mm
src/common/fontcmn.cpp
src/dfb/font.cpp
src/gtk/font.cpp
src/gtk1/font.cpp
src/mgl/font.cpp
src/motif/dcclient.cpp
src/motif/font.cpp
src/msw/font.cpp
src/os2/font.cpp
src/osx/carbon/font.cpp
src/palmos/font.cpp
src/x11/font.cpp

index c11e4e3e0134d8b883ccaa505ad4985bc8e88fce..e1fcaecca92b00059fe754e8718b3de7f90365f4 100644 (file)
@@ -40,6 +40,7 @@ public:
 
     /*! @abstract   Platform-independent construction with individual properties
      */
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
     wxFont(int size,
            int family,
            int style,
@@ -47,6 +48,17 @@ public:
            bool underlined = FALSE,
            const wxString& face = wxEmptyString,
            wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
+    }
+#endif
+    wxFont(int size,
+           wxFontFamily family,
+           wxFontStyle style,
+           wxFontWeight weight,
+           bool underlined = FALSE,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
     {
         (void)Create(size, family, style, weight, underlined, face, encoding);
     }
@@ -66,9 +78,9 @@ public:
     // NOTE: Copy c-tor and assignment from wxObject is fine
 
     bool Create(int size,
-                int family,
-                int style,
-                int weight,
+                wxFontFamily family,
+                wxFontStyle style,
+                wxFontWeight weight,
                 bool underlined = FALSE,
                 const wxString& face = wxEmptyString,
                 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
@@ -79,22 +91,24 @@ public:
 
     // implement base class pure virtuals
     virtual int GetPointSize() const;
-    virtual int GetFamily() const;
-    virtual int GetStyle() const;
-    virtual int GetWeight() const;
+    virtual wxFontFamily GetFamily() const;
+    virtual wxFontStyle GetStyle() const;
+    virtual wxFontWeight GetWeight() const;
     virtual bool GetUnderlined() const;
     virtual wxString GetFaceName() const;
     virtual wxFontEncoding GetEncoding() const;
     virtual const wxNativeFontInfo *GetNativeFontInfo() const;
 
     virtual void SetPointSize(int pointSize);
-    virtual void SetFamily(int family);
-    virtual void SetStyle(int style);
-    virtual void SetWeight(int weight);
+    virtual void SetFamily(wxFontFamily family);
+    virtual void SetStyle(wxFontStyle style);
+    virtual void SetWeight(wxFontWeight weight);
     virtual bool SetFaceName(const wxString& faceName);
     virtual void SetUnderlined(bool underlined);
     virtual void SetEncoding(wxFontEncoding encoding);
 
+    WXDECLARE_COMPAT_SETTERS
+
     // implementation only from now on
     // -------------------------------
 
index 46498e465be7bf830e1b37296893b0bb28e2471c..c3e61462d516da95b0596498b5dea020cd268f43 100644 (file)
 #   endif
 
     /*
-       VC6 insists on complaining about 
+       VC6 insists on complaining about
 
         return type for 'wxVector<T>::reverse_iterator::operator ->' is 'T **'
         (ie; not a UDT or reference to a UDT.  Will produce errors if applied
@@ -506,7 +506,7 @@ typedef short int WXTYPE;
 #else
     #define  wxDEPRECATED_CONSTRUCTOR(x) wxDEPRECATED( inline x)
 #endif
-    
+
 /*
    Macro which marks the function as being deprecated but also defines it
    inline.
@@ -1222,7 +1222,7 @@ typedef double wxDouble;
 
 #if wxUSE_WCHAR_T && (!defined(SIZEOF_WCHAR_T) || (SIZEOF_WCHAR_T == 2))
     #define wxWCHAR_T_IS_WXCHAR16
-    typedef wchar_t wxChar16; 
+    typedef wchar_t wxChar16;
 #else
     typedef wxUint16 wxChar16;
 #endif
@@ -2087,6 +2087,14 @@ enum wxHitTest
 /*  GDI descriptions */
 /*  ---------------------------------------------------------------------------- */
 
+/*
+    WARNING: the following styles are deprecated; use the
+             wxFontFamily, wxFontStyle, wxFontWeight, wxBrushStyle,
+             wxPenStyle, wxPenCap, wxPenJoin enum values instead!
+*/
+
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
+
 /* don't use any elements of this enum in the new code */
 enum wxDeprecatedGUIConstants
 {
@@ -2110,13 +2118,6 @@ enum wxDeprecatedGUIConstants
     wxITALIC,
     wxSLANT,
 
-
-#if FUTURE_WXWIN_COMPATIBILITY_3_0
-    /*
-        WARNING: the following styles are deprecated; use the wxBrushStyle,
-                 wxPenStyle, wxPenCap, wxPenJoin enum values instead!
-    */
-
     /*  Pen styles */
     wxSOLID      =   100,
     wxDOT,
@@ -2142,8 +2143,8 @@ enum wxDeprecatedGUIConstants
     wxVERTICAL_HATCH,
     wxFIRST_HATCH = wxBDIAGONAL_HATCH,
     wxLAST_HATCH = wxVERTICAL_HATCH
-#endif
 };
+#endif
 
 /*  Logical ops */
 typedef enum
index a3441e48cccf4dac91ac456c2c5b96ebe44d5d2a..56c838680bfa48d27bfa6849fd85bbc6d9c0e55d 100644 (file)
@@ -24,6 +24,7 @@ class WXDLLIMPEXP_CORE wxFont : public wxFontBase
 public:
     wxFont() {}
     wxFont(const wxNativeFontInfo& info) { Create(info); }
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
     wxFont(int size,
            int family,
            int style,
@@ -31,14 +32,26 @@ public:
            bool underlined = false,
            const wxString& face = wxEmptyString,
            wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
+    }
+#endif
+
+    wxFont(int size,
+           wxFontFamily family,
+           wxFontStyle style,
+           wxFontWeight weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
     {
         Create(size, family, style, weight, underlined, face, encoding);
     }
 
     bool Create(int size,
-                int family,
-                int style,
-                int weight,
+                wxFontFamily family,
+                wxFontStyle style,
+                wxFontWeight weight,
                 bool underlined = false,
                 const wxString& face = wxEmptyString,
                 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
@@ -46,9 +59,9 @@ public:
 
     // implement base class pure virtuals
     virtual int GetPointSize() const;
-    virtual int GetFamily() const;
-    virtual int GetStyle() const;
-    virtual int GetWeight() const;
+    virtual wxFontFamily GetFamily() const;
+    virtual wxFontStyle GetStyle() const;
+    virtual wxFontWeight GetWeight() const;
     virtual wxString GetFaceName() const;
     virtual bool GetUnderlined() const;
     virtual wxFontEncoding GetEncoding() const;
@@ -56,13 +69,15 @@ public:
     virtual const wxNativeFontInfo *GetNativeFontInfo() const;
 
     virtual void SetPointSize(int pointSize);
-    virtual void SetFamily(int family);
-    virtual void SetStyle(int style);
-    virtual void SetWeight(int weight);
+    virtual void SetFamily(wxFontFamily family);
+    virtual void SetStyle(wxFontStyle style);
+    virtual void SetWeight(wxFontWeight weight);
     virtual bool SetFaceName(const wxString& faceName);
     virtual void SetUnderlined(bool underlined);
     virtual void SetEncoding(wxFontEncoding encoding);
 
+    WXDECLARE_COMPAT_SETTERS
+
     // Unofficial API, don't use
     virtual void SetNoAntiAliasing(bool no = true);
     virtual bool GetNoAntiAliasing() const;
index b93becbeca0a49f73a4b5fc56a3ac43b32316048..6f39a459c4463059c7a53c5d1382bbf7c09c3c73 100644 (file)
@@ -114,6 +114,8 @@ public:
     // creator function
     virtual ~wxFontBase();
 
+
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
     // from the font components
     static wxFont *New(
         int pointSize,              // size of the font in points
@@ -122,15 +124,9 @@ public:
         int weight,                 // see wxFontWeight enum
         bool underlined = false,    // not underlined by default
         const wxString& face = wxEmptyString,              // facename
-        wxFontEncoding encoding = wxFONTENCODING_DEFAULT); // ISO8859-X, ...
-
-    // from the font components but using the font flags instead of separate
-    // parameters for each flag
-    static wxFont *New(int pointSize,
-                       wxFontFamily family,
-                       int flags = wxFONTFLAG_DEFAULT,
-                       const wxString& face = wxEmptyString,
-                       wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
+        wxFontEncoding encoding = wxFONTENCODING_DEFAULT)  // ISO8859-X, ...
+        { return New(pointSize, (wxFontFamily)family, (wxFontStyle)style,
+                     (wxFontWeight)weight, underlined, face, encoding); }
 
     // from the font components
     static wxFont *New(
@@ -140,8 +136,40 @@ public:
         int weight,                 // see wxFontWeight enum
         bool underlined = false,    // not underlined by default
         const wxString& face = wxEmptyString,              // facename
+        wxFontEncoding encoding = wxFONTENCODING_DEFAULT)  // ISO8859-X, ...
+        { return New(pixelSize, (wxFontFamily)family, (wxFontStyle)style,
+                     (wxFontWeight)weight, underlined, face, encoding); }
+#endif
+
+    // from the font components
+    static wxFont *New(
+        int pointSize,              // size of the font in points
+        wxFontFamily family,        // see wxFontFamily enum
+        wxFontStyle style,          // see wxFontStyle enum
+        wxFontWeight weight,        // see wxFontWeight enum
+        bool underlined = false,    // not underlined by default
+        const wxString& face = wxEmptyString,              // facename
         wxFontEncoding encoding = wxFONTENCODING_DEFAULT); // ISO8859-X, ...
 
+    // from the font components
+    static wxFont *New(
+        const wxSize& pixelSize,    // size of the font in pixels
+        wxFontFamily family,        // see wxFontFamily enum
+        wxFontStyle style,          // see wxFontStyle enum
+        wxFontWeight weight,        // see wxFontWeight enum
+        bool underlined = false,    // not underlined by default
+        const wxString& face = wxEmptyString,              // facename
+        wxFontEncoding encoding = wxFONTENCODING_DEFAULT); // ISO8859-X, ...
+
+    // from the font components but using the font flags instead of separate
+    // parameters for each flag
+    static wxFont *New(int pointSize,
+                       wxFontFamily family,
+                       int flags = wxFONTFLAG_DEFAULT,
+                       const wxString& face = wxEmptyString,
+                       wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
+
+
     // from the font components but using the font flags instead of separate
     // parameters for each flag
     static wxFont *New(const wxSize& pixelSize,
@@ -164,9 +192,9 @@ public:
     virtual int GetPointSize() const = 0;
     virtual wxSize GetPixelSize() const;
     virtual bool IsUsingSizeInPixels() const;
-    virtual int GetFamily() const = 0;
-    virtual int GetStyle() const = 0;
-    virtual int GetWeight() const = 0;
+    virtual wxFontFamily GetFamily() const = 0;
+    virtual wxFontStyle GetStyle() const = 0;
+    virtual wxFontWeight GetWeight() const = 0;
     virtual bool GetUnderlined() const = 0;
     virtual wxString GetFaceName() const = 0;
     virtual wxFontEncoding GetEncoding() const = 0;
@@ -180,9 +208,10 @@ public:
     // change the font characteristics
     virtual void SetPointSize( int pointSize ) = 0;
     virtual void SetPixelSize( const wxSize& pixelSize );
-    virtual void SetFamily( int family ) = 0;
-    virtual void SetStyle( int style ) = 0;
-    virtual void SetWeight( int weight ) = 0;
+    virtual void SetFamily( wxFontFamily family ) = 0;
+    virtual void SetStyle( wxFontStyle style ) = 0;
+    virtual void SetWeight( wxFontWeight weight ) = 0;
+
     virtual void SetUnderlined( bool underlined ) = 0;
     virtual void SetEncoding(wxFontEncoding encoding) = 0;
     virtual bool SetFaceName( const wxString& faceName );
@@ -224,6 +253,23 @@ WXDLLIMPEXP_CORE wxString wxToString(const wxFontBase& font);
 WXDLLIMPEXP_CORE bool wxFromString(const wxString& str, wxFontBase* font);
 
 
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
+#define WXDECLARE_COMPAT_SETTERS   \
+    wxDEPRECATED_FUTURE( void SetFamily(int family) ) \
+        { SetFamily((wxFontFamily)family); } \
+    wxDEPRECATED_FUTURE( void SetStyle(int style) ) \
+        { SetStyle((wxFontStyle)style); } \
+    wxDEPRECATED_FUTURE( void SetWeight(int weight) ) \
+        { SetWeight((wxFontWeight)weight); } \
+    wxDEPRECATED_FUTURE( void SetFamily(wxDeprecatedGUIConstants family) ) \
+        { SetFamily((wxFontFamily)family); } \
+    wxDEPRECATED_FUTURE( void SetStyle(wxDeprecatedGUIConstants style) ) \
+        { SetStyle((wxFontStyle)style); } \
+    wxDEPRECATED_FUTURE( void SetWeight(wxDeprecatedGUIConstants weight) ) \
+        { SetWeight((wxFontWeight)weight); }
+#else
+#define WXDECLARE_COMPAT_SETTERS  /*empty*/
+#endif
 
 // include the real class declaration
 #if defined(__WXPALMOS__)
@@ -278,5 +324,29 @@ public:
 
 extern WXDLLIMPEXP_DATA_CORE(wxFontList*)    wxTheFontList;
 
+
+// provide comparison operators to allow code such as
+//
+//      if ( font.GetStyle() == wxFONTSTYLE_SLANT )
+//
+// to compile without warnings which it would otherwise provoke from some
+// compilers as it compares elements of different enums
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
+
+inline bool operator==(wxFontFamily s, wxDeprecatedGUIConstants t)
+{ return static_cast<int>(s) == static_cast<int>(t); }
+inline bool operator!=(wxFontFamily s, wxDeprecatedGUIConstants t)
+{ return !(s == t); }
+inline bool operator==(wxFontStyle s, wxDeprecatedGUIConstants t)
+{ return static_cast<int>(s) == static_cast<int>(t); }
+inline bool operator!=(wxFontStyle s, wxDeprecatedGUIConstants t)
+{ return !(s == t); }
+inline bool operator==(wxFontWeight s, wxDeprecatedGUIConstants t)
+{ return static_cast<int>(s) == static_cast<int>(t); }
+inline bool operator!=(wxFontWeight s, wxDeprecatedGUIConstants t)
+{ return !(s == t); }
+
+#endif // FUTURE_WXWIN_COMPATIBILITY_3_0
+
 #endif
     // _WX_FONT_H_BASE_
index 253c5cf11f5f96581fb0f04dc07c00814610f216..2743dca4693b1993fc42b9d930da1e8df980e6c1 100644 (file)
@@ -27,6 +27,7 @@ public:
 
     wxFont(const wxNativeFontInfo& info);
 
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
     wxFont(int size,
            int family,
            int style,
@@ -35,13 +36,25 @@ public:
            const wxString& face = wxEmptyString,
            wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
     {
-        (void)Create(size, family, style, weight, underlined, face, encoding);
+        (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
+    }
+#endif
+
+    wxFont(int size,
+           wxFontFamily family,
+           wxFontStyle style,
+           wxFontWeight weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        Create(size, family, style, weight, underlined, face, encoding);
     }
 
     bool Create(int size,
-                int family,
-                int style,
-                int weight,
+                wxFontFamily family,
+                wxFontStyle style,
+                wxFontWeight weight,
                 bool underlined = false,
                 const wxString& face = wxEmptyString,
                 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
@@ -53,9 +66,9 @@ public:
 
     // implement base class pure virtuals
     virtual int GetPointSize() const;
-    virtual int GetFamily() const;
-    virtual int GetStyle() const;
-    virtual int GetWeight() const;
+    virtual wxFontFamily GetFamily() const;
+    virtual wxFontStyle GetStyle() const;
+    virtual wxFontWeight GetWeight() const;
     virtual wxString GetFaceName() const;
     virtual bool GetUnderlined() const;
     virtual wxFontEncoding GetEncoding() const;
@@ -63,13 +76,15 @@ public:
     virtual bool IsFixedWidth() const;
 
     virtual void SetPointSize( int pointSize );
-    virtual void SetFamily( int family );
-    virtual void SetStyle( int style );
-    virtual void SetWeight( int weight );
+    virtual void SetFamily(wxFontFamily family);
+    virtual void SetStyle(wxFontStyle style);
+    virtual void SetWeight(wxFontWeight weight);
     virtual bool SetFaceName( const wxString& faceName );
     virtual void SetUnderlined( bool underlined );
     virtual void SetEncoding(wxFontEncoding encoding);
 
+    WXDECLARE_COMPAT_SETTERS
+
     virtual void SetNoAntiAliasing( bool no = true );
     virtual bool GetNoAntiAliasing() const ;
 
index 62250ef33b97ea30d9bf5d774d83e1b58b3d997d..cbce9d2c1fa56274664fe79ba8965ab777d989a3 100644 (file)
@@ -40,6 +40,7 @@ public:
 
     wxFont(const wxNativeFontInfo& info);
 
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
     wxFont(int size,
            int family,
            int style,
@@ -48,17 +49,30 @@ public:
            const wxString& face = wxEmptyString,
            wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
     {
-        (void)Create(size, family, style, weight, underlined, face, encoding);
+        (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
+    }
+#endif
+
+    wxFont(int size,
+           wxFontFamily family,
+           wxFontStyle style,
+           wxFontWeight weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        Create(size, family, style, weight, underlined, face, encoding);
     }
 
     bool Create(int size,
-                int family,
-                int style,
-                int weight,
+                wxFontFamily family,
+                wxFontStyle style,
+                wxFontWeight weight,
                 bool underlined = false,
                 const wxString& face = wxEmptyString,
                 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
 
+
     // wxGTK-specific
     bool Create(const wxString& fontname);
 
@@ -66,9 +80,9 @@ public:
 
     // implement base class pure virtuals
     virtual int GetPointSize() const;
-    virtual int GetFamily() const;
-    virtual int GetStyle() const;
-    virtual int GetWeight() const;
+    virtual wxFontFamily GetFamily() const;
+    virtual wxFontStyle GetStyle() const;
+    virtual wxFontWeight GetWeight() const;
     virtual wxString GetFaceName() const;
     virtual bool GetUnderlined() const;
     virtual wxFontEncoding GetEncoding() const;
@@ -76,13 +90,15 @@ public:
     virtual bool IsFixedWidth() const;
 
     virtual void SetPointSize( int pointSize );
-    virtual void SetFamily( int family );
-    virtual void SetStyle( int style );
-    virtual void SetWeight( int weight );
+    virtual void SetFamily(wxFontFamily family);
+    virtual void SetStyle(wxFontStyle style);
+    virtual void SetWeight(wxFontWeight weight);
     virtual bool SetFaceName( const wxString& faceName );
     virtual void SetUnderlined( bool underlined );
     virtual void SetEncoding(wxFontEncoding encoding);
 
+    WXDECLARE_COMPAT_SETTERS
+
     virtual void SetNoAntiAliasing( bool no = true );
     virtual bool GetNoAntiAliasing() const ;
 
index 06f4002930437f6b792101ccbcbc37cdfe95ea21..c372a219b763b53e0178175a7dd8a171d7b425e3 100644 (file)
@@ -34,25 +34,38 @@ public:
 
     wxFont(const wxNativeFontInfo& info)
     {
-        (void)Create(info);  
+        (void)Create(info);
     }
 
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
     wxFont(int size,
            int family,
            int style,
            int weight,
-           bool underlined = FALSE,
+           bool underlined = false,
            const wxString& face = wxEmptyString,
            wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
     {
-        (void)Create(size, family, style, weight, underlined, face, encoding);
+        (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
+    }
+#endif
+
+    wxFont(int size,
+           wxFontFamily family,
+           wxFontStyle style,
+           wxFontWeight weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        Create(size, family, style, weight, underlined, face, encoding);
     }
 
     bool Create(int size,
-                int family,
-                int style,
-                int weight,
-                bool underlined = FALSE,
+                wxFontFamily family,
+                wxFontStyle style,
+                wxFontWeight weight,
+                bool underlined = false,
                 const wxString& face = wxEmptyString,
                 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
 
@@ -62,9 +75,9 @@ public:
 
     // implement base class pure virtuals
     virtual int GetPointSize() const;
-    virtual int GetFamily() const;
-    virtual int GetStyle() const;
-    virtual int GetWeight() const;
+    virtual wxFontFamily GetFamily() const;
+    virtual wxFontStyle GetStyle() const;
+    virtual wxFontWeight GetWeight() const;
     virtual wxString GetFaceName() const;
     virtual bool GetUnderlined() const;
     virtual wxFontEncoding GetEncoding() const;
@@ -72,13 +85,15 @@ public:
     virtual const wxNativeFontInfo *GetNativeFontInfo() const;
 
     virtual void SetPointSize(int pointSize);
-    virtual void SetFamily(int family);
-    virtual void SetStyle(int style);
-    virtual void SetWeight(int weight);
+    virtual void SetFamily(wxFontFamily family);
+    virtual void SetStyle(wxFontStyle style);
+    virtual void SetWeight(wxFontWeight weight);
     virtual bool SetFaceName(const wxString& faceName);
     virtual void SetUnderlined(bool underlined);
     virtual void SetEncoding(wxFontEncoding encoding);
 
+    WXDECLARE_COMPAT_SETTERS
+
     // Unofficial API, don't use
     virtual void SetNoAntiAliasing(bool no = true);
     virtual bool GetNoAntiAliasing() const;
index bd8eff6b268ca800c6d878bfd276efa4ecdf382c..8b470cf76ea8015d876602b61fdc9b3d27abb530 100644 (file)
@@ -28,26 +28,39 @@ public:
     // ctors and such
     wxFont() { }
 
+    wxFont(const wxNativeFontInfo& info);
+
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
     wxFont(int size,
-        int family,
-        int style,
-        int weight,
-        bool underlined = false,
-        const wxString& face = wxEmptyString,
-        wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+           int family,
+           int style,
+           int weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
     {
-        (void)Create(size, family, style, weight, underlined, face, encoding);
+        (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
     }
+#endif
 
-    wxFont(const wxNativeFontInfo& info);
+    wxFont(int size,
+           wxFontFamily family,
+           wxFontStyle style,
+           wxFontWeight weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        Create(size, family, style, weight, underlined, face, encoding);
+    }
 
     bool Create(int size,
-        int family,
-        int style,
-        int weight,
-        bool underlined = false,
-        const wxString& face = wxEmptyString,
-        wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
+                wxFontFamily family,
+                wxFontStyle style,
+                wxFontWeight weight,
+                bool underlined = false,
+                const wxString& face = wxEmptyString,
+                wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
 
     // wxMOTIF-specific
     bool Create(const wxString& fontname,
@@ -58,22 +71,24 @@ public:
 
     // implement base class pure virtuals
     virtual int GetPointSize() const;
-    virtual int GetFamily() const;
-    virtual int GetStyle() const;
-    virtual int GetWeight() const;
+    virtual wxFontFamily GetFamily() const;
+    virtual wxFontStyle GetStyle() const;
+    virtual wxFontWeight GetWeight() const;
     virtual bool GetUnderlined() const;
     virtual wxString GetFaceName() const;
     virtual wxFontEncoding GetEncoding() const;
     virtual const wxNativeFontInfo *GetNativeFontInfo() const;
 
     virtual void SetPointSize(int pointSize);
-    virtual void SetFamily(int family);
-    virtual void SetStyle(int style);
-    virtual void SetWeight(int weight);
+    virtual void SetFamily(wxFontFamily family);
+    virtual void SetStyle(wxFontStyle style);
+    virtual void SetWeight(wxFontWeight weight);
     virtual bool SetFaceName(const wxString& faceName);
     virtual void SetUnderlined(bool underlined);
     virtual void SetEncoding(wxFontEncoding encoding);
 
+    WXDECLARE_COMPAT_SETTERS
+
     // Implementation
 
     // Find an existing, or create a new, XFontStruct
index fc690bdcbcf09a91ad048b2edacb8e12d125c384..ba22cb5cdbe5c51ed5412628957946eef6de1061 100644 (file)
@@ -24,6 +24,7 @@ public:
     // ctors and such
     wxFont() { }
 
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
     wxFont(int size,
            int family,
            int style,
@@ -32,9 +33,34 @@ public:
            const wxString& face = wxEmptyString,
            wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
     {
-        (void)Create(size, family, style, weight, underlined, face, encoding);
+        (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
     }
+#endif
 
+    wxFont(int size,
+           wxFontFamily family,
+           wxFontStyle style,
+           wxFontWeight weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        Create(size, family, style, weight, underlined, face, encoding);
+    }
+
+    bool Create(int size,
+                wxFontFamily family,
+                wxFontStyle style,
+                wxFontWeight weight,
+                bool underlined = false,
+                const wxString& face = wxEmptyString,
+                wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        return DoCreate(size, wxDefaultSize, false, family, style,
+                        weight, underlined, face, encoding);
+    }
+
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
     wxFont(const wxSize& pixelSize,
            int family,
            int style,
@@ -42,6 +68,19 @@ public:
            bool underlined = false,
            const wxString& face = wxEmptyString,
            wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        (void)Create(pixelSize, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight,
+                     underlined, face, encoding);
+    }
+#endif
+
+    wxFont(const wxSize& pixelSize,
+           wxFontFamily family,
+           wxFontStyle style,
+           wxFontWeight weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
     {
         (void)Create(pixelSize, family, style, weight,
                      underlined, face, encoding);
@@ -54,22 +93,11 @@ public:
 
     wxFont(const wxString& fontDesc);
 
-    bool Create(int size,
-                int family,
-                int style,
-                int weight,
-                bool underlined = false,
-                const wxString& face = wxEmptyString,
-                wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
-    {
-        return DoCreate(size, wxDefaultSize, false, family, style,
-                        weight, underlined, face, encoding);
-    }
 
     bool Create(const wxSize& pixelSize,
-                int family,
-                int style,
-                int weight,
+                wxFontFamily family,
+                wxFontStyle style,
+                wxFontWeight weight,
                 bool underlined = false,
                 const wxString& face = wxEmptyString,
                 wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
@@ -90,9 +118,9 @@ public:
     virtual int GetPointSize() const;
     virtual wxSize GetPixelSize() const;
     virtual bool IsUsingSizeInPixels() const;
-    virtual int GetFamily() const;
-    virtual int GetStyle() const;
-    virtual int GetWeight() const;
+    virtual wxFontFamily GetFamily() const;
+    virtual wxFontStyle GetStyle() const;
+    virtual wxFontWeight GetWeight() const;
     virtual bool GetUnderlined() const;
     virtual wxString GetFaceName() const;
     virtual wxFontEncoding GetEncoding() const;
@@ -100,13 +128,15 @@ public:
 
     virtual void SetPointSize(int pointSize);
     virtual void SetPixelSize(const wxSize& pixelSize);
-    virtual void SetFamily(int family);
-    virtual void SetStyle(int style);
-    virtual void SetWeight(int weight);
+    virtual void SetFamily(wxFontFamily family);
+    virtual void SetStyle(wxFontStyle style);
+    virtual void SetWeight(wxFontWeight weight);
     virtual bool SetFaceName(const wxString& faceName);
     virtual void SetUnderlined(bool underlined);
     virtual void SetEncoding(wxFontEncoding encoding);
 
+    WXDECLARE_COMPAT_SETTERS
+
     virtual bool IsFixedWidth() const;
 
     // implementation only from now on
index 0f599670849745359ba59f0dc76951952d816ac0..1efdc99f8d5b80d2c71429c0bff579c59b7580c3 100644 (file)
@@ -27,25 +27,38 @@ public:
     // ctors and such
     wxFont() { }
 
-    wxFont( int             nSize
-           ,int             nFamily
-           ,int             nStyle
-           ,int             nWeight
-           ,bool            bUnderlined = false
-           ,const wxString& rsFace = wxEmptyString
-           ,wxFontEncoding  vEncoding = wxFONTENCODING_DEFAULT
-          )
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
+    wxFont(int size,
+           int family,
+           int style,
+           int weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
     {
-        (void)Create( nSize
-                     ,nFamily
-                     ,nStyle
-                     ,nWeight
-                     ,bUnderlined
-                     ,rsFace
-                     ,vEncoding
-                    );
+        (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
+    }
+#endif
+
+    wxFont(int size,
+           wxFontFamily family,
+           wxFontStyle style,
+           wxFontWeight weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        Create(size, family, style, weight, underlined, face, encoding);
     }
 
+    bool Create(int size,
+                wxFontFamily family,
+                wxFontStyle style,
+                wxFontWeight weight,
+                bool underlined = false,
+                const wxString& face = wxEmptyString,
+                wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
+
     wxFont( const wxNativeFontInfo& rInfo
            ,WXHFONT                 hFont = 0
           )
@@ -58,14 +71,6 @@ public:
 
     wxFont(const wxString& rsFontDesc);
 
-    bool Create( int             nSize
-                ,int             nFamily
-                ,int             nStyle
-                ,int             nWeight
-                ,bool            bUnderlined = false
-                ,const wxString& rsFace = wxEmptyString
-                ,wxFontEncoding  vEncoding = wxFONTENCODING_DEFAULT
-               );
     bool Create( const wxNativeFontInfo& rInfo
                 ,WXHFONT                 hFont = 0
                );
@@ -76,22 +81,24 @@ public:
     // Implement base class pure virtuals
     //
     virtual int               GetPointSize(void) const;
-    virtual int               GetFamily(void) const;
-    virtual int               GetStyle(void) const;
-    virtual int               GetWeight(void) const;
+    virtual wxFontFamily GetFamily() const;
+    virtual wxFontStyle GetStyle() const;
+    virtual wxFontWeight GetWeight() const;
     virtual bool              GetUnderlined(void) const;
     virtual wxString          GetFaceName(void) const;
     virtual wxFontEncoding    GetEncoding(void) const;
     virtual const wxNativeFontInfo* GetNativeFontInfo() const;
 
     virtual void SetPointSize(int nPointSize);
-    virtual void SetFamily(int nFamily);
-    virtual void SetStyle(int nStyle);
-    virtual void SetWeight(int nWeight);
+    virtual void SetFamily(wxFontFamily family);
+    virtual void SetStyle(wxFontStyle style);
+    virtual void SetWeight(wxFontWeight weight);
     virtual bool SetFaceName(const wxString& rsFaceName);
     virtual void SetUnderlined(bool bUnderlined);
     virtual void SetEncoding(wxFontEncoding vEncoding);
 
+    WXDECLARE_COMPAT_SETTERS
+
     //
     // For internal use only!
     //
index d2dcb558ae321f3794163cb3560570e894927f2b..6dd3efa68a3c6bf28d5014d5a9688d4a7b5500b3 100644 (file)
@@ -22,32 +22,45 @@ public:
     // ctors and such
     wxFont() { }
 
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
     wxFont(int size,
            int family,
            int style,
            int weight,
-           bool underlined = FALSE,
+           bool underlined = false,
            const wxString& face = wxEmptyString,
            wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
     {
-        (void)Create(size, family, style, weight, underlined, face, encoding);
+        (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
     }
+#endif
 
-    wxFont(const wxNativeFontInfo& info)
+    wxFont(int size,
+           wxFontFamily family,
+           wxFontStyle style,
+           wxFontWeight weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
     {
-        (void)Create(info);
+        Create(size, family, style, weight, underlined, face, encoding);
     }
 
-    wxFont(const wxString& fontDesc);
-
     bool Create(int size,
-                int family,
-                int style,
-                int weight,
-                bool underlined = FALSE,
+                wxFontFamily family,
+                wxFontStyle style,
+                wxFontWeight weight,
+                bool underlined = false,
                 const wxString& face = wxEmptyString,
                 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
 
+    wxFont(const wxNativeFontInfo& info)
+    {
+        (void)Create(info);
+    }
+
+    wxFont(const wxString& fontDesc);
+
     bool Create(const wxNativeFontInfo& info);
 
 #if wxOSX_USE_CARBON
@@ -64,22 +77,24 @@ public:
     // implement base class pure virtuals
     virtual int GetPointSize() const;
     virtual wxSize GetPixelSize() const;
-    virtual int GetFamily() const;
-    virtual int GetStyle() const;
-    virtual int GetWeight() const;
+    virtual wxFontFamily GetFamily() const;
+    virtual wxFontStyle GetStyle() const;
+    virtual wxFontWeight GetWeight() const;
     virtual bool GetUnderlined() const;
     virtual wxString GetFaceName() const;
     virtual wxFontEncoding GetEncoding() const;
     virtual const wxNativeFontInfo *GetNativeFontInfo() const;
 
     virtual void SetPointSize(int pointSize);
-    virtual void SetFamily(int family);
-    virtual void SetStyle(int style);
-    virtual void SetWeight(int weight);
+    virtual void SetFamily(wxFontFamily family);
+    virtual void SetStyle(wxFontStyle style);
+    virtual void SetWeight(wxFontWeight weight);
     virtual bool SetFaceName(const wxString& faceName);
     virtual void SetUnderlined(bool underlined);
     virtual void SetEncoding(wxFontEncoding encoding);
 
+    WXDECLARE_COMPAT_SETTERS
+
     // implementation only from now on
     // -------------------------------
 
index 7319b4638f73974894c7f7f70674c09f350325d6..44b00e9987c70a71fd7f0436f934e47240563db7 100644 (file)
@@ -24,6 +24,7 @@ public:
     // ctors and such
     wxFont() { }
 
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
     wxFont(int size,
            int family,
            int style,
@@ -32,8 +33,28 @@ public:
            const wxString& face = wxEmptyString,
            wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
     {
-        (void)Create(size, family, style, weight, underlined, face, encoding);
+        (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
     }
+#endif
+
+    wxFont(int size,
+           wxFontFamily family,
+           wxFontStyle style,
+           wxFontWeight weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        Create(size, family, style, weight, underlined, face, encoding);
+    }
+
+    bool Create(int size,
+                wxFontFamily family,
+                wxFontStyle style,
+                wxFontWeight weight,
+                bool underlined = false,
+                const wxString& face = wxEmptyString,
+                wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
 
     wxFont(const wxSize& pixelSize,
            int family,
@@ -54,18 +75,6 @@ public:
 
     wxFont(const wxString& fontDesc);
 
-    bool Create(int size,
-                int family,
-                int style,
-                int weight,
-                bool underlined = false,
-                const wxString& face = wxEmptyString,
-                wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
-    {
-        return DoCreate(size, wxDefaultSize, false, family, style,
-                        weight, underlined, face, encoding);
-    }
-
     bool Create(const wxSize& pixelSize,
                 int family,
                 int style,
@@ -90,9 +99,9 @@ public:
     virtual int GetPointSize() const;
     virtual wxSize GetPixelSize() const;
     virtual bool IsUsingSizeInPixels() const;
-    virtual int GetFamily() const;
-    virtual int GetStyle() const;
-    virtual int GetWeight() const;
+    virtual wxFontFamily GetFamily() const;
+    virtual wxFontStyle GetStyle() const;
+    virtual wxFontWeight GetWeight() const;
     virtual bool GetUnderlined() const;
     virtual wxString GetFaceName() const;
     virtual wxFontEncoding GetEncoding() const;
@@ -100,13 +109,15 @@ public:
 
     virtual void SetPointSize(int pointSize);
     virtual void SetPixelSize(const wxSize& pixelSize);
-    virtual void SetFamily(int family);
-    virtual void SetStyle(int style);
-    virtual void SetWeight(int weight);
+    virtual void SetFamily(wxFontFamily family);
+    virtual void SetStyle(wxFontStyle style);
+    virtual void SetWeight(wxFontWeight weight);
     virtual bool SetFaceName(const wxString& faceName);
     virtual void SetUnderlined(bool underlined);
     virtual void SetEncoding(wxFontEncoding encoding);
 
+    WXDECLARE_COMPAT_SETTERS
+
     virtual bool IsFixedWidth() const;
 
     // implementation only from now on
index 6a2db7f31056c4b66788a7e4a5d2f41919d15205..300156f0bc73c2175f1082d0f2125379448d0327 100644 (file)
@@ -21,26 +21,39 @@ public:
     // ctors and such
     wxFont() { }
 
+#if FUTURE_WXWIN_COMPATIBILITY_3_0
     wxFont(int size,
-        int family,
-        int style,
-        int weight,
-        bool underlined = FALSE,
-        const wxString& face = wxEmptyString,
-        wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+           int family,
+           int style,
+           int weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
     {
-        (void)Create(size, family, style, weight, underlined, face, encoding);
+        (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
     }
+#endif
 
-    wxFont(const wxNativeFontInfo& info);
+    wxFont(int size,
+           wxFontFamily family,
+           wxFontStyle style,
+           wxFontWeight weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        Create(size, family, style, weight, underlined, face, encoding);
+    }
 
     bool Create(int size,
-        int family,
-        int style,
-        int weight,
-        bool underlined = FALSE,
-        const wxString& face = wxEmptyString,
-        wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
+                wxFontFamily family,
+                wxFontStyle style,
+                wxFontWeight weight,
+                bool underlined = false,
+                const wxString& face = wxEmptyString,
+                wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
+
+    wxFont(const wxNativeFontInfo& info);
 
     // FIXME: I added the ! to make it compile;
     // is this right? - JACS
@@ -55,9 +68,9 @@ public:
 
     // implement base class pure virtuals
     virtual int GetPointSize() const;
-    virtual int GetFamily() const;
-    virtual int GetStyle() const;
-    virtual int GetWeight() const;
+    virtual wxFontFamily GetFamily() const;
+    virtual wxFontStyle GetStyle() const;
+    virtual wxFontWeight GetWeight() const;
     virtual bool GetUnderlined() const;
     virtual wxString GetFaceName() const;
     virtual wxFontEncoding GetEncoding() const;
@@ -66,13 +79,15 @@ public:
     virtual bool IsFixedWidth() const;
 
     virtual void SetPointSize(int pointSize);
-    virtual void SetFamily(int family);
-    virtual void SetStyle(int style);
-    virtual void SetWeight(int weight);
+    virtual void SetFamily(wxFontFamily family);
+    virtual void SetStyle(wxFontStyle style);
+    virtual void SetWeight(wxFontWeight weight);
     virtual bool SetFaceName(const wxString& faceName);
     virtual void SetUnderlined(bool underlined);
     virtual void SetEncoding(wxFontEncoding encoding);
 
+    WXDECLARE_COMPAT_SETTERS
+
     virtual void SetNoAntiAliasing( bool no = TRUE );
     virtual bool GetNoAntiAliasing() const ;
 
index c816fb38cc725f46e057a689f2958b116800a992..9b67dbb3aa9456ead959aec48a47ab4c0c5d2869 100644 (file)
@@ -94,7 +94,7 @@
 static NSFont* GetNSFontForNativeFontInfo(const wxNativeFontInfo &info);
 static void UpdateNativeFontInfoWithNSFont(wxNativeFontInfo &info, NSFont *cocoaNSFont);
 static wxNativeFontInfo MakeNativeFontInfoForNSFont(NSFont *cocoaNSFont, bool underlined = false);
-static wxNativeFontInfo MakeNativeFontInfo(int size, int family, int style, int weight, bool underlined, const wxString& faceName, wxFontEncoding encoding);
+static wxNativeFontInfo MakeNativeFontInfo(int size, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underlined, const wxString& faceName, wxFontEncoding encoding);
 
 /*! @discussion
     Due to 2.8 ABI compatibility concerns we probably don't want to change wxNativeFontInfo
@@ -146,9 +146,9 @@ public:
     }
 
     wxFontRefData(int size,
-                  int family,
-                  int style,
-                  int weight,
+                  wxFontFamily family,
+                  wxFontStyle style,
+                  wxFontWeight weight,
                   bool underlined,
                   const wxString& faceName,
                   wxFontEncoding encoding)
@@ -166,9 +166,9 @@ protected:
         FIXME: Remove from trunk
      */
     void Init(int size,
-              int family,
-              int style,
-              int weight,
+              wxFontFamily family,
+              wxFontStyle style,
+              wxFontWeight weight,
               bool underlined,
               const wxString& faceName,
               wxFontEncoding encoding);
@@ -283,7 +283,7 @@ static wxNativeFontInfo MakeNativeFontInfoForNSFont(NSFont *cocoaNSFont, bool un
 
 IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
 
-static wxNativeFontInfo MakeNativeFontInfo(int size, int family, int style, int weight, bool underlined, const wxString& faceName, wxFontEncoding encoding)
+static wxNativeFontInfo MakeNativeFontInfo(int size, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underlined, const wxString& faceName, wxFontEncoding encoding)
 {
     wxNativeFontInfo m_info; // NOTE: not an i-var despite name
     m_info.pointSize = size;
@@ -296,7 +296,7 @@ static wxNativeFontInfo MakeNativeFontInfo(int size, int family, int style, int
     return m_info;
 }
 
-void wxFontRefData::Init(int size, int family, int style, int weight, bool underlined, const wxString& faceName, wxFontEncoding encoding)
+void wxFontRefData::Init(int size, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underlined, const wxString& faceName, wxFontEncoding encoding)
 {
     m_info = MakeNativeFontInfo(size, family, style, weight, underlined, faceName, encoding);
 }
@@ -364,19 +364,19 @@ bool wxFont::GetUnderlined() const
         return false;
 }
 
-int wxFont::GetStyle() const
+wxFontStyle wxFont::GetStyle() const
 {
     wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
     return M_FONTDATA->m_info.style;
 }
 
-int wxFont::GetFamily() const
+wxFontFamily wxFont::GetFamily() const
 {
     wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
     return M_FONTDATA->m_info.family;
 }
 
-int wxFont::GetWeight() const
+wxFontWeight wxFont::GetWeight() const
 {
     wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
     return M_FONTDATA->m_info.weight;
@@ -388,7 +388,7 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
     return &M_FONTDATA->m_info;
 }
 
-bool wxFont::Create(int pointSize, int family, int style, int weight, bool underlined, const wxString& faceName, wxFontEncoding encoding)
+bool wxFont::Create(int pointSize, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underlined, const wxString& faceName, wxFontEncoding encoding)
 {
     UnRef();
     m_refData = new wxFontRefData(pointSize, family, style, weight, underlined, faceName, encoding);
@@ -417,7 +417,7 @@ void wxFont::SetPointSize(int pointSize)
     RealizeResource();
 }
 
-void wxFont::SetFamily(int family)
+void wxFont::SetFamily(wxFontFamily family)
 {
     AllocExclusive();
 
@@ -426,7 +426,7 @@ void wxFont::SetFamily(int family)
     RealizeResource();
 }
 
-void wxFont::SetStyle(int style)
+void wxFont::SetStyle(wxFontStyle style)
 {
     AllocExclusive();
 
@@ -435,7 +435,7 @@ void wxFont::SetStyle(int style)
     RealizeResource();
 }
 
-void wxFont::SetWeight(int weight)
+void wxFont::SetWeight(wxFontWeight weight)
 {
     AllocExclusive();
 
index b2b7e2c1080de23e8de56e11c3900c404f06a12e..a5ff16a10fef310b384d9394ebf549589f2b3210 100644 (file)
@@ -130,9 +130,9 @@ wxFontBase::~wxFontBase()
 
 /* static */
 wxFont *wxFontBase::New(int size,
-                        int family,
-                        int style,
-                        int weight,
+                        wxFontFamily family,
+                        wxFontStyle style,
+                        wxFontWeight weight,
                         bool underlined,
                         const wxString& face,
                         wxFontEncoding encoding)
@@ -176,9 +176,9 @@ wxFont *wxFontBase::New(int pointSize,
 
 /* static */
 wxFont *wxFontBase::New(const wxSize& pixelSize,
-                        int family,
-                        int style,
-                        int weight,
+                        wxFontFamily family,
+                        wxFontStyle style,
+                        wxFontWeight weight,
                         bool underlined,
                         const wxString& face,
                         wxFontEncoding encoding)
index 206c11b14d600f09f1b2edb14007f34fe62031d0..83fc2138a6ee955e1ba45af9a0628ed763df6a7a 100644 (file)
@@ -48,9 +48,9 @@ bool wxFont::Create(const wxNativeFontInfo& info)
 }
 
 bool wxFont::Create(int pointSize,
-                    int family,
-                    int style,
-                    int weight,
+                    wxFontFamily family,
+                    wxFontStyle style,
+                    wxFontWeight weight,
                     bool underlined,
                     const wxString& face,
                     wxFontEncoding encoding)
@@ -98,23 +98,23 @@ wxString wxFont::GetFaceName() const
     return M_FONTDATA->GetFaceName();
 }
 
-int wxFont::GetFamily() const
+wxFontFamily wxFont::GetFamily() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTFAMILY_MAX, wxT("invalid font") );
 
     return M_FONTDATA->GetFamily();
 }
 
-int wxFont::GetStyle() const
+wxFontStyle wxFont::GetStyle() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") );
 
     return M_FONTDATA->GetStyle();
 }
 
-int wxFont::GetWeight() const
+wxFontWeight wxFont::GetWeight() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") );
 
     return M_FONTDATA->GetWeight();
 }
@@ -165,19 +165,19 @@ void wxFont::SetPointSize(int pointSize)
     M_FONTDATA->SetPointSize(pointSize);
 }
 
-void wxFont::SetFamily(int family)
+void wxFont::SetFamily(wxFontFamily family)
 {
     AllocExclusive();
     M_FONTDATA->SetFamily(family);
 }
 
-void wxFont::SetStyle(int style)
+void wxFont::SetStyle(wxFontStyle style)
 {
     AllocExclusive();
     M_FONTDATA->SetStyle(style);
 }
 
-void wxFont::SetWeight(int weight)
+void wxFont::SetWeight(wxFontWeight weight)
 {
     AllocExclusive();
     M_FONTDATA->SetWeight(weight);
index c1a2bda2df82df8bb93ee3d9004d9a901c7ac6e6..ea4997a099f284d49ec46270bb2b6760cf15f3a9 100644 (file)
@@ -49,9 +49,9 @@ class wxFontRefData : public wxGDIRefData
 public:
     // from broken down font parameters, also default ctor
     wxFontRefData(int size = -1,
-                  int family = wxFONTFAMILY_DEFAULT,
-                  int style = wxFONTSTYLE_NORMAL,
-                  int weight = wxFONTWEIGHT_NORMAL,
+                  wxFontFamily family = wxFONTFAMILY_DEFAULT,
+                  wxFontStyle style = wxFONTSTYLE_NORMAL,
+                  wxFontWeight weight = wxFONTWEIGHT_NORMAL,
                   bool underlined = false,
                   const wxString& faceName = wxEmptyString,
                   wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
@@ -74,9 +74,9 @@ public:
     // setters: all of them also take care to modify m_nativeFontInfo if we
     // have it so as to not lose the information not carried by our fields
     void SetPointSize(int pointSize);
-    void SetFamily(int family);
-    void SetStyle(int style);
-    void SetWeight(int weight);
+    void SetFamily(wxFontFamily family);
+    void SetStyle(wxFontStyle style);
+    void SetWeight(wxFontWeight weight);
     void SetUnderlined(bool underlined);
     bool SetFaceName(const wxString& facename);
     void SetEncoding(wxFontEncoding encoding);
@@ -90,9 +90,9 @@ public:
 protected:
     // common part of all ctors
     void Init(int pointSize,
-              int family,
-              int style,
-              int weight,
+              wxFontFamily family,
+              wxFontStyle style,
+              wxFontWeight weight,
               bool underlined,
               const wxString& faceName,
               wxFontEncoding encoding);
@@ -105,9 +105,9 @@ private:
     void ClearGdkFonts();
 
     int             m_pointSize;
-    int             m_family,
-                    m_style,
-                    m_weight;
+    wxFontFamily    m_family;
+    wxFontStyle     m_style;
+    wxFontWeight    m_weight;
     bool            m_underlined;
     wxString        m_faceName;
     wxFontEncoding  m_encoding;
@@ -127,9 +127,9 @@ private:
 // ----------------------------------------------------------------------------
 
 void wxFontRefData::Init(int pointSize,
-                         int family,
-                         int style,
-                         int weight,
+                         wxFontFamily family,
+                         wxFontStyle style,
+                         wxFontWeight weight,
                          bool underlined,
                          const wxString& faceName,
                          wxFontEncoding encoding)
@@ -252,8 +252,8 @@ wxFontRefData::wxFontRefData( const wxFontRefData& data )
     m_nativeFontInfo.FromString(data.m_nativeFontInfo.ToString());
 }
 
-wxFontRefData::wxFontRefData(int size, int family, int style,
-                             int weight, bool underlined,
+wxFontRefData::wxFontRefData(int size, wxFontFamily family, wxFontStyle style,
+                             wxFontWeight weight, bool underlined,
                              const wxString& faceName,
                              wxFontEncoding encoding)
 {
@@ -287,21 +287,21 @@ void wxFontRefData::SetPointSize(int pointSize)
     m_nativeFontInfo.SetPointSize(pointSize);
 }
 
-void wxFontRefData::SetFamily(int family)
+void wxFontRefData::SetFamily(wxFontFamily family)
 {
     m_family = family;
 
     // TODO: what are we supposed to do with m_nativeFontInfo here?
 }
 
-void wxFontRefData::SetStyle(int style)
+void wxFontRefData::SetStyle(wxFontStyle style)
 {
     m_style = style;
 
     m_nativeFontInfo.SetStyle((wxFontStyle)style);
 }
 
-void wxFontRefData::SetWeight(int weight)
+void wxFontRefData::SetWeight(wxFontWeight weight)
 {
     m_weight = weight;
 
@@ -356,9 +356,9 @@ wxFont::wxFont(const wxNativeFontInfo& info)
 }
 
 bool wxFont::Create( int pointSize,
-                     int family,
-                     int style,
-                     int weight,
+                    wxFontFamily family,
+                    wxFontStyle style,
+                    wxFontWeight weight,
                      bool underlined,
                      const wxString& face,
                      wxFontEncoding encoding)
@@ -410,11 +410,11 @@ wxString wxFont::GetFaceName() const
                                        : M_FONTDATA->m_faceName;
 }
 
-int wxFont::GetFamily() const
+wxFontFamily wxFont::GetFamily() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTFAMILY_MAX, wxT("invalid font") );
 
-    int ret = M_FONTDATA->m_family;
+    wxFontFamily ret = M_FONTDATA->m_family;
     if (M_FONTDATA->HasNativeFont())
         // wxNativeFontInfo::GetFamily is expensive, must not call more than once
         ret = M_FONTDATA->m_nativeFontInfo.GetFamily();
@@ -425,17 +425,17 @@ int wxFont::GetFamily() const
     return ret;
 }
 
-int wxFont::GetStyle() const
+wxFontStyle wxFont::GetStyle() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") );
 
     return M_FONTDATA->HasNativeFont() ? M_FONTDATA->m_nativeFontInfo.GetStyle()
                                        : M_FONTDATA->m_style;
 }
 
-int wxFont::GetWeight() const
+wxFontWeight wxFont::GetWeight() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") );
 
     return M_FONTDATA->HasNativeFont() ? M_FONTDATA->m_nativeFontInfo.GetWeight()
                                        : M_FONTDATA->m_weight;
@@ -487,21 +487,21 @@ void wxFont::SetPointSize(int pointSize)
     M_FONTDATA->SetPointSize(pointSize);
 }
 
-void wxFont::SetFamily(int family)
+void wxFont::SetFamily(wxFontFamily family)
 {
     AllocExclusive();
 
     M_FONTDATA->SetFamily(family);
 }
 
-void wxFont::SetStyle(int style)
+void wxFont::SetStyle(wxFontStyle style)
 {
     AllocExclusive();
 
     M_FONTDATA->SetStyle(style);
 }
 
-void wxFont::SetWeight(int weight)
+void wxFont::SetWeight(wxFontWeight weight)
 {
     AllocExclusive();
 
index b032de7a6b86fbdbd07a7fdce72470afd5dc87a7..3fa21a96ab26b1597bf8336cf0f7531cec92e86c 100644 (file)
@@ -59,9 +59,9 @@ class wxFontRefData : public wxGDIRefData
 public:
     // from broken down font parameters, also default ctor
     wxFontRefData(int size = -1,
-                  int family = wxFONTFAMILY_DEFAULT,
-                  int style = wxFONTSTYLE_NORMAL,
-                  int weight = wxFONTWEIGHT_NORMAL,
+                  wxFontFamily family = wxFONTFAMILY_DEFAULT,
+                  wxFontStyle style = wxFONTSTYLE_NORMAL,
+                  wxFontWeight weight = wxFONTWEIGHT_NORMAL,
                   bool underlined = false,
                   const wxString& faceName = wxEmptyString,
                   wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
@@ -84,9 +84,9 @@ public:
     // setters: all of them also take care to modify m_nativeFontInfo if we
     // have it so as to not lose the information not carried by our fields
     void SetPointSize(int pointSize);
-    void SetFamily(int family);
-    void SetStyle(int style);
-    void SetWeight(int weight);
+    void SetFamily(wxFontFamily family);
+    void SetStyle(wxFontStyle style);
+    void SetWeight(wxFontWeight weight);
     void SetUnderlined(bool underlined);
     bool SetFaceName(const wxString& facename);
     void SetEncoding(wxFontEncoding encoding);
@@ -120,9 +120,9 @@ public:
 protected:
     // common part of all ctors
     void Init(int pointSize,
-              int family,
-              int style,
-              int weight,
+              wxFontFamily family,
+              wxFontStyle style,
+              wxFontWeight weight,
               bool underlined,
               const wxString& faceName,
               wxFontEncoding encoding);
@@ -138,9 +138,9 @@ private:
     wxScaledFontList  m_scaled_xfonts;
 
     int             m_pointSize;
-    int             m_family,
-                    m_style,
-                    m_weight;
+    wxFontFamily    m_family;
+    wxFontStyle     m_style;
+    wxFontWeight    m_weight;
     bool            m_underlined;
     wxString        m_faceName;
     wxFontEncoding  m_encoding;  // Unused under GTK 2.0
@@ -160,9 +160,9 @@ private:
 // ----------------------------------------------------------------------------
 
 void wxFontRefData::Init(int pointSize,
-                         int family,
-                         int style,
-                         int weight,
+                         wxFontFamily family,
+                         wxFontStyle style,
+                         wxFontWeight weight,
                          bool underlined,
                          const wxString& faceName,
                          wxFontEncoding encoding)
@@ -311,8 +311,8 @@ wxFontRefData::wxFontRefData( const wxFontRefData& data )
     m_nativeFontInfo.FromString(data.m_nativeFontInfo.ToString());
 }
 
-wxFontRefData::wxFontRefData(int size, int family, int style,
-                             int weight, bool underlined,
+wxFontRefData::wxFontRefData(int size, wxFontFamily family, wxFontStyle style,
+                             wxFontWeight weight, bool underlined,
                              const wxString& faceName,
                              wxFontEncoding encoding)
 {
@@ -365,14 +365,14 @@ void wxFontRefData::SetPointSize(int pointSize)
     }
 }
 
-void wxFontRefData::SetFamily(int family)
+void wxFontRefData::SetFamily(wxFontFamily family)
 {
     m_family = family;
 
     // TODO: what are we supposed to do with m_nativeFontInfo here?
 }
 
-void wxFontRefData::SetStyle(int style)
+void wxFontRefData::SetStyle(wxFontStyle style)
 {
     m_style = style;
 
@@ -401,7 +401,7 @@ void wxFontRefData::SetStyle(int style)
     }
 }
 
-void wxFontRefData::SetWeight(int weight)
+void wxFontRefData::SetWeight(wxFontWeight weight)
 {
     m_weight = weight;
 
@@ -488,9 +488,9 @@ wxFont::wxFont(const wxNativeFontInfo& info)
 }
 
 bool wxFont::Create( int pointSize,
-                     int family,
-                     int style,
-                     int weight,
+                    wxFontFamily family,
+                    wxFontStyle style,
+                    wxFontWeight weight,
                      bool underlined,
                      const wxString& face,
                      wxFontEncoding encoding)
@@ -564,23 +564,23 @@ wxString wxFont::GetFaceName() const
     return M_FONTDATA->m_faceName;
 }
 
-int wxFont::GetFamily() const
+wxFontFamily wxFont::GetFamily() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTFAMILY_MAX, wxT("invalid font") );
 
     return M_FONTDATA->m_family;
 }
 
-int wxFont::GetStyle() const
+wxFontStyle wxFont::GetStyle() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") );
 
     return M_FONTDATA->m_style;
 }
 
-int wxFont::GetWeight() const
+wxFontWeight wxFont::GetWeight() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") );
 
     return M_FONTDATA->m_weight;
 }
@@ -649,21 +649,21 @@ void wxFont::SetPointSize(int pointSize)
     M_FONTDATA->SetPointSize(pointSize);
 }
 
-void wxFont::SetFamily(int family)
+void wxFont::SetFamily(wxFontFamily family)
 {
     Unshare();
 
     M_FONTDATA->SetFamily(family);
 }
 
-void wxFont::SetStyle(int style)
+void wxFont::SetStyle(wxFontStyle style)
 {
     Unshare();
 
     M_FONTDATA->SetStyle(style);
 }
 
-void wxFont::SetWeight(int weight)
+void wxFont::SetWeight(wxFontWeight weight)
 {
     Unshare();
 
index db17cb1c013d425ac6ced9b5250ee5d071d2dc25..fb72e2d45c503c1cdc973015696145bf2f085f35 100644 (file)
@@ -45,9 +45,9 @@ bool wxFont::Create(const wxNativeFontInfo& info)
 }
 
 bool wxFont::Create(int pointSize,
-                    int family,
-                    int style,
-                    int weight,
+                    wxFontFamily family,
+                    wxFontStyle style,
+                    wxFontWeight weight,
                     bool underlined,
                     const wxString& face,
                     wxFontEncoding encoding)
@@ -95,23 +95,23 @@ wxString wxFont::GetFaceName() const
     return M_FONTDATA->GetFaceName();
 }
 
-int wxFont::GetFamily() const
+wxFontFamily wxFont::GetFamily() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTFAMILY_MAX, wxT("invalid font") );
 
     return M_FONTDATA->GetFamily();
 }
 
-int wxFont::GetStyle() const
+wxFontStyle wxFont::GetStyle() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") );
 
     return M_FONTDATA->GetStyle();
 }
 
-int wxFont::GetWeight() const
+wxFontWeight wxFont::GetWeight() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") );
 
     return M_FONTDATA->GetWeight();
 }
@@ -162,19 +162,19 @@ void wxFont::SetPointSize(int pointSize)
     M_FONTDATA->SetPointSize(pointSize);
 }
 
-void wxFont::SetFamily(int family)
+void wxFont::SetFamily(wxFontFamily family)
 {
     AllocExclusive();
     M_FONTDATA->SetFamily(family);
 }
 
-void wxFont::SetStyle(int style)
+void wxFont::SetStyle(wxFontStyle style)
 {
     AllocExclusive();
     M_FONTDATA->SetStyle(style);
 }
 
-void wxFont::SetWeight(int weight)
+void wxFont::SetWeight(wxFontWeight weight)
 {
     AllocExclusive();
     M_FONTDATA->SetWeight(weight);
index 32f80903e4b29aa2e94705e8e1658297545cea6c..a04811cc5c5f508e634a6be89fd2b3724a9e314a 100644 (file)
@@ -1736,7 +1736,9 @@ void wxWindowDCImpl::SetPen( const wxPen &pen )
             pixel = m_backgroundPixel;
         else
         {
-            pixel = CalculatePixel( (wxColour&) m_pen.GetColour(), m_currentColour, false);
+            wxColour penClr = m_pen.GetColour();
+            pixel = CalculatePixel( penClr, m_currentColour, false);
+            m_pen.SetColour(penClr);
         }
 
         // Finally, set the GC to the required colour
@@ -1898,7 +1900,9 @@ void wxWindowDCImpl::SetBrush( const wxBrush &brush )
     // must test m_logicalFunction, because it involves background!
     if (!sameColour || !GET_OPTIMIZATION || m_logicalFunction == wxXOR)
     {
-        WXPixel pixel = CalculatePixel( (wxColour&) m_brush.GetColour(), m_currentColour, true);
+        wxColour brushClr = m_brush.GetColour();
+        WXPixel pixel = CalculatePixel( brushClr, m_currentColour, true);
+        m_brush.SetColour(brushClr);
 
         if (pixel > -1)
             SetForegroundPixelWithLogicalFunction(pixel);
index 04d2e08318d63504b2638b9f10ba71242c828d47..53cf1c2a3fa20e53e143207b1a3077cca513c4ff 100644 (file)
@@ -75,9 +75,9 @@ class wxFontRefData: public wxGDIRefData
 
 public:
     wxFontRefData(int size = wxDEFAULT,
-                  int family = wxDEFAULT,
-                  int style = wxDEFAULT,
-                  int weight = wxDEFAULT,
+                  wxFontFamily family = wxFONTFAMILY_DEFAULT,
+                  wxFontStyle style = wxFONTSTYLE_NORMAL,
+                  wxFontWeight weight = wxFONTWEIGHT_NORMAL,
                   bool underlined = false,
                   const wxString& faceName = wxEmptyString,
                   wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
@@ -96,18 +96,18 @@ public:
 protected:
     // common part of all ctors
     void Init(int size,
-              int family,
-              int style,
-              int weight,
+              wxFontFamily family,
+              wxFontStyle style,
+              wxFontWeight weight,
               bool underlined,
               const wxString& faceName,
               wxFontEncoding encoding);
 
     // font attributes
     int           m_pointSize;
-    int           m_family;
-    int           m_style;
-    int           m_weight;
+    wxFontFamily  m_family;
+    wxFontStyle   m_style;
+    wxFontWeight  m_weight;
     bool          m_underlined;
     wxString      m_faceName;
     wxFontEncoding m_encoding;
@@ -166,27 +166,27 @@ wxXFont::~wxXFont()
 // ----------------------------------------------------------------------------
 
 void wxFontRefData::Init(int pointSize,
-                         int family,
-                         int style,
-                         int weight,
+                         wxFontFamily family,
+                         wxFontStyle style,
+                         wxFontWeight weight,
                          bool underlined,
                          const wxString& faceName,
                          wxFontEncoding encoding)
 {
     if (family == wxDEFAULT)
-        m_family = wxSWISS;
+        m_family = wxFONTFAMILY_SWISS;
     else
         m_family = family;
 
     m_faceName = faceName;
 
     if (style == wxDEFAULT)
-        m_style = wxNORMAL;
+        m_style = wxFONTSTYLE_NORMAL;
     else
         m_style = style;
 
     if (weight == wxDEFAULT)
-        m_weight = wxNORMAL;
+        m_weight = wxFONTWEIGHT_NORMAL;
     else
         m_weight = weight;
 
@@ -223,9 +223,9 @@ wxFont::wxFont(const wxNativeFontInfo& info)
 }
 
 bool wxFont::Create(int pointSize,
-                    int family,
-                    int style,
-                    int weight,
+                    wxFontFamily family,
+                    wxFontStyle style,
+                    wxFontWeight weight,
                     bool underlined,
                     const wxString& faceName,
                     wxFontEncoding encoding)
@@ -260,18 +260,18 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc)
     M_FONTDATA->m_faceName = tn.GetNextToken();  // family
 
     tmp = tn.GetNextToken().MakeUpper();         // weight
-    if (tmp == wxT("BOLD")) M_FONTDATA->m_weight = wxBOLD;
-    if (tmp == wxT("BLACK")) M_FONTDATA->m_weight = wxBOLD;
-    if (tmp == wxT("EXTRABOLD")) M_FONTDATA->m_weight = wxBOLD;
-    if (tmp == wxT("DEMIBOLD")) M_FONTDATA->m_weight = wxBOLD;
-    if (tmp == wxT("ULTRABOLD")) M_FONTDATA->m_weight = wxBOLD;
+    if (tmp == wxT("BOLD")) M_FONTDATA->m_weight = wxFONTWEIGHT_BOLD;
+    if (tmp == wxT("BLACK")) M_FONTDATA->m_weight = wxFONTWEIGHT_BOLD;
+    if (tmp == wxT("EXTRABOLD")) M_FONTDATA->m_weight = wxFONTWEIGHT_BOLD;
+    if (tmp == wxT("DEMIBOLD")) M_FONTDATA->m_weight = wxFONTWEIGHT_BOLD;
+    if (tmp == wxT("ULTRABOLD")) M_FONTDATA->m_weight = wxFONTWEIGHT_BOLD;
 
-    if (tmp == wxT("LIGHT")) M_FONTDATA->m_weight = wxLIGHT;
-    if (tmp == wxT("THIN")) M_FONTDATA->m_weight = wxLIGHT;
+    if (tmp == wxT("LIGHT")) M_FONTDATA->m_weight = wxFONTWEIGHT_LIGHT;
+    if (tmp == wxT("THIN")) M_FONTDATA->m_weight = wxFONTWEIGHT_LIGHT;
 
     tmp = tn.GetNextToken().MakeUpper();        // slant
-    if (tmp == wxT("I")) M_FONTDATA->m_style = wxITALIC;
-    if (tmp == wxT("O")) M_FONTDATA->m_style = wxITALIC;
+    if (tmp == wxT("I")) M_FONTDATA->m_style = wxFONTSTYLE_ITALIC;
+    if (tmp == wxT("O")) M_FONTDATA->m_style = wxFONTSTYLE_ITALIC;
 
     tn.GetNextToken();                           // set width
     tn.GetNextToken();                           // add. style
@@ -290,17 +290,17 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc)
     tmp = tn.GetNextToken().MakeUpper();         // spacing
 
     if (tmp == wxT("M"))
-        M_FONTDATA->m_family = wxMODERN;
+        M_FONTDATA->m_family = wxFONTFAMILY_MODERN;
     else if (M_FONTDATA->m_faceName == wxT("TIMES"))
-        M_FONTDATA->m_family = wxROMAN;
+        M_FONTDATA->m_family = wxFONTFAMILY_ROMAN;
     else if (M_FONTDATA->m_faceName == wxT("HELVETICA"))
-        M_FONTDATA->m_family = wxSWISS;
+        M_FONTDATA->m_family = wxFONTFAMILY_SWISS;
     else if (M_FONTDATA->m_faceName == wxT("LUCIDATYPEWRITER"))
-        M_FONTDATA->m_family = wxTELETYPE;
+        M_FONTDATA->m_family = wxFONTFAMILY_TELETYPE;
     else if (M_FONTDATA->m_faceName == wxT("LUCIDA"))
-        M_FONTDATA->m_family = wxDECORATIVE;
+        M_FONTDATA->m_family = wxFONTFAMILY_DECORATIVE;
     else if (M_FONTDATA->m_faceName == wxT("UTOPIA"))
-        M_FONTDATA->m_family = wxSCRIPT;
+        M_FONTDATA->m_family = wxFONTFAMILY_SCRIPT;
 
     tn.GetNextToken();                           // avg width
 
@@ -381,7 +381,7 @@ void wxFont::SetPointSize(int pointSize)
     M_FONTDATA->m_nativeFontInfo.GetXFontName().Clear(); // invalid now
 }
 
-void wxFont::SetFamily(int family)
+void wxFont::SetFamily(wxFontFamily family)
 {
     Unshare();
 
@@ -389,7 +389,7 @@ void wxFont::SetFamily(int family)
     M_FONTDATA->m_nativeFontInfo.GetXFontName().Clear(); // invalid now
 }
 
-void wxFont::SetStyle(int style)
+void wxFont::SetStyle(wxFontStyle style)
 {
     Unshare();
 
@@ -397,7 +397,7 @@ void wxFont::SetStyle(int style)
     M_FONTDATA->m_nativeFontInfo.GetXFontName().Clear(); // invalid now
 }
 
-void wxFont::SetWeight(int weight)
+void wxFont::SetWeight(wxFontWeight weight)
 {
     Unshare();
 
@@ -455,23 +455,23 @@ wxString wxFont::GetFaceName() const
     return M_FONTDATA->m_faceName ;
 }
 
-int wxFont::GetFamily() const
+wxFontFamily wxFont::GetFamily() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTFAMILY_MAX, wxT("invalid font") );
 
     return M_FONTDATA->m_family;
 }
 
-int wxFont::GetStyle() const
+wxFontStyle wxFont::GetStyle() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") );
 
     return M_FONTDATA->m_style;
 }
 
-int wxFont::GetWeight() const
+wxFontWeight wxFont::GetWeight() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") );
 
     return M_FONTDATA->m_weight;
 }
index 992dea1f0d45bcb90b0e53a5e249e58641b13652..778f351b9c779aabda641472319d7a015cbe8df7 100644 (file)
@@ -116,9 +116,9 @@ public:
     wxFontRefData(int size,
                   const wxSize& pixelSize,
                   bool sizeUsingPixels,
-                  int family,
-                  int style,
-                  int weight,
+                  wxFontFamily family,
+                  wxFontStyle style,
+                  wxFontWeight weight,
                   bool underlined,
                   const wxString& faceName,
                   wxFontEncoding encoding)
@@ -257,14 +257,14 @@ public:
         }
     }
 
-    void SetFamily(int family)
+    void SetFamily(wxFontFamily family)
     {
         Free();
 
         m_family = family;
     }
 
-    void SetStyle(int style)
+    void SetStyle(wxFontStyle style)
     {
         Free();
 
@@ -274,7 +274,7 @@ public:
             m_style = style;
     }
 
-    void SetWeight(int weight)
+    void SetWeight(wxFontWeight weight)
     {
         Free();
 
@@ -334,9 +334,9 @@ protected:
     void Init(int size,
               const wxSize& pixelSize,
               bool sizeUsingPixels,
-              int family,
-              int style,
-              int weight,
+              wxFontFamily family,
+              wxFontStyle style,
+              wxFontWeight weight,
               bool underlined,
               const wxString& faceName,
               wxFontEncoding encoding);
@@ -347,9 +347,9 @@ protected:
     int           m_pointSize;
     wxSize        m_pixelSize;
     bool          m_sizeUsingPixels;
-    int           m_family;
-    int           m_style;
-    int           m_weight;
+    wxFontFamily  m_family;
+    wxFontStyle   m_style;
+    wxFontWeight  m_weight;
     bool          m_underlined;
     wxString      m_faceName;
     wxFontEncoding m_encoding;
@@ -375,9 +375,9 @@ protected:
 void wxFontRefData::Init(int pointSize,
                          const wxSize& pixelSize,
                          bool sizeUsingPixels,
-                         int family,
-                         int style,
-                         int weight,
+                         wxFontFamily family,
+                         wxFontStyle style,
+                         wxFontWeight weight,
                          bool underlined,
                          const wxString& faceName,
                          wxFontEncoding encoding)
@@ -864,9 +864,9 @@ wxFont::wxFont(const wxString& fontdesc)
 bool wxFont::DoCreate(int pointSize,
                       const wxSize& pixelSize,
                       bool sizeUsingPixels,
-                      int family,
-                      int style,
-                      int weight,
+                      wxFontFamily family,
+                      wxFontStyle style,
+                      wxFontWeight weight,
                       bool underlined,
                       const wxString& faceName,
                       wxFontEncoding encoding)
@@ -958,21 +958,21 @@ void wxFont::SetPixelSize(const wxSize& pixelSize)
     M_FONTDATA->SetPixelSize(pixelSize);
 }
 
-void wxFont::SetFamily(int family)
+void wxFont::SetFamily(wxFontFamily family)
 {
     AllocExclusive();
 
     M_FONTDATA->SetFamily(family);
 }
 
-void wxFont::SetStyle(int style)
+void wxFont::SetStyle(wxFontStyle style)
 {
     AllocExclusive();
 
     M_FONTDATA->SetStyle(style);
 }
 
-void wxFont::SetWeight(int weight)
+void wxFont::SetWeight(wxFontWeight weight)
 {
     AllocExclusive();
 
@@ -1042,23 +1042,23 @@ bool wxFont::IsUsingSizeInPixels() const
     return M_FONTDATA->IsUsingSizeInPixels();
 }
 
-int wxFont::GetFamily() const
+wxFontFamily wxFont::GetFamily() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTFAMILY_MAX, wxT("invalid font") );
 
     return M_FONTDATA->GetFamily();
 }
 
-int wxFont::GetStyle() const
+wxFontStyle wxFont::GetStyle() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") );
 
     return M_FONTDATA->GetStyle();
 }
 
-int wxFont::GetWeight() const
+wxFontWeight wxFont::GetWeight() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") );
 
     return M_FONTDATA->GetWeight();
 }
index d8d7d0ea6df416248625a80454e4d3cc420a2060..88f305dc51dcffee0eb696dea0acb123a1256467 100644 (file)
@@ -272,9 +272,9 @@ protected:
     // Font characterstics
     //
     int                             m_nPointSize;
-    int                             m_nFamily;
-    int                             m_nStyle;
-    int                             m_nWeight;
+    wxFontFamily                    m_family;
+    wxFontStyle                     m_style;
+    wxFontWeight                    m_weight;
     bool                            m_bUnderlined;
     wxString                        m_sFaceName;
     wxFontEncoding                  m_vEncoding;
@@ -891,9 +891,9 @@ wxFont::wxFont(
 // in wxDC::SetFont, when information is available about scaling etc.
 // ----------------------------------------------------------------------------
 bool wxFont::Create( int             nPointSize,
-                     int             nFamily,
-                     int             nStyle,
-                     int             nWeight,
+                     wxFontFamily nFamily,
+                     wxFontStyle nStyle,
+                     wxFontWeight nWeight,
                      bool            bUnderlined,
                      const wxString& rsFaceName,
                      wxFontEncoding  vEncoding )
@@ -1082,23 +1082,23 @@ int wxFont::GetPointSize() const
     return M_FONTDATA->GetPointSize();
 } // end of wxFont::GetPointSize
 
-int wxFont::GetFamily() const
+wxFontFamily wxFont::GetFamily() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTFAMILY_MAX, wxT("invalid font") );
 
     return M_FONTDATA->GetFamily();
 } // end of wxFont::GetFamily
 
-int wxFont::GetStyle() const
+wxFontStyle wxFont::GetStyle() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") );
 
     return M_FONTDATA->GetStyle();
 } // end of wxFont::GetStyle
 
-int wxFont::GetWeight() const
+wxFontWeight wxFont::GetWeight() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") );
 
     return M_FONTDATA->GetWeight();
 }
index bc6040b5af2075f511f3a8a889a9da120c986e08..09f4b683e62cd50606e918283450905ced80df7d 100644 (file)
@@ -54,9 +54,9 @@ public:
     }
 
     wxFontRefData(int size,
-                  int family,
-                  int style,
-                  int weight,
+                  wxFontFamily family,
+                  wxFontStyle style,
+                  wxFontWeight weight,
                   bool underlined,
                   const wxString& faceName,
                   wxFontEncoding encoding)
@@ -84,7 +84,7 @@ public:
 
     int GetPointSize() const { return m_pointSize; }
 
-    void SetFamily( int family )
+    void SetFamily( wxFontFamily family )
     {
         m_family = family;
         MacInvalidateNativeFont();
@@ -93,7 +93,7 @@ public:
 
     int GetFamily() const { return m_family; }
 
-    void SetStyle( int style )
+    void SetStyle( wxFontStyle style )
     {
         m_style = style;
         MacInvalidateNativeFont();
@@ -102,7 +102,7 @@ public:
 
     int GetStyle() const { return m_style; }
 
-    void SetWeight( int weight )
+    void SetWeight( wxFontWeight weight )
     {
         m_weight = weight;
         MacInvalidateNativeFont();
@@ -142,9 +142,9 @@ public:
 protected:
     // common part of all ctors
     void Init(int size,
-              int family,
-              int style,
-              int weight,
+              wxFontFamily family,
+              wxFontStyle style,
+              wxFontWeight weight,
               bool underlined,
               const wxString& faceName,
               wxFontEncoding encoding);
@@ -154,9 +154,9 @@ protected:
 #endif
     // font characterstics
     int             m_pointSize;
-    int             m_family;
-    int             m_style;
-    int             m_weight;
+    wxFontFamily    m_family;
+    wxFontStyle     m_style;
+    wxFontWeight    m_weight;
     bool            m_underlined;
     wxString        m_faceName;
     wxFontEncoding  m_encoding;
@@ -202,9 +202,9 @@ public:
 // ----------------------------------------------------------------------------
 
 void wxFontRefData::Init(int pointSize,
-    int family,
-    int style,
-    int weight,
+    wxFontFamily family,
+    wxFontStyle style,
+    wxFontWeight weight,
     bool underlined,
     const wxString& faceName,
     wxFontEncoding encoding)
@@ -406,17 +406,17 @@ void wxFontRefData::MacFindFont()
                 }
             }
 
-            
+
             CTFontSymbolicTraits traits = 0;
 
             if (m_weight == wxBOLD)
                 traits |= kCTFontBoldTrait;
             if (m_style == wxITALIC || m_style == wxSLANT)
                 traits |= kCTFontItalicTrait;
-     
+
             // use font caching
             wxString lookupnameWithSize = wxString::Format( "%s_%ld_%ld", m_faceName.c_str(), traits, m_pointSize );
-            
+
             static std::map< std::wstring , wxCFRef< CTFontRef > > fontcache ;
             m_ctFont = fontcache[ std::wstring(lookupnameWithSize.wc_str()) ];
             if ( !m_ctFont )
@@ -429,7 +429,7 @@ void wxFontRefData::MacFindFont()
                         qdstyle |= bold;
                     if (m_style == wxITALIC || m_style == wxSLANT)
                         qdstyle |= italic;
-                    
+
                     Str255 qdFontName ;
                     wxMacStringToPascal( m_faceName , qdFontName );
                     m_ctFont.reset( CTFontCreateWithQuickdrawInstance(qdFontName, 0 , qdstyle, m_pointSize) );
@@ -454,7 +454,7 @@ void wxFontRefData::MacFindFont()
                         // TODO further fallbacks, synthesizing bold and italic, trying direct PostScript names etc
                     }
                 }
-                
+
                 fontcache[ std::wstring(lookupnameWithSize.wc_str()) ] = m_ctFont;
 #if 1 // debugging coretext font matching
                 CTFontSymbolicTraits received = CTFontGetSymbolicTraits( m_ctFont ) & 0x03;
@@ -473,7 +473,7 @@ void wxFontRefData::MacFindFont()
                     CFShow( dict );
                     CFRelease( dict );
                 }
-#endif  
+#endif
             }
 
         }
@@ -711,12 +711,12 @@ wxFont::wxFont(const wxString& fontdesc)
 }
 
 bool wxFont::Create(int pointSize,
-    int family,
-    int style,
-    int weight,
-    bool underlined,
-    const wxString& faceName,
-    wxFontEncoding encoding)
+                    wxFontFamily family,
+                    wxFontStyle style,
+                    wxFontWeight weight,
+                    bool underlined,
+                    const wxString& faceName,
+                    wxFontEncoding encoding)
 {
     UnRef();
 
@@ -837,7 +837,7 @@ void wxFont::SetPointSize(int pointSize)
     RealizeResource();
 }
 
-void wxFont::SetFamily(int family)
+void wxFont::SetFamily(wxFontFamily family)
 {
     Unshare();
 
@@ -846,7 +846,7 @@ void wxFont::SetFamily(int family)
     RealizeResource();
 }
 
-void wxFont::SetStyle(int style)
+void wxFont::SetStyle(wxFontStyle style)
 {
     Unshare();
 
@@ -855,7 +855,7 @@ void wxFont::SetStyle(int style)
     RealizeResource();
 }
 
-void wxFont::SetWeight(int weight)
+void wxFont::SetWeight(wxFontWeight weight)
 {
     Unshare();
 
@@ -921,23 +921,23 @@ wxSize wxFont::GetPixelSize() const
 #endif
 }
 
-int wxFont::GetFamily() const
+wxFontFamily wxFont::GetFamily() const
 {
-    wxCHECK_MSG( M_FONTDATA != NULL , 0, wxT("invalid font") );
+    wxCHECK_MSG( M_FONTDATA != NULL , wxFONTFAMILY_MAX, wxT("invalid font") );
 
     return M_FONTDATA->GetFamily();
 }
 
-int wxFont::GetStyle() const
+wxFontStyle wxFont::GetStyle() const
 {
-    wxCHECK_MSG( M_FONTDATA != NULL , 0, wxT("invalid font") );
+    wxCHECK_MSG( M_FONTDATA != NULL , wxFONTSTYLE_MAX, wxT("invalid font") );
 
     return M_FONTDATA->GetStyle() ;
 }
 
-int wxFont::GetWeight() const
+wxFontWeight wxFont::GetWeight() const
 {
-    wxCHECK_MSG( M_FONTDATA != NULL , 0, wxT("invalid font") );
+    wxCHECK_MSG( M_FONTDATA != NULL , wxFONTWEIGHT_MAX, wxT("invalid font") );
 
     return M_FONTDATA->GetWeight();
 }
index 5c79e75d42a5315616985c57c98803764c4f24be..56bc52c737355bd37c367366a0e276fef91d1ad6 100644 (file)
@@ -107,9 +107,9 @@ public:
     wxFontRefData(int size,
                   const wxSize& pixelSize,
                   bool sizeUsingPixels,
-                  int family,
-                  int style,
-                  int weight,
+                  wxFontFamily family,
+                  wxFontStyle style,
+                  wxFontWeight weight,
                   bool underlined,
                   const wxString& faceName,
                   wxFontEncoding encoding)
@@ -231,12 +231,12 @@ public:
         }
     }
 
-    void SetFamily(int family)
+    void SetFamily(wxFontFamily family)
     {
         m_family = family;
     }
 
-    void SetStyle(int style)
+    void SetStyle(wxFontStyle style)
     {
         if ( m_nativeFontInfoOk )
             m_nativeFontInfo.SetStyle((wxFontStyle)style);
@@ -244,7 +244,7 @@ public:
             m_style = style;
     }
 
-    void SetWeight(int weight)
+    void SetWeight(wxFontWeight weight)
     {
         if ( m_nativeFontInfoOk )
             m_nativeFontInfo.SetWeight((wxFontWeight)weight);
@@ -287,9 +287,9 @@ protected:
     void Init(int size,
               const wxSize& pixelSize,
               bool sizeUsingPixels,
-              int family,
-              int style,
-              int weight,
+              wxFontFamily family,
+              wxFontStyle style,
+              wxFontWeight weight,
               bool underlined,
               const wxString& faceName,
               wxFontEncoding encoding);
@@ -300,9 +300,9 @@ protected:
     int           m_pointSize;
     wxSize        m_pixelSize;
     bool          m_sizeUsingPixels;
-    int           m_family;
-    int           m_style;
-    int           m_weight;
+    wxFontFamily  m_family;
+    wxFontStyle   m_style;
+    wxFontWeight  m_weight;
     bool          m_underlined;
     wxString      m_faceName;
     wxFontEncoding m_encoding;
@@ -328,9 +328,9 @@ protected:
 void wxFontRefData::Init(int pointSize,
                          const wxSize& pixelSize,
                          bool sizeUsingPixels,
-                         int family,
-                         int style,
-                         int weight,
+                         wxFontFamily family,
+                         wxFontStyle style,
+                         wxFontWeight weight,
                          bool underlined,
                          const wxString& faceName,
                          wxFontEncoding encoding)
@@ -381,9 +381,9 @@ wxFont::wxFont(const wxString& fontdesc)
 bool wxFont::DoCreate(int pointSize,
                       const wxSize& pixelSize,
                       bool sizeUsingPixels,
-                      int family,
-                      int style,
-                      int weight,
+                      wxFontFamily family,
+                      wxFontStyle style,
+                      wxFontWeight weight,
                       bool underlined,
                       const wxString& faceName,
                       wxFontEncoding encoding)
@@ -440,15 +440,15 @@ void wxFont::SetPixelSize(const wxSize& pixelSize)
 {
 }
 
-void wxFont::SetFamily(int family)
+void wxFont::SetFamily(wxFontFamily family)
 {
 }
 
-void wxFont::SetStyle(int style)
+void wxFont::SetStyle(wxFontStyle style)
 {
 }
 
-void wxFont::SetWeight(int weight)
+void wxFont::SetWeight(wxFontWeight weight)
 {
 }
 
@@ -488,17 +488,17 @@ bool wxFont::IsUsingSizeInPixels() const
     return false;
 }
 
-int wxFont::GetFamily() const
+wxFontFamily wxFont::GetFamily() const
 {
     return wxFONTFAMILY_ROMAN;
 }
 
-int wxFont::GetStyle() const
+wxFontStyle wxFont::GetStyle() const
 {
     return wxFONTSTYLE_NORMAL;
 }
 
-int wxFont::GetWeight() const
+wxFontWeight wxFont::GetWeight() const
 {
     return wxFONTWEIGHT_NORMAL;
 }
index 7d035d8c4b318b6ea85b96954b18b54907c0e92c..b37530a1992994f7ece6498dc29c027097ccb08b 100644 (file)
@@ -99,9 +99,9 @@ friend class wxFont;
 
 public:
     wxFontRefData(int size = wxDEFAULT,
-                  int family = wxDEFAULT,
-                  int style = wxDEFAULT,
-                  int weight = wxDEFAULT,
+                  wxFontFamily family = wxFONTFAMILY_DEFAULT,
+                  wxFontStyle style = wxFONTSTYLE_NORMAL,
+                  wxFontWeight weight = wxFONTWEIGHT_NORMAL,
                   bool underlined = false,
                   const wxString& faceName = wxEmptyString,
                   wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
@@ -118,9 +118,9 @@ public:
     // setters: all of them also take care to modify m_nativeFontInfo if we
     // have it so as to not lose the information not carried by our fields
     void SetPointSize(int pointSize);
-    void SetFamily(int family);
-    void SetStyle(int style);
-    void SetWeight(int weight);
+    void SetFamily(wxFontFamily family);
+    void SetStyle(wxFontStyle style);
+    void SetWeight(wxFontWeight weight);
     void SetUnderlined(bool underlined);
     bool SetFaceName(const wxString& facename);
     void SetEncoding(wxFontEncoding encoding);
@@ -134,9 +134,9 @@ public:
 protected:
     // common part of all ctors
     void Init(int size,
-              int family,
-              int style,
-              int weight,
+              wxFontFamily family,
+              wxFontStyle style,
+              wxFontWeight weight,
               bool underlined,
               const wxString& faceName,
               wxFontEncoding encoding);
@@ -146,9 +146,9 @@ protected:
 
     // font attributes
     int           m_pointSize;
-    int           m_family;
-    int           m_style;
-    int           m_weight;
+    wxFontFamily  m_family;
+    wxFontStyle   m_style;
+    wxFontWeight  m_weight;
     bool          m_underlined;
     wxString      m_faceName;
     wxFontEncoding m_encoding;   // Unused in Unicode mode
@@ -172,9 +172,9 @@ protected:
 // ----------------------------------------------------------------------------
 
 void wxFontRefData::Init(int pointSize,
-                         int family,
-                         int style,
-                         int weight,
+                         wxFontFamily family,
+                         wxFontStyle style,
+                         wxFontWeight weight,
                          bool underlined,
                          const wxString& faceName,
                          wxFontEncoding encoding)
@@ -419,8 +419,8 @@ wxFontRefData::wxFontRefData( const wxFontRefData& data )
     m_nativeFontInfo = data.m_nativeFontInfo;
 }
 
-wxFontRefData::wxFontRefData(int size, int family, int style,
-                             int weight, bool underlined,
+wxFontRefData::wxFontRefData(int size, wxFontFamily family, wxFontStyle style,
+                             wxFontWeight weight, bool underlined,
                              const wxString& faceName,
                              wxFontEncoding encoding)
 {
@@ -474,14 +474,14 @@ void wxFontRefData::SetPointSize(int pointSize)
 #endif
 }
 
-void wxFontRefData::SetFamily(int family)
+void wxFontRefData::SetFamily(wxFontFamily family)
 {
     m_family = family;
 
     // TODO: what are we supposed to do with m_nativeFontInfo here?
 }
 
-void wxFontRefData::SetStyle(int style)
+void wxFontRefData::SetStyle(wxFontStyle style)
 {
     m_style = style;
 
@@ -507,7 +507,7 @@ void wxFontRefData::SetStyle(int style)
 #endif
 }
 
-void wxFontRefData::SetWeight(int weight)
+void wxFontRefData::SetWeight(wxFontWeight weight)
 {
     m_weight = weight;
 }
@@ -561,9 +561,9 @@ wxFont::wxFont(const wxNativeFontInfo& info)
 }
 
 bool wxFont::Create(int pointSize,
-                    int family,
-                    int style,
-                    int weight,
+                    wxFontFamily family,
+                    wxFontStyle style,
+                    wxFontWeight weight,
                     bool underlined,
                     const wxString& faceName,
                     wxFontEncoding encoding)
@@ -733,23 +733,23 @@ wxString wxFont::GetFaceName() const
     return M_FONTDATA->m_faceName;
 }
 
-int wxFont::GetFamily() const
+wxFontFamily wxFont::GetFamily() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTFAMILY_MAX, wxT("invalid font") );
 
     return M_FONTDATA->m_family;
 }
 
-int wxFont::GetStyle() const
+wxFontStyle wxFont::GetStyle() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") );
 
     return M_FONTDATA->m_style;
 }
 
-int wxFont::GetWeight() const
+wxFontWeight wxFont::GetWeight() const
 {
-    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+    wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") );
 
     return M_FONTDATA->m_weight;
 }
@@ -822,21 +822,21 @@ void wxFont::SetPointSize(int pointSize)
     M_FONTDATA->SetPointSize(pointSize);
 }
 
-void wxFont::SetFamily(int family)
+void wxFont::SetFamily(wxFontFamily family)
 {
     Unshare();
 
     M_FONTDATA->SetFamily(family);
 }
 
-void wxFont::SetStyle(int style)
+void wxFont::SetStyle(wxFontStyle style)
 {
     Unshare();
 
     M_FONTDATA->SetStyle(style);
 }
 
-void wxFont::SetWeight(int weight)
+void wxFont::SetWeight(wxFontWeight weight)
 {
     Unshare();