win32.h
author Darkvater
Sun, 03 Dec 2006 17:47:53 +0000
changeset 5218 bde1f7566777
parent 5168 e206899169c4
child 5222 66a48f112460
permissions -rw-r--r--
(svn r7333) -Codechange: [win32] Extend the OTTD2FS and FS2OTTD functions to also accept conversions
into a predefined buffer insted of using the static (global) buffer. This is useful if
the converted value will be used later on; no need to copy it somewhere else to save it.
-CodeChange: [win32] Added appropiate macros WIDE_TO_MB_BUFFER, MB_TO_WIDE_BUFFER next to
existing WIDE_TO_MB and MB_TO_WIDE that only do work when UNICODE is defined, saves
#ifdefs all over the place
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2183
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2183
diff changeset
     2
2183
b88b90aba8bc (svn r2697) Make compiling with SDL on Windows work again (missing #includes) and fix some warnings
tron
parents:
diff changeset
     3
#ifndef WIN32_H
b88b90aba8bc (svn r2697) Make compiling with SDL on Windows work again (missing #includes) and fix some warnings
tron
parents:
diff changeset
     4
#define WIN32_H
b88b90aba8bc (svn r2697) Make compiling with SDL on Windows work again (missing #includes) and fix some warnings
tron
parents:
diff changeset
     5
2207
be1ef1e1fc58 (svn r2725) Move MyShowCursor() back into win32.c, it fits better there
tron
parents: 2186
diff changeset
     6
bool MyShowCursor(bool show);
be1ef1e1fc58 (svn r2725) Move MyShowCursor() back into win32.c, it fits better there
tron
parents: 2186
diff changeset
     7
2183
b88b90aba8bc (svn r2697) Make compiling with SDL on Windows work again (missing #includes) and fix some warnings
tron
parents:
diff changeset
     8
typedef void (*Function)(int);
5168
e206899169c4 (svn r7278) -Codechange: [win32] Add UNICODE support so it should compile on OS's using UNICODE
Darkvater
parents: 2436
diff changeset
     9
bool LoadLibraryList(Function proc[], const char *dll);
e206899169c4 (svn r7278) -Codechange: [win32] Add UNICODE support so it should compile on OS's using UNICODE
Darkvater
parents: 2436
diff changeset
    10
5218
bde1f7566777 (svn r7333) -Codechange: [win32] Extend the OTTD2FS and FS2OTTD functions to also accept conversions
Darkvater
parents: 5168
diff changeset
    11
char *convert_from_fs(const wchar_t *name, char *utf8_buf, size_t buflen);
bde1f7566777 (svn r7333) -Codechange: [win32] Extend the OTTD2FS and FS2OTTD functions to also accept conversions
Darkvater
parents: 5168
diff changeset
    12
wchar_t *convert_to_fs(const char *name, wchar_t *utf16_buf, size_t buflen);
bde1f7566777 (svn r7333) -Codechange: [win32] Extend the OTTD2FS and FS2OTTD functions to also accept conversions
Darkvater
parents: 5168
diff changeset
    13
5168
e206899169c4 (svn r7278) -Codechange: [win32] Add UNICODE support so it should compile on OS's using UNICODE
Darkvater
parents: 2436
diff changeset
    14
#if defined(UNICODE)
5218
bde1f7566777 (svn r7333) -Codechange: [win32] Extend the OTTD2FS and FS2OTTD functions to also accept conversions
Darkvater
parents: 5168
diff changeset
    15
# define MB_TO_WIDE(str) OTTD2FS(str)
bde1f7566777 (svn r7333) -Codechange: [win32] Extend the OTTD2FS and FS2OTTD functions to also accept conversions
Darkvater
parents: 5168
diff changeset
    16
# define MB_TO_WIDE_BUFFER(str, buffer, buflen) convert_to_fs(str, buffer, buflen)
bde1f7566777 (svn r7333) -Codechange: [win32] Extend the OTTD2FS and FS2OTTD functions to also accept conversions
Darkvater
parents: 5168
diff changeset
    17
# define WIDE_TO_MB(str) FS2OTTD(str)
bde1f7566777 (svn r7333) -Codechange: [win32] Extend the OTTD2FS and FS2OTTD functions to also accept conversions
Darkvater
parents: 5168
diff changeset
    18
# define WIDE_TO_MB_BUFFER(str, buffer, buflen) convert_from_fs(str, buffer, buflen)
5168
e206899169c4 (svn r7278) -Codechange: [win32] Add UNICODE support so it should compile on OS's using UNICODE
Darkvater
parents: 2436
diff changeset
    19
#else
5218
bde1f7566777 (svn r7333) -Codechange: [win32] Extend the OTTD2FS and FS2OTTD functions to also accept conversions
Darkvater
parents: 5168
diff changeset
    20
# define MB_TO_WIDE(str) (str)
bde1f7566777 (svn r7333) -Codechange: [win32] Extend the OTTD2FS and FS2OTTD functions to also accept conversions
Darkvater
parents: 5168
diff changeset
    21
# define MB_TO_WIDE_BUFFER(str, buffer, buflen) (str)
bde1f7566777 (svn r7333) -Codechange: [win32] Extend the OTTD2FS and FS2OTTD functions to also accept conversions
Darkvater
parents: 5168
diff changeset
    22
# define WIDE_TO_MB(str) (str)
bde1f7566777 (svn r7333) -Codechange: [win32] Extend the OTTD2FS and FS2OTTD functions to also accept conversions
Darkvater
parents: 5168
diff changeset
    23
# define WIDE_TO_MB_BUFFER(str, buffer, buflen) (str)
5168
e206899169c4 (svn r7278) -Codechange: [win32] Add UNICODE support so it should compile on OS's using UNICODE
Darkvater
parents: 2436
diff changeset
    24
#endif
2183
b88b90aba8bc (svn r2697) Make compiling with SDL on Windows work again (missing #includes) and fix some warnings
tron
parents:
diff changeset
    25
2436
7d5df545bd5d (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2207
diff changeset
    26
#endif /* WIN32_H */