comctl32: Add Str_SetPtrWtoA analogue to Str_SetPtrAtoW.
[wine] / dlls / comctl32 / comctl32.h
1 /******************************************************************************
2  *
3  * Common definitions (resource ids and global variables)
4  *
5  * Copyright 1999 Thuy Nguyen
6  * Copyright 1999 Eric Kohl
7  * Copyright 2002 Dimitrie O. Paun
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22  */
23
24 #ifndef __WINE_COMCTL32_H
25 #define __WINE_COMCTL32_H
26
27 #ifndef RC_INVOKED
28 #include <stdarg.h>
29 #endif
30
31 #include "windef.h"
32 #include "winbase.h"
33 #include "wingdi.h"
34 #include "winuser.h"
35 #include "winnls.h"
36 #include "commctrl.h"
37
38 extern HMODULE COMCTL32_hModule;
39 extern HBRUSH  COMCTL32_hPattern55AABrush;
40
41 /* Property sheet / Wizard */
42 #define IDD_PROPSHEET 1006
43 #define IDD_WIZARD    1020
44
45 #define IDC_TABCONTROL   12320
46 #define IDC_APPLY_BUTTON 12321
47 #define IDC_BACK_BUTTON  12323
48 #define IDC_NEXT_BUTTON  12324
49 #define IDC_FINISH_BUTTON 12325
50 #define IDC_SUNKEN_LINE   12326
51 #define IDC_SUNKEN_LINEHEADER 12327
52
53 #define IDS_CLOSE         4160
54
55 /* Toolbar customization dialog */
56 #define IDD_TBCUSTOMIZE     200
57
58 #define IDC_AVAILBTN_LBOX   201
59 #define IDC_RESET_BTN       202
60 #define IDC_TOOLBARBTN_LBOX 203
61 #define IDC_REMOVE_BTN      204
62 #define IDC_HELP_BTN        205
63 #define IDC_MOVEUP_BTN      206
64 #define IDC_MOVEDN_BTN      207
65
66 #define IDS_SEPARATOR      1024
67
68 /* Toolbar imagelist bitmaps */
69 #define IDB_STD_SMALL       120
70 #define IDB_STD_LARGE       121
71 #define IDB_VIEW_SMALL      124
72 #define IDB_VIEW_LARGE      125
73 #define IDB_HIST_SMALL      130
74 #define IDB_HIST_LARGE      131
75
76
77 /* Month calendar month menu popup */
78 #define IDD_MCMONTHMENU     300
79
80 #define IDM_JAN                         301
81 #define IDM_FEB                         302
82 #define IDM_MAR                         303
83 #define IDM_APR                         304
84 #define IDM_MAY                         305
85 #define IDM_JUN                         306
86 #define IDM_JUL                         307
87 #define IDM_AUG                         308
88 #define IDM_SEP                         309
89 #define IDM_OCT                         310
90 #define IDM_NOV                         311
91 #define IDM_DEC                         312
92
93 #define IDM_TODAY                      4163
94 #define IDM_GOTODAY                    4164
95
96 /* Treeview Checkboxes */
97
98 #define IDT_CHECK        401
99
100
101 /* Header cursors */
102 #define IDC_DIVIDER                     106
103 #define IDC_DIVIDEROPEN                 107
104
105
106 /* DragList resources */
107 #define IDI_DRAGARROW                   501
108 #define IDC_COPY                        502
109
110 #define IDC_MOVEBUTTON                    1
111
112 /* HOTKEY internal strings */
113 #define HKY_NONE                        2048
114
115 /* Tooltip icons */
116 #define IDI_TT_INFO_SM                   22
117 #define IDI_TT_WARN_SM                   25
118 #define IDI_TT_ERROR_SM                  28
119
120 typedef struct
121 {
122     COLORREF clrBtnHighlight;       /* COLOR_BTNHIGHLIGHT                  */
123     COLORREF clrBtnShadow;          /* COLOR_BTNSHADOW                     */
124     COLORREF clrBtnText;            /* COLOR_BTNTEXT                       */
125     COLORREF clrBtnFace;            /* COLOR_BTNFACE                       */
126     COLORREF clrHighlight;          /* COLOR_HIGHLIGHT                     */
127     COLORREF clrHighlightText;      /* COLOR_HIGHLIGHTTEXT                 */
128     COLORREF clr3dHilight;          /* COLOR_3DHILIGHT                     */
129     COLORREF clr3dShadow;           /* COLOR_3DSHADOW                      */
130     COLORREF clr3dDkShadow;         /* COLOR_3DDKSHADOW                    */
131     COLORREF clr3dFace;             /* COLOR_3DFACE                        */
132     COLORREF clrWindow;             /* COLOR_WINDOW                        */
133     COLORREF clrWindowText;         /* COLOR_WINDOWTEXT                    */
134     COLORREF clrGrayText;           /* COLOR_GREYTEXT                      */
135     COLORREF clrActiveCaption;      /* COLOR_ACTIVECAPTION                 */
136     COLORREF clrInfoBk;             /* COLOR_INFOBK                        */
137     COLORREF clrInfoText;           /* COLOR_INFOTEXT                      */
138 } COMCTL32_SysColor;
139
140 extern COMCTL32_SysColor  comctl32_color;
141
142 /* Internal function */
143 HWND COMCTL32_CreateToolTip (HWND);
144 VOID COMCTL32_RefreshSysColors(void);
145 void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark, BOOL bHorizontal);
146 INT  Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen);
147 BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc);
148 BOOL Str_SetPtrWtoA (LPSTR *lppDest, LPCWSTR lpSrc);
149
150 #define COMCTL32_VERSION_MINOR 80
151 #define WINE_FILEVERSION 5, COMCTL32_VERSION_MINOR, 0, 0
152 #define WINE_FILEVERSIONSTR "5.80"
153
154 /* Our internal stack structure of the window procedures to subclass */
155 typedef struct _SUBCLASSPROCS {
156     SUBCLASSPROC subproc;
157     UINT_PTR id;
158     DWORD_PTR ref;
159     struct _SUBCLASSPROCS *next;
160 } SUBCLASSPROCS, *LPSUBCLASSPROCS;
161
162 typedef struct
163 {
164    SUBCLASSPROCS *SubclassProcs;
165    SUBCLASSPROCS *stackpos;
166    WNDPROC origproc;
167    int running;
168 } SUBCLASS_INFO, *LPSUBCLASS_INFO;
169
170 /* undocumented functions */
171
172 LPVOID WINAPI Alloc (DWORD);
173 LPVOID WINAPI ReAlloc (LPVOID, DWORD);
174 BOOL   WINAPI Free (LPVOID);
175 DWORD  WINAPI GetSize (LPVOID);
176
177 INT  WINAPI Str_GetPtrA (LPCSTR, LPSTR, INT);
178 INT  WINAPI Str_GetPtrW (LPCWSTR, LPWSTR, INT);
179
180 INT  WINAPI DPA_GetPtrIndex (const HDPA, LPVOID);
181 BOOL WINAPI DPA_Grow (const HDPA, INT);
182
183 #define DPAM_NOSORT             0x0001
184 #define DPAM_INSERT             0x0004
185 #define DPAM_DELETE             0x0008
186
187 typedef PVOID (CALLBACK *PFNDPAMERGE)(DWORD,PVOID,PVOID,LPARAM);
188 BOOL WINAPI DPA_Merge (const HDPA, const HDPA, DWORD, PFNDPACOMPARE, PFNDPAMERGE, LPARAM);
189
190 #define DPA_GetPtrCount(hdpa)  (*(INT*)(hdpa))
191
192 LRESULT WINAPI SetPathWordBreakProc(HWND hwnd, BOOL bSet);
193 BOOL WINAPI MirrorIcon(HICON *phicon1, HICON *phicon2);
194
195 extern void ANIMATE_Register(void);
196 extern void ANIMATE_Unregister(void);
197 extern void COMBOEX_Register(void);
198 extern void COMBOEX_Unregister(void);
199 extern void DATETIME_Register(void);
200 extern void DATETIME_Unregister(void);
201 extern void FLATSB_Register(void);
202 extern void FLATSB_Unregister(void);
203 extern void HEADER_Register(void);
204 extern void HEADER_Unregister(void);
205 extern void HOTKEY_Register(void);
206 extern void HOTKEY_Unregister(void);
207 extern void IPADDRESS_Register(void);
208 extern void IPADDRESS_Unregister(void);
209 extern void LISTVIEW_Register(void);
210 extern void LISTVIEW_Unregister(void);
211 extern void MONTHCAL_Register(void);
212 extern void MONTHCAL_Unregister(void);
213 extern void NATIVEFONT_Register(void);
214 extern void NATIVEFONT_Unregister(void);
215 extern void PAGER_Register(void);
216 extern void PAGER_Unregister(void);
217 extern void PROGRESS_Register(void);
218 extern void PROGRESS_Unregister(void);
219 extern void REBAR_Register(void);
220 extern void REBAR_Unregister(void);
221 extern void STATUS_Register(void);
222 extern void STATUS_Unregister(void);
223 extern void SYSLINK_Register(void);
224 extern void SYSLINK_Unregister(void);
225 extern void TAB_Register(void);
226 extern void TAB_Unregister(void);
227 extern void TOOLBAR_Register(void);
228 extern void TOOLBAR_Unregister(void);
229 extern void TOOLTIPS_Register(void);
230 extern void TOOLTIPS_Unregister(void);
231 extern void TRACKBAR_Register(void);
232 extern void TRACKBAR_Unregister(void);
233 extern void TREEVIEW_Register(void);
234 extern void TREEVIEW_Unregister(void);
235 extern void UPDOWN_Register(void);
236 extern void UPDOWN_Unregister(void);
237
238
239 int MONTHCAL_MonthLength(int month, int year);
240
241 static inline void MONTHCAL_CopyTime(const SYSTEMTIME *from, SYSTEMTIME *to)
242 {
243   to->wYear = from->wYear;
244   to->wMonth = from->wMonth;
245   to->wDayOfWeek = from->wDayOfWeek;
246   to->wDay = from->wDay;
247   to->wHour = from->wHour;
248   to->wMinute = from->wMinute;
249   to->wSecond = from->wSecond;
250   to->wMilliseconds = from->wMilliseconds;
251 }
252
253 extern void THEMING_Initialize(void);
254 extern void THEMING_Uninitialize(void);
255 extern LRESULT THEMING_CallOriginalClass(HWND, UINT, WPARAM, LPARAM);
256 extern void THEMING_SetSubclassData(HWND, ULONG_PTR);
257
258 #endif  /* __WINE_COMCTL32_H */