]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/strvararg.h
add aglUpdateContext() call (doesn't seem to change anything but should be there...
[wxWidgets.git] / include / wx / strvararg.h
index fd7301603a0081a510696234c5bbefeaf8a28387..6ad650be857c846eb3c702746ea5267a324fc8a8 100644 (file)
     #error "OpenWatcom version >= 1.4 is required to compile this code"
 #endif
 
     #error "OpenWatcom version >= 1.4 is required to compile this code"
 #endif
 
-// include wchar_t definition if needed:
-#if defined(__WATCOMC__)
-#include <inttypes.h>
-#elif defined(__VISUALC__)
-#include <stdlib.h>
-#endif
-
+#include "wx/chartype.h"
 
 class WXDLLIMPEXP_BASE wxCStrData;
 class WXDLLIMPEXP_BASE wxString;
 
 class WXDLLIMPEXP_BASE wxCStrData;
 class WXDLLIMPEXP_BASE wxString;
@@ -95,27 +89,11 @@ struct wxArgNormalizer
 
 // special cases for converting strings:
 
 
 // special cases for converting strings:
 
-// FIXME-UTF8: move this to wxchartype.h!
-#if wxUSE_UNICODE
-    /* for now, all Unicode builds are wchar_t* based: */
-    #define wxUSE_UNICODE_WCHAR 1
-#else
-    #define wxUSE_UNICODE_WCHAR 0
-#endif
-
-// FIXME-UTF8: include wx/wxchartype.h and use wxChar after headers split
-// FIXME-UTF8: this will be char* in UTF-8 build and wchar_t* on Windows
-#if wxUSE_UNICODE_WCHAR
-    typedef wchar_t wxArgNativeCharType;
-#else
-    typedef char wxArgNativeCharType;
-#endif
-
 template<>
 struct WXDLLIMPEXP_BASE wxArgNormalizer<const wxCStrData&>
 {
     wxArgNormalizer(const wxCStrData& value) : m_value(value) {}
 template<>
 struct WXDLLIMPEXP_BASE wxArgNormalizer<const wxCStrData&>
 {
     wxArgNormalizer(const wxCStrData& value) : m_value(value) {}
-    const wxArgNativeCharType *get() const;
+    const wxStringCharType *get() const;
 
     const wxCStrData& m_value;
 };
 
     const wxCStrData& m_value;
 };
@@ -131,7 +109,7 @@ template<>
 struct WXDLLIMPEXP_BASE wxArgNormalizer<const wxString&>
 {
     wxArgNormalizer(const wxString& value) : m_value(value) {}
 struct WXDLLIMPEXP_BASE wxArgNormalizer<const wxString&>
 {
     wxArgNormalizer(const wxString& value) : m_value(value) {}
-    const wxArgNativeCharType *get() const;
+    const wxStringCharType *get() const;
 
     const wxString& m_value;
 };
 
     const wxString& m_value;
 };
@@ -183,6 +161,23 @@ struct wxArgNormalizer<wchar_t*> : public wxArgNormalizer<const wchar_t*>
 
 #endif // wxUSE_UNICODE_WCHAR / !wxUSE_UNICODE_WCHAR && wxUSE_WCHAR_T
 
 
 #endif // wxUSE_UNICODE_WCHAR / !wxUSE_UNICODE_WCHAR && wxUSE_WCHAR_T
 
+// versions for passing wx[W]CharBuffer:
+template<>
+struct WXDLLIMPEXP_BASE wxArgNormalizer<wxCharBuffer>
+            : public wxArgNormalizer<const char*>
+{
+    wxArgNormalizer(const wxCharBuffer& buf);
+};
+
+template<>
+struct WXDLLIMPEXP_BASE wxArgNormalizer<wxWCharBuffer>
+            : public wxArgNormalizer<const wchar_t*>
+{
+    wxArgNormalizer(const wxWCharBuffer& buf);
+};
+
+
+
 // NB: The vararg emulation code is limited to 30 arguments at the moment.
 //     If you need more, you need to
 //        1) increase the value of _WX_VARARG_MAX_ARGS
 // NB: The vararg emulation code is limited to 30 arguments at the moment.
 //     If you need more, you need to
 //        1) increase the value of _WX_VARARG_MAX_ARGS