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 tWlExt of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
10 //==========================================================================
12 * @file CicoSCWlInputMgrIF.cpp
14 * @brief This file implementation of CicoSCInputDev class
16 //==========================================================================
23 #include "CicoSCWlInputMgrIF.h"
24 #include "CicoSCWayland.h"
27 //--------------------------------------------------------------------------
29 * @brief default constructor
31 //--------------------------------------------------------------------------
32 CicoSCWlInputMgrIF::CicoSCWlInputMgrIF()
36 //--------------------------------------------------------------------------
40 //--------------------------------------------------------------------------
41 CicoSCWlInputMgrIF::~CicoSCWlInputMgrIF()
45 //--------------------------------------------------------------------------
47 * @brief initialize input interfaces
49 * @param [in] data user data
50 * @param [in] registry wayland registry
51 * @param [in] name wayland display id
52 * @parma [in] interface wayland interface name
53 * @parma [in] version wayland interface version number
55 //--------------------------------------------------------------------------
57 CicoSCWlInputMgrIF::initInterface(void *data,
58 struct wl_registry *registry,
60 const char *interface,
63 ICO_TRA("CicoSCWlInputMgrIF::initInterface : Enter(interface=%s)", interface);
65 ICO_TRA("CicoSCWlInputMgrIF::initInterface Leave");
68 //--------------------------------------------------------------------------
70 * @brief wrapper function add_input_app
72 * @param [in] appid application id
73 * @param [in] device input device name
74 * @param [in] input input number
75 * @parma [in] fix fixed assign flag
76 * @parma [in] keycode assigned keycode value
78 //--------------------------------------------------------------------------
80 CicoSCWlInputMgrIF::addInputApp(const string &appid,
86 ICO_DBG("called: add_input_app"
87 "(appid=%s device=%s input=%d fix=%d keycode=%d)",
88 appid.c_str(), device.c_str(), input, fix, keycode);
91 //--------------------------------------------------------------------------
93 * @brief wrapper function del_input_app
95 * @param [in] appid application id
96 * @param [in] device input device name
97 * @param [in] input input number
99 //--------------------------------------------------------------------------
101 CicoSCWlInputMgrIF::delInputApp(const string &appid,
102 const string &device,
105 ICO_DBG("called: del_input_app"
106 "(appid=%s device=%s input=%d)",
107 appid.c_str(), device.c_str(), input);
110 //--------------------------------------------------------------------------
112 * @brief wrapper function set_input_region
114 * @param [in] target target window name(winname@appid)
115 * @param [in] x region x positon
116 * @param [in] y region y positon
117 * @param [in] width region width
118 * @param [in] height region height
119 * @param [in] hotspot_x hotspot x position
120 * @param [in] hotspot_y hotspot y position
121 * @param [in] cursor_x cursor x position
122 * @param [in] cursor_y cursor y position
123 * @param [in] cursor_width cursor width
124 * @param [in] cursor_height cursor height
125 * @param [in] attr region attribute
127 //--------------------------------------------------------------------------
129 CicoSCWlInputMgrIF::setInputRegion(const string &target,
142 ICO_DBG("called: set_input_region"
143 "(target=%s x/y=%d/%d w/h=%d/%d hot=%d/%d "
144 "cursor=%d/%d-%d/%d attr=%d)",
145 target.c_str(), x, y, width, height, hotspot_x, hotspot_y,
146 cursor_x, cursor_y, cursor_width, cursor_height, attr);
149 //--------------------------------------------------------------------------
151 * @brief wrapper function unset_input_region
153 * @param [in] target target window name(winname@appid)
154 * @param [in] x region x positon
155 * @param [in] y region y positon
156 * @param [in] width region width
157 * @param [in] height region height
159 //--------------------------------------------------------------------------
161 CicoSCWlInputMgrIF::unsetInputRegion(const string &target,
167 ICO_DBG("called: unset_input_region"
168 "(target=%s x=%d y=%d width=%d height=%d",
169 target.c_str(), x, y, width, height);
172 //--------------------------------------------------------------------------
174 * @brief callback to application for input switch information
176 * @param [in] data user data
177 * @param [in] device input device name
178 * @param [in] type input device type (as enum type)
179 * @param [in] swname input switch name
180 * @param [in] input input switch number
181 * @param [in] codename input code name
182 * @param [in] code input code number
184 //--------------------------------------------------------------------------
186 CicoSCWlInputMgrIF::capabilitiesCB(void *data,
191 const char *codename,
194 ICO_WRN("CicoSCWlInputMgrIF::capabilitiesCB called.");
197 //--------------------------------------------------------------------------
199 * @brief callback to application for input code information
201 * @param [in] data user data
202 * @param [in] device input device name
203 * @param [in] input input switch number
204 * @param [in] codename input code name
205 * @param [in] code input code number
207 //--------------------------------------------------------------------------
209 CicoSCWlInputMgrIF::codeCB(void *data,
212 const char *codename,
215 ICO_WRN("CicoSCWlInputMgrIF::codeCB called.");
218 //--------------------------------------------------------------------------
220 * @brief callback to application for switch input
222 * @param [in] data user data
223 * @param [in] time input time of millisecond
224 * @param [in] device input device name
225 * @param [in] input input switch number
226 * @param [in] code input switch code
227 * @param [in] state Of/Off status
229 //--------------------------------------------------------------------------
231 CicoSCWlInputMgrIF::inputCB(void *data,
238 ICO_WRN("CicoSCWlInputMgrIF::inputCB called.");
241 //--------------------------------------------------------------------------
243 * @brief callback to application for change input region
245 * @param [in] data user data
246 * @param [in] region input regions
248 //--------------------------------------------------------------------------
250 CicoSCWlInputMgrIF::regionCB(void *data,
251 struct wl_array *region)
253 ICO_WRN("CicoSCWlInputMgrIF::regionCB called.");
256 //==========================================================================
258 //==========================================================================
260 //--------------------------------------------------------------------------
262 * @brief callback to application for input switch information
264 * @param [in] data user data
265 * @param [in] device input device name
266 * @param [in] type input device type (as enum type)
267 * @param [in] swname input switch name
268 * @param [in] input input switch number
269 * @param [in] codename input code name
270 * @param [in] code input code number
272 //--------------------------------------------------------------------------
274 CicoSCWlInputMgrIF::wlCapabilitiesCB(void *data,
279 const char *codename,
283 ICO_WRN("wlCapabilitiesCB: data is null");
286 static_cast<CicoSCWlInputMgrIF*>(data)->capabilitiesCB(data, device, type,
291 //--------------------------------------------------------------------------
293 * @brief callback to application for input code information
295 * @param [in] data user data
296 * @param [in] device input device name
297 * @param [in] input input switch number
298 * @param [in] codename input code name
299 * @param [in] code input code number
301 //--------------------------------------------------------------------------
303 CicoSCWlInputMgrIF::wlCodeCB(void *data,
306 const char *codename,
310 ICO_WRN("wlCodeCB: data is null");
313 static_cast<CicoSCWlInputMgrIF*>(data)->codeCB(data, device, input,
317 //--------------------------------------------------------------------------
319 * @brief callback to application for switch input
321 * @param [in] data user data
322 * @param [in] time input time of millisecond
323 * @param [in] device input device name
324 * @param [in] input input switch number
325 * @param [in] code input switch code
326 * @param [in] state Of/Off status
328 //--------------------------------------------------------------------------
330 CicoSCWlInputMgrIF::wlInputCB(void *data,
338 ICO_WRN("wlInputCB: data is null");
341 static_cast<CicoSCWlInputMgrIF*>(data)->inputCB(data, time, device, input,
345 //--------------------------------------------------------------------------
347 * @brief callback to application for change input region
349 * @param [in] data user data
350 * @param [in] region input regions
352 //--------------------------------------------------------------------------
354 CicoSCWlInputMgrIF::wlRegionCB(void *data,
355 struct wl_array *region)
358 ICO_WRN("wlRegionCB: data is null");
361 static_cast<CicoSCWlInputMgrIF*>(data)->regionCB(data, region);
363 // vim:set expandtab ts=4 sw=4: