X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/551fe9528a2c08886a48a8e13234a4f2228f7b4c..eebb8902d970787df1e70b83e011ce051ebead21:/include/wx/motif/private.h?ds=sidebyside diff --git a/include/wx/motif/private.h b/include/wx/motif/private.h index c19974fbe4..5b05c6e249 100644 --- a/include/wx/motif/private.h +++ b/include/wx/motif/private.h @@ -13,13 +13,15 @@ #define _WX_PRIVATE_H_ #include "wx/defs.h" -#include "X11/Xlib.h" +#include +#include +#include "wx/evtloop.h" -class WXDLLEXPORT wxFont; -class WXDLLEXPORT wxWindow; -class WXDLLEXPORT wxSize; -class WXDLLEXPORT wxBitmap; -class WXDLLEXPORT wxColour; +class WXDLLIMPEXP_FWD_CORE wxFont; +class WXDLLIMPEXP_FWD_CORE wxWindow; +class WXDLLIMPEXP_FWD_CORE wxSize; +class WXDLLIMPEXP_FWD_CORE wxBitmap; +class WXDLLIMPEXP_FWD_CORE wxColour; #include "wx/x11/privx.h" @@ -42,7 +44,7 @@ class WXDLLEXPORT 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 @@ -106,6 +108,9 @@ extern void wxGetTextExtent(WXDisplay* display, const wxFont& font, double scale, const wxString& string, int* width, int* height, int* ascent, int* descent); +extern void wxGetTextExtent(const wxWindow* window, const wxString& str, + int* width, int* height, + int* ascent, int* descent); #define wxNO_COLORS 0x00 #define wxBACK_COLORS 0x01 @@ -124,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) @@ -133,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: @@ -142,6 +154,11 @@ public: Init(str); } + wxXmString(const wchar_t* str) + { + Init(wxConvLibc.cWC2MB(str)); + } + wxXmString(const wxString& str) { Init(str.mb_str()); @@ -182,11 +199,9 @@ wxSize wxDoGetSingleTextCtrlBestSize( Widget textWidget, // event-related functions // ---------------------------------------------------------------------------- -class wxEventLoop; - // executes one main loop iteration (implemented in src/motif/evtloop.cpp) // returns true if the loop should be exited -bool wxDoEventLoopIteration( wxEventLoop& evtLoop ); +bool wxDoEventLoopIteration( wxGUIEventLoop& evtLoop ); // Consume all events until no more left void wxFlushEvents(WXDisplay* display);