X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5f11fef5435283f9d2465f7eaccdd72d2f3fb1ef..c08ee0349dd4ed6d62f734fe576e47c7027e2b9e:/src/gtk/utilsgtk.cpp diff --git a/src/gtk/utilsgtk.cpp b/src/gtk/utilsgtk.cpp index d0fd5c36a0..f615293ba2 100644 --- a/src/gtk/utilsgtk.cpp +++ b/src/gtk/utilsgtk.cpp @@ -11,11 +11,14 @@ #include "wx/wxprec.h" #include "wx/utils.h" -#include "wx/string.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" + #include "wx/intl.h" + #include "wx/log.h" +#endif #include "wx/apptrait.h" -#include "wx/intl.h" -#include "wx/log.h" #include "wx/process.h" @@ -69,12 +72,12 @@ bool wxSetDetectableAutoRepeat( bool flag ) { Bool result; XkbSetDetectableAutoRepeat( GDK_DISPLAY(), flag, &result ); - return result; /* TRUE if keyboard hardware supports this mode */ + return result; /* true if keyboard hardware supports this mode */ } #else bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) ) { - return FALSE; + return false; } #endif @@ -152,7 +155,7 @@ void wxGetMousePosition( int* x, int* y ) bool wxColourDisplay() { - return TRUE; + return true; } int wxDisplayDepth() @@ -190,7 +193,16 @@ wxCharBuffer wxConvertToGTK(const wxString& s, wxFontEncoding enc) return wxCharBuffer(s); } - const wxWCharBuffer wbuf = wxCSConv(enc).cMB2WC(s); + wxWCharBuffer wbuf; + if ( enc == wxFONTENCODING_SYSTEM || enc == wxFONTENCODING_DEFAULT ) + { + wbuf = wxConvUI->cMB2WC(s); + } + else // another encoding, use generic conversion class + { + wbuf = wxCSConv(enc).cMB2WC(s); + } + wxCharBuffer buf; if ( wbuf ) buf = wxConvUTF8.cWC2MB(wbuf); @@ -247,4 +259,3 @@ int wxAddProcessCallback(wxEndProcessData *proc_data, int fd) return tag; } -