Merge branch 'dev' of git://feistymeow.org/feisty_meow into dev
[feisty_meow.git] / nucleus / library / loggers / definitions_wx.h
1 #ifndef WX_DEFINITIONS_GROUP
2 #define WX_DEFINITIONS_GROUP
3
4 /*****************************************************************************\
5 *                                                                             *
6 *  Name   : definitions for wx                                                *
7 *  Author : Chris Koeritz                                                     *
8 *                                                                             *
9 *  Purpose:                                                                   *
10 *                                                                             *
11 *    Some macros that support the use of WX widgets.                          *
12 *                                                                             *
13 *******************************************************************************
14 * Copyright (c) 2006-$now By Author.  This program is free software; you can  *
15 * redistribute it and/or modify it under the terms of the GNU General Public  *
16 * License as published by the Free Software Foundation; either version 2 of   *
17 * the License or (at your option) any later version.  This is online at:      *
18 *     http://www.fsf.org/copyleft/gpl.html                                    *
19 * Please send any updates to: fred@gruntose.com                               *
20 \*****************************************************************************/
21
22 #include <basis/utf_conversion.h>
23
24 #include <wx/defs.h>
25
26 namespace loggers {
27
28 #ifdef wxUSE_UNICODE
29   //! converts to wx's UTF-16 string format.
30   #define to_unicode_wx(s) ((const wxChar *)(const flexichar *)transcode_to_utf16(s))
31   //! converts a wx UTF-16 string to UTF-8.
32   #define from_unicode_wx(s) ((const char *)(const UTF8 *)transcode_to_utf8(s))
33 #else
34   // turn off the unicode macro to ensure nothing gets confused.
35   #undef UNICODE
36   // placeholder macros try not to do much.
37   #define to_unicode_wx(s) ((const wxChar *)null_transcoder(s, false))
38   #define from_unicode_wx(s) ((const char *)null_transcoder((const wxChar *)s, false))
39 #endif
40
41 } //namespace.
42
43 #endif
44