[COMCTL32] -Implement BCM_GETTEXTMARGIN, BCM_SETTEXTMARGIN, BCM_SETIMAGELIST and...
[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
85 RECT rcTextMargin;
86 BUTTON_IMAGELIST imlData;
87 } BUTTON_DATA, *PBUTTON_DATA;
88
89 static inline PBUTTON_DATA _GetButtonData(HWND hwnd)
90 {
91 return (PBUTTON_DATA)GetWindowLongPtrW( hwnd, 0 );
92 }
93
94 /* Internal function */
95 HWND COMCTL32_CreateToolTip (HWND) DECLSPEC_HIDDEN;
96 VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN;
97 void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark, BOOL bHorizontal) DECLSPEC_HIDDEN;
98 void COMCTL32_EnsureBitmapSize(HBITMAP *pBitmap, int cxMinWidth, int cyMinHeight, COLORREF crBackground) DECLSPEC_HIDDEN;
99 void COMCTL32_GetFontMetrics(HFONT hFont, TEXTMETRICW *ptm) DECLSPEC_HIDDEN;
100 BOOL COMCTL32_IsReflectedMessage(UINT uMsg) DECLSPEC_HIDDEN;
101 INT Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen) DECLSPEC_HIDDEN;
102 INT Str_GetPtrAtoW (LPCSTR lpSrc, LPWSTR lpDest, INT nMaxLen) DECLSPEC_HIDDEN;
103 BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc) DECLSPEC_HIDDEN;
104 BOOL Str_SetPtrWtoA (LPSTR *lppDest, LPCWSTR lpSrc) DECLSPEC_HIDDEN;
105
106 /* Our internal stack structure of the window procedures to subclass */
107 typedef struct _SUBCLASSPROCS {
108 SUBCLASSPROC subproc;
109 UINT_PTR id;
110 DWORD_PTR ref;
111 struct _SUBCLASSPROCS *next;
112 } SUBCLASSPROCS, *LPSUBCLASSPROCS;
113
114 typedef struct
115 {
116 SUBCLASSPROCS *SubclassProcs;
117 SUBCLASSPROCS *stackpos;
118 WNDPROC origproc;
119 int running;
120 } SUBCLASS_INFO, *LPSUBCLASS_INFO;
121
122 /* undocumented functions */
123
124 LPVOID WINAPI Alloc (DWORD) __WINE_ALLOC_SIZE(1);
125 LPVOID WINAPI ReAlloc (LPVOID, DWORD) __WINE_ALLOC_SIZE(2);
126 BOOL WINAPI Free (LPVOID);
127 DWORD WINAPI GetSize (LPVOID);
128
129 INT WINAPI Str_GetPtrA (LPCSTR, LPSTR, INT);
130 INT WINAPI Str_GetPtrW (LPCWSTR, LPWSTR, INT);
131
132 LRESULT WINAPI SetPathWordBreakProc(HWND hwnd, BOOL bSet);
133 BOOL WINAPI MirrorIcon(HICON *phicon1, HICON *phicon2);
134
135 extern void ANIMATE_Register(void) DECLSPEC_HIDDEN;
136 extern void ANIMATE_Unregister(void) DECLSPEC_HIDDEN;
137 extern void COMBOEX_Register(void) DECLSPEC_HIDDEN;
138 extern void COMBOEX_Unregister(void) DECLSPEC_HIDDEN;
139 extern void DATETIME_Register(void) DECLSPEC_HIDDEN;
140 extern void DATETIME_Unregister(void) DECLSPEC_HIDDEN;
141 extern void FLATSB_Register(void) DECLSPEC_HIDDEN;
142 extern void FLATSB_Unregister(void) DECLSPEC_HIDDEN;
143 extern void HEADER_Register(void) DECLSPEC_HIDDEN;
144 extern void HEADER_Unregister(void) DECLSPEC_HIDDEN;
145 extern void HOTKEY_Register(void) DECLSPEC_HIDDEN;
146 extern void HOTKEY_Unregister(void) DECLSPEC_HIDDEN;
147 extern void IPADDRESS_Register(void) DECLSPEC_HIDDEN;
148 extern void IPADDRESS_Unregister(void) DECLSPEC_HIDDEN;
149 extern void LISTVIEW_Register(void) DECLSPEC_HIDDEN;
150 extern void LISTVIEW_Unregister(void) DECLSPEC_HIDDEN;
151 extern void MONTHCAL_Register(void) DECLSPEC_HIDDEN;
152 extern void MONTHCAL_Unregister(void) DECLSPEC_HIDDEN;
153 extern void NATIVEFONT_Register(void) DECLSPEC_HIDDEN;
154 extern void NATIVEFONT_Unregister(void) DECLSPEC_HIDDEN;
155 extern void PAGER_Register(void) DECLSPEC_HIDDEN;
156 extern void PAGER_Unregister(void) DECLSPEC_HIDDEN;
157 extern void PROGRESS_Register(void) DECLSPEC_HIDDEN;
158 extern void PROGRESS_Unregister(void) DECLSPEC_HIDDEN;
159 extern void REBAR_Register(void) DECLSPEC_HIDDEN;
160 extern void REBAR_Unregister(void) DECLSPEC_HIDDEN;
161 extern void STATUS_Register(void) DECLSPEC_HIDDEN;
162 extern void STATUS_Unregister(void) DECLSPEC_HIDDEN;
163 extern void SYSLINK_Register(void) DECLSPEC_HIDDEN;
164 extern void SYSLINK_Unregister(void) DECLSPEC_HIDDEN;
165 extern void TAB_Register(void) DECLSPEC_HIDDEN;
166 extern void TAB_Unregister(void) DECLSPEC_HIDDEN;
167 extern void TOOLBAR_Register(void) DECLSPEC_HIDDEN;
168 extern void TOOLBAR_Unregister(void) DECLSPEC_HIDDEN;
169 extern void TOOLTIPS_Register(void) DECLSPEC_HIDDEN;
170 extern void TOOLTIPS_Unregister(void) DECLSPEC_HIDDEN;
171 extern void TRACKBAR_Register(void) DECLSPEC_HIDDEN;
172 extern void TRACKBAR_Unregister(void) DECLSPEC_HIDDEN;
173 extern void TREEVIEW_Register(void) DECLSPEC_HIDDEN;
174 extern void TREEVIEW_Unregister(void) DECLSPEC_HIDDEN;
175 extern void UPDOWN_Register(void) DECLSPEC_HIDDEN;
176 extern void UPDOWN_Unregister(void) DECLSPEC_HIDDEN;
177 extern void BUTTON_Register();
178 extern void BUTTON_Unregister();
179
180 int MONTHCAL_MonthLength(int month, int year) DECLSPEC_HIDDEN;
181 int MONTHCAL_CalculateDayOfWeek(SYSTEMTIME *date, BOOL inplace) DECLSPEC_HIDDEN;
182 LONG MONTHCAL_CompareSystemTime(const SYSTEMTIME *first, const SYSTEMTIME *second) DECLSPEC_HIDDEN;
183
184 extern void THEMING_Initialize(HANDLE hActCtx5, HANDLE hActCtx6) DECLSPEC_HIDDEN;
185 extern void THEMING_Uninitialize(void) DECLSPEC_HIDDEN;
186 extern LRESULT THEMING_CallOriginalClass(HWND, UINT, WPARAM, LPARAM) DECLSPEC_HIDDEN;
187 extern void THEMING_SetSubclassData(HWND, ULONG_PTR) DECLSPEC_HIDDEN;
188
189 #endif /* __WINE_COMCTL32_H */