Chromium Code Reviews| Index: gfx/native_theme_linux.h |
| diff --git a/gfx/native_theme_linux.h b/gfx/native_theme_linux.h |
| index 4a79da31dc7fd576f04cef604e3455a304e1bb1c..011aecaf3f22901d27b90c642986a5cbc71c954b 100644 |
| --- a/gfx/native_theme_linux.h |
| +++ b/gfx/native_theme_linux.h |
| @@ -28,7 +28,16 @@ class NativeThemeLinux { |
| kScrollbarHorizontalThumb, |
| kScrollbarVerticalThumb, |
| kScrollbarHorizontalTrack, |
| - kScrollbarVerticalTrack |
| + kScrollbarVerticalTrack, |
| + kCheckbox, |
| + kRadio, |
| + kPushButton, |
| + kTextField, |
| + kMenuList, |
| + kSliderTrack, |
| + kSliderThumb, |
| + kInnerSpinButton, |
| + kProgressBar, |
| }; |
| // The state of the part. |
| @@ -47,8 +56,51 @@ class NativeThemeLinux { |
| int track_height; |
| }; |
| + struct ButtonExtraParams { |
| + bool checked; |
| + bool indeterminate; // Whether the button state is indeterminate. |
| + bool is_default; // Whether the button is default button. |
| + SkColor background_color; |
| + }; |
| + |
| + struct TextFieldExtraParams { |
| + bool is_text_area; |
| + bool is_listbox; |
| + SkColor background_color; |
| + }; |
| + |
| + struct MenuListExtraParams { |
| + int arrow_x; |
| + int arrow_y; |
| + SkColor background_color; |
| + }; |
| + |
| + struct SliderExtraParams { |
| + bool vertical; |
| + bool in_drag; |
| + }; |
| + |
| + struct InnerSpinButtonExtraParams { |
| + bool spin_up; |
| + bool read_only; |
| + }; |
| + |
| + struct ProgressBarExtraParams { |
| + bool determinate; |
| + int value_rect_x; |
| + int value_rect_y; |
| + int value_rect_width; |
| + int value_rect_height; |
| + }; |
| + |
| union ExtraParams { |
| ScrollbarTrackExtraParams scrollbar_track; |
| + ButtonExtraParams button; |
| + MenuListExtraParams menu_list; |
| + SliderExtraParams slider; |
| + TextFieldExtraParams text_field; |
| + InnerSpinButtonExtraParams inner_spin; |
| + ProgressBarExtraParams progress_bar; |
| }; |
| // Gets our singleton instance. |
| @@ -88,6 +140,61 @@ class NativeThemeLinux { |
| Part part, |
| State state, |
| const gfx::Rect& rect); |
| + // Draw the checkbox. |
| + virtual void PaintCheckbox(skia::PlatformCanvas* canvas, |
| + State state, |
| + const gfx::Rect& rect, |
| + const ButtonExtraParams& button); |
| + // Draw the radio. |
| + virtual void PaintRadio(skia::PlatformCanvas* canvas, |
| + State state, |
| + const gfx::Rect& rect, |
| + const ButtonExtraParams& button); |
| + // Draw the push button. |
| + virtual void PaintButton(skia::PlatformCanvas* canvas, |
| + State state, |
| + const gfx::Rect& rect, |
| + const ButtonExtraParams& button); |
| + // Draw the text field. |
| + virtual void PaintTextField(skia::PlatformCanvas* canvas, |
| + State state, |
| + const gfx::Rect& rect, |
| + const TextFieldExtraParams& text); |
| + // Draw the menu list. |
| + virtual void PaintMenuList(skia::PlatformCanvas* canvas, |
| + State state, |
| + const gfx::Rect& rect, |
| + const MenuListExtraParams& menu_list); |
| + // Draw the slider track. |
| + virtual void PaintSliderTrack(skia::PlatformCanvas* canvas, |
| + State state, |
| + const gfx::Rect& rect, |
| + const SliderExtraParams& slider); |
| + // Draw the slider thumb. |
| + virtual void PaintSliderThumb(skia::PlatformCanvas* canvas, |
| + State state, |
| + const gfx::Rect& rect, |
| + const SliderExtraParams& slider); |
| + // Draw the inner spin button. |
| + virtual void PaintInnerSpinButton(skia::PlatformCanvas* canvas, |
| + State state, |
| + const gfx::Rect& rect, |
| + const InnerSpinButtonExtraParams& spin_button); |
| + // Draw the progress bar. |
| + virtual void PaintProgressBar(skia::PlatformCanvas* canvas, |
| + State state, |
| + const gfx::Rect& rect, |
| + const ProgressBarExtraParams& progress_bar); |
| + |
| + void DrawTiledImage(SkCanvas* canvas, |
|
tony
2011/01/14 22:06:04
Can this be protected?
xiyuan
2011/01/18 21:30:49
Done.
|
| + const SkBitmap& bitmap, |
| + int src_x, int src_y, |
| + double tile_scale_x, double tile_scale_y, |
| + int dest_x, int dest_y, int w, int h) const; |
| + |
| + SkColor SaturateAndBrighten(SkScalar* hsv, |
|
tony
2011/01/14 22:06:04
Can this be protected too?
xiyuan
2011/01/18 21:30:49
Done.
|
| + SkScalar saturate_amount, |
| + SkScalar brighten_amount) const; |
| private: |
| void DrawVertLine(SkCanvas* canvas, |
| @@ -106,9 +213,6 @@ class NativeThemeLinux { |
| SkScalar Clamp(SkScalar value, |
| SkScalar min, |
| SkScalar max) const; |
| - SkColor SaturateAndBrighten(SkScalar* hsv, |
| - SkScalar saturate_amount, |
| - SkScalar brighten_amount) const; |
| SkColor OutlineColor(SkScalar* hsv1, SkScalar* hsv2) const; |
| static unsigned int scrollbar_width_; |
| @@ -117,6 +221,9 @@ class NativeThemeLinux { |
| static unsigned int thumb_active_color_; |
| static unsigned int track_color_; |
| + static const int kCheckboxAndRadioWidth; |
| + static const int kCheckboxAndRadioHeight; |
|
tony
2011/01/14 22:06:04
Can we just move these into the .cc file?
xiyuan
2011/01/18 21:30:49
Done.
|
| + |
| DISALLOW_COPY_AND_ASSIGN(NativeThemeLinux); |
| }; |