Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 module mojo; | 5 module mojo; |
| 6 | 6 |
| 7 import "mojo/services/public/interfaces/geometry/geometry.mojom"; | |
| 8 | |
| 7 enum OrderDirection { | 9 enum OrderDirection { |
| 8 ABOVE = 1, | 10 ABOVE = 1, |
| 9 BELOW, | 11 BELOW, |
| 10 }; | 12 }; |
| 13 | |
| 14 enum AnimationTweenType { | |
| 15 LINEAR, | |
| 16 EASE_IN, | |
| 17 EASE_OUT, | |
| 18 EASE_IN_OUT, | |
| 19 }; | |
| 20 | |
| 21 enum AnimationProperty { | |
| 22 // Used for pausing. | |
| 23 NONE, | |
| 24 OPACITY, | |
| 25 TRANSFORM, | |
| 26 }; | |
| 27 | |
| 28 struct AnimationValue { | |
|
Elliot Glaysher
2014/12/03 23:49:59
You may want to have these in a different file; if
sky
2014/12/04 00:21:23
Done.
| |
| 29 float float_value; | |
| 30 Transform transform; | |
| 31 }; | |
| 32 | |
| 33 // Identifies how a particular property should be animated between a start and | |
| 34 // target value. | |
| 35 struct AnimationElement { | |
| 36 AnimationProperty property; | |
| 37 | |
| 38 // Duration is in microseconds. | |
| 39 int64 duration; | |
| 40 | |
| 41 AnimationTweenType tween_type; | |
| 42 | |
| 43 // If not specified the start value is taken from either the current value | |
| 44 // (for the first element) or the target_value of the previous element. | |
| 45 AnimationValue? start_value; | |
| 46 | |
| 47 // target_value may be null when property is NONE. | |
| 48 AnimationValue? target_value; | |
| 49 }; | |
| 50 | |
| 51 // An AnimationSequence consists of a number of AnimationElements to animate. | |
| 52 // Each element is animated serially. | |
| 53 struct AnimationSequence { | |
| 54 // Number of times to run the sequence. Value of 0 means run until | |
| 55 // explicitly stopped. | |
| 56 uint32 cycle_count; | |
| 57 | |
| 58 array<AnimationElement> elements; | |
| 59 }; | |
| 60 | |
| 61 // AnimationGroup identifies a view and a set of AnimationSequences to apply | |
| 62 // to the view. Each sequence is run in parallel. | |
| 63 struct AnimationGroup { | |
| 64 uint32 view_id; | |
| 65 array<AnimationSequence> sequences; | |
| 66 }; | |
| OLD | NEW |