summaryrefslogtreecommitdiffstats
path: root/gfx/native_theme_linux.h
diff options
context:
space:
mode:
authorsail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-02 23:03:07 +0000
committersail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-02 23:03:07 +0000
commit267c03d478d9c83ef8c37999f3abb1cd822881ff (patch)
tree6286c650d0ec58cdee9c7482fda929252bd985b5 /gfx/native_theme_linux.h
parent7c085463177741a3844215675577bba3de1be836 (diff)
downloadchromium_src-267c03d478d9c83ef8c37999f3abb1cd822881ff.zip
chromium_src-267c03d478d9c83ef8c37999f3abb1cd822881ff.tar.gz
chromium_src-267c03d478d9c83ef8c37999f3abb1cd822881ff.tar.bz2
Move src/gfx/ to src/ui/gfx
To reduce the size of this change I've left stub header files in src/gfx/. Once all includes have been updated I'll delete the stub files. BUG=71063 TEST=Still doing test builds. Review URL: http://codereview.chromium.org/6246027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73530 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx/native_theme_linux.h')
-rw-r--r--gfx/native_theme_linux.h231
1 files changed, 2 insertions, 229 deletions
diff --git a/gfx/native_theme_linux.h b/gfx/native_theme_linux.h
index 0837d2a..679c6b8 100644
--- a/gfx/native_theme_linux.h
+++ b/gfx/native_theme_linux.h
@@ -5,234 +5,7 @@
#ifndef GFX_NATIVE_THEME_LINUX_H_
#define GFX_NATIVE_THEME_LINUX_H_
-#include "base/basictypes.h"
-#include "skia/ext/platform_canvas.h"
-
-namespace skia {
-class PlatformCanvas;
-}
-
-namespace gfx {
-class Rect;
-class Size;
-
-// Linux theming API.
-class NativeThemeLinux {
- public:
- // The part to be painted / sized.
- enum Part {
- kScrollbarDownArrow,
- kScrollbarLeftArrow,
- kScrollbarRightArrow,
- kScrollbarUpArrow,
- kScrollbarHorizontalThumb,
- kScrollbarVerticalThumb,
- kScrollbarHorizontalTrack,
- kScrollbarVerticalTrack,
- kCheckbox,
- kRadio,
- kPushButton,
- kTextField,
- kMenuList,
- kSliderTrack,
- kSliderThumb,
- kInnerSpinButton,
- kProgressBar,
- };
-
- // The state of the part.
- enum State {
- kDisabled,
- kHovered,
- kNormal,
- kPressed,
- };
-
- // Extra data needed to draw scrollbar track correctly.
- struct ScrollbarTrackExtraParams {
- int track_x;
- int track_y;
- int track_width;
- 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.
- static NativeThemeLinux* instance();
-
- // Return the size of the part.
- virtual gfx::Size GetPartSize(Part part) const;
- // Paint the part to the canvas.
- virtual void Paint(skia::PlatformCanvas* canvas,
- Part part,
- State state,
- const gfx::Rect& rect,
- const ExtraParams& extra);
- // Supports theme specific colors.
- void SetScrollbarColors(unsigned inactive_color,
- unsigned active_color,
- unsigned track_color) const;
-
- protected:
- NativeThemeLinux();
- virtual ~NativeThemeLinux();
-
- // Draw the arrow. Used by scrollbar and inner spin button.
- virtual void PaintArrowButton(
- skia::PlatformCanvas* gc,
- const gfx::Rect& rect,
- Part direction,
- State state);
- // Paint the scrollbar track. Done before the thumb so that it can contain
- // alpha.
- virtual void PaintScrollbarTrack(skia::PlatformCanvas* canvas,
- Part part,
- State state,
- const ScrollbarTrackExtraParams& extra_params,
- const gfx::Rect& rect);
- // Draw the scrollbar thumb over the track.
- virtual void PaintScrollbarThumb(skia::PlatformCanvas* canvas,
- 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);
-
- protected:
- bool IntersectsClipRectInt(skia::PlatformCanvas* canvas,
- int x, int y, int w, int h);
-
- void DrawBitmapInt(skia::PlatformCanvas* canvas, const SkBitmap& bitmap,
- int src_x, int src_y, int src_w, int src_h,
- int dest_x, int dest_y, int dest_w, int dest_h);
-
- void DrawTiledImage(SkCanvas* canvas,
- 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,
- SkScalar saturate_amount,
- SkScalar brighten_amount) const;
-
- private:
- void DrawVertLine(SkCanvas* canvas,
- int x,
- int y1,
- int y2,
- const SkPaint& paint) const;
- void DrawHorizLine(SkCanvas* canvas,
- int x1,
- int x2,
- int y,
- const SkPaint& paint) const;
- void DrawBox(SkCanvas* canvas,
- const gfx::Rect& rect,
- const SkPaint& paint) const;
- SkScalar Clamp(SkScalar value,
- SkScalar min,
- SkScalar max) const;
- SkColor OutlineColor(SkScalar* hsv1, SkScalar* hsv2) const;
-
- static unsigned int scrollbar_width_;
- static unsigned int button_length_;
- static unsigned int thumb_inactive_color_;
- static unsigned int thumb_active_color_;
- static unsigned int track_color_;
-
- DISALLOW_COPY_AND_ASSIGN(NativeThemeLinux);
-};
-
-} // namespace gfx
+#include "ui/gfx/native_theme_linux.h"
+// TODO(sail): remove this file once all includes have been updated.
#endif // GFX_NATIVE_THEME_LINUX_H_