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 #define SCWINMGR_GENIVI_NATIVE_SURFACE_ID 0x40000000
38 struct creation_surface_wait {
39 struct creation_surface_wait *next;
42 struct wl_surface *surface;
44 char title[ICO_SYC_MAX_WINNAME_LEN];
46 #define SCWINMGR_GENIVI_BUSY_NONE 0
47 #define SCWINMGR_GENIVI_BUSY_REQSURF 1
48 #define SCWINMGR_GENIVI_BUSY_REQBIND 2
49 #define SCWINMGR_GENIVI_BUSY_WAIT 3
51 class CicoSCWlWinMgrIF : public CicoSCWaylandIF {
53 virtual void initInterface(void *data,
54 struct wl_registry *registry,
56 const char *interface,
59 virtual void activeCB(void *data,
60 struct ico_window_mgr *ico_window_mgr,
64 virtual void mapSurfaceCB(void *data,
65 struct ico_window_mgr *ico_window_mgr,
74 virtual void updateSurfaceCB(void *data,
75 struct ico_window_mgr *ico_window_mgr,
85 virtual void destroySurfaceCB(void *data,
86 struct ico_window_mgr *ico_window_mgr,
89 virtual void updateWinnameCB(uint32_t surfaceid,
92 virtual void outputGeometryCB(void *data,
93 struct wl_output *wl_output,
96 int32_t physical_width,
97 int32_t physical_height,
103 virtual void outputModeCB(void *data,
104 struct wl_output *wl_output,
110 virtual void createSurfaceCB(void *data,
111 struct ivi_controller *ivi_controller,
116 static void wlIviCtrlRemoveSurface(uint32_t id_surface);
119 // default constructor
123 virtual ~CicoSCWlWinMgrIF();
125 // assignment operator
126 CicoSCWlWinMgrIF& operator=(const CicoSCWlWinMgrIF &object);
129 CicoSCWlWinMgrIF(const CicoSCWlWinMgrIF &object);
131 // wrapper function ico_window_mgr_set_window_layer
132 void setWindowLayer(uint32_t surfaceid, uint32_t layer, uint32_t oldlayer);
134 // wrapper function ico_window_mgr_set_positionsize
135 void setPositionsize(uint32_t surfaceid, uint32_t node,
136 int32_t x, int32_t y, int32_t width, int32_t height);
138 // wrapper function ico_window_mgr_set_visible
139 void setVisible(uint32_t surfaceid, int32_t visible);
141 // wrapper function of ico_window_mgr_set_animation
142 void setAnimation(uint32_t surfaceid, int32_t type,
143 const char *animation, int32_t time);
145 // wrapper function of ico_window_mgr_set_active
146 void setActive(uint32_t surfaceid, int32_t active);
148 // wrapper function of ico_window_mgr_set_layer_visible
149 void setLayerVisible(uint32_t layer, int32_t visible);
151 // wrapper function of ilm_takeSurfaceScreenshot
152 void setmapGet(int surfaceid, const char *filepath);
154 // wrapper function of ico_window_mgr_map_surface
155 void mapSurface(uint32_t surfaceid, int32_t framerate, const char *filepath);
157 // wrapper function of ico_window_mgr_unmap_surface
158 void unmapSurface(uint32_t surfaceid);
160 static const char *wlIviCtrlGetSurfaceWaiting(uint32_t id_surface, int *pid);
163 // ico_window_mgr(Multi Window Manager) callback functions
164 static void wlActiveCB(void *data,
165 struct ico_window_mgr *ico_window_mgr,
169 static void wlMapSurfaceCB(void *data,
170 struct ico_window_mgr *ico_window_mgr,
179 static void wlUpdateSurfaceCB(void *data,
180 struct ico_window_mgr *ico_window_mgr,
190 static void wlDestroySurfaceCB(void *data,
191 struct ico_window_mgr *ico_window_mgr,
194 static void wlOutputGeometryCB(void *data,
195 struct wl_output *wl_output,
198 int32_t physical_width,
199 int32_t physical_height,
205 static void wlOutputModeCB(void *data,
206 struct wl_output *wl_output,
212 static void wlIviAppNativeShellInfoCB(void *data,
213 struct ivi_application *ivi_application,
216 uint32_t id_surface);
217 static void wlIviCtrlScreenCB(void *data,
218 struct ivi_controller *ivi_controller,
220 struct ivi_controller_screen *screen);
222 static void wlIviCtrlLayerCB(void *data,
223 struct ivi_controller *ivi_controller,
226 static void wlIviCtrlSurfaceCB(void *data,
227 struct ivi_controller *ivi_controller,
232 static void wlIviCtrlErrorCB(void *data,
233 struct ivi_controller *ivi_controller,
237 const char *error_text);
239 static void wlIviCtrlNativeHandleCB(void *data,
240 struct ivi_controller *ivi_controller,
241 struct wl_surface *surface);
244 // ico_window_mgr listener
245 struct ico_window_mgr_listener m_listener;
247 // wayland output listener
248 struct wl_output_listener m_wlOutputListener;
250 // genivi ivi-application listener
251 struct ivi_application_listener m_ivi_app_listener;
253 // genivi ivi-controller listener
254 struct ivi_controller_listener m_ivi_ctrl_listener;
256 // Wayland's Window Manager PlugIn instance
257 static struct ico_window_mgr *m_winmgr;
259 // Wayland's genivi ivi_application instance
260 static struct ivi_application *m_ivi_app;
262 // Wayland's genivi ivi_controller instance
263 static struct ivi_controller *m_ivi_ctrl;
265 // Wayland's genivi ivi_controller_surface instance
266 static struct ivi_controller_surface *m_ivi_ctrl_surf;
268 // wayland output instance
269 static struct wl_output *m_wloutput;
271 // surface id for wayland/weston applications
272 static int m_id_surface;
274 // creation surface title name
275 static struct creation_surface_wait *m_wait_surface_creation;
276 static struct creation_surface_wait *m_free_surface_creation;
278 #endif // __CICO_SC_WL_WINMGR_IF_H__
279 // vim:set expandtab ts=4 sw=4: