2 * Copyright © 2010-2011 Intel Corporation
3 * Copyright © 2008-2011 Kristian Høgsberg
4 * Copyright © 2013-2014 TOYOTA MOTOR CORPORATION.
6 * Permission to use, copy, modify, distribute, and sell this software and
7 * its documentation for any purpose is hereby granted without fee, provided
8 * that the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of the copyright holders not be used in
11 * advertising or publicity pertaining to distribution of the software
12 * without specific, written prior permission. The copyright holders make
13 * no representations about the suitability of this software for any
14 * purpose. It is provided "as is" without express or implied warranty.
16 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
17 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
18 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
20 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
21 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
22 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 * @brief The common functions that each Plugin is available.
30 #ifndef _ICO_IVI_COMMON_PRIVATE_H_
31 #define _ICO_IVI_COMMON_PRIVATE_H_
33 /* Log for performance evaluations */
34 #define PERFORMANCE_EVALUATIONS 1
37 #define ICO_IVI_NODEID_2_HOSTID(nodeid) (((unsigned int)nodeid) >> 8)
38 #define ICO_IVI_NODEID_2_DISPLAYNO(nodeid) (((unsigned int)nodeid) & 0x0ff)
39 #define ICO_IVI_NODEDISP_2_NODEID(nodeid, displayno) \
40 ((nodeid << 8) | displayno)
41 #define ICO_IVI_SURFACEID_2_HOSTID(surfid) (((unsigned int)surfid) >> 24)
42 #define ICO_IVI_SURFACEID_2_DISPLAYNO(surfid) ((((unsigned int)surfid) >> 16) & 0x0ff)
43 #define ICO_IVI_SURFACEID_2_NODEID(surfid) (((unsigned int)surfid) >> 16)
44 #define ICO_IVI_SURFACEID_BASE(nodeid) (((unsigned int)nodeid) << 16)
47 #define ICO_IVI_MAX_DISPLAY (8) /* Maximum numer of displays in a ECU */
48 #define ICO_IVI_APPID_LENGTH (80) /* Maximum length of applicationId(AppCore) */
49 /* (with terminate NULL) */
50 #define ICO_IVI_WINNAME_LENGTH (40) /* Maximum length of window name (with NULL)*/
51 #define ICO_IVI_FILEPATH_LENGTH (80) /* Maximum length of file path (with NULL)*/
52 #define ICO_IVI_ANIMATION_LENGTH (16) /* Maximum length of animation name (w NULL)*/
53 #define ICO_IVI_MAX_COORDINATE (16383) /* Maximum X or Y coordinate */
64 #define ICO_IVI_OPTION_SHOW_SURFACE 0x0001 /* new surface show on create */
65 #define ICO_IVI_OPTION_SHOW_NODISP 0x0002 /* show if display not exist */
66 #define ICO_IVI_OPTION_SHOW_INPUTLAYER 0x0004 /* show input panel layer */
67 #define ICO_IVI_OPTION_SUPPORT_SHM 0x0010 /* support shm_buffer thumbnail */
68 #define ICO_IVI_OPTION_FIXED_ASPECT 0x0080 /* surface fixed aspect rate */
69 #define ICO_IVI_OPTION_GPU_DEPEND 0x8000 /* Acceleration depending on GPU */
72 #define ICO_IVI_DEBUG_PERF_LOG 0x0001 /* performance log */
74 /* Function prototype */
75 int ico_ivi_get_mynode(void); /* Get my node numner */
76 int ico_ivi_optionflag(void); /* Get option flag */
77 int ico_ivi_debuglevel(void); /* Get debug log level */
78 int ico_ivi_debugflag(void); /* Get debug flag */
79 /* Get default animation name */
80 const char *ico_ivi_default_animation_name(void);
81 int ico_ivi_default_animation_time(void); /* Get default animation time(ms) */
82 int ico_ivi_default_animation_fps(void); /* Get animation frame rate(fps) */
85 /* Define for debug write */
86 #define UIFW_DEBUG_OUT 1 /* 1=Debug Print/0=No Debug Print */
88 #if UIFW_DEBUG_OUT > 0
89 #define uifw_perf(fmt,...) \
90 { if (ico_ivi_debugflag() & ICO_IVI_DEBUG_PERF_LOG) {weston_log("PRF>"fmt" (%s:%d)\n",##__VA_ARGS__,__FILE__,__LINE__);} }
91 #define uifw_debug(fmt,...) \
92 { if (ico_ivi_debuglevel() >= 5) {weston_log("DBG>"fmt" (%s:%d)\n",##__VA_ARGS__,__FILE__,__LINE__);} }
93 #define uifw_trace(fmt,...) \
94 { if (ico_ivi_debuglevel() >= 4) {weston_log("TRC>"fmt" (%s:%d)\n",##__VA_ARGS__,__FILE__,__LINE__);} }
96 #ifdef UIFW_DETAIL_OUT
97 #if UIFW_DETAIL_OUT > 0
98 #define uifw_detail(fmt,...) \
99 { if (ico_ivi_debuglevel() >= 5) {weston_log("DBG>"fmt" (%s:%d)\n",##__VA_ARGS__,__FILE__,__LINE__);} }
101 #define uifw_detail(fmt,...)
104 #define uifw_detail(fmt,...)
107 #else /*UIFW_DEBUG_OUT*/
108 #define uifw_perf(fmt,...)
109 #define uifw_debug(fmt,...)
110 #define uifw_trace(fmt,...)
111 #endif /*UIFW_DEBUG_OUT*/
113 #define uifw_info(fmt,...) \
114 { if (ico_ivi_debuglevel() >= 3) {weston_log("INF>"fmt" (%s:%d)\n",##__VA_ARGS__,__FILE__,__LINE__);} }
115 #define uifw_warn(fmt,...) \
116 { if (ico_ivi_debuglevel() >= 2) {weston_log("WRN>"fmt" (%s:%d)\n",##__VA_ARGS__,__FILE__,__LINE__);} }
117 #define uifw_error(fmt,...) \
118 { if (ico_ivi_debuglevel() >= 1) {weston_log("ERR>"fmt" (%s:%d)\n",##__VA_ARGS__,__FILE__,__LINE__);} }
120 #endif /*_ICO_IVI_COMMON_PRIVATE_H_*/