LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
WindowContentTransitionRunner.h
Go to the documentation of this file.
1 /* @@@LICENSE
2 *
3 * Copyright (c) 2008-2012 Hewlett-Packard Development Company, L.P.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * LICENSE@@@ */
18 
19 
20 
21 
22 #ifndef WINDOWCONTENTTRANSITIONRUNNER_H
23 #define WINDOWCONTENTTRANSITIONRUNNER_H
24 
25 #include "Common.h"
26 
27 #include <glib.h>
28 
29 class CardWebApp;
30 class PGSurface;
31 class PGContext;
32 class PIpcChannel;
33 class PIpcBuffer;
34 
36 {
37 public:
38 
40 
41  void runRotateTransition(CardWebApp* app,
42  PGSurface* toSurface,
43  PGContext* dstContext,
44  int currAngle,
45  int targAngle);
46 
47 private:
48 
51 
52  void runLoop();
53  bool timerTicked();
54  static gboolean sourceCallback(gpointer arg);
55 
56  bool rotateTick();
57 
58 private:
59 
60  enum TransitionType {
61  Transition_Invalid,
62  Transition_Rotate
63  };
64 
65  struct AnimObject {
66  AnimObject() : currX(0), currY(0), currR(0), currB(0), currA(0),
67  targX(0), targY(0), targR(0), targB(0), targA(0) {}
68  int currX, currY, currR, currB, currA;
69  int targX, targY, targR, targB, targA;
70  };
71 
72  GMainLoop* m_mainLoop;
73  GMainContext* m_mainCtxt;
74 
75  TransitionType m_transitionType;
76 
77  CardWebApp* m_app;
78  PIpcChannel* m_channel;
79  PIpcBuffer* m_ipcBuffer;
80  PGContext* m_dstContext;
81 
82  AnimObject m_fromSceneAnimObject;
83  AnimObject m_toSceneAnimObject;
84 
85  PGSurface* m_fromSceneSurface;
86  PGSurface* m_toSceneSurface;
87  bool m_transitionIsPop;
88 
89  int m_currRotateAngle;
90  int m_targRotateAngle;
91 };
92 
93 #endif // WINDOWCONTENTTRANSITIONRUNNER_H