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,
114 static void wlIviCtrlRemoveSurface(uint32_t id_surface);
117 // default constructor
121 virtual ~CicoSCWlWinMgrIF();
123 // assignment operator
124 CicoSCWlWinMgrIF& operator=(const CicoSCWlWinMgrIF &object);
127 CicoSCWlWinMgrIF(const CicoSCWlWinMgrIF &object);
129 // wrapper function ico_window_mgr_set_window_layer
130 void setWindowLayer(uint32_t surfaceid, uint32_t layer, uint32_t oldlayer);
132 // wrapper function ico_window_mgr_set_positionsize
133 void setPositionsize(uint32_t surfaceid, uint32_t node,
134 int32_t x, int32_t y, int32_t width, int32_t height);
136 // wrapper function ico_window_mgr_set_visible
137 void setVisible(uint32_t surfaceid, int32_t visible);
139 // wrapper function of ico_window_mgr_set_animation
140 void setAnimation(uint32_t surfaceid, int32_t type,
141 const char *animation, int32_t time);
143 // wrapper function of ico_window_mgr_set_active
144 void setActive(uint32_t surfaceid, int32_t active);
146 // wrapper function of ico_window_mgr_set_layer_visible
147 void setLayerVisible(uint32_t layer, int32_t visible);
149 // wrapper function of ilm_takeSurfaceScreenshot
150 void setmapGet(int surfaceid, const char *filepath);
152 // wrapper function of ico_window_mgr_map_surface
153 void mapSurface(uint32_t surfaceid, int32_t framerate, const char *filepath);
155 // wrapper function of ico_window_mgr_unmap_surface
156 void unmapSurface(uint32_t surfaceid);
158 static const char *wlIviCtrlGetSurfaceWaiting(uint32_t id_surface, int *pid);
161 // ico_window_mgr(Multi Window Manager) callback functions
162 static void wlActiveCB(void *data,
163 struct ico_window_mgr *ico_window_mgr,
167 static void wlMapSurfaceCB(void *data,
168 struct ico_window_mgr *ico_window_mgr,
177 static void wlUpdateSurfaceCB(void *data,
178 struct ico_window_mgr *ico_window_mgr,
188 static void wlDestroySurfaceCB(void *data,
189 struct ico_window_mgr *ico_window_mgr,
192 static void wlOutputGeometryCB(void *data,
193 struct wl_output *wl_output,
196 int32_t physical_width,
197 int32_t physical_height,
203 static void wlOutputModeCB(void *data,
204 struct wl_output *wl_output,
210 static void wlIviAppNativeShellInfoCB(void *data,
211 struct ivi_application *ivi_application,
214 uint32_t id_surface);
215 static void wlIviCtrlScreenCB(void *data,
216 struct ivi_controller *ivi_controller,
218 struct ivi_controller_screen *screen);
220 static void wlIviCtrlLayerCB(void *data,
221 struct ivi_controller *ivi_controller,
224 static void wlIviCtrlSurfaceCB(void *data,
225 struct ivi_controller *ivi_controller,
230 static void wlIviCtrlErrorCB(void *data,
231 struct ivi_controller *ivi_controller,
235 const char *error_text);
237 static void wlIviCtrlNativeHandleCB(void *data,
238 struct ivi_controller *ivi_controller,
239 struct wl_surface *surface);
242 // ico_window_mgr listener
243 struct ico_window_mgr_listener m_listener;
245 // wayland output listener
246 struct wl_output_listener m_wlOutputListener;
248 // genivi ivi-application listener
249 struct ivi_application_listener m_ivi_app_listener;
251 // genivi ivi-controller listener
252 struct ivi_controller_listener m_ivi_ctrl_listener;
254 // Wayland's Window Manager PlugIn instance
255 static struct ico_window_mgr *m_winmgr;
257 // Wayland's genivi ivi_application instance
258 static struct ivi_application *m_ivi_app;
260 // Wayland's genivi ivi_controller instance
261 static struct ivi_controller *m_ivi_ctrl;
263 // Wayland's genivi ivi_controller_surface instance
264 static struct ivi_controller_surface *m_ivi_ctrl_surf;
266 // wayland output instance
267 static struct wl_output *m_wloutput;
269 // surface id for wayland/weston applications
270 static int m_id_surface;
272 // creation surface title name
273 static struct creation_surface_wait *m_wait_surface_creation;
274 static struct creation_surface_wait *m_free_surface_creation;
276 #endif // __CICO_SC_WL_WINMGR_IF_H__
277 // vim:set expandtab ts=4 sw=4: