OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_AURA_SCREEN_ROTATION_H_ | 5 #ifndef UI_GFX_COMPOSITOR_SCREEN_ROTATION_H_ |
6 #define UI_AURA_SCREEN_ROTATION_H_ | 6 #define UI_GFX_COMPOSITOR_SCREEN_ROTATION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "ui/base/animation/animation_delegate.h" | 11 #include "ui/base/animation/animation_delegate.h" |
| 12 #include "ui/gfx/compositor/compositor_export.h" |
12 #include "ui/gfx/compositor/layer_animation_element.h" | 13 #include "ui/gfx/compositor/layer_animation_element.h" |
13 #include "ui/gfx/point.h" | 14 #include "ui/gfx/point.h" |
14 | 15 |
15 namespace ui { | 16 namespace ui { |
16 class InterpolatedTransform; | 17 class InterpolatedTransform; |
17 class LayerAnimationDelegate; | 18 class LayerAnimationDelegate; |
18 } | |
19 | 19 |
20 // A screen rotation represents a single transition from one screen orientation | 20 // A screen rotation represents a single transition from one screen orientation |
21 // to another. The intended usage is that a new instance of the class is | 21 // to another. The intended usage is that a new instance of the class is |
22 // created for every transition. It is possible to update the target orientation | 22 // created for every transition. It is possible to update the target orientation |
23 // in the middle of a transition. | 23 // in the middle of a transition. |
24 class ScreenRotation : public ui::LayerAnimationElement { | 24 class COMPOSITOR_EXPORT ScreenRotation : public LayerAnimationElement { |
25 public: | 25 public: |
26 // The screen rotation does not own the view or the listener, and these | 26 // The screen rotation does not own the view or the listener, and these |
27 // objects are required to outlive the Screen rotation object. | 27 // objects are required to outlive the Screen rotation object. |
28 ScreenRotation(int degrees); | 28 ScreenRotation(int degrees); |
29 virtual ~ScreenRotation(); | 29 virtual ~ScreenRotation(); |
30 | 30 |
31 private: | 31 private: |
32 // Implementation of ui::LayerAnimationDelegate | 32 // Implementation of LayerAnimationDelegate |
33 virtual void OnStart(ui::LayerAnimationDelegate* delegate) OVERRIDE; | 33 virtual void OnStart(LayerAnimationDelegate* delegate) OVERRIDE; |
34 virtual void OnProgress(double t, | 34 virtual void OnProgress(double t, |
35 ui::LayerAnimationDelegate* delegate) OVERRIDE; | 35 LayerAnimationDelegate* delegate) OVERRIDE; |
36 virtual void OnGetTarget(TargetValue* target) const OVERRIDE; | 36 virtual void OnGetTarget(TargetValue* target) const OVERRIDE; |
37 virtual void OnAbort() OVERRIDE; | 37 virtual void OnAbort() OVERRIDE; |
38 | 38 |
39 static const ui::LayerAnimationElement::AnimatableProperties& GetProperties(); | 39 static const LayerAnimationElement::AnimatableProperties& GetProperties(); |
40 | 40 |
41 // Generates the intermediate transformation matrices used during the | 41 // Generates the intermediate transformation matrices used during the |
42 // animation. | 42 // animation. |
43 scoped_ptr<ui::InterpolatedTransform> interpolated_transform_; | 43 scoped_ptr<InterpolatedTransform> interpolated_transform_; |
44 | 44 |
45 // The number of degrees to rotate. | 45 // The number of degrees to rotate. |
46 int degrees_; | 46 int degrees_; |
47 | 47 |
48 // The target origin for |view_| | 48 // The target origin |
49 gfx::Point new_origin_; | 49 gfx::Point new_origin_; |
50 | 50 |
51 DISALLOW_COPY_AND_ASSIGN(ScreenRotation); | 51 DISALLOW_COPY_AND_ASSIGN(ScreenRotation); |
52 }; | 52 }; |
53 | 53 |
54 #endif // UI_AURA_SCREEN_ROTATION_H_ | 54 } // namespace ui |
| 55 |
| 56 #endif // UI_GFX_COMPOSITOR_SCREEN_ROTATION_H_ |
OLD | NEW |