diff options
author | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-27 20:39:35 +0000 |
---|---|---|
committer | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-27 20:39:35 +0000 |
commit | f9e77d7d6dd6ffe2a686ae98d8bba47abd92ad9a (patch) | |
tree | cba32fc4a32415221c1a5ea30944a27cbf075761 /ui/gfx/native_theme_win.h | |
parent | 311cb806c0d6eb603d4e29606bf33d83bdea3d22 (diff) | |
download | chromium_src-f9e77d7d6dd6ffe2a686ae98d8bba47abd92ad9a.zip chromium_src-f9e77d7d6dd6ffe2a686ae98d8bba47abd92ad9a.tar.gz chromium_src-f9e77d7d6dd6ffe2a686ae98d8bba47abd92ad9a.tar.bz2 |
Step 5 in native theme refactoring
Moved all calls to new API. Kept PaintTextField() still available from the
old API since there is one user of the method that is not in views::View
specific code, and does not have access to gfx::Canvas and such.
Also moved callers of GetThemePartSize() to the new GetPartSize() API.
BUG=None
TEST=Use the following URL to test all possible controls on web pages:
http://www.corp.google.com/~rogerta/no_crawl/widgets_test.html All controls
should look and before the same with and without my changes. Also, make sure
the chrome UI has not been changed, for example the wrench menu.
Review URL: http://codereview.chromium.org/6880107
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83204 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/native_theme_win.h')
-rw-r--r-- | ui/gfx/native_theme_win.h | 150 |
1 files changed, 75 insertions, 75 deletions
diff --git a/ui/gfx/native_theme_win.h b/ui/gfx/native_theme_win.h index fb41485..f192126 100644 --- a/ui/gfx/native_theme_win.h +++ b/ui/gfx/native_theme_win.h @@ -49,14 +49,6 @@ class NativeThemeWin : public NativeTheme { bool IsThemingActive() const; - HRESULT GetThemePartSize(ThemeName themeName, - HDC hdc, - int part_id, - int state_id, - RECT* rect, - int ts, - SIZE* size) const; - HRESULT GetThemeColor(ThemeName theme, int part_id, int state_id, @@ -72,12 +64,6 @@ class NativeThemeWin : public NativeTheme { int prop_id, int default_sys_color) const; - HRESULT GetThemeInt(ThemeName theme, - int part_id, - int state_id, - int prop_id, - int *result) const; - // Get the thickness of the border associated with the specified theme, // defaulting to GetSystemMetrics edge size if themes are disabled. // In Classic Windows, borders are typically 2px; on XP+, they are 1px. @@ -100,63 +86,6 @@ class NativeThemeWin : public NativeTheme { // Gets our singleton instance. static const NativeThemeWin* instance(); - typedef HRESULT (WINAPI* DrawThemeBackgroundPtr)(HANDLE theme, - HDC hdc, - int part_id, - int state_id, - const RECT* rect, - const RECT* clip_rect); - typedef HRESULT (WINAPI* DrawThemeBackgroundExPtr)(HANDLE theme, - HDC hdc, - int part_id, - int state_id, - const RECT* rect, - const DTBGOPTS* opts); - typedef HRESULT (WINAPI* GetThemeColorPtr)(HANDLE hTheme, - int part_id, - int state_id, - int prop_id, - COLORREF* color); - typedef HRESULT (WINAPI* GetThemeContentRectPtr)(HANDLE hTheme, - HDC hdc, - int part_id, - int state_id, - const RECT* rect, - RECT* content_rect); - typedef HRESULT (WINAPI* GetThemePartSizePtr)(HANDLE hTheme, - HDC hdc, - int part_id, - int state_id, - RECT* rect, - int ts, - SIZE* size); - typedef HANDLE (WINAPI* OpenThemeDataPtr)(HWND window, - LPCWSTR class_list); - typedef HRESULT (WINAPI* CloseThemeDataPtr)(HANDLE theme); - - typedef void (WINAPI* SetThemeAppPropertiesPtr) (DWORD flags); - typedef BOOL (WINAPI* IsThemeActivePtr)(); - typedef HRESULT (WINAPI* GetThemeIntPtr)(HANDLE hTheme, - int part_id, - int state_id, - int prop_id, - int *value); - - // The PaintXXX methods below this point should be private or be deleted, - // but remain public while NativeThemeWin is transitioned over to use the - // single Paint() entry point. Do not make new calls to these methods. - - // This method is deprecated and will be removed in the near future. - HRESULT PaintStatusGripper(HDC hdc, - int part_id, - int state_id, - int classic_state, - RECT* rect) const; - - // This method is deprecated and will be removed in the near future. - HRESULT PaintTabPanelBackground(HDC dc, RECT* rect) const; - - // This method is deprecated and will be removed in the near future. HRESULT PaintTextField(HDC hdc, int part_id, int state_id, @@ -171,13 +100,23 @@ class NativeThemeWin : public NativeTheme { ~NativeThemeWin(); // NativeTheme Implementation: - virtual gfx::Size GetPartSize(Part part) const; + virtual gfx::Size GetPartSize(Part part, + State state, + const ExtraParams& extra) const; virtual void Paint(SkCanvas* canvas, Part part, State state, const gfx::Rect& rect, const ExtraParams& extra) const; + HRESULT GetThemePartSize(ThemeName themeName, + HDC hdc, + int part_id, + int state_id, + RECT* rect, + int ts, + SIZE* size) const; + HRESULT PaintButton(HDC hdc, int part_id, int state_id, @@ -279,11 +218,30 @@ class NativeThemeWin : public NativeTheme { const gfx::Rect& rect, const ProgressBarExtraParams& extra) const; - // Get the windows theme name that goes with the part. + HRESULT PaintWindowResizeGripper(HDC hdc, const gfx::Rect& rect) const; + + HRESULT PaintTabPanelBackground(HDC hdc, const gfx::Rect& rect) const; + + HRESULT PaintTextField(HDC hdc, + Part part, + State state, + const gfx::Rect& rect, + const TextFieldExtraParams& extra) const; + + + // Get the windows theme name/part/state. These three helper functions are + // used only by GetPartSize(), as each of the corresponding PaintXXX() + // methods do further validation of the part and state that is required for + // getting the size. static ThemeName GetThemeName(Part part); + static int GetWindowsPart(Part part, State state, const ExtraParams& extra); + static int GetWindowsState(Part part, State state, const ExtraParams& extra); - // Get the windows theme part id that goes with the part. - static int GetWindowsPart(Part part); + HRESULT GetThemeInt(ThemeName theme, + int part_id, + int state_id, + int prop_id, + int *result) const; HRESULT PaintFrameControl(HDC hdc, const gfx::Rect& rect, @@ -294,6 +252,48 @@ class NativeThemeWin : public NativeTheme { // Returns a handle to the theme data. HANDLE GetThemeHandle(ThemeName theme_name) const; + typedef HRESULT (WINAPI* DrawThemeBackgroundPtr)(HANDLE theme, + HDC hdc, + int part_id, + int state_id, + const RECT* rect, + const RECT* clip_rect); + typedef HRESULT (WINAPI* DrawThemeBackgroundExPtr)(HANDLE theme, + HDC hdc, + int part_id, + int state_id, + const RECT* rect, + const DTBGOPTS* opts); + typedef HRESULT (WINAPI* GetThemeColorPtr)(HANDLE hTheme, + int part_id, + int state_id, + int prop_id, + COLORREF* color); + typedef HRESULT (WINAPI* GetThemeContentRectPtr)(HANDLE hTheme, + HDC hdc, + int part_id, + int state_id, + const RECT* rect, + RECT* content_rect); + typedef HRESULT (WINAPI* GetThemePartSizePtr)(HANDLE hTheme, + HDC hdc, + int part_id, + int state_id, + RECT* rect, + int ts, + SIZE* size); + typedef HANDLE (WINAPI* OpenThemeDataPtr)(HWND window, + LPCWSTR class_list); + typedef HRESULT (WINAPI* CloseThemeDataPtr)(HANDLE theme); + + typedef void (WINAPI* SetThemeAppPropertiesPtr) (DWORD flags); + typedef BOOL (WINAPI* IsThemeActivePtr)(); + typedef HRESULT (WINAPI* GetThemeIntPtr)(HANDLE hTheme, + int part_id, + int state_id, + int prop_id, + int *value); + // Function pointers into uxtheme.dll. DrawThemeBackgroundPtr draw_theme_; DrawThemeBackgroundExPtr draw_theme_ex_; |