OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CC_LAYERS_LAYER_POSITION_CONSTRAINT_H_ | 5 #ifndef CC_LAYERS_LAYER_POSITION_CONSTRAINT_H_ |
6 #define CC_LAYERS_LAYER_POSITION_CONSTRAINT_H_ | 6 #define CC_LAYERS_LAYER_POSITION_CONSTRAINT_H_ |
7 | 7 |
8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
11 | 11 |
12 namespace proto { | |
13 class LayerPositionConstraint; | |
14 } | |
15 | |
16 class CC_EXPORT LayerPositionConstraint { | 12 class CC_EXPORT LayerPositionConstraint { |
17 public: | 13 public: |
18 LayerPositionConstraint(); | 14 LayerPositionConstraint(); |
19 | 15 |
20 void set_is_fixed_position(bool fixed) { is_fixed_position_ = fixed; } | 16 void set_is_fixed_position(bool fixed) { is_fixed_position_ = fixed; } |
21 bool is_fixed_position() const { return is_fixed_position_; } | 17 bool is_fixed_position() const { return is_fixed_position_; } |
22 void set_is_fixed_to_right_edge(bool fixed) { | 18 void set_is_fixed_to_right_edge(bool fixed) { |
23 is_fixed_to_right_edge_ = fixed; | 19 is_fixed_to_right_edge_ = fixed; |
24 } | 20 } |
25 bool is_fixed_to_right_edge() const { return is_fixed_to_right_edge_; } | 21 bool is_fixed_to_right_edge() const { return is_fixed_to_right_edge_; } |
26 void set_is_fixed_to_bottom_edge(bool fixed) { | 22 void set_is_fixed_to_bottom_edge(bool fixed) { |
27 is_fixed_to_bottom_edge_ = fixed; | 23 is_fixed_to_bottom_edge_ = fixed; |
28 } | 24 } |
29 bool is_fixed_to_bottom_edge() const { return is_fixed_to_bottom_edge_; } | 25 bool is_fixed_to_bottom_edge() const { return is_fixed_to_bottom_edge_; } |
30 | 26 |
31 void ToProtobuf(proto::LayerPositionConstraint* proto) const; | |
32 void FromProtobuf(const proto::LayerPositionConstraint& proto); | |
33 | |
34 bool operator==(const LayerPositionConstraint&) const; | 27 bool operator==(const LayerPositionConstraint&) const; |
35 bool operator!=(const LayerPositionConstraint&) const; | 28 bool operator!=(const LayerPositionConstraint&) const; |
36 | 29 |
37 private: | 30 private: |
38 bool is_fixed_position_ : 1; | 31 bool is_fixed_position_ : 1; |
39 bool is_fixed_to_right_edge_ : 1; | 32 bool is_fixed_to_right_edge_ : 1; |
40 bool is_fixed_to_bottom_edge_ : 1; | 33 bool is_fixed_to_bottom_edge_ : 1; |
41 }; | 34 }; |
42 | 35 |
43 } // namespace cc | 36 } // namespace cc |
44 | 37 |
45 #endif // CC_LAYERS_LAYER_POSITION_CONSTRAINT_H_ | 38 #endif // CC_LAYERS_LAYER_POSITION_CONSTRAINT_H_ |
OLD | NEW |