X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b5dbe15d0bacde245539f54c4d97af6b4696f01f..ab67e8874db324fab5223cc8d5dff8a8de3e2b77:/include/wx/motif/private.h?ds=sidebyside diff --git a/include/wx/motif/private.h b/include/wx/motif/private.h index 816fc71fcc..5b05c6e249 100644 --- a/include/wx/motif/private.h +++ b/include/wx/motif/private.h @@ -13,7 +13,8 @@ #define _WX_PRIVATE_H_ #include "wx/defs.h" -#include "X11/Xlib.h" +#include +#include #include "wx/evtloop.h" class WXDLLIMPEXP_FWD_CORE wxFont; @@ -43,7 +44,7 @@ class WXDLLIMPEXP_FWD_CORE wxColour; // (non const) "char *" but many Motif functions take "char *" parameters which // are really "const char *" so use this macro to suppress the warnings when we // know it's ok -#define wxMOTIF_STR(x) wx_const_cast(char *, x) +#define wxMOTIF_STR(x) const_cast(x) // ---------------------------------------------------------------------------- // Miscellaneous functions @@ -128,8 +129,11 @@ extern XColor itemColors[5] ; // ---------------------------------------------------------------------------- wxString wxXmStringToString( const XmString& xmString ); -XmString wxStringToXmString( const wxString& string ); XmString wxStringToXmString( const char* string ); +inline XmString wxStringToXmString( const wxScopedCharBuffer& string ) + { return wxStringToXmString(string.data()); } +inline XmString wxStringToXmString( const wxString& string ) + { return wxStringToXmString((const char*)string.mb_str()); } // XmString made easy to use in wxWidgets (and has an added benefit of // cleaning up automatically) @@ -137,7 +141,11 @@ class wxXmString { void Init(const char *str) { - m_string = XmStringCreateLtoR((char *)str, XmSTRING_DEFAULT_CHARSET); + m_string = XmStringCreateLtoR + ( + const_cast(str), + const_cast(XmSTRING_DEFAULT_CHARSET) + ); } public: @@ -146,6 +154,11 @@ public: Init(str); } + wxXmString(const wchar_t* str) + { + Init(wxConvLibc.cWC2MB(str)); + } + wxXmString(const wxString& str) { Init(str.mb_str());