OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef UI_VIEWS_PAINTER_H_ | 5 #ifndef UI_VIEWS_PAINTER_H_ |
6 #define UI_VIEWS_PAINTER_H_ | 6 #define UI_VIEWS_PAINTER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
12 #include "ui/base/nine_image_painter_factory.h" | |
13 #include "ui/views/views_export.h" | 12 #include "ui/views/views_export.h" |
14 | 13 |
15 namespace gfx { | 14 namespace gfx { |
16 class Canvas; | 15 class Canvas; |
17 class ImageSkia; | 16 class ImageSkia; |
18 class Insets; | 17 class Insets; |
19 class Rect; | 18 class Rect; |
20 class Size; | 19 class Size; |
21 } | 20 } |
22 | 21 |
| 22 // A macro to define arrays of IDR constants used with CreateImageGridPainter. |
| 23 #define IMAGE_GRID(x) { x ## _TOP_LEFT, x ## _TOP, x ## _TOP_RIGHT, \ |
| 24 x ## _LEFT, x ## _CENTER, x ## _RIGHT, \ |
| 25 x ## _BOTTOM_LEFT, x ## _BOTTOM, x ## _BOTTOM_RIGHT, } |
| 26 |
23 namespace views { | 27 namespace views { |
24 | 28 |
25 class View; | 29 class View; |
26 | 30 |
27 // Painter, as the name implies, is responsible for painting in a particular | 31 // Painter, as the name implies, is responsible for painting in a particular |
28 // region. Think of Painter as a Border or Background that can be painted | 32 // region. Think of Painter as a Border or Background that can be painted |
29 // in any region of a View. | 33 // in any region of a View. |
30 class VIEWS_EXPORT Painter { | 34 class VIEWS_EXPORT Painter { |
31 public: | 35 public: |
32 Painter(); | 36 Painter(); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 117 |
114 // NOTE: the images are owned by ResourceBundle. Don't free them. | 118 // NOTE: the images are owned by ResourceBundle. Don't free them. |
115 const gfx::ImageSkia* images_[3]; | 119 const gfx::ImageSkia* images_[3]; |
116 | 120 |
117 DISALLOW_COPY_AND_ASSIGN(HorizontalPainter); | 121 DISALLOW_COPY_AND_ASSIGN(HorizontalPainter); |
118 }; | 122 }; |
119 | 123 |
120 } // namespace views | 124 } // namespace views |
121 | 125 |
122 #endif // UI_VIEWS_PAINTER_H_ | 126 #endif // UI_VIEWS_PAINTER_H_ |
OLD | NEW |