]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/winundef.h
Attempt at getting mingw32 working again... still doesn't work
[wxWidgets.git] / include / wx / msw / winundef.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: winundef.h
3 // Purpose: undefine the common symbols #define'd by <windows.h>
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 16.05.99
7 // RCS-ID: $Id$
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_WINUNDEF_H_
13 #define _WX_WINUNDEF_H_
14
15 // windows.h #defines the following identifiers which are also used in wxWin
16
17 // GetCharWidth
18
19 #ifdef GetCharWidth
20 #undef GetCharWidth
21 inline BOOL GetCharWidth(HDC dc, UINT first, UINT last, LPINT buffer)
22 {
23 #ifdef _UNICODE
24 return GetCharWidthW(dc, first, last, buffer);
25 #else
26 return GetCharWidthA(dc, first, last, buffer);
27 #endif
28 }
29 #endif
30
31 // FindWindow
32
33 #ifdef FindWindow
34 #undef FindWindow
35 #ifdef _UNICODE
36 inline HWND FindWindow(LPCWSTR classname, LPCWSTR windowname)
37 {
38 return FindWindowW(classname, windowname);
39 }
40 #else
41 inline HWND FindWindow(LPCSTR classname, LPCSTR windowname)
42 {
43 return FindWindowA(classname, windowname);
44 }
45 #endif
46 #endif
47
48 // GetClassName
49
50 #ifdef GetClassName
51 #undef GetClassName
52 #ifdef _UNICODE
53 inline int GetClassName(HWND h, LPWSTR classname, int maxcount)
54 {
55 return GetClassNameW(h, classname, maxcount);
56 }
57 #else
58 inline int GetClassName(HWND h, LPSTR classname, int maxcount)
59 {
60 return GetClassNameA(h, classname, maxcount);
61 }
62 #endif
63 #endif
64
65 // GetClassInfo
66
67 #ifdef GetClassInfo
68 #undef GetClassInfo
69 #ifdef _UNICODE
70 inline BOOL GetClassInfo(HINSTANCE h, LPCWSTR name, LPWNDCLASSW winclass)
71 {
72 return GetClassInfoW(h, name, winclass);
73 }
74 #else
75 inline BOOL GetClassInfo(HINSTANCE h, LPCSTR name, LPWNDCLASSA winclass)
76 {
77 return GetClassInfoA(h, name, winclass);
78 }
79 #endif
80 #endif
81
82 // LoadAccelerators
83
84 #ifdef LoadAccelerators
85 #undef LoadAccelerators
86 #ifdef _UNICODE
87 inline HACCEL LoadAccelerators(HINSTANCE h, LPCWSTR name)
88 {
89 return LoadAcceleratorsW(h, name);
90 }
91 #else
92 inline HACCEL LoadAccelerators(HINSTANCE h, LPCSTR name)
93 {
94 return LoadAcceleratorsA(h, name);
95 }
96 #endif
97 #endif
98
99 // DrawText
100
101 #ifdef DrawText
102 #undef DrawText
103 #ifdef _UNICODE
104 inline int DrawText(HDC h, LPCWSTR str, int count, LPRECT rect, UINT format)
105 {
106 return DrawTextW(h, str, count, rect, format);
107 }
108 #else
109 inline int DrawText(HDC h, LPCSTR str, int count, LPRECT rect, UINT format)
110 {
111 return DrawTextA(h, str, count, rect, format);
112 }
113 #endif
114 #endif
115
116 // StartDoc
117
118 #ifdef StartDoc
119 #undef StartDoc
120 #ifdef __MINGW32__
121 #define DOCINFOW DOCINFO
122 #define DOCINFOA DOCINFO
123 #endif
124 #ifdef _UNICODE
125 inline int StartDoc(HDC h, CONST DOCINFOW* info)
126 {
127 return StartDocW(h, info);
128 }
129 #else
130 inline int StartDoc(HDC h, CONST DOCINFOA* info)
131 {
132 return StartDocA(h, info);
133 }
134 #endif
135 #endif
136
137 // GetObject
138
139 #ifdef GetObject
140 #undef GetObject
141 inline int GetObject(HGDIOBJ h, int i, LPVOID buffer)
142 {
143 #ifdef _UNICODE
144 return GetObjectW(h, i, buffer);
145 #else
146 return GetObjectA(h, i, buffer);
147 #endif
148 }
149 #endif
150
151
152 // For ming and cygwin
153
154 // GetFirstChild
155 #ifdef GetFirstChild
156 #undef GetFirstChild
157 inline HWND GetFirstChild(HWND h)
158 {
159 return GetTopWindow(h);
160 }
161 #endif
162
163
164 // GetNextSibling
165 #ifdef GetNextSibling
166 #undef GetNextSibling
167 inline HWND GetNextSibling(HWND h)
168 {
169 return GetWindow(h, GW_HWNDNEXT);
170 }
171 #endif
172
173 // GetWindowProc
174 //ifdef GetWindowProc
175 // #undef GetWindowProc
176 //endif
177 //ifdef GetNextChild
178 // #undef GetNextChild
179 //endif
180
181 #endif // _WX_WINUNDEF_H_