OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // A wrapper class for working with custom XP/Vista themes provided in | 5 // A wrapper class for working with custom XP/Vista themes provided in |
6 // uxtheme.dll. This is a singleton class that can be grabbed using | 6 // uxtheme.dll. This is a singleton class that can be grabbed using |
7 // NativeThemeWin::instance(). | 7 // NativeThemeWin::instance(). |
8 // For more information on visual style parts and states, see: | 8 // For more information on visual style parts and states, see: |
9 // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/plat
form/commctls/userex/topics/partsandstates.asp | 9 // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/plat
form/commctls/userex/topics/partsandstates.asp |
10 | 10 |
11 #ifndef UI_GFX_NATIVE_THEME_WIN_H_ | 11 #ifndef UI_GFX_NATIVE_THEME_WIN_H_ |
12 #define UI_GFX_NATIVE_THEME_WIN_H_ | 12 #define UI_GFX_NATIVE_THEME_WIN_H_ |
13 #pragma once | 13 #pragma once |
14 | 14 |
15 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
16 #include <windows.h> | 16 #include <windows.h> |
17 #include <uxtheme.h> | 17 #include <uxtheme.h> |
18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
19 #include "third_party/skia/include/core/SkColor.h" | 19 #include "third_party/skia/include/core/SkColor.h" |
20 | 20 |
21 namespace skia { | 21 class SkCanvas; |
22 class PlatformCanvas; | |
23 } // namespace skia | |
24 | 22 |
25 namespace gfx { | 23 namespace gfx { |
26 | 24 |
27 // TODO: Define class member enums to replace part_id and state_id parameters | 25 // TODO: Define class member enums to replace part_id and state_id parameters |
28 // that are currently defined in <vssym32.h>. Afterward, classic_state should | 26 // that are currently defined in <vssym32.h>. Afterward, classic_state should |
29 // be removed and class users wouldn't need to include <vssym32.h> anymore. | 27 // be removed and class users wouldn't need to include <vssym32.h> anymore. |
30 // This would enable HOT state on non-themed UI (like when RDP'ing) and would | 28 // This would enable HOT state on non-themed UI (like when RDP'ing) and would |
31 // simplify usage. | 29 // simplify usage. |
32 // TODO: This class should probably be changed to be platform independent at | 30 // TODO: This class should probably be changed to be platform independent at |
33 // the same time. | 31 // the same time. |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 174 |
177 // Paints a scrollbar track section. |align_rect| is only used in classic | 175 // Paints a scrollbar track section. |align_rect| is only used in classic |
178 // mode, and makes sure the checkerboard pattern in |target_rect| is aligned | 176 // mode, and makes sure the checkerboard pattern in |target_rect| is aligned |
179 // with one presumed to be in |align_rect|. | 177 // with one presumed to be in |align_rect|. |
180 HRESULT PaintScrollbarTrack(HDC hdc, | 178 HRESULT PaintScrollbarTrack(HDC hdc, |
181 int part_id, | 179 int part_id, |
182 int state_id, | 180 int state_id, |
183 int classic_state, | 181 int classic_state, |
184 RECT* target_rect, | 182 RECT* target_rect, |
185 RECT* align_rect, | 183 RECT* align_rect, |
186 skia::PlatformCanvas* canvas) const; | 184 SkCanvas* canvas) const; |
187 | 185 |
188 // Paints a scrollbar thumb or gripper. | 186 // Paints a scrollbar thumb or gripper. |
189 HRESULT PaintScrollbarThumb(HDC hdc, | 187 HRESULT PaintScrollbarThumb(HDC hdc, |
190 int part_id, | 188 int part_id, |
191 int state_id, | 189 int state_id, |
192 int classic_state, | 190 int classic_state, |
193 RECT* rect) const; | 191 RECT* rect) const; |
194 | 192 |
195 HRESULT PaintSpinButton(HDC hdc, | 193 HRESULT PaintSpinButton(HDC hdc, |
196 int part_id, | 194 int part_id, |
(...skipping 16 matching lines...) Expand all Loading... |
213 RECT* rect, | 211 RECT* rect, |
214 COLORREF color, | 212 COLORREF color, |
215 bool fill_content_area, | 213 bool fill_content_area, |
216 bool draw_edges) const; | 214 bool draw_edges) const; |
217 | 215 |
218 HRESULT PaintTrackbar(HDC hdc, | 216 HRESULT PaintTrackbar(HDC hdc, |
219 int part_id, | 217 int part_id, |
220 int state_id, | 218 int state_id, |
221 int classic_state, | 219 int classic_state, |
222 RECT* rect, | 220 RECT* rect, |
223 skia::PlatformCanvas* canvas) const; | 221 SkCanvas* canvas) const; |
224 | 222 |
225 HRESULT PaintProgressBar(HDC hdc, | 223 HRESULT PaintProgressBar(HDC hdc, |
226 RECT* bar_rect, | 224 RECT* bar_rect, |
227 RECT* value_rect, | 225 RECT* value_rect, |
228 bool determinate, | 226 bool determinate, |
229 double animated_seconds, | 227 double animated_seconds, |
230 skia::PlatformCanvas* canvas) const; | 228 SkCanvas* canvas) const; |
231 | 229 |
232 bool IsThemingActive() const; | 230 bool IsThemingActive() const; |
233 | 231 |
234 HRESULT GetThemePartSize(ThemeName themeName, | 232 HRESULT GetThemePartSize(ThemeName themeName, |
235 HDC hdc, | 233 HDC hdc, |
236 int part_id, | 234 int part_id, |
237 int state_id, | 235 int state_id, |
238 RECT* rect, | 236 RECT* rect, |
239 int ts, | 237 int ts, |
240 SIZE* size) const; | 238 SIZE* size) const; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 | 310 |
313 // A cache of open theme handles. | 311 // A cache of open theme handles. |
314 mutable HANDLE theme_handles_[LAST]; | 312 mutable HANDLE theme_handles_[LAST]; |
315 | 313 |
316 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin); | 314 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin); |
317 }; | 315 }; |
318 | 316 |
319 } // namespace gfx | 317 } // namespace gfx |
320 | 318 |
321 #endif // UI_GFX_NATIVE_THEME_WIN_H_ | 319 #endif // UI_GFX_NATIVE_THEME_WIN_H_ |
OLD | NEW |