[COMCTL32] -Reduce diff with user32 and move all data of the button in a single struct.
[reactos.git] / reactos / dll / win32 / 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24 #ifndef __WINE_COMCTL32_H
25 #define __WINE_COMCTL32_H
26
27 #include <wine/config.h>
28
29 #include <stdarg.h>
30 #include <assert.h>
31
32 #define _INC_WINDOWS
33 #define COM_NO_WINDOWS_H
34
35 #define COBJMACROS
36 #define NONAMELESSUNION
37 #define NONAMELESSSTRUCT
38
39 #include <windef.h>
40 #include <winbase.h>
41 #include <wingdi.h>
42 #include <winuser.h>
43 #include <winreg.h>
44 #include <objbase.h>
45 #include <uxtheme.h>
46 #include <vssym32.h>
47
48 #include <wine/unicode.h>
49 #include <wine/debug.h>
50
51 #include "resource.h"
52
53 extern HMODULE COMCTL32_hModule DECLSPEC_HIDDEN;
54 extern HBRUSH COMCTL32_hPattern55AABrush DECLSPEC_HIDDEN;
55
56 typedef struct
57 {
58 COLORREF clrBtnHighlight; /* COLOR_BTNHIGHLIGHT */
59 COLORREF clrBtnShadow; /* COLOR_BTNSHADOW */
60 COLORREF clrBtnText; /* COLOR_BTNTEXT */
61 COLORREF clrBtnFace; /* COLOR_BTNFACE */
62 COLORREF clrHighlight; /* COLOR_HIGHLIGHT */
63 COLORREF clrHighlightText; /* COLOR_HIGHLIGHTTEXT */
64 COLORREF clrHotTrackingColor; /* COLOR_HOTLIGHT */
65 COLORREF clr3dHilight; /* COLOR_3DHILIGHT */
66 COLORREF clr3dShadow; /* COLOR_3DSHADOW */
67 COLORREF clr3dDkShadow; /* COLOR_3DDKSHADOW */
68 COLORREF clr3dFace; /* COLOR_3DFACE */
69 COLORREF clrWindow; /* COLOR_WINDOW */
70 COLORREF clrWindowText; /* COLOR_WINDOWTEXT */
71 COLORREF clrGrayText; /* COLOR_GREYTEXT */
72 COLORREF clrActiveCaption; /* COLOR_ACTIVECAPTION */
73 COLORREF clrInfoBk; /* COLOR_INFOBK */
74 COLORREF clrInfoText; /* COLOR_INFOTEXT */
75 } COMCTL32_SysColor;
76
77 extern COMCTL32_SysColor comctl32_color DECLSPEC_HIDDEN;
78
79 typedef struct _BUTTON_DATA {
80 LONG state;
81 HFONT font;
82 LONG_PTR image;
83 DWORD ui_state;
84 } BUTTON_DATA, *PBUTTON_DATA;
85
86 static inline PBUTTON_DATA _GetButtonData(HWND hwnd)
87 {
88 return (PBUTTON_DATA)GetWindowLongPtrW( hwnd, 0 );
89 }
90
91 /* Internal function */
92 HWND COMCTL32_CreateToolTip (HWND) DECLSPEC_HIDDEN;
93 VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN;
94 void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark, BOOL bHorizontal) DECLSPEC_HIDDEN;
95 void COMCTL32_EnsureBitmapSize(HBITMAP *pBitmap, int cxMinWidth, int cyMinHeight, COLORREF crBackground) DECLSPEC_HIDDEN;
96 void COMCTL32_GetFontMetrics(HFONT hFont, TEXTMETRICW *ptm) DECLSPEC_HIDDEN;
97 BOOL COMCTL32_IsReflectedMessage(UINT uMsg) DECLSPEC_HIDDEN;
98 INT Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen) DECLSPEC_HIDDEN;
99 INT Str_GetPtrAtoW (LPCSTR lpSrc, LPWSTR lpDest, INT nMaxLen) DECLSPEC_HIDDEN;
100 BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc) DECLSPEC_HIDDEN;
101 BOOL Str_SetPtrWtoA (LPSTR *lppDest, LPCWSTR lpSrc) DECLSPEC_HIDDEN;
102
103 /* Our internal stack structure of the window procedures to subclass */
104 typedef struct _SUBCLASSPROCS {
105 SUBCLASSPROC subproc;
106 UINT_PTR id;
107 DWORD_PTR ref;
108 struct _SUBCLASSPROCS *next;
109 } SUBCLASSPROCS, *LPSUBCLASSPROCS;
110
111 typedef struct
112 {
113 SUBCLASSPROCS *SubclassProcs;
114 SUBCLASSPROCS *stackpos;
115 WNDPROC origproc;
116 int running;
117 } SUBCLASS_INFO, *LPSUBCLASS_INFO;
118
119 /* undocumented functions */
120
121 LPVOID WINAPI Alloc (DWORD) __WINE_ALLOC_SIZE(1);
122 LPVOID WINAPI ReAlloc (LPVOID, DWORD) __WINE_ALLOC_SIZE(2);
123 BOOL WINAPI Free (LPVOID);
124 DWORD WINAPI GetSize (LPVOID);
125
126 INT WINAPI Str_GetPtrA (LPCSTR, LPSTR, INT);
127 INT WINAPI Str_GetPtrW (LPCWSTR, LPWSTR, INT);
128
129 LRESULT WINAPI SetPathWordBreakProc(HWND hwnd, BOOL bSet);
130 BOOL WINAPI MirrorIcon(HICON *phicon1, HICON *phicon2);
131
132 extern void ANIMATE_Register(void) DECLSPEC_HIDDEN;
133 extern void ANIMATE_Unregister(void) DECLSPEC_HIDDEN;
134 extern void COMBOEX_Register(void) DECLSPEC_HIDDEN;
135 extern void COMBOEX_Unregister(void) DECLSPEC_HIDDEN;
136 extern void DATETIME_Register(void) DECLSPEC_HIDDEN;
137 extern void DATETIME_Unregister(void) DECLSPEC_HIDDEN;
138 extern void FLATSB_Register(void) DECLSPEC_HIDDEN;
139 extern void FLATSB_Unregister(void) DECLSPEC_HIDDEN;
140 extern void HEADER_Register(void) DECLSPEC_HIDDEN;
141 extern void HEADER_Unregister(void) DECLSPEC_HIDDEN;
142 extern void HOTKEY_Register(void) DECLSPEC_HIDDEN;
143 extern void HOTKEY_Unregister(void) DECLSPEC_HIDDEN;
144 extern void IPADDRESS_Register(void) DECLSPEC_HIDDEN;
145 extern void IPADDRESS_Unregister(void) DECLSPEC_HIDDEN;
146 extern void LISTVIEW_Register(void) DECLSPEC_HIDDEN;
147 extern void LISTVIEW_Unregister(void) DECLSPEC_HIDDEN;
148 extern void MONTHCAL_Register(void) DECLSPEC_HIDDEN;
149 extern void MONTHCAL_Unregister(void) DECLSPEC_HIDDEN;
150 extern void NATIVEFONT_Register(void) DECLSPEC_HIDDEN;
151 extern void NATIVEFONT_Unregister(void) DECLSPEC_HIDDEN;
152 extern void PAGER_Register(void) DECLSPEC_HIDDEN;
153 extern void PAGER_Unregister(void) DECLSPEC_HIDDEN;
154 extern void PROGRESS_Register(void) DECLSPEC_HIDDEN;
155 extern void PROGRESS_Unregister(void) DECLSPEC_HIDDEN;
156 extern void REBAR_Register(void) DECLSPEC_HIDDEN;
157 extern void REBAR_Unregister(void) DECLSPEC_HIDDEN;
158 extern void STATUS_Register(void) DECLSPEC_HIDDEN;
159 extern void STATUS_Unregister(void) DECLSPEC_HIDDEN;
160 extern void SYSLINK_Register(void) DECLSPEC_HIDDEN;
161 extern void SYSLINK_Unregister(void) DECLSPEC_HIDDEN;
162 extern void TAB_Register(void) DECLSPEC_HIDDEN;
163 extern void TAB_Unregister(void) DECLSPEC_HIDDEN;
164 extern void TOOLBAR_Register(void) DECLSPEC_HIDDEN;
165 extern void TOOLBAR_Unregister(void) DECLSPEC_HIDDEN;
166 extern void TOOLTIPS_Register(void) DECLSPEC_HIDDEN;
167 extern void TOOLTIPS_Unregister(void) DECLSPEC_HIDDEN;
168 extern void TRACKBAR_Register(void) DECLSPEC_HIDDEN;
169 extern void TRACKBAR_Unregister(void) DECLSPEC_HIDDEN;
170 extern void TREEVIEW_Register(void) DECLSPEC_HIDDEN;
171 extern void TREEVIEW_Unregister(void) DECLSPEC_HIDDEN;
172 extern void UPDOWN_Register(void) DECLSPEC_HIDDEN;
173 extern void UPDOWN_Unregister(void) DECLSPEC_HIDDEN;
174 extern void BUTTON_Register();
175 extern void BUTTON_Unregister();
176
177 int MONTHCAL_MonthLength(int month, int year) DECLSPEC_HIDDEN;
178 int MONTHCAL_CalculateDayOfWeek(SYSTEMTIME *date, BOOL inplace) DECLSPEC_HIDDEN;
179 LONG MONTHCAL_CompareSystemTime(const SYSTEMTIME *first, const SYSTEMTIME *second) DECLSPEC_HIDDEN;
180
181 extern void THEMING_Initialize(HANDLE hActCtx5, HANDLE hActCtx6) DECLSPEC_HIDDEN;
182 extern void THEMING_Uninitialize(void) DECLSPEC_HIDDEN;
183 extern LRESULT THEMING_CallOriginalClass(HWND, UINT, WPARAM, LPARAM) DECLSPEC_HIDDEN;
184 extern void THEMING_SetSubclassData(HWND, ULONG_PTR) DECLSPEC_HIDDEN;
185
186 #endif /* __WINE_COMCTL32_H */