]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/font.cpp
added changes in order to make at least button events work on mac
[wxWidgets.git] / src / motif / font.cpp
index 10ab6faf5bd090cad51e3be9991d855ff8a3a285..a032dd8775526dca4f00fa541e26635b7fe76d68 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        font.cpp
+// Name:        src/motif/font.cpp
 // Purpose:     wxFont class
 // Author:      Julian Smart
 // Modified by:
     #pragma implementation "font.h"
 #endif
 
+#ifdef __VMS
+#pragma message disable nosimpint
+#include "wx/vms_x_fix.h"
+#endif
 #include <Xm/Xm.h>
+#ifdef __VMS
+#pragma message enable nosimpint
+#endif
 
 #include "wx/defs.h"
 #include "wx/string.h"
 #include "wx/font.h"
 #include "wx/gdicmn.h"
 #include "wx/utils.h"       // for wxGetDisplay()
-#include "wx/fontutil.h"
+#include "wx/fontutil.h"    // for wxNativeFontInfo
 
-#if !USE_SHARED_LIBRARIES
-    IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
-#endif
+IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
 
 // ----------------------------------------------------------------------------
 // private classes
@@ -181,10 +186,16 @@ wxFontRefData::~wxFontRefData()
 // wxFont
 // ----------------------------------------------------------------------------
 
+wxFont::wxFont(const wxNativeFontInfo& info)
+{
+    Init();
+
+    (void)Create(info.pointSize, info.family, info.style, info.weight,
+                 info.underlined, info.faceName, info.encoding);
+}
+
 void wxFont::Init()
 {
-    if ( wxTheFontList )
-        wxTheFontList->Append(this);
 }
 
 bool wxFont::Create(int pointSize,
@@ -206,8 +217,6 @@ bool wxFont::Create(int pointSize,
 
 wxFont::~wxFont()
 {
-    if ( wxTheFontList )
-        wxTheFontList->DeleteObject(this);
 }
 
 // ----------------------------------------------------------------------------
@@ -360,7 +369,8 @@ wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const
     }
 
     // not found, create a new one
-    XFontStruct *font = wxLoadQueryNearestFont(pointSize,
+    XFontStruct *font = (XFontStruct *)
+                        wxLoadQueryNearestFont(pointSize,
                                                M_FONTDATA->m_family,
                                                M_FONTDATA->m_style,
                                                M_FONTDATA->m_weight,
@@ -398,3 +408,4 @@ WXFontList wxFont::GetFontList(double scale, WXDisplay* display) const
 
     return (f ? f->m_fontList : (WXFontList) 0);
 }
+