OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_BORDER_IMAGES_H_ |
| 6 #define UI_VIEWS_CONTROLS_BUTTON_BORDER_IMAGES_H_ |
| 7 |
| 8 #include "ui/gfx/image/image_skia.h" |
| 9 #include "ui/views/views_export.h" |
| 10 |
| 11 namespace gfx { |
| 12 class Canvas; |
| 13 class Rect; |
| 14 } |
| 15 |
| 16 namespace views { |
| 17 |
| 18 // BorderImages stores and paints the nine images comprising a button border. |
| 19 // TODO(msw): Merge common "nine-box" code with BubbleBorder, ImagePainter, etc. |
| 20 // TODO(msw): Stitch border image assets together and use ImagePainter. |
| 21 struct VIEWS_EXPORT BorderImages { |
| 22 // The default hot and pushed button image IDs; normal has none by default. |
| 23 static const int kHot[]; |
| 24 static const int kPushed[]; |
| 25 |
| 26 BorderImages(); |
| 27 // |image_ids| must contain 9 image IDs matching the member order below. |
| 28 explicit BorderImages(const int image_ids[]); |
| 29 ~BorderImages(); |
| 30 |
| 31 // Paint the images on |canvas| within |rect|'s dimensions. |
| 32 void Paint(const gfx::Rect& rect, gfx::Canvas* canvas) const; |
| 33 |
| 34 gfx::ImageSkia top_left; |
| 35 gfx::ImageSkia top; |
| 36 gfx::ImageSkia top_right; |
| 37 gfx::ImageSkia left; |
| 38 gfx::ImageSkia center; |
| 39 gfx::ImageSkia right; |
| 40 gfx::ImageSkia bottom_left; |
| 41 gfx::ImageSkia bottom; |
| 42 gfx::ImageSkia bottom_right; |
| 43 }; |
| 44 |
| 45 } // namespace views |
| 46 |
| 47 #endif // UI_VIEWS_CONTROLS_BUTTON_BORDER_IMAGES_H_ |
OLD | NEW |