| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // NativeTheme::instance(). | 7 // NativeTheme::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 BASE_GFX_NATIVE_THEME_H__ | 11 #ifndef BASE_GFX_NATIVE_THEME_H__ |
| 12 #define BASE_GFX_NATIVE_THEME_H__ | 12 #define BASE_GFX_NATIVE_THEME_H__ |
| 13 | 13 |
| 14 #include <windows.h> | 14 #include <windows.h> |
| 15 #include <uxtheme.h> | 15 #include <uxtheme.h> |
| 16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 17 #include "base/gfx/size.h" | 17 #include "base/gfx/size.h" |
| 18 #include "third_party/skia/include/core/SkColor.h" | 18 #include "third_party/skia/include/core/SkColor.h" |
| 19 | 19 |
| 20 namespace skia { | 20 namespace skia { |
| 21 class PlatformCanvasWin; | 21 class PlatformCanvas; |
| 22 } // namespace skia | 22 } // namespace skia |
| 23 | 23 |
| 24 namespace gfx { | 24 namespace gfx { |
| 25 | 25 |
| 26 // TODO: Define class member enums to replace part_id and state_id parameters | 26 // TODO: Define class member enums to replace part_id and state_id parameters |
| 27 // that are currently defined in <vssym32.h>. Afterward, classic_state should | 27 // that are currently defined in <vssym32.h>. Afterward, classic_state should |
| 28 // be removed and class users wouldn't need to include <vssym32.h> anymore. | 28 // be removed and class users wouldn't need to include <vssym32.h> anymore. |
| 29 // This would enable HOT state on non-themed UI (like when RDP'ing) and would | 29 // This would enable HOT state on non-themed UI (like when RDP'ing) and would |
| 30 // simplify usage. | 30 // simplify usage. |
| 31 // TODO: This class should probably be changed to be platform independent at | 31 // TODO: This class should probably be changed to be platform independent at |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 // Paints a scrollbar track section. |align_rect| is only used in classic | 168 // Paints a scrollbar track section. |align_rect| is only used in classic |
| 169 // mode, and makes sure the checkerboard pattern in |target_rect| is aligned | 169 // mode, and makes sure the checkerboard pattern in |target_rect| is aligned |
| 170 // with one presumed to be in |align_rect|. | 170 // with one presumed to be in |align_rect|. |
| 171 HRESULT PaintScrollbarTrack(HDC hdc, | 171 HRESULT PaintScrollbarTrack(HDC hdc, |
| 172 int part_id, | 172 int part_id, |
| 173 int state_id, | 173 int state_id, |
| 174 int classic_state, | 174 int classic_state, |
| 175 RECT* target_rect, | 175 RECT* target_rect, |
| 176 RECT* align_rect, | 176 RECT* align_rect, |
| 177 skia::PlatformCanvasWin* canvas) const; | 177 skia::PlatformCanvas* canvas) const; |
| 178 | 178 |
| 179 // Paints a scrollbar thumb or gripper. | 179 // Paints a scrollbar thumb or gripper. |
| 180 HRESULT PaintScrollbarThumb(HDC hdc, | 180 HRESULT PaintScrollbarThumb(HDC hdc, |
| 181 int part_id, | 181 int part_id, |
| 182 int state_id, | 182 int state_id, |
| 183 int classic_state, | 183 int classic_state, |
| 184 RECT* rect) const; | 184 RECT* rect) const; |
| 185 | 185 |
| 186 HRESULT PaintStatusGripper(HDC hdc, | 186 HRESULT PaintStatusGripper(HDC hdc, |
| 187 int part_id, | 187 int part_id, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 198 RECT* rect, | 198 RECT* rect, |
| 199 COLORREF color, | 199 COLORREF color, |
| 200 bool fill_content_area, | 200 bool fill_content_area, |
| 201 bool draw_edges) const; | 201 bool draw_edges) const; |
| 202 | 202 |
| 203 HRESULT PaintTrackbar(HDC hdc, | 203 HRESULT PaintTrackbar(HDC hdc, |
| 204 int part_id, | 204 int part_id, |
| 205 int state_id, | 205 int state_id, |
| 206 int classic_state, | 206 int classic_state, |
| 207 RECT* rect, | 207 RECT* rect, |
| 208 skia::PlatformCanvasWin* canvas) const; | 208 skia::PlatformCanvas* canvas) const; |
| 209 | 209 |
| 210 bool IsThemingActive() const; | 210 bool IsThemingActive() const; |
| 211 | 211 |
| 212 HRESULT GetThemePartSize(ThemeName themeName, | 212 HRESULT GetThemePartSize(ThemeName themeName, |
| 213 HDC hdc, | 213 HDC hdc, |
| 214 int part_id, | 214 int part_id, |
| 215 int state_id, | 215 int state_id, |
| 216 RECT* rect, | 216 RECT* rect, |
| 217 int ts, | 217 int ts, |
| 218 SIZE* size) const; | 218 SIZE* size) const; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 287 |
| 288 // A cache of open theme handles. | 288 // A cache of open theme handles. |
| 289 mutable HANDLE theme_handles_[LAST]; | 289 mutable HANDLE theme_handles_[LAST]; |
| 290 | 290 |
| 291 DISALLOW_EVIL_CONSTRUCTORS(NativeTheme); | 291 DISALLOW_EVIL_CONSTRUCTORS(NativeTheme); |
| 292 }; | 292 }; |
| 293 | 293 |
| 294 } // namespace gfx | 294 } // namespace gfx |
| 295 | 295 |
| 296 #endif // BASE_GFX_NATIVE_THEME_H__ | 296 #endif // BASE_GFX_NATIVE_THEME_H__ |
| OLD | NEW |