Addition of the window animation interface.
[profile/ivi/ico-uxf-weston-plugin.git] / src / ico_window_mgr.h
1 /*
2  * Copyright © 2010-2011 Intel Corporation
3  * Copyright © 2008-2011 Kristian Høgsberg
4  * Copyright © 2013 TOYOTA MOTOR CORPORATION.
5  *
6  * Permission to use, copy, modify, distribute, and sell this software and
7  * its documentation for any purpose is hereby granted without fee, provided
8  * that the above copyright notice appear in all copies and that both that
9  * copyright notice and this permission notice appear in supporting
10  * documentation, and that the name of the copyright holders not be used in
11  * advertising or publicity pertaining to distribution of the software
12  * without specific, written prior permission.  The copyright holders make
13  * no representations about the suitability of this software for any
14  * purpose.  It is provided "as is" without express or implied warranty.
15  *
16  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
17  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
18  * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
19  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
20  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
21  * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
22  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23  */
24 /**
25  * @brief   Public functions in ico_window_mgr Weston plugin
26  *
27  * @date    Feb-08-2013
28  */
29
30 #ifndef _ICO_WINDOW_MGR_H_
31 #define _ICO_WINDOW_MGR_H_
32
33 /* Cleint management table          */
34 struct uifw_client  {
35     struct wl_client *client;               /* Wayland client                       */
36     int     pid;                            /* ProcessId (pid)                      */
37     char    appid[ICO_IVI_APPID_LENGTH];    /* ApplicationId(from AppCore AUL)      */
38     char    manager;                        /* Manager flag (Need send event)       */
39     char    noconfigure;                    /* no need configure event              */
40     char    res[2];
41     struct wl_resource *resource;
42     struct wl_list  link;
43 };
44
45 /* UIFW surface                         */
46 struct shell_surface;
47 struct uifw_win_surface {
48     uint32_t id;                            /* UIFW SurfaceId                       */
49     int     layer;                          /* LayerId                              */
50     struct weston_surface *surface;         /* Weston surface                       */
51     struct shell_surface  *shsurf;          /* Shell(IVI-Shell) surface             */
52     struct uifw_client    *uclient;         /* Client                               */
53     int     x;                              /* X-axis                               */
54     int     y;                              /* Y-axis                               */
55     int     width;                          /* Width                                */
56     int     height;                         /* Height                               */
57     struct  _uifw_win_surface_animation {   /* wndow animation                      */
58         struct weston_animation animation;  /* animation control                    */
59         short   type;                       /* animation type                       */
60         short   type_next;                  /* next animation type                  */
61         short   current;                    /* animation current percentage         */
62         char    state;                      /* animation state                      */
63         char    visible;                    /* need visible(1)/hide(2) at end of animation*/
64         uint32_t starttime;                 /* start time(ms)                       */
65     }       animation;
66     void    *animadata;                     /* animation data                       */
67     struct wl_list link;                    /* surface link list                    */
68     struct uifw_win_surface *next_idhash;   /* UIFW SurfaceId hash list             */
69     struct uifw_win_surface *next_wshash;   /* Weston SurfaceId hash list           */
70 };
71
72 /* animation operation                  */
73 /* default animation                    */
74 #define ICO_WINDOW_MGR_ANIMATION_NONE           0   /* no animation                 */
75
76 /* return code of animation hook function*/
77 #define ICO_WINDOW_MGR_ANIMATION_RET_NOANIMA    -1  /* no animation                 */
78 #define ICO_WINDOW_MGR_ANIMATION_RET_ANIMA      0   /* animation                    */
79 #define ICO_WINDOW_MGR_ANIMATION_RET_ANIMASHOW  1   /* animation with visible       */
80
81 /* animation state                      */
82 #define ICO_WINDOW_MGR_ANIMATION_STATE_NONE     0   /* not animation                */
83 #define ICO_WINDOW_MGR_ANIMATION_STATE_IN       1   /* show(in) animation           */
84 #define ICO_WINDOW_MGR_ANIMATION_STATE_OUT      2   /* hide(out) animation          */
85 #define ICO_WINDOW_MGR_ANIMATION_STATE_MOVE     3   /* move animation               */
86 #define ICO_WINDOW_MGR_ANIMATION_STATE_RESIZE   4   /* resize animation             */
87
88 /* extended(plugin) animation operation */
89 #define ICO_WINDOW_MGR_ANIMATION_TYPE       0       /* convert animation name to value*/
90 #define ICO_WINDOW_MGR_ANIMATION_DESTROY    99      /* surface destroy              */
91 #define ICO_WINDOW_MGR_ANIMATION_OPIN       1       /* change to show               */
92 #define ICO_WINDOW_MGR_ANIMATION_OPOUT      2       /* change to hide               */
93 #define ICO_WINDOW_MGR_ANIMATION_OPMOVE     3       /* surface move                 */
94 #define ICO_WINDOW_MGR_ANIMATION_OPRESIZE   4       /* surface resize               */
95 #define ICO_WINDOW_MGR_ANIMATION_OPCANCEL   9       /* animation cancel             */
96
97 /* Prototype for function               */
98                                             /* get client applicationId             */
99 char *ico_window_mgr_appid(struct wl_client* client);
100                                             /* set window animation hook            */
101 void ico_window_mgr_set_animation(int (*hook_animation)(const int op, void *data));
102
103 #endif  /*_ICO_WINDOW_MGR_H_*/
104