# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
-AC_INIT([org.tizen.ico.homescreen], [0.9.14], [])
+AC_INIT([org.tizen.ico.homescreen], [0.9.21], [])
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_HEADERS([config.h])
AC_SUBST(UWS_CFLAGS)
AC_SUBST(UWS_LIBS)
+GENIVI_CFLAGS="-I/usr/include/ilm -I/usr/include/layermanager"
+GENIVI_LIBS="-lilmCommon -lilmControl -lilmClient"
+AC_SUBST(GENIVI_CFLAGS)
+AC_SUBST(GENIVI_LIBS)
+
SLPPKGMGR_CFLAGS="$SLPPKGMGR_CFLAGS"
SLPPKGMGR_LIBS="$SLPPKGMGR_LIBS"
AC_SUBST(SLPPKGMGR_CFLAGS)
<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.ico.homescreen" version="0.9.14" install-location="internal-only">
+<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.ico.homescreen" version="0.9.21" install-location="internal-only">
<label>HomeScreen</label>
<description>IVI HomeScreen Application</description>
<ui-application appid="org.tizen.ico.homescreen" exec="/usr/apps/org.tizen.ico.homescreen/bin/HomeScreen" nodisplay="true" multiple="false" type="capp" taskmanage="true">
<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.ico.onscreen" version="0.9.14" install-location="internal-only">
+<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.ico.onscreen" version="0.9.21" install-location="internal-only">
<label>OnScreen</label>
<description>IVI OnScreen Application</description>
<ui-application appid="org.tizen.ico.onscreen" exec="/usr/apps/org.tizen.ico.onscreen/bin/OnScreen" nodisplay="true" multiple="false" type="capp" taskmanage="true">
<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.ico.statusbar" version="0.9.14" install-location="internal-only">
+<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.ico.statusbar" version="0.9.21" install-location="internal-only">
<label>StatusBar</label>
<description>IVI StatusBar Application</description>
<ui-application appid="org.tizen.ico.statusbar" exec="/usr/apps/org.tizen.ico.statusbar/bin/StatusBar" nodisplay="true" multiple="false" type="capp" taskmanage="true">
<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.ico.system-controller" version="0.9.14" install-location="internal-only">
+<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.ico.system-controller" version="0.9.21" install-location="internal-only">
<label>system-controller</label>
<author email="" href=""> </author>
<description>ico system-controller</description>
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
* @brief header file of Input Control API
* for privilege applications
*
- * @date July-31-2013
+ * @date Feb-21-2014
*/
#ifndef _ICO_SYC_INPUTCTL_H_
/*--------------------------------------------------------------------------*/
int ico_syc_delete_input(const char *appid, const char *device, int input);
-/*--------------------------------------------------------------------------*/
-/**
- * @brief ico_syc_send_input
- * Send the input event to the application.
- *
- * @param[in] appid application id
- * @param[in] surface window's surface id
- * @param[in] type device type of input event
- * @param[in] deviceno input device number
- * @param[in] time input event time(ms), if 0 auto generate
- * @param[in] code input event code
- * @param[in] value input event value
- * @return result
- * @retval 0 success
- * @retval not 0 error
- * @see ico_syc_input_type_e
- */
-/*--------------------------------------------------------------------------*/
-int ico_syc_send_input(const char *appid, int surface, int type,
- int deviceno, int time, int code, int value);
-
-
#ifdef __cplusplus
}
#endif
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
#define MSG_CMD_NAME 0x00010009
#define MSG_CMD_MAP_THUMB 0x00010011
#define MSG_CMD_UNMAP_THUMB 0x00010012
-#define MSG_CMD_MAP_BUFFER 0x00010013
+#define MSG_CMD_MAP_GET 0x00010013
#define MSG_CMD_SHOW_LAYER 0x00010020
#define MSG_CMD_HIDE_LAYER 0x00010021
#define MSG_CMD_CHANGE_LAYER_ATTR 0x00010022
/* input controller */
#define MSG_CMD_ADD_INPUT 0x00020001
#define MSG_CMD_DEL_INPUT 0x00020002
-#define MSG_CMD_SEND_INPUT 0x00020003
/* user controller */
#define MSG_CMD_CHANGE_USER 0x00030001
#define MSG_CMD_GET_USERLIST 0x00030002
--- /dev/null
+/*
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0. The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+/**
+ * @brief header file of System Fixed Parameters
+ * for privilege and general applications
+ *
+ * @date Feb-21-2014
+ */
+
+#ifndef _ICO_SYC_SYSDEF_H_
+#define _ICO_SYC_SYSDEF_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Display number
+ */
+#define ICO_SYC_DISPLAY_CENTER 0 /* center display Id */
+#define ICO_SYC_DISPLAY_MATER 1 /* meter display Id */
+
+/*
+ * Layer id
+ */
+#define ICO_SYC_LAYER_BACKGROUND 0 /* layer of BackGround */
+#define ICO_SYC_LAYER_APPLICATION 1 /* layer of Application */
+#define ICO_SYC_LAYER_HOMESCREEN 2 /* layer of HomeScreen menu */
+#define ICO_SYC_LAYER_CONTROLBAR 3 /* layer of Control/Status bar */
+#define ICO_SYC_LAYER_FULLSCREEN 4 /* layer of FullScreen Application */
+#define ICO_SYC_LAYER_ONSCREEN 5 /* layer of OnScreen */
+#define ICO_SYC_LAYER_TOUCHPANEL 6 /* layer of TouchPanel input */
+#define ICO_SYC_LAYER_CURSOR 7 /* layer of Cursor */
+
+#define ICO_SYC_LAYER_MATERAPP 3 /* layer of Meter application */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /*_ICO_SYC_SYSDEF_H_*/
+/* vim:set expandtab ts=4 sw=4: */
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
* @brief header file of System Controller
* for privilege and general applications
*
- * @date Aug-6-2013
+ * @date Feb-21-2014
*/
#ifndef _ICO_SYC_TYPE_H_
* @ICO_SYC_WIN_NOCHANGE: no change value
*/
typedef enum _win_value {
- ICO_SYC_WIN_NOCHANGE = ICO_WINDOW_MGR_V_NOCHANGE
+ ICO_SYC_WIN_NOCHANGE = 99999999
} ico_syc_win_value_e;
/*
* @ICO_SYC_WIN_RAISE_NOCHANGE: order of showing surface is not change
*/
typedef enum _window_raise {
- ICO_SYC_WIN_RAISE_RAISE = ICO_WINDOW_MGR_RAISE_RAISE,
- ICO_SYC_WIN_RAISE_LOWER = ICO_WINDOW_MGR_RAISE_LOWER,
- ICO_SYC_WIN_RAISE_NOCHANGE = ICO_WINDOW_MGR_V_NOCHANGE
+ ICO_SYC_WIN_RAISE_RAISE = 1,
+ ICO_SYC_WIN_RAISE_LOWER = 0,
+ ICO_SYC_WIN_RAISE_NOCHANGE = 9
} ico_syc_win_raise_e;
/*
* @ICO_SYC_WIN_VISIBLE_NOCHANGE: show/hide status is not change
*/
typedef enum _window_visible {
- ICO_SYC_WIN_VISIBLE_SHOW = ICO_WINDOW_MGR_VISIBLE_SHOW,
- ICO_SYC_WIN_VISIBLE_HIDE = ICO_WINDOW_MGR_VISIBLE_HIDE,
- ICO_SYC_WIN_VISIBLE_NOCHANGE = ICO_WINDOW_MGR_V_NOCHANGE
+ ICO_SYC_WIN_VISIBLE_SHOW = 1,
+ ICO_SYC_WIN_VISIBLE_HIDE = 0,
+ ICO_SYC_WIN_VISIBLE_NOCHANGE = 9
} ico_syc_win_visible_e;
/*
- * type of window active
- * @ICO_SYC_WIN_ACTIVE_NONE: surface is not active
- * @ICO_SYC_WIN_ACTIVE_POINTER: pointing device is active
- * @ICO_SYC_WIN_ACTIVE_KEYBOARD: keyboard is active
- * @ICO_SYC_WIN_ACTIVE_SELECTED: pointing device that is operated
- * by touch panel or mouse is still active
+ * window change hint
+ * @ICO_SYC_WIN_HINT_HINT: hint information(no change)
+ * @ICO_SYC_WIN_HINT_CHANGE: real changed
*/
-typedef enum _window_active {
- ICO_SYC_WIN_ACTIVE_NONE = ICO_WINDOW_MGR_ACTIVE_NONE,
- ICO_SYC_WIN_ACTIVE_POINTER = ICO_WINDOW_MGR_ACTIVE_POINTER,
- ICO_SYC_WIN_ACTIVE_KEYBOARD = ICO_WINDOW_MGR_ACTIVE_KEYBOARD,
- ICO_SYC_WIN_ACTIVE_SELECTED = ICO_WINDOW_MGR_ACTIVE_SELECTED
-} ico_syc_win_act_e;
+typedef enum _window_change_hint {
+ ICO_SYC_WIN_HINT_HINT = 1,
+ ICO_SYC_WIN_HINT_CHANGE = 0
+} ico_syc_win_change_hint_e;
+
+/*
+ * type of window active select
+ * @ICO_SYC_WIN_ACTIVE_NONE: no device(surface not active)
+ * @ICO_SYC_WIN_ACTIVE_POINTER: active by pointing device(mouse)
+ * @ICO_SYC_WIN_ACTIVE_TOUCH: active by touchpanel device
+ */
+typedef enum _window_active_select {
+ ICO_SYC_WIN_ACTIVE_NONE = 0,
+ ICO_SYC_WIN_ACTIVE_POINTER = 1,
+ ICO_SYC_WIN_ACTIVE_TOUCH = 2
+} ico_syc_win_act_select_e;
/*
* layer show/hide status
* @ICO_SYC_LAYER_VISIBLE_HIDE: hide the layer
*/
typedef enum _layer_visible {
- ICO_SYC_LAYER_VISIBLE_SHOW = 0,
- ICO_SYC_LAYER_VISIBLE_HIDE = 1
+ ICO_SYC_LAYER_VISIBLE_SHOW = 1,
+ ICO_SYC_LAYER_VISIBLE_HIDE = 0,
+ ICO_SYC_LAYER_VISIBLE_NOCHANGE = 9
} ico_syc_layer_visible_e;
+/*
+ * surface animation on/off
+ * @ICO_SYC_ANIMATION_ON: surface animation
+ * @ICO_SYC_ANIMATION_OFF: no surface animation
+ */
+typedef enum _surface_animation {
+ ICO_SYC_ANIMATION_ON = 1,
+ ICO_SYC_ANIMATION_OFF = 0
+} ico_syc_surface_animation;
+
+/*
+ * type of window aspect
+ * @ICO_SYC_WIN_ASPECT_FIXED: fixed aspect
+ * @ICO_SYC_WIN_ASPECT_ALIGN_LEFT: left align
+ * @ICO_SYC_WIN_ASPECT_ALIGN_RIGHT: right align
+ * @ICO_SYC_WIN_ASPECT_ALIGN_TOP: top align
+ * @ICO_SYC_WIN_ASPECT_ALIGN_BOTTOM: bottom align
+ */
+typedef enum _window_aspect {
+ ICO_SYC_WIN_ASPECT_FIXED = 16,
+ ICO_SYC_WIN_ASPECT_ALIGN_LEFT = 1,
+ ICO_SYC_WIN_ASPECT_ALIGN_RIGHT = 2,
+ ICO_SYC_WIN_ASPECT_ALIGN_TOP = 4,
+ ICO_SYC_WIN_ASPECT_ALIGN_BOTTOM = 8,
+} ico_syc_win_aspect_e;
+
/**
* system state
*/
char *appid; /* application id */
int surface; /* window's surface id */
int type; /* buffer type(ICO_WINDOW_MGR_MAP_TYPE_EGL/SHM/PIXEL)*/
- int name; /* EGL buffer name/shared memory buffer index(+1) */
int width; /* window width */
int height; /* window height */
int stride; /* byte par line of frame buffer */
typedef void (*ico_syc_callback_t) (const ico_syc_ev_e event,
const void *detail,
void *user_data);
-
#ifdef __cplusplus
}
#endif
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
* @brief header file of Window Control API
* for privilege applications
*
- * @date July-31-2013
+ * @date Feb-21-2014
*/
#ifndef _ICO_SYC_WINCTL_H_
/*--------------------------------------------------------------------------*/
/**
- * @brief ico_syc_map_buffer
- * Set map buffer for surface image mapping to the memory.
+ * @brief ico_syc_map_get
+ * Get surface image pixel to the file.
*
- * @param[in] shmname shared memory name
- * @param[in] bufsize buffer size [byte]
- * @param[in] bufnum number of buffer
+ * @param[in] surface window's surface id
+ * @param[in] filepath pixel image file path
* @return result
* @retval 0 success
* @retval not 0 error
*/
/*--------------------------------------------------------------------------*/
-int ico_syc_map_buffer(const char *shmname, int bufsize, int bufnum);
+int ico_syc_map_get(int surface, const char *filepath);
/*--------------------------------------------------------------------------*/
/**
* @brief ico_syc_map_thumb
- * Map the thumbnail data for mapping to the memory.
+ * Map the thumbnail data
*
* @param[in] surface window's surface id
* @param[in] framerate notify cycle [frames par sec]
+ * @param[in] filepath pixel image file path
* @return result
* @retval 0 success
* @retval not 0 error
*/
/*--------------------------------------------------------------------------*/
-int ico_syc_map_thumb(int surface, int framerate);
+int ico_syc_map_thumb(int surface, int framerate, const char *filepath);
/*--------------------------------------------------------------------------*/
/**
lib_LTLIBRARIES = libico-appfw.la
-COMMON_LIBS = -lm -lwebsockets -lico-uxf-weston-plugin
+COMMON_LIBS = -lm -lwebsockets -lico-uxf-weston-plugin -lilmCommon -lilmControl -lilmClient
libico_appfw_la_CFLAGS = -I../../include $(OPT_CFLAGS) $(UWS_CFLAGS) \
$(AUL_CFLAGS) @ECORE_CFLAGS@ \
+ -I/usr/include/ilm \
+ -I/usr/include/layermanager \
-I/usr/include/ico-uxf-weston-plugin \
-I/usr/include/ico-util
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
* @brief Input Control API
* for privilege applications
*
- * @date July-31-2013
+ * @date Feb-21-2014
*/
#include "ico_syc_msg_cmd_def.h"
int input, int fix, int keycode);
static msg_t _create_del_input_msg(const char *appid,
const char *device, int input);
-static msg_t _create_send_input_msg(const char *appid, int surface, int type,
- int deviceno, int time, int code, int value);
/*============================================================================*/
/* static function */
return gen;
}
-/*--------------------------------------------------------------------------*/
-/**
- * @brief _create_send_input_msg
- * Create the message to send input event.
- *
- * @param[in] appid application id
- * @param[in] surface window's surface id
- * @param[in] type device type of input event
- * @param[in] deviceno input device number
- * @param[in] time input event time(ms)
- * @param[in] code input event code
- * @param[in] value input event value
- * @return json generator
- * @retval json generator success
- * @retval NULL error
- */
-/*--------------------------------------------------------------------------*/
-static msg_t
-_create_send_input_msg(const char *appid, int surface, int type,
- int deviceno, int time, int code, int value)
-{
- JsonObject *obj = NULL;
- JsonObject *argobj = NULL;
- JsonGenerator *gen = NULL;
- JsonNode *root = NULL;
-
- /* create json object */
- obj = json_object_new();
- argobj = json_object_new();
- if (obj == NULL || argobj == NULL) {
- _ERR("json_object_new failed");
- return NULL;
- }
-
- /* set message */
- json_object_set_int_member(obj, MSG_PRMKEY_CMD, MSG_CMD_SEND_INPUT);
- json_object_set_string_member(obj, MSG_PRMKEY_APPID, appid);
- json_object_set_int_member(obj, MSG_PRMKEY_PID, getpid());
-
- json_object_set_int_member(argobj, MSG_PRMKEY_SURFACE, surface);
- json_object_set_int_member(argobj, MSG_PRMKEY_EV_TYPE, type);
- json_object_set_int_member(argobj, MSG_PRMKEY_DEVICE, deviceno);
- json_object_set_int_member(argobj, MSG_PRMKEY_EV_TIME, time);
- json_object_set_int_member(argobj, MSG_PRMKEY_EV_CODE, code);
- json_object_set_int_member(argobj, MSG_PRMKEY_EV_VAL, value);
- json_object_set_object_member(obj, MSG_PRMKEY_ARG, argobj);
-
- /* create root object */
- root = json_node_new(JSON_NODE_OBJECT);
- json_node_take_object(root, obj);
-
- /* create generator object */
- gen = json_generator_new();
- json_generator_set_root(gen, root);
-
- return gen;
-}
-
/*============================================================================*/
/* public interface function */
/*============================================================================*/
return ret;
}
-
-/*--------------------------------------------------------------------------*/
-/**
- * @brief ico_syc_send_input
- * Send the input event to the application.
- *
- * @param[in] appid application id
- * @param[in] surface window's surface id
- * @param[in] type device type of input event
- * @param[in] deviceno input device number
- * @param[in] time input event time
- * @param[in] code input event code
- * @param[in] value input event value
- * @return result
- * @retval 0 success
- * @retval not 0 error
- * @see ico_syc_input_type_e
- */
-/*--------------------------------------------------------------------------*/
-ICO_API int
-ico_syc_send_input(const char *appid, int surface, int type,
- int deviceno, int time, int code, int value)
-{
- int ret = ICO_SYC_ERR_NONE;
- msg_t msg;
-
- /* check argument */
- if (appid == NULL) {
- _ERR("invalid parameter (appid is NULL)");
- return ICO_SYC_ERR_INVALID_PARAM;
- }
-
- /* make message */
- msg = _create_send_input_msg(appid, surface, type, deviceno, time, code, value);
- /* send message */
- ret = ico_syc_send_msg(msg);
- /* free send message */
- ico_syc_free_msg(msg);
-
- return ret;
-}
/* vim: set expandtab ts=4 sw=4: */
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
* @brief Window Control API
* for privilege applications
*
- * @date Aug-22-2013
+ * @date Feb-21-2014
*/
#include <string.h>
const ico_syc_win_move_t *move,
const ico_syc_animation_t *animation);
static msg_t _create_active_win_msg(const char *appid, int surface);
-static msg_t _create_change_layer_msg(const char *appid, int surface,
- int layer);
-static msg_t _create_map_buffer_msg(const char *appid, const char *shmname,
- int bufsize, int bufnum);
-static msg_t _create_map_thumb_msg(const char *appid, int surface, int framerate);
+static msg_t _create_change_layer_msg(const char *appid, int surface, int layer);
+static msg_t _create_map_get_msg(const char *appid, int surface, const char *filepath);
+static msg_t _create_map_thumb_msg(const char *appid, int surface, int framerate,
+ const char *filepath);
static msg_t _create_unmap_thumb_msg(const char *appid, int surface);
-static msg_t _create_layer_msg(const char *appid, int layer, int attr,
- int type);
+static msg_t _create_layer_msg(const char *appid, int layer, int type);
/*============================================================================*/
/* static function */
/*--------------------------------------------------------------------------*/
/**
- * @brief _create_map_buffer_msg
- * Create the message to map buffer.
+ * @brief _create_map_get_msg
+ * Create the message to map get.
*
* @param[in] appid application id
- * @param[in] shmname shared memory name
- * @param[in] bufsize buffer size
- * @param[in] bufnum number of buffer
+ * @param[in] surface window's surface id
+ * @param[in] filepath pixel image file path
* @return json generator
* @retval json generator success
* @retval NULL error
*/
/*--------------------------------------------------------------------------*/
static msg_t
-_create_map_buffer_msg(const char *appid, const char *shmname, int bufsize, int bufnum)
+_create_map_get_msg(const char *appid, int surface, const char *filepath)
{
JsonObject *obj = NULL;
JsonObject *argobj = NULL;
}
/* set message */
- json_object_set_int_member(obj, MSG_PRMKEY_CMD, MSG_CMD_MAP_BUFFER);
+ json_object_set_int_member(obj, MSG_PRMKEY_CMD, MSG_CMD_MAP_GET);
json_object_set_string_member(obj, MSG_PRMKEY_APPID, appid);
json_object_set_int_member(obj, MSG_PRMKEY_PID, getpid());
- json_object_set_string_member(argobj, MSG_PRMKEY_ANIM_NAME, shmname);
- json_object_set_int_member(argobj, MSG_PRMKEY_WIDTH, bufsize);
- json_object_set_int_member(argobj, MSG_PRMKEY_HEIGHT, bufnum);
+ json_object_set_int_member(argobj, MSG_PRMKEY_SURFACE, surface);
+ json_object_set_string_member(argobj, MSG_PRMKEY_ANIM_NAME, filepath);
json_object_set_object_member(obj, MSG_PRMKEY_ARG, argobj);
/* create root object */
* @param[in] appid application id
* @param[in] surface window's surface id
* @param[in] framerate notify cycle [frames par sec]
+ * @param[in] filepath pixel image file path
* @return json generator
* @retval json generator success
* @retval NULL error
*/
/*--------------------------------------------------------------------------*/
static msg_t
-_create_map_thumb_msg(const char *appid, int surface, int framerate)
+_create_map_thumb_msg(const char *appid, int surface, int framerate, const char *filepath)
{
JsonObject *obj = NULL;
JsonObject *argobj = NULL;
json_object_set_int_member(argobj, MSG_PRMKEY_SURFACE, surface);
json_object_set_int_member(argobj, MSG_PRMKEY_RATE, framerate);
+ if ((filepath != NULL) && (*filepath != 0) && (*filepath != ' ')) {
+ json_object_set_string_member(argobj, MSG_PRMKEY_ANIM_NAME, filepath);
+ }
+ else {
+ json_object_set_string_member(argobj, MSG_PRMKEY_ANIM_NAME, " ");
+ }
json_object_set_object_member(obj, MSG_PRMKEY_ARG, argobj);
/* create root object */
*
* @param[in] appid application id
* @param[in] layer window's layer id
- * @param[in] attr attribute
* @param[in] type type of command
* @return json generator
* @retval json generator success
*/
/*--------------------------------------------------------------------------*/
static msg_t
-_create_layer_msg(const char *appid, int layer, int attr, int type)
+_create_layer_msg(const char *appid, int layer, int type)
{
JsonObject *obj = NULL;
JsonObject *argobj = NULL;
thumb_info->surface = ico_syc_get_int_member(argobj,
MSG_PRMKEY_SURFACE);
- thumb_info->name = ico_syc_get_int_member(argobj, MSG_PRMKEY_NAME);
thumb_info->type = ico_syc_get_int_member(argobj, MSG_PRMKEY_ATTR);
thumb_info->width = ico_syc_get_int_member(argobj, MSG_PRMKEY_WIDTH);
thumb_info->height = ico_syc_get_int_member(argobj, MSG_PRMKEY_HEIGHT);
/*--------------------------------------------------------------------------*/
/**
- * @brief ico_syc_map_buffer
- * Prepare the thumbnail set map buffer for mapping to the memory.
+ * @brief ico_syc_map_get
+ * Get the surface thumbnail pixel image to the file.
*
- * @param[in] shmname shared memory name
- * @param[in] bufsize buffer size [byte]
- * @param[in] bufnum number of buffer
+ * @param[in] surface window's surface id
+ * @param[in] filepath surface image pixel file path
* @return result
* @retval 0 success
* @retval not 0 error
*/
/*--------------------------------------------------------------------------*/
ICO_API int
-ico_syc_map_buffer(const char *shmname, int bufsize, int bufnum)
+ico_syc_map_get(int surface, const char *filepath)
{
int ret = ICO_SYC_ERR_NONE;
msg_t msg;
appid = ico_syc_get_appid();
/* make message */
- msg = _create_map_buffer_msg(appid, shmname, bufsize, bufnum);
+ msg = _create_map_get_msg(appid, surface, filepath);
/* send message */
ret = ico_syc_send_msg(msg);
/* free send message */
/*--------------------------------------------------------------------------*/
/**
* @brief ico_syc_map_thumb
- * Prepare the thumbnail data for mapping to the memory.
+ * Prepare the thumbnail data
*
* @param[in] surface window's surface id
* @param[in] framerate notify cycle [ms]
+ * @param[in] filepath pixel image file path
* @return result
* @retval 0 success
* @retval not 0 error
*/
/*--------------------------------------------------------------------------*/
ICO_API int
-ico_syc_map_thumb(int surface, int framerate)
+ico_syc_map_thumb(int surface, int framerate, const char *filepath)
{
int ret = ICO_SYC_ERR_NONE;
msg_t msg;
appid = ico_syc_get_appid();
/* make message */
- msg = _create_map_thumb_msg(appid, surface, framerate);
+ msg = _create_map_thumb_msg(appid, surface, framerate, filepath);
/* send message */
ret = ico_syc_send_msg(msg);
/* free send message */
appid = ico_syc_get_appid();
/* make message */
- msg = _create_layer_msg(appid, layer, 0, _CMD_SHOW_LAYER);
+ msg = _create_layer_msg(appid, layer, _CMD_SHOW_LAYER);
/* send message */
ret = ico_syc_send_msg(msg);
/* free send message */
appid = ico_syc_get_appid();
/* make message */
- msg = _create_layer_msg(appid, layer, 0, _CMD_HIDE_LAYER);
+ msg = _create_layer_msg(appid, layer, _CMD_HIDE_LAYER);
/* send message */
ret = ico_syc_send_msg(msg);
/* free send message */
* @param [in]
*/
//--------------------------------------------------------------------------
+const CicoSCDisplayConf*
+CicoSystemConfig::findDisplayConfbyId(int id)
+{
+ vector<CicoSCDisplayConf*>::iterator itr;
+ itr = m_displayConfList.begin();
+ for (; itr != m_displayConfList.end(); ++itr) {
+ const CicoSCDisplayConf* conf = NULL;
+ conf = const_cast<CicoSCDisplayConf*>(*itr);
+ if (id == conf->id) {
+ return conf;
+ }
+ }
+ return NULL;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief
+ *
+ * @param [in]
+ */
+//--------------------------------------------------------------------------
const CicoSCLayerConf*
CicoSystemConfig::findLayerConfbyName(const string & displayName,
const string & layerName)
* @param [in]
*/
//--------------------------------------------------------------------------
+const CicoSCLayerConf*
+CicoSystemConfig::findLayerConfbyIdx(int displayid, int idx)
+{
+ const CicoSCDisplayConf* displayConf = NULL;
+ displayConf = findDisplayConfbyId(displayid);
+ if (NULL == displayConf) {
+ return NULL;
+ }
+
+ vector<CicoSCLayerConf*>::const_iterator itr;
+ itr = displayConf->layerConfList.begin();
+ for (; itr != displayConf->layerConfList.end(); ++itr) {
+ const CicoSCLayerConf* conf = NULL;
+ conf = const_cast<CicoSCLayerConf*>(*itr);
+ if (idx <= 0) {
+ return conf;
+ }
+ idx --;
+ }
+ return NULL;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief
+ *
+ * @param [in]
+ */
+//--------------------------------------------------------------------------
const CicoSCDisplayZoneConf*
CicoSystemConfig::findDisplayZoneConfbyName(const string & displayName,
const string & zoneName)
*/
//--------------------------------------------------------------------------
int
+CicoSystemConfig::getDisplayIdbyNo(int no)
+{
+ vector<CicoSCDisplayConf*>::iterator itr;
+ itr = m_displayConfList.begin();
+ for (; itr != m_displayConfList.end(); ++itr) {
+ const CicoSCDisplayConf* conf = NULL;
+ conf = const_cast<CicoSCDisplayConf*>(*itr);
+ if (no == conf->no) {
+ return conf->id;
+ }
+ }
+ return -1;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief
+ *
+ * @param [in]
+ */
+//--------------------------------------------------------------------------
+void
+CicoSystemConfig::setDisplaySize(int id, int width, int height)
+{
+ vector<CicoSCDisplayConf*>::iterator itr;
+ itr = m_displayConfList.begin();
+ for (; itr != m_displayConfList.end(); ++itr) {
+ CicoSCDisplayConf* conf = NULL;
+ conf = const_cast<CicoSCDisplayConf*>(*itr);
+ if (id == conf->id) {
+ ICO_TRA("CicoSystemConfig::setDisplaySize(%d,%d,%d) change size from %d,%d",
+ id, width, height, conf->width, conf->height);
+ conf->width = width;
+ conf->height = height;
+ return;
+ }
+ }
+ ICO_ERR("CicoSystemConfig::setDisplaySize(%d,%d,%d) Error", id, width, height);
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief
+ *
+ * @param [in]
+ */
+//--------------------------------------------------------------------------
+int
CicoSystemConfig::getLayerIdfbyName(const string & displayName,
const string & layerName)
{
const CicoSCNodeConf* findNodeConfbyName(const string & name);
const CicoSCDisplayConf* findDisplayConfbyName(const string & name);
+ const CicoSCDisplayConf* findDisplayConfbyId(int id);
const CicoSCLayerConf* findLayerConfbyName(const string & displayName,
const string & layerName);
+ const CicoSCLayerConf* findLayerConfbyIdx(int displayid, int idx);
const CicoSCDisplayZoneConf* findDisplayZoneConfbyName(const string & displayName,
const string & zoneName);
const CicoSCSoundConf* findSoundConfbyName(const string & name);
const string & switchName);
int getAppKindIdbyName(const string & name);
int getCategoryIdbyName(const string & name);
+ int getDisplayIdbyNo(int no);
+ void setDisplaySize(int id, int width, int height);
+
const CicoSCResourceConf* getResourceConf() const
{
return m_resourceConf;
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
opt = static_cast<CicoSCCmdInputDevCtrlOpt*>(cmd->opt);
delInputApp(cmd->appid, opt->device, opt->input);
break;
- case MSG_CMD_SEND_INPUT:
- opt = static_cast<CicoSCCmdInputDevCtrlOpt*>(cmd->opt);
- sendInputEvent(cmd->appid, opt->surfaceid, opt->evtype,
- opt->deviceno, opt->evtime, opt->evcode, opt->evvalue);
- break;
case MSG_CMD_SET_REGION:
set_opt = static_cast<CicoSCCmdInputDevSettingOpt*>(cmd->opt);
setInputRegion(cmd->appid, set_opt->winname, set_opt->x, set_opt->y,
//--------------------------------------------------------------------------
/**
- * @brief send input device event
- *
- * @param [in] appid application id
- * @param [in] surfaceid surface id
- * @param [in] type device type
- * @param [in] deviceno input device number
- * @param [in] time event time
- * @param [in] code event code
- * @param [in] value event value
- */
-//--------------------------------------------------------------------------
-int
-CicoSCInputController::sendInputEvent(const string &appid,
- int surfaceid,
- int type,
- int deviceno,
- int time,
- int code,
- int value)
-{
- ICO_TRA("CicoSCInputController::sendInputEvent Enter"
- "(appid=%s surfaceid=0x%08X type=%d dev_no=%d time=%d code=%d value=%d)",
- appid.c_str(), surfaceid, type, deviceno, time, code, value);
-
- CicoSCWlInputMgrIF::sendInputEvent(appid.c_str(), surfaceid,
- type, deviceno, time, code, value);
-
- ICO_TRA("CicoSCInputController::sendInputEvent Leave(EOK)");
- return ICO_SYC_EOK;
-}
-
-//--------------------------------------------------------------------------
-/**
* @brief set input region information
*
* @param [in] appid application id
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
const std::string &device,
int input);
- // send input device event
- int sendInputEvent(const std::string &appid,
- int surfaceid,
- int type,
- int deviceno,
- int time,
- int code,
- int value);
-
// set input region information
int setInputRegion(const std::string &appid,
const std::string &winname,
/*========================================================================*/
/**
- * @file CicoSCLayer.h
+ * @file CicoSCLayer.cpp
*
* @brief This file is implementation of CicoSCLayer class
*/
/*========================================================================*/
+#include <stdlib.h>
+#include <string.h>
#include "CicoSCLayer.h"
#include "CicoLog.h"
//--------------------------------------------------------------------------
CicoSCLayer::CicoSCLayer()
: layerid(-1), type(-1), width(-1), height(-1),
- displayid(-1), menuoverlap(false)
+ displayid(-1), numsurfaces(0), menuoverlap(false)
{
+ surfaceids = (int *)malloc(40 * sizeof(int));
+ if (surfaceids) {
+ maxsurfaces = 50;
+ }
}
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
CicoSCLayer::~CicoSCLayer()
{
+ if (surfaceids) {
+ maxsurfaces = 0;
+ numsurfaces = 0;
+ free(surfaceids);
+ surfaceids = NULL;
+ }
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief addSurface
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCLayer::addSurface(int surfaceid, bool top)
+{
+ int idx, idx2;
+ int *wksurfaceids;
+ ICO_DBG("CicoSCLayer::addSurface(%d,%d)", surfaceid, top);
+
+ idx2 = 0;
+ for (idx = 0; idx < numsurfaces; idx++, idx2++) {
+ if (surfaceids[idx] == surfaceid) {
+ idx2 --;
+ }
+ else {
+ surfaceids[idx2] = surfaceids[idx];
+ }
+ }
+ numsurfaces = idx2;
+
+ if (numsurfaces >= maxsurfaces) {
+ maxsurfaces += 20;
+ wksurfaceids = (int *)malloc(maxsurfaces * sizeof(int));
+ if (! wksurfaceids) {
+ ICO_ERR("CicoSCLayer::addSurface: Out of Memory");
+ return;
+ }
+ if (surfaceids) {
+ memcpy(wksurfaceids, surfaceids, numsurfaces * sizeof(int));
+ free(surfaceids);
+ }
+ surfaceids = wksurfaceids;
+ }
+ if (top) {
+ surfaceids[numsurfaces] = surfaceid;
+ }
+ else {
+ for (idx = numsurfaces; idx > 0; idx--) {
+ surfaceids[idx] = surfaceids[idx-1];
+ }
+ surfaceids[0] = surfaceid;
+ }
+ numsurfaces ++;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief removeSurface
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCLayer::removeSurface(int surfaceid)
+{
+ int idx, idx2;
+ ICO_DBG("CicoSCLayer::removeSurface(%d)", surfaceid);
+
+ idx2 = 0;
+ for (idx = 0; idx < numsurfaces; idx++, idx2++) {
+ if (surfaceids[idx] == surfaceid) {
+ idx2 --;
+ }
+ else {
+ surfaceids[idx2] = surfaceids[idx];
+ }
+ }
+ numsurfaces = idx2;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief getSurfaces
+ */
+//--------------------------------------------------------------------------
+const int *
+CicoSCLayer::getSurfaces(int *retsurfaces)
+{
+ *retsurfaces = numsurfaces;
+ return surfaceids;
}
//--------------------------------------------------------------------------
// destructor
virtual ~CicoSCLayer();
+ // surface
+ void addSurface(int surfaceid, bool top);
+ void removeSurface(int surfaceid);
+ const int *getSurfaces(int *retsurfaces);
+
// dump log this class member variables
void dump(void);
int width; //!< The number of the lateral pixels
int height; //!< The number of vertical pixels
int displayid; //!< display ID
+
+ int *surfaceids; //!< surface ID list
+ int numsurfaces; //!< current number of surfaces
+ int maxsurfaces; //!< max number of surfaces
bool menuoverlap; //!< overlap menu window flag
};
#endif // __CICO_SC_LAYER_H__
ailRenewFlagOff();
initAIL();
initAUL();
+
+ CicoSCLifeCycleController::ms_myInstance = this;
}
/**
CicoSCLifeCycleController::~CicoSCLifeCycleController()
{
delete m_RC;
+ CicoSCLifeCycleController::ms_myInstance = NULL;
}
CicoSCLifeCycleController*
--- /dev/null
+/*
+ * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0. The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+
+//==========================================================================
+/**
+ * @file CicoSCMessageRes.cpp
+ *
+ * @brief This file implementation of CicoSCMessage class
+ */
+//==========================================================================
+
+#include <string>
+#include <limits.h>
+
+#include "CicoSCMessage.h"
+#include "CicoSCMessageRes.h"
+#include "CicoLog.h"
+
+//==========================================================================
+// private static variable
+//==========================================================================
+
+//--------------------------------------------------------------------------
+/**
+ * @brief default constructor
+ */
+//--------------------------------------------------------------------------
+CicoSCMessageRes::CicoSCMessageRes()
+{
+ m_winObj = json_object_new();
+ m_sndObj = json_object_new();
+ m_inpObj = json_object_new();
+ m_winCnt = 0;
+ m_sndCnt = 0;
+ m_inpCnt = 0;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief destructor
+ */
+//--------------------------------------------------------------------------
+CicoSCMessageRes::~CicoSCMessageRes()
+{
+ //ICO_TRA("Enter");
+ json_object_unref(m_winObj);
+ json_object_unref(m_sndObj);
+ json_object_unref(m_inpObj);
+ //ICO_TRA("Leave");
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief add argument object for char pointer type
+ *
+ * @param [in] key key name of object
+ * @param [in] value value of object for char pointer type
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCMessageRes::addWinObject(const char * key, const char * value)
+{
+ json_object_set_string_member(m_winObj, key, value);
+ m_winCnt++;
+}
+
+void
+CicoSCMessageRes::addSndObject(const char * key, const char * value)
+{
+ json_object_set_string_member(m_sndObj, key, value);
+ m_sndCnt++;
+}
+
+void
+CicoSCMessageRes::addInpObject(const char * key, const char * value)
+{
+ json_object_set_string_member(m_inpObj, key, value);
+ m_inpCnt++;
+}
+
+void
+CicoSCMessageRes::addWinObject(const char * key, const std::string & value)
+{
+ json_object_set_string_member(m_winObj, key, value.c_str());
+ m_winCnt++;
+}
+
+void
+CicoSCMessageRes::addSndObject(const char * key, const std::string & value)
+{
+ json_object_set_string_member(m_sndObj, key, value.c_str());
+ m_sndCnt++;
+}
+
+void
+CicoSCMessageRes::addInpObject(const char * key, const std::string & value)
+{
+ json_object_set_string_member(m_inpObj, key, value.c_str());
+ m_inpCnt++;
+}
+
+void
+CicoSCMessageRes::addWinObject(const char * key, int value)
+{
+ json_object_set_int_member(m_winObj, key, value);
+ m_winCnt++;
+}
+
+void
+CicoSCMessageRes::addSndObject(const char * key, int value)
+{
+ json_object_set_int_member(m_sndObj, key, value);
+ m_sndCnt++;
+}
+
+void
+CicoSCMessageRes::addInpObject(const char * key, int value)
+{
+ json_object_set_int_member(m_inpObj, key, value);
+ m_inpCnt++;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief get message data
+ *
+ * @return pointer of message data
+ */
+//--------------------------------------------------------------------------
+const char*
+CicoSCMessageRes::getData(void)
+{
+ // count up reference
+ json_object_ref(m_rootObj);
+ json_object_ref(m_argObj);
+ json_object_ref(m_winObj);
+ json_object_ref(m_sndObj);
+ json_object_ref(m_inpObj);
+
+ if (0 != m_winCnt) {
+ json_object_set_object_member(m_argObj, "window", m_winObj);
+ }
+ if (0 != m_sndCnt) {
+ json_object_set_object_member(m_argObj, "sound", m_sndObj);
+ }
+ if (0 != m_inpCnt) {
+ json_object_set_object_member(m_argObj, "input", m_inpObj);
+ }
+
+ json_object_set_object_member(m_rootObj, "res", m_argObj);
+ json_node_take_object(m_root, m_rootObj);
+ json_generator_set_root(m_generator, m_root);
+ gsize len = 0;
+ gchar* data = json_generator_to_data(m_generator, &len);
+ m_data = data;
+ g_free(data);
+ return m_data.c_str();
+}
+
--- /dev/null
+/*
+ * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0. The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+
+//==========================================================================
+/**
+ * @file CicoSCMessageRes.h
+ *
+ * @brief This file is definition of CicoSCMessage class
+ */
+//==========================================================================
+#ifndef __CICO_SC_MESSAGE_RES_H__
+#define __CICO_SC_MESSAGE_RES_H__
+
+#include <string>
+
+#include <json-glib/json-glib.h>
+#include "CicoSCMessage.h"
+
+//==========================================================================
+// forward declaration
+//==========================================================================
+
+//==========================================================================
+/**
+ * @brief This class hold communication message
+ */
+//==========================================================================
+class CicoSCMessageRes :public CicoSCMessage
+{
+public:
+ // default constructor
+ CicoSCMessageRes();
+
+ // destructor
+ ~CicoSCMessageRes();
+
+ // add argument object for char pointer type
+ void addWinObject(const char * key, const char * value);
+
+ // add argument object for string type
+ void addWinObject(const char * key, const std::string & value);
+
+ // add argument object for integer type
+ void addWinObject(const char * key, int value);
+
+ // add argument object for char pointer type
+ void addSndObject(const char * key, const char * value);
+
+ // add argument object for string type
+ void addSndObject(const char * key, const std::string & value);
+
+ // add argument object for integer type
+ void addSndObject(const char * key, int value);
+
+ // add argument object for char pointer type
+ void addInpObject(const char * key, const char * value);
+
+ // add argument object for string type
+ void addInpObject(const char * key, const std::string & value);
+
+ // add argument object for integer type
+ void addInpObject(const char * key, int value);
+
+ // get message data
+ virtual const char* getData(void);
+
+private:
+
+private:
+ JsonObject *m_winObj; //!< json window objects
+ JsonObject *m_sndObj; //!< json sound objects
+ JsonObject *m_inpObj; //!< json input objects
+ int m_winCnt;
+ int m_sndCnt;
+ int m_inpCnt;
+};
+#endif // __CICO_SC_MESSAGE_RES_H__
+// vim:set expandtab ts=4 sw=4:
m_inputCtrl(NULL) , m_userMgr(NULL), m_resourceMgr(NULL),
m_policyMgr(NULL), m_dispatchProcessing(false)
{
+ CicoSCServer::ms_myInstance = this;
}
//--------------------------------------------------------------------------
if (NULL != m_uwsContext) {
ico_uws_close(m_uwsContext);
}
+ CicoSCServer::ms_myInstance = NULL;
}
//--------------------------------------------------------------------------
chkAndAddSlash(m_flagPath);
m_flagPath += ICO_SYC_CHGUSR_FLAG_FIL;
ICO_TRA("end");
+
+ CicoSCUserManager::ms_myInstance = this;
}
//--------------------------------------------------------------------------
m_userList.clear();
m_vppa.clear();
+ CicoSCUserManager::ms_myInstance = NULL;
+
ICO_TRA("CicoSCUserManager::~CicoSCUserManager Leave");
}
ms_dbusTypes[ICO_TYPE_STRING] = DBUS_TYPE_STRING;
ms_ecoreEvType = ecore_event_type_new();
+
+ CicoSCVInfoManager::ms_myInstance = this;
}
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
CicoSCVInfoManager::~CicoSCVInfoManager()
{
+ CicoSCVInfoManager::ms_myInstance = NULL;
}
//--------------------------------------------------------------------------
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
#include <wayland-client.h>
#include <ico_window_mgr-client-protocol.h>
+#include <ilm_control.h>
#include "CicoSCWayland.h"
#include "CicoSCWlWinMgrIF.h"
+#include "CicoSCWindowController.h"
#include "CicoLog.h"
#include "ico_syc_error.h"
// wayland callbacks
m_wlListener.global = wlGlobalCB;
m_wlListener.global_remove = NULL;
+
+ CicoSCWayland::ms_myInstance = this;
}
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
CicoSCWayland::~CicoSCWayland()
{
+ CicoSCWayland::ms_myInstance = NULL;
}
//--------------------------------------------------------------------------
CicoSCWayland::initialize(void)
{
ICO_TRA("CicoSCWayland::initialize Enter");
+
for (int i = 0; i < (5000/50); ++i) {
m_wlDisplay = wl_display_connect(NULL);
if (NULL != m_wlDisplay) {
ICO_DBG("called: wl_display_flush(wlDisplay=0x%08x)", (int)m_wlDisplay);
wl_display_flush(m_wlDisplay);
+ // initialize genivi ivi-shell
+ if (ilm_init() != ILM_SUCCESS) {
+ ICO_ERR("ilm_init failed.");
+ ICO_TRA("CicoSCWayland::initialize Leave(EIO)");
+ return ICO_SYC_EIO;
+ }
+
ICO_DBG("called: wl_display_get_fd(wlDisplay=0x%08x)", (int)m_wlDisplay);
m_wlFd = wl_display_get_fd(m_wlDisplay);
ICO_DBG("CicoSCWayland::initialize: Wayland/Weston fd=%d", m_wlFd);
ICO_DBG("CicoSCWayland::initialize: Wayland/Weston connect OK");
+ // initialize genivi callbacks
+ CicoSCWindowController::initializeGeniviNotifications();
+
ICO_TRA("CicoSCWayland::initialize: Leave(EOK)");
return ICO_SYC_EOK;
}
if (-1 == wlret) {
int error = wl_display_get_error(m_wlDisplay);
ICO_ERR("wl_display_dispatch failed. error(%d)", error);
+
+ if (error == EINVAL) {
+ exit(9);
+ }
}
}
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
const char * CicoSCWaylandIF::ICO_WL_INPUT_MGR_CTRL_IF = "ico_input_mgr_control";
const char * CicoSCWaylandIF::ICO_WL_EXINPUT_IF = "ico_exinput";
const char * CicoSCWaylandIF::ICO_WL_INPUT_MGR_DEV_IF = "ico_input_mgr_device";
+const char * CicoSCWaylandIF::ICO_WL_IVI_APPLICATION_IF= "ivi_application";
+const char * CicoSCWaylandIF::ICO_WL_IVI_CONTROLLER_IF = "ivi_controller";
const char * CicoSCWaylandIF::ICO_WL_OUTPUT_IF = "wl_output";
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
static const char * ICO_WL_WIN_MGR_IF;
/// interface name of wayland input manager control
static const char * ICO_WL_INPUT_MGR_CTRL_IF;
- /// interface name of wayland exinput
+ /// interface name of wayland exinput
static const char * ICO_WL_EXINPUT_IF;
/// interface name of wayland input manager device
static const char * ICO_WL_INPUT_MGR_DEV_IF;
+ /// interface name of genivi ivi_application
+ static const char * ICO_WL_IVI_APPLICATION_IF;
+ /// interface name of genivi ivi_controller
+ static const char * ICO_WL_IVI_CONTROLLER_IF;
/// interface name of wayland output
static const char * ICO_WL_OUTPUT_IF;
using namespace std;
#include "CicoSCWindow.h"
+#include "CicoSCWlWinMgrIF.h"
#include "CicoLog.h"
//--------------------------------------------------------------------------
*/
//--------------------------------------------------------------------------
CicoSCWindow::CicoSCWindow()
- : surfaceid(-1), name(""), appid(""), pid(-1), layertype(-1),
+ : surfaceid(-1), name(""), appid(""), pid(-1),
nodeid(-1), displayid(-1), layerid(-1), zone(""), zoneid(-1),
subwindow(0), eventmask(0), x(-1), y(-1), width(-1), height(-1),
visible(false), raise(false), active(false)
//--------------------------------------------------------------------------
CicoSCWindow::~CicoSCWindow()
{
-// ICO_TRA("CicoSCWindow::~CicoSCWindow Enter");
-// ICO_TRA("CicoSCWindow::~CicoSCWindow Leave");
+ ICO_TRA("CicoSCWindow::~CicoSCWindow Enter");
+ CicoSCWlWinMgrIF::wlIviCtrlRemoveSurface(surfaceid);
+ ICO_TRA("CicoSCWindow::~CicoSCWindow Leave");
}
//--------------------------------------------------------------------------
ICO_DBG("CicoSCWindow: surfaceid=0x%08X name=%s appid=%s pid=%d "
"nodeid=%d displayid=%d layerid=%d zone=%s zoneid=%d "
"subwindow=%d eventmask=%d x=%d y=%d width=%d height=%d "
- "visible=%s raise=%s active=%s layertype=%x",
+ "visible=%s raise=%s active=%s",
surfaceid, name.c_str(), appid.c_str(), pid, nodeid, displayid,
layerid, zone.c_str(), zoneid, subwindow, eventmask,
x, y, width, height,
visible ? "true" : "false", raise ? "true" : "false",
- active ? "true" : "false", layertype);
+ active ? "true" : "false");
}
// vim:set expandtab ts=4 sw=4:
std::string name; ///< window name
std::string appid; ///< application id
int pid; ///< process id
- int layertype; ///< layer type
int nodeid; ///< node id
int displayid; ///< display id
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
#include "CicoSCLifeCycleController.h"
#include "CicoSCResourceManager.h"
+//==========================================================================
+// private static variable
+//==========================================================================
+CicoSCWindowController* CicoSCWindowController::ms_myInstance = NULL;
+
+//--------------------------------------------------------------------------
+/**
+ * @brief get instance of CicoSCWindowController
+ *
+ * @return instance of CicoSCWayland
+ */
+//--------------------------------------------------------------------------
+CicoSCWindowController*
+CicoSCWindowController::getInstance(void)
+{
+ if (NULL == ms_myInstance) {
+ ms_myInstance = new CicoSCWindowController();
+ }
+ return ms_myInstance;
+}
+
//--------------------------------------------------------------------------
/**
* @brief default constructor
{
CicoSCWayland* wayland = CicoSCWayland::getInstance();
wayland->getInstance()->addWaylandIF(ICO_WL_WIN_MGR_IF, this);
+ wayland->getInstance()->addWaylandIF(ICO_WL_IVI_APPLICATION_IF, this);
+ wayland->getInstance()->addWaylandIF(ICO_WL_IVI_CONTROLLER_IF, this);
wayland->getInstance()->addWaylandIF(ICO_WL_OUTPUT_IF, this);
initDB();
+
+ CicoSCWindowController::ms_myInstance = this;
}
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
CicoSCWindowController::~CicoSCWindowController()
{
+ CicoSCWindowController::ms_myInstance = NULL;
}
//--------------------------------------------------------------------------
}
// set animation request to Multi Window Manager
- int animaFlag = ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE;
- int raiseFlag = ICO_WINDOW_MGR_V_NOCHANGE;
+ int animaFlag = ICO_SYC_ANIMATION_OFF;
+ int raiseFlag = ICO_SYC_WIN_RAISE_NOCHANGE;
if (animationTime & ICO_SYC_WIN_SURF_RAISE) {
- raiseFlag = ICO_WINDOW_MGR_RAISE_RAISE;
+ raiseFlag = ICO_SYC_WIN_RAISE_RAISE;
window->raise = true;
}
else if (animationTime & ICO_SYC_WIN_SURF_LOWER) {
- raiseFlag = ICO_WINDOW_MGR_RAISE_LOWER;
+ raiseFlag = ICO_SYC_WIN_RAISE_LOWER;
window->raise = false;
}
else if (((animationTime & ICO_SYC_WIN_SURF_NOCHANGE) == 0) &&
(false == window->raise)) {
- raiseFlag = ICO_WINDOW_MGR_RAISE_RAISE;
+ raiseFlag = ICO_SYC_WIN_RAISE_RAISE;
window->raise = true;
}
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW,
animation, animationTime & ~ICO_SYC_WIN_SURF_FLAGS);
- animaFlag = ICO_WINDOW_MGR_FLAGS_ANIMATION;
+ animaFlag = ICO_SYC_ANIMATION_ON;
}
// set visible request to Multi Window Manager
CicoSCWlWinMgrIF::setVisible(window->surfaceid,
- ICO_WINDOW_MGR_VISIBLE_SHOW,
+ ICO_SYC_WIN_VISIBLE_SHOW,
raiseFlag, animaFlag);
// flush display
}
// set animation request to Multi Window Manager
- int animaFlag = ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE;
+ int animaFlag = ICO_SYC_ANIMATION_OFF;
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
ICO_WINDOW_MGR_ANIMATION_TYPE_HIDE,
animation, animationTime & ~ICO_SYC_WIN_SURF_FLAGS);
- animaFlag = ICO_WINDOW_MGR_FLAGS_ANIMATION;
+ animaFlag = ICO_SYC_ANIMATION_ON;
}
// set visible request to Multi Window Manager
CicoSCWlWinMgrIF::setVisible(window->surfaceid,
- ICO_WINDOW_MGR_VISIBLE_HIDE,
- ICO_WINDOW_MGR_V_NOCHANGE, animaFlag);
+ ICO_SYC_LAYER_VISIBLE_HIDE,
+ ICO_SYC_WIN_RAISE_NOCHANGE, animaFlag);
// flush display
CicoSCWayland::getInstance()->flushDisplay();
}
// set animation request to Multi Window Manager
- int animaFlag = ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE;
+ int animaFlag = ICO_SYC_ANIMATION_OFF;
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
ICO_WINDOW_MGR_ANIMATION_TYPE_RESIZE,
animation, animationTime);
- animaFlag = ICO_WINDOW_MGR_FLAGS_ANIMATION;
+ animaFlag = ICO_SYC_ANIMATION_ON;
}
// set visible request to Multi Window Manager
+ window->width = w;
+ window->height = h;
CicoSCWlWinMgrIF::setPositionsize(window->surfaceid, window->nodeid,
- ICO_WINDOW_MGR_V_NOCHANGE,
- ICO_WINDOW_MGR_V_NOCHANGE,
+ window->x, window->y,
w, h, animaFlag);
// flush display
//--------------------------------------------------------------------------
/**
- * @brief move window(surface) size
+ * @brief move window(surface) position
*
* @param [in] surfaceid wayland surface id
* @param [in] nodeid node id
}
// set animation request to Multi Window Manager
- int animaFlag = ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE;
+ int animaFlag = ICO_SYC_ANIMATION_OFF;
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
ICO_WINDOW_MGR_ANIMATION_TYPE_MOVE,
animation, animationTime);
- animaFlag = ICO_WINDOW_MGR_FLAGS_ANIMATION;
+ animaFlag = ICO_SYC_ANIMATION_ON;
}
- int moveNodeId = ICO_WINDOW_MGR_V_NOCHANGE;
+ int moveNodeId = ICO_SYC_WIN_NOCHANGE;
if (nodeid >= 0) {
moveNodeId = nodeid;
}
// set visible request to Multi Window Manager
+ window->x = x;
+ window->y = y;
CicoSCWlWinMgrIF::setPositionsize(window->surfaceid,
moveNodeId, x, y,
- ICO_WINDOW_MGR_V_NOCHANGE,
- ICO_WINDOW_MGR_V_NOCHANGE,
+ window->width, window->height,
animaFlag);
// flush display
window->raise = true;
// set animation request to Multi Window Manager
- int animaFlag = ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE;
+ int animaFlag = ICO_SYC_ANIMATION_OFF;
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWindowController::setAnimation(window->surfaceid,
ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW,
animation, animationTime);
- animaFlag = ICO_WINDOW_MGR_FLAGS_ANIMATION;
+ animaFlag = ICO_SYC_ANIMATION_ON;
}
// set visible request to Multi Window Manager
CicoSCWlWinMgrIF::setVisible(window->surfaceid,
- ICO_WINDOW_MGR_V_NOCHANGE,
- ICO_WINDOW_MGR_RAISE_RAISE, animaFlag);
+ ICO_SYC_WIN_VISIBLE_NOCHANGE,
+ ICO_SYC_WIN_RAISE_RAISE, animaFlag);
// flush display
CicoSCWayland::getInstance()->flushDisplay();
ICO_WINDOW_MGR_ANIMATION_TYPE_MOVE,
animation, moveAnimationTime);
- int moveNodeId = ICO_WINDOW_MGR_V_NOCHANGE;
+ int moveNodeId = ICO_SYC_WIN_NOCHANGE;
if (nodeid >= 0) {
moveNodeId = nodeid;
}
return ICO_SYC_EINVAL;
}
- int moveX = ICO_WINDOW_MGR_V_NOCHANGE;
+ int moveX = window->x;
if (0 <= x) {
moveX = x;
+ window->x = x;
}
- int moveY = ICO_WINDOW_MGR_V_NOCHANGE;
+ int moveY = window->y;
if (0 <= y) {
moveY = y;
+ window->y = y;
}
- int moveW = ICO_WINDOW_MGR_V_NOCHANGE;
+ int moveW = window->width;
if (0 <= w) {
moveW = w;
+ window->width = w;
}
- int moveH = ICO_WINDOW_MGR_V_NOCHANGE;
+ int moveH = window->height;
if (0 <= h) {
moveH = h;
+ window->height = h;
}
// set window layer to Multi Window Manager
// set visible request to Multi Window Manager
CicoSCWlWinMgrIF::setPositionsize(window->surfaceid, moveNodeId,
moveX, moveY, moveW, moveH,
- ICO_WINDOW_MGR_FLAGS_ANIMATION);
+ ICO_SYC_ANIMATION_ON);
// flush display
CicoSCWayland::getInstance()->flushDisplay();
window->raise = false;
// set animation request to Multi Window Manager
- int animaFlag = ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE;
+ int animaFlag = ICO_SYC_ANIMATION_OFF;
if ((NULL != animation) && (animation[0] != '\0')) {
CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
ICO_WINDOW_MGR_ANIMATION_TYPE_HIDE,
animation, animationTime);
- animaFlag = ICO_WINDOW_MGR_FLAGS_ANIMATION;
+ animaFlag = ICO_SYC_ANIMATION_ON;
}
// set visible request to Multi Window Manager
- CicoSCWlWinMgrIF::setVisible(window->surfaceid, ICO_WINDOW_MGR_V_NOCHANGE,
- ICO_WINDOW_MGR_RAISE_LOWER, animaFlag);
+ CicoSCWlWinMgrIF::setVisible(window->surfaceid, ICO_SYC_WIN_VISIBLE_NOCHANGE,
+ ICO_SYC_WIN_RAISE_LOWER, animaFlag);
// flush display
CicoSCWayland::getInstance()->flushDisplay();
int
CicoSCWindowController::setWindowLayer(int surfaceid, int layerid)
{
+ uint32_t oldlayerid;
+
ICO_TRA("CicoSCWindowController::setWindowLayer Enter"
"(surfaceid=0x%08X layerid=%x)", surfaceid, layerid);
// find window information in window list
- CicoSCWindow *window = findWindow(surfaceid);
+ CicoSCWindow* window = findWindow(surfaceid);
if (NULL == window) {
ICO_WRN("not found window information");
ICO_TRA("CicoSCWindowController::setWindowLayer Leave(ENOENT)");
// find layer information in layer list
CicoSCLayer* layer = findLayer(window->displayid, layerid);
if (NULL == layer) {
- // check special layer
- if ((layerid != ICO_WINDOW_MGR_LAYERTYPE_TOUCH) &&
- (layerid != ICO_WINDOW_MGR_LAYERTYPE_CURSOR)) {
- ICO_TRA("CicoSCWindowController::setWindowLayer Leave(ENOENT[disp=%d,layer=%d])",
- window->displayid, layerid);
- return ICO_SYC_ENOENT;
- }
+ ICO_TRA("CicoSCWindowController::setWindowLayer Leave(ENOENT[disp=%d,layer=%d])",
+ window->displayid, layerid);
+ return ICO_SYC_ENOENT;
}
// update window attr
+ oldlayerid = window->layerid;
window->layerid = layerid;
// set window layer request to Multi Window Manager
- CicoSCWlWinMgrIF::setWindowLayer(window->surfaceid, window->layerid);
-
+ CicoSCWlWinMgrIF::setWindowLayer(window->surfaceid,
+ (uint32_t)window->layerid, oldlayerid);
// flush display
CicoSCWayland::getInstance()->flushDisplay();
return ICO_SYC_ENOENT;
}
- CicoSCWlWinMgrIF::setLayerVisible(layerid, ICO_WINDOW_MGR_VISIBLE_SHOW);
+ CicoSCWlWinMgrIF::setLayerVisible(layerid, ICO_SYC_LAYER_VISIBLE_SHOW);
// flush display
CicoSCWayland::getInstance()->flushDisplay();
return ICO_SYC_ENOENT;
}
- CicoSCWlWinMgrIF::setLayerVisible(layerid, ICO_WINDOW_MGR_VISIBLE_HIDE);
+ CicoSCWlWinMgrIF::setLayerVisible(layerid, ICO_SYC_LAYER_VISIBLE_HIDE);
// flush display
CicoSCWayland::getInstance()->flushDisplay();
}
if (target < 0) {
- target = ICO_WINDOW_MGR_ACTIVE_POINTER |
- ICO_WINDOW_MGR_ACTIVE_KEYBOARD;
+ target = 0xffff;
}
// set active request to Multi Window Manager
//--------------------------------------------------------------------------
/**
- * @brief set surface map buffer
+ * @brief set surface map get
*
- * @param [in] shmname shared memory name (POSIX I/F)
- * @param [in] bufsize shared memory buffer size
- * @param [in] bufnum number of shared memory buffer
+ * @param [in] surfaceid wayland surface id
+ * @param [in] filepath surface image pixel file path
*
* @return ICO_SYC_EOK on success, other on error(currently EOK only)
* @retval ICO_SYC_EOK success
*/
//--------------------------------------------------------------------------
int
-CicoSCWindowController::setmapBuffer(const char *shmname, int bufsize, int bufnum)
+CicoSCWindowController::setmapGet(int surfaceid, const char *filepath)
{
- ICO_TRA("CicoSCWindowController::setmapBuffer Enter");
+ ICO_TRA("CicoSCWindowController::setmapGet Enter");
- CicoSCWlWinMgrIF::setmapBuffer(shmname, bufsize, bufnum);
+ CicoSCWlWinMgrIF::setmapGet(surfaceid, filepath);
CicoSCWayland::getInstance()->flushDisplay();
- ICO_TRA("CicoSCWindowController::setmapBuffer Leave(EOK)");
+ ICO_TRA("CicoSCWindowController::setmapGet Leave(EOK)");
return ICO_SYC_EOK;
}
*
* @param [in] surfaceid wayland surface id
* @param [in] framerate surface change frame rate(frames par sec)
+ * @param [in] filepath surface image pixel file path
*
* @return ICO_SYC_EOK on success, other on error
* @retval ICO_SYC_EOK success
*/
//--------------------------------------------------------------------------
int
-CicoSCWindowController::mapSurface(int surfaceid, int framerate)
+CicoSCWindowController::mapSurface(int surfaceid, int framerate, const char *filepath)
{
- ICO_TRA("CicoSCWindowController::mapSurface Enter");
+ ICO_TRA("CicoSCWindowController::mapSurface Enter(0x%08x,%d,%s)",
+ surfaceid, framerate, filepath ? filepath : "(null)");
// find window information in window list
CicoSCWindow *window = findWindow(surfaceid);
framerate = 0;
}
- CicoSCWlWinMgrIF::mapSurface(surfaceid, framerate);
+ CicoSCWlWinMgrIF::mapSurface(surfaceid, framerate, filepath);
CicoSCWayland::getInstance()->flushDisplay();
ICO_TRA("CicoSCWindowController::mapSurface Leave(EOK)");
int
CicoSCWindowController::unmapSurface(int surfaceid)
{
- ICO_TRA("CicoSCWindowController::unmapSurface Enter");
+ ICO_TRA("CicoSCWindowController::unmapSurface Enter(0x%08x)", surfaceid);
// find window information in window list
CicoSCWindow *window = findWindow(surfaceid);
uint32_t attributes = 0;
if (true == zone->aspectFixed) {
- attributes |= ICO_WINDOW_MGR_ATTR_FIXED_ASPECT;
+ attributes |= ICO_SYC_WIN_ASPECT_FIXED;
if (true == zone->aspectAlignLeft) {
- attributes |= ICO_WINDOW_MGR_ATTR_ALIGN_LEFT;
+ attributes |= ICO_SYC_WIN_ASPECT_ALIGN_LEFT;
}
if (true == zone->aspectAlignRight) {
- attributes |= ICO_WINDOW_MGR_ATTR_ALIGN_RIGHT;
+ attributes |= ICO_SYC_WIN_ASPECT_ALIGN_RIGHT;
}
if (true == zone->aspectAlignTop) {
- attributes |= ICO_WINDOW_MGR_ATTR_ALIGN_TOP;
+ attributes |= ICO_SYC_WIN_ASPECT_ALIGN_TOP;
}
if (true == zone->aspectAlignBottom) {
- attributes |= ICO_WINDOW_MGR_ATTR_ALIGN_BOTTOM;
+ attributes |= ICO_SYC_WIN_ASPECT_ALIGN_BOTTOM;
}
}
-
- CicoSCWlWinMgrIF::setAttributes(surfaceid, attributes);
- CicoSCWayland::getInstance()->flushDisplay();
-
ICO_TRA("CicoSCWindowController::setAttributes Leave(EOK)");
return ICO_SYC_EOK;
}
//--------------------------------------------------------------------------
/**
- * @brief wayland surface create callback
- *
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] surfaceid ico_window_mgr surface Id
- * @param [in] winname surface window name(title)
- * @param [in] pid wayland client process Id
- * @param [in] appid wayland client application Id
- * @param [in] layertype surface layer type
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWindowController::createdCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- const char *winname,
- int32_t pid,
- const char *appid,
- int32_t layertype)
-{
- ICO_TRA("CicoSCWindowController::createdCB Enter"
- "(surfaceid=0x%08X winname=%s pid=%d appid=%s layer=%x)",
- surfaceid, winname, pid, appid, layertype);
-
- if (layertype == ICO_WINDOW_MGR_LAYERTYPE_INPUTPANEL) {
- // So far, SystemController ignores this event
- // because it does not support InputPanel(Software Keyboard).
- ICO_WRN("Input Panel layer create window information skip.");
- ICO_TRA("CicoSCWindowController::createdCB Leave(Input Panel)");
- return;
- }
-
- CicoSCWindow* window = new CicoSCWindow();
-
- window->surfaceid = surfaceid;
- window->name = winname;
- window->appid = appid;
- window->layertype = layertype;
- window->pid = pid;
- window->displayid = ICO_SURFACEID_2_NODEID(surfaceid);
-
- CicoSCLifeCycleController* appctrl;
- appctrl = CicoSCLifeCycleController::getInstance();
- const CicoAilItems *ailItem = appctrl->findAIL(appid);
- if (NULL == ailItem) {
- const CicoAulItems* aulitem = appctrl->findAUL(pid);
- if (NULL != aulitem) {
- window->appid = aulitem->m_appid;
- ICO_DBG("appid=%s", window->appid.c_str());
- ailItem = appctrl->findAIL(window->appid.c_str());
- }
- else {
- ICO_DBG("application information not found.");
- }
- }
-
- if (NULL != ailItem) {
- window->layerid = ailItem->m_layer;
- window->zoneid = ailItem->m_displayZone;
- window->nodeid = ailItem->m_nodeID;
- if ((window->displayid >= 0) && (window->zoneid >= 0)) {
-
- const CicoSCDisplayZone* zone = findDisplayZone(window->zoneid);
- if (NULL != zone) {
- window->zone = zone->fullname;
- window->x = zone->x;
- window->y = zone->y;
- window->width = zone->width;
- window->height = zone->height;
- }
- }
- }
- else{
- delete window;
- ICO_WRN("ail item not found.");
- ICO_TRA("CicoSCWindowController::createdCB Leave(ENOENT)");
- return;
- }
-
- appctrl->enterAUL(appid, pid, window);
-
- // dump log window information
- window->dump();
-
- m_windowList[surfaceid] = window;
-
- // set surface attributes
- setAttributes(surfaceid);
-
- // send message
- CicoSCMessage *message = new CicoSCMessage();
- message->addRootObject("command", MSG_CMD_CREATE);
- message->addRootObject("appid", window->appid);
- message->addRootObject("pid", window->pid);
- message->addArgObject("surface", window->surfaceid);
- message->addArgObject("winname", window->name);
- CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
-
- if (NULL != m_resMgr) {
- CicoSCCommand cmd;
- CicoSCCmdResCtrlOpt *opt = new CicoSCCmdResCtrlOpt();
-
- cmd.cmdid = MSG_CMD_CREATE_RES;
- cmd.appid = window->appid;
- cmd.pid = window->pid;
- cmd.opt = opt;
-
- opt->dispres = true;
- opt->winname = window->name;
- opt->surfaceid = window->surfaceid;
-
- string fullname;
- const CicoSCDisplayZone* zone = findDisplayZone(window->zoneid);
- if (NULL != zone) {
- opt->dispzone = zone->fullname;
- }
-
-#if 1 //TODO
- opt->soundres = true;
- opt->soundname = window->appid;
- opt->soundid = 0;
- CicoSystemConfig *sysconf = CicoSystemConfig::getInstance();
- const CicoSCDefaultConf *defconf = sysconf->getDefaultConf();
- if (NULL != defconf) {
- const CicoSCSoundZoneConf *zoneconf =
- sysconf->findSoundZoneConfbyId(defconf->soundzone);
- if (NULL != zoneconf) {
- opt->soundzone = zoneconf->fullname;
- }
- }
-#endif
-
- m_resMgr->handleCommand((const CicoSCCommand&)cmd, true);
- }
- else {
- show(window->surfaceid, NULL, 0);
- }
-
- ICO_TRA("CicoSCWindowController::createdCB Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief wayland change surface name callback
- *
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] surfaceid ico_window_mgr surface Id
- * @param [in] winname surface window name(title)
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWindowController::nameCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- const char *winname)
-{
- ICO_TRA("CicoSCWindowController::nameCB Enter"
- "(surfaceid=0x%08X winname=%s)", surfaceid, winname);
-
- CicoSCWindow *window = findWindow(surfaceid);
- if (NULL == window) {
- ICO_WRN("not found window information");
- ICO_TRA("CicoSCWindowController::nameCB Leave");
- return;
- }
-
- ICO_DBG("nameCB: Update window name %s=>%s",
- window->name.c_str(), winname);
- window->name = winname;
-
- // send message
- CicoSCMessage *message = new CicoSCMessage();
- message->addRootObject("command", MSG_CMD_NAME);
- message->addRootObject("appid", window->appid);
- message->addRootObject("pid", window->pid);
- message->addArgObject("surface", window->surfaceid);
- message->addArgObject("winname", window->name);
- CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
-
- ICO_TRA("CicoSCWindowController::nameCB Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief wayland surface destroy callback
- *
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] surfaceid ico_window_mgr surface Id
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWindowController::destroyedCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid)
-{
- ICO_TRA("CicoSCWindowController::destroyedCB Enter"
- "(surfaceid=0x%08X)", surfaceid);
-
- CicoSCWindow *window = findWindow(surfaceid);
- if (NULL == window) {
- ICO_WRN("not found window information");
- ICO_TRA("CicoSCWindowController::destroyedCB Leave");
- return;
- }
-
- // send message
- CicoSCMessage *message = new CicoSCMessage();
- message->addRootObject("command", MSG_CMD_DESTROY);
- message->addRootObject("appid", window->appid);
- message->addRootObject("pid", window->pid);
- message->addArgObject("surface", window->surfaceid);
- message->addArgObject("winname", window->name);
- CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
-
- // TODO delete window in application
-
- if (NULL != m_resMgr) {
- CicoSCCommand cmd;
- CicoSCCmdResCtrlOpt *opt = new CicoSCCmdResCtrlOpt();
-
- cmd.cmdid = MSG_CMD_DESTORY_RES;
- cmd.appid = window->appid;
- cmd.pid = window->pid;
- cmd.opt = opt;
-
- opt->dispres = true;
- opt->winname = window->name;
- opt->surfaceid = window->surfaceid;
-
- string fullname;
- const CicoSCDisplayZone* zone = findDisplayZone(window->zoneid);
- if (NULL != zone) {
- opt->dispzone = zone->fullname;
- }
-
- opt->soundres = true;
- opt->soundname = window->appid;
- opt->soundid = 0;
- CicoSystemConfig *sysconf = CicoSystemConfig::getInstance();
- const CicoSCDefaultConf *defconf = sysconf->getDefaultConf();
- if (NULL != defconf) {
- const CicoSCSoundZoneConf *zoneconf =
- sysconf->findSoundZoneConfbyId(defconf->soundzone);
- if (NULL != zoneconf) {
- opt->soundzone = zoneconf->fullname;
- }
- }
-
- m_resMgr->handleCommand((const CicoSCCommand&)cmd, true);
- }
-
- // delete window in list
- m_windowList.erase(window->surfaceid);
- delete(window);
-
- ICO_TRA("CicoSCWindowController::destroyedCB Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief wayland surface visible callback
- *
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] surfaceid ico_window_mgr surface Id
- * @param [in] visible surface visible
- * (1=visible/0=invisible/other=no-change)
- * @param [in] raise surface raise
- * (1=raise/0=lower/other=no change)
- * @param [in] hint client request
- * (1=client request(not changed)/0=changed)
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWindowController::visibleCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- int32_t visible,
- int32_t raise,
- int32_t hint)
-{
- ICO_TRA("CicoSCWindowController::visibleCB Enter"
- "(surfaceid=0x%08X visible=%d raise=%d hint=%d)",
- surfaceid, visible, raise, hint);
-
- CicoSCWindow *window = findWindow(surfaceid);
- if (NULL == window) {
- ICO_WRN("not found window information");
- ICO_TRA("CicoSCWindowController::visibleCB Leave");
- return;
- }
-
- int newVisible = visible;
- int newRaise = raise;
-
- if (visible == ICO_WINDOW_MGR_V_NOCHANGE) {
- newVisible = window->visible;
- }
-
- if (raise == ICO_WINDOW_MGR_V_NOCHANGE) {
- newVisible = window->raise;
- }
-
- if ((window->visible == newVisible) && (window->raise == newRaise) ){
- ICO_TRA("CicoSCWindowController::visibleCB Leave");
- return;
- }
-
- // update attr
- window->visible = newVisible;
- window->raise = newRaise;
-
- // notify homescreen
- CicoSCMessage *message = new CicoSCMessage();
- message->addRootObject("command", MSG_CMD_CHANGE_ATTR);
- message->addRootObject("appid", window->appid);
- const CicoSCDisplayZone* zone = findDisplayZone(window->zoneid);
- if (NULL != zone) {
- message->addArgObject("zone", zone->fullname);
- }
- else {
- message->addArgObject("zone", "");
- }
- message->addArgObject("surface", window->surfaceid);
- message->addArgObject("winname", window->name);
- message->addArgObject("node", window->nodeid);
- message->addArgObject("layer", window->layerid);
- message->addArgObject("pos_x", window->x);
- message->addArgObject("pos_y", window->y);
- message->addArgObject("width", window->width);
- message->addArgObject("height", window->height);
- message->addArgObject("raise", window->raise ? 1 : 0);
- message->addArgObject("visible", window->visible ? 1 : 0);
- message->addArgObject("active", window->active ? 1 : 0);
- CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
-
- ICO_TRA("CicoSCWindowController::visibleCB Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief wayland surface configure callback
- *
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] surfaceid ico_window_mgr surface Id
- * @param [in] node surface node Id
- * @param [in] layertype surface layer type
- * @param [in] layer surface layer Id
- * @param [in] x surface upper-left X coordinate
- * @param [in] y surface upper-left Y coordinate
- * @param [in] width surface width
- * @param [in] height surface height
- * @param [in] hint client request
- * (1=client request(not changed)/0=changed)
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWindowController::configureCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- uint32_t node,
- int32_t layertype,
- uint32_t layer,
- int32_t x,
- int32_t y,
- int32_t width,
- int32_t height,
- int32_t hint)
-{
- ICO_TRA("CicoSCWindowController::configureCB Enter"
- "(surfaceid=0x%08X node=%d layer=%x.%x x=%d y=%d "
- "width=%d height=%d hint=%d)",
- surfaceid, node, layertype, layer, x, y, width, height, hint);
-
- if (layertype == ICO_WINDOW_MGR_LAYERTYPE_INPUTPANEL) {
- // So far, SystemController ignores this event
- // because it does not support InputPanel(Software Keyboard).
- ICO_TRA("CicoSCWindowController::configureCB Leave(Input Panel)");
- return;
- }
- CicoSCWindow *window = findWindow(surfaceid);
- if (NULL == window) {
- ICO_WRN("not found window information");
- ICO_TRA("CicoSCWindowController::visibleCB Leave"
- "(update window visible failed)");
- return;
- }
-
- if (ICO_WINDOW_MGR_HINT_CHANGE == hint) {
- window->x = x;
- window->y = y;
- window->width = width;
- window->height = height;
- window->layertype = layertype;
- }
-
- // send message
- CicoSCMessage *message = new CicoSCMessage();
- message->addRootObject("command", MSG_CMD_CHANGE_ATTR);
- message->addRootObject("appid", window->appid);
- const CicoSCDisplayZone* zone = findDisplayZone(window->zoneid);
- if (NULL != zone) {
- message->addArgObject("zone", zone->fullname);
- }
- else {
- message->addArgObject("zone", "");
- }
- message->addArgObject("surface", window->surfaceid);
- message->addArgObject("winname", window->name);
- message->addArgObject("node", window->nodeid);
- message->addArgObject("layertype", window->layertype);
- message->addArgObject("layer", window->layerid);
- message->addArgObject("pos_x", window->x);
- message->addArgObject("pos_y", window->y);
- message->addArgObject("width", window->width);
- message->addArgObject("height", window->height);
- message->addArgObject("raise", window->raise ? 1 : 0);
- message->addArgObject("visible", window->visible ? 1 : 0);
- message->addArgObject("active", window->active ? 1 : 0);
- CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
-
- ICO_TRA("CicoSCWindowController::configureCB Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
* @brief wayland surface active callback
*
* @param [in] data user data(unused)
* @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
* @param [in] surfaceid ico_window_mgr surface Id
- * @param [in] active surface active
- * (1=active/0=not active)
+ * @param [in] select select device(unused)
+ * (0=not active/1=pointer/2=touch)
*/
//--------------------------------------------------------------------------
void
CicoSCWindowController::activeCB(void *data,
struct ico_window_mgr *ico_window_mgr,
uint32_t surfaceid,
- int32_t active)
+ int32_t select)
{
ICO_TRA("CicoSCWindowController::activeCB Enter"
- "(surfaceid=0x%08X active=%d)", surfaceid, active);
+ "(surfaceid=0x%08X select=%d)", surfaceid, select);
CicoSCWindow *window = findWindow(surfaceid);
if (NULL == window) {
return;
}
- if (0 == active) {
+ if (0 == select) {
ICO_TRA("CicoSCWindowController::activeCB Leave(not active)");
return;
}
//--------------------------------------------------------------------------
/**
- * @brief wayland layer visible callback
- *
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] layer layer Id
- * @param [in] visible layer visible
- * (1=visible/0=invisible/other=no change)
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWindowController::layerVisibleCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t layer,
- int32_t visible)
-{
- ICO_TRA("CicoSCWindowController::layerVisibleCB Enter"
- "layer=%d visible=%d)", layer, visible);
-
- // send message
- CicoSCMessage *message = new CicoSCMessage();
- message->addRootObject("command", MSG_CMD_CHANGE_LAYER_ATTR);
- message->addRootObject("appid", "");
- message->addArgObject("layer", layer);
- message->addArgObject("visible", visible);
- CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
-
- ICO_TRA("CicoSCWindowController::layerVisibleCB Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief query application surface callback
- *
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] appid application Id
- * @param [in] surface surface Id array
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWindowController::appSurfacesCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- const char *appid,
- struct wl_array *surfaces)
-{
- ICO_TRA("CicoSCWindowController::appSurfacesCB Enter(appid=%s)", appid);
-
- //struct wl_array {
- // size_t size;
- // size_t alloc;
- // void *data;
- //};
- uint32_t **p;
- for (p = (uint32_t**)(surfaces)->data;
- (const char*) p < ((const char*) (surfaces)->data + (surfaces)->size);
- (p)++) {
- ICO_DBG("appSurfacesCB: surface=%d", (int)*p);
- }
-
- ICO_TRA("CicoSCWindowController::appSurfacesCB Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
* @brief surface map event callback
*
* @param [in] data user data(unused)
* @param [in] event event
* @param [in] surfaceid surface Id
* @param [in] type surface type (EGL buffer/Shared memory)
- * @param [in] target surface buffer target(EGL buffer name)
* @param [in] width surface width
* @param [in] height surface height
* @param [in] stride surface buffer(frame buffer) stride
int32_t event,
uint32_t surfaceid,
uint32_t type,
- uint32_t target,
int32_t width,
int32_t height,
int32_t stride,
int command;
ICO_TRA("CicoSCWindowController::mapSurfaceCB Enter(ev=%d surf=%x "
- "type=%d target=%d w/h=%d/%d stride=%d form=%x)",
- event, surfaceid, type, target, width, height, stride, format);
+ "type=%d w/h=%d/%d stride=%d form=%x)",
+ event, surfaceid, type, width, height, stride, format);
CicoSCWindow *window = findWindow(surfaceid);
if (NULL == window) {
message->addRootObject("appid", window->appid);
message->addArgObject("surface", window->surfaceid);
message->addArgObject("attr", type);
- message->addArgObject("name", target);
message->addArgObject("width", width);
message->addArgObject("height", height);
message->addArgObject("stride", stride);
ICO_TRA("CicoSCWindowController::outputModeCB Leave");
}
+//--------------------------------------------------------------------------
+/**
+ * @brief wayland genivi ivi-shell surface create callback
+ *
+ * @param [in] data user data
+ * @param [in] ivi_controller wayland ivi-controller plugin interface
+ * @param [in] id_surface surface id
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWindowController::createSurfaceCB(void *data,
+ struct ivi_controller *ivi_controller,
+ uint32_t id_surface)
+{
+ int pid;
+ int ret;
+ struct ilmSurfaceProperties SurfaceProperties;
+
+ ICO_TRA("CicoSCWindowController::createSurfaceCB Enter"
+ "(surfaceid=0x%08x)", id_surface);
+
+ if ((ilm_getPropertiesOfSurface(id_surface, &SurfaceProperties) != ILM_SUCCESS) ||
+ (ilm_commitChanges() != ILM_SUCCESS)) {
+ ICO_ERR("CicoSCWindowController::createSurfaceCB: ilm_getPropertiesOfSurface(%x) Error",
+ id_surface);
+ return;
+ }
+ ICO_TRA("createSurfaceCB: surface=%08x pid=%d w/h=%d/%d->%d/%d",
+ id_surface, SurfaceProperties.creatorPid,
+ SurfaceProperties.sourceWidth, SurfaceProperties.sourceHeight,
+ SurfaceProperties.destWidth, SurfaceProperties.destHeight);
+
+ CicoSCWindow* window = new CicoSCWindow();
+ window->surfaceid = id_surface;
+ window->name = CicoSCWlWinMgrIF::wlIviCtrlGetSurfaceWaiting(id_surface, &pid);
+ window->pid = pid;
+ window->displayid = 0; // currently fixed 0
+ window->raise = 1; // created surface is top of layer
+
+ CicoSCLifeCycleController* appctrl;
+ appctrl = CicoSCLifeCycleController::getInstance();
+ const CicoAilItems* ailItem = NULL;
+ const CicoAulItems* aulitem = appctrl->findAUL(window->pid);
+ if (NULL != aulitem) {
+ window->appid = aulitem->m_appid;
+ ICO_DBG("appid=%s", window->appid.c_str());
+ ailItem = appctrl->findAIL(window->appid.c_str());
+ }
+ else {
+ ICO_DBG("application information not found.");
+ }
+
+ if (NULL != ailItem) {
+ window->layerid = ailItem->m_layer;
+ window->zoneid = ailItem->m_displayZone;
+ window->nodeid = ailItem->m_nodeID;
+ if ((window->displayid >= 0) && (window->zoneid >= 0)) {
+
+ const CicoSCDisplayZone* zone = findDisplayZone(window->zoneid);
+ if (NULL != zone) {
+ window->zone = zone->fullname;
+ window->x = zone->x;
+ window->y = zone->y;
+ window->width = zone->width;
+ window->height = zone->height;
+ }
+ }
+ }
+ else{
+ delete window;
+ ICO_WRN("ail item not found.");
+ ICO_TRA("CicoSCWindowController::createSurfaceCB Leave(ENOENT)");
+ return;
+ }
+
+ CicoSCLayer *blayer = findLayer(window->displayid, window->layerid);
+ if (blayer) {
+ blayer->addSurface(window->surfaceid, true);
+ int nsurf;
+ const int *surfs = blayer->getSurfaces(&nsurf);
+ if (ilm_layerSetRenderOrder(window->layerid, (t_ilm_layer *)surfs, nsurf)
+ != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::createSurfaceCB: "
+ "ilm_layerSetRenderOrder(%d,,%d) Error", window->layerid, nsurf);
+ }
+ else if (ilm_commitChanges() != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::createSurfaceCB ilm_commitChanges() Error");
+ }
+ }
+
+ appctrl->enterAUL(window->appid.c_str(), window->pid, window);
+
+ // dump log window information
+ window->dump();
+
+ m_windowList[window->surfaceid] = window;
+
+ // set surface attributes
+ setAttributes(window->surfaceid);
+
+ // send message
+ CicoSCMessage *message = new CicoSCMessage();
+ message->addRootObject("command", MSG_CMD_CREATE);
+ message->addRootObject("appid", window->appid);
+ message->addRootObject("pid", window->pid);
+ message->addArgObject("surface", window->surfaceid);
+ message->addArgObject("winname", window->name);
+ CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
+
+ if (NULL != m_resMgr) {
+ CicoSCCommand cmd;
+ CicoSCCmdResCtrlOpt *opt = new CicoSCCmdResCtrlOpt();
+
+ cmd.cmdid = MSG_CMD_CREATE_RES;
+ cmd.appid = window->appid;
+ cmd.pid = window->pid;
+ cmd.opt = opt;
+
+ opt->dispres = true;
+ opt->winname = window->name;
+ opt->surfaceid = window->surfaceid;
+
+ string fullname;
+ const CicoSCDisplayZone* zone = findDisplayZone(window->zoneid);
+ if (NULL != zone) {
+ opt->dispzone = zone->fullname;
+ }
+
+#if 1 //TODO
+ opt->soundres = true;
+ opt->soundname = window->appid;
+ opt->soundid = 0;
+ CicoSystemConfig *sysconf = CicoSystemConfig::getInstance();
+ const CicoSCDefaultConf *defconf = sysconf->getDefaultConf();
+ if (NULL != defconf) {
+ const CicoSCSoundZoneConf *zoneconf =
+ sysconf->findSoundZoneConfbyId(defconf->soundzone);
+ if (NULL != zoneconf) {
+ opt->soundzone = zoneconf->fullname;
+ }
+ }
+#endif
+ m_resMgr->handleCommand((const CicoSCCommand&)cmd, true);
+ }
+ else {
+ show(window->surfaceid, NULL, 0);
+ }
+
+ // add notification
+ if ((ret = ilm_surfaceAddNotification(window->surfaceid, wlGeniviSurfaceNotification))
+ != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::createSurfaceCB ilm_surfaceAddNotification(%08x) "
+ "Error.%d", window->surfaceid, ret);
+ }
+ ICO_TRA("CicoSCWindowController::createSurfaceCB Leave");
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief genivi ivi-shell layer propaty callback
+ *
+ * @param [in] layer layer id
+ * @param [in] LayerProperties layer properties
+ * @param [in] mask change properties
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWindowController::wlGeniviLayerNotification(t_ilm_layer layer,
+ struct ilmLayerProperties *LayerProperties,
+ t_ilm_notification_mask mask)
+{
+ ICO_TRA("CicoSCWindowController::wlGeniviLayerNotification Enter(%x,,%x)", layer, mask);
+
+ if (mask & ILM_NOTIFICATION_VISIBILITY) {
+ // change layer visibility, send message to HomeScreen
+ CicoSCMessage *message = new CicoSCMessage();
+ message->addRootObject("command", MSG_CMD_CHANGE_LAYER_ATTR);
+ message->addRootObject("appid", "");
+ message->addArgObject("layer", layer);
+ message->addArgObject("visible", LayerProperties->visibility ? 1 : 0);
+ CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
+ }
+ ICO_TRA("CicoSCWindowController::wlGeniviLayerNotification Leave");
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief genivi ivi-shell surface propaty callback
+ *
+ * @param [in] surface surface id
+ * @param [in] SurfaceProperties surface properties
+ * @param [in] mask change properties
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWindowController::wlGeniviSurfaceNotification(t_ilm_surface surface,
+ struct ilmSurfaceProperties *SurfaceProperties,
+ t_ilm_notification_mask mask)
+{
+ int newVisible;
+
+ ICO_TRA("CicoSCWindowController::wlGeniviSurfaceNotification Enter(%x,,%x)", surface, mask);
+ newVisible = SurfaceProperties->visibility ? ICO_SYC_WIN_VISIBLE_SHOW
+ : ICO_SYC_WIN_VISIBLE_HIDE;
+ CicoSCWindow *window = CicoSCWindowController::getInstance()->findWindow(surface);
+ if (NULL == window) {
+ ICO_WRN("CicoSCWindowController::wlGeniviSurfaceNotification Leave(surface=%08x not exist)", surface);
+ return;
+ }
+ if ((window->visible != newVisible) ||
+ (window->x != (int)SurfaceProperties->destX) ||
+ (window->y != (int)SurfaceProperties->destY) ||
+ (window->width != (int)SurfaceProperties->destWidth) ||
+ (window->height != (int)SurfaceProperties->destHeight)) {
+ // change visibility
+ window->visible = newVisible;
+ window->x = (int)SurfaceProperties->destX;
+ window->y = (int)SurfaceProperties->destY;
+ window->width = (int)SurfaceProperties->destWidth;
+ window->height = (int)SurfaceProperties->destHeight;
+
+ // update attr
+ window->visible = newVisible;
+
+ // notify to homescreen
+ CicoSCMessage *message = new CicoSCMessage();
+ message->addRootObject("command", MSG_CMD_CHANGE_ATTR);
+ message->addRootObject("appid", window->appid);
+ const CicoSCDisplayZone* zone
+ = CicoSCWindowController::getInstance()->findDisplayZone(window->zoneid);
+ if (NULL != zone) {
+ message->addArgObject("zone", zone->fullname);
+ }
+ else {
+ message->addArgObject("zone", "");
+ }
+ message->addArgObject("surface", window->surfaceid);
+ message->addArgObject("winname", window->name);
+ message->addArgObject("node", window->nodeid);
+ message->addArgObject("layer", window->layerid);
+ message->addArgObject("pos_x", window->x);
+ message->addArgObject("pos_y", window->y);
+ message->addArgObject("width", window->width);
+ message->addArgObject("height", window->height);
+ message->addArgObject("raise", window->raise ? 1 : 0);
+ message->addArgObject("visible", window->visible ? 1 : 0);
+ message->addArgObject("active", window->active ? 1 : 0);
+ CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
+ }
+ else {
+ ICO_TRA("CicoSCWindowController::wlGeniviSurfaceNotification Leave(no change)");
+ }
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief setup Genivi ivi-shell notification(callback) finctions
+ *
+ * @param none
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWindowController::initializeGeniviNotifications(void)
+{
+ t_ilm_uint NumberOfScreens = 16;
+ t_ilm_uint ScreenIds[16];
+ t_ilm_layer *pLayerId, *ppLayerId;
+ t_ilm_int LayerNumber;
+ t_ilm_uint *pScreenIds = ScreenIds;
+ struct ilmScreenProperties ScreenProperties;
+ int idx, DisplayId;
+ const CicoSCDisplayConf *DisplayConf;
+ const CicoSCLayerConf *LayerConf;
+ int LayerId;
+
+ // get all screen id
+ memset(ScreenIds, 0, sizeof(ScreenIds));
+ if ((ilm_getScreenIDs(&NumberOfScreens, &pScreenIds) != ILM_SUCCESS) ||
+ (ilm_commitChanges() != ILM_SUCCESS)) {
+ ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ "ilm_getScreenIDs() Error");
+ return;
+ }
+ ICO_TRA("initializeGeniviNotifications: Screens=%d.%x %x %x %x",
+ NumberOfScreens, ScreenIds[0], ScreenIds[1], ScreenIds[2], ScreenIds[3]);
+ for (idx = 0; idx < (int)NumberOfScreens; idx++) {
+ ICO_TRA("CicoSCWindowController::initializeGeniviNotifications: call ilm_getPropertiesOfScreen(%x)", ScreenIds[idx]);
+ if ((ilm_getPropertiesOfScreen(ScreenIds[idx], &ScreenProperties) != ILM_SUCCESS) ||
+ (ilm_commitChanges() != ILM_SUCCESS)) {
+ ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ "ilm_getPropertiesOfScreen(%d.%x) Error", idx, ScreenIds[idx]);
+ continue;
+ }
+ ICO_TRA("CicoSCWindowController::initializeGeniviNotifications: "
+ "Screen[%d.%x] w/h=%d/%d layers=%d",
+ idx, ScreenIds[idx], ScreenProperties.screenWidth,
+ ScreenProperties.screenHeight, ScreenProperties.layerCount);
+
+ DisplayId = CicoSystemConfig::getInstance()->getDisplayIdbyNo((int)ScreenIds[idx]);
+ if ((DisplayId < 0) ||
+ ((DisplayConf = CicoSystemConfig::getInstance()->findDisplayConfbyId(DisplayId))
+ == NULL)) {
+ ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ "ScreenId.%x not found", ScreenIds[idx]);
+ }
+ else {
+#if 0 // TODO
+ CicoSystemConfig::getInstance()->setDisplaySize(DisplayId,
+ ScreenProperties.screenWidth,
+ ScreenProperties.screenHeight);
+#endif
+ // set genivi layers
+ for (idx = 0; ; idx++) {
+ LayerConf = CicoSystemConfig::getInstance()->
+ findLayerConfbyIdx(DisplayId, idx);
+ if (! LayerConf) break;
+ }
+ pLayerId = (t_ilm_layer *)malloc(sizeof(t_ilm_layer) * idx);
+ ppLayerId = pLayerId;
+ LayerNumber = 0;
+
+ for (idx = 0; ; idx++) {
+ LayerConf = CicoSystemConfig::getInstance()->
+ findLayerConfbyIdx(DisplayId, idx);
+ if (! LayerConf) break;
+
+ LayerId = (DisplayId << 16) | LayerConf->id;
+ if (ilm_layerCreateWithDimension((t_ilm_layer *)&LayerId,
+ DisplayConf->width, DisplayConf->height) != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ "ilm_layerCreateWithDimension(%x,%d,%d) Error",
+ LayerId, DisplayConf->width, DisplayConf->height);
+ }
+ else if (ilm_commitChanges() != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ "ilm_commitChanges() Error");
+ }
+ else if (ilm_layerSetOpacity(LayerId, (t_ilm_float)1.0f) != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ "ilm_layerSetOpacity(%x) Error", LayerId);
+ }
+ else if (ilm_layerSetSourceRectangle(LayerId, 0, 0,
+ DisplayConf->width, DisplayConf->height) != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ "ilm_layerSetSourceRectangle(%x) Error", LayerId);
+ }
+ else if (ilm_layerSetDestinationRectangle(LayerId, 0, 0,
+ DisplayConf->width, DisplayConf->height) != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ "ilm_layerSetDestinationRectangle(%x) Error", LayerId);
+ }
+ else if (ilm_layerSetOrientation(LayerId, ILM_ZERO) != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ "ilm_layerSetOrientation(%x) Error", LayerId);
+ }
+ else if (ilm_layerSetOrientation(LayerId, ILM_ZERO) != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ "ilm_layerSetOrientation(%x) Error", LayerId);
+ }
+ else if (ilm_layerAddNotification(LayerId, wlGeniviLayerNotification)
+ != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ "ilm_layerAddNotification(%x) Error", LayerId);
+ }
+ else {
+ if (ilm_commitChanges() != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ "ilm_commitChanges() Error");
+ }
+ ICO_TRA("initializeGeniviNotifications: layer=%x created(%d,%d)",
+ LayerId, DisplayConf->width, DisplayConf->height);
+ *ppLayerId = LayerId;
+ ppLayerId ++;
+ LayerNumber ++;
+ }
+ }
+ if (LayerNumber > 0) {
+ if (ilm_displaySetRenderOrder(ScreenIds[idx], pLayerId, LayerNumber)
+ != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ "ilm_displaySetRenderOrder(%d) Error", LayerNumber);
+ }
+ else if (ilm_commitChanges() != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ "ilm_commitChanges() Error");
+ }
+ ppLayerId = pLayerId;
+ for (idx = 0; idx < LayerNumber; idx++) {
+ if (ilm_layerAddNotification(*ppLayerId, wlGeniviLayerNotification)
+ != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWindowController::initializeGeniviNotifications "
+ "ilm_layerAddNotification(%x) Error", *ppLayerId);
+ }
+ ppLayerId ++;
+ }
+ }
+ free(pLayerId);
+ }
+ }
+}
+
//==========================================================================
// private method
//==========================================================================
map<unsigned int, CicoSCWindow*>::iterator itr;
itr = m_windowList.find(surfaceid);
if (m_windowList.end() == itr) {
- ICO_WRN("not found window object. surfaceid=0x%08X", surfaceid);
+ ICO_TRA("not found window object. surfaceid=0x%08X", surfaceid);
return NULL;
}
ICO_DBG("command: MSG_CMD_CHANGE_LAYER");
(void)setWindowLayer(opt->surfaceid, opt->layerid);
break;
- case MSG_CMD_MAP_BUFFER:
- ICO_DBG("command: MSG_CMD_MAP_BUFFER");
- (void)setmapBuffer(opt->animation.c_str(), opt->width, opt->height);
+ case MSG_CMD_MAP_GET:
+ ICO_DBG("command: MSG_CMD_MAP_GET");
+ (void)setmapGet(opt->surfaceid, opt->animation.c_str());
break;
case MSG_CMD_MAP_THUMB:
ICO_DBG("command: MSG_CMD_MAP_THUMB");
- (void)mapSurface(opt->surfaceid, opt->framerate);
+ (void)mapSurface(opt->surfaceid, opt->framerate, opt->animation.c_str());
break;
case MSG_CMD_UNMAP_THUMB:
ICO_DBG("command: MSG_CMD_UNMAP_THUMB");
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
class CicoSCWindowController : public CicoSCWlWinMgrIF
{
public:
+ // get instance of CicoSCWindowController
+ static CicoSCWindowController* getInstance();
+
// default constructor
CicoSCWindowController();
int active(int surfaceid, int target);
- int setmapBuffer(const char *shmname, int bufsize, int bufnum);
+ int setmapGet(int surfaceid, const char *filepath);
- int mapSurface(int surfaceid, int framerate);
+ int mapSurface(int surfaceid, int framerate, const char *filepath);
int unmapSurface(int surfaceid);
int setAttributes(int surfaceid);
- //
- virtual void createdCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- const char *winname,
- int32_t pid,
- const char *appid,
- int32_t layertype);
-
- virtual void nameCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- const char *winname);
-
- virtual void destroyedCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid);
-
- virtual void visibleCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- int32_t visible,
- int32_t raise,
- int32_t hint);
-
- virtual void configureCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- uint32_t node,
- int32_t layertype,
- uint32_t layer,
- int32_t x,
- int32_t y,
- int32_t width,
- int32_t height,
- int32_t hint);
+ static void initializeGeniviNotifications(void);
+
+ static void wlGeniviLayerNotification(t_ilm_layer layer,
+ struct ilmLayerProperties *LayerProperties,
+ t_ilm_notification_mask mask);
+ static void wlGeniviSurfaceNotification(t_ilm_surface surface,
+ struct ilmSurfaceProperties *SurfaceProperties,
+ t_ilm_notification_mask mask);
+ //
virtual void activeCB(void *data,
struct ico_window_mgr *ico_window_mgr,
uint32_t surfaceid,
- int32_t active);
-
- virtual void layerVisibleCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t layer,
- int32_t visible);
-
- virtual void appSurfacesCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- const char *appid,
- struct wl_array *surfaces);
+ int32_t select);
virtual void mapSurfaceCB(void *data,
struct ico_window_mgr *ico_window_mgr,
int32_t event,
uint32_t surfaceid,
uint32_t type,
- uint32_t target,
int32_t width,
int32_t height,
int32_t stride,
int32_t height,
int32_t refresh);
+ virtual void createSurfaceCB(void *data,
+ struct ivi_controller *ivi_controller,
+ uint32_t id_surface);
+
private:
// assignment operator
CicoSCWindowController& operator=(const CicoSCWindowController &object);
int animationTime);
private:
+ /// my instance
+ static CicoSCWindowController *ms_myInstance;
+
// resource manager instance
CicoSCResourceManager *m_resMgr;
// display object list
vector<CicoSCDisplay*> m_displayList;
- // total of physical display
+ // total of physical display
unsigned int m_physicalDisplayTotal;
-
};
#endif // __CICO_SC_WINDOW_CONTROLLER_H__
// vim:set expandtab ts=4 sw=4:
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full tWlExt of the Apache License is at
//--------------------------------------------------------------------------
/**
- * @brief wrapper function ico_input_mgr_control_send_input_event
- *
- * @param [in] appid application id
- * @param [in] surfaceid surface id
- * @param [in] type device type
- * @param [in] deviceno input device number
- * @param [in] time event time
- * @param [in] code event code
- * @param [in] value event value
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWlInputMgrIF::sendInputEvent(const string &appid,
- int surfaceid,
- int type,
- int deviceno,
- int time,
- int code,
- int value)
-{
- ICO_DBG("called: ico_input_mgr_control_send_input_event"
- "(appid=<%s> surfaceid=0x%08X type=%d deviceno=%d time=%d code=%d value=%d)",
- appid.c_str(), surfaceid, type, deviceno, time, code, value);
- ico_input_mgr_control_send_input_event(m_inputmgr, appid.c_str(), surfaceid,
- type, deviceno, time, code, value);
- // flush display
- CicoSCWayland::getInstance()->flushDisplay();
-}
-
-//--------------------------------------------------------------------------
-/**
* @brief wrapper function ico_exinput_set_input_region
*
* @param [in] target target window name(winname@appid)
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full tWlExt of the Apache License is at
const std::string &device,
int input);
- // wrapper function ico_input_mgr_control_send_input_event
- void sendInputEvent(const std::string &appid,
- int surfaceid,
- int type,
- int deviceno,
- int time,
- int code,
- int value);
-
// wrapper function ico_exinput_set_input_region
void setInputRegion(const std::string &target,
int x,
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
#include <fcntl.h>
#include <cstring>
+#include "ico_syc_type.h"
#include "CicoSCWlWinMgrIF.h"
#include "CicoLog.h"
+#include "CicoSystemConfig.h"
+#include "CicoConf.h"
+#include "CicoSCWindowController.h"
//==========================================================================
// static variables
//==========================================================================
+struct ico_window_mgr *CicoSCWlWinMgrIF::m_winmgr = NULL;
+struct ivi_application *CicoSCWlWinMgrIF::m_ivi_app = NULL;
+struct ivi_controller *CicoSCWlWinMgrIF::m_ivi_ctrl = NULL;
+struct wl_output *CicoSCWlWinMgrIF::m_wloutput = NULL;
+
+int CicoSCWlWinMgrIF::m_id_surface = 0;
+
+struct creation_surface_wait *CicoSCWlWinMgrIF::m_wait_surface_creation = NULL;
+struct creation_surface_wait *CicoSCWlWinMgrIF::m_free_surface_creation = NULL;
//--------------------------------------------------------------------------
/**
*/
//--------------------------------------------------------------------------
CicoSCWlWinMgrIF::CicoSCWlWinMgrIF()
- : m_winmgr(NULL), m_wloutput(NULL)
{
// ico_window_mgr listener
- m_listener.window_created = wlCreatedCB;
- m_listener.window_name = wlNameCB;
- m_listener.window_destroyed = wlDestroyedCB;
- m_listener.window_visible = wlVisibleCB;
- m_listener.window_configure = wlConfigureCB;
m_listener.window_active = wlActiveCB;
- m_listener.layer_visible = wlLayerVisibleCB;
- m_listener.app_surfaces = wlAppSurfacesCB;
m_listener.map_surface = wlMapSurfaceCB;
+ // genivi ivi_application listener
+ m_ivi_app_listener.error = wlIviAppErrorCB;
+ m_ivi_app_listener.wl_shell_info = wlIviAppNativeShellInfoCB;
+
+ // genivi ivi_controller listener
+ m_ivi_ctrl_listener.screen = wlIviCtrlScreenCB;
+ m_ivi_ctrl_listener.layer = wlIviCtrlLayerCB;
+ m_ivi_ctrl_listener.surface = wlIviCtrlSurfaceCB;
+ m_ivi_ctrl_listener.error = wlIviCtrlErrorCB;
+ m_ivi_ctrl_listener.native_handle = wlIviCtrlNativeHandleCB;
+
// wayland output listener
m_wlOutputListener.geometry = wlOutputGeometryCB;
m_wlOutputListener.mode = wlOutputModeCB;
m_winmgr = (struct ico_window_mgr *)wlProxy;
- ico_window_mgr_add_listener(m_winmgr,
+ ico_window_mgr_add_listener(m_winmgr,
&m_listener,
this);
-#if 0
- ico_window_mgr_set_user_data(m_winmgr, NULL/*TODO*/);
-#endif
-
- ICO_DBG("called: ico_window_mgr_declare_manager");
- ico_window_mgr_declare_manager(m_winmgr,
- ICO_WINDOW_MGR_DECLARE_MANAGER_MANAGER);
-
+ }
+ else if (0 == strcmp(interface, ICO_WL_IVI_APPLICATION_IF)) {
+ // get interface instance
+ ICO_DBG("called: wl_registry_bind for ivi_application");
+ void *wlProxy = wl_registry_bind(registry,
+ name,
+ &ivi_application_interface,
+ 1);
+ if (NULL == wlProxy) {
+ ICO_WRN("interface(%s) wl_registry_bind failed.",
+ interface);
+ ICO_TRA("CicoSCWlWinMgrIF::initInterface Leave(binding failed)");
+ return;
+ }
+ m_ivi_app = (struct ivi_application *)wlProxy;
+ ivi_application_add_listener(m_ivi_app,
+ &m_ivi_app_listener,
+ this);
+ }
+ else if (0 == strcmp(interface, ICO_WL_IVI_CONTROLLER_IF)) {
+ // get interface instance
+ ICO_DBG("called: wl_registry_bind for ivi_controller");
+ void *wlProxy = wl_registry_bind(registry,
+ name,
+ &ivi_controller_interface,
+ 1);
+ if (NULL == wlProxy) {
+ ICO_WRN("interface(%s) wl_registry_bind failed.",
+ interface);
+ ICO_TRA("CicoSCWlWinMgrIF::initInterface Leave(binding failed)");
+ return;
+ }
+ m_ivi_ctrl = (struct ivi_controller *)wlProxy;
+ ivi_controller_add_listener(m_ivi_ctrl,
+ &m_ivi_ctrl_listener,
+ this);
}
else if (0 == strcmp(interface, ICO_WL_OUTPUT_IF)) {
// get interface instance
}
m_wloutput = (struct wl_output*)wlProxy;
- wl_output_add_listener(m_wloutput,
+ wl_output_add_listener(m_wloutput,
&m_wlOutputListener,
this);
-#if 0
- wl_output_set_user_data(m_wloutput, NULL/*TODO*/);
-#endif
}
else {
ICO_WRN("unmatch interface");
}
//--------------------------------------------------------------------------
-/**
- * @brief wrapper function of ico_window_mgr_declare_manager
- *
- * @param [in] manager type of manager
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWlWinMgrIF::declareManager(int32_t manager)
-{
- // declare manager request to Multi Window Manager
- ICO_DBG("called: ico_window_mgr_declare_manager(manager=%d)", manager);
- ico_window_mgr_declare_manager(m_winmgr, manager);
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief wrapper function of ico_window_mgr_set_window_layer
- *
+/**
+ * @brief wrapper function of ilm_layerAddSurface
+ *
* @param [in] surfaceid wayland surface id
- * @param [in] layer number of layer
+ * @param [in] layer layer id
+ * @param [in] oldlayer old layer id(if 0xffffffff, no old layer)
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::setWindowLayer(uint32_t surfaceid, uint32_t layer)
+CicoSCWlWinMgrIF::setWindowLayer(uint32_t surfaceid, uint32_t layer, uint32_t oldlayer)
{
// set window layer request to Multi Window Manager
- ICO_DBG("called: ico_window_mgr_set_window_layer"
- "(surfaceid=0x%08X layer=%d)", surfaceid, layer);
- ico_window_mgr_set_window_layer(m_winmgr, surfaceid, layer);
+ ICO_DBG("CicoSCWlWinMgrIF::setWindowLayer: "
+ "surfaceid=0x%08X layer=%d->%d", surfaceid, oldlayer, layer);
+
+ // remove original layer
+ if (oldlayer <= 0x7fffffff) {
+ ICO_TRA("CicoSCWlWinMgrIF::setWindowLayer: remove surface %08x "
+ "from layer(%d)", surfaceid, oldlayer);
+ (void) ilm_layerRemoveSurface(oldlayer, surfaceid);
+ }
+ else {
+ ICO_TRA("CicoSCWlWinMgrIF::setWindowLayer: surface %08x has no old layer(%d)",
+ surfaceid, oldlayer);
+ }
+
+ // add new layer
+ if (ilm_layerAddSurface(layer, surfaceid) != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWlWinMgrIF::setWindowLayer ilm_layerAddSurface(%d,%08x) Error",
+ layer, surfaceid);
+ }
+ if (ilm_commitChanges() != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWlWinMgrIF::setWindowLayer ilm_commitChanges Error");
+ }
}
//--------------------------------------------------------------------------
-/**
- * @brief wrapper function of ico_window_mgr_set_positionsize
- *
+/**
+ * @brief wrapper function of ilm_surfaceSetDestinationRectangle
+ *
* @param [in] surfaceid wayland surface id
* @param [in] layer number of layer
* @param [in] x
* @param [in] y
* @param [in] width
* @param [in] height
- * @param [in] flags
+ * @param [in] flags (unused)
*/
//--------------------------------------------------------------------------
void
int32_t height, int32_t flags)
{
// set position size request to Multi Window Manager
- ICO_DBG("called: ico_window_mgr_set_positionsize"
+ ICO_DBG("called: ilm_surfaceSetDestinationRectangle"
"(surfaceid=0x%08X node=%d x=%d y=%d w=%d h=%d flags=%d)",
surfaceid, node, x, y, width, height, flags);
- ico_window_mgr_set_positionsize(m_winmgr, surfaceid, node,
- x, y, width, height, flags);
+ if ((ilm_surfaceSetDestinationRectangle(surfaceid, x, y, width, height)
+ != ILM_SUCCESS) ||
+ (ilm_commitChanges() != ILM_SUCCESS)) {
+ ICO_ERR("CicoSCWlWinMgrIF::setPositionsize ilm_surfaceSetDestinationRectangle"
+ "(%08x,%d,%d,%d,%d) Error",
+ surfaceid, x, y, width, height);
+ }
}
//--------------------------------------------------------------------------
-/**
- * @brief wrapper function of ico_window_mgr_set_visible
- *
+/**
+ * @brief wrapper function of ilm_surfaceSetVisibility
+ *
* @param [in] surfaceid wayland surface id
* @param [in] visible visible state
* @param [in] raise raise state
- * @param [in] flags option on change visible
+ * @param [in] flags (unused)
*/
//--------------------------------------------------------------------------
void
int32_t raise, int32_t flags)
{
// set visible request to Multi Window Manager
- ICO_DBG("called: ico_window_mgr_set_visible"
+ ICO_DBG("called: ilm_surfaceSetVisibility"
"(surfaceid=0x%08X visible=%d raise=%d anima=%d)",
surfaceid, visible, raise, flags);
- ico_window_mgr_set_visible(m_winmgr, surfaceid, visible, raise, flags);
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief wrapper function of ico_window_mgr_visible_animation
- *
- * @param [in] surfaceid wayland surface id
- * @param [in] visible visible state
- * @param [in] raise raise state
- * @param [in] flags option on change visible
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWlWinMgrIF::visibleAnimation(uint32_t surfaceid, int32_t visible,
- int32_t x, int32_t y,
- int32_t width, int32_t height)
-{
- // visible animation request to Multi Window Manager
- ICO_DBG("called: ico_window_mgr_visible_animation"
- "(surfaceid=0x%08X visible=%d x=%d y=%d w=%d h=%d)",
- surfaceid, visible, x, y, width, height);
- ico_window_mgr_visible_animation(m_winmgr, surfaceid, visible,
- x, y, width, height);
+ if ((visible == ICO_SYC_WIN_VISIBLE_SHOW) || (visible == ICO_SYC_WIN_VISIBLE_HIDE)) {
+ ilm_surfaceSetVisibility(surfaceid, visible);
+ }
+ if ((raise == ICO_SYC_WIN_RAISE_RAISE) || (raise == ICO_SYC_WIN_RAISE_LOWER)) {
+ // TODO: need raise/lower control
+ }
+ if (ilm_commitChanges() != ILM_SUCCESS) {
+ ICO_ERR("CicoSCWlWinMgrIF::setVisible: ilm_commitChanges() Error");
+ }
}
//--------------------------------------------------------------------------
-/**
+/**
* @brief wrapper function of ico_window_mgr_set_animation
- *
+ *
* @param [in] surfaceid wayland surface id
* @param [in] type transition type
* @param [in] animation name of animation
}
//--------------------------------------------------------------------------
-/**
- * @brief wrapper function of ico_window_mgr_set_attributes
- *
- * @param [in] surfaceid wayland surface id
- * @param [in] attributes attributes of surface
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWlWinMgrIF::setAttributes(uint32_t surfaceid, uint32_t attributes)
-{
- ICO_DBG("called: ico_window_mgr_set_attributes"
- "(surfaceid=0x%08X attributes=%d)", surfaceid, attributes);
- ico_window_mgr_set_attributes(m_winmgr, surfaceid, attributes);
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief wrapper function of ico_window_mgr_set_active
- *
+/**
+ * @brief wrapper function of ilm_SetKeyboardFocusOn
+ *
* @param [in] surfaceid wayland surface id
- * @param [in] active flags od active device
+ * @param [in] active flags or active device(unused)
*/
//--------------------------------------------------------------------------
void
CicoSCWlWinMgrIF::setActive(uint32_t surfaceid, int32_t active)
{
- ICO_DBG("called: ico_window_mgr_set_active"
+ ICO_DBG("called: ilm_SetKeyboardFocusOn"
"(surfaceid=0x%08X active=%d)", surfaceid, active);
- ico_window_mgr_set_active(m_winmgr, surfaceid, active);
+ if ((ilm_SetKeyboardFocusOn(surfaceid) != ILM_SUCCESS) ||
+ (ilm_commitChanges() != ILM_SUCCESS)) {
+ ICO_ERR("CicoSCWlWinMgrIF::setActive ilm_SetKeyboardFocusOn(%08x) Error", surfaceid);
+ }
}
//--------------------------------------------------------------------------
-/**
- * @brief wrapper function of ico_window_mgr_set_layer_visible
- *
+/**
+ * @brief wrapper function of ilm_layerSetVisibility
+ *
* @param [in] surfaceid wayland surface id
* @param [in] layer id of layer
* @param [in] visible visible state
void
CicoSCWlWinMgrIF::setLayerVisible(uint32_t layer, int32_t visible)
{
- ICO_DBG("called: ico_window_mgr_set_layer_visible"
+ ICO_DBG("called: ilm_layerSetVisibility"
"(layer=%d visible=%d)", layer, visible);
- ico_window_mgr_set_layer_visible(m_winmgr, layer, visible);
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief wrapper function of ico_window_mgr_get_surfaces
- *
- * @param [in] appid id of application
- * @param [in] pid id of process
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWlWinMgrIF::getSurfaces(const char *appid, int pid)
-{
- ICO_DBG("called: ico_window_mgr_get_surfaces(appid=%d,pid=%d)",
- appid ? appid : " ", pid);
- ico_window_mgr_get_surfaces(m_winmgr, appid ? appid : " ", pid);
+ if ((ilm_layerSetVisibility(layer, visible) != ILM_SUCCESS) ||
+ (ilm_commitChanges() != ILM_SUCCESS)) {
+ ICO_ERR("CicoSCWlWinMgrIF::setLayerVisible ilm_layerSetVisibility(%d,%d) Error",
+ layer, visible);
+ }
}
//--------------------------------------------------------------------------
-/**
- * @brief wrapper function of ico_window_mgr_set_map_buffer
- *
- * @param[in] shmname shared memory name(POSIX I/F)
- * @param[in] bufsize buffer size in byte
- * @param[in] bufnum number of buffers
+/**
+ * @brief wrapper function of ilm_takeSurfaceScreenshot
+ *
+ * @param [in] surface id of wayland surface
+ * @param [in] filepath surface image pixel file path
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::setmapBuffer(const char *shmname, int bufsize, int bufnum)
+CicoSCWlWinMgrIF::setmapGet(int surfaceid, const char *filepath)
{
- ICO_DBG("called: ico_window_mgr_set_map_buffer(shmname=%s, bufsize=%d, bufnum=%d)",
- shmname ? shmname : "(null)", bufsize, bufnum);
- ico_window_mgr_set_map_buffer(m_winmgr, shmname, bufsize, bufnum);
+ ICO_DBG("called: ilm_takeSurfaceScreenshot(filepath=%s,, surface=0x%08x)",
+ filepath ? filepath : "(null)", surfaceid);
+ if ((ilm_takeSurfaceScreenshot(filepath, surfaceid) != ILM_SUCCESS) ||
+ (ilm_commitChanges() != ILM_SUCCESS)) {
+ ICO_ERR("CicoSCWlWinMgrIF::setmapGet ilm_takeSurfaceScreenshot(%s,%x) Error",
+ filepath ? filepath : "(null)", surfaceid);
+ }
}
//--------------------------------------------------------------------------
-/**
+/**
* @brief wrapper function of ico_window_mgr_map_surface
- *
+ *
* @param [in] surface id of wayland surface
* @param [in] framerate interval of changed notify[frame per second]
+ * @param [in] filepath surface image pixel file path
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::mapSurface(uint32_t surfaceid, int32_t framerate)
+CicoSCWlWinMgrIF::mapSurface(uint32_t surfaceid, int32_t framerate, const char *filepath)
{
- ICO_DBG("called: ico_window_mgr_map_surface"
- "(surfaceid=0x%08X framerate=%d)", surfaceid, framerate);
- ico_window_mgr_map_surface(m_winmgr, surfaceid, framerate);
+ ICO_DBG("called: ico_window_mgr_map_surface(surfaceid=0x%08X framerate=%d file=%s)",
+ surfaceid, framerate, filepath ? filepath : "(null)");
+ // currently GENIVI genivi-shell not support contents change, so use ico_window_mgr
+ if ((filepath != NULL) && (*filepath != 0) && (*filepath != ' ')) {
+ ico_window_mgr_map_surface(m_winmgr, surfaceid, framerate, filepath);
+ }
+ else {
+ ico_window_mgr_map_surface(m_winmgr, surfaceid, framerate, " ");
+ }
}
//--------------------------------------------------------------------------
-/**
+/**
* @brief wrapper function of ico_window_mgr_unmap_surface
- *
+ *
* @param [in] surface id of wayland surface
*/
//--------------------------------------------------------------------------
{
ICO_DBG("called: ico_window_mgr_unmap_surface"
"(surfaceid=0x%08X)", surfaceid);
+ // currently GENIVI genivi-shell not support contents change, so use ico_window_mgr
ico_window_mgr_unmap_surface(m_winmgr, surfaceid);
}
//--------------------------------------------------------------------------
-/**
- * @brief wayland surface create callback
- *
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] surfaceid ico_window_mgr surface Id
- * @param [in] winname surface window name(title)
- * @param [in] pid wayland client process Id
- * @param [in] appid wayland client application Id
- * @param [in] layertype surface layer type
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWlWinMgrIF::createdCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- const char *winname,
- int32_t pid,
- const char *appid,
- int32_t layertype)
-{
- ICO_WRN("CicoSCWlWinMgrIF::createdCB called.");
-}
-
-//--------------------------------------------------------------------------
/**
- * @brief wayland change surface name callback
+ * @brief get creation surface window name(title) and pid
*
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] surfaceid ico_window_mgr surface Id
- * @param [in] winname surface window name(title)
+ * @param [in] id_surface surface id
+ * @param [out] pid application process id
*/
//--------------------------------------------------------------------------
-void
-CicoSCWlWinMgrIF::nameCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- const char *winname)
+const char *
+CicoSCWlWinMgrIF::wlIviCtrlGetSurfaceWaiting(uint32_t id_surface, int *pid)
{
- ICO_WRN("CicoSCWlWinMgrIF::nameCB called.");
+ struct creation_surface_wait *tp = m_wait_surface_creation;
+
+ while (tp) {
+ if (tp->id_surface == id_surface) {
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlGetSurfaceWaiting(%x) pid=%d title=<%s>",
+ id_surface, tp->pid, tp->title);
+ *pid = tp->pid;
+ return tp->title;
+ }
+ tp = tp->next;
+ }
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlGetSurfaceWaiting(%x) dose not exist", id_surface);
+ return NULL;
}
//--------------------------------------------------------------------------
/**
- * @brief wayland surface destroy callback
+ * @brief remove surface window
*
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] surfaceid ico_window_mgr surface Id
+ * @param [in] id_surface surface id
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::destroyedCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid)
+CicoSCWlWinMgrIF::wlIviCtrlRemoveSurface(uint32_t id_surface)
{
- ICO_WRN("CicoSCWlWinMgrIF::destroyedCB called.");
-}
+ struct creation_surface_wait *tp = m_wait_surface_creation;
+ struct creation_surface_wait *bp = NULL;
-//--------------------------------------------------------------------------
-/**
- * @brief wayland surface visible callback
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] surfaceid ico_window_mgr surface Id
- * @param [in] visible surface visible
- * (1=visible/0=invisible/other=no change)
- * @param [in] raise surface raise
- * (1=raise/0=lower/other=no change)
- * @param [in] hint client request
- * (1=client request(not changed)/0=changed)
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWlWinMgrIF::visibleCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- int32_t visible,
- int32_t raise,
- int32_t hint)
-{
- ICO_WRN("CicoSCWlWinMgrIF::visibleCB called.");
-}
+ while (tp) {
+ if (tp->id_surface == id_surface) {
+ if (bp) {
+ bp->next = tp->next;
+ }
+ else {
+ m_wait_surface_creation = tp->next;
+ }
+ tp->next = m_free_surface_creation;
+ m_free_surface_creation = tp;
-//--------------------------------------------------------------------------
-/**
- * @brief wayland surface configure callback
- *
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] surfaceid ico_window_mgr surface Id
- * @param [in] node surface node Id
- * @param [in] layertype surface layer type
- * @param [in] layer surface layer Id
- * @param [in] x surface upper-left X coordinate
- * @param [in] y surface upper-left Y coordinate
- * @param [in] width surface width
- * @param [in] height surface height
- * @param [in] hint client request
- * (1=client request(not changed)/0=changed)
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWlWinMgrIF::configureCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- uint32_t node,
- int32_t layertype,
- uint32_t layer,
- int32_t x,
- int32_t y,
- int32_t width,
- int32_t height,
- int32_t hint)
-{
- ICO_WRN("CicoSCWlWinMgrIF::configureCB called.");
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlRemoveSurface(%x) removed", id_surface);
+ return;
+ }
+ }
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlRemoveSurface(%x) dose not exist", id_surface);
}
//--------------------------------------------------------------------------
* @param [in] data user data(unused)
* @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
* @param [in] surfaceid ico_window_mgr surface Id
- * @param [in] active surface active
- * (1=active/0=not active)
+ * @param [in] select select device(unused)
+ * (0=not active/1=pointer/2=touch)
*/
//--------------------------------------------------------------------------
void
CicoSCWlWinMgrIF::activeCB(void *data,
struct ico_window_mgr *ico_window_mgr,
uint32_t surfaceid,
- int32_t active)
+ int32_t select)
{
ICO_WRN("CicoSCWlWinMgrIF::activeCB called.");
}
//--------------------------------------------------------------------------
/**
- * @brief wayland layer visible callback
- *
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] layer layer Id
- * @param [in] visible layer visible
- * (1=visible/0=invisible/other=no change)
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWlWinMgrIF::layerVisibleCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t layer,
- int32_t visible)
-{
- ICO_WRN("CicoSCWlWinMgrIF::layerVisibleCB called.");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief query application surface callback
- *
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] appid application Id
- * @param [in] pid process Id
- * @param [in] surface surface Id array
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWlWinMgrIF::appSurfacesCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- const char *appid,
- int32_t pid,
- struct wl_array *surfaces)
-{
- ICO_WRN("CicoSCWlWinMgrIF::appSurfacesCB called.");
-}
-
-//--------------------------------------------------------------------------
-/**
* @brief surface map event callback
*
* @param [in] data user data(unused)
* @param [in] event event
* @param [in] surfaceid surface Id
* @param [in] type surface buffer type(EGL buffer/Shared memory)
- * @param [in] target surface buffer target(EGL buffer name)
* @param [in] width surface width
* @param [in] height surface height
* @param [in] stride surface buffer(frame buffer) stride
int32_t event,
uint32_t surfaceid,
uint32_t type,
- uint32_t target,
int32_t width,
int32_t height,
int32_t stride,
int32_t refresh)
{
ICO_WRN("CicoSCWlWinMgrIF::outputModeCB called.");
+};
+
+//--------------------------------------------------------------------------
+/**
+ * @brief wayland genivi ivi-surface create callback
+ *
+ * @param [in] data user data(unused)
+ * @param [in] ivi_controller wayland ivi-controller plugin interface
+ * @param [in] id_surface surface id
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWlWinMgrIF::createSurfaceCB(void *data,
+ struct ivi_controller *ivi_controller,
+ uint32_t id_surface)
+{
+ ICO_WRN("CicoSCWlWinMgrIF::createSurfaceCB called.");
}
//==========================================================================
//==========================================================================
//--------------------------------------------------------------------------
-/**
- * @brief wayland surface create callback
- *
+/**
+ * @brief wayland surface active callback
+ *
* @param [in] data user data(unused)
* @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
* @param [in] surfaceid ico_window_mgr surface Id
- * @param [in] winname surface window name(title)
- * @param [in] pid wayland client process Id
- * @param [in] appid wayland client application Id
- * @param [in] layertype surface layer type
+ * @param [in] select select device(unused)
+ * (0=not active/1=pointer/2=touch)
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::wlCreatedCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- const char *winname,
- int32_t pid,
- const char *appid,
- int32_t layertype)
+CicoSCWlWinMgrIF::wlActiveCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid,
+ int32_t select)
{
-// ICO_TRA("CicoSCWlWinMgrIF::wlCreatedCB Enter");
+// ICO_TRA("CicoSCWlWinMgrIF::wlActiveCB Enter");
+
if (NULL == data) {
- ICO_WRN("wlCreatedCB : data is null");
+ ICO_WRN("wlActiveCB: data is null");
return;
}
- static_cast<CicoSCWlWinMgrIF*>(data)->createdCB(data, ico_window_mgr,
- surfaceid, winname,
- pid, appid, layertype);
-// ICO_TRA("CicoSCWlWinMgrIF::wlCreatedCB Leave");
+ static_cast<CicoSCWlWinMgrIF*>(data)->activeCB(data, ico_window_mgr,
+ surfaceid, select);
+// ICO_TRA("CicoSCWlWinMgrIF::wlActiveCB Leave");
}
//--------------------------------------------------------------------------
/**
- * @brief wayland change surface name callback
+ * @brief surface map event callback
*
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] surfaceid ico_window_mgr surface Id
- * @param [in] winname surface window name(title)
+ * @param [in] data user data
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
+ * @param [in] event event
+ * @param [in] surfaceid surface Id
+ * @param [IN] type buffer type(fixed ICO_WINDOW_MGR_MAP_TYPE_EGL)
+ * @param [in] width surface width
+ * @param [in] height surface height
+ * @param [in] stride surface buffer(frame buffer) stride
+ * @param [in] format surface buffer format
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::wlNameCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- const char *winname)
+CicoSCWlWinMgrIF::wlMapSurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ int32_t event,
+ uint32_t surfaceid,
+ uint32_t type,
+ int32_t width,
+ int32_t height,
+ int32_t stride,
+ uint32_t format)
{
-// ICO_TRA("CicoSCWlWinMgrIF::wlNameCB Enter");
+// ICO_TRA("CicoSCWlWinMgrIF::wlMapSurfaceCB Enter");
if (NULL == data) {
- ICO_WRN("wlNameCB: data is null");
+ ICO_WRN("wlMapSurfaceCB: data is null");
return;
}
- static_cast<CicoSCWlWinMgrIF*>(data)->nameCB(data, ico_window_mgr,
- surfaceid, winname);
-// ICO_TRA("CicoSCWlWinMgrIF::wlNameCB Leave");
+ static_cast<CicoSCWlWinMgrIF*>(data)->mapSurfaceCB(data, ico_window_mgr,
+ event, surfaceid,
+ type,
+ width, height,
+ stride, format);
+// ICO_TRA("CicoSCWlWinMgrIF::wlMapSurfaceCB Leave");
}
//--------------------------------------------------------------------------
/**
- * @brief wayland surface destroy callback
+ * @brief wayland display attribute callback
*
* @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] surfaceid ico_window_mgr surface Id
+ * @param [in] wl_output wayland wl_output interface
+ * @param [in] x display upper-left X coordinate
+ * @param [in] y display upper-left Y coordinate
+ * @param [in] physical_width display physical width
+ * @param [in] physical_height display physical height
+ * @param [in] subpixel display sub pixel
+ * @param [in] make display maker
+ * @param [in] model display model
+ * @param [in] transform transform
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::wlDestroyedCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid)
+CicoSCWlWinMgrIF::wlOutputGeometryCB(void *data,
+ struct wl_output *wl_output,
+ int32_t x,
+ int32_t y,
+ int32_t physical_width,
+ int32_t physical_height,
+ int32_t subpixel,
+ const char *make,
+ const char *model,
+ int32_t transform)
{
-// ICO_TRA("CicoSCWlWinMgrIF::wlDestroyedCB Enter");
+// ICO_TRA("CicoSCWlWinMgrIF::wlOutputGeometryCB Enter");
if (NULL == data) {
- ICO_WRN("wlDestroyedCB: data is null");
+ ICO_WRN("wlOutputGeometryCB: data is null");
return;
}
- static_cast<CicoSCWlWinMgrIF*>(data)->destroyedCB(data, ico_window_mgr,
- surfaceid);
-// ICO_TRA("CicoSCWlWinMgrIF::wlDestroyedCB Leave");
+ static_cast<CicoSCWlWinMgrIF*>(data)->outputGeometryCB(data, wl_output,
+ x, y,
+ physical_width,
+ physical_height,
+ subpixel,
+ make,
+ model,
+ transform);
+// ICO_TRA("CicoSCWlWinMgrIF::wlOutputGeometryCB Leave");
}
//--------------------------------------------------------------------------
/**
- * @brief wayland surface visible callback
+ * @brief wayland display mode callback
*
- * @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] surfaceid ico_window_mgr surface Id
- * @param [in] visible surface visible
- * (1=visible/0=invisible/other=no change)
- * @param [in] raise surface raise
- * (1=raise/0=lower/other=no change)
- * @param [in] hint client request
- * (1=client request(not changed)/0=changed)
+ * @param [in] data user data(unused)
+ * @param [in] wl_output wayland wl_output interface
+ * @param [in] flags flags
+ * @param [in] width display width
+ * @param [in] height display height
+ * @param [in] refresh display refresh rate
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::wlVisibleCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- int32_t visible,
- int32_t raise,
- int32_t hint)
+CicoSCWlWinMgrIF::wlOutputModeCB(void *data,
+ struct wl_output *wl_output,
+ uint32_t flags,
+ int32_t width,
+ int32_t height,
+ int32_t refresh)
{
-// ICO_TRA("CicoSCWlWinMgrIF::wlVisibleCB Enter");
+// ICO_TRA("CicoSCWlWinMgrIF::wlOutputModeCB Enter");
if (NULL == data) {
- ICO_WRN("wlVisibleCB: data is null");
+ ICO_WRN("wlOutputGeometryCB: data is null");
return;
}
- static_cast<CicoSCWlWinMgrIF*>(data)->visibleCB(data, ico_window_mgr,
- surfaceid, visible,
- raise, hint);
-// ICO_TRA("CicoSCWlWinMgrIF::wlVisibleCB Leave");
+ static_cast<CicoSCWlWinMgrIF*>(data)->outputModeCB(data, wl_output, flags,
+ width, height, refresh);
+// ICO_TRA("CicoSCWlWinMgrIF::wlOutputModeCB Leave");
}
//--------------------------------------------------------------------------
/**
- * @brief wayland surface configure callback
+ * @brief wayland ivi-shell ivi-application protocol error callback
*
* @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] surfaceid ico_window_mgr surface Id
- * @param [in] node surface node Id
- * @param [in] layertype surface layer type
- * @param [in] layer surface layer Id
- * @param [in] x surface upper-left X coordinate
- * @param [in] y surface upper-left Y coordinate
- * @param [in] width surface width
- * @param [in] height surface height
- * @param [in] hint client request
- * (1=client request(not changed)/0=changed)
+ * @param [in] ivi_application wayland ivi-application interface
+ * @param [in] error_code error code
+ * @param [in] error_text error message
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::wlConfigureCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- uint32_t node,
- int32_t layertype,
- uint32_t layer,
- int32_t x,
- int32_t y,
- int32_t width,
- int32_t height,
- int32_t hint)
+CicoSCWlWinMgrIF::wlIviAppErrorCB(void *data,
+ struct ivi_application *ivi_application,
+ int32_t error_code, const char *error_text)
{
-// ICO_TRA("CicoSCWlWinMgrIF::wlConfigureCB Enter");
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviAppErrorCB: Enter(%d,%s)",
+ error_code, error_text ? error_text : "(null)");
if (NULL == data) {
- ICO_WRN("wlConfigureCB: data is null");
+ ICO_WRN("CicoSCWlWinMgrIF::wlIviAppErrorCB: data is null");
return;
}
- static_cast<CicoSCWlWinMgrIF*>(data)->configureCB(data, ico_window_mgr,
- surfaceid, node, layertype,
- layer, x, y, width, height,
- hint);
-// ICO_TRA("CicoSCWlWinMgrIF::wlConfigureCB Leave");
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviAppErrorCB: Leave");
}
+
//--------------------------------------------------------------------------
/**
- * @brief wayland surface active callback
+ * @brief wayland ivi-shell ivi-application protocol create wl_surface callback
*
* @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] surfaceid ico_window_mgr surface Id
- * @param [in] active surface active
- * (1=active/0=not active)
+ * @param [in] ivi_application wayland ivi-application interface
+ * @param [in] pid application process id
+ * @param [in] title surface title name
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::wlActiveCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- int32_t active)
+CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB(void *data,
+ struct ivi_application *ivi_application,
+ int32_t pid, const char *title)
{
-// ICO_TRA("CicoSCWlWinMgrIF::wlActiveCB Enter");
+ struct creation_surface_wait *tp;
+ struct creation_surface_wait *bp;
+ uint32_t nowtime;
+
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB: Enter(%d,<%s>)",
+ pid, title ? title : "(null)");
if (NULL == data) {
- ICO_WRN("wlActiveCB: data is null");
+ ICO_WRN("CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB: data is null");
return;
}
- static_cast<CicoSCWlWinMgrIF*>(data)->activeCB(data, ico_window_mgr,
- surfaceid, active);
-// ICO_TRA("CicoSCWlWinMgrIF::wlActiveCB Leave");
+
+ // bind wl_surface to ivi_surface
+ ivi_controller_get_native_handle(m_ivi_ctrl, pid, title ? title : "");
+
+ // save pid and title(window name)
+ nowtime = (time(NULL) >> 2) & 0x3fffffff;
+ tp = m_wait_surface_creation;
+ while (tp) {
+ if ((tp->pid == pid) && (tp->title[0] == 0)) break;
+ tp = tp->next;
+ }
+ if (! tp) {
+ tp = m_free_surface_creation;
+ if (tp) {
+ m_free_surface_creation = tp->next;
+ }
+ else {
+ tp = m_wait_surface_creation;
+ bp = NULL;
+ while (tp) {
+ if (((nowtime >= tp->create_time)
+ && ((nowtime - tp->create_time) > 15)) ||
+ ((nowtime < tp->create_time)
+ && ((nowtime + 0x40000000 - tp->create_time) > 15))) {
+ if (bp) {
+ bp->next = tp->next;
+ }
+ else {
+ m_wait_surface_creation = tp->next;
+ }
+ break;
+ }
+ bp = tp;
+ tp = tp->next;
+ }
+ if (! tp) {
+ tp = (struct creation_surface_wait *)
+ malloc(sizeof(struct creation_surface_wait));
+ if (! tp) {
+ ICO_ERR("CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB: out of memory");
+ return;
+ }
+ }
+ }
+ memset(tp, 0, sizeof(struct creation_surface_wait));
+ tp->next = m_wait_surface_creation;
+ m_wait_surface_creation = tp;
+ }
+ tp->pid = pid;
+ strncpy(tp->title, title, ICO_SYC_MAX_WINNAME_LEN-1);
+ tp->create_time = nowtime;
+
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB: Leave");
}
//--------------------------------------------------------------------------
/**
- * @brief wayland layer visible callback
+ * @brief wayland ivi-shell ivi-controller protocol create screen callback
*
* @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] layer layer Id
- * @param [in] visible layer visible
- * (1=visible/0=invisible/other=no change)
+ * @param [in] ivi_controller wayland ivi-controller interface
+ * @param [in] id_screen screen id
+ * @param [in] screen screen information
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::wlLayerVisibleCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t layer,
- int32_t visible)
+CicoSCWlWinMgrIF::wlIviCtrlScreenCB(void *data,
+ struct ivi_controller *ivi_controller,
+ uint32_t id_screen,
+ struct ivi_controller_screen *screen)
{
-// ICO_TRA("CicoSCWlWinMgrIF::wlLayerVisibleCB Enter");
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlScreenCB: Enter(%x)", id_screen);
if (NULL == data) {
- ICO_WRN("wlLayerVisibleCB: data is null");
+ ICO_WRN("CicoSCWlWinMgrIF::wlIviCtrlScreenCB: data is null");
return;
}
- static_cast<CicoSCWlWinMgrIF*>(data)->layerVisibleCB(data, ico_window_mgr,
- layer, visible);
-// ICO_TRA("CicoSCWlWinMgrIF::wlLayerVisibleCB Leave");
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlScreenCB: Leave");
}
//--------------------------------------------------------------------------
/**
- * @brief query application surface callback
+ * @brief wayland ivi-shell ivi-controller protocol create layer callback
*
* @param [in] data user data(unused)
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] appid application Id
- * @param [in] pid process Id
- * @param [in] surface surface Id array
+ * @param [in] ivi_controller wayland ivi-controller interface
+ * @param [in] id_layer layer id
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::wlAppSurfacesCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- const char *appid,
- int32_t pid,
- struct wl_array *surfaces)
+CicoSCWlWinMgrIF::wlIviCtrlLayerCB(void *data,
+ struct ivi_controller *ivi_controller,
+ uint32_t id_layer)
{
-// ICO_TRA("CicoSCWlWinMgrIF::wlAppSurfacesCB Enter");
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlLayerCB: Enter(%x)", id_layer);
if (NULL == data) {
- ICO_WRN("wlAppSurfacesCB: data is null");
+ ICO_WRN("CicoSCWlWinMgrIF::wlIviCtrlLayerCB: data is null");
return;
}
- static_cast<CicoSCWlWinMgrIF*>(data)->appSurfacesCB(data, ico_window_mgr,
- appid, pid, surfaces);
-// ICO_TRA("CicoSCWlWinMgrIF::wlAppSurfacesCB Leave");
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlLayerCB: Leave");
}
//--------------------------------------------------------------------------
/**
- * @brief surface map event callback
+ * @brief wayland ivi-shell ivi-controller protocol create surface callback
*
- * @param [in] data user data
- * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
- * @param [in] event event
- * @param [in] surfaceid surface Id
- * @param [IN] type buffer type(fixed ICO_WINDOW_MGR_MAP_TYPE_EGL)
- * @param [IN] target EGL buffer name
- * @param [in] width surface width
- * @param [in] height surface height
- * @param [in] stride surface buffer(frame buffer) stride
- * @param [in] format surface buffer format
+ * @param [in] data user data(unused)
+ * @param [in] ivi_controller wayland ivi-controller interface
+ * @param [in] id_surface surface id
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::wlMapSurfaceCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- int32_t event,
- uint32_t surfaceid,
- uint32_t type,
- uint32_t target,
- int32_t width,
- int32_t height,
- int32_t stride,
- uint32_t format)
+CicoSCWlWinMgrIF::wlIviCtrlSurfaceCB(void *data,
+ struct ivi_controller *ivi_controller,
+ uint32_t id_surface)
{
-// ICO_TRA("CicoSCWlWinMgrIF::wlMapSurfaceCB Enter");
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlSurfaceCB: Enter(%x)", id_surface);
if (NULL == data) {
- ICO_WRN("wlMapSurfaceCB: data is null");
+ ICO_WRN("CicoSCWlWinMgrIF::wlIviCtrlSurfaceCB: data is null");
return;
}
- static_cast<CicoSCWlWinMgrIF*>(data)->mapSurfaceCB(data, ico_window_mgr,
- event, surfaceid,
- type, target,
- width, height,
- stride, format);
-// ICO_TRA("CicoSCWlWinMgrIF::wlMapSurfaceCB Leave");
+
+ static_cast<CicoSCWlWinMgrIF*>(data)->createSurfaceCB(data, ivi_controller, id_surface);
+
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlSurfaceCB: Leave");
}
//--------------------------------------------------------------------------
/**
- * @brief wayland display attribute callback
+ * @brief wayland ivi-shell ivi-controller protocol error callback
*
* @param [in] data user data(unused)
- * @param [in] wl_output wayland wl_output interface
- * @param [in] x display upper-left X coordinate
- * @param [in] y display upper-left Y coordinate
- * @param [in] physical_width display physical width
- * @param [in] physical_height display physical height
- * @param [in] subpixel display sub pixel
- * @param [in] make display maker
- * @param [in] model display model
- * @param [in] transform transform
+ * @param [in] ivi_controller wayland ivi-controller interface
+ * @param [in] error_code error code
+ * @param [in] error_text error message
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::wlOutputGeometryCB(void *data,
- struct wl_output *wl_output,
- int32_t x,
- int32_t y,
- int32_t physical_width,
- int32_t physical_height,
- int32_t subpixel,
- const char *make,
- const char *model,
- int32_t transform)
+CicoSCWlWinMgrIF::wlIviCtrlErrorCB(void *data,
+ struct ivi_controller *ivi_controller,
+ int32_t object_id, int32_t object_type,
+ int32_t error_code, const char *error_text)
{
-// ICO_TRA("CicoSCWlWinMgrIF::wlOutputGeometryCB Enter");
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlErrorCB: Enter(%d[%d],%d,<%s>)",
+ object_id, object_type, error_code, error_text ? error_text : "(null)");
if (NULL == data) {
- ICO_WRN("wlOutputGeometryCB: data is null");
+ ICO_WRN("CicoSCWlWinMgrIF::wlIviCtrlErrorCB: data is null");
return;
}
- static_cast<CicoSCWlWinMgrIF*>(data)->outputGeometryCB(data, wl_output,
- x, y,
- physical_width,
- physical_height,
- subpixel,
- make,
- model,
- transform);
-// ICO_TRA("CicoSCWlWinMgrIF::wlOutputGeometryCB Leave");
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlErrorCB: Leave");
}
//--------------------------------------------------------------------------
/**
- * @brief wayland display mode callback
+ * @brief wayland ivi-shell ivi-controller protocol error callback
*
- * @param [in] data user data(unused)
- * @param [in] wl_output wayland wl_output interface
- * @param [in] flags flags
- * @param [in] width display width
- * @param [in] height display height
- * @param [in] refresh display refresh rate
+ * @param [in] data user data(unused)
+ * @param [in] ivi_controller wayland ivi-controller interface
+ * @param [in] error_code error code
+ * @param [in] error_text error message
*/
//--------------------------------------------------------------------------
void
-CicoSCWlWinMgrIF::wlOutputModeCB(void *data,
- struct wl_output *wl_output,
- uint32_t flags,
- int32_t width,
- int32_t height,
- int32_t refresh)
+CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB(void *data,
+ struct ivi_controller *ivi_controller,
+ struct wl_surface *surface)
{
-// ICO_TRA("CicoSCWlWinMgrIF::wlOutputModeCB Enter");
+ uint32_t id_surface;
+ struct creation_surface_wait *tp;
+
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: Enter(surface=%08x)", (int)surface);
if (NULL == data) {
- ICO_WRN("wlOutputGeometryCB: data is null");
+ ICO_WRN("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: data is null");
return;
}
- static_cast<CicoSCWlWinMgrIF*>(data)->outputModeCB(data, wl_output, flags,
- width, height, refresh);
-// ICO_TRA("CicoSCWlWinMgrIF::wlOutputModeCB Leave");
+
+ // check same surface
+ tp = m_wait_surface_creation;
+ while (tp) {
+ if (tp->surface == surface) {
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: Leave(same surface)");
+ return;
+ }
+ tp = tp->next;
+ }
+
+ // create ivi-surface and bind to wl_surface
+ m_id_surface ++;
+ if (m_id_surface >= 0x00ffffff) m_id_surface = 1;
+ id_surface = m_id_surface | 0x40000000;
+
+ if (ivi_application_surface_create(m_ivi_app, id_surface, surface) == NULL) {
+ ICO_ERR("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: "
+ "ivi_application_surface_create(%x) Error", id_surface);
+ if (m_wait_surface_creation) {
+ tp = m_wait_surface_creation;
+ m_wait_surface_creation = tp->next;
+ tp->next = m_free_surface_creation;
+ m_free_surface_creation = tp;
+ }
+ }
+ else {
+ tp = m_wait_surface_creation;
+ while (tp) {
+ if (tp->id_surface == 0) {
+ tp->id_surface = id_surface;
+ tp->surface = surface;
+ break;
+ }
+ tp = tp->next;
+ }
+ if (! tp) {
+ ICO_ERR("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: waiting surface dose not exist");
+ }
+ }
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: Leave(id_surface=%08x)", id_surface);
}
// vim:set expandtab ts=4 sw=4:
/*
- * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
+ * Copyright (c) 2013-2014, TOYOTA MOTOR CORPORATION.
*
* This program is licensed under the terms and conditions of the
* Apache License, version 2.0. The full text of the Apache License is at
#define __CICO_SC_WL_WINMGR_IF_H__
#include <wayland-client.h>
+#include <ilm_client.h>
+#include <ilm_control.h>
#include <ico_window_mgr-client-protocol.h>
+#include <ivi-controller-client-protocol.h>
+#include <ivi-application-client-protocol.h>
+#include "ico_syc_type.h"
#include "CicoSCWaylandIF.h"
+#include "CicoSCWindow.h"
//--------------------------------------------------------------------------
/**
* @brief This class is wayland interface of multi window manager
*/
//--------------------------------------------------------------------------
+struct creation_surface_wait {
+ struct creation_surface_wait *next;
+ int32_t pid;
+ uint32_t id_surface;
+ struct wl_surface *surface;
+ uint32_t create_time;
+ char title[ICO_SYC_MAX_WINNAME_LEN];
+};
+
class CicoSCWlWinMgrIF : public CicoSCWaylandIF {
public:
virtual void initInterface(void *data,
const char *interface,
uint32_t version);
- virtual void createdCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- const char *winname,
- int32_t pid,
- const char *appid,
- int32_t layertype);
-
- virtual void nameCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- const char *winname);
-
- virtual void destroyedCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid);
-
- virtual void visibleCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- int32_t visible,
- int32_t raise,
- int32_t hint);
-
- virtual void configureCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- uint32_t node,
- int32_t layertype,
- uint32_t layer,
- int32_t x,
- int32_t y,
- int32_t width,
- int32_t height,
- int32_t hint);
-
virtual void activeCB(void *data,
struct ico_window_mgr *ico_window_mgr,
uint32_t surfaceid,
- int32_t active);
-
- virtual void layerVisibleCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t layer,
- int32_t visible);
-
- virtual void appSurfacesCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- const char *appid,
- int32_t pid,
- struct wl_array *surfaces);
+ int32_t select);
virtual void mapSurfaceCB(void *data,
struct ico_window_mgr *ico_window_mgr,
int32_t event,
uint32_t surfaceid,
uint32_t type,
- uint32_t target,
int32_t width,
int32_t height,
int32_t stride,
const char *model,
int32_t transform);
- virtual void outputModeCB(void *data,
- struct wl_output *wl_output,
- uint32_t flags,
- int32_t width,
- int32_t height,
- int32_t refresh);
+ virtual void outputModeCB(void *data,
+ struct wl_output *wl_output,
+ uint32_t flags,
+ int32_t width,
+ int32_t height,
+ int32_t refresh);
+
+ virtual void createSurfaceCB(void *data,
+ struct ivi_controller *ivi_controller,
+ uint32_t id_surface);
+
+ static void wlIviCtrlRemoveSurface(uint32_t id_surface);
protected:
// default constructor
// copy constructor
CicoSCWlWinMgrIF(const CicoSCWlWinMgrIF &object);
- // wrapper function ico_window_mgr_declare_manager
- void declareManager(int32_t manager);
-
// wrapper function ico_window_mgr_set_window_layer
- void setWindowLayer(uint32_t surfaceid, uint32_t layer);
+ void setWindowLayer(uint32_t surfaceid, uint32_t layer, uint32_t oldlayer);
// wrapper function ico_window_mgr_set_positionsize
void setPositionsize(uint32_t surfaceid, uint32_t node,
void setVisible(uint32_t surfaceid, int32_t visible,
int32_t raise, int32_t flags);
- // wrapper function ico_window_mgr_visible_animation
- void visibleAnimation(uint32_t surfaceid, int32_t visible,
- int32_t x, int32_t y,
- int32_t width, int32_t height);
-
// wrapper function of ico_window_mgr_set_animation
void setAnimation(uint32_t surfaceid, int32_t type,
const char *animation, int32_t time);
- // wrapper function of ico_window_mgr_set_attributes
- void setAttributes(uint32_t surfaceid, uint32_t attributes);
-
// wrapper function of ico_window_mgr_set_active
void setActive(uint32_t surfaceid, int32_t active);
// wrapper function of ico_window_mgr_set_layer_visible
void setLayerVisible(uint32_t layer, int32_t visible);
- // wrapper function of ico_window_mgr_get_surfaces
- void getSurfaces(const char *appid, int32_t pid);
-
- // wrapper function of ico_window_mgr_set_map_buffer
- void setmapBuffer(const char *shmname, int bufsize, int bufnum);
+ // wrapper function of ilm_takeSurfaceScreenshot
+ void setmapGet(int surfaceid, const char *filepath);
// wrapper function of ico_window_mgr_map_surface
- void mapSurface(uint32_t surfaceid, int32_t framerate);
+ void mapSurface(uint32_t surfaceid, int32_t framerate, const char *filepath);
// wrapper function of ico_window_mgr_unmap_surface
void unmapSurface(uint32_t surfaceid);
+ static const char *wlIviCtrlGetSurfaceWaiting(uint32_t id_surface, int *pid);
+
private:
// ico_window_mgr(Multi Window Manager) callback functions
- static void wlCreatedCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- const char *winname,
- int32_t pid,
- const char *appid,
- int32_t layertype);
-
- static void wlNameCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- const char *winname);
-
- static void wlDestroyedCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid);
-
- static void wlVisibleCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- int32_t visible,
- int32_t raise,
- int32_t hint);
-
- static void wlConfigureCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t surfaceid,
- uint32_t node,
- int32_t layertype,
- uint32_t layer,
- int32_t x,
- int32_t y,
- int32_t width,
- int32_t height,
- int32_t hint);
-
static void wlActiveCB(void *data,
struct ico_window_mgr *ico_window_mgr,
uint32_t surfaceid,
int32_t active);
- static void wlLayerVisibleCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- uint32_t layer,
- int32_t visible);
-
- static void wlAppSurfacesCB(void *data,
- struct ico_window_mgr *ico_window_mgr,
- const char *appid,
- int32_t pid,
- struct wl_array *surfaces);
-
static void wlMapSurfaceCB(void *data,
struct ico_window_mgr *ico_window_mgr,
int32_t event,
uint32_t surfaceid,
uint32_t type,
- uint32_t target,
int32_t width,
int32_t height,
int32_t stride,
int32_t height,
int32_t refresh);
+ static void wlIviAppErrorCB(void *data,
+ struct ivi_application *ivi_application,
+ int32_t error_code,
+ const char *error_text);
+
+ static void wlIviAppNativeShellInfoCB(void *data,
+ struct ivi_application *ivi_application,
+ int32_t pid,
+ const char *title);
+ static void wlIviCtrlScreenCB(void *data,
+ struct ivi_controller *ivi_controller,
+ uint32_t id_screen,
+ struct ivi_controller_screen *screen);
+
+ static void wlIviCtrlLayerCB(void *data,
+ struct ivi_controller *ivi_controller,
+ uint32_t id_layer);
+
+ static void wlIviCtrlSurfaceCB(void *data,
+ struct ivi_controller *ivi_controller,
+ uint32_t id_surface);
+
+ static void wlIviCtrlErrorCB(void *data,
+ struct ivi_controller *ivi_controller,
+ int32_t object_id,
+ int32_t object_type,
+ int32_t error_code,
+ const char *error_text);
+
+ static void wlIviCtrlNativeHandleCB(void *data,
+ struct ivi_controller *ivi_controller,
+ struct wl_surface *surface);
+
protected:
// ico_window_mgr listener
struct ico_window_mgr_listener m_listener;
// wayland output listener
struct wl_output_listener m_wlOutputListener;
+ // genivi ivi-application listener
+ struct ivi_application_listener m_ivi_app_listener;
+
+ // genivi ivi-controller listener
+ struct ivi_controller_listener m_ivi_ctrl_listener;
+
// Wayland's Window Manager PlugIn instance
- struct ico_window_mgr *m_winmgr;
+ static struct ico_window_mgr *m_winmgr;
+
+ // Wayland's genivi ivi_application instance
+ static struct ivi_application *m_ivi_app;
+
+ // Wayland's genivi ivi_controller instance
+ static struct ivi_controller *m_ivi_ctrl;
// wayland output instance
- struct wl_output *m_wloutput;
+ static struct wl_output *m_wloutput;
+
+ // surface id for wayland/weston applications
+ static int m_id_surface;
+ // creation surface title name
+ static struct creation_surface_wait *m_wait_surface_creation;
+ static struct creation_surface_wait *m_free_surface_creation;
};
#endif // __CICO_SC_WL_WINMGR_IF_H__
// vim:set expandtab ts=4 sw=4:
@MURPHYRESOURCE_CFLAGS@ \
@EDBUS_CFLAGS@ \
$(UWS_CFLAGS) \
+ $(GENIVI_CFLAGS) \
$(WESTONPLUGIN_CFLAGS) \
-I../../include \
-I../common \
@MURPHYRESOURCE_LIBS@ \
@EDBUS_LIBS@ \
$(UWS_LIBS) \
+ $(GENIVI_LIBS) \
$(WESTONPLUGIN_LIBS)
AM_LDFLAGS = -module -avoid-version -rpath $(libdir)
Name: ico-uxf-homescreen
Summary: Sample homescreen and system controller
-Version: 0.9.14
+Version: 0.9.21
Release: 1.1
Group: Graphics & UI Framework/Automotive UI
License: Apache-2.0
URL: ""
Source0: %{name}-%{version}.tar.bz2
-BuildRequires: pkgconfig(wayland-client) >= 1.2
-BuildRequires: ico-uxf-weston-plugin-devel >= 0.9.09
+BuildRequires: pkgconfig(wayland-client) >= 1.4
+BuildRequires: ico-uxf-weston-plugin-devel >= 0.9.21
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(ecore-wayland)
BuildRequires: pkgconfig(notification)
BuildRequires: boost-devel
BuildRequires: mesa-devel
-BuildRequires: ico-uxf-utilities-devel >= 0.9.06
-Requires: weston >= 1.2
-Requires: ico-uxf-weston-plugin >= 0.9.09
-Requires: ico-uxf-utilities >= 0.9.06
+BuildRequires: genivi-shell
+BuildRequires: ico-uxf-utilities-devel >= 0.9.07
+Requires: weston >= 1.4
+Requires: genivi-shell
+Requires: ico-uxf-weston-plugin >= 0.9.21
+Requires: ico-uxf-utilities >= 0.9.07
%description
Sample homescreen application and system controller daemon
TerminateApp(it->m_appid);
break;
case MSG_CMD_WIN_CHANGE:
-# if 0
- while( it != opt->arg.end() ) {
- if ((it->m_appid).empty() == true) {
- ret = GetAppId(it->m_pid, it->m_appid);
- if (ret != 0) {
- ++it;
- continue;
- }
- }
- // change application window
- WinChangeApp(it->m_appid, it->m_zone, it->m_visible);
- ++it;
- }
-#else
WinChgControl(opt->arg);
-#endif
-
break;
default:
ICO_WRN("Unknown Command(0x%08X)", cmd->cmdid);
ICO_TRA("aul items not find");
return -1;
}
- appid = aul->m_appid;
+ appid = aul->m_appid;
return 0;
ICO_TRA("CicoHSAppControl::GetAppId Leave");
{
ICO_DBG("start %s", appid);
if (true == m_waitSelApp.empty()) {
-#if 1
moveHistoryHead(appid);
-#endif
ICO_DBG("end current none");
return;
}
return;
}
ICO_DBG("end no match select app(%s)", m_waitSelApp.c_str());
-#if 1
if (true == moveHistoryHead(appid)) {
m_waitSelApp.clear();
}
-#endif
return;
}
}
/**
- * @breief update appid
+ * @breief update appid
* @param pid
* @param appid update appid store string
* @param aulstt value is AUL_R_OK then no update
void CicoHSAppHistoryExt::update_appid()
{
ICO_DBG("start");
-#if 0
- list<string>::iterator his_appid = m_appHistoryList.begin();
- while (his_appid != m_appHistoryList.end()) {
- string appid = *his_appid;
- if (true == update_pairPidAppid(appid)) {
- *his_appid = appid;
- }
- ++his_appid;
- }
-#else
vector<pairPidAppid>::iterator itV = m_vppa.begin();
vector<int>::iterator itAS = m_aulstt.begin();
while (itV != m_vppa.end()) {
++itV;
++itAS;
}
-#endif
ICO_DBG("end");
}
m_vpbpa.push_back(pairBoolPidAppid(false, pairPidAppid(pid, appid)));
if (true == d) {
m_subDispApp = appid;
- }
+ }
else {
m_lastStartupApp = appid;
}
/// destructor
virtual ~CicoHSCmdAppCtlOpt() {}
-#if 0
+#if 0 /* for debug */
/// dump log this class member variables
void dump(void)
{
void dump(void);
// get arg
- bool getArg(const boost::property_tree:: ptree& pt, std::vector<CicoHSCommandArg>& vArg);
+ bool getArg(const boost::property_tree:: ptree& pt, std::vector<CicoHSCommandArg>& vArg);
// get arg array
bool getArgArray(const boost::property_tree:: ptree& pt, std::vector<CicoHSCommandArg>& vArg);
public:
unsigned long cmdid; //!< id of command
std::string appid; //!< id of application
- int pid; //!< id of pid
- int seq_no; //!< id of sequence number
+ int pid; //!< id of pid
+ int seq_no; //!< id of sequence number
CicoHSCommandOption *opt; //!< command option instance
};
#endif // __CICO_HS_COMMAND_H__
#include <ico_window_mgr.h>
/*============================================================================*/
-/* static members */
-/*============================================================================*/
-static int _CicoHSMenuTile_initialized = 0;
-struct _CicoHSMenuTile_glfunc CicoHSMenuTile::glfunc;
-char *CicoHSMenuTile::thumbmapbuffer = NULL;
-
-static void SetYinvert(Evas_Object *obj);
-
-/*============================================================================*/
/* functions */
/*============================================================================*/
/*--------------------------------------------------------------------------*/
int page, int subpage,
int position, int width, int height)
{
- int shmfd;
-
ICO_TRA("CicoHSMenuTile::CicoHSMenuTile Enter");
- if (_CicoHSMenuTile_initialized == 0) {
- // Initialize and setting OpenGL/EGL functions
- ICO_DBG("CicoHSMenuTile::CicoHSMenuTile: initialize OpenGL/EGL functions");
- _CicoHSMenuTile_initialized = 1;
-
- CicoHSMenuTile::glfunc.egl_display
- = eglGetDisplay((EGLNativeDisplayType)ecore_wl_display_get());
- if (CicoHSMenuTile::glfunc.egl_display) {
- CicoHSMenuTile::glfunc.create_image
- = (PFNEGLCREATEIMAGEKHRPROC)eglGetProcAddress("eglCreateImageKHR");
- CicoHSMenuTile::glfunc.image_target_texture_2d
- = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)
- eglGetProcAddress("glEGLImageTargetTexture2DOES");
- CicoHSMenuTile::glfunc.destroy_image
- = (PFNEGLDESTROYIMAGEKHRPROC)eglGetProcAddress("eglDestroyImageKHR");
- if ((! CicoHSMenuTile::glfunc.create_image) ||
- (! CicoHSMenuTile::glfunc.image_target_texture_2d) ||
- (! CicoHSMenuTile::glfunc.destroy_image)) {
- ICO_WRN("CicoHSMenuTile::CicoHSMenuTile: can not get EGL functions");
- _CicoHSMenuTile_initialized = 2;
- }
- }
- else {
- _CicoHSMenuTile_initialized = 2;
- ICO_WRN("CicoHSMenuTile::CicoHSMenuTile: can not initialize OpenGL/EGL");
- }
-
- // create shared memory buffer for non EGL surface
- CicoHSMenuTile::thumbmapbuffer = NULL;
- shmfd = shm_open(ICO_HS_SHMBUFFER_NAME, O_RDWR|O_CREAT, 0600);
- if (shmfd == -1) {
- ICO_ERR("CicoHSMenuTile::CicoHSMenuTile: can not open shared memory buffer");
- _CicoHSMenuTile_initialized = -2;
- }
- else {
- if (ftruncate(shmfd, ICO_HS_SHMBUFFER_SIZE * ICO_HS_SHMBUFFER_NUM) == -1) {
- ICO_ERR("CicoHSMenuTile::CicoHSMenuTile: can not truncate shared memory buffer");
- _CicoHSMenuTile_initialized = -2;
- }
- else {
- CicoHSMenuTile::thumbmapbuffer = (char *)
- mmap(NULL, ICO_HS_SHMBUFFER_SIZE * ICO_HS_SHMBUFFER_NUM,
- PROT_READ|PROT_WRITE, MAP_SHARED, shmfd, 0);
- if (CicoHSMenuTile::thumbmapbuffer == NULL) {
- ICO_ERR("CicoHSMenuTile::CicoHSMenuTile: can not map shared memory buffer");
- _CicoHSMenuTile_initialized = -2;
- }
- else {
- memset(CicoHSMenuTile::thumbmapbuffer, 0,
- ICO_HS_SHMBUFFER_SIZE * ICO_HS_SHMBUFFER_NUM);
- ico_syc_map_buffer(ICO_HS_SHMBUFFER_NAME,
- ICO_HS_SHMBUFFER_SIZE, ICO_HS_SHMBUFFER_NUM);
- }
- }
- close(shmfd);
- if (CicoHSMenuTile::thumbmapbuffer == NULL) {
- shm_unlink(ICO_HS_SHMBUFFER_NAME);
- }
- }
- }
if (appid != NULL) {
strncpy(this->appid, appid, ICO_HS_MAX_PROCESS_NAME);
appid, this->icon_image_path);
thumb.surface = 0;
thumb.fbcount = 0;
- thumb.name = 0;
- thumb.image = NULL;
- thumb.texture = 0;
thumb.pixel_data = NULL;
this->page = page;
this->subpage = subpage;
this->height = height;
pos_x = GetPositionX();
pos_y = GetPositionY();
+
+ (void) mkdir(ICO_HS_THUMB_ICODIR, 0755);
+ (void) mkdir(ICO_HS_THUMB_ICODIR ICO_HS_THUMB_FILEDIR, 0755);
+
ICO_TRA("CicoHSMenuTile::CicoHSMenuTile Leave");
}
void
CicoHSMenuTile::FreeObject(void)
{
+ char sWork[80];
+
ICO_DBG("CicoHSMenuTile::FreeObject(appid=%08x<%s>)", (int)this->appid, appid);
if (thumb.surface) {
+ sprintf(sWork, "%s/%08x.pixel", ICO_HS_THUMB_ICODIR ICO_HS_THUMB_FILEDIR,
+ thumb.surface);
+ (void) unlink(sWork);
ico_syc_unmap_thumb(thumb.surface);
thumb.surface = 0;
}
- if (thumb.image) {
- CicoHSMenuTile::glfunc.destroy_image(
- CicoHSMenuTile::glfunc.egl_display, thumb.image);
- thumb.image = NULL;
- }
- if (thumb.texture) {
- glDeleteTextures(1, &thumb.texture);
- thumb.texture = 0;
- }
if (tile != NULL){
evas_object_del(tile);
tile = NULL;
void
CicoHSMenuTile::ValidThumbnail(int surface)
{
+ char sWork[80];
+
ICO_DBG("CicoHSMenuTile::ValidThumbnail(appid=%08x<%s>) run=%d surf=%08x",
(int)this->appid, appid, app_running, surface);
if ((! app_running) || (surface == 0)) {
if (thumb.surface != 0) {
+ sprintf(sWork, "%s/%08x.pixel", ICO_HS_THUMB_ICODIR ICO_HS_THUMB_FILEDIR,
+ thumb.surface);
+ (void) unlink(sWork);
ico_syc_unmap_thumb(thumb.surface);
// delete image and texture
if ((surface == 0) && (thumb.pixel_data)) {
free(thumb.pixel_data);
thumb.pixel_data = NULL;
}
- if (thumb.image) {
- CicoHSMenuTile::glfunc.destroy_image(
- CicoHSMenuTile::glfunc.egl_display, thumb.image);
- thumb.image = NULL;
- }
- if (thumb.texture) {
- glDeleteTextures(1, &thumb.texture);
- thumb.texture = 0;
- }
}
thumb.surface = surface;
if (surface) {
app_running = true;
- ico_syc_map_thumb(thumb.surface, menu_show ? ICO_HS_MENUTILE_THUMBNAIL_FPS_SHOW :
- ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE);
+ sprintf(sWork, "%s/%08x.pixel", ICO_HS_THUMB_ICODIR ICO_HS_THUMB_FILEDIR,
+ thumb.surface);
+ (void) unlink(sWork);
+ ico_syc_map_thumb(thumb.surface,
+ menu_show ? ICO_HS_MENUTILE_THUMBNAIL_FPS_SHOW :
+ ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE, sWork);
if (! small_icon) {
small_icon = evas_object_image_filled_add(menu_evas);
evas_object_image_file_set(small_icon, icon_image_path, NULL);
void
CicoHSMenuTile::SetThumbnail(ico_syc_thumb_info_t *info)
{
- EGLint attribs[9];
Evas_Object *old_icon = icon;
struct ico_uifw_image_buffer *pixelbuf = NULL;
- Evas_Native_Surface nsurf;
int svx, svy;
int unmap;
+ int fd;
+ char sWork[80];
ICO_DBG("CicoHSMenuTile::SetThumbnail(appid=%08x<%s>) info=%08x surf=%08x",
(int)this->appid, appid, (int)info, info ? info->surface : 0);
- if ((info == NULL) || (info->surface == 0) || (info->name == 0)) {
+ if ((info == NULL) || (info->surface == 0)) {
unmap = 1;
}
else {
ICO_DBG("CicoHSMenuTile::SetThumbnail: surface change(%08x->%08x)",
thumb.surface, info->surface);
ico_syc_unmap_thumb(thumb.surface);
+ sprintf(sWork, "%s/%08x.pixel", ICO_HS_THUMB_ICODIR ICO_HS_THUMB_FILEDIR,
+ thumb.surface);
+ (void) unlink(sWork);
}
thumb.surface = info->surface;
+ sprintf(sWork, "%s/%08x.pixel", ICO_HS_THUMB_ICODIR ICO_HS_THUMB_FILEDIR,
+ thumb.surface);
+ (void) unlink(sWork);
ico_syc_map_thumb(thumb.surface,
menu_show ? ICO_HS_MENUTILE_THUMBNAIL_FPS_SHOW :
- ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE);
+ ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE, sWork);
+ }
+ else {
+ sprintf(sWork, "%s/%08x.pixel", ICO_HS_THUMB_ICODIR ICO_HS_THUMB_FILEDIR,
+ thumb.surface);
}
thumb.type = info->type;
- thumb.name = info->name;
thumb.width = info->width;
thumb.height = info->height;
thumb.stride = info->stride;
thumb.format = info->format;
#if 0 /* too many log */
ICO_DBG("CicoHSMenuTile::SetThumbnail: make thumbnail %s(%08x) "
- "type=%d name=%d w/h/s=%d/%d/%d tile w/h=%d/%d",
- appid, thumb.surface, thumb.type, thumb.name,
+ "type=%d w/h/s=%d/%d/%d tile w/h=%d/%d",
+ appid, thumb.surface, thumb.type,
thumb.width, thumb.height, thumb.stride, width, height);
#endif
- // delete image and texture
- if (thumb.image) {
- CicoHSMenuTile::glfunc.destroy_image(
- CicoHSMenuTile::glfunc.egl_display, thumb.image);
- thumb.image = NULL;
- }
- if (thumb.texture) {
- glDeleteTextures(1, &thumb.texture);
- thumb.texture = 0;
- }
-
if ((info->width <= 1) || (info->height <= 1)) {
ICO_DBG("CicoHSMenuTile::SetThumbnail: small surface(%d,%d) skip",
info->width, info->height);
}
else {
- // create image and texture
- if (_CicoHSMenuTile_initialized > 0) {
- svx = thumb_reduce_x;
- svy = thumb_reduce_y;
- if (thumb.width > (thumb.height + 64)) {
- thumb_reduce_x = ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX;
- thumb_reduce_y = height / ICO_HS_MENUTILE_THUMBNAIL_REDUCE_RATE;
- }
- else if (thumb.width < (thumb.height - 64)) {
- thumb_reduce_y = ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX;
- thumb_reduce_x = width / ICO_HS_MENUTILE_THUMBNAIL_REDUCE_RATE;
- }
- else {
- thumb_reduce_x = ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX;
- thumb_reduce_y = ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX;
+ // create thumbnail image
+ svx = thumb_reduce_x;
+ svy = thumb_reduce_y;
+ if (thumb.width > (thumb.height + 64)) {
+ thumb_reduce_x = ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX;
+ thumb_reduce_y = height / ICO_HS_MENUTILE_THUMBNAIL_REDUCE_RATE;
+ }
+ else if (thumb.width < (thumb.height - 64)) {
+ thumb_reduce_y = ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX;
+ thumb_reduce_x = width / ICO_HS_MENUTILE_THUMBNAIL_REDUCE_RATE;
+ }
+ else {
+ thumb_reduce_x = ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX;
+ thumb_reduce_y = ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX;
+ }
+ if (! thumb_tile) {
+ thumb_tile = evas_object_image_filled_add(menu_evas);
+ evas_object_resize(thumb_tile, width - thumb_reduce_x * 2,
+ height - thumb_reduce_y * 2);
+ evas_object_move(thumb_tile, pos_x + thumb_reduce_x,
+ pos_y + thumb_reduce_y);
+ evas_object_event_callback_add(thumb_tile, EVAS_CALLBACK_MOUSE_DOWN,
+ CicoHSMenuTouch::TouchDownMenu, appid);
+ evas_object_event_callback_add(thumb_tile, EVAS_CALLBACK_MOUSE_UP,
+ CicoHSMenuTouch::TouchUpMenu, appid);
+ ICO_DBG("CicoHSMenuTile::SetThumbnail: create thumb_tile %s "
+ "tile=(%d+%d,%d+%d)", appid,
+ pos_x, thumb_reduce_x, pos_y, thumb_reduce_y);
+ if (small_icon) {
+ evas_object_move(small_icon,
+ pos_x + thumb_reduce_x
+ - ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2,
+ pos_y + height - thumb_reduce_y - height
+ / ICO_HS_MENUTILE_THUMBNAIL_REDUCTION
+ + ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2);
+ evas_object_raise(small_icon);
}
- if (! thumb_tile) {
- thumb_tile = evas_object_image_filled_add(menu_evas);
- evas_object_resize(thumb_tile, width - thumb_reduce_x * 2,
- height - thumb_reduce_y * 2);
- evas_object_move(thumb_tile, pos_x + thumb_reduce_x,
- pos_y + thumb_reduce_y);
- evas_object_event_callback_add(thumb_tile, EVAS_CALLBACK_MOUSE_DOWN,
- CicoHSMenuTouch::TouchDownMenu, appid);
- evas_object_event_callback_add(thumb_tile, EVAS_CALLBACK_MOUSE_UP,
- CicoHSMenuTouch::TouchUpMenu, appid);
- ICO_DBG("CicoHSMenuTile::SetThumbnail: create thumb_tile %s "
- "tile=(%d+%d,%d+%d)", appid,
- pos_x, thumb_reduce_x, pos_y, thumb_reduce_y);
- if (small_icon) {
- evas_object_move(small_icon,
- pos_x + thumb_reduce_x
- - ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2,
- pos_y + height - thumb_reduce_y - height
- / ICO_HS_MENUTILE_THUMBNAIL_REDUCTION
- + ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2);
- evas_object_raise(small_icon);
- }
- evas_object_raise(term_icon);
+ evas_object_raise(term_icon);
+ }
+ else if ((svx != thumb_reduce_x) || (svy != thumb_reduce_y)) {
+ evas_object_resize(thumb_tile, width - thumb_reduce_x * 2,
+ height - thumb_reduce_y * 2);
+ evas_object_move(thumb_tile, pos_x + thumb_reduce_x,
+ pos_y + thumb_reduce_y);
+ if (small_icon) {
+ evas_object_move(small_icon,
+ pos_x + thumb_reduce_x
+ - ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2,
+ pos_y + height - thumb_reduce_y - height
+ / ICO_HS_MENUTILE_THUMBNAIL_REDUCTION
+ + ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2);
}
- else if ((svx != thumb_reduce_x) || (svy != thumb_reduce_y)) {
- evas_object_resize(thumb_tile, width - thumb_reduce_x * 2,
- height - thumb_reduce_y * 2);
- evas_object_move(thumb_tile, pos_x + thumb_reduce_x,
- pos_y + thumb_reduce_y);
- if (small_icon) {
- evas_object_move(small_icon,
- pos_x + thumb_reduce_x
- - ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2,
- pos_y + height - thumb_reduce_y - height
- / ICO_HS_MENUTILE_THUMBNAIL_REDUCTION
- + ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2);
- }
+ }
+ /* read surface image pixel */
+ int bufsize = ((thumb.width * thumb.height * 4 + 4096 - 1) / 4096) * 4095;
+ if ((! thumb.pixel_data) || (bufsize > thumb.pixel_bufsize)) {
+ if (thumb.pixel_data) free(thumb.pixel_data);
+ thumb.pixel_data = (char *)malloc(bufsize);
+ thumb.pixel_bufsize = bufsize;
+ }
+ if (thumb.pixel_data) {
+ fd = open(sWork, O_RDONLY, 0644);
+ if ((fd < 0) ||
+ (read(fd, thumb.pixel_data, bufsize) <= 0)) {
+ ICO_ERR("CicoHSMenuTile::SetThumbnail: can not read pixel file(%s)", sWork);
+ unmap = 1;
}
- if (thumb.type == ICO_WINDOW_MGR_MAP_TYPE_EGL) {
- /* Intel GPU depend */
- attribs[0] = EGL_WIDTH;
- attribs[1] = thumb.width;
- attribs[2] = EGL_HEIGHT;
- attribs[3] = thumb.height;
- attribs[4] = EGL_DRM_BUFFER_FORMAT_MESA;
- attribs[5] = EGL_DRM_BUFFER_FORMAT_ARGB32_MESA; /* support only ARGB */
- attribs[6] = EGL_DRM_BUFFER_STRIDE_MESA;
- attribs[7] = thumb.stride / 4;
- attribs[8] = EGL_NONE;
-
- thumb.image = CicoHSMenuTile::glfunc.create_image(
- CicoHSMenuTile::glfunc.egl_display, EGL_NO_CONTEXT,
- EGL_DRM_BUFFER_MESA,
- (EGLClientBuffer)thumb.name, attribs);
- if (thumb.image) {
- icon = thumb_tile;
-#if 0 /* too many logs */
- ICO_DBG("CicoHSMenuTile::SetThumbnail: create image = %08x",
- (int)thumb.image);
-#endif
- /* create texture from image */
- thumb.texture = 0;
- glGenTextures(1, &thumb.texture);
- glBindTexture(GL_TEXTURE_2D, thumb.texture);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- CicoHSMenuTile::glfunc.image_target_texture_2d(
- GL_TEXTURE_2D, thumb.image);
-#if 0 /* too many logs */
- ICO_DBG("CicoHSMenuTile::SetThumbnail: create texture = %08x",
- (int)thumb.texture);
-#endif
- /* draw texture to screen */
- memset(&nsurf, 0, sizeof(nsurf));
- nsurf.version = EVAS_NATIVE_SURFACE_VERSION;
- nsurf.type = EVAS_NATIVE_SURFACE_OPENGL;
- nsurf.data.opengl.texture_id = thumb.texture;
-
- thumb.fbcount ++;
- if (thumb.fbcount <= 0) thumb.fbcount = 1;
- nsurf.data.opengl.framebuffer_id = thumb.fbcount;
-
- nsurf.data.opengl.internal_format = GL_BGRA_EXT;
- nsurf.data.opengl.format = GL_BGRA_EXT;
- nsurf.data.opengl.x = 0;
- nsurf.data.opengl.y = 0;
- nsurf.data.opengl.w = thumb.width;
- nsurf.data.opengl.h = thumb.height / 4;
-
- evas_object_image_native_surface_set(thumb_tile, &nsurf);
-
- // set Y invert to native OpenGL object (Evas bug fix)
- SetYinvert(thumb_tile);
-
- evas_object_image_data_update_add(thumb_tile,
- 0, 0, thumb.width, thumb.height);
- evas_object_image_size_set(thumb_tile, thumb.width, thumb.height);
- evas_object_resize(thumb_tile, width - thumb_reduce_x * 2,
- height - thumb_reduce_y * 2);
- evas_object_move(thumb_tile,
- pos_x + thumb_reduce_x, pos_y + thumb_reduce_y);
- }
- else {
- ICO_ERR("CicoHSMenuTile::SetThumbnail: can not create image");
- unmap = 1;
- }
+ if (fd >= 0) {
+ close(fd);
+ (void) unlink(sWork);
}
- else {
- if ((CicoHSMenuTile::thumbmapbuffer != NULL) &&
- (thumb.name <= ICO_HS_SHMBUFFER_NUM)) {
- /* glReadPixels image */
-#if 0 /* too many logs */
- ICO_DBG("CicoHSMenuTile::SetThumbnail: %s pixel(idx=%d) "
- "tile=(%d+%d,%d+%d)", appid, thumb.name,
- pos_x, thumb_reduce_x, pos_y, thumb_reduce_y);
-#endif
- pixelbuf = (struct ico_uifw_image_buffer *)
- ((char *)(CicoHSMenuTile::thumbmapbuffer) +
- ICO_HS_SHMBUFFER_SIZE * (thumb.name-1));
- if (! thumb.pixel_data) {
- thumb.pixel_data = (char *)
- malloc(ICO_HS_SHMBUFFER_SIZE - ICO_UIFW_IMAGE_HEADER_SIZE);
- }
- if (thumb.pixel_data) {
- int bufsize = thumb.width * thumb.height * 4;
- if (bufsize >
- (ICO_HS_SHMBUFFER_SIZE - ICO_UIFW_IMAGE_HEADER_SIZE)) {
- bufsize = ICO_HS_SHMBUFFER_SIZE - ICO_UIFW_IMAGE_HEADER_SIZE;
- }
- memcpy(thumb.pixel_data, pixelbuf->image, bufsize);
- evas_object_image_data_update_add(
+ if (unmap == 0) {
+ evas_object_image_data_update_add(
thumb_tile, 0, 0, thumb.width, thumb.height);
- icon = thumb_tile;
- evas_object_image_size_set(thumb_tile, thumb.width, thumb.height);
- evas_object_image_data_set(thumb_tile, thumb.pixel_data);
- evas_object_image_filled_set(thumb_tile, EINA_TRUE);
- evas_object_resize(thumb_tile, width - thumb_reduce_x * 2,
- height - thumb_reduce_y * 2);
- evas_object_move(thumb_tile,
- pos_x + thumb_reduce_x, pos_y + thumb_reduce_y);
- }
- else {
- ICO_ERR("CicoHSMenuTile::SetThumbnail: can not malloc pixel buffer");
- unmap = 1;
- }
- }
- else {
- ICO_ERR("CicoHSMenuTile::SetThumbnail: not pixel buffer");
- unmap = 1;
- }
+ icon = thumb_tile;
+ evas_object_image_size_set(thumb_tile, thumb.width, thumb.height);
+ evas_object_image_data_set(thumb_tile, thumb.pixel_data);
+ evas_object_image_filled_set(thumb_tile, EINA_TRUE);
+ evas_object_resize(thumb_tile, width - thumb_reduce_x * 2,
+ height - thumb_reduce_y * 2);
+ evas_object_move(thumb_tile,
+ pos_x + thumb_reduce_x, pos_y + thumb_reduce_y);
}
}
else {
- ICO_DBG("CicoHSMenuTile::SetThumbnail: OpenGL/EGL initialize error");
+ ICO_ERR("CicoHSMenuTile::SetThumbnail: can not malloc pixel buffer");
unmap = 1;
}
}
if (unmap > 0) {
ICO_DBG("CicoHSMenuTile::SetThumbnail: unmap thumbnail %08x", thumb.surface);
- if (thumb.pixel_data) {
- free(thumb.pixel_data);
- thumb.pixel_data = NULL;
- }
if (thumb.surface) {
+ sprintf(sWork, "%s/%08x.pixel", ICO_HS_THUMB_ICODIR ICO_HS_THUMB_FILEDIR,
+ thumb.surface);
+ (void) unlink(sWork);
ico_syc_unmap_thumb(thumb.surface);
- // delete image and texture
- if (thumb.image) {
- CicoHSMenuTile::glfunc.destroy_image(
- CicoHSMenuTile::glfunc.egl_display, thumb.image);
- thumb.image = NULL;
- }
- if (thumb.texture) {
- glDeleteTextures(1, &thumb.texture);
- thumb.texture = 0;
- }
thumb.surface = 0;
}
+ if (thumb.pixel_data) {
+ free(thumb.pixel_data);
+ thumb.pixel_data = NULL;
+ }
icon = tile;
}
void
CicoHSMenuTile::ShowMenu(bool show)
{
+ char sWork[80];
menu_show = show;
if ((thumb_tile) && (thumb.surface != 0)) {
+ sprintf(sWork, "%s/%08x.pixel", ICO_HS_THUMB_ICODIR ICO_HS_THUMB_FILEDIR,
+ thumb.surface);
+ (void) unlink(sWork);
ico_syc_map_thumb(thumb.surface,
menu_show ? ICO_HS_MENUTILE_THUMBNAIL_FPS_SHOW :
- ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE);
- }
-}
-
-/*--------------------------------------------------------------------------*/
-/**
- * @brief SetYinvert (static function)
-* set Y invert of OpenGL native object
- *
- * @param[in] obj target OpenGL native object
- * @return none
- */
-/*--------------------------------------------------------------------------*/
-static void
-SetYinvert(Evas_Object *obj)
-{
- // inport from evas-1.7.8/src/lib/canvas/evas_object_image.c _Evas_Object_Image
- struct local_Evas_Object_Image
- {
- uint32_t magic;
-
- struct {
- int spread;
- Evas_Coord_Rectangle fill;
- struct {
- short w, h, stride;
- } image;
- struct {
- short l, r, t, b;
- unsigned char fill;
- double scale;
- } border;
-
- Evas_Object *source;
- Evas_Map *defmap;
- const char *file;
- const char *key;
- int frame;
- Evas_Colorspace cspace;
-
- unsigned char smooth_scale : 1;
- unsigned char has_alpha :1;
- unsigned char opaque :1;
- unsigned char opaque_valid :1;
- } cur, prev;
-
- int pixels_checked_out;
- int load_error;
- Eina_List *pixel_updates;
-
- struct {
- unsigned char scale_down_by;
- double dpi;
- short w, h;
- struct {
- short x, y, w, h;
- } region;
- Eina_Bool orientation : 1;
- } load_opts;
-
- struct {
- Evas_Object_Image_Pixels_Get_Cb get_pixels;
- void *get_pixels_data;
- } func;
-
- Evas_Video_Surface video;
-#if 0 /* delete at evas-1.7.8-15.1 */
- unsigned int video_caps;
-#endif
- const char *tmpf;
- int tmpf_fd;
-
- Evas_Image_Scale_Hint scale_hint;
- Evas_Image_Content_Hint content_hint;
-
- void *engine_data;
-
- unsigned char changed : 1;
- unsigned char dirty_pixels : 1;
- unsigned char filled : 1;
- unsigned char proxyrendering : 1;
- unsigned char preloading : 1;
- unsigned char video_rendering : 1;
- unsigned char video_surface : 1;
- unsigned char video_visible : 1;
- unsigned char created : 1;
- unsigned char proxyerror : 1;
- };
-
- // inport from evas-1.7.8/src/lib/include/evas_common.h _RGBA_Image_Loadopts
- struct local_RGBA_Image_Loadopts
- {
- int scale_down_by; // if > 1 then use this
- double dpi; // if > 0.0 use this
- unsigned int w, h; // if > 0 use this
- unsigned int degree;//if>0 there is some info related with rotation
- struct {
- unsigned int x, y, w, h;
- } region;
-
- Eina_Bool orientation;
- };
- // inport from evas-1.7.8/src/modules/engines/gl_common/evas_gl_common.h _Evas_GL_Image
- struct local_Evas_GL_Image
- {
- void *gc;
- void *im;
- void *tex;
- struct local_RGBA_Image_Loadopts load_opts;
- int references;
- // if im->im == NULL, it's a render-surface so these here are used
- int w, h;
- struct {
- int space;
- void *data;
- unsigned char no_free : 1;
- } cs;
-
- struct {
- void *data;
- struct {
- void (*bind) (void *data, void *image);
- void (*unbind) (void *data, void *image);
- void (*free) (void *data, void *image);
- void *data;
- } func;
- int yinvert;
- int target;
- int mipmap;
- unsigned char loose : 1;
- } native;
-
- int scale_hint, content_hint;
- int csize;
-
- Eina_List *filtered;
-
- unsigned char dirty : 1;
- unsigned char cached : 1;
- unsigned char alpha : 1;
- unsigned char tex_only : 1;
- };
- // inport evas-1.7.8/src/lib/include/evas_private.h _Evas_Object
- struct local_Evas_Object
- {
- EINA_INLIST;
-
- uint32_t magic;
-
- const char *type;
- void *layer;
-
- struct {
- Evas_Map *map;
- Evas_Object *clipper;
- Evas_Object *mask;
- Evas_Object *map_parent;
- double scale;
- Evas_Coord_Rectangle geometry;
- Evas_Coord_Rectangle bounding_box;
- struct {
- struct {
- Evas_Coord x, y, w, h;
- unsigned char r, g, b, a;
- Eina_Bool visible : 1;
- Eina_Bool dirty : 1;
- } clip;
- } cache;
- short layer;
- struct {
- unsigned char r, g, b, a;
- } color;
- Eina_Bool usemap : 1;
- Eina_Bool valid_map : 1;
- Eina_Bool visible : 1;
- Eina_Bool have_clipees : 1;
- Eina_Bool anti_alias : 1;
- Evas_Render_Op render_op : 4;
-
- Eina_Bool valid_bounding_box : 1;
- Eina_Bool cached_surface : 1;
- Eina_Bool parent_cached_surface : 1;
- } cur, prev;
-
- struct {
- void *surface; // surface holding map if needed
- int surface_w, surface_h; // current surface w & h alloc
- } map;
-
- Evas_Map *cache_map;
- char *name;
-
- void *interceptors;
-
- struct {
- Eina_List *elements;
- } data;
-
- Eina_List *grabs;
-
- void *callbacks;
-
- struct {
- Eina_List *clipees;
- Eina_List *changes;
- } clip;
-
- void *func;
-
- void *object_data;
- struct {
- Evas_Smart *smart;
- Evas_Object *parent;
- } smart;
-
- struct {
- Eina_List *proxies;
- void *surface;
- int w,h;
- Eina_Bool redraw;
- } proxy;
-
- #if 0 // filtering disabled
- Evas_Filter_Info *filter;
- #endif
-
- void *size_hints;
-
- void *spans;
-
- int last_mouse_down_counter;
- int last_mouse_up_counter;
- int mouse_grabbed;
-
- int last_event;
- Evas_Callback_Type last_event_type;
-
- struct {
- int in_move, in_resize;
- } doing;
-
- /* ptr array + data blob holding all interfaces private data for
- * this object */
- void **interface_privates;
-
- unsigned int ref;
-
- unsigned char delete_me;
-
- unsigned char recalculate_cycle;
- Eina_Clist calc_entry;
-
- Evas_Object_Pointer_Mode pointer_mode : 2;
- Eina_Bool store : 1;
- Eina_Bool pass_events : 1;
- Eina_Bool freeze_events : 1;
- Eina_Bool repeat_events : 1;
- struct {
- Eina_Bool pass_events : 1;
- Eina_Bool pass_events_valid : 1;
- Eina_Bool freeze_events : 1;
- Eina_Bool freeze_events_valid : 1;
- } parent_cache;
- Eina_Bool restack : 1;
- Eina_Bool is_active : 1;
- Eina_Bool precise_is_inside : 1;
- Eina_Bool is_static_clip : 1;
-
- Eina_Bool render_pre : 1;
- Eina_Bool rect_del : 1;
- Eina_Bool mouse_in : 1;
- Eina_Bool pre_render_done : 1;
- Eina_Bool intercepted : 1;
- Eina_Bool focused : 1;
- Eina_Bool in_layer : 1;
- Eina_Bool no_propagate : 1;
- Eina_Bool changed : 1;
- Eina_Bool changed_move : 1;
- Eina_Bool changed_color : 1;
- Eina_Bool changed_map : 1;
- Eina_Bool changed_pchange : 1;
- Eina_Bool del_ref : 1;
-
- Eina_Bool is_frame : 1;
- Eina_Bool child_has_map : 1;
- };
-
- struct local_Evas_Object_Image *image_obj;
- struct local_Evas_GL_Image *im;
-
- image_obj = (struct local_Evas_Object_Image *)
- (((struct local_Evas_Object *)obj)->object_data);
-
- im = (struct local_Evas_GL_Image *)image_obj->engine_data;
-
- // Evas old version check and revise
- if (((int)im & 0xffff0000) == 0) {
- // Evas old version
- image_obj = (struct local_Evas_Object_Image *)(((int *)image_obj) + 1);
- im = (struct local_Evas_GL_Image *)image_obj->engine_data;
- }
- if (((int)im & 0xffff0000) != 0) {
- if (im->native.yinvert == 0)
- im->native.yinvert = 1;
+ ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE, sWork);
}
}
// vim: set expandtab ts=4 sw=4:
#include <Ecore_Evas.h>
#include <Edje.h>
-#include <EGL/egl.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-#include <EGL/eglext.h>
-
#include "ico_syc_common.h"
#include "ico_syc_winctl.h"
#include "ico_window_mgr.h"
#define ICO_HS_MENUTILE_THUMBNAIL_REDUCTION 4
/*shared memory buffer*/
-#define ICO_HS_SHMBUFFER_NAME "/HomeScreen_ShmBuffer"
-#define ICO_HS_SHMBUFFER_SIZE (1920*1080*4+ICO_UIFW_IMAGE_HEADER_SIZE)
-#define ICO_HS_SHMBUFFER_NUM (3)
-
-struct _CicoHSMenuTile_glfunc {
- EGLDisplay egl_display; // EGL display
- PFNEGLCREATEIMAGEKHRPROC create_image; // create image
- PFNGLEGLIMAGETARGETTEXTURE2DOESPROC image_target_texture_2d; // set image target
- PFNEGLDESTROYIMAGEKHRPROC destroy_image; // destroy image
-};
+#define ICO_HS_THUMB_ICODIR "/tmp/ico"
+#define ICO_HS_THUMB_FILEDIR "/thumbnail"
+
struct _CicoHSMenuTile_thumb {
int surface; // surface id
int type; // frame buffer type
- int name; // EGL buffer name
int width; // frame buffer width
int height; // frame buff height
int stride; // frame buffer stride
int format; // frame buffer format(only EGL_TEXTURE_RGBA)
int fbcount; // frame buffer change counter
- EGLImageKHR image; // frame buffer image
- GLuint texture; // texture id
char *pixel_data; // glReadPixels data buffer
+ int pixel_bufsize; // data buffer size
};
class CicoHSMenuTile
void ShowMenu(bool show);
private:
- static struct _CicoHSMenuTile_glfunc glfunc;
- static char *thumbmapbuffer;
-
char appid[ICO_HS_MAX_PROCESS_NAME];
char icon_image_path[ICO_HS_MAX_PATH_BUFF_LEN];
int page;
int CicoHSSwipeTouch::touch_state_b_y;
int CicoHSSwipeTouch::touch_state_a_x;
int CicoHSSwipeTouch::touch_state_a_y;
-int CicoHSSwipeTouch::touch_lasttime;
-Ecore_Timer *CicoHSSwipeTouch::timer;
int CicoHSSwipeTouch::touch_down;
-bool CicoHSSwipeTouch::long_act;
bool CicoHSSwipeTouch::set_xy_pos;
int CicoHSSwipeTouch::num_windows;
CicoHSSwipeTouch::Initialize(CicoHSControlBarWindow* ctl_bar, CicoHSAppHistoryExt* apphist,
int width, int height)
{
- timer = NULL;
num_windows = 0;
touch_down = 0;
- long_act = false;
set_xy_pos = false;
ctl_bar_window = ctl_bar;
app_history = apphist;
full_width = width;
full_height = height;
- touch_lasttime = 0;
ICO_DBG("Initialize: ctlbar=%08x apphist=%08x width=%d height=%d",
(int)ctl_bar, (int)apphist, width, height);
}
{
Evas_Event_Mouse_Down *info;
CicoHSSwipeInputWindow *window;
- struct timeval ctime;
int x, y;
- if (timer) {
- ecore_timer_del(timer);
- timer = NULL;
- }
touch_down ++;
info = reinterpret_cast<Evas_Event_Mouse_Down*>(event_info);
ICO_PRF("TOUCH_EVENT Swipe Down (%d,%d)->(%d,%d) (%d)",
info->output.x, info->output.y, x, y, touch_down);
- if (touch_down == 1) {
- gettimeofday(&ctime, NULL);
- touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
- long_act = false;
- timer = ecore_timer_add(ICO_HS_SWIPE_TOUCH_LONG_PUSH_THREASHOLD_TIME_SECONDS,
- LongPushed, NULL);
- }
if ((x >= 0) && (x < 4096) && (y >= 0) && (y < 4096)) {
if (set_xy_pos == false) {
set_xy_pos = true;
/*--------------------------------------------------------------------------*/
/**
- * @brief LongPushed::Touch timeout
- * touch down timeout called from ecore
- *
- * @param[in] data user data(unused)
- * @return fixed ECORE_CALLBACK_CANCEL
- */
-/*--------------------------------------------------------------------------*/
-Eina_Bool
-CicoHSSwipeTouch::LongPushed(void *data)
-{
- ICO_DBG("LongPushed: timedout");
-
- long_act = true;
- timer = NULL;
-
- if (touch_down > 0) {
- /* release my grab */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
- BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_RESET);
- touch_down = 0;
- }
- if (set_xy_pos == false) {
- ICO_DBG("LongPushed: unknown coordinate, Skip");
-
- long_act = false;
- return ECORE_CALLBACK_CANCEL;
- }
- ICO_DBG("LongPushed: Not Swipe, send Touch Down event to application");
-
- /* send touch down event to lower application */
- /* send ABS_X/Y */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
- ABS_Z, (touch_state_b_x << 16) | touch_state_b_y);
- /* send TOUCH Down */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
- BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_DOWN);
- /* send ABS_X/Y */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
- ABS_Z, ((touch_state_a_x) << 16) | (touch_state_a_y));
- set_xy_pos = false;
-
- return ECORE_CALLBACK_CANCEL;
-}
-
-/*--------------------------------------------------------------------------*/
-/**
* @brief CicoHSSwipeTouch::TouchUpSwipe
* touch up action at swipe input window
*
CicoHSAppInfo *appinfo;
ico_hs_window_info *wininfo;
ico_syc_animation_t animation;
- struct timeval ctime;
int sub;
int idx;
int swipe = 0;
return;
}
- if(timer != NULL){
- ecore_timer_del(timer);
- timer = NULL;
- }
-
- gettimeofday(&ctime, NULL);
- touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
-
if (touch_down == 0) {
- /* send ABS_X/Y */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
- ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
- /* send TOUCH Up */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
- BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_UP);
set_xy_pos = false;
- long_act = false;
ICO_DBG("TouchUpSwipe: no touch down, Skip");
return;
}
if (set_xy_pos == false) {
ICO_DBG("TouchUpSwipe: unknown coordinate, Skip");
-
- /* send touch release event */
- /* send ABS_X/Y */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
- ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
- /* send TOUCH Up */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
- BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_UP);
- long_act = false;
return;
}
set_xy_pos = false;
-
- /* long push */
- if(long_act == true) {
- ICO_DBG("TouchUpSwipe: not down(%d) or timedout(%d)", touch_down, long_act);
- set_xy_pos = false;
- touch_down = 0;
- long_act = false;
-
- /* send touch release event */
- /* send ABS_X/Y */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
- ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
- /* send TOUCH Up */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
- BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_UP);
- return;
- }
sub = touch_state_a_x - touch_state_b_x;
/* check slide left to right or right to left */
}
#endif
if (swipe <= 0) {
- /* send touch press event */
- ICO_DBG("TouchUpSwipe: Not Swipe, send event to application");
- /* send ABS_X/Y */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
- ABS_Z, (touch_state_b_x << 16) | touch_state_b_y);
- /* send TOUCH Down */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
- BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_DOWN);
- /* send ABS_X/Y */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
- ABS_Z, ((touch_state_b_x+1) << 16) | (touch_state_b_y+1));
-
- /* send touch release event */
- gettimeofday(&ctime, NULL);
- touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
-
- /* send ABS_X/Y */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
- ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
- /* send TOUCH Up */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
- BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_UP);
set_xy_pos = false;
}
}
{
Evas_Event_Mouse_Move *info;
CicoHSSwipeInputWindow *window;
- struct timeval ctime;
int x, y;
info = reinterpret_cast<Evas_Event_Mouse_Move*>(event_info);
ICO_DBG("TouchMoveSwipe: no TouchDown, Skip");
return;
}
-
- if (long_act == true) {
- ICO_DBG("TouchMoveSwipe: timedout");
-
- if(timer != NULL){
- ecore_timer_del(timer);
- timer = NULL;
- }
-
- /* send ABS_X/Y */
- gettimeofday(&ctime, NULL);
- touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
-
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
- ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
- long_act = false;
- return;
- }
-
- if (abs(touch_state_b_y - touch_state_a_y)
- > ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_MOVE_Y) {
- /* slide to top or buttom over threashold, swipe cancel */
- ICO_DBG("TouchMoveSwipe: over Y direction");
- if(timer != NULL){
- ecore_timer_del(timer);
- timer = NULL;
- }
- long_act = false;
-
- if (touch_down > 0) {
- /* release my grab */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
- BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_RESET);
- }
- /* send ABS_X/Y */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
- ABS_Z, (touch_state_b_x << 16) | touch_state_b_y);
- /* send TOUCH Down */
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
- BTN_TOUCH, ICO_INPUT_MGR_CONTROL_TOUCH_EVENT_DOWN);
- touch_down = 0;
- /* send ABS_X/Y */
- gettimeofday(&ctime, NULL);
- touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
- ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
- ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
- set_xy_pos = false;
- }
}
// vim: set expandtab ts=4 sw=4:
#include "CicoHSControlBarWindow.h"
#include "CicoHSAppHistoryExt.h"
-#define ICO_HS_SWIPE_TOUCH_SWIPE_WIDTH 80
-#define ICO_HS_SWIPE_TOUCH_SWIPE_HEIGHT 80
-#define ICO_HS_SWIPE_TOUCH_DISTANCE_XY 200
+#define ICO_HS_SWIPE_TOUCH_SWIPE_WIDTH 60
+#define ICO_HS_SWIPE_TOUCH_SWIPE_HEIGHT 60
+#define ICO_HS_SWIPE_TOUCH_DISTANCE_XY 100
#define ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_DISTANCE 80
#define ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_MOVE_Y 80
#define ICO_HS_SWIPE_TOUCH_LONG_PUSH_THREASHOLD_TIME_SECONDS 2.0d
static int touch_state_b_y;
static int touch_state_a_x;
static int touch_state_a_y;
- static int touch_lasttime;
- static Ecore_Timer *timer;
static int touch_down;
- static bool long_act;
static bool set_xy_pos;
static int num_windows;
static CicoHSSwipeInputWindow* swipe_windows[ICO_HS_MAX_SWIPEWINDOWS];
ico_syc_animation_t animation;
animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_FADE;
animation.time = ICO_HS_MENU_ANIMATION_DURATION;
-#if 0
- ico_syc_show(win_info->appid, win_info->surface, &animation);
-#else
const string& lastStartupApp = m_appHis->getLastStartupAppid();
if (true == lastStartupApp.empty()) {
ICO_DBG("show (empty) %s", win_info->appid);
}
else {
bool bShow = false;
-#if 0
- const string& subDispApp = m_appHis->getSubDispAppid();
-#endif
if (0 == lastStartupApp.compare(win_info->appid)) {
bShow = true;
}
-#if 0
- if (0 == subDispApp.compare(win_info->appid)) {
- bShow = true;
- }
-#endif
if (true == bShow) {
ICO_DBG("show (last) %s", win_info->appid);
ico_syc_show(win_info->appid, win_info->surface, &animation);
ico_syc_hide(win_info->appid, win_info->surface, &animation);
}
}
-#endif
ICO_TRA("CicoHomeScreen::ShowApplicationWindow Leave");
}
swipe_input_windows[0] = new CicoHSSwipeInputWindow();
swipe_input_windows[0]->
CreateSwipeInputWindow(ICO_HS_WINDOW_POS_X,
- ICO_HS_WINDOW_POS_Y + ICO_HS_SWIPE_TOUCH_DISTANCE_XY,
+ full_height / 2 + ICO_HS_SWIPE_TOUCH_DISTANCE_XY,
ICO_HS_SWIPE_TOUCH_SWIPE_WIDTH,
- full_height - (ICO_HS_SWIPE_TOUCH_DISTANCE_XY*2), "left");
+ full_height / 2 - (ICO_HS_SWIPE_TOUCH_DISTANCE_XY*2),
+ "left");
swipe_input_windows[0]->ShowWindow();
/* right side window */
swipe_input_windows[1] = new CicoHSSwipeInputWindow();
swipe_input_windows[1]->
CreateSwipeInputWindow(full_width - ICO_HS_SWIPE_TOUCH_SWIPE_WIDTH,
- ICO_HS_WINDOW_POS_Y + ICO_HS_SWIPE_TOUCH_DISTANCE_XY,
+ full_height / 2 + ICO_HS_SWIPE_TOUCH_DISTANCE_XY,
ICO_HS_SWIPE_TOUCH_SWIPE_WIDTH,
- full_height - (ICO_HS_SWIPE_TOUCH_DISTANCE_XY*2), "right");
+ full_height / 2 - (ICO_HS_SWIPE_TOUCH_DISTANCE_XY*2),
+ "right");
swipe_input_windows[1]->ShowWindow();
#if 0 /* currently not support(not fix specification) */
*/
/*--------------------------------------------------------------------------*/
static Eina_Bool launchApps(void* data)
-{
- ICO_DBG("start");
+{
+ ICO_DBG("start");
launcApps_data_t* x = (launcApps_data_t*) data;
if ((NULL == x) || (NULL == x->hs)) {
ICO_DBG("end fail");
return ECORE_CALLBACK_CANCEL;
}
-
+
vector<pairAppidSubd> apps;
x->hs->readStartupApp(apps);
-
+
int sz = apps.size();
for (int i =sz; i > 0; i--) {
string appid = apps[i-1].first;
* move app
*
* @param app appid
- * @param zone zone
+ * @param zone zone
*/
/*--------------------------------------------------------------------------*/
void
#include <ico_log.h>
#include <ico_window_mgr-client-protocol.h>
+#include "ico_syc_sysdef.h"
#define ICO_OK 0
#define ICO_ERROR -1
#define ICO_HS_CONFIG_HISTORY "app_history"
/*misc*/
-#define HS_DISPLAY_HOMESCREEN 0 /* HomeScreen target display Id */
+#define HS_DISPLAY_HOMESCREEN ICO_SYC_DISPLAY_CENTER /* HomeScreen target display Id */
/*Layer dicralation*/
-#define HS_LAYER_BACKGROUND 0 /* layer of BackGround */
-#define HS_LAYER_APPLICATION 1 /* layer of Application */
-#define HS_LAYER_METERAPP 2 /* layer of Meter Display Application */
-#define HS_LAYER_HOMESCREEN 3 /* layer of HomeScreen menu */
-#define HS_LAYER_CONTROLBAR 4 /* layer of Control/Status bar */
-#define HS_LAYER_FULLSCREEN 5 /* layer of FullScreen Application */
-#define HS_LAYER_ONSCREEN 6 /* layer of OnScreen */
-#define HS_LAYER_TOUCHPANEL ICO_WINDOW_MGR_LAYERTYPE_TOUCH
- /* layer of TouchPanel input */
-#define HS_LAYER_CURSOR ICO_WINDOW_MGR_LAYERTYPE_CURSOR
- /* layer of Cursor */
-
-#define HS_LAYER_2NDDISP_APP 3 // second display application layer
+#define HS_LAYER_BACKGROUND ICO_SYC_LAYER_BACKGROUND /* layer of BackGround */
+#define HS_LAYER_APPLICATION ICO_SYC_LAYER_APPLICATION /* layer of Application */
+#define HS_LAYER_HOMESCREEN ICO_SYC_LAYER_HOMESCREEN /* layer of HomeScreen menu */
+#define HS_LAYER_CONTROLBAR ICO_SYC_LAYER_CONTROLBAR /* layer of Control/Status bar */
+#define HS_LAYER_FULLSCREEN ICO_SYC_LAYER_FULLSCREEN /* layer of FullScreen Application */
+#define HS_LAYER_ONSCREEN ICO_SYC_LAYER_ONSCREEN /* layer of OnScreen */
+#define HS_LAYER_TOUCHPANEL ICO_SYC_LAYER_TOUCHPANEL /* layer of TouchPanel input */
+#define HS_LAYER_CURSOR ICO_SYC_LAYER_CURSOR /* layer of Cursor */
+
+#define HS_LAYER_2NDDISP_APP ICO_SYC_LAYER_MATERAPP /* second display application layer */
/* config history name */
#define ICO_HS_CONFIG_HSTRY_KEY1 "timer"
#ifndef HOME_SCREEN_RES_H
#define HOME_SCREEN_RES_H
-#if 0
-/* file_path */
-//#define default_path "./"
-#define edj_path "/usr/apps/%s/res/edj/"
-#define image_path "/usr/apps/%s/res/images/"
-#define sound_path "/usr/apps/%s/res/sounds/"
-#define manifest_path "/usr/apps/%s/res/config/"
-#define local_top_path "/home/tizen/HomeScreen"
-#define local_edj_path "%s/src/"
-#define local_image_path "%s/res/images/"
-#define local_sound_path "%s/res/sounds/"
-#define local_manifest_path "%s/res/apps/org.tizen.ico.homescreen/"
-#endif
-
#define fname_api_all_off "api_all_off.png"
#define fname_api_all_on "api_all_on.png"
#define fname_backboard "back_b_01.png"
-#define fname_back_bg "back_b_01.png"
+#define fname_back_bg "back_b_01.png"
/* file name (appli list) */
#define fname_api01_off "api_s_01_off.png"
--- /dev/null
+/*
+ * Copyright (c) 2014, TOYOTA MOTOR CORPORATION.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0. The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+/**
+ * @brief On Screen Popup Window
+ *
+ * @date Feb-17-2014
+ */
+#include <Ecore.h>
+#include <Ecore_Wayland.h>
+#include "CicoOnScreen.h"
+#include "CicoNotification.h"
+#include "CicoOSPopWindow.h"
+#include "ico_syc_type.h"
+#include "ico_syc_appresctl.h"
+
+using namespace std;
+
+//==========================================================================
+// static members
+//==========================================================================
+
+//==========================================================================
+// functions
+//==========================================================================
+
+//--------------------------------------------------------------------------
+/**
+ * @brief CicoOnScreen::CicoOnScreen
+ * Constractor
+ *
+ * @param[in] none
+ * @return none
+ */
+//--------------------------------------------------------------------------
+CicoOSPopWindow::CicoOSPopWindow(notification_type_e type) : CicoNotification(type)
+{
+ ICO_TRA("Enter type(%d)", (int)type);
+ m_window = NULL;
+ m_icon = NULL;
+ m_theme = NULL;
+ m_resourceId = 0;
+ m_context = NULL;
+ ICO_TRA("Leave");
+}
+
+CicoOSPopWindow::CicoOSPopWindow(notification_h noti) : CicoNotification(noti)
+{
+ ICO_TRA("Enter");
+ m_window = NULL;
+ m_icon = NULL;
+ m_theme = NULL;
+ m_resourceId = 0;
+ m_context = NULL;
+ ICO_TRA("Leave");
+}
+//--------------------------------------------------------------------------
+/**
+ * @brief CicoOnScreen::~CicoOnScreen
+ * Destractor
+ *
+ * @param[in] none
+ * @return none
+ */
+//--------------------------------------------------------------------------
+CicoOSPopWindow::~CicoOSPopWindow(void)
+{
+// ICO_TRA("Enter");
+ if (NULL != m_window) {
+ ecore_evas_free(m_window);
+ m_window = NULL;
+ }
+ // if (NULL != m_icon) /* import m_window */
+ m_icon = NULL;
+ // if (NULL != m_theme) /* import m_window */
+ m_theme = NULL;
+ if (NULL != m_context) {
+ int r = ico_syc_release_res(m_context);
+ ICO_DBG("_____ %d = ico_syc_release_res", r);
+ }
+
+// ICO_TRA("Leave");
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief CicoOnScreen::ShowPopup
+ * Show popup window
+ *
+ * @param[in] none
+ * @return none
+ */
+//--------------------------------------------------------------------------
+bool
+CicoOSPopWindow::showPopup()
+{
+ ICO_TRA("Enter");
+ if (NULL == m_window) {
+ if (false == InitializeWindow()) {
+ ICO_TRA("Leave false");
+ return false;
+ }
+ }
+ // get caller pachage name
+ const char *pkgname = GetPkgname();
+
+ // get priv_id
+ int priv_id = GetPrivId();
+
+ // Get title
+ const char *title = GetTitle();
+
+ // Get content
+ const char *content = GetContent();
+
+ // Get execute option
+ const char *text = NULL;
+ bundle *service_handle = NULL;
+ (void)GetExecuteOption(NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, &text,
+ &service_handle);
+
+ // Get icon path
+ const char *icon = GetIconPath();
+ ICO_DBG("Received: %s : %i : %s : %s : %s : %x",
+ pkgname, priv_id, title, content,
+ text, (int)service_handle);
+
+ if (icon) {
+ if (NULL != m_icon) {
+ evas_object_image_file_set(m_icon, icon, NULL);
+ evas_object_show(m_icon);
+ }
+ }
+
+ if (title) {
+ if (!edje_object_part_text_set(m_theme, "title_text", title)) {
+ ICO_WRN("could not set the text. Maybe part 'text' does not exist?");
+ }
+ }
+
+ if (content) {
+ if (strlen(content) <= 25) {
+ ICO_DBG("content text center");
+ if (!edje_object_part_text_set(m_theme, "content_text_center", content)) {
+ ICO_WRN("could not set the text. Maybe part 'text' does not exist?");
+ }
+ if (!edje_object_part_text_set(m_theme, "content_text_left", "")) {
+ ICO_WRN("could not set the text. Maybe part 'text' does not exist?");
+ }
+ }
+ else {
+ ICO_DBG("content text left");
+ if (!edje_object_part_text_set(m_theme, "content_text_left", content)) {
+ ICO_WRN("could not set the text. Maybe part 'text' does not exist?");
+ }
+ if (!edje_object_part_text_set(m_theme, "content_text_center", "")) {
+ ICO_WRN("could not set the text. Maybe part 'text' does not exist?");
+ }
+ }
+ }
+
+ if (text) {
+ if (!edje_object_part_text_set(m_theme, "button_text", text)) {
+ ICO_WRN("could not set the text. Maybe part 'text' does not exist?");
+ }
+ }
+ else {
+ if (!edje_object_part_text_set(m_theme, "button_text", "OK")) {
+ ICO_WRN("could not set the text. Maybe part 'text' does not exist?");
+ }
+ }
+
+ evas_object_show(m_theme);
+ ICO_TRA("Leave true");
+ return true;
+}
+
+bool
+CicoOSPopWindow::acquireRes()
+{
+ ICO_TRA("Enter");
+ if (NULL != m_context) {
+ ICO_TRA("Leave false");
+ return false;
+ }
+ ico_syc_res_window_t w;
+ makeResWindowT(w);
+ m_context = ico_syc_acquire_res( &w, NULL, NULL, ICO_SYC_RES_ONSCREEN);
+ if (NULL == m_context) {
+ ICO_TRA("Leave false");
+ return false;
+ }
+ ICO_TRA("Leave true");
+ return true;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief CicoOnScreen::HidePopup
+ * Hide popup window
+ *
+ * @param[in] data The user data passed from the callback
+ * registration function
+ * @param[in] e The handle to the popup window
+ * @param[in] obj The handle to the Evas object
+ * @param[in] event_info Event information
+ * @return none
+ */
+//--------------------------------------------------------------------------
+void
+CicoOSPopWindow::hidePopup(void)
+{
+ ICO_TRA("Enter");
+ releaseRes();
+
+ ICO_TRA("Leave");
+}
+
+bool
+CicoOSPopWindow::releaseRes()
+{
+ ICO_TRA("Enter");
+ if (NULL != m_context) {
+ int r = ico_syc_release_res(m_context);
+ ICO_DBG("_____ %d = ico_syc_release_res", r);
+ if (ICO_SYC_ERR_NONE == r) {
+ m_context = NULL;
+ ICO_TRA("Leave true");
+ return true;
+ }
+ }
+ ICO_TRA("Leave false");
+ return false;
+}
+
+
+//--------------------------------------------------------------------------
+/**
+ * @brief CicoOnScreen::InitializePopup
+ * Initialize popup window
+ *
+ * @param[in] none
+ * @return none
+ */
+//--------------------------------------------------------------------------
+bool
+CicoOSPopWindow::InitializeWindow(void)
+{
+ ICO_TRA("Enter");
+ // Window setup
+ m_window = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, "frame=0");
+ if (NULL == m_window) {
+ ICO_ERR("ecore_evas_new() error");
+ ICO_TRA("Leave(ERR)");
+ return false;
+ }
+ ecore_evas_show(m_window);
+ m_theme = edje_object_add(ecore_evas_get(m_window));
+ if (NULL == m_theme) {
+ ICO_ERR("could not create edje object!");
+ ICO_TRA("Leave(ERR)");
+ return false;
+ }
+ if (!edje_object_file_set(m_theme, ICO_OS_THEMES_EDJ_FILEPATH, "main")) {
+ Edje_Load_Error err = edje_object_load_error_get(m_theme);
+ const char *errmsg = edje_load_error_str(err);
+ ICO_ERR("could not load 'main' from onscreen.edj: %s", errmsg);
+ evas_object_del(m_theme);
+ m_theme = NULL;
+ return false;
+ }
+ // icon setup
+ m_icon = evas_object_image_filled_add(ecore_evas_get(m_window));
+ edje_object_part_swallow(m_theme, "icon", m_icon);
+ /* getting size of screen */
+ /* home screen size is full of display*/
+ int display_width = 0;
+ int display_height = 0;
+ ecore_wl_screen_size_get(&display_width, &display_height);
+
+ ICO_DBG("display size w/h=%d/%d", display_width, display_height);
+ int popup_x = (display_width / 2) - (POPUP_FRAME_WIDTH / 2);
+ int popup_y = (display_height / 2) - (POPUP_FRAME_HEIGHT/ 2);
+ ICO_DBG("popup postion x/y=%d/%d", popup_x, popup_y);
+ evas_object_move(m_theme, popup_x, popup_y);
+ evas_object_resize(m_theme, POPUP_FRAME_WIDTH, POPUP_FRAME_HEIGHT);
+
+ Evas_Object* obj = NULL;
+ obj = (Evas_Object*)edje_object_part_object_get(m_theme, "button_text");
+ if (NULL != obj) {
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP,
+ evasMouseUpCB, this);
+ }
+
+ obj = (Evas_Object*)edje_object_part_object_get(m_theme, "button");
+ if (NULL != obj) {
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP,
+ evasMouseUpCB, this);
+ }
+ evas_object_show(m_theme);
+ ICO_TRA("Leave(OK)");
+ return true;
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief callback function of evas mouse up event
+ *
+ * @param [in] data The user data passed from the callback
+ * registration function
+ * @param [in] e The handle to the popup window
+ * @param [in] obj The handle to the Evas object
+ * @param [in] event_info Event information
+ *
+ */
+//--------------------------------------------------------------------------
+void
+CicoOSPopWindow::evasMouseUpCB(void *data, Evas *e, Evas_Object *obj,
+ void *event_info)
+{
+ ICO_TRA("Enter %x, %x, %x, %x", data, e, obj, event_info);
+ if (NULL != obj) {
+ ICO_DBG("_____ obj name=%s", evas_object_name_get(obj));
+ }
+ static_cast<CicoOSPopWindow*>(data)->hidePopup();
+ ICO_TRA("Leave");
+}
+
+
+static char id0_ECU[] = "Center";
+
+static char id00_display[] = "Center";
+// static char id01_display[] = "Mid";
+
+// static char id001_layer[] = "Application";
+// static char id002_layer[] = "SoftKeyboard";
+// static char id003_layer[] = "HomeScreen";
+// static char id004_layer[] = "ControlBar";
+// static char id005_layer[] = "InterruptApp";
+static char id006_layer[] = "OnScreen";
+// static char id007_layer[] = "Touch";
+// static char id008_layer[] = "Cursor";
+// static char id011_layer[] = "MainApp";
+// static char id012_layer[] = "SubDispMainApp";
+// static char id013_layer[] = "SubDispSubApp";
+
+static char id00611_layout[] = "Whole";
+// static char id00612_layout[] = "Half";
+
+static char id006111_area[] = "Full";
+// static char id006121_area[] = "Upper";
+// static char id006122_area[] = "Lower";
+
+static char role_incoming[] = "incoming";
+static char role_message[] = "message";
+void
+CicoOSPopWindow::makeResWindowT(ico_syc_res_window_t& w)
+{
+ w.ECU = id0_ECU;
+ w.display = id00_display;
+ w.layer = id006_layer;
+ w.layout = id00611_layout;
+ w.area = id006111_area;
+ w.dispatchApp = (char*)GetPkgname();
+ if (0 == strcmp(w.dispatchApp,"org.tizen.dialer")) {
+ w.role = role_incoming;
+ }
+ else {
+ w.role = role_message;
+ }
+ w.resourceId = m_resourceId;
+}
+
+// vim: set expandtab ts=4 sw=4:
--- /dev/null
+/*
+ * Copyright (c) 2014, TOYOTA MOTOR CORPORATION.
+ *
+ * This program is licensed under the terms and conditions of the
+ * Apache License, version 2.0. The full text of the Apache License is at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+/**
+ * @brief Pop Window
+ *
+ * @date Feb-17-2014
+ */
+#ifndef __CICO_ONSCREEN_POP_WINDOW_H__
+#define __CICO_ONSCREEN_POP_WINDOW_H__
+
+#ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #define __UNUSED__
+#else
+ #define __UNUSED__
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <app.h>
+#include <aul.h>
+#include <Ecore_Evas.h>
+#include <Evas.h>
+#include <Edje.h>
+
+#include <stdbool.h>
+#include <CicoNotification.h>
+#include <CicoNotificationService.h>
+
+#include "ico_syc_common.h"
+#include "ico_syc_privilege.h"
+
+#include "ico_log.h"
+
+/*============================================================================*/
+/* Define fixed parameters */
+/*============================================================================*/
+/* Window Size */
+#define STATUS_BAR_HEIGHT 64
+#define CTRL_BAR_HEIGHT 128
+#define WIDTH 1080
+#define HEIGHT (1920 - STATUS_BAR_HEIGHT - CTRL_BAR_HEIGHT)
+
+/* Popup Size */
+#define POPUP_WIDTH 640
+#define POPUP_HEIGHT 300
+
+/* Popup Frame Size */
+#define POPUP_FRAME_THICK 10
+#define POPUP_FRAME_WIDTH (POPUP_WIDTH+POPUP_FRAME_THICK)
+#define POPUP_FRAME_HEIGHT (POPUP_HEIGHT+POPUP_FRAME_THICK)
+
+#if 0
+#define POPUP_ST_X ((WIDTH-POPUP_WIDTH)/2)
+#define POPUP_ST_Y ((HEIGHT-POPUP_HEIGHT)/2)
+
+/* Popup Frame Size */
+#define POPUP_FRAME_THICK 10
+#define POPUP_FRAME_WIDTH (POPUP_WIDTH+POPUP_FRAME_THICK)
+#define POPUP_FRAME_HEIGHT (POPUP_HEIGHT+POPUP_FRAME_THICK)
+#define POPUP_FRAME_ST_X (POPUP_ST_X-POPUP_FRAME_THICK/2)
+#define POPUP_FRAME_ST_Y (POPUP_ST_Y-POPUP_FRAME_THICK/2)
+
+/* Popup Icon Size */
+#define POPUP_ICON_WIDTH 50
+#define POPUP_ICON_HEIGHT 50
+#define POPUP_ICON_ST_X POPUP_ST_X
+#define POPUP_ICON_ST_Y POPUP_ST_Y
+
+/* Popup Title Size */
+#define POPUP_TITLE_WIDTH (POPUP_WIDTH-POPUP_ICON_WIDTH)
+#define POPUP_TITLE_HEIGHT POPUP_ICON_HEIGHT
+#define POPUP_TITLE_ST_X (POPUP_ST_X+POPUP_ICON_WIDTH)
+#define POPUP_TITLE_ST_Y POPUP_ST_Y
+
+/* Popup Content BG Size */
+#define POPUP_CONTENT_BG_WIDTH POPUP_WIDTH
+#define POPUP_CONTENT_BG_HEIGHT (POPUP_HEIGHT-POPUP_TITLE_HEIGHT)
+#define POPUP_CONTENT_BG_ST_X POPUP_ST_X
+#define POPUP_CONTENT_BG_ST_Y (POPUP_ST_Y+POPUP_TITLE_HEIGHT)
+
+/* Popup Content Size */
+#define POPUP_CONTENT_WIDTH POPUP_WIDTH
+#define POPUP_CONTENT_HEIGHT POPUP_TITLE_HEIGHT
+#define POPUP_CONTENT_ST_X POPUP_ST_X
+#define POPUP_CONTENT_ST_Y (POPUP_ST_Y+POPUP_TITLE_HEIGHT+(POPUP_HEIGHT-POPUP_CONTENT_HEIGHT)/2)
+
+#define ICO_ORIENTATION_VERTICAL (1)
+#define ICO_ORIENTATION_HORIZONTAL (2)
+
+#define LEMOLO_PKGNAME "org.tizen.dialer"
+#endif
+
+#define FALSE 0
+#define TRUE 1
+
+#if 0
+#define ICON_PATH (char *)"/usr/share/icons/default/small/org.tizen.dialer.png"
+#endif
+#define ICO_OS_THEMES_EDJ_FILEPATH "/usr/apps/org.tizen.ico.onscreen/res/themes/onscreen.edj"
+/*============================================================================*/
+/* Define data types */
+/*============================================================================*/
+
+/*============================================================================*/
+/* Define class */
+/*============================================================================*/
+class CicoOSPopWindow :public CicoNotification {
+public:
+ CicoOSPopWindow(notification_type_e type);
+ CicoOSPopWindow(notification_h noti);
+ virtual ~CicoOSPopWindow();
+ bool showPopup();
+ void hidePopup();
+ bool acquireRes();
+ bool releaseRes();
+ const CicoNotification& getNotif() const {
+ return (const CicoNotification&)*this;
+ }
+private:
+ bool InitializeWindow(void);
+ static void evasMouseUpCB(void *data, Evas *e, Evas_Object *obj,
+ void *event_info);
+ void makeResWindowT(ico_syc_res_window_t& w);
+
+public:
+ Ecore_Evas* m_window;
+ Evas_Object* m_icon;
+ Evas_Object* m_theme;
+ uint32_t m_resourceId;
+ struct ico_syc_res_context* m_context;
+};
+
+#endif // __CICO_ONSCREEN_POP_WINDOW_H__
+// vim:set expandtab ts=4 sw=4:
@MURPHYRESOURCE_CFLAGS@ \
@EDBUS_CFLAGS@ \
$(UWS_CFLAGS) \
+ $(GENIVI_CFLAGS) \
$(WESTONPLUGIN_CFLAGS) \
-I../../include \
-I../../lib/system-controller \
@MURPHYRESOURCE_LIBS@ \
@EDBUS_LIBS@ \
$(UWS_LIBS) \
+ $(GENIVI_LIBS) \
$(WESTONPLUGIN_LIBS)
CLEANFILES = $(BUILT_SOURCES)
tst_send_input(const char *appid, int surface, int ev_type,
int deviceno, int ev_time, int ev_code, int ev_value)
{
+#if 0 /* SystemController 0.9.21(with GENIVI ivi-shell) not support send_input */
int ret;
char *func = "ico_syc_send_input";
return;
}
print_ok("%s", func);
-
+#endif
return;
}
break;
case MSG_CMD_ADD_INPUT:
case MSG_CMD_DEL_INPUT:
+#if 0 /* SystemController 0.9.21(with GENIVI ivi-shell) not support send_input */
case MSG_CMD_SEND_INPUT:
+#endif
gen = NULL;
break;
case MSG_CMD_CHANGE_USER:
int ret;
char *func = "ico_syc_map_thumb";
- ret = ico_syc_map_thumb(surface, framerate);
+ ret = ico_syc_map_thumb(surface, framerate, " ");
if (ret != 0) {
print_ng("%s (ret: %d)", func, ret);
return;
AM_LDFLAGS = -module -avoid-version -rpath $(libdir) $(GLIB_LIBS)
bin_PROGRAMS = \
- ico_clear_screen \
ico_change_loginuser
check_LTLIBRARIES = $(TESTS)