]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/winundef.h
The new wxRect doesn't compile so I #if 0ed it
[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 _UNICODE
121 inline int StartDoc(HDC h, CONST DOCINFOW* info)
122 {
123 return StartDocW(h, info);
124 }
125 #else
126 inline int StartDoc(HDC h, CONST DOCINFOA* info)
127 {
128 return StartDocA(h, info);
129 }
130 #endif
131 #endif
132
133 // GetObject
134
135 #ifdef GetObject
136 #undef GetObject
137 inline int GetObject(HGDIOBJ h, int i, LPVOID buffer)
138 {
139 #ifdef _UNICODE
140 return GetObjectW(h, i, buffer);
141 #else
142 return GetObjectA(h, i, buffer);
143 #endif
144 }
145 #endif
146
147
148 // For ming and cygwin
149
150 // GetFirstChild
151 #ifdef GetFirstChild
152 #undef GetFirstChild
153 inline HWND GetFirstChild(HWND h)
154 {
155 return GetTopWindow(h);
156 }
157 #endif
158
159
160 // GetNextSibling
161 #ifdef GetNextSibling
162 #undef GetNextSibling
163 inline HWND GetNextSibling(HWND h)
164 {
165 return GetWindow(h, GW_HWNDNEXT);
166 }
167 #endif
168
169 // GetWindowProc
170 //ifdef GetWindowProc
171 // #undef GetWindowProc
172 //endif
173 //ifdef GetNextChild
174 // #undef GetNextChild
175 //endif
176
177 #endif // _WX_WINUNDEF_H_