Chromium Code Reviews| 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 "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| 11 #include "ui/views/views_export.h" | 11 #include "ui/views/views_export.h" |
| 12 | 12 |
| 13 namespace gfx { | 13 namespace gfx { |
| 14 class Canvas; | 14 class Canvas; |
| 15 class ImageSkia; | 15 class ImageSkia; |
| 16 class Insets; | 16 class Insets; |
| 17 class Rect; | 17 class Rect; |
| 18 class Size; | 18 class Size; |
| 19 } | 19 } |
| 20 | 20 |
| 21 // A macro to define arrays of IDR constants used with CreateImageGridPainter. | 21 // A macro to define arrays of IDR constants used with CreateImageGridPainter. |
| 22 #define IMAGE_GRID(x) { x ## _TOP_LEFT, x ## _TOP, x ## _TOP_RIGHT, \ | 22 #define IMAGE_GRID(x) { x ## _TOP_LEFT, x ## _TOP, x ## _TOP_RIGHT, \ |
| 23 x ## _LEFT, x ## _CENTER, x ## _RIGHT, \ | 23 x ## _LEFT, x ## _CENTER, x ## _RIGHT, \ |
| 24 x ## _BOTTOM_LEFT, x ## _BOTTOM, x ## _BOTTOM_RIGHT, } | 24 x ## _BOTTOM_LEFT, x ## _BOTTOM, x ## _BOTTOM_RIGHT, } |
| 25 | 25 |
| 26 #define IMAGE_GRID2(x, y) { \ | |
|
sky
2013/12/02 21:28:55
Why do you need a new macro for this? Can't you em
hajimehoshi
2013/12/03 10:30:52
Done.
| |
| 27 x ## _TOP_LEFT_ ## y, x ## _TOP_ ## y, x ## _TOP_RIGHT_ ## y, \ | |
| 28 x ## _LEFT_ ## y, x ## _CENTER_ ## y, x ## _RIGHT_ ## y, \ | |
| 29 x ## _BOTTOM_LEFT_ ## y, x ## _BOTTOM_ ## y, x ## _BOTTOM_RIGHT_ ## y, } | |
| 30 | |
| 26 namespace views { | 31 namespace views { |
| 27 | 32 |
| 28 // Painter, as the name implies, is responsible for painting in a particular | 33 // Painter, as the name implies, is responsible for painting in a particular |
| 29 // region. Think of Painter as a Border or Background that can be painted | 34 // region. Think of Painter as a Border or Background that can be painted |
| 30 // in any region of a View. | 35 // in any region of a View. |
| 31 class VIEWS_EXPORT Painter { | 36 class VIEWS_EXPORT Painter { |
| 32 public: | 37 public: |
| 33 Painter(); | 38 Painter(); |
| 34 virtual ~Painter(); | 39 virtual ~Painter(); |
| 35 | 40 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 | 106 |
| 102 // NOTE: the images are owned by ResourceBundle. Don't free them. | 107 // NOTE: the images are owned by ResourceBundle. Don't free them. |
| 103 const gfx::ImageSkia* images_[3]; | 108 const gfx::ImageSkia* images_[3]; |
| 104 | 109 |
| 105 DISALLOW_COPY_AND_ASSIGN(HorizontalPainter); | 110 DISALLOW_COPY_AND_ASSIGN(HorizontalPainter); |
| 106 }; | 111 }; |
| 107 | 112 |
| 108 } // namespace views | 113 } // namespace views |
| 109 | 114 |
| 110 #endif // UI_VIEWS_PAINTER_H_ | 115 #endif // UI_VIEWS_PAINTER_H_ |
| OLD | NEW |