OLD | NEW |
1 // Copyright (c) 2011 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/native_theme.h" | 15 #include "ui/gfx/native_theme.h" |
16 #include "ui/gfx/size.h" | 16 #include "ui/gfx/size.h" |
17 #include <windows.h> | 17 #include <windows.h> |
18 #include <uxtheme.h> | 18 #include <uxtheme.h> |
19 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
20 #include "third_party/skia/include/core/SkColor.h" | 20 #include "third_party/skia/include/core/SkColor.h" |
21 | 21 |
22 namespace skia { | 22 class SkCanvas; |
23 class PlatformCanvas; | |
24 } // namespace skia | |
25 | 23 |
26 namespace gfx { | 24 namespace gfx { |
27 | 25 |
28 // Windows implementation of native theme class. | 26 // Windows implementation of native theme class. |
29 // | 27 // |
30 // At the moment, this class in in transition from an older API that consists | 28 // At the moment, this class in in transition from an older API that consists |
31 // of several PaintXXX methods to an API, inherited from the NativeTheme base | 29 // of several PaintXXX methods to an API, inherited from the NativeTheme base |
32 // class, that consists of a single Paint() method with a argument to indicate | 30 // class, that consists of a single Paint() method with a argument to indicate |
33 // what kind of part to paint. | 31 // what kind of part to paint. |
34 class NativeThemeWin : public NativeTheme { | 32 class NativeThemeWin : public NativeTheme { |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 // This method is deprecated and will be removed in the near future. | 244 // This method is deprecated and will be removed in the near future. |
247 // Paints a scrollbar track section. |align_rect| is only used in classic | 245 // Paints a scrollbar track section. |align_rect| is only used in classic |
248 // mode, and makes sure the checkerboard pattern in |target_rect| is aligned | 246 // mode, and makes sure the checkerboard pattern in |target_rect| is aligned |
249 // with one presumed to be in |align_rect|. | 247 // with one presumed to be in |align_rect|. |
250 HRESULT PaintScrollbarTrack(HDC hdc, | 248 HRESULT PaintScrollbarTrack(HDC hdc, |
251 int part_id, | 249 int part_id, |
252 int state_id, | 250 int state_id, |
253 int classic_state, | 251 int classic_state, |
254 RECT* target_rect, | 252 RECT* target_rect, |
255 RECT* align_rect, | 253 RECT* align_rect, |
256 skia::PlatformCanvas* canvas) const; | 254 SkCanvas* canvas) const; |
257 | 255 |
258 // This method is deprecated and will be removed in the near future. | 256 // This method is deprecated and will be removed in the near future. |
259 // Paints a scrollbar thumb or gripper. | 257 // Paints a scrollbar thumb or gripper. |
260 HRESULT PaintScrollbarThumb(HDC hdc, | 258 HRESULT PaintScrollbarThumb(HDC hdc, |
261 int part_id, | 259 int part_id, |
262 int state_id, | 260 int state_id, |
263 int classic_state, | 261 int classic_state, |
264 RECT* rect) const; | 262 RECT* rect) const; |
265 | 263 |
266 // This method is deprecated and will be removed in the near future. | 264 // This method is deprecated and will be removed in the near future. |
(...skipping 22 matching lines...) Expand all Loading... |
289 COLORREF color, | 287 COLORREF color, |
290 bool fill_content_area, | 288 bool fill_content_area, |
291 bool draw_edges) const; | 289 bool draw_edges) const; |
292 | 290 |
293 // This method is deprecated and will be removed in the near future. | 291 // This method is deprecated and will be removed in the near future. |
294 HRESULT PaintTrackbar(HDC hdc, | 292 HRESULT PaintTrackbar(HDC hdc, |
295 int part_id, | 293 int part_id, |
296 int state_id, | 294 int state_id, |
297 int classic_state, | 295 int classic_state, |
298 RECT* rect, | 296 RECT* rect, |
299 skia::PlatformCanvas* canvas) const; | 297 SkCanvas* canvas) const; |
300 | 298 |
301 // This method is deprecated and will be removed in the near future. | 299 // This method is deprecated and will be removed in the near future. |
302 HRESULT PaintProgressBar(HDC hdc, | 300 HRESULT PaintProgressBar(HDC hdc, |
303 RECT* bar_rect, | 301 RECT* bar_rect, |
304 RECT* value_rect, | 302 RECT* value_rect, |
305 bool determinate, | 303 bool determinate, |
306 double animated_seconds, | 304 double animated_seconds, |
307 skia::PlatformCanvas* canvas) const; | 305 SkCanvas* canvas) const; |
308 | 306 |
309 private: | 307 private: |
310 NativeThemeWin(); | 308 NativeThemeWin(); |
311 ~NativeThemeWin(); | 309 ~NativeThemeWin(); |
312 | 310 |
313 // NativeTheme Implementation: | 311 // NativeTheme Implementation: |
314 virtual gfx::Size GetPartSize(Part part) const; | 312 virtual gfx::Size GetPartSize(Part part) const; |
315 virtual void Paint(skia::PlatformCanvas* canvas, | 313 virtual void Paint(skia::PlatformCanvas* canvas, |
316 Part part, | 314 Part part, |
317 State state, | 315 State state, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 | 378 |
381 // A cache of open theme handles. | 379 // A cache of open theme handles. |
382 mutable HANDLE theme_handles_[LAST]; | 380 mutable HANDLE theme_handles_[LAST]; |
383 | 381 |
384 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin); | 382 DISALLOW_COPY_AND_ASSIGN(NativeThemeWin); |
385 }; | 383 }; |
386 | 384 |
387 } // namespace gfx | 385 } // namespace gfx |
388 | 386 |
389 #endif // UI_GFX_NATIVE_THEME_WIN_H_ | 387 #endif // UI_GFX_NATIVE_THEME_WIN_H_ |
OLD | NEW |