]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/chartype.h
Apply [ 1713345 ] combobox: cmd accelerators shouldn't steal editing hotkeys
[wxWidgets.git] / include / wx / chartype.h
index c73722946ad1e0e6b772aa790f494a11dbdb8194..5162b91dafa8ba9d5a95928c21187e7b92125371 100644 (file)
     #endif /* __WCHAR_TYPE__ */
 #endif /* ASCII/Unicode */
 
+/* ------------------------------------------------------------------------- */
+/* define wxStringCharType                                                   */
+/* ------------------------------------------------------------------------- */
+
+/* depending on the platform, Unicode build can either store wxStrings as
+   wchar_t* or UTF-8 encoded char*: */
+#if wxUSE_UNICODE
+    // FIXME-UTF8: what would be better place for this?
+    #if defined(wxUSE_UTF8_LOCALE_ONLY) && !defined(wxUSE_UNICODE_UTF8)
+        #error "wxUSE_UTF8_LOCALE_ONLY only makes sense with wxUSE_UNICODE_UTF8"
+    #endif
+    #ifndef wxUSE_UTF8_LOCALE_ONLY
+        #define wxUSE_UTF8_LOCALE_ONLY 0
+    #endif
+
+    #ifndef wxUSE_UNICODE_UTF8
+        #define wxUSE_UNICODE_UTF8 0
+    #endif
+
+    #if wxUSE_UNICODE_UTF8
+        #define wxUSE_UNICODE_WCHAR 0
+    #else
+        #define wxUSE_UNICODE_WCHAR 1
+    #endif
+#else
+    #define wxUSE_UNICODE_WCHAR 0
+    #define wxUSE_UNICODE_UTF8  0
+    #define wxUSE_UTF8_LOCALE_ONLY 0
+#endif
+
+/* define char type used by wxString internal representation: */
+#if wxUSE_UNICODE_UTF8
+    typedef char wxStringCharType;
+#elif wxUSE_UNICODE_WCHAR
+    typedef wchar_t wxStringCharType;
+#else
+    typedef char wxStringCharType;
+#endif
+
+
 /* ------------------------------------------------------------------------- */
 /* define _T() and related macros                                            */
 /* ------------------------------------------------------------------------- */