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