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 * @brief header file of System Controller internal definition
15 #ifndef _ICO_SYC_PRIVATE_H_
16 #define _ICO_SYC_PRIVATE_H_
23 #include "ico_syc_type.h"
29 /*============================================================================*/
31 /*============================================================================*/
35 #define ICO_SYC_URI (char *)"ws://127.0.0.1:18081"
36 #define ICO_SYC_PROTOCOL (char *)"ico_syc_protocol"
38 #define ICO_SYC_MAX_LEN 128
43 #define ICO_SYC_PACKAGE_SYSTEMCONTROLLER "org.tizen.ico.system-controller"
44 #define ICO_SYC_PACKAGE_HOMESCREEN "org.tizen.ico.homescreen"
45 #define ICO_SYC_PACKAGE_STATUSBAR "org.tizen.ico.statusbar"
46 #define ICO_SYC_PACKAGE_ONSCREEN "org.tizen.ico.onscreen"
47 #define ICO_SYC_PACKAGE_LOGIN "org.tizen.ico.login"
48 #define ICO_SYC_PACKAGE_DIALER "org.tizen.dialer"
51 * configuration file path
53 #define ICO_SYC_CONFIGPATH_HOME "ico"
54 #define ICO_SYC_CONFIGPATH_HOME_CONFIG ICO_SYC_CONFIGPATH_HOME "/config"
55 #define ICO_SYC_CONFIGPATH_HOME_IMAGE ICO_SYC_CONFIGPATH_HOME "/images"
56 #define ICO_SYC_CONFIGPATH_HOME_SOUND ICO_SYC_CONFIGPATH_HOME "/sound"
57 #define ICO_SYC_CONFIGPATH_PACKAGE "res"
58 #define ICO_SYC_CONFIGPATH_PACKAGE_CONFIG ICO_SYC_CONFIGPATH_PACKAGE "/config"
59 #define ICO_SYC_CONFIGPATH_PACKAGE_IMAGE ICO_SYC_CONFIGPATH_PACKAGE "/images"
60 #define ICO_SYC_CONFIGPATH_PACKAGE_SOUND ICO_SYC_CONFIGPATH_PACKAGE "/sound"
62 /*============================================================================*/
63 /* variable & table */
64 /*============================================================================*/
65 struct ico_syc_res_context {
66 char appid[ICO_SYC_MAX_LEN];
68 ico_syc_res_window_t *window;
70 ico_syc_res_sound_t *sound;
72 ico_syc_res_input_t *input;
74 /* window and sound resource type (basic or interruption) */
78 /*============================================================================*/
79 /* internal function (common) */
80 /*============================================================================*/
81 /*--------------------------------------------------------------------------*/
84 * @brief ico_syc_get_context
85 * Get the ico_uws context connected to System Controller.
88 * @retval context success
91 /*--------------------------------------------------------------------------*/
92 struct ico_uws_context *ico_syc_get_context(void);
94 /*--------------------------------------------------------------------------*/
97 * @brief ico_syc_get_id
98 * Get the ico_uws id to send message to System Controller.
104 /*--------------------------------------------------------------------------*/
105 void *ico_syc_get_id(void);
107 /*--------------------------------------------------------------------------*/
110 * @brief ico_syc_get_appid
111 * Get the application id.
114 * @retval appid success
117 /*--------------------------------------------------------------------------*/
118 char *ico_syc_get_appid(void);
120 /*============================================================================*/
121 /* internal function (winctl) */
122 /*============================================================================*/
123 /*--------------------------------------------------------------------------*/
126 * @brief ico_syc_cb_win
127 * Execute callback function. (ICO_SYC_EV_WIN_ACTIVE
128 * ICO_SYC_EV_WIN_CREATE
129 * ICO_SYC_EV_WIN_DESTROY)
131 * @param[in] callback callback function
132 * @param[in] user_data passed data on called callback function
133 * @param[in] event event code
134 * @param[in] data message data
135 * @param[in] len length of data
138 /*--------------------------------------------------------------------------*/
139 void ico_syc_cb_win(ico_syc_callback_t callback, void *user_data,
140 int event, const void *data, size_t len);
142 /*--------------------------------------------------------------------------*/
145 * @brief ico_syc_cb_win_attr
146 * Execute callback function. (ICO_SYC_EV_WIN_ATTR_CHANGE)
148 * @param[in] callback callback function
149 * @param[in] user_data passed data on called callback function
150 * @param[in] event event code
151 * @param[in] data message data
152 * @param[in] len length of data
155 /*--------------------------------------------------------------------------*/
156 void ico_syc_cb_win_attr(ico_syc_callback_t callback, void *user_data,
157 int event, const void *data, size_t len);
159 /*--------------------------------------------------------------------------*/
162 * @brief ico_syc_cb_thumb
163 * Execute callback function. (ICO_SYC_EV_THUMB_ERROR
164 * ICO_SYC_EV_THUMB_CHANGE
165 * ICO_SYC_EV_THUMB_UNMAP)
167 * @param[in] callback callback function
168 * @param[in] user_data passed data on called callback function
169 * @param[in] event event code
170 * @param[in] data message data
171 * @param[in] len length of data
174 /*--------------------------------------------------------------------------*/
175 void ico_syc_cb_thumb(ico_syc_callback_t callback, void *user_data,
176 int event, const void *data, size_t len);
178 /*--------------------------------------------------------------------------*/
181 * @brief ico_syc_cb_layer
182 * Execute callback function. (ICO_SYC_EV_LAYER_ATTR_CHANGE)
184 * @param[in] callback callback function
185 * @param[in] user_data passed data on called callback function
186 * @param[in] event event code
187 * @param[in] data message data
188 * @param[in] len length of data
191 /*--------------------------------------------------------------------------*/
192 void ico_syc_cb_layer(ico_syc_callback_t callback, void *user_data,
193 int event, const void *data, size_t len);
195 /*============================================================================*/
196 /* internal function (userctl) */
197 /*============================================================================*/
198 /*--------------------------------------------------------------------------*/
201 * @brief ico_syc_cb_auth
202 * Execute callback function. (ICO_SYC_EV_AUTH_FAIL)
204 * @param[in] callback callback function
205 * @param[in] user_data passed data on called callback function
206 * @param[in] event event code
209 /*--------------------------------------------------------------------------*/
210 void ico_syc_cb_auth(ico_syc_callback_t callback, void *user_data, int event);
212 /*--------------------------------------------------------------------------*/
215 * @brief ico_syc_cb_userlist
216 * Execute callback function. (ICO_SYC_EV_USERLIST)
218 * @param[in] callback callback function
219 * @param[in] user_data passed data on called callback function
220 * @param[in] event event code
221 * @param[in] data message data
222 * @param[in] len length of data
225 /*--------------------------------------------------------------------------*/
226 void ico_syc_cb_userlist(ico_syc_callback_t callback, void *user_data,
227 int event, const void *data, size_t len);
229 /*--------------------------------------------------------------------------*/
232 * @brief ico_syc_cb_lastinfo
233 * Execute callback function. (ICO_SYC_EV_LASTINFO)
235 * @param[in] callback callback function
236 * @param[in] user_data passed data on called callback function
237 * @param[in] event event code
238 * @param[in] data message data
239 * @param[in] len length of data
242 /*--------------------------------------------------------------------------*/
243 void ico_syc_cb_lastinfo(ico_syc_callback_t callback, void *user_data,
244 int event, const void *data, size_t len);
246 /*============================================================================*/
247 /* internal function (appresctl) */
248 /*============================================================================*/
249 /*--------------------------------------------------------------------------*/
252 * @brief ico_syc_cb_res
253 * Execute callback function. (ICO_SYC_EV_RES_ACQUIRE
254 * ICO_SYC_EV_RES_DEPRIVE
255 * ICO_SYC_EV_RES_WAITING
256 * ICO_SYC_EV_RES_REVERT
257 * ICO_SYC_EV_RES_RELEASE)
259 * @param[in] callback callback function
260 * @param[in] user_data passed data on called callback function
261 * @param[in] event event code
262 * @param[in] data message data
263 * @param[in] len length of data
266 /*--------------------------------------------------------------------------*/
267 void ico_syc_cb_res(ico_syc_callback_t callback, void *user_data,
268 int event, const void *data, size_t len);
270 /*--------------------------------------------------------------------------*/
273 * @brief ico_syc_cb_region
274 * Execute callback function. (ICO_SYC_EV_INPUT_SET
275 * ICO_SYC_EV_INPUT_UNSET)
277 * @param[in] callback callback function
278 * @param[in] user_data passed data on called callback function
279 * @param[in] event event code
280 * @param[in] data message data
281 * @param[in] len length of data
284 /*--------------------------------------------------------------------------*/
285 void ico_syc_cb_region(ico_syc_callback_t callback, void *user_data,
286 int event, const void *data, size_t len);
289 /*============================================================================*/
290 /* NodeId <-> DisplayId macro */
291 /*============================================================================*/
292 #define ICO_SYC_ECUBASE 100
293 #define ICO_SYC_DISPLAYID(nodeid) (nodeid % ICO_SYC_ECUBASE)
294 #define ICO_SYC_ECUID(nodeid) (nodeid / ICO_SYC_ECUBASE)
295 #define ICO_SYC_NODEID(ecuid, displayid) (ecuid * ICO_SYC_ECUBASE + \
296 (displayid % ICO_SYC_ECUBASE))
298 /*============================================================================*/
300 /*============================================================================*/
307 #define LOG_TAG "ICO_SYC"
308 #include <dlog/dlog.h>
310 #define _ERR(fmt, arg...) \
313 "ico_syc E: %s:%d [ "fmt" ]\n", \
317 LOGE("%s:%d " fmt, __FUNCTION__, __LINE__, ##arg); \
320 #define _WARN(fmt, arg...) \
323 "ico_syc W: %s:%d [ "fmt" ]\n", \
327 LOGW("%s:%d " fmt, __FUNCTION__, __LINE__, ##arg); \
330 #define _INFO(fmt, arg...) \
333 "ico_syc I: %s:%d [ "fmt" ]\n", \
337 LOGI("%s:%d " fmt, __FUNCTION__, __LINE__, ##arg); \
340 #define _DBG(fmt, arg...) \
342 LOGD("%s:%d " fmt, __FUNCTION__, __LINE__, ##arg); \
347 #define _ERR(fmt, arg...) \
350 "ico_syc E: %s:%d [ "fmt" ]\n", \
356 #define _WARN(fmt, arg...) \
359 "ico_syc W: %s:%d [ "fmt" ]\n", \
366 #define _INFO(fmt, arg...) \
369 "ico_syc I: %s:%d [ "fmt" ]\n", \
375 #define _DBG(fmt, arg...) \
377 if (getenv("ICO_SYC_DEBUG")) { \
379 "ico_syc D: %s:%d [ "fmt" ]\n", \
392 #endif /*_ICO_SYC_PRIVATE_H_*/
393 /* vim:set expandtab ts=4 sw=4: */