| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserv
ed. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 #ifndef NinePieceImage_h | 24 #ifndef NinePieceImage_h |
| 25 #define NinePieceImage_h | 25 #define NinePieceImage_h |
| 26 | 26 |
| 27 #include "core/CoreExport.h" | 27 #include "core/CoreExport.h" |
| 28 #include "core/style/BorderImageLengthBox.h" | 28 #include "core/style/BorderImageLengthBox.h" |
| 29 #include "core/style/DataRef.h" | 29 #include "core/style/DataRef.h" |
| 30 #include "core/style/StyleImage.h" | 30 #include "core/style/StyleImage.h" |
| 31 #include "platform/LayoutUnit.h" | 31 #include "platform/LayoutUnit.h" |
| 32 #include "platform/LengthBox.h" | 32 #include "platform/LengthBox.h" |
| 33 #include "wtf/Allocator.h" |
| 33 | 34 |
| 34 namespace blink { | 35 namespace blink { |
| 35 | 36 |
| 36 enum ENinePieceImageRule { | 37 enum ENinePieceImageRule { |
| 37 StretchImageRule, RoundImageRule, SpaceImageRule, RepeatImageRule | 38 StretchImageRule, RoundImageRule, SpaceImageRule, RepeatImageRule |
| 38 }; | 39 }; |
| 39 | 40 |
| 40 class CORE_EXPORT NinePieceImageData : public RefCounted<NinePieceImageData> { | 41 class CORE_EXPORT NinePieceImageData : public RefCounted<NinePieceImageData> { |
| 41 public: | 42 public: |
| 42 static PassRefPtr<NinePieceImageData> create() { return adoptRef(new NinePie
ceImageData); } | 43 static PassRefPtr<NinePieceImageData> create() { return adoptRef(new NinePie
ceImageData); } |
| 43 PassRefPtr<NinePieceImageData> copy() const { return adoptRef(new NinePieceI
mageData(*this)); } | 44 PassRefPtr<NinePieceImageData> copy() const { return adoptRef(new NinePieceI
mageData(*this)); } |
| 44 | 45 |
| 45 bool operator==(const NinePieceImageData&) const; | 46 bool operator==(const NinePieceImageData&) const; |
| 46 bool operator!=(const NinePieceImageData& o) const { return !(*this == o); } | 47 bool operator!=(const NinePieceImageData& o) const { return !(*this == o); } |
| 47 | 48 |
| 48 unsigned fill : 1; | 49 unsigned fill : 1; |
| 49 unsigned horizontalRule : 2; // ENinePieceImageRule | 50 unsigned horizontalRule : 2; // ENinePieceImageRule |
| 50 unsigned verticalRule : 2; // ENinePieceImageRule | 51 unsigned verticalRule : 2; // ENinePieceImageRule |
| 51 RefPtrWillBePersistent<StyleImage> image; | 52 RefPtrWillBePersistent<StyleImage> image; |
| 52 LengthBox imageSlices; | 53 LengthBox imageSlices; |
| 53 BorderImageLengthBox borderSlices; | 54 BorderImageLengthBox borderSlices; |
| 54 BorderImageLengthBox outset; | 55 BorderImageLengthBox outset; |
| 55 | 56 |
| 56 private: | 57 private: |
| 57 NinePieceImageData(); | 58 NinePieceImageData(); |
| 58 NinePieceImageData(const NinePieceImageData&); | 59 NinePieceImageData(const NinePieceImageData&); |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 class CORE_EXPORT NinePieceImage { | 62 class CORE_EXPORT NinePieceImage { |
| 63 DISALLOW_ALLOCATION(); |
| 62 public: | 64 public: |
| 63 NinePieceImage(); | 65 NinePieceImage(); |
| 64 NinePieceImage(PassRefPtrWillBeRawPtr<StyleImage>, LengthBox imageSlices, bo
ol fill, const BorderImageLengthBox& borderSlices, | 66 NinePieceImage(PassRefPtrWillBeRawPtr<StyleImage>, LengthBox imageSlices, bo
ol fill, const BorderImageLengthBox& borderSlices, |
| 65 const BorderImageLengthBox& outset, ENinePieceImageRule horizontalRule,
ENinePieceImageRule verticalRule); | 67 const BorderImageLengthBox& outset, ENinePieceImageRule horizontalRule,
ENinePieceImageRule verticalRule); |
| 66 | 68 |
| 67 bool operator==(const NinePieceImage& other) const { return m_data == other.
m_data; } | 69 bool operator==(const NinePieceImage& other) const { return m_data == other.
m_data; } |
| 68 bool operator!=(const NinePieceImage& other) const { return m_data != other.
m_data; } | 70 bool operator!=(const NinePieceImage& other) const { return m_data != other.
m_data; } |
| 69 | 71 |
| 70 bool hasImage() const { return m_data->image; } | 72 bool hasImage() const { return m_data->image; } |
| 71 StyleImage* image() const { return m_data->image.get(); } | 73 StyleImage* image() const { return m_data->image.get(); } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 return outsetSide.length().value(); | 127 return outsetSide.length().value(); |
| 126 } | 128 } |
| 127 | 129 |
| 128 private: | 130 private: |
| 129 DataRef<NinePieceImageData> m_data; | 131 DataRef<NinePieceImageData> m_data; |
| 130 }; | 132 }; |
| 131 | 133 |
| 132 } // namespace blink | 134 } // namespace blink |
| 133 | 135 |
| 134 #endif // NinePieceImage_h | 136 #endif // NinePieceImage_h |
| OLD | NEW |