2 * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
10 //==========================================================================
12 * @file CicoSCWlWinMgrIF.h
14 * @brief This file is definition of CicoSCWlWinMgrIF class
16 //==========================================================================
17 #ifndef __CICO_SC_WL_WINMGR_IF_H__
18 #define __CICO_SC_WL_WINMGR_IF_H__
20 #include <wayland-client.h>
21 #include <ilm/ilm_client.h>
22 #include <ilm/ilm_control.h>
23 #include <ico-uxf-weston-plugin/ico_window_mgr-client-protocol.h>
24 #include <weston/ivi-controller-client-protocol.h>
25 #include <weston/ivi-application-client-protocol.h>
27 #include "ico_syc_type.h"
28 #include "CicoSCWaylandIF.h"
29 #include "CicoSCWindow.h"
31 //--------------------------------------------------------------------------
33 * @brief This class is wayland interface of multi window manager
35 //--------------------------------------------------------------------------
36 struct creation_surface_wait {
37 struct creation_surface_wait *next;
40 struct wl_surface *surface;
42 char title[ICO_SYC_MAX_WINNAME_LEN];
44 #define SCWINMGR_GENIVI_BUSY_NONE 0
45 #define SCWINMGR_GENIVI_BUSY_REQSURF 1
46 #define SCWINMGR_GENIVI_BUSY_REQBIND 2
47 #define SCWINMGR_GENIVI_BUSY_WAIT 3
49 class CicoSCWlWinMgrIF : public CicoSCWaylandIF {
51 virtual void initInterface(void *data,
52 struct wl_registry *registry,
54 const char *interface,
57 virtual void activeCB(void *data,
58 struct ico_window_mgr *ico_window_mgr,
62 virtual void mapSurfaceCB(void *data,
63 struct ico_window_mgr *ico_window_mgr,
72 virtual void updateSurfaceCB(void *data,
73 struct ico_window_mgr *ico_window_mgr,
83 virtual void destroySurfaceCB(void *data,
84 struct ico_window_mgr *ico_window_mgr,
87 virtual void updateWinnameCB(uint32_t surfaceid,
90 virtual void outputGeometryCB(void *data,
91 struct wl_output *wl_output,
94 int32_t physical_width,
95 int32_t physical_height,
101 virtual void outputModeCB(void *data,
102 struct wl_output *wl_output,
108 virtual void createSurfaceCB(void *data,
109 struct ivi_controller *ivi_controller,
110 uint32_t id_surface);
112 static void wlIviCtrlRemoveSurface(uint32_t id_surface);
115 // default constructor
119 virtual ~CicoSCWlWinMgrIF();
121 // assignment operator
122 CicoSCWlWinMgrIF& operator=(const CicoSCWlWinMgrIF &object);
125 CicoSCWlWinMgrIF(const CicoSCWlWinMgrIF &object);
127 // wrapper function ico_window_mgr_set_window_layer
128 void setWindowLayer(uint32_t surfaceid, uint32_t layer, uint32_t oldlayer);
130 // wrapper function ico_window_mgr_set_positionsize
131 void setPositionsize(uint32_t surfaceid, uint32_t node,
132 int32_t x, int32_t y, int32_t width, int32_t height);
134 // wrapper function ico_window_mgr_set_visible
135 void setVisible(uint32_t surfaceid, int32_t visible);
137 // wrapper function of ico_window_mgr_set_animation
138 void setAnimation(uint32_t surfaceid, int32_t type,
139 const char *animation, int32_t time);
141 // wrapper function of ico_window_mgr_set_active
142 void setActive(uint32_t surfaceid, int32_t active);
144 // wrapper function of ico_window_mgr_set_layer_visible
145 void setLayerVisible(uint32_t layer, int32_t visible);
147 // wrapper function of ilm_takeSurfaceScreenshot
148 void setmapGet(int surfaceid, const char *filepath);
150 // wrapper function of ico_window_mgr_map_surface
151 void mapSurface(uint32_t surfaceid, int32_t framerate, const char *filepath);
153 // wrapper function of ico_window_mgr_unmap_surface
154 void unmapSurface(uint32_t surfaceid);
156 static const char *wlIviCtrlGetSurfaceWaiting(uint32_t id_surface, int *pid);
159 // ico_window_mgr(Multi Window Manager) callback functions
160 static void wlActiveCB(void *data,
161 struct ico_window_mgr *ico_window_mgr,
165 static void wlMapSurfaceCB(void *data,
166 struct ico_window_mgr *ico_window_mgr,
175 static void wlUpdateSurfaceCB(void *data,
176 struct ico_window_mgr *ico_window_mgr,
186 static void wlDestroySurfaceCB(void *data,
187 struct ico_window_mgr *ico_window_mgr,
190 static void wlOutputGeometryCB(void *data,
191 struct wl_output *wl_output,
194 int32_t physical_width,
195 int32_t physical_height,
201 static void wlOutputModeCB(void *data,
202 struct wl_output *wl_output,
208 static void wlIviAppNativeShellInfoCB(void *data,
209 struct ivi_application *ivi_application,
212 static void wlIviCtrlScreenCB(void *data,
213 struct ivi_controller *ivi_controller,
215 struct ivi_controller_screen *screen);
217 static void wlIviCtrlLayerCB(void *data,
218 struct ivi_controller *ivi_controller,
221 static void wlIviCtrlSurfaceCB(void *data,
222 struct ivi_controller *ivi_controller,
223 uint32_t id_surface);
225 static void wlIviCtrlErrorCB(void *data,
226 struct ivi_controller *ivi_controller,
230 const char *error_text);
232 static void wlIviCtrlNativeHandleCB(void *data,
233 struct ivi_controller *ivi_controller,
234 struct wl_surface *surface);
237 // ico_window_mgr listener
238 struct ico_window_mgr_listener m_listener;
240 // wayland output listener
241 struct wl_output_listener m_wlOutputListener;
243 // genivi ivi-application listener
244 struct ivi_application_listener m_ivi_app_listener;
246 // genivi ivi-controller listener
247 struct ivi_controller_listener m_ivi_ctrl_listener;
249 // Wayland's Window Manager PlugIn instance
250 static struct ico_window_mgr *m_winmgr;
252 // Wayland's genivi ivi_application instance
253 static struct ivi_application *m_ivi_app;
255 // Wayland's genivi ivi_controller instance
256 static struct ivi_controller *m_ivi_ctrl;
258 // Wayland's genivi ivi_controller_surface instance
259 static struct ivi_controller_surface *m_ivi_ctrl_surf;
261 // wayland output instance
262 static struct wl_output *m_wloutput;
264 // surface id for wayland/weston applications
265 static int m_id_surface;
267 // creation surface title name
268 static struct creation_surface_wait *m_wait_surface_creation;
269 static struct creation_surface_wait *m_free_surface_creation;
271 #endif // __CICO_SC_WL_WINMGR_IF_H__
272 // vim:set expandtab ts=4 sw=4: