- define additional shell paths for CSIDL_... constants
[wine] / dlls / uxtheme / draw.c
1 /*
2  * Win32 5.1 Theme drawing
3  *
4  * Copyright (C) 2003 Kevin Koltzau
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "config.h"
22
23 #include <stdarg.h>
24
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winuser.h"
28 #include "wingdi.h"
29 #include "uxtheme.h"
30 #include "tmschema.h"
31
32 #include "msstyles.h"
33 #include "uxthemedll.h"
34
35 #include "wine/debug.h"
36
37 WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
38
39 /***********************************************************************
40  *      EnableThemeDialogTexture                            (UXTHEME.@)
41  */
42 HRESULT WINAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
43 {
44     FIXME("%p 0x%08lx: stub\n", hwnd, dwFlags);
45     return ERROR_CALL_NOT_IMPLEMENTED;
46  }
47
48 /***********************************************************************
49  *      IsThemeDialogTextureEnabled                         (UXTHEME.@)
50  */
51 BOOL WINAPI IsThemeDialogTextureEnabled(void)
52 {
53     FIXME("stub\n");
54     return FALSE;
55 }
56
57 /***********************************************************************
58  *      DrawThemeParentBackground                           (UXTHEME.@)
59  */
60 HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
61 {
62     FIXME("stub\n");
63     return ERROR_CALL_NOT_IMPLEMENTED;
64 }
65
66 /***********************************************************************
67  *      DrawThemeBackground                                 (UXTHEME.@)
68  */
69 HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId,
70                                    int iStateId, const RECT *pRect,
71                                    const RECT *pClipRect)
72 {
73     FIXME("%d %d: stub\n", iPartId, iStateId);
74     if(!hTheme)
75         return E_HANDLE;
76     return ERROR_CALL_NOT_IMPLEMENTED;
77 }
78
79 /***********************************************************************
80  *      DrawThemeBackgroundEx                               (UXTHEME.@)
81  */
82 HRESULT WINAPI DrawThemeBackgroundEx(HTHEME hTheme, HDC hdc, int iPartId,
83                                      int iStateId, const RECT *pRect,
84                                      const DTBGOPTS *pOptions)
85 {
86     FIXME("%d %d: stub\n", iPartId, iStateId);
87     if(!hTheme)
88         return E_HANDLE;
89     return ERROR_CALL_NOT_IMPLEMENTED;
90 }
91
92 /***********************************************************************
93  *      DrawThemeEdge                                       (UXTHEME.@)
94  */
95 HRESULT WINAPI DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId,
96                              int iStateId, const RECT *pDestRect, UINT uEdge,
97                              UINT uFlags, RECT *pContentRect)
98 {
99     FIXME("%d %d 0x%08x 0x%08x: stub\n", iPartId, iStateId, uEdge, uFlags);
100     if(!hTheme)
101         return E_HANDLE;
102     return ERROR_CALL_NOT_IMPLEMENTED;
103 }
104
105 /***********************************************************************
106  *      DrawThemeIcon                                       (UXTHEME.@)
107  */
108 HRESULT WINAPI DrawThemeIcon(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
109                              const RECT *pRect, HIMAGELIST himl, int iImageIndex)
110 {
111     FIXME("%d %d: stub\n", iPartId, iStateId);
112     if(!hTheme)
113         return E_HANDLE;
114     return ERROR_CALL_NOT_IMPLEMENTED;
115 }
116
117 /***********************************************************************
118  *      DrawThemeText                                       (UXTHEME.@)
119  */
120 HRESULT WINAPI DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
121                              LPCWSTR pszText, int iCharCount, DWORD dwTextFlags,
122                              DWORD dwTextFlags2, const RECT *pRect)
123 {
124     FIXME("%d %d: stub\n", iPartId, iStateId);
125     if(!hTheme)
126         return E_HANDLE;
127     return ERROR_CALL_NOT_IMPLEMENTED;
128 }
129
130 /***********************************************************************
131  *      GetThemeBackgroundContentRect                       (UXTHEME.@)
132  */
133 HRESULT WINAPI GetThemeBackgroundContentRect(HTHEME hTheme, HDC hdc, int iPartId,
134                                              int iStateId,
135                                              const RECT *pBoundingRect,
136                                              RECT *pContentRect)
137 {
138     MARGINS margin;
139     HRESULT hr;
140
141     TRACE("(%d,%d)\n", iPartId, iStateId);
142     if(!hTheme)
143         return E_HANDLE;
144
145     hr = GetThemeMargins(hTheme, hdc, iPartId, iStateId, TMT_CONTENTMARGINS, NULL, &margin);
146     if(FAILED(hr)) {
147         TRACE("Margins not found\n");
148         return hr;
149     }
150     pContentRect->left = pBoundingRect->left + margin.cxLeftWidth;
151     pContentRect->top  = pBoundingRect->top + margin.cyTopHeight;
152     pContentRect->right = pBoundingRect->right - margin.cxRightWidth;
153     pContentRect->bottom = pBoundingRect->bottom - margin.cyBottomHeight;
154
155     TRACE("left:%ld,top:%ld,right:%ld,bottom:%ld\n", pContentRect->left, pContentRect->top, pContentRect->right, pContentRect->bottom);
156
157     return S_OK;
158 }
159
160 /***********************************************************************
161  *      GetThemeBackgroundExtent                            (UXTHEME.@)
162  */
163 HRESULT WINAPI GetThemeBackgroundExtent(HTHEME hTheme, HDC hdc, int iPartId,
164                                         int iStateId, const RECT *pContentRect,
165                                         RECT *pExtentRect)
166 {
167     FIXME("%d %d: stub\n", iPartId, iStateId);
168     if(!hTheme)
169         return E_HANDLE;
170     return ERROR_CALL_NOT_IMPLEMENTED;
171 }
172
173 /***********************************************************************
174  *      GetThemeBackgroundRegion                            (UXTHEME.@)
175  */
176 HRESULT WINAPI GetThemeBackgroundRegion(HTHEME hTheme, HDC hdc, int iPartId,
177                                         int iStateId, const RECT *pRect,
178                                         HRGN *pRegion)
179 {
180     FIXME("%d %d: stub\n", iPartId, iStateId);
181     if(!hTheme)
182         return E_HANDLE;
183     return ERROR_CALL_NOT_IMPLEMENTED;
184 }
185
186 /***********************************************************************
187  *      GetThemePartSize                                    (UXTHEME.@)
188  */
189 HRESULT WINAPI GetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId,
190                                 int iStateId, RECT *prc, THEMESIZE eSize,
191                                 SIZE *psz)
192 {
193     FIXME("%d %d %d: stub\n", iPartId, iStateId, eSize);
194     if(!hTheme)
195         return E_HANDLE;
196     return ERROR_CALL_NOT_IMPLEMENTED;
197 }
198
199
200 /***********************************************************************
201  *      GetThemeTextExtent                                  (UXTHEME.@)
202  */
203 HRESULT WINAPI GetThemeTextExtent(HTHEME hTheme, HDC hdc, int iPartId,
204                                   int iStateId, LPCWSTR pszText, int iCharCount,
205                                   DWORD dwTextFlags, const RECT *pBoundingRect,
206                                   RECT *pExtentRect)
207 {
208     FIXME("%d %d: stub\n", iPartId, iStateId);
209     if(!hTheme)
210         return E_HANDLE;
211     return ERROR_CALL_NOT_IMPLEMENTED;
212 }
213
214 /***********************************************************************
215  *      GetThemeTextMetrics                                 (UXTHEME.@)
216  */
217 HRESULT WINAPI GetThemeTextMetrics(HTHEME hTheme, HDC hdc, int iPartId,
218                                    int iStateId, TEXTMETRICW *ptm)
219 {
220     FIXME("%d %d: stub\n", iPartId, iStateId);
221     if(!hTheme)
222         return E_HANDLE;
223     return ERROR_CALL_NOT_IMPLEMENTED;
224 }
225
226 /***********************************************************************
227  *      IsThemeBackgroundPartiallyTransparent               (UXTHEME.@)
228  */
229 BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId,
230                                                   int iStateId)
231 {
232     FIXME("%d %d: stub\n", iPartId, iStateId);
233     return FALSE;
234 }