lib \
src \
tool \
- tests
+ tests \
+ tool/notification
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
-AC_INIT([org.tizen.ico.homescreen], [0.9.31], [])
+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(WL_CFLAGS)
AC_SUBST(WL_LIBS)
+WESTONPLUGIN_LIBS="-lico-uxf-weston-plugin"
+AC_SUBST(WESTONPLUGIN_LIBS)
+
CFLAGS="$CFLAGS $EGL_CFLAGS"
AC_SUBST(CFLAGS)
src/statusbar/Makefile
src/onscreen/Makefile
tool/Makefile
+ tool/notification/Makefile
tests/Makefile
tests/system-controller/Makefile
tests/system-controller/apps-framework/Makefile])
Environment=TIZEN_DLOG_LEVEL=1
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/dbus/user_bus_socket
ExecStart=/bin/sh -l -c "/usr/apps/org.tizen.ico.system-controller/bin/IcoSysconDaemon --user app"
+
<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.ico.homescreen" version="0.9.31" 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.31" 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.31" 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.31" 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>
#ifndef _ICO_SYC_INPUTCTL_H_
#define _ICO_SYC_INPUTCTL_H_
+#include <ico-uxf-weston-plugin/ico_input_mgr-client-protocol.h>
+
#ifdef __cplusplus
extern "C" {
#endif
* @ICO_SYC_INPUT_TYPE_SWITCH: switch event
*/
typedef enum _input_type {
- ICO_SYC_INPUT_TYPE_POINTER = 1,
- ICO_SYC_INPUT_TYPE_KEYBOARD = 2,
- ICO_SYC_INPUT_TYPE_TOUCH = 4,
- ICO_SYC_INPUT_TYPE_SWITCH = 8
+ ICO_SYC_INPUT_TYPE_POINTER = ICO_INPUT_MGR_DEVICE_TYPE_POINTER,
+ ICO_SYC_INPUT_TYPE_KEYBOARD = ICO_INPUT_MGR_DEVICE_TYPE_KEYBOARD,
+ ICO_SYC_INPUT_TYPE_TOUCH = ICO_INPUT_MGR_DEVICE_TYPE_TOUCH,
+ ICO_SYC_INPUT_TYPE_SWITCH = ICO_INPUT_MGR_DEVICE_TYPE_SWITCH
} ico_syc_input_type_e;
/*============================================================================*/
#ifndef _ICO_SYC_TYPE_H_
#define _ICO_SYC_TYPE_H_
-#include <stdint.h>
-#include <wayland-client-protocol.h>
+#include <ico-uxf-weston-plugin/ico_window_mgr-client-protocol.h>
#ifdef __cplusplus
extern "C" {
ICO_SYC_STATE_ON = 1 /**< state of on */
} ico_syc_state_onoff_e;
-/**
- * window animation name
- */
-#define ICO_SYC_WIN_ANIMATION_FADE "Fade"
-#define ICO_SYC_WIN_ANIMATION_SLIDE "Slide"
-#define ICO_SYC_WIN_ANIMATION_SLIDE_TOTOP "Slide.toTop"
-#define ICO_SYC_WIN_ANIMATION_SLIDE_TOBUTTOM "Slide.toButtom"
-#define ICO_SYC_WIN_ANIMATION_SLIDE_TOLEFT "Slide.toLeft"
-#define ICO_SYC_WIN_ANIMATION_SLIDE_TORIGHT "Slide.toRight"
-
/*============================================================================*/
/* structure */
/*============================================================================*/
typedef struct _thumb_info {
char *appid; /* application id */
int surface; /* window's surface id */
- int type; /* buffer type */
+ int type; /* buffer type(ICO_WINDOW_MGR_MAP_TYPE_EGL/SHM/PIXEL)*/
int width; /* window width */
int height; /* window height */
int stride; /* byte par line of frame buffer */
#ifndef _ICO_SYC_WINCTL_H_
#define _ICO_SYC_WINCTL_H_
+#include <ico-uxf-weston-plugin/ico_window_mgr-client-protocol.h>
+
#ifdef __cplusplus
extern "C" {
#endif
/*--------------------------------------------------------------------------*/
/**
+ * @brief ico_syc_set_animation
+ * Set the application window animation.
+ *
+ * @param[in] appid application id
+ * @param[in] surface window's surface id
+ * @param[in] type set animation target
+ * @param[in] animation animation information
+ * @return result
+ * @retval 0 success
+ * @retval not 0 error
+ */
+/*--------------------------------------------------------------------------*/
+int ico_syc_set_animation(const char *appid, int surface, int type,
+ const ico_syc_animation_t *animation);
+
+/*--------------------------------------------------------------------------*/
+/**
* @brief ico_syc_change_active
* Change the active window which receives the input-event notification
* from System Controller.
lib_LTLIBRARIES = libico-appfw.la
-COMMON_LIBS = -lm -lwebsockets -lilmCommon -lilmControl -lilmClient
+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
libico_appfw_la_LIBADD = $(OPT_LIBS) $(WL_LIBS) $(AUL_LIBS) $(UWS_LIBS) $(COMMON_LIBS) @ECORE_LIBS@
static msg_t _create_win_move_msg(const char *appid, int surface,
const ico_syc_win_move_t *move,
const ico_syc_animation_t *animation);
+static msg_t _create_win_animation_msg(const char *appid, int surface,
+ int type, const char *animation, int time);
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_get_msg(const char *appid, int surface, const char *filepath);
/*--------------------------------------------------------------------------*/
/**
+ * @brief _create_win_animation_msg
+ * Create the message to set animation the application window.
+ *
+ * @param[in] appid application id
+ * @param[in] surface window's surface id
+ * @param[in] type set animation target
+ * @param[in] animation animation information
+ * @param[in] time animation time
+ * @return json generator
+ * @retval json generator success
+ * @retval NULL error
+ */
+/*--------------------------------------------------------------------------*/
+static msg_t
+_create_win_animation_msg(const char *appid, int surface,
+ int type, const char *animation, int time)
+{
+ 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_ANIMATION);
+ 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_ANIM_TYPE, type);
+ json_object_set_string_member(argobj, MSG_PRMKEY_ANIM_NAME, animation);
+ json_object_set_int_member(argobj, MSG_PRMKEY_ANIM_TIME, time);
+
+ 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;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
* @brief _create_active_win_msg
* Create the message to change active window.
*
/*--------------------------------------------------------------------------*/
/**
+ * @brief ico_syc_set_animation
+ * Set the application window animation.
+ *
+ * @param[in] appid application id
+ * @param[in] surface window's surface id
+ * @param[in] type set animation target
+ * @param[in] animation animation information
+ * @return result
+ * @retval 0 success
+ * @retval not 0 error
+ */
+/*--------------------------------------------------------------------------*/
+ICO_API int
+ico_syc_set_animation(const char *appid, int surface, int type,
+ const ico_syc_animation_t *animation)
+{
+ 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_win_animation_msg(appid, surface, type, animation->name, animation->time);
+ /* send message */
+ ret = ico_syc_send_msg(msg);
+ /* free send message */
+ ico_syc_free_msg(msg);
+
+ return ret;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
* @brief ico_syc_change_active
* Change the active window which receives the win-event notification
* from System Controller.
*/
CicoAilItems::~CicoAilItems()
{
-// ICO_TRA("start");
-// ICO_TRA("end");
+ ICO_TRA("start");
+ ICO_TRA("end");
}
/**
* @brief init member
}
CicoSystemConfig* CSCSC = CicoSystemConfig::getInstance();
- m_inputDev = CSCSC->getInputDevIdbyName(inputDev);
- ICO_DBG("input %s->%d", inputDev.c_str(), m_inputDev);
+ m_sound = CSCSC->getInputDevIdbyName(inputDev);
+ ICO_DBG("sound %s->%d", inputDev.c_str(), m_sound);
if (false == sw.empty()) {
m_switch = CSCSC->getSwitchIdbyName(inputDev, sw);
ICO_DBG("switch %s, %s->%d", inputDev.c_str(), sw.c_str(), m_switch);
*/
CicoAulItems::~CicoAulItems()
{
-// ICO_TRA("CicoAulItems::~CicoAulItems");
+ ICO_TRA("CicoAulItems::~CicoAulItems");
m_CSCWptrs.clear();
}
{
int pid;
char command[256];
-
+
if (false == m_initialized) {
return false;
}
ICO_DBG("PlaySound:system(%s)", command);
pid = fork();
if (!pid) {
- (void) system(command);
+ system(command);
exit(0);
}
{
if (NULL == ms_myInstance) {
ms_myInstance = new CicoSystemConfig();
- ms_myInstance->load(ICO_SYSTEM_CONFIG_PATH);
}
return ms_myInstance;
}
#endif
//==========================================================================
-// Default configuration file
-//==========================================================================
-#define ICO_SYSTEM_CONFIG_PATH "/usr/apps/org.tizen.ico.system-controller/res/config/system.xml"
-
-//==========================================================================
/**
* @brief This class has function of access to system config information
*/
//--------------------------------------------------------------------------
CicoSCInputController::CicoSCInputController()
{
+ CicoSCWayland* wayland = CicoSCWayland::getInstance();
+ wayland->addWaylandIF(ICO_WL_INPUT_MGR_CTRL_IF, this);
+ wayland->addWaylandIF(ICO_WL_EXINPUT_IF, this);
+ wayland->addWaylandIF(ICO_WL_INPUT_MGR_DEV_IF, this);
+
}
//--------------------------------------------------------------------------
* @brief callback to application for input switch information
*
* @param [in] data user data
+ * @param [in] ico_exinput wayland ico_exinput interface
* @param [in] device input device name
* @param [in] type input device type (as enum type)
* @param [in] swname input switch name
//--------------------------------------------------------------------------
void
CicoSCInputController::capabilitiesCB(void *data,
+ struct ico_exinput *ico_exinput,
const char *device,
int32_t type,
const char *swname,
* @brief callback to application for input code information
*
* @param [in] data user data
+ * @param [in] ico_exinput wayland ico_exinput interface
* @param [in] device input device name
* @param [in] input input switch number
* @param [in] codename input code name
//--------------------------------------------------------------------------
void
CicoSCInputController::codeCB(void *data,
+ struct ico_exinput *ico_exinput,
const char *device,
int32_t input,
const char *codename,
* @brief callback to application for switch input
*
* @param [in] data user data
+ * @param [in] ico_exinput wayland ico_exinput interface
* @param [in] time input time of millisecond
* @param [in] device input device name
* @param [in] input input switch number
//--------------------------------------------------------------------------
void
CicoSCInputController::inputCB(void *data,
+ struct ico_exinput *ico_exinput,
uint32_t time,
const char *device,
int32_t input,
* @brief callback to application for change input region
*
* @param [in] data user data
+ * @param [in] ico_input_mgr_dev wayland ico_exinput interface
* @param [in] region input regions
*/
//--------------------------------------------------------------------------
void
CicoSCInputController::regionCB(void *data,
+ struct ico_input_mgr_device *ico_input_mgr_dev,
struct wl_array *region)
{
ICO_TRA("CicoSCInputController::regionCB Enter");
// callback to application for input switch information
void capabilitiesCB(void *data,
+ struct ico_exinput *ico_exinput,
const char *device,
int32_t type,
const char *swname,
// callback to application for input code information
void codeCB(void *data,
+ struct ico_exinput *ico_exinput,
const char *device,
int32_t input,
const char *codename,
// callback to application for switch input
void inputCB(void *data,
+ struct ico_exinput *ico_exinput,
uint32_t time,
const char *device,
int32_t input,
// callback to application for change input region
void regionCB(void *data,
+ struct ico_input_mgr_device *ico_input_mgr_device,
struct wl_array *region);
protected:
{
int idx, idx2;
int *wksurfaceids;
- ICO_DBG("CicoSCLayer::addSurface(%d,%08x,%d)", layerid, surfaceid, top);
+ ICO_DBG("CicoSCLayer::addSurface(%08x,%d)", surfaceid, top);
idx2 = 0;
for (idx = 0; idx < numsurfaces; idx++) {
CicoSCLayer::removeSurface(int surfaceid)
{
int idx, idx2;
- ICO_DBG("CicoSCLayer::removeSurface(%d,%08x)", layerid, surfaceid);
+ ICO_DBG("CicoSCLayer::removeSurface(%08x)", surfaceid);
idx2 = 0;
for (idx = 0; idx < numsurfaces; idx++) {
public:
int layerid; //!< layer id
- int type; //!< layer attribute
+ int type; //!< enum ico_window_mgr_layer_attr
int width; //!< The number of the lateral pixels
int height; //!< The number of vertical pixels
int displayid; //!< display ID
if (true == active) {
resource_request_t* popreq = popWaitingDispResReq(*itr);
updateDisplayResource(popreq);
- m_winCtrl->activeCB(NULL, popreq->surfaceid, -1);
+ m_winCtrl->activeCB(NULL, NULL, popreq->surfaceid, -1);
break;
}
}
// show request window
m_winCtrl->show(req->surfaceid, req->animation, req->animationTime);
#if 0
- m_winCtrl->activeCB(NULL, req->surfaceid, -1);
+ m_winCtrl->activeCB(NULL, NULL, req->surfaceid, -1);
#endif
ICO_TRA("CicoSCResourceManager::updateDisplayResource Leave");
return;
}
CicoSCSysResourceController* oCSCSRC = (CicoSCSysResourceController*)data;
oCSCSRC->watch();
+// double tVal = (double)g_samplingWaitTimer / 100;
+// ecore_timer_add(g_samplingWaitTimer, ico_SCResourceWatch, data);
if (g_RC_LOG) ICO_TRA("end");
return ECORE_CALLBACK_RENEW;
}
return false;
}
// cpu,cpuacct cgroup init
- init_cgroup(); // cgroup
+ init_cgroup(); // cgroup
m_monitor = new CicoSCSysResourceMonitor();
CicoSystemConfig* CSCSC = CicoSystemConfig::getInstance();
string filePath(CSCSC->getDefaultConf()->confdir);
using namespace std;
#include <wayland-client.h>
+#include <ico-uxf-weston-plugin/ico_window_mgr-client-protocol.h>
#include <ilm/ilm_control.h>
#include "CicoSCWayland.h"
#include "CicoSCWaylandIF.h"
#include "CicoLog.h"
-const char * CicoSCWaylandIF::ICO_WL_IVI_CONTROLLER_IF = "ivi_controller";
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
+const char * CicoSCWaylandIF::ICO_WL_WIN_MGR_IF = "ico_window_mgr";
+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";
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
+const char * CicoSCWaylandIF::ICO_WL_IVI_CONTROLLER_IF = "ivi_controller";
const char * CicoSCWaylandIF::ICO_WL_OUTPUT_IF = "wl_output";
CicoSCWaylandIF(const CicoSCWaylandIF &object);
protected:
- // interface name of genivi ivi_controller
- static const char * ICO_WL_IVI_CONTROLLER_IF;
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
- // interface name of genivi ivi_application
+ /// interface name of wayland multi window manager
+ 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
+ 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;
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
- // interface name of wayland output
+ /// 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;
// initialized flag
//--------------------------------------------------------------------------
CicoSCWindow::~CicoSCWindow()
{
-// ICO_TRA("CicoSCWindow::~CicoSCWindow Enter");
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
+ ICO_TRA("CicoSCWindow::~CicoSCWindow Enter");
CicoSCWlWinMgrIF::wlIviCtrlRemoveSurface(surfaceid);
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
-// ICO_TRA("CicoSCWindow::~CicoSCWindow Leave");
+ ICO_TRA("CicoSCWindow::~CicoSCWindow Leave");
}
//--------------------------------------------------------------------------
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <Ecore.h>
#include <vector>
#include <algorithm>
//==========================================================================
CicoSCWindowController* CicoSCWindowController::ms_myInstance = NULL;
-struct ico_sc_win_check_t* CicoSCWindowController::win_check_timer = NULL;
-struct ico_sc_win_check_t* CicoSCWindowController::win_check_free = NULL;
-
-//==========================================================================
-// static function for Ecore timer
-//==========================================================================
-static Ecore_Timer* g_SCWindowChecker = 0;
-static struct timeval g_lasttime = { 0, 0 };
-static int g_hightimer = 0;
-
//--------------------------------------------------------------------------
/**
* @brief get instance of CicoSCWindowController
: m_resMgr(NULL), m_physicalDisplayTotal(0)
{
CicoSCWayland* wayland = CicoSCWayland::getInstance();
- wayland->getInstance()->addWaylandIF(ICO_WL_IVI_CONTROLLER_IF, this);
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
+ wayland->getInstance()->addWaylandIF(ICO_WL_WIN_MGR_IF, this);
wayland->getInstance()->addWaylandIF(ICO_WL_IVI_APPLICATION_IF, this);
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
+ wayland->getInstance()->addWaylandIF(ICO_WL_IVI_CONTROLLER_IF, this);
wayland->getInstance()->addWaylandIF(ICO_WL_OUTPUT_IF, this);
initDB();
CicoSCWindowController::ms_myInstance = this;
-
- g_SCWindowChecker = ecore_timer_add(((double)ICO_SC_WINCHK_TIMER_BASE_L)/1000.0,
- ico_SCWindowChecker, this);
}
//--------------------------------------------------------------------------
}
}
- // set animation request
+ // set animation request to Multi Window Manager
int raiseFlag = ICO_SYC_WIN_RAISE_NOCHANGE;
if (type & ICO_SYC_WIN_SURF_RAISE) {
raiseFlag = ICO_SYC_WIN_RAISE_RAISE;
(false == window->raise)) {
raiseFlag = ICO_SYC_WIN_RAISE_RAISE;
}
- if ((animationTime > 0) && (NULL != animation) &&
- (animation[0] != '\0') && (strcasecmp(animation, "none") != 0)) {
- // set animation
- setWindowAnimation(window, ICO_SC_WINANIMA_SHOW, animation, animationTime);
- }
- else {
- // reset animation
- resetWindowAnimation(window);
+ if ((NULL != animation) && (animation[0] != '\0')) {
+ // set animation request to Multi Window Manager
+ CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
+ (type & ICO_SYC_WIN_SURF_ONESHOT) ?
+ ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW |
+ ICO_WINDOW_MGR_ANIMATION_TYPE_ONESHOT :
+ ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW,
+ animation, animationTime);
}
// set raise/lower request (if need)
raiselower(window, (raiseFlag == ICO_SYC_WIN_RAISE_RAISE));
}
- // set visible request
+ // set visible request to Multi Window Manager
CicoSCWlWinMgrIF::setVisible(window->surfaceid, ICO_SYC_WIN_VISIBLE_SHOW);
// flush display
}
}
- if ((animationTime > 0) && (NULL != animation) &&
- (animation[0] != '\0') && (strcasecmp(animation, "none") != 0)) {
- // set animation
- setWindowAnimation(window, ICO_SC_WINANIMA_HIDE, animation, animationTime);
- }
- else {
- // reset animation
- resetWindowAnimation(window);
- CicoSCWlWinMgrIF::setVisible(window->surfaceid, ICO_SYC_WIN_VISIBLE_HIDE);
+ // set animation request to Multi Window Manager
+ if ((NULL != animation) && (animation[0] != '\0')) {
+ CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
+ (type & ICO_SYC_WIN_SURF_ONESHOT) ?
+ ICO_WINDOW_MGR_ANIMATION_TYPE_HIDE |
+ ICO_WINDOW_MGR_ANIMATION_TYPE_ONESHOT :
+ ICO_WINDOW_MGR_ANIMATION_TYPE_HIDE,
+ animation, animationTime);
}
+ // set visible request to Multi Window Manager
+ CicoSCWlWinMgrIF::setVisible(window->surfaceid, ICO_SYC_LAYER_VISIBLE_HIDE);
+
// flush display
CicoSCWayland::getInstance()->flushDisplay();
return ICO_SYC_ENOENT;
}
- // set visible request
+ // set animation request to Multi Window Manager
+ if ((NULL != animation) && (animation[0] != '\0')) {
+ CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
+ (type & ICO_SYC_WIN_SURF_ONESHOT) ?
+ ICO_WINDOW_MGR_ANIMATION_TYPE_RESIZE |
+ ICO_WINDOW_MGR_ANIMATION_TYPE_ONESHOT :
+ ICO_WINDOW_MGR_ANIMATION_TYPE_RESIZE,
+ animation, animationTime);
+ }
+
+ // set visible request to Multi Window Manager
window->width = w;
window->height = h;
CicoSCWlWinMgrIF::setPositionsize(window->surfaceid, window->nodeid,
return ICO_SYC_ENOENT;
}
+ // set animation request to Multi Window Manager
+ if ((NULL != animation) && (animation[0] != '\0')) {
+ CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
+ (type & ICO_SYC_WIN_SURF_ONESHOT) ?
+ ICO_WINDOW_MGR_ANIMATION_TYPE_MOVE |
+ ICO_WINDOW_MGR_ANIMATION_TYPE_ONESHOT :
+ ICO_WINDOW_MGR_ANIMATION_TYPE_MOVE,
+ animation, animationTime);
+ }
+
int moveNodeId = ICO_SYC_WIN_NOCHANGE;
if (nodeid >= 0) {
moveNodeId = nodeid;
}
- // set visible request
+ // set visible request to Multi Window Manager
window->x = x;
window->y = y;
CicoSCWlWinMgrIF::setPositionsize(window->surfaceid,
return ICO_SYC_ENOENT;
}
- // set raise request
+ // set animation request to Multi Window Manager
+ if ((NULL != animation) && (animation[0] != '\0')) {
+ CicoSCWindowController::setAnimation(window->surfaceid,
+ (type & ICO_SYC_WIN_SURF_ONESHOT) ?
+ ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW |
+ ICO_WINDOW_MGR_ANIMATION_TYPE_ONESHOT :
+ ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW,
+ animation, animationTime);
+ }
+ // set raise request to Multi Window Manager
raiselower(window, true);
if (ilm_commitChanges() != ILM_SUCCESS) {
ICO_ERR("CicoSCWindowController::raise ilm_commitChanges() Error");
return ICO_SYC_ENOENT;
}
+ // set animation request to Multi Window Manager
+ const char *animation = "";
+ if (NULL != resizeAnimation) {
+ animation = resizeAnimation;
+ }
+ CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
+ ICO_WINDOW_MGR_ANIMATION_TYPE_RESIZE,
+ animation, resizeAnimationTime);
+
+ if (NULL != moveAnimation) {
+ animation = moveAnimation;
+ }
+ CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
+ ICO_WINDOW_MGR_ANIMATION_TYPE_MOVE,
+ animation, moveAnimationTime);
+
int moveNodeId = ICO_SYC_WIN_NOCHANGE;
if (nodeid >= 0) {
moveNodeId = nodeid;
window->height = h;
}
- // set window layer
+ // set window layer to Multi Window Manager
if (0 <= layerid) {
setWindowLayer(window->surfaceid, layerid);
}
// update window attr
window->nodeid = moveNodeId;
- // set visible request
+ // set visible request to Multi Window Manager
CicoSCWlWinMgrIF::setPositionsize(window->surfaceid, moveNodeId,
moveX, moveY, moveW, moveH);
return ICO_SYC_ENOENT;
}
- // set lower request
+ // set animation request to Multi Window Manager
+ if ((NULL != animation) && (animation[0] != '\0')) {
+ CicoSCWlWinMgrIF::setAnimation(window->surfaceid,
+ (type & ICO_SYC_WIN_SURF_ONESHOT) ?
+ ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW |
+ ICO_WINDOW_MGR_ANIMATION_TYPE_ONESHOT :
+ ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW,
+ animation, animationTime);
+ }
+
+ // set lower request to Multi Window Manager
raiselower(window, false);
if (ilm_commitChanges() != ILM_SUCCESS) {
ICO_ERR("CicoSCWindowController::lower ilm_commitChanges() Error");
//--------------------------------------------------------------------------
/**
+ * @brief set window(surface) animation
+ *
+ * @param [in] surfaceid wayland surface id
+ * @param [in] target target(pointer and/or keyboard)
+ * @param [in] type set animation target
+ * @param [in] animation animation information
+ * @param [in] time animation time
+ *
+ * @return ICO_SYC_EOK on success, other on error
+ * @retval ICO_SYC_EOK success
+ * @retval ICO_SYC_ESRCH error(not initialized)
+ * @retval ICO_SYC_ENOENT error(layer dose not exist)
+ */
+//--------------------------------------------------------------------------
+int
+CicoSCWindowController::setWindowAnimation(int surfaceid, int type,
+ const char *animation, int time)
+{
+ CicoSCWindow *window = NULL;
+
+ ICO_TRA("CicoSCWindowController::setWindowAnimation Enter"
+ "(surfaceid=%08x, type=%x, animation=<%s>, time=%d)",
+ surfaceid, type, animation ? animation : "(null)", time);
+
+ // find window information in window list
+ window = findWindow(surfaceid);
+ if (NULL == window) {
+ ICO_WRN("not found window information");
+ ICO_TRA("CicoSCWindowController::setWindowAnimation Leave(ENOENT)");
+ return ICO_SYC_ENOENT;
+ }
+
+ // set animation request to Multi Window Manager
+ CicoSCWlWinMgrIF::setAnimation(surfaceid, type, animation, time);
+
+ // flush display
+ CicoSCWayland::getInstance()->flushDisplay();
+
+ ICO_TRA("CicoSCWindowController::setWindowAnimation Leave(EOK)");
+ return ICO_SYC_EOK;
+}
+
+//--------------------------------------------------------------------------
+/**
* @brief set window layer
*
* @param [in] surfaceid wayland surface id
int
CicoSCWindowController::hideLayer(int displayid, int layerid)
{
- ICO_TRA("CicoSCWindowController::hideLayer Enter(displayid=%d layerid=%d)",
+ ICO_TRA("CicoSCWindowController::hideLayer Enter"
+ "displayid=%d layerid=%d)",
displayid, layerid);
// find layer information in layer list
// flush display
CicoSCWayland::getInstance()->flushDisplay();
- ICO_TRA("CicoSCWindowController::hideLayer Leave(EOK)");
+ ICO_TRA("CicoSCWindowController::hideVisible Leave(EOK)");
return ICO_SYC_EOK;
}
target = 0xffff;
}
- // set active request
+ // set active request to Multi Window Manager
CicoSCWlWinMgrIF::setActive(surfaceid, target);
// flush display
return ICO_SYC_ENOENT;
}
- setWindowMap(window, framerate, filepath);
+ CicoSCWlWinMgrIF::mapSurface(surfaceid, framerate, filepath);
+ CicoSCWayland::getInstance()->flushDisplay();
ICO_TRA("CicoSCWindowController::mapSurface Leave(EOK)");
return ICO_SYC_EOK;
return ICO_SYC_ENOENT;
}
- resetWindowMap(surfaceid);
+ CicoSCWlWinMgrIF::unmapSurface(surfaceid);
+ CicoSCWayland::getInstance()->flushDisplay();
ICO_TRA("CicoSCWindowController::unmapSurface Leave(EOK)");
return ICO_SYC_EOK;
int
CicoSCWindowController::setAttributes(int surfaceid)
{
- ICO_TRA("CicoSCWindowController::setAttributes Enter(surfaceid=%08x)", surfaceid);
+ ICO_TRA("CicoSCWindowController::setAttributes Enter"
+ "(surfaceid=%08x)", surfaceid);
// find window information in window list
CicoSCWindow *window = findWindow(surfaceid);
* @brief wayland surface active callback
*
* @param [in] data user data(unused)
- * @param [in] surfaceid surface Id
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
+ * @param [in] surfaceid ico_window_mgr surface Id
* @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 select)
{
- ICO_TRA("CicoSCWindowController::activeCB Enter(surfaceid=%08x select=%d)",
- surfaceid, select);
+ ICO_TRA("CicoSCWindowController::activeCB Enter"
+ "(surfaceid=%08x select=%d)", surfaceid, select);
CicoSCWindow *window = findWindow(surfaceid);
if (NULL == window) {
/**
* @brief surface map event callback
*
+ * @param [in] data user data(unused)
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
* @param [in] event event
* @param [in] surfaceid surface Id
* @param [in] type surface type (EGL buffer/Shared memory)
*/
//--------------------------------------------------------------------------
void
-CicoSCWindowController::mapSurfaceCB(int32_t event,
- uint32_t surfaceid,
- uint32_t type,
- int32_t width,
- int32_t height,
- int32_t stride,
+CicoSCWindowController::mapSurfaceCB(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)
{
- int command;
+ int command;
- ICO_TRA("CicoSCWindowController::mapSurfaceCB Enter(ev=%d surf=%d[%x] w/h=%d/%d)",
- event, surfaceid, surfaceid, width, height);
+ ICO_TRA("CicoSCWindowController::mapSurfaceCB Enter(ev=%d surf=%x "
+ "type=%d w/h=%d/%d stride=%d form=%x)",
+ event, surfaceid, type, width, height, stride, format);
CicoSCWindow *window = findWindow(surfaceid);
if (NULL == window) {
- ICO_TRA("CicoSCWindowController::mapSurfaceCB Leave(NOENT)");
return;
}
// convert event to command
switch (event) {
- case ICO_SC_WINCHK_MAP_SURFACE_EVENT_MAP:
- case ICO_SC_WINCHK_MAP_SURFACE_EVENT_CONTENTS:
+ case ICO_WINDOW_MGR_MAP_SURFACE_EVENT_CONTENTS:
+ case ICO_WINDOW_MGR_MAP_SURFACE_EVENT_RESIZE:
+ case ICO_WINDOW_MGR_MAP_SURFACE_EVENT_MAP:
command = MSG_CMD_MAP_THUMB;
break;
- case ICO_SC_WINCHK_MAP_SURFACE_EVENT_UNMAP:
+ case ICO_WINDOW_MGR_MAP_SURFACE_EVENT_UNMAP:
+ case ICO_WINDOW_MGR_MAP_SURFACE_EVENT_ERROR:
command = MSG_CMD_UNMAP_THUMB;
break;
default:
//--------------------------------------------------------------------------
/**
- * @brief surface update event callback from GENIVI-LM
- *
- * @param [in] surfaceid surface Id
- * @param [in] surfprop surface Properties
- * @param [in] maek attribute change mask bits(unused)
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWindowController::wlGeniviSurfaceNotification(t_ilm_surface surfaceid,
- struct ilmSurfaceProperties *surfprop,
- t_ilm_notification_mask mask)
-{
- ICO_TRA("CicoSCWindowController::wlGeniviSurfaceNotification(%d(%x),,%x)",
- surfaceid, surfaceid, mask);
-
- if (mask & (ILM_NOTIFICATION_VISIBILITY | ILM_NOTIFICATION_SOURCE_RECT |
- ILM_NOTIFICATION_DEST_RECT)) {
- CicoSCWindowController::getInstance()->
- updateSurfaceCB((uint32_t)surfaceid, surfprop);
- }
- else if (mask & ILM_NOTIFICATION_CONTENT_REMOVED) {
- CicoSCWindowController::getInstance()->
- destroySurfaceCB((uint32_t)surfaceid);
- }
-}
-
-//--------------------------------------------------------------------------
-/**
* @brief surface update event callback
*
+ * @param [in] data user data(unused)
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
* @param [in] surfaceid surface Id
- * @param [in] surfprop surface Properties
+ * @param [in] visible visibility
+ * @param [in] srcwidth application buffer width
+ * @param [in] srcheight application buffer height
+ * @param [in] x X
+ * @param [in] y Y
+ * @param [in] width width
+ * @param [in] height height
*/
//--------------------------------------------------------------------------
void
-CicoSCWindowController::updateSurfaceCB(uint32_t surfaceid,
- struct ilmSurfaceProperties *surfprop)
+CicoSCWindowController::updateSurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid,
+ int visible,
+ int srcwidth,
+ int srcheight,
+ int x,
+ int y,
+ int width,
+ int height)
{
- ICO_TRA("CicoSCWindowController::updateSurfaceCB: Enter"
- "(%08x pid=%d v=%d,x/y=%d/%d,w/h=%d/%d->%d/%d)",
- surfaceid, surfprop->creatorPid, surfprop->visibility,
- surfprop->destX, surfprop->destY,
- surfprop->sourceWidth, surfprop->sourceHeight,
- surfprop->destWidth, surfprop->destHeight);
+ ICO_TRA("CicoSCWindowController::updateSurfaceCB: Enter(%08x %d,%d,%d,%d,%d,%d,%d)",
+ surfaceid, visible, srcwidth, srcheight, x, y, width, height);
CicoSCWindow *window = findWindow(surfaceid);
if (NULL == window) {
}
// update attr
- window->visible = surfprop->visibility;
- window->srcwidth = surfprop->sourceWidth;
- window->srcheight = surfprop->sourceHeight;
- window->x = surfprop->destX;
- window->y = surfprop->destY;
- window->width = surfprop->destWidth;
- window->height = surfprop->destHeight;
+ window->visible = visible;
+ window->srcwidth = srcwidth;
+ window->srcheight = srcheight;
+ window->x = x;
+ window->y = y;
+ window->width = width;
+ window->height = height;
window->nodeid = window->layerid / ICO_SC_LAYERID_SCREENBASE;
// notify to homescreen
/**
* @brief wayland surface destroy callback
*
- * @param [in] surfaceid surface Id
+ * @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::destroySurfaceCB(uint32_t surfaceid)
+CicoSCWindowController::destroySurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid)
{
ICO_TRA("CicoSCWindowController::destroySurfaceCB: Enter(%08x)", surfaceid);
return;
}
- // remove window check
- CicoSCWindowController::windowCheckerRemove(surfaceid);
-
// delete surface from layer
CicoSCLayer* layer = findLayer(window->displayid, window->layerid);
if (NULL == layer) {
x, y, physical_width, physical_height,
subpixel, make, model, transform);
- ++ m_physicalDisplayTotal;
+ ++m_physicalDisplayTotal;
if (0 == m_displayList.size()) {
ICO_TRA("CicoSCWindowController::outputGeometryCB Leave"
"(display is zero)");
struct ivi_controller *ivi_controller,
uint32_t id_surface)
{
+ int pid;
struct ilmSurfaceProperties SurfaceProperties;
ICO_TRA("CicoSCWindowController::createSurfaceCB Enter"
id_surface);
return;
}
- ICO_TRA("createSurfaceCB: surface=%d(0x%08x) pid=%d w/h=%d/%d(%d/%d)->%d/%d",
- id_surface, id_surface, SurfaceProperties.creatorPid,
- SurfaceProperties.sourceWidth, SurfaceProperties.sourceHeight,
- SurfaceProperties.origSourceWidth, SurfaceProperties.origSourceHeight,
+ ICO_TRA("createSurfaceCB: surface=%08x w/h=%d/%d->%d/%d",
+ id_surface, SurfaceProperties.sourceWidth, SurfaceProperties.sourceHeight,
SurfaceProperties.destWidth, SurfaceProperties.destHeight);
-#if 1 /* 2014/08/20 workaround, SurfaceProperties.creatorPid not set */
- if (SurfaceProperties.creatorPid == 0) {
- SurfaceProperties.creatorPid = (id_surface - 6000) / 100;
- ICO_WRN("createSurfaceCB: surface=%d(0x%08x) pid is Zero, workaround to %d",
- id_surface, id_surface, SurfaceProperties.creatorPid);
- }
-#endif
-
CicoSCWindow* window = new CicoSCWindow();
window->surfaceid = id_surface;
- window->name = "";
- window->pid = SurfaceProperties.creatorPid;
+ 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
window->srcwidth = SurfaceProperties.sourceWidth;
window->height = SurfaceProperties.destHeight;
window->layerid = 0;
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
- const char *title = CicoSCWlWinMgrIF::wlIviCtrlGetSurfaceWaiting(id_surface, &pid);
-
- if (title) {
- window->name = title;
- window->pid = pid;
- }
- else {
- ICO_WRN("Could not find window title!");
- }
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
-
CicoSCLifeCycleController* appctrl;
appctrl = CicoSCLifeCycleController::getInstance();
const CicoAilItems* ailItem = NULL;
ICO_DBG("application information not found. search parent process");
int fd;
- int cpid = window->pid;
+ int cpid = pid;
int ppid;
int size;
char *ppid_line;
else {
show(window->surfaceid, NULL, 0);
}
-
- // set surface change notification
- if (ilm_surfaceAddNotification(window->surfaceid, wlGeniviSurfaceNotification)
- != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::createSurfaceCB "
- "ilm_surfaceAddNotification(%08x) Error", window->surfaceid);
- }
-
ICO_TRA("CicoSCWindowController::createSurfaceCB Leave");
}
}
break;
}
+ case MSG_CMD_ANIMATION:
+ ICO_DBG("command: MSG_CMD_ANIMATION");
+ (void)setWindowAnimation(opt->surfaceid, opt->animationType,
+ opt->animation.c_str(), opt->animationTime);
+ break;
case MSG_CMD_CHANGE_ACTIVE:
ICO_DBG("command: MSG_CMD_CHANGE_ACTIVE");
(void)active(opt->surfaceid, opt->active);
{
return m_resMgr;
}
-
-//--------------------------------------------------------------------------
-/**
- * @brief Window Check Timer
- * @param data this object
- */
-//--------------------------------------------------------------------------
-Eina_Bool
-CicoSCWindowController::ico_SCWindowChecker(void *data)
-{
- struct ico_sc_win_check_t *tp, *bp;
- struct timeval curtime;
- int ntime;
- int delflag;
- int commflag;
- int par;
- int htimer = 0;
- double rate;
- int x, y;
-
- gettimeofday(&curtime, NULL);
-
- if ((curtime.tv_sec < g_lasttime.tv_sec) ||
- ((curtime.tv_sec - g_lasttime.tv_sec) > 2)) {
- ntime = ICO_SC_WINCHK_TIMER_BASE;
- htimer ++;
- }
- else {
- ntime = (curtime.tv_sec - g_lasttime.tv_sec) * 1000;
- if (curtime.tv_usec >= g_lasttime.tv_usec) {
- ntime += (curtime.tv_usec - g_lasttime.tv_usec) / 1000;
- }
- else {
- ntime += ((1000000 + curtime.tv_usec - g_lasttime.tv_usec) / 1000) - 1000;
- }
- }
- tp = CicoSCWindowController::win_check_timer;
- bp = NULL;
- delflag = 0;
- commflag = 0;
- while (tp) {
- tp->lapsed += ntime;
- tp->timeout += ntime;
- if (tp->function != ICO_SC_WINCHK_CONTENTS_CHECK) {
- htimer ++;
- }
-
- if (tp->timeout >= tp->cycle) {
- /* timedout */
- do {
- tp->timeout -= tp->cycle;
- } while (tp->timeout > 0);
-
- switch (tp->function) {
- case ICO_SC_WINCHK_CONTENTS_CHECK: /* check contents change */
- if (tp->state == ICO_SC_WINCONT_CHECK) {
- // GENIVI-LM 1.6.0 not support contents change event
- // get surface image form GENIVI-LM
- ICO_DBG("CicoSCWindowController::ico_SCWindowChecker "
- "call ilm_takeSurfaceScreenshot %d[%x]",
- tp->surfaceid, tp->surfaceid);
- getInstance()->setmapGet(tp->surfaceid, tp->u.cont.path);
- tp->state = ICO_SC_WINCONT_WAITFILE;
- tp->time = ICO_SC_WINCHK_TIMER_BASE;
- tp->cycle = ICO_SC_WINCHK_TIMER_BASE;
- tp->timeout = 0;
- }
- else {
- struct stat stat_buf;
-
- if (stat(tp->u.cont.path, &stat_buf) >= 0) {
- tp->state = ICO_SC_WINCONT_CHECK;
- tp->time = ICO_SC_WINCHK_CONTENTS_TIME;
- tp->cycle = ICO_SC_WINCHK_CONTENTS_TIME;
- tp->timeout = 0;
-
- getInstance()->mapSurfaceCB(ICO_SC_WINCHK_MAP_SURFACE_EVENT_MAP,
- tp->surfaceid, 0,
- tp->u.cont.width, tp->u.cont.height,
- tp->u.cont.width * 4, 0);
- }
- }
- break;
-
- case ICO_SC_WINCHK_ANIMA_FADE: /* fade animation */
- par = ((tp->lapsed * 100 / tp->time) / 3) * 3;
- if (par == tp->par) break;
-
- if (par < 0) par = 0;
- tp->par = par;
- if (par >= 97) {
- if (ilm_surfaceSetOpacity(tp->surfaceid, 1.0) != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::ico_SCWindowChecker "
- "ilm_surfaceSetOpacity Error %d[%x]",
- tp->surfaceid, tp->surfaceid);
- }
- if (tp->state != ICO_SC_WINANIMA_SHOW) {
- if (ilm_surfaceSetVisibility(tp->surfaceid, 0) != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::ico_SCWindowChecker "
- "ilm_surfaceSetVisibility Error %d[%x]",
- tp->surfaceid, tp->surfaceid);
- }
- }
- delflag = 1;
- }
- else {
- if (tp->state == ICO_SC_WINANIMA_SHOW) {
- rate = ((double)par) / 100.0;
- }
- else {
- rate = ((double)(100 - par)) / 100.0;
- }
- if (ilm_surfaceSetOpacity(tp->surfaceid, rate) != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::ico_SCWindowChecker "
- "ilm_surfaceSetOpacity Error %d[%x]",
- tp->surfaceid, tp->surfaceid);
- }
- }
- commflag ++;
- break;
-
- case ICO_SC_WINCHK_ANIMA_SLIDETOTOP: /* slide totop animation */
- case ICO_SC_WINCHK_ANIMA_SLIDETOBUTTOM: /* slide totop animation */
- case ICO_SC_WINCHK_ANIMA_SLIDETOLEFT: /* slide totop animation */
- case ICO_SC_WINCHK_ANIMA_SLIDETORIGHT: /* slide totop animation */
- par = ((tp->lapsed * 100 / tp->time) / 3) * 3;
- if (par == tp->par) break;
-
- if (par < 0) par = 0;
- tp->par = par;
- if (par >= 97) {
- if (tp->state != ICO_SC_WINANIMA_SHOW) {
- if (ilm_surfaceSetVisibility(tp->surfaceid, 0) != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::ico_SCWindowChecker "
- "ilm_surfaceSetVisibility Error %d[%x]",
- tp->surfaceid, tp->surfaceid);
- }
- }
- x = tp->u.anim.x;
- y = tp->u.anim.y;
- delflag = 1;
- }
- else {
- if (tp->function == ICO_SC_WINCHK_ANIMA_SLIDETOTOP) {
- x = tp->u.anim.x;
- if (tp->state == ICO_SC_WINANIMA_SHOW) {
- y = tp->u.anim.screen_height -
- (tp->u.anim.screen_height - tp->u.anim.y) * par / 100;
- }
- else {
- y = tp->u.anim.y +
- (tp->u.anim.screen_height - tp->u.anim.y) * par / 100;
- }
- }
- else if (tp->function == ICO_SC_WINCHK_ANIMA_SLIDETOBUTTOM) {
- x = tp->u.anim.x;
- if (tp->state == ICO_SC_WINANIMA_SHOW) {
- y = (-tp->u.anim.height) +
- (tp->u.anim.y + tp->u.anim.height) * par / 100;
- }
- else {
- y = tp->u.anim.y -
- (tp->u.anim.height + tp->u.anim.y) * par / 100;
- }
- }
- else if (tp->function == ICO_SC_WINCHK_ANIMA_SLIDETOLEFT) {
- y = tp->u.anim.y;
- if (tp->state == ICO_SC_WINANIMA_SHOW) {
- x = tp->u.anim.screen_width -
- (tp->u.anim.screen_width - tp->u.anim.x) * par / 100;
- }
- else {
- x = tp->u.anim.x +
- (tp->u.anim.screen_width - tp->u.anim.x) * par / 100;
- }
- }
- else {
- y = tp->u.anim.y;
- if (tp->state == ICO_SC_WINANIMA_SHOW) {
- x = (-tp->u.anim.width) +
- (tp->u.anim.x + tp->u.anim.width) * par / 100;
- }
- else {
- x = tp->u.anim.x -
- (tp->u.anim.x + tp->u.anim.width) * par / 100;
- }
- }
- }
- if (ilm_surfaceSetDestinationRectangle(tp->surfaceid, x, y,
- tp->u.anim.width, tp->u.anim.height)
- != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::ico_SCWindowChecker "
- "ilm_surfaceSetDestinationRectangle Error %d[%x]",
- tp->surfaceid, tp->surfaceid);
- }
- commflag ++;
- break;
- }
- }
- if (delflag) {
- delflag = 0;
- if (bp == NULL) {
- tp = tp->next;
- CicoSCWindowController::win_check_timer = tp;
- }
- else {
- bp->next = tp->next;
- tp->next = CicoSCWindowController::win_check_free;
- CicoSCWindowController::win_check_free = tp;
- tp = bp->next;
- }
- }
- else {
- bp = tp;
- tp = tp->next;
- }
- }
- if (commflag) {
- if (ilm_commitChanges() != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::ico_SCWindowChecker "
- "ilm_commitChanges Error");
- }
- }
- g_lasttime = curtime;
- if (((htimer == 0) && (g_hightimer != 0)) ||
- ((htimer != 0) && (g_hightimer == 0))) {
- // change timer speed
- g_hightimer = 1 - g_hightimer;
-
- ecore_timer_interval_set(g_SCWindowChecker,
- ((double)(g_hightimer ?
- ICO_SC_WINCHK_TIMER_BASE : ICO_SC_WINCHK_TIMER_BASE_L)) / 1000.0);
- }
- return ECORE_CALLBACK_RENEW;
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief window checker destroy surface
- * @param surfaceid surface id
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWindowController::windowCheckerRemove(uint32_t surfaceid)
-{
- struct ico_sc_win_check_t *tp, *bp, *fp;
-
- ICO_TRA("CicoSCWindowController::windowCheckerRemove: Enter %d[%x]",
- surfaceid, surfaceid);
-
- resetWindowMap(surfaceid);
-
- tp = CicoSCWindowController::win_check_timer;
- bp = NULL;
- while (tp) {
- if (tp->surfaceid == surfaceid) {
- // delete check target
- if (tp->function == ICO_SC_WINCHK_CONTENTS_CHECK) {
- ICO_DBG("CicoSCWindowController::windowCheckerRemove: Remove Thumbnail %d",
- tp->surfaceid);
- }
-
- fp = tp;
- if (bp == NULL) {
- tp = tp->next;
- CicoSCWindowController::win_check_timer = tp;
- }
- else {
- bp->next = tp->next;
- tp = tp->next;
- }
- fp->next = CicoSCWindowController::win_check_free;
- CicoSCWindowController::win_check_free = fp;
- }
- else {
- bp = tp;
- tp = tp->next;
- }
- }
- ICO_TRA("CicoSCWindowController::windowCheckerRemove: Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief window checker set animation
- * @param window window object
- * @param show show/hide
- * @param animation animation name
- * @param time animation time(ms)
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWindowController::setWindowAnimation(CicoSCWindow *window,
- int show, const char *animation, int time)
-{
- struct ico_sc_win_check_t *tp, *bp;
- uint32_t surfaceid = window->surfaceid;
-
- ICO_TRA("CicoSCWindowController::setWindowAnimation: Enter %d[%x] %d <%s> %d",
- surfaceid, surfaceid, show, animation, time);
-
- tp = CicoSCWindowController::win_check_timer;
- bp = NULL;
- while (tp) {
- if ((tp->surfaceid == surfaceid) &&
- ((tp->function == ICO_SC_WINCHK_ANIMA_FADE) ||
- (tp->function == ICO_SC_WINCHK_ANIMA_SLIDETOTOP) ||
- (tp->function == ICO_SC_WINCHK_ANIMA_SLIDETOBUTTOM) ||
- (tp->function == ICO_SC_WINCHK_ANIMA_SLIDETOLEFT) ||
- (tp->function == ICO_SC_WINCHK_ANIMA_SLIDETORIGHT))) {
- // same surface target
- break;
- }
- bp = tp;
- tp = tp->next;
- }
- if (! tp) {
- tp = CicoSCWindowController::win_check_free;
- if (tp) {
- CicoSCWindowController::win_check_free = tp->next;
- }
- else {
- tp = (struct ico_sc_win_check_t *)malloc(sizeof(struct ico_sc_win_check_t));
- if (! tp) {
- ICO_ERR("CicoSCWindowController::setWindowAnimation: Out of Memory");
- return;
- }
- }
- memset(tp, 0, sizeof(struct ico_sc_win_check_t));
- if (bp) {
- bp->next = tp;
- }
- else {
- CicoSCWindowController::win_check_timer = tp;
- }
- }
-
- tp->surfaceid = surfaceid;
- tp->time = time;
- tp->lapsed = 0;
- tp->par = -1;
- tp->timeout = ICO_SC_WINCHK_ANIMATION_TIME;
- tp->cycle = ICO_SC_WINCHK_ANIMATION_TIME;
- if ((strcasecmp(animation, ICO_SYC_WIN_ANIMATION_SLIDE) == 0) ||
- (strcasecmp(animation, ICO_SYC_WIN_ANIMATION_SLIDE_TOTOP) == 0)) {
- tp->function = ICO_SC_WINCHK_ANIMA_SLIDETOTOP;
- }
- else if (strcasecmp(animation, ICO_SYC_WIN_ANIMATION_SLIDE_TOBUTTOM) == 0) {
- tp->function = ICO_SC_WINCHK_ANIMA_SLIDETOBUTTOM;
- }
- else if (strcasecmp(animation, ICO_SYC_WIN_ANIMATION_SLIDE_TOLEFT) == 0) {
- tp->function = ICO_SC_WINCHK_ANIMA_SLIDETOLEFT;
- }
- else if (strcasecmp(animation, ICO_SYC_WIN_ANIMATION_SLIDE_TORIGHT) == 0) {
- tp->function = ICO_SC_WINCHK_ANIMA_SLIDETORIGHT;
- }
- else {
- tp->function = ICO_SC_WINCHK_ANIMA_FADE;
- }
- tp->state = show;
- tp->u.anim.x = window->x;
- tp->u.anim.y = window->y;
- tp->u.anim.width = window->width;
- tp->u.anim.height = window->height;
- tp->u.anim.screen_width = 1080;
- tp->u.anim.screen_height = 1920;
-
- vector<CicoSCDisplay*>::iterator itr;
- itr = m_displayList.begin();
- for (; itr != m_displayList.end(); ++itr) {
- if ((*itr)->displayid == window->displayid) {
- tp->u.anim.screen_width = (*itr)->pWidth;
- tp->u.anim.screen_height = (*itr)->pHeight;
- break;
- }
- }
- (void) CicoSCWindowController::ico_SCWindowChecker(NULL);
-
- ICO_TRA("CicoSCWindowController::setWindowAnimation: Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief window checker reset animation
- * @param window window object
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWindowController::resetWindowAnimation(CicoSCWindow *window)
-{
- struct ico_sc_win_check_t *tp, *bp;
- uint32_t surfaceid = window->surfaceid;
-
- ICO_TRA("CicoSCWindowController::resetWindowAnimation: Enter %d[%x]",
- surfaceid, surfaceid);
-
- tp = CicoSCWindowController::win_check_timer;
- bp = NULL;
- while (tp) {
- if ((tp->surfaceid == surfaceid) &&
- ((tp->function == ICO_SC_WINCHK_ANIMA_FADE) ||
- (tp->function == ICO_SC_WINCHK_ANIMA_SLIDETOTOP) ||
- (tp->function == ICO_SC_WINCHK_ANIMA_SLIDETOBUTTOM) ||
- (tp->function == ICO_SC_WINCHK_ANIMA_SLIDETOLEFT) ||
- (tp->function == ICO_SC_WINCHK_ANIMA_SLIDETORIGHT))) {
- // delete surface target
- if (ilm_surfaceSetOpacity(tp->surfaceid, 1.0) != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::resetWindowAnimation "
- "ilm_surfaceSetOpacity Error %d[%x]",
- tp->surfaceid, tp->surfaceid);
- }
- if (ilm_surfaceSetDestinationRectangle(tp->surfaceid,
- tp->u.anim.x, tp->u.anim.y,
- tp->u.anim.width, tp->u.anim.height)
- != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::resetWindowAnimation "
- "ilm_surfaceSetDestinationRectangle Error %d[%x]",
- tp->surfaceid, tp->surfaceid);
- }
- if (ilm_surfaceSetVisibility(tp->surfaceid,
- (tp->state == ICO_SC_WINANIMA_SHOW) ? 1 : 0) != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::resetWindowAnimation "
- "ilm_surfaceSetVisibility Error %d[%x]",
- tp->surfaceid, tp->surfaceid);
- }
- if (ilm_commitChanges() != ILM_SUCCESS) {
- ICO_ERR("CicoSCWindowController::resetWindowAnimation "
- "ilm_commitChanges Error");
- }
- if (bp == NULL) {
- CicoSCWindowController::win_check_timer = tp->next;
- }
- else {
- bp->next = tp->next;
- }
- tp->next = CicoSCWindowController::win_check_free;
- CicoSCWindowController::win_check_free = tp;
- break;
- }
- bp = tp;
- tp = tp->next;
- }
- ICO_TRA("CicoSCWindowController::resetWindowAnimation: Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief window checker set map
- * @param window window object
- * @param framerate frame rate(frames/sec or -1)
- * @param filepath surface image file path
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWindowController::setWindowMap(CicoSCWindow *window,
- int framerate, const char *filepath)
-{
- struct ico_sc_win_check_t *tp, *bp;
- uint32_t surfaceid = window->surfaceid;
-
- ICO_TRA("CicoSCWindowController::setWindowMap: Enter %d[%x],%d,<%s>",
- surfaceid, surfaceid, framerate, filepath);
-
- tp = CicoSCWindowController::win_check_timer;
- bp = NULL;
- while (tp) {
- if ((tp->surfaceid == surfaceid) &&
- (tp->function == ICO_SC_WINCHK_CONTENTS_CHECK)) {
- // same surface target
- break;
- }
- bp = tp;
- tp = tp->next;
- }
- if (! tp) {
- tp = CicoSCWindowController::win_check_free;
- if (tp) {
- CicoSCWindowController::win_check_free = tp->next;
- }
- else {
- tp = (struct ico_sc_win_check_t *)malloc(sizeof(struct ico_sc_win_check_t));
- if (! tp) {
- ICO_ERR("CicoSCWindowController::setWindowMap: Out of Memory");
- return;
- }
- }
- memset(tp, 0, sizeof(struct ico_sc_win_check_t));
- if (bp) {
- bp->next = tp;
- }
- else {
- CicoSCWindowController::win_check_timer = tp;
- }
- }
- tp->function = ICO_SC_WINCHK_CONTENTS_CHECK;
- tp->surfaceid = surfaceid;
- if (framerate <= 0) {
- tp->cycle = 0x7fff;
- }
- else {
- tp->cycle = 1000/framerate;
- }
- tp->time = 0x7fff;
- tp->lapsed = 0;
- tp->par = -1;
- tp->timeout = 0;
- strncpy(tp->u.cont.path, filepath, ICO_SYC_MAX_LEN-1);
- tp->state = ICO_SC_WINCONT_CHECK;
- tp->u.cont.x = window->x;
- tp->u.cont.y = window->y;
- tp->u.cont.width = window->width;
- tp->u.cont.height = window->height;
-
- (void) CicoSCWindowController::ico_SCWindowChecker(NULL);
-
- ICO_TRA("CicoSCWindowController::setWindowMap: Leave");
-}
-
-//--------------------------------------------------------------------------
-/**
- * @brief window checker reset map
- * @param surfaceid surface id
- */
-//--------------------------------------------------------------------------
-void
-CicoSCWindowController::resetWindowMap(uint32_t surfaceid)
-{
- struct ico_sc_win_check_t *tp, *bp;
-
- ICO_TRA("CicoSCWindowController::resetWindowMap: Enter %d[%x]",
- surfaceid, surfaceid);
-
- tp = CicoSCWindowController::win_check_timer;
- bp = NULL;
- while (tp) {
- if ((tp->surfaceid == surfaceid) &&
- (tp->function == ICO_SC_WINCHK_CONTENTS_CHECK)) {
- if (bp == NULL) {
- CicoSCWindowController::win_check_timer = tp->next;
- }
- else {
- bp->next = tp->next;
- }
- tp->next = CicoSCWindowController::win_check_free;
- CicoSCWindowController::win_check_free = tp;
- break;
- }
- bp = tp;
- tp = tp->next;
- }
- if (tp) {
- mapSurfaceCB(ICO_SC_WINCHK_MAP_SURFACE_EVENT_UNMAP,
- tp->surfaceid, 0, tp->u.cont.width, tp->u.cont.height,
- tp->u.cont.width * 4, 0);
- }
- ICO_TRA("CicoSCWindowController::resetWindowMap: Leave");
-}
// vim:set expandtab ts=4 sw=4:
#include <vector>
#include <map>
-#include "ico_syc_private.h"
using namespace std;
#define ICO_SC_APPID_DEFAULT_ONS "org.tizen.ico.onscreen"
#define ICO_SC_LAYERID_SCREENBASE 1000
-#define ICO_SC_WINCHK_TIMER_BASE 20 /* window check timer cycle(ms) */
-#define ICO_SC_WINCHK_TIMER_BASE_L 50 /* window check timer slow cycle(ms)*/
-#define ICO_SC_WINCHK_ANIMATION_TIME 20 /* window check timer cycle(ms) */
-#define ICO_SC_WINCHK_CONTENTS_TIME 1000 /* window contents check time(ms) */
-
-#define ICO_SC_WINCHK_CONTENTS_CHECK 101
-#define ICO_SC_WINCHK_ANIMA_FADE 201
-#define ICO_SC_WINCHK_ANIMA_SLIDETOTOP 211
-#define ICO_SC_WINCHK_ANIMA_SLIDETOBUTTOM 212
-#define ICO_SC_WINCHK_ANIMA_SLIDETOLEFT 213
-#define ICO_SC_WINCHK_ANIMA_SLIDETORIGHT 214
-
-#define ICO_SC_WINANIMA_SHOW 1
-#define ICO_SC_WINANIMA_HIDE 2
-
-#define ICO_SC_WINCONT_CHECK 1
-#define ICO_SC_WINCONT_WAITFILE 2
-
-#define ICO_SC_WINCHK_MAP_SURFACE_EVENT_MAP 1
-#define ICO_SC_WINCHK_MAP_SURFACE_EVENT_UNMAP 2
-#define ICO_SC_WINCHK_MAP_SURFACE_EVENT_CONTENTS 3
-
-struct ico_sc_win_check_t {
- struct ico_sc_win_check_t *next;
- uint32_t surfaceid;
- short time;
- short cycle;
- short lapsed;
- short timeout;
- short function;
- short state;
- short par;
- union {
- struct {
- short x;
- short y;
- short width;
- short height;
- short screen_width;
- short screen_height;
- } anim;
- struct {
- short x;
- short y;
- short width;
- short height;
- char path[ICO_SYC_MAX_LEN];
- } cont;
- } u;
-};
-
//==========================================================================
// Forward declaration
//==========================================================================
int lower(int surfaceid, const char *animation, int animationTime);
+ int setWindowAnimation(int surfaceid, int type, const char *animation, int time);
+
int setWindowLayer(int surfaceid, int layerid);
int showLayer(int displayid, int layerid);
t_ilm_notification_mask mask);
//
virtual void activeCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
uint32_t surfaceid,
int32_t select);
- virtual void mapSurfaceCB(int32_t event,
+ virtual void mapSurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ int32_t event,
uint32_t surfaceid,
uint32_t type,
int32_t width,
int32_t stride,
uint32_t format);
- static void wlGeniviSurfaceNotification(t_ilm_surface surfaceid,
- struct ilmSurfaceProperties *surfprop,
- t_ilm_notification_mask mask);
-
- virtual void updateSurfaceCB(uint32_t surfaceid,
- struct ilmSurfaceProperties *surfprop);
-
- virtual void destroySurfaceCB(uint32_t surfaceid);
+ virtual void updateSurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid,
+ int visible,
+ int srcwidth,
+ int srcheight,
+ int x,
+ int y,
+ int width,
+ int height);
+
+ virtual void destroySurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid);
virtual void updateWinnameCB(uint32_t surfaceid,
const char *winname);
const char *animation,
int animationTime);
- // window checker
- void windowCheckerRemove(uint32_t surfaceid);
-
- void setWindowAnimation(CicoSCWindow *window, int show,
- const char *animation, int time);
-
- void resetWindowAnimation(CicoSCWindow *window);
-
- void setWindowMap(CicoSCWindow *window, int framerate, const char *filepath);
-
- void resetWindowMap(uint32_t surfaceid);
-
-protected:
- static Eina_Bool ico_SCWindowChecker(void *data);
-
private:
/// my instance
static CicoSCWindowController *ms_myInstance;
// total of physical display
unsigned int m_physicalDisplayTotal;
-
-protected:
- // window check timer
- static struct ico_sc_win_check_t *win_check_timer;
- static struct ico_sc_win_check_t *win_check_free;
};
#endif // __CICO_SC_WINDOW_CONTROLLER_H__
// vim:set expandtab ts=4 sw=4:
*/
//--------------------------------------------------------------------------
CicoSCWlInputMgrIF::CicoSCWlInputMgrIF()
+ : m_inputmgr(NULL), m_exinput(NULL), m_inputmgrdev(NULL)
{
+ // ico_exinput listener
+ m_exInputListener.capabilities = wlCapabilitiesCB;
+ m_exInputListener.code = wlCodeCB;
+ m_exInputListener.input = wlInputCB;
+
+ // ico_input_mgr_device listener
+ m_devListener.input_regions = wlRegionCB;
}
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
/**
- * @brief initialize input interfaces
+ * @brief initialize ico_input_mgr interfaces
*
* @param [in] data user data
* @param [in] registry wayland registry
const char *interface,
uint32_t version)
{
- ICO_TRA("CicoSCWlInputMgrIF::initInterface : Enter(interface=%s)", interface);
- m_initialized = true;
+ ICO_TRA("CicoSCWlInputMgrIF::initInterface : Enter(interface=%s)",
+ interface);
+
+ if (0 == strcmp(interface, ICO_WL_INPUT_MGR_CTRL_IF)) {
+ // get interface instance
+ ICO_DBG("called: wl_registry_bind");
+ void *wlProxy = wl_registry_bind(registry,
+ name,
+ &ico_input_mgr_control_interface,
+ 1);
+ if (NULL == wlProxy) {
+ ICO_WRN("interface(%s) wl_registry_bind failed.", interface);
+ ICO_TRA("CicoSCWlInputMgrIF::initInterface Leave",
+ "(binding failed)");
+ return;
+ }
+ m_inputmgr = (struct ico_input_mgr_control*)wlProxy;
+ }
+ else if (0 == strcmp(interface, ICO_WL_EXINPUT_IF)) {
+ // get interface instance
+ ICO_DBG("called: wl_registry_bind");
+ void *wlProxy = wl_registry_bind(registry,
+ name,
+ &ico_exinput_interface,
+ 1);
+ if (NULL == wlProxy) {
+ ICO_WRN("interface(%s) wl_registry_bind failed.", interface);
+ ICO_TRA("CicoSCWlInputMgrIF::initInterface Leave",
+ "(binding failed)");
+ return;
+ }
+
+ m_exinput = (struct ico_exinput*)wlProxy;
+ ico_exinput_add_listener(m_exinput,
+ &m_exInputListener,
+ this);
+ }
+ else if (0 == strcmp(interface, ICO_WL_INPUT_MGR_DEV_IF)) {
+ // get interface instance
+ ICO_DBG("called: wl_registry_bind");
+ void *wlProxy = wl_registry_bind(registry,
+ name,
+ &ico_input_mgr_device_interface,
+ 1);
+ if (NULL == wlProxy) {
+ ICO_WRN("interface(%s) wl_registry_bind failed.", interface);
+ ICO_TRA("CicoSCWlInputMgrIF::initInterface Leave"
+ "(binding failed)");
+ return;
+ }
+
+ m_inputmgrdev = (struct ico_input_mgr_device*)wlProxy;
+ ico_input_mgr_device_add_listener(m_inputmgrdev,
+ &m_devListener,
+ this);
+ }
+
+ if ((NULL != m_inputmgrdev) &&
+ (NULL != m_inputmgr) &&
+ (NULL != m_exinput)) {
+ m_initialized = true;
+ }
ICO_TRA("CicoSCWlInputMgrIF::initInterface Leave");
}
//--------------------------------------------------------------------------
/**
- * @brief wrapper function add_input_app
+ * @brief wrapper function ico_input_mgr_control_add_input_app
*
* @param [in] appid application id
* @param [in] device input device name
int fix,
int keycode)
{
- ICO_DBG("called: add_input_app"
+ ICO_DBG("called: ico_input_mgr_control_add_input_app"
"(appid=%s device=%s input=%d fix=%d keycode=%d)",
appid.c_str(), device.c_str(), input, fix, keycode);
+ ico_input_mgr_control_add_input_app(m_inputmgr,appid.c_str(),
+ device.c_str(), input, fix, keycode);
+ // flush display
+ CicoSCWayland::getInstance()->flushDisplay();
}
//--------------------------------------------------------------------------
/**
- * @brief wrapper function del_input_app
+ * @brief wrapper function ico_input_mgr_control_del_input_app
*
* @param [in] appid application id
* @param [in] device input device name
const string &device,
int input)
{
- ICO_DBG("called: del_input_app"
+ ICO_DBG("called: ico_input_mgr_control_del_input_app"
"(appid=%s device=%s input=%d)",
appid.c_str(), device.c_str(), input);
+ ico_input_mgr_control_del_input_app(m_inputmgr, appid.c_str(),
+ device.c_str(), input);
+ // flush display
+ CicoSCWayland::getInstance()->flushDisplay();
}
//--------------------------------------------------------------------------
/**
- * @brief wrapper function set_input_region
+ * @brief wrapper function ico_exinput_set_input_region
*
* @param [in] target target window name(winname@appid)
* @param [in] x region x positon
int cursor_height,
int attr)
{
- ICO_DBG("called: set_input_region"
+ ICO_DBG("called: ico_exinput_set_input_region"
"(target=%s x/y=%d/%d w/h=%d/%d hot=%d/%d "
"cursor=%d/%d-%d/%d attr=%d)",
target.c_str(), x, y, width, height, hotspot_x, hotspot_y,
cursor_x, cursor_y, cursor_width, cursor_height, attr);
+ ico_exinput_set_input_region(m_exinput, target.c_str(), x, y,
+ width, height, hotspot_x, hotspot_y, cursor_x,
+ cursor_y, cursor_width, cursor_height,attr);
+ // flush display
+ CicoSCWayland::getInstance()->flushDisplay();
}
//--------------------------------------------------------------------------
/**
- * @brief wrapper function unset_input_region
+ * @brief wrapper function ico_exinput_unset_input_region
*
* @param [in] target target window name(winname@appid)
* @param [in] x region x positon
int width,
int height)
{
- ICO_DBG("called: unset_input_region"
+ ICO_DBG("called: ico_exinput_unset_input_region"
"(target=%s x=%d y=%d width=%d height=%d",
target.c_str(), x, y, width, height);
+ ico_exinput_unset_input_region(m_exinput, target.c_str(),
+ x, y, width, height);
+ // flush display
+ CicoSCWayland::getInstance()->flushDisplay();
}
//--------------------------------------------------------------------------
* @brief callback to application for input switch information
*
* @param [in] data user data
+ * @param [in] ico_exinput wayland ico_exinput interface
* @param [in] device input device name
* @param [in] type input device type (as enum type)
* @param [in] swname input switch name
//--------------------------------------------------------------------------
void
CicoSCWlInputMgrIF::capabilitiesCB(void *data,
+ struct ico_exinput *ico_exinput,
const char *device,
int32_t type,
const char *swname,
* @brief callback to application for input code information
*
* @param [in] data user data
+ * @param [in] ico_exinput wayland ico_exinput interface
* @param [in] device input device name
* @param [in] input input switch number
* @param [in] codename input code name
//--------------------------------------------------------------------------
void
CicoSCWlInputMgrIF::codeCB(void *data,
+ struct ico_exinput *ico_exinput,
const char *device,
int32_t input,
const char *codename,
* @brief callback to application for switch input
*
* @param [in] data user data
+ * @param [in] ico_exinput wayland ico_exinput interface
* @param [in] time input time of millisecond
* @param [in] device input device name
* @param [in] input input switch number
//--------------------------------------------------------------------------
void
CicoSCWlInputMgrIF::inputCB(void *data,
+ struct ico_exinput *ico_exinput,
uint32_t time,
const char *device,
int32_t input,
* @brief callback to application for change input region
*
* @param [in] data user data
+ * @param [in] ico_input_mgr_dev wayland ico_exinput interface
* @param [in] region input regions
*/
//--------------------------------------------------------------------------
void
CicoSCWlInputMgrIF::regionCB(void *data,
+ struct ico_input_mgr_device *ico_input_mgr_dev,
struct wl_array *region)
{
ICO_WRN("CicoSCWlInputMgrIF::regionCB called.");
* @brief callback to application for input switch information
*
* @param [in] data user data
+ * @param [in] ico_exinput wayland ico_exinput interface
* @param [in] device input device name
* @param [in] type input device type (as enum type)
* @param [in] swname input switch name
//--------------------------------------------------------------------------
void
CicoSCWlInputMgrIF::wlCapabilitiesCB(void *data,
+ struct ico_exinput *ico_exinput,
const char *device,
int32_t type,
const char *swname,
const char *codename,
int32_t code)
{
+// ICO_TRA("CicoSCWlInputMgrIF::wlCapabilitiesCB Enter");
+
if (NULL == data) {
ICO_WRN("wlCapabilitiesCB: data is null");
return;
}
- static_cast<CicoSCWlInputMgrIF*>(data)->capabilitiesCB(data, device, type,
+ static_cast<CicoSCWlInputMgrIF*>(data)->capabilitiesCB(data, ico_exinput,
+ device, type,
swname, input,
codename, code);
+// ICO_TRA("CicoSCWlInputMgrIF::wlCapabilitiesCB Leave");
}
//--------------------------------------------------------------------------
* @brief callback to application for input code information
*
* @param [in] data user data
+ * @param [in] ico_exinput wayland ico_exinput interface
* @param [in] device input device name
* @param [in] input input switch number
* @param [in] codename input code name
//--------------------------------------------------------------------------
void
CicoSCWlInputMgrIF::wlCodeCB(void *data,
+ struct ico_exinput *ico_exinput,
const char *device,
int32_t input,
const char *codename,
int32_t code)
{
+// ICO_TRA("CicoSCWlInputMgrIF::wlCodeCB Enter");
+
if (NULL == data) {
ICO_WRN("wlCodeCB: data is null");
return;
}
- static_cast<CicoSCWlInputMgrIF*>(data)->codeCB(data, device, input,
+ static_cast<CicoSCWlInputMgrIF*>(data)->codeCB(data, ico_exinput,
+ device, input,
codename, code);
+
+// ICO_TRA("CicoSCWlInputMgrIF::wlCodeCB Leave");
}
//--------------------------------------------------------------------------
* @brief callback to application for switch input
*
* @param [in] data user data
+ * @param [in] ico_exinput wayland ico_exinput interface
* @param [in] time input time of millisecond
* @param [in] device input device name
* @param [in] input input switch number
//--------------------------------------------------------------------------
void
CicoSCWlInputMgrIF::wlInputCB(void *data,
+ struct ico_exinput *ico_exinput,
uint32_t time,
const char *device,
int32_t input,
int32_t code,
int32_t state)
{
+// ICO_TRA("CicoSCWlInputMgrIF::wlInputCB Enter");
+
if (NULL == data) {
ICO_WRN("wlInputCB: data is null");
return;
}
- static_cast<CicoSCWlInputMgrIF*>(data)->inputCB(data, time, device, input,
+ static_cast<CicoSCWlInputMgrIF*>(data)->inputCB(data, ico_exinput,
+ time, device, input,
code, state);
+
+// ICO_TRA("CicoSCWlInputMgrIF::wlInputCB Leave");
}
//--------------------------------------------------------------------------
* @brief callback to application for change input region
*
* @param [in] data user data
+ * @param [in] ico_input_mgr_dev wayland ico_exinput interface
* @param [in] region input regions
*/
//--------------------------------------------------------------------------
void
CicoSCWlInputMgrIF::wlRegionCB(void *data,
+ struct ico_input_mgr_device *ico_input_mgr_dev,
struct wl_array *region)
{
+// ICO_TRA("CicoSCWlInputMgrIF::wlRegionCB Enter");
+
if (NULL == data) {
ICO_WRN("wlRegionCB: data is null");
return;
}
- static_cast<CicoSCWlInputMgrIF*>(data)->regionCB(data, region);
+ static_cast<CicoSCWlInputMgrIF*>(data)->regionCB(data, ico_input_mgr_dev,
+ region);
+
+// ICO_TRA("CicoSCWlInputMgrIF::wlRegionCB Leave");
}
// vim:set expandtab ts=4 sw=4:
#define __CICO_SC_WL_INPUT_MGR_IF_H__
#include <string>
+#include <ico-uxf-weston-plugin/ico_input_mgr-client-protocol.h>
#include "CicoSCWaylandIF.h"
//--------------------------------------------------------------------------
// capabilities callback function
void capabilitiesCB(void *data,
+ struct ico_exinput *ico_exinput,
const char *device,
int32_t type,
const char *swname,
// code callback function
void codeCB(void *data,
+ struct ico_exinput *ico_exinput,
const char *device,
int32_t input,
const char *codename,
// input callback function
void inputCB(void *data,
+ struct ico_exinput *ico_exinput,
uint32_t time,
const char *device,
int32_t input,
// region callback function
void regionCB(void *data,
+ struct ico_input_mgr_device *ico_input_mgr_device,
struct wl_array *region);
protected:
// copy constructor
CicoSCWlInputMgrIF(const CicoSCWlInputMgrIF &object);
- // wrapper function add_input_app
+ // wrapper function ico_input_mgr_control_add_input_app
void addInputApp(const std::string &appid,
const std::string &device,
int input,
int fix,
int keycode);
- // wrapper function del_input_app
+ // wrapper function ico_input_mgr_control_del_input_app
void delInputApp(const std::string &appid,
const std::string &device,
int input);
- // wrapper function input_region
+ // wrapper function ico_exinput_set_input_region
void setInputRegion(const std::string &target,
int x,
int y,
int cursor_height,
int attr);
- // wrapper function unset_input_region
+ // wrapper function ico_exinput_unset_input_region
void unsetInputRegion(const std::string &target,
int x,
int y,
int height);
private:
+ // ico_input_mgr(Multi Input Manager) callback functions
+
// wayland capabilities callback function
static void wlCapabilitiesCB(void *data,
+ struct ico_exinput *ico_exinput,
const char *device,
int32_t type,
const char *swname,
// wayland code callback function
static void wlCodeCB(void *data,
+ struct ico_exinput *ico_exinput,
const char *device,
int32_t input,
const char *codename,
// wayland input callback function
static void wlInputCB(void *data,
+ struct ico_exinput *ico_exinput,
uint32_t time,
const char *device,
int32_t input,
// wayland region callback function
static void wlRegionCB(void *data,
+ struct ico_input_mgr_device *ico_input_mgr_device,
struct wl_array *region);
protected:
+ // input manager interface
+ struct ico_input_mgr_control *m_inputmgr;
+
+ // extra input event interface
+ struct ico_exinput *m_exinput;
+
+ // input manage device interface
+ struct ico_input_mgr_device *m_inputmgrdev;
private:
+ // exinput listener
+ struct ico_exinput_listener m_exInputListener;
+
+ // input manager device listener
+ struct ico_input_mgr_device_listener m_devListener;
};
#endif // __CICO_SC_WL_INPUT_MGR_IF_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;
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
struct creation_surface_wait *CicoSCWlWinMgrIF::m_wait_surface_creation = NULL;
struct creation_surface_wait *CicoSCWlWinMgrIF::m_free_surface_creation = NULL;
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
//--------------------------------------------------------------------------
/**
//--------------------------------------------------------------------------
CicoSCWlWinMgrIF::CicoSCWlWinMgrIF()
{
- // 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;
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
- m_ivi_ctrl_listener.native_handle = wlIviCtrlNativeHandleCB;
+ // ico_window_mgr listener
+ m_listener.window_active = wlActiveCB;
+ m_listener.map_surface = wlMapSurfaceCB;
+ m_listener.update_surface = wlUpdateSurfaceCB;
+ m_listener.destroy_surface = wlDestroySurfaceCB;
// genivi ivi_application listener
m_ivi_app_listener.wl_shell_info = wlIviAppNativeShellInfoCB;
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
+
+ // 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;
//--------------------------------------------------------------------------
/**
- * @brief initialize GENIVI-LM interfaces
+ * @brief initialize ico_window_mgr interfaces
*
* @param [in] data user data
* @param [in] registry wayland registry
ICO_TRA("CicoSCWlWinMgrIF::initInterface Enter(interface=%s)", interface);
// check interface name
- if (0 == strcmp(interface, ICO_WL_IVI_CONTROLLER_IF)) {
+ if (0 == strcmp(interface, ICO_WL_WIN_MGR_IF)) {
// get interface instance
- ICO_DBG("called: wl_registry_bind for ivi_controller");
- void *wlProxy = wl_registry_bind(registry, name,
- &ivi_controller_interface, 1);
+ ICO_DBG("called: wl_registry_bind");
+ void *wlProxy = wl_registry_bind(registry,
+ name,
+ &ico_window_mgr_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,
+
+
+ m_winmgr = (struct ico_window_mgr *)wlProxy;
+ ico_window_mgr_add_listener(m_winmgr,
+ &m_listener,
this);
}
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
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);
+ void *wlProxy = wl_registry_bind(registry,
+ name,
+ &ivi_application_interface,
+ 1);
if (NULL == wlProxy) {
ICO_WRN("interface(%s) wl_registry_bind failed.",
interface);
&m_ivi_app_listener,
this);
}
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
+ 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
ICO_DBG("called: wl_registry_bind");
- void *wlProxy = wl_registry_bind(registry, name,
- &wl_output_interface, 1);
+ void *wlProxy = wl_registry_bind(registry,
+ name,
+ &wl_output_interface,
+ 1);
if (NULL == wlProxy) {
ICO_WRN("interface(%s) wl_registry_bind failed.",
interface);
return;
}
- if(NULL != m_wloutput) {
+ if((NULL != m_winmgr) && (NULL != m_wloutput)) {
m_initialized = true;
}
//--------------------------------------------------------------------------
/**
+ * @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
+ * @param [in] time time of animation
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWlWinMgrIF::setAnimation(uint32_t surfaceid, int32_t type,
+ const char *animation, int32_t time)
+{
+ ICO_DBG("called: ico_window_mgr_set_animation"
+ "(surfaceid=%08x type=%d anima=%s time=%d)",
+ surfaceid, type, animation, time);
+ ico_window_mgr_set_animation(m_winmgr, surfaceid, type, animation, time);
+ // need wayland flush for GENIVI layer management
+ CicoSCWayland::getInstance()->flushDisplay();
+}
+
+//--------------------------------------------------------------------------
+/**
* @brief wrapper function of ilm_SetKeyboardFocusOn
*
* @param [in] surfaceid wayland surface id
}
}
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
+//--------------------------------------------------------------------------
+/**
+ * @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, const char *filepath)
+{
+ ICO_DBG("called: ico_window_mgr_map_surface(surfaceid=%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
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWlWinMgrIF::unmapSurface(uint32_t surfaceid)
+{
+ ICO_DBG("called: ico_window_mgr_unmap_surface"
+ "(surfaceid=%08x)", surfaceid);
+ // currently GENIVI genivi-shell not support contents change, so use ico_window_mgr
+ ico_window_mgr_unmap_surface(m_winmgr, surfaceid);
+}
+
//--------------------------------------------------------------------------
/**
* @brief get creation surface window name(title) and pid
}
tp = tp->next;
}
- ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlGetSurfaceWaiting(%x) dose not exist",
- id_surface);
+ ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlGetSurfaceWaiting(%x) dose not exist", id_surface);
return NULL;
}
}
ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlRemoveSurface(%x) dose not exist", id_surface);
}
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
//--------------------------------------------------------------------------
/**
* @brief wayland surface active callback
*
* @param [in] data user data(unused)
- * @param [in] surfaceid surface Id
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
+ * @param [in] surfaceid ico_window_mgr surface Id
* @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 select)
{
//--------------------------------------------------------------------------
/**
+ * @brief surface map event callback
+ *
+ * @param [in] data user data(unused)
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
+ * @param [in] event event
+ * @param [in] surfaceid surface Id
+ * @param [in] type surface buffer type(EGL buffer/Shared memory)
+ * @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::mapSurfaceCB(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_WRN("CicoSCWlWinMgrIF::mapSurfaceCB called.");
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief surface update event callback
+ *
+ * @param [in] data user data(unused)
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
+ * @param [in] surfaceid surface Id
+ * @param [in] visible visibility
+ * @param [in] srcwidth application buffer width
+ * @param [in] srcheight application buffer height
+ * @param [in] x X
+ * @param [in] y Y
+ * @param [in] width width
+ * @param [in] height height
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWlWinMgrIF::updateSurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid,
+ int visible,
+ int srcwidth,
+ int srcheight,
+ int x,
+ int y,
+ int width,
+ int height)
+{
+ ICO_WRN("CicoSCWlWinMgrIF::updateSurfaceCB called.");
+}
+
+//--------------------------------------------------------------------------
+/**
* @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 surface Id
*/
//--------------------------------------------------------------------------
void
CicoSCWlWinMgrIF::destroySurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
uint32_t surfaceid)
{
ICO_WRN("CicoSCWlWinMgrIF::destroySurfaceCB 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
*/
//--------------------------------------------------------------------------
* @brief wayland surface active callback
*
* @param [in] data user data(unused)
- * @param [in] surfaceid surface Id
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
+ * @param [in] surfaceid ico_window_mgr surface Id
* @param [in] select select device(unused)
* (0=not active/1=pointer/2=touch)
*/
//--------------------------------------------------------------------------
void
CicoSCWlWinMgrIF::wlActiveCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
uint32_t surfaceid,
int32_t select)
{
-// ICO_TRA("CicoSCWlWinMgrIF::wlActiveCB Enter");
+// ICO_TRA("CicoSCWlWinMgrIF::wlActiveCB Enter");
if (NULL == data) {
ICO_WRN("wlActiveCB: data is null");
return;
}
- static_cast<CicoSCWlWinMgrIF*>(data)->activeCB(data, surfaceid, select);
-// ICO_TRA("CicoSCWlWinMgrIF::wlActiveCB Leave");
+ static_cast<CicoSCWlWinMgrIF*>(data)->activeCB(data, ico_window_mgr,
+ surfaceid, select);
+// ICO_TRA("CicoSCWlWinMgrIF::wlActiveCB Leave");
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief surface map event 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] width surface width
+ * @param [in] height surface height
+ * @param [in] stride surface buffer(frame buffer) stride
+ * @param [in] format surface buffer format
+ */
+//--------------------------------------------------------------------------
+void
+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::wlMapSurfaceCB Enter");
+
+ if (NULL == data) {
+ ICO_WRN("wlMapSurfaceCB: data is null");
+ return;
+ }
+ static_cast<CicoSCWlWinMgrIF*>(data)->mapSurfaceCB(data, ico_window_mgr,
+ event, surfaceid,
+ type,
+ width, height,
+ stride, format);
+// ICO_TRA("CicoSCWlWinMgrIF::wlMapSurfaceCB Leave");
+}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief surface update event callback
+ *
+ * @param [in] data user data
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
+ * @param [in] surfaceid surface Id
+ * @param [in] visible visibility
+ * @param [in] srcwidth application buffer width
+ * @param [in] srcheight application buffer height
+ * @param [in] x X
+ * @param [in] y Y
+ * @param [in] width width
+ * @param [in] height height
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCWlWinMgrIF::wlUpdateSurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid,
+ int visible,
+ int srcwidth,
+ int srcheight,
+ int x,
+ int y,
+ int width,
+ int height)
+{
+// ICO_TRA("CicoSCWlWinMgrIF::wlUpdateSurfaceCB Enter");
+
+ if (NULL == data) {
+ ICO_WRN("wlUpdateSurfaceCB: data is null");
+ return;
+ }
+ static_cast<CicoSCWlWinMgrIF*>(data)->updateSurfaceCB(data, ico_window_mgr,
+ surfaceid, visible,
+ srcwidth, srcheight,
+ x, y, width, height);
+// ICO_TRA("CicoSCWlWinMgrIF::wlUpdateSurfaceCB Leave");
}
//--------------------------------------------------------------------------
* @brief surface destroy event callback
*
* @param [in] data user data
+ * @param [in] ico_window_mgr wayland ico_window_mgr plugin interface
* @param [in] surfaceid surface Id
*/
//--------------------------------------------------------------------------
void
CicoSCWlWinMgrIF::wlDestroySurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
uint32_t surfaceid)
{
+// ICO_TRA("CicoSCWlWinMgrIF::wlDestroySurfaceCB Enter");
+
if (NULL == data) {
ICO_WRN("wlDestroySurfaceCB: data is null");
return;
}
- static_cast<CicoSCWlWinMgrIF*>(data)->destroySurfaceCB(data, surfaceid);
+ wlIviCtrlRemoveSurface(surfaceid);
+
+ static_cast<CicoSCWlWinMgrIF*>(data)->destroySurfaceCB(data, ico_window_mgr,
+ surfaceid);
+// ICO_TRA("CicoSCWlWinMgrIF::wlDestroySurfaceCB Leave");
}
//--------------------------------------------------------------------------
int32_t height,
int32_t refresh)
{
-// ICO_TRA("CicoSCWlWinMgrIF::wlOutputModeCB Enter");
+// ICO_TRA("CicoSCWlWinMgrIF::wlOutputModeCB Enter");
if (NULL == data) {
ICO_WRN("wlOutputGeometryCB: data is null");
}
static_cast<CicoSCWlWinMgrIF*>(data)->outputModeCB(data, wl_output, flags,
width, height, refresh);
-// ICO_TRA("CicoSCWlWinMgrIF::wlOutputModeCB Leave");
+// ICO_TRA("CicoSCWlWinMgrIF::wlOutputModeCB Leave");
}
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
//--------------------------------------------------------------------------
/**
* @brief wayland ivi-shell ivi-application protocol create wl_surface callback
}
ICO_TRA("CicoSCWlWinMgrIF::wlIviAppNativeShellInfoCB: Leave");
}
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
//--------------------------------------------------------------------------
/**
int32_t object_id, int32_t object_type,
int32_t error_code, const char *error_text)
{
+ struct creation_surface_wait *tp;
+ struct creation_surface_wait *tp2;
+ struct creation_surface_wait *deltp;
+
ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlErrorCB: Enter(%d[%d],%d,<%s>)",
object_id, object_type, error_code, error_text ? error_text : "(null)");
ICO_WRN("CicoSCWlWinMgrIF::wlIviCtrlErrorCB: data is null");
return;
}
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
- struct creation_surface_wait *tp;
- struct creation_surface_wait *tp2;
- struct creation_surface_wait *deltp;
// search request wait
tp = m_wait_surface_creation;
"call ivi_controller_get_native_handle(%d,<%s>)", tp2->pid, tp2->title);
ivi_controller_get_native_handle(m_ivi_ctrl, tp2->pid, tp2->title);
}
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlErrorCB: Leave");
}
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
-/--------------------------------------------------------------------------
+//--------------------------------------------------------------------------
/**
* @brief wayland ivi-shell ivi-controller protocol native handle callback
*
}
ICO_TRA("CicoSCWlWinMgrIF::wlIviCtrlNativeHandleCB: Leave(id_surface=%08x)", id_surface);
}
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
// vim:set expandtab ts=4 sw=4:
#include <wayland-client.h>
#include <ilm/ilm_client.h>
#include <ilm/ilm_control.h>
+#include <ico-uxf-weston-plugin/ico_window_mgr-client-protocol.h>
#include <weston/ivi-controller-client-protocol.h>
#include <weston/ivi-application-client-protocol.h>
* @brief This class is wayland interface of multi window manager
*/
//--------------------------------------------------------------------------
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
struct creation_surface_wait {
struct creation_surface_wait *next;
int32_t pid;
#define SCWINMGR_GENIVI_BUSY_REQSURF 1
#define SCWINMGR_GENIVI_BUSY_REQBIND 2
#define SCWINMGR_GENIVI_BUSY_WAIT 3
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
class CicoSCWlWinMgrIF : public CicoSCWaylandIF {
public:
uint32_t version);
virtual void activeCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
uint32_t surfaceid,
int32_t select);
+ virtual void mapSurfaceCB(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);
+
+ virtual void updateSurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid,
+ int visible,
+ int srcwidth,
+ int srcheight,
+ int x,
+ int y,
+ int width,
+ int height);
+
virtual void destroySurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
uint32_t surfaceid);
virtual void updateWinnameCB(uint32_t surfaceid,
virtual void createSurfaceCB(void *data,
struct ivi_controller *ivi_controller,
uint32_t id_surface);
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
+
static void wlIviCtrlRemoveSurface(uint32_t id_surface);
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
protected:
// default constructor
// copy constructor
CicoSCWlWinMgrIF(const CicoSCWlWinMgrIF &object);
- // wrapper function GENIVI-LM set layer
+ // wrapper function ico_window_mgr_set_window_layer
void setWindowLayer(uint32_t surfaceid, uint32_t layer, uint32_t oldlayer);
- // wrapper function GENIVI-LM set position and size
+ // wrapper function ico_window_mgr_set_positionsize
void setPositionsize(uint32_t surfaceid, uint32_t node,
int32_t x, int32_t y, int32_t width, int32_t height);
- // wrapper function GENIVI-LM set visibility
+ // wrapper function ico_window_mgr_set_visible
void setVisible(uint32_t surfaceid, int32_t visible);
- // wrapper function of GENIVI-LM set active
+ // 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_active
void setActive(uint32_t surfaceid, int32_t active);
- // wrapper function of GENIVI-LM set layer visibility
+ // wrapper function of ico_window_mgr_set_layer_visible
void setLayerVisible(uint32_t layer, int32_t visible);
// wrapper function of ilm_takeSurfaceScreenshot
void setmapGet(int surfaceid, const char *filepath);
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
+ // wrapper function of ico_window_mgr_map_surface
+ 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);
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
private:
- // GENIVI-LM callback functions
+ // ico_window_mgr(Multi Window Manager) callback functions
static void wlActiveCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
uint32_t surfaceid,
int32_t active);
+ static void 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);
+
+ static void wlUpdateSurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
+ uint32_t surfaceid,
+ int layer,
+ int srcwidth,
+ int srcheight,
+ int x,
+ int y,
+ int width,
+ int height);
+
static void wlDestroySurfaceCB(void *data,
+ struct ico_window_mgr *ico_window_mgr,
uint32_t surfaceid);
//
static void wlOutputGeometryCB(void *data,
int32_t height,
int32_t refresh);
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
static void wlIviAppNativeShellInfoCB(void *data,
struct ivi_application *ivi_application,
int32_t pid,
const char *title);
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
-
static void wlIviCtrlScreenCB(void *data,
struct ivi_controller *ivi_controller,
uint32_t id_screen,
int32_t error_code,
const char *error_text);
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
static void wlIviCtrlNativeHandleCB(void *data,
struct ivi_controller *ivi_controller,
struct wl_surface *surface);
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
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;
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
- // genivi ivi-application listener
- struct ivi_application_listener m_ivi_app_listener;
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
+ // Wayland's Window Manager PlugIn instance
+ static struct ico_window_mgr *m_winmgr;
// Wayland's genivi ivi_application instance
static struct ivi_application *m_ivi_app;
// surface id for wayland/weston applications
static int m_id_surface;
-#ifdef GENIVI_WL_SHELL_INFO /* GENIVI-LM is supporting the wl_shell_info */
// creation surface title name
static struct creation_surface_wait *m_wait_surface_creation;
static struct creation_surface_wait *m_free_surface_creation;
-#endif /*GENIVI_WL_SHELL_INFO*/ /* GENIVI-LM is supporting the wl_shell_info */
};
#endif // __CICO_SC_WL_WINMGR_IF_H__
// vim:set expandtab ts=4 sw=4:
#lib_LTLIBRARIES =\
# libico-system-controller.la
-libico_system_controller_la_LDFLAGS = -version-info 0:9:0
+libico_system_controller_la_LDFLAGS = -version-info 0:9:0
libico_system_controller_la_SOURCES = \
CicoSCLifeCycleController.cpp \
CicoSCWaylandIF.cpp \
@MURPHYECORE_LIBS@ \
@MURPHYRESOURCE_LIBS@ \
$(UWS_LIBS) \
- $(GENIVI_LIBS)
+ $(GENIVI_LIBS) \
+ $(WESTONPLUGIN_LIBS)
AM_LDFLAGS = -module -avoid-version -rpath $(libdir)
-* Fri Aug 29 2014 Shibata Makoto <shibata@mac.tec.toyota.co.jp> submit/tizen/20140827.131718@f8d5f54
-- 0.9.31 release
--- Corresponding to TizenIVI3.0 M14.3,
- GENIVI-LayerManagement was used instead of ico-uxf-weston-plugin,
- and ico-uxf-weston-plugin was eliminated.
-
* Tue Apr 08 2014 Shibata Makoto <shibata@mac.tec.toyota.co.jp> accepted/tizen/ivi/panda/20140403.020026@294446b
- 0.9.22 release
-- bug fix: TIVI-3007 - Home button doesn't response after some operations.
Name: ico-uxf-homescreen
Summary: Sample homescreen and system controller
-Version: 0.9.31
-Release: 1.1
+Version: 0.9.22
+Release: 0
Group: Automotive / ICO Homescreen
License: Apache-2.0
URL: ""
Source0: %{name}-%{version}.tar.bz2
-BuildRequires: pkgconfig(wayland-client) >= 1.5
+BuildRequires: pkgconfig(wayland-client) >= 1.4
+BuildRequires: ico-uxf-weston-plugin-devel >= 0.9.21
BuildRequires: pkgconfig(egl)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(appsvc)
BuildRequires: boost-devel
BuildRequires: mesa-devel
-BuildRequires: weston-ivi-shell-devel >= 0.1.7
-BuildRequires: genivi-shell-devel >= 0.2.3
+BuildRequires: weston-ivi-shell
+BuildRequires: weston-ivi-shell-devel
+BuildRequires: genivi-shell
+BuildRequires: genivi-shell-devel
BuildRequires: ico-uxf-utilities-devel >= 0.9.07
-Requires: weston >= 1.5
-Requires: weston-ivi-shell >= 0.1.7
-Requires: genivi-shell >= 0.2.3
+Requires: weston >= 1.4
+Requires: weston-ivi-shell
+Requires: genivi-shell
+Requires: ico-uxf-weston-plugin >= 0.9.21
Requires: ico-uxf-utilities >= 0.9.07
Requires: system-controller
-Conflicts: weston-ivi-config
-Conflicts: weston-ivi-shell-config
%description
Sample homescreen application.
Summary: System controller for ICO HomeScreen
Group: Automotive / ICO Homescreen
Requires: %{name} = %{version}-%{release}
-Requires: weston >= 1.5
-Requires: weston-ivi-shell >= 0.1.7
-Requires: genivi-shell >= 0.2.3
+Requires: weston >= 1.4
+Requires: weston-ivi-shell
+Requires: genivi-shell
+Requires: ico-uxf-weston-plugin >= 0.9.21
Requires: ico-uxf-utilities >= 0.9.07
Provides: system-controller
%make_install
+cp tool/ico_clear_screen %{buildroot}%{_bindir}
cp tool/ico_change_loginuser %{buildroot}%{_bindir}
-
-# configurations
-%define weston_conf %{_sysconfdir}/xdg/weston
-%define ecore_setting %{_sysconfdir}/profile.d
-mkdir -p %{buildroot}%{weston_conf} > /dev/null 2>&1
-mkdir -p %{buildroot}%{ecore_setting} > /dev/null 2>&1
-install -m 0644 settings/weston.ini %{buildroot}%{weston_conf}
-install -m 0644 settings/ecore.sh %{buildroot}%{ecore_setting}
+cp tool/notification/ico_del_notification %{buildroot}%{_bindir}
+cp tool/notification/ico_dump_notification %{buildroot}%{_bindir}
+cp tool/notification/ico_send_notification %{buildroot}%{_bindir}
+cp tool/notification/ico_send_notification2 %{buildroot}%{_bindir}
%post
/sbin/ldconfig
/usr/share/packages/org.tizen.ico.onscreen.xml
%{_libdir}/libico-appfw.*
%{_libdir}/libico-state-machine.*
+%{_bindir}/ico_clear_screen
%{_bindir}/ico_change_loginuser
-%{weston_conf}/weston.ini
-%{ecore_setting}/ecore.sh
+%{_bindir}/ico_del_notification
+%{_bindir}/ico_dump_notification
+%{_bindir}/ico_send_notification
+%{_bindir}/ico_send_notification2
%files system-controller
%manifest %{name}.manifest
# StatusBar application id
# -- onscreen
# OnScreen application id
-# -- background
-# picture : picture as background
-# transparent: see under runing APP window
#
#---------------------------------------------------------------------------
[homescreen]
statusbar=org.tizen.ico.statusbar
onscreen=org.tizen.ico.onscreen
-background=picture
#---------------------------------------------------------------------------
# HomeScreen application log setting
+++ /dev/null
-##EFL_WAYLAND_USE_XDG_SHELL='defined'
-##export EFL_WAYLAND_USE_XDG_SHELL
-
-# for EFL on GENIVI-LM
-EFL_WAYLAND_USE_IVI_SHELL="defined"
-export EFL_WAYLAND_USE_IVI_SHELL
+++ /dev/null
-[core]
-modules=ivi-controller.so
-shell=ivi-shell.so
-
-[output]
-name=LVDS1
-mode=1920x1080
-transform=90
-
-[output]
-name=VGA1
-mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
-transform=90
-
-#[output]
-#name=X1
-#mode=1024x768
-#transform=flipped-270
-
-[output]
-name=HDMI1
-mode=1920x1080
-transform=90
-
-[output]
-name=HDMI3
-mode=1920x1080
-transform=90
-
-[output]
-name=DP1
-mode=1920x1080
-transform=90
-
-[output]
-name=UNKNOWN1
-mode=1280x768
-transform=90
-
-[ivi-shell]
-cursor-theme=default
-cursor-size=32
-
-ivi-module=ivi-layout.so
-ivi-surface-creator-path=/usr/bin/LayerManagerControl
-
-[input-method]
-path=/bin/weekeyboard
-
-#[keyboard]
-#keymap_rules=evdev
-#keymap_layout=jp
-
#include "CicoSystemConfig.h"
#include "CicoConf.h"
#include "CicoHSLifeCycleController.h"
-#include "CicoHSWindow.h"
//==========================================================================
// public functions
int
CicoHSAppInfo::AddWindowInfo(ico_syc_win_info_t *wininfo)
{
- ico_syc_win_info_t wk_wininfo;
if (NULL == wininfo) {
ICO_ERR("wininfo is null.");
return ICO_ERROR;
}
- ICO_TRA("CicoHSAppInfo::AddWindowInfo Enter(appid=%s surface=%x)",
+ ICO_TRA("CicoHSAppInfo::AddWindowInfo Enter(appid=%s surface=%x",
wininfo->appid, wininfo->surface);
// if exist window information, update current window information
ICO_ERR("CicoHSAppInfo::AddWindowInfo Leave(ERR)");
return ICO_ERROR;
}
- memcpy(&wk_wininfo, wininfo, sizeof(wk_wininfo));
- if ((wk_wininfo.name == NULL) || (*wk_wininfo.name == 0)) {
- wk_wininfo.name = (char *)CicoHSWindow::getWindowName(m_window_num);
- ICO_TRA("CicoHSAppInfo::AddWindowInfo surface=%d idx=%d name=<%s>",
- wk_wininfo.surface, m_window_num,
- wk_wininfo.name ? wk_wininfo.name : "(null)");
- }
- SetWindowInfo(tmp_win_info, &wk_wininfo);
+ SetWindowInfo(tmp_win_info, wininfo);
this->m_window_info.push_back(tmp_win_info);
- ++ m_window_num;
+ ++m_window_num;
ICO_TRA("CicoHSAppInfo::AddWindowInfo Leave(OK)");
return ICO_OK;
int
CicoHSAppInfo::AddWindowAttr(ico_syc_win_attr_t *winattr)
{
- ico_syc_win_attr_t wk_winattr;
-
if (NULL == winattr) {
ICO_ERR("winattr is null.");
return ICO_ERROR;
ICO_TRA("CicoHSAppInfo::AddWindowAttr Leave(ERR)");
return ICO_ERROR;
}
- memcpy(&wk_winattr, winattr, sizeof(wk_winattr));
- if ((wk_winattr.name == NULL) || (*wk_winattr.name == 0)) {
- wk_winattr.name = (char *)CicoHSWindow::getWindowName(m_window_num);
- ICO_TRA("CicoHSAppInfo::AddWindowAttr surface=%d idx=%d name=<%s>",
- wk_winattr.surface, m_window_num,
- wk_winattr.name ? wk_winattr.name : "(null)");
- }
- SetWindowAttr(tmp_win_info, &wk_winattr);
+ SetWindowAttr(tmp_win_info, winattr);
m_window_info.push_back(tmp_win_info);
- ++ m_window_num;
+ ++m_window_num;
ICO_TRA("CicoHSAppInfo::AddWindowAttr Leave(OK)");
return ICO_OK;
}
// set window name(window title)
- if((wininfo->name != NULL) && (*wininfo->name != 0)) {
+ if(wininfo->name != NULL){
strncpy(hs_wininfo->name, wininfo->name, ICO_HS_MAX_WINDOW_NAME);
}
// set surface id
"(winifo=%p "
"appid=%s winname=%s zone=%s surface=%x nodeid=%d layer=%d "
"x/y=%d/%d w/h=%d/%d raise=%d visible=%d active=%d)",
- hs_wininfo, winattr->appid,
- ((winattr->name != NULL) && (*winattr->name != 0)) ?
- winattr->name : hs_wininfo->name,
- winattr->zone, winattr->surface, winattr->nodeid, winattr->layer,
+ hs_wininfo,
+ winattr->appid, winattr->name, winattr->zone,
+ winattr->surface, winattr->nodeid, winattr->layer,
winattr->pos_x, winattr->pos_y, winattr->width, winattr->height,
winattr->raise, winattr->visible, winattr->active);
strncpy(hs_wininfo->appid, winattr->appid, ICO_HS_MAX_PROCESS_NAME);
}
- if ((winattr->name != NULL) && (*winattr->name != 0)) {
+ if (winattr->name != NULL) {
strncpy(hs_wininfo->name, winattr->name, ICO_HS_MAX_WINDOW_NAME);
}
ico_hs_window_info *tmp_win_info;
for (int ii = 0; ii < ICO_HS_APP_MAX_WINDOW_NUM; ii++) {
if (m_window_info_i[ii].valid == false) {
- tmp_win_info = &m_window_info_i[ii];
- memset(tmp_win_info, 0, sizeof(ico_hs_window_info));
- tmp_win_info->valid = true;
- return tmp_win_info;
+ tmp_win_info = &m_window_info_i[ii];
+ tmp_win_info->valid = true;
+ return tmp_win_info;
}
}
return NULL;
/*--------------------------------------------------------------------------*/
CicoHSControlBarWindow::CicoHSControlBarWindow(void)
{
- ICO_DBG("CicoHSControlBarWindow::CicoHSControlBarWindow: Enter");
-
evas = NULL;
CicoResourceConfig::GetImagePath(img_dir_path, ICO_HS_MAX_PATH_BUFF_LEN);
ICO_DBG("shortcut_appid[%d] = NULL", ii);
}
}
- ICO_DBG("CicoHSControlBarWindow::CicoHSControlBarWindow: Leave");
}
/*--------------------------------------------------------------------------*/
* @return OK or ERRROR
*/
/*--------------------------------------------------------------------------*/
-int
+int
CicoHSControlBarWindow::CreateControlBarWindow(int pos_x, int pos_y,
int width, int height)
{
int ret;
char img_path[ICO_HS_MAX_PATH_BUFF_LEN];
-
- ICO_DBG("CicoHSControlBarWindow::CreateControlBarWindow: Enter(x/y=%d/%d,w/h=%d/%d)",
- pos_x, pos_y, width, height);
-
+
/*create window*/
ret = CreateWindow(ICO_HS_CONTROL_BAR_WINDOW_TITLE,
pos_x, pos_y, width, height, EINA_TRUE);
if(ret != ICO_OK){
- ICO_ERR("CreateWindow failed.");
- ICO_DBG("CicoHSControlBarWindow::CreateControlBarWindow: Leave(Error=%d)", ret);
- return ret;
+ return ret;
}
-
+
/* get evas */
evas = ecore_evas_get(window);
if (!evas) {
background = evas_object_rectangle_add(evas);
// add callback functions
- evas_object_event_callback_add(background, EVAS_CALLBACK_KEY_DOWN,
+ evas_object_event_callback_add(background, EVAS_CALLBACK_KEY_DOWN,
CicoHSControlBarWindow::evasKeyDownCB, this);
// key grab
- evas_object_focus_set(background, EINA_FALSE);
+ evas_object_focus_set(background, EINA_FALSE);
Eina_Bool eret = evas_object_key_grab(background, (const char*)changeZoneKeyName,
0, 0, EINA_TRUE);
if (EINA_FALSE == eret) {
ICO_HS_IMAGE_FILE_CONTROL_BAR_BUTTON_NIHGT2);
evas_object_image_file_set(menu_btn, img_path, NULL);
- // load fisrt show icon image
+ // load fisrt show icon image
snprintf(img_path,sizeof(img_path),"%s%s",img_dir_path,
ICO_HS_IMAGE_FILE_CONTROL_BAR_BUTTON_DAY);
evas_object_image_file_set(menu_btn, img_path, NULL);
evas_object_move(menu_btn,
(width/2) - (ICO_HS_CONTROL_BAR_MENU_BTN_WIDTH /2),
ICO_HS_CONTROL_BAR_MENU_BTN_START_POS_Y);
- evas_object_resize(menu_btn, ICO_HS_CONTROL_BAR_MENU_BTN_WIDTH,
+ evas_object_resize(menu_btn, ICO_HS_CONTROL_BAR_MENU_BTN_WIDTH,
ICO_HS_CONTROL_BAR_MENU_BTN_HEIGHT);
evas_object_event_callback_add(menu_btn, EVAS_CALLBACK_MOUSE_DOWN,
CicoHSControlBarTouch::TouchDownControlBar,
evas_object_event_callback_add(menu_btn, EVAS_CALLBACK_MOUSE_UP,
CicoHSControlBarTouch::TouchUpControlBar,
NULL);
- evas_object_show(menu_btn);
+ evas_object_show(menu_btn);
/* shortcut */
AddShortcut(evas, width);
-
- ICO_DBG("CicoHSControlBarWindow::CreateControlBarWindow: Leave");
+
return ICO_OK;
}
* @return none
*/
/*--------------------------------------------------------------------------*/
-void
+void
CicoHSControlBarWindow::TouchHome(void)
{
ActivationUpdate();
else {
CicoSound::GetInstance()->PlayOperationSound();
}
+
CicoHomeScreen::ChangeMode(ICO_HS_SHOW_HIDE_PATTERN_SLIDE);
}
ICO_DBG("CicoHSControlBarWindow::TouchShortcut appid = [%s]", appid);
CicoHomeScreen::ExecuteApp(appid);
}
+
ICO_TRA("CicoHSControlBarWindow::TouchShortcut Leave");
}
TouchHome();
}
else if (0 == strcmp(evinfo->keyname, backKeyName)) {
- // TODO not assinded funciton
+ // TODO not assinded funciton
}
else if (0 == strcmp(evinfo->keyname, menuKeyName)) {
- // TODO not assinded funciton
+ // TODO not assinded funciton
}
}
try {
// load system config
- (void) CicoSystemConfig::getInstance();
+ CicoSystemConfig::getInstance()->load(
+ ICO_HS_LIFECYCLE_CONTROLLER_SETTING_PATH);
// start homescreen
m_homescreen = new CicoHomeScreen();
int unmap;
int fd;
char sWork[PATH_MAX];
+#if 0 /* for BMP format */
#pragma pack(push, 1)
struct _bmphead {
short magic;
int colors2;
} bmphead;
#pragma pack(pop)
+#endif
ICO_DBG("CicoHSMenuTile::SetThumbnail(appid=%08x<%s>) info=%08x surf=%08x",
(int)this->appid, appid, (int)info, info ? info->surface : 0);
thumb.height = info->height;
thumb.stride = info->stride;
thumb.format = info->format;
-
- /* read surface image pixel */
- int bufsize = ((thumb.width * thumb.height * 4 + 4095) / 4096) * 4096;
- if ((! thumb.pixel_data) || (bufsize > thumb.pixel_bufsize)) {
- free(thumb.pixel_data);
- thumb.pixel_data = (char *)malloc(bufsize);
- thumb.pixel_bufsize = bufsize;
- if (thumb.pixel_data) {
- memset(thumb.pixel_data, 0, bufsize);
- }
- }
- if (thumb.pixel_data) {
- fd = open(sWork, O_RDONLY, 0644);
- if (fd >= 0) {
- if (read(fd, &bmphead, sizeof(bmphead)) != sizeof(bmphead)) {
- ICO_ERR("CicoHSMenuTile::SetThumbnail: can not read pixel file(%s)",
- sWork);
- close(fd);
- fd = -1;
- }
- else if (read(fd, thumb.pixel_data, bufsize) <= 0) {
- ICO_ERR("CicoHSMenuTile::SetThumbnail: can not read pixel file(%s)",
- sWork);
- close(fd);
- fd = -1;
- }
- else {
- thumb.width = bmphead.width;
- thumb.height = bmphead.height;
- thumb.stride = thumb.width * 4;
- }
- }
- else {
- ICO_ERR("CicoHSMenuTile::SetThumbnail: can not open pixel file(%s)",
- sWork);
- }
- if (fd >= 0) {
- close(fd);
- (void) unlink(sWork);
- }
- }
- else {
- ICO_ERR("CicoHSMenuTile::SetThumbnail: can not malloc pixel buffer");
- unmap = 1;
- }
-
#if 0 /* too many log */
ICO_DBG("CicoHSMenuTile::SetThumbnail: make thumbnail %s(%08x) "
"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
- if ((thumb.width <= 1) || (thumb.height <= 1)) {
+ if ((info->width <= 1) || (info->height <= 1)) {
ICO_DBG("CicoHSMenuTile::SetThumbnail: small surface(%d,%d) skip",
- thumb.width, thumb.height);
+ info->width, info->height);
}
- else if (unmap == 0) {
+ else {
// create thumbnail image
svx = thumb_reduce_x;
svy = thumb_reduce_y;
+ ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2);
}
}
- 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);
+ /* read surface image pixel */
+ int bufsize = ((thumb.width * thumb.height * 4 + 4095) / 4096) * 4096;
+ if ((! thumb.pixel_data) || (bufsize > thumb.pixel_bufsize)) {
+ free(thumb.pixel_data);
+ thumb.pixel_data = (char *)malloc(bufsize);
+ thumb.pixel_bufsize = bufsize;
+ if (thumb.pixel_data) {
+ memset(thumb.pixel_data, 0, bufsize);
+ }
+ }
+ if (thumb.pixel_data) {
+ fd = open(sWork, O_RDONLY, 0644);
+ if (fd >= 0) {
+#if 0 /* for BMP format */
+ if (read(fd, &bmphead, sizeof(bmphead)) != sizeof(bmphead)) {
+ ICO_ERR("CicoHSMenuTile::SetThumbnail: can not read pixel file(%s)",
+ sWork);
+ }
+ else
+#endif
+ if (read(fd, thumb.pixel_data, bufsize) <= 0) {
+ ICO_ERR("CicoHSMenuTile::SetThumbnail: can not read pixel file(%s)",
+ sWork);
+ }
+ }
+ else {
+ ICO_ERR("CicoHSMenuTile::SetThumbnail: can not open pixel file(%s)",
+ sWork);
+ }
+ if (fd >= 0) {
+ close(fd);
+ (void) unlink(sWork);
+ }
+ 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;
+ }
}
}
{
char sWork[PATH_MAX];
menu_show = show;
- if (thumb.surface != 0) {
+ if ((thumb_tile) && (thumb.surface != 0)) {
sprintf(sWork, ICO_HS_THUMB_ICODIR ICO_HS_THUMB_FILEDIR "/%08x."
ICO_HS_THUMB_FILEEXT, 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);
void
CicoHSMenuTile::SetOrgThumbnail(CicoHSMenuTile *orgTile)
{
+
ICO_DBG("CicoHSMenuTile::SetOrgThumbnail Enter(appid=%08x<%s>) run=%d surf=%08x",
(int)this->appid, this->appid, app_running, orgTile->thumb.surface );
#define ICO_HS_MENUTILE_TERM_ICON_WIDTH 64
#define ICO_HS_MENUTILE_TERM_ICON_HEIGHT 64
-#define ICO_HS_MENUTILE_THUMBNAIL_FPS_SHOW 5 /* 5 frames/sec */
+#define ICO_HS_MENUTILE_THUMBNAIL_FPS_SHOW 15 /* 15 frames/sec */
#define ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE -1 /* meanse 'not update' */
#define ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX 4
#define ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2 6
/*shared memory buffer*/
#define ICO_HS_THUMB_ICODIR "/tmp/ico"
#define ICO_HS_THUMB_FILEDIR "/thumbnail"
-#define ICO_HS_THUMB_FILEEXT "bmp"
+#define ICO_HS_THUMB_FILEEXT "pixel"
struct _CicoHSMenuTile_thumb {
int surface; // surface id
/*--------------------------------------------------------------------------*/
CicoHSMenuWindow::CicoHSMenuWindow(void)
{
- CicoGKeyFileConfig config;
- config.Initialize(ICO_HOMESCREEN_CONFIG_FILE);
- const char *value = config.ConfigGetString("homescreen", "background", "picture");
- transparent_background = false;
- if (strcmp(value, "picture") != 0)
- transparent_background = true;
-
/*initialzie values*/
terminate_mode = false;
{
char img_path[ICO_HS_MAX_PATH_BUFF_LEN];
/* set menu back */
+ /* image file name*/
+ snprintf(img_path, sizeof(img_path), "%s%s",
+ img_dir_path, ICO_HS_IMAGE_FILE_MENU_BACK_GROUND);
/* set object*/
- if (transparent_background) {
- /* image file name*/
- snprintf(img_path, sizeof(img_path), "%s%s",
- img_dir_path, ICO_HS_IMAGE_FILE_MENU_BACK_GROUND_BLANK);
-
- rectangle = evas_object_rectangle_add(evas);
- if (true == CicoHSSystemState::getInstance()->getNightMode()) {
- evas_object_color_set(rectangle,0,0,0,178);
- }
- else {
- evas_object_color_set(rectangle,120,120,120,178);
- }
- evas_object_move(rectangle, 0, 0);
- evas_object_resize(rectangle, width, height);
- evas_object_show(rectangle);
- } else
- snprintf(img_path, sizeof(img_path), "%s%s",
- img_dir_path, ICO_HS_IMAGE_FILE_MENU_BACK_GROUND_PICTURE);
+ rectangle = evas_object_rectangle_add(evas);
+ if (true == CicoHSSystemState::getInstance()->getNightMode()) {
+ evas_object_color_set(rectangle,0,0,0,178);
+ }
+ else {
+ evas_object_color_set(rectangle,120,120,120,178);
+ }
+ evas_object_move(rectangle, 0, 0);
+ evas_object_resize(rectangle, width, height);
+ evas_object_show(rectangle);
/* set object*/
canvas = evas_object_image_filled_add(evas);
CicoHSMenuWindow::FreeMenuBack(void)
{
evas_object_del(canvas);
- if (transparent_background)
- evas_object_del(rectangle);
+ evas_object_del(rectangle);
}
/*--------------------------------------------------------------------------*/
CicoHSMenuWindow::SetNightMode(void)
{
ICO_TRA("CicoHSMenuWindow::SetNightMode Enter");
- if (transparent_background) {
- if (true == CicoHSSystemState::getInstance()->getNightMode()) {
- evas_object_color_set(rectangle,0,0,0,178);
- }
- else {
- evas_object_color_set(rectangle,120,120,120,178);
- }
+ if (true == CicoHSSystemState::getInstance()->getNightMode()) {
+ evas_object_color_set(rectangle,0,0,0,178);
+ }
+ else {
+ evas_object_color_set(rectangle,120,120,120,178);
}
ICO_TRA("CicoHSMenuWindow::SetNightMode Leave");
}
#define ICO_HS_MENU_SHOW_ANIMATION_SLIDE "Slide"
#define ICO_HS_MENU_HIDE_ANIMATION_FADE "Fade"
#define ICO_HS_MENU_SHOW_ANIMATION_FADE "Fade"
-#define ICO_HS_MENU_ANIMATION_DURATION 400
+#define ICO_HS_MENU_ANIMATION_DURATION 300
#define ICO_HS_MENU_OTHER_CATEGORY_ID -1
Evas *evas;
/* menu back */
Evas_Object *canvas;
- bool transparent_background;
Evas_Object *rectangle;
/* tiles */
CicoHSMenuTile *menu_tile[ICO_HS_MENU_MAX_TILE_NUM];
memset(&show, 0, sizeof(show));
show.name = (char *)"none";
+ /* set default animation */
+ ico_syc_set_animation(appid, surface, ICO_SYC_ANIMATION_TYPE_ALL, &show);
/* move swipe input window to TouchLayer */
ico_syc_change_layer(appid, surface, HS_LAYER_TOUCHPANEL);
/* move window position and size */
set_xy_pos = true;
touch_state_b_x = touch_state_a_x;
touch_state_b_y = touch_state_a_y;
-// ICO_DBG("TouchMoveSwipe: save x/y=%d/%d", touch_state_b_x, touch_state_b_y);
+ ICO_DBG("TouchMoveSwipe: save x/y=%d/%d", touch_state_b_x, touch_state_b_y);
}
#if 0 /* too many log */
ICO_DBG("TouchMoveSwipe: Swipe Move (%d,%d)->(%d,%d) Button=%x",
#define ICO_HS_SWIPE_TOUCH_DISTANCE_TOP 200
#define ICO_HS_SWIPE_TOUCH_DISTANCE_BOTTOM 128
#define ICO_HS_SWIPE_TOUCH_SWIPE_THREASHOLD_DISTANCE 60
-#define ICO_HS_SWIPE_TOUCH_SWIPE_ANIMA_TIME 400
+#define ICO_HS_SWIPE_TOUCH_SWIPE_ANIMA_TIME 300
#define ICO_HS_MAX_SWIPEWINDOWS 4
*/
#include "CicoHSWindow.h"
-//==========================================================================
-// static variables
-//==========================================================================
-struct created_window_name *CicoHSWindow::created_window_title = NULL;
-
/*============================================================================*/
/* functions */
/*============================================================================*/
{
window = NULL;
}
-
/*--------------------------------------------------------------------------*/
/**
* @brief CicoHSWindow::~CicoHSWindow
FreeWindow();
}
}
-
/*--------------------------------------------------------------------------*/
/**
* @brief CicoHSWindow::CreateWindow
* @return none
*/
/*--------------------------------------------------------------------------*/
-int
-CicoHSWindow::CreateWindow(const char *title, int pos_x, int pos_y,
- int width, int height, int alpha)
+int
+CicoHSWindow::CreateWindow(const char *title,int pos_x,int pos_y,int width,int height,int alpha)
{
- struct created_window_name *winname;
- struct created_window_name *tp;
-
- ICO_DBG("CicoHSWindow::CreateWindow: Enter(%s,x/y=%d/%d,w/h=%d/%d,a=%d)",
- title, pos_x, pos_y, width, height, alpha);
-
+
this->pos_x = pos_x;
this->pos_y = pos_y;
this->width = width;
this->height = height;
- /* Make a new ecore_evas */
- window = ecore_evas_new(NULL, pos_x, pos_y, width, height, "frame=0");
+ /* Make a new ecore_evas */
+ window = ecore_evas_new(NULL, pos_x, pos_y, width, height, "frame=0");
/* if do not creted new, enlightenment return NULL */
if (!window) {
- ICO_ERR("CicoHSWindow::CreateWindow: could not create new_window.");
- ICO_DBG("CicoHSWindow::CreateWindow: Leave(Error)");
+ EINA_LOG_CRIT("CicoHSWindow::Initialize: could not create new_window.");
return ICO_ERROR;
}
strncpy(this->title, title, ICO_MAX_TITLE_NAME_LEN);
ecore_evas_title_set(window, this->title);
- /* alpha channel is enable */
+ /* alpha channel is enable*/
ecore_evas_alpha_set(window, alpha);
- /* save window name(title) */
- winname = (struct created_window_name *)malloc(sizeof(struct created_window_name));
- if (! winname) {
- ICO_ERR("CicoHSWindow::CreateWindow: out of memory");
- ICO_DBG("CicoHSWindow::CreateWindow: Leave(Error)");
- return ICO_ERROR;
- }
- else {
- memset(winname, 0, sizeof(struct created_window_name));
- strncpy(winname->winname, title, ICO_MAX_TITLE_NAME_LEN-1);
- if (created_window_title) {
- tp = created_window_title;
- while (tp->next) tp = tp->next;
- tp->next = winname;
- }
- else {
- created_window_title = winname;
- }
- }
- ICO_DBG("CicoHSWindow::CreateWindow: Leave");
return ICO_OK;
}
-
-/*--------------------------------------------------------------------------*/
-/**
- * @brief CicoHSWindow::getWindowName
- * get window title by window index
- *
- * @param[in] index
- * @return window title
- */
-/*--------------------------------------------------------------------------*/
-const char *
-CicoHSWindow::getWindowName(const int index)
-{
- int i = index;
- struct created_window_name *tp = created_window_title;
-
- for (i = 0; i < index; i++) {
- if (! tp) break;
- tp = tp->next;
- }
-
- if (tp) {
- return tp->winname;
- }
- else {
- return "\0";
- }
-}
-
/*--------------------------------------------------------------------------*/
/**
* @brief CicoHSWindow::FreeWindow
* @return none
*/
/*--------------------------------------------------------------------------*/
-void
+void
CicoHSWindow::FreeWindow(void)
{
ecore_evas_free(window);
}
-
/*--------------------------------------------------------------------------*/
/**
* @brief CicoHSWindow::WindowSetting
this->width = width;
this->height = height;
- /* move */
+ /* move */
ecore_evas_move(window,pos_x,pos_y);
- /* resize */
+ /* resize */
ecore_evas_resize(window, width, height);
- /* alpha channel is enable */
+ /* alpha channel is enable*/
ecore_evas_alpha_set(window, alpha);
}
-
/*--------------------------------------------------------------------------*/
/**
* @brief CicoHSWindow::ShowWindow
void
CicoHSWindow::ShowWindow(void)
{
- /* showing */
+ /* showing */
ecore_evas_show(window);
}
void
CicoHSWindow::HideWindow(void)
{
- /* hiding */
+ /* hiding */
ecore_evas_hide(window);
}
// vim:set expandtab ts=4 sw=4:
#define ICO_MAX_TITLE_NAME_LEN 64
-struct created_window_name {
- struct created_window_name *next;
- char winname[ICO_MAX_TITLE_NAME_LEN];
-};
-
class CicoHSWindow
{
public:
void WindowSetting(int pos_x,int pos_y,int width,int height,int alpha);
void ShowWindow(void);
void HideWindow(void);
-
- static const char *getWindowName(const int index);
private:
protected:
int width; /*width*/
int height; /*height*/
Ecore_Evas *window; /* ecore-evas object */
-
- static struct created_window_name *created_window_title;
};
#endif
// vim:set expandtab ts=4 sw=4:
* @date Aug-08-2013
*/
#include "CicoHSWindowController.h"
-#include "CicoConf.h"
-#include "CicoSystemConfig.h"
Ecore_Evas *CicoHSWindowController::ms_ecoreEvas = NULL;
ICO_DBG("ecore_wl_screen_size_get => w/h=%d/%d",
display_width, display_height);
-#if 1 /* 2014/07/16 ecore_wl_screen_size_get() bug */
- if ((display_width <= 0) || (display_height <= 0)) {
- const CicoSCDisplayConf* dispconf = CicoSystemConfig::getInstance()
- ->findDisplayConfbyId(0);
- if (dispconf) {
- // if Ecore has no full screen size, get from configuration
- display_width = dispconf->width;
- display_height = dispconf->height;
- ICO_DBG("Screen size w/h=%d/%d from Config", display_width, display_height);
- }
- else {
- // if Ecore and config has no full screen size, fixed vaule
- display_width = 1080;
- display_height = 1920;
- ICO_DBG("Screen size w/h=1080/1920 fixed");
- }
- }
-#endif /* 2014/07/16 ecore_wl_screen_size_get() bug */
-
+#if 1 /* TizenIVI 3.0 ecore return correct display size */
*width = display_width;
*height = display_height;
-
+#else /* TizenIVI 3.0 ecore return correct display size */
+ if (orientation == ICO_ORIENTATION_VERTICAL) {
+ *width = display_width > display_height ?
+ display_height : display_width;
+ *height = (display_width > display_height ?
+ display_width : display_height);
+ }
+ else {
+ *width = display_width < display_height ?
+ display_height : display_width;
+ *height = (display_width < display_height ?
+ display_width : display_height);
+ }
+#endif /* TizenIVI 3.0 ecore return correct display size */
ICO_TRA("CicoHSWindowController::GetFullScreenSize Leave(w/h=%d/%d)", *width, *height);
}
// vim:set expandtab ts=4 sw=4:
return;
}
- ICO_DBG("change zone: \"%s\"->\"%s\" move with (w/h=0/0)", wininfo->zone, dispzone);
+ ICO_DBG("change zone: \"%s\"->\"%s\"", wininfo->zone, dispzone);
ico_syc_win_move_t move = {
.zone = (char*)dispzone,
.layer = layer,
return;
}
- ico_syc_change_layer(win_info->appid, win_info->surface, layer);
- ICO_DBG("CicoHomeScreen::ShowHomeScreenWindow: id(%s) name(%s) layer(%d) surface(%x) "
+ ico_syc_change_layer(win_info->appid,win_info->surface,layer);
+ ICO_DBG("CicoHomeScreen::ShowHomeScreenWindow: id(%s) name(%s) surface(%d) "
"pos(%d,%d) size(%d,%d)", win_info->appid,
- win_info->name, layer, win_info->surface, move. pos_x, move.pos_y,
+ win_info->name, win_info->surface, move. pos_x, move.pos_y,
move.width, move.height);
ico_syc_move(win_info->appid, win_info->surface, &move, NULL);
move.height = ICO_HS_STATUSBAR_WINDOW_HEIGHT;
layer = HS_LAYER_CONTROLBAR;
- ico_syc_change_layer(win_info->appid, win_info->surface, layer);
+ ico_syc_change_layer(win_info->appid,win_info->surface,layer);
ICO_DBG("CicoHomeScreen::ShowStatusBarWindow: id(%s) name(%s) surface(%d) "
- "pos(%d,%d) size(%d,%d)", win_info->appid,
- win_info->name, win_info->surface, move.pos_x, move.pos_y,
- move.width, move.height);
- ico_syc_move(win_info->appid, win_info->surface, &move, NULL);
- ico_syc_show(win_info->appid, win_info->surface, NULL);
+ "pos(%d,%d) size(%d,%d)",win_info->appid,
+ win_info->name,win_info->surface,move.pos_x,move.pos_y,
+ move.width,move.height);
+ ico_syc_move(win_info->appid,win_info->surface,&move,NULL);
+ ico_syc_show(win_info->appid, win_info->surface,NULL);
}
/*--------------------------------------------------------------------------*/
move.height = full_height - ICO_HS_STATUSBAR_WINDOW_HEIGHT -
ICO_HS_CONTROLBAR_WINDOW_HEIGHT;
- ico_syc_move(win_info->appid, win_info->surface, &move, NULL);
+ ico_syc_move(win_info->appid,win_info->surface,&move,NULL);
ico_syc_animation_t animation;
- animation.name = (char*)ICO_SYC_WIN_ANIMATION_FADE;
+ animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_FADE;
animation.time = ICO_HS_MENU_ANIMATION_DURATION;
const string& lastStartupApp = m_appHis->getLastStartupAppid();
if (true == lastStartupApp.empty()) {
/*--------------------------------------------------------------------------*/
void
CicoHomeScreen::EventCallBack(const ico_syc_ev_e event,
- const void *detail, void *user_data)
+ const void *detail,void *user_data)
{
int idx;
- ICO_DBG("CicoHomeScreen::EventCallBack: start(event %d)", event);
+// ICO_DBG("CicoHomeScreen::EventCallBack: start (event %d)",event);
if (event == ICO_SYC_EV_WIN_CREATE) {
- ico_syc_win_info_t wk_win_info;
-
- memcpy(&wk_win_info, detail, sizeof(wk_win_info));
-
- ICO_DBG("Event:ICO_SYC_EV_WIN_CREATE(appid=%s surface=%d[%x])",
- wk_win_info.appid, wk_win_info.surface, wk_win_info.surface);
- /* only save information */
- if (strncmp(wk_win_info.appid, hs_instance->GetHsPackageName(),
+ ico_syc_win_info_t *win_info =
+ reinterpret_cast<ico_syc_win_info_t*>(const_cast<void*>(detail));
+ ICO_DBG("Event:ICO_SYC_EV_WIN_CREATE(appid=%s surface=%08x)",
+ win_info->appid, win_info->surface);
+ /*only save information*/
+ if (strncmp(win_info->appid, hs_instance->GetHsPackageName(),
ICO_HS_MAX_PROCESS_NAME) == 0) {
- /* Home Screen */
- hs_instance->hs_app_info->AddWindowInfo(&wk_win_info);
-
- if ((wk_win_info.name == NULL) || (*wk_win_info.name == 0)) {
- ico_hs_window_info *hs_win_info
- = hs_instance->hs_app_info->GetWindowInfobySurface(wk_win_info.surface);
- if (hs_win_info) wk_win_info.name = &hs_win_info->name[0];
- }
+ /*Home Screen*/
+ hs_instance->hs_app_info->AddWindowInfo(win_info);
- /* when Menu window */
- if (strncmp(wk_win_info.name, ICO_HS_MENU_WINDOW_TITLE,
+ /*when Menu window*/
+ if (strncmp(win_info->name,ICO_HS_MENU_WINDOW_TITLE,
ICO_MAX_TITLE_NAME_LEN) == 0) {
- hs_instance->menu_window->SetMenuWindowID(wk_win_info.appid,
- wk_win_info.surface);
+ hs_instance->menu_window->SetMenuWindowID(win_info->appid,
+ win_info->surface);
}
- else if (strncmp(wk_win_info.name, ICO_HS_CONTROL_BAR_WINDOW_TITLE,
+ else if (strncmp(win_info->name,ICO_HS_CONTROL_BAR_WINDOW_TITLE,
ICO_MAX_TITLE_NAME_LEN) == 0) {
- hs_instance->ctl_bar_window->SetWindowID(wk_win_info.appid,
- wk_win_info.surface);
+ hs_instance->ctl_bar_window->SetWindowID(win_info->appid,
+ win_info->surface);
}
else {
- if (wk_win_info.name[0] == 0) {
- /* null name, nothing to do */
+ if (win_info->name[0] == 0) {
+ /* null name, nothing to do */
return;
}
for (idx = 0; idx < hs_instance->num_swipe_input_windows; idx++) {
if (hs_instance->swipe_input_windows[idx]->
- isMyWindowName(wk_win_info.name)) {
+ isMyWindowName(win_info->name)) {
hs_instance->swipe_input_windows[idx]->
- SetWindowID(wk_win_info.appid, wk_win_info.surface);
+ SetWindowID(win_info->appid, win_info->surface);
hs_instance->swipe_input_windows[idx]->SetupSwipeWindow();
break;
}
}
}
- /* show window */
- hs_instance->ShowHomeScreenWindow(&wk_win_info);
+ /*show window*/
+ hs_instance->ShowHomeScreenWindow(win_info);
}
- else if (strncmp(wk_win_info.appid,
+ else if (strncmp(win_info->appid,
hs_instance->GetSbPackageName(),
ICO_HS_MAX_PROCESS_NAME) == 0) {
- /* Status Bar */
- hs_instance->sb_app_info->AddWindowInfo(&wk_win_info);
+ /*Status Bar*/
+ hs_instance->sb_app_info->AddWindowInfo(win_info);
- /* show window */
- hs_instance->ShowStatusBarWindow(&wk_win_info);
+ /*show window*/
+ hs_instance->ShowStatusBarWindow(win_info);
}
- else if (strncmp(wk_win_info.appid,
+ else if (strncmp(win_info->appid,
hs_instance->GetOsPackageName(),
ICO_HS_MAX_PROCESS_NAME) == 0) {
// On Screen
- hs_instance->os_app_info->AddWindowInfo(&wk_win_info);
+ hs_instance->os_app_info->AddWindowInfo(win_info);
// change the layer of onscreen window
- ico_syc_change_layer(wk_win_info.appid, wk_win_info.surface,
+ ico_syc_change_layer(win_info->appid, win_info->surface,
HS_LAYER_ONSCREEN);
const CicoSCPositionOSConf* oPOSC =
move.width = oPOSC->m_w;
move.height = oPOSC->m_h;
ico_syc_animation_t animation;
- animation.name = (char*)ICO_SYC_WIN_ANIMATION_SLIDE_TOTOP;
+ animation.name = (char*)ICO_HS_MENU_SHOW_ANIMATION_SLIDE;
animation.time = ICO_HS_MENU_ANIMATION_DURATION;
- ico_syc_move(wk_win_info.appid, wk_win_info.surface, &move, &animation);
+ ico_syc_move(win_info->appid, win_info->surface, &move, &animation);
+
}
else {
- /* Application */
- CicoHSAppInfo *appinfo = hs_instance->GetAppInfo(wk_win_info.appid);
+ /*Application*/
+ CicoHSAppInfo *appinfo = hs_instance->GetAppInfo(win_info->appid);
if (appinfo == NULL) {
return;
}
- appinfo->AddWindowInfo(&wk_win_info);
+ appinfo->AddWindowInfo(win_info);
- appinfo->SetLastSurface(wk_win_info.surface);
- hs_instance->ShowApplicationWindow(&wk_win_info);
- ico_syc_change_active(wk_win_info.appid, wk_win_info.surface);
- hs_instance->SetActiveAppInfo(wk_win_info.appid);
- hs_instance->UpdateTile(wk_win_info.appid);
+ appinfo->SetLastSurface(win_info->surface);
+ hs_instance->ShowApplicationWindow(win_info);
+ ico_syc_change_active(win_info->appid,win_info->surface);
+ hs_instance->SetActiveAppInfo(win_info->appid);
+ hs_instance->UpdateTile(win_info->appid);
- hs_instance->startupCheck(wk_win_info.appid);
+ hs_instance->startupCheck(win_info->appid);
}
}
-#if 0 /* GENIVI-LM not support window title */
else if (event == ICO_SYC_EV_WIN_NAME) {
ico_syc_win_info_t *win_info =
reinterpret_cast<ico_syc_win_info_t*>(const_cast<void*>(detail));
if (strncmp(win_info->appid, hs_instance->GetHsPackageName(),
ICO_HS_MAX_PROCESS_NAME) == 0) {
- /* Home Screen */
+ /*Home Screen*/
hs_instance->hs_app_info->AddWindowInfo(win_info);
- /* when Menu window */
+ /*when Menu window*/
if (strncmp(win_info->name,ICO_HS_MENU_WINDOW_TITLE,
ICO_MAX_TITLE_NAME_LEN) == 0) {
hs_instance->menu_window->SetMenuWindowID(win_info->appid,
}
}
- /* show window */
+ /*show window*/
hs_instance->ShowHomeScreenWindow(win_info);
}
else if (strncmp(win_info->appid, hs_instance->GetSbPackageName(),
ICO_HS_MAX_PROCESS_NAME) == 0) {
- /* Status Bar */
+ /*Status Bar*/
hs_instance->sb_app_info->AddWindowInfo(win_info);
}
else if (strncmp(win_info->appid, hs_instance->GetOsPackageName(),
ICO_HS_MAX_PROCESS_NAME) == 0) {
- /* On Screen */
+ /*On Screen*/
hs_instance->os_app_info->AddWindowInfo(win_info);
}
else {
- /* Application */
+ /*Application*/
CicoHSAppInfo *appinfo = hs_instance->GetAppInfo(win_info->appid);
if (appinfo == NULL) {
return;
appinfo->AddWindowInfo(win_info);
}
}
-#endif /* GENIVI-LM not support window title */
else if (event == ICO_SYC_EV_WIN_DESTROY) {
ico_syc_win_info_t *win_info =
reinterpret_cast<ico_syc_win_info_t*>(const_cast<void*>(detail));
- ICO_DBG("Event:ICO_SYC_EV_WIN_DESTROY(appid=%s surface=%d[%x])",
- win_info->appid, win_info->surface, win_info->surface);
- /* only save information */
+ ICO_DBG("Event:ICO_SYC_EV_WIN_DESTROY(appid=%s surface=%08x)",
+ win_info->appid, win_info->surface);
+ /*only save information*/
if (strncmp(win_info->appid, hs_instance->GetHsPackageName(),
ICO_HS_MAX_PROCESS_NAME) == 0) {
hs_instance->hs_app_info->FreeWindowInfo(win_info->name);
hs_instance->os_app_info->FreeWindowInfo(win_info->name);
}
else {
- /* Application */
+ /*Application*/
CicoHSAppInfo *appinfo =
hs_instance->GetAppInfo(win_info->appid);
if (appinfo == NULL) {
else if (event == ICO_SYC_EV_WIN_ACTIVE) {
ico_syc_win_info_t *win_info =
reinterpret_cast<ico_syc_win_info_t*>(const_cast<void*>(detail));
- ICO_DBG("Event:ICO_SYC_EV_WIN_ACTIVE(appid=%s surface=%d[%x])",
- win_info->appid, win_info->surface, win_info->surface);
+ ICO_DBG("Event:ICO_SYC_EV_WIN_ACTIVE(appid=%s surface=%08x)",
+ win_info->appid, win_info->surface);
hs_instance->ChangeActive(win_info->appid, win_info->surface);
}
else if (event == ICO_SYC_EV_WIN_ATTR_CHANGE) {
ico_syc_win_attr_t *win_attr =
reinterpret_cast<ico_syc_win_attr_t*>(const_cast<void*>(detail));
- ICO_DBG("Event:ICO_SYC_EV_WIN_ATTR_CHANGE(appid=%s surface=%d[%x])",
- win_attr->appid, win_attr->surface, win_attr->surface);
+ ICO_DBG("Event:ICO_SYC_EV_WIN_ATTR_CHANGE(appid=%s surface=%08x)",
+ win_attr->appid, win_attr->surface);
if (strncmp(win_attr->appid, hs_instance->GetHsPackageName(),
ICO_HS_MAX_PROCESS_NAME) == 0) {
- /* Home Screen */
+ /*Home Screen*/
hs_instance->hs_app_info->AddWindowAttr(win_attr);
}
else if (strncmp(win_attr->appid, hs_instance->GetSbPackageName(),
ICO_HS_MAX_PROCESS_NAME) == 0) {
- /* Status Bar */
+ /*Status Bar*/
hs_instance->sb_app_info->AddWindowAttr(win_attr);
}
else if (strncmp(win_attr->appid, hs_instance->GetOsPackageName(),
ICO_HS_MAX_PROCESS_NAME) == 0) {
- /* On Screen */
+ /*On Screen*/
hs_instance->os_app_info->AddWindowAttr(win_attr);
}
else {
ICO_DBG("CicoHomeScreen::EventCallBack : application window %s %s",
win_attr->appid,win_attr->name);
- /* Application */
+ /*Application*/
CicoHSAppInfo *appinfo = hs_instance->GetAppInfo(win_attr->appid);
if (appinfo == NULL) {
return;
}
}
}
+
// update window information
appinfo->AddWindowAttr(win_attr);
hs_instance->UpdateTile(win_attr->appid);
reinterpret_cast<ico_syc_thumb_info_t*>(const_cast<void*>(detail));
CicoHSAppInfo *appinfo = hs_instance->GetAppInfo(thumb_info->appid);
if (appinfo == NULL) {
- ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_CHANGE %s"
- "(%d[%x]) no appinfo",
- thumb_info->appid, thumb_info->surface, thumb_info->surface);
+ ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_CHANGE %s(%02x) "
+ "no appinfo", thumb_info->appid, thumb_info->surface);
return;
}
// ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_CHANGE %s(%02x)",
reinterpret_cast<ico_syc_thumb_info_t*>(const_cast<void*>(detail));
CicoHSAppInfo *appinfo = hs_instance->GetAppInfo(thumb_info->appid);
if (appinfo == NULL) {
- ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_UNMAP %s"
- "(%d[%x]) no appinfo",
- thumb_info->appid, thumb_info->surface, thumb_info->surface);
+ ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_UNMAP %s(%02x) "
+ "no appinfo", thumb_info->appid, thumb_info->surface);
return;
}
- ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_UNMAP %s(%d[%x])",
- thumb_info->appid, thumb_info->surface, thumb_info->surface);
+ ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_UNMAP %s(%02x)",
+ thumb_info->appid, thumb_info->surface);
hs_instance->menu_window->SetThumbnail(thumb_info->appid, NULL);
}
else if (event == ICO_SYC_EV_THUMB_ERROR) {
reinterpret_cast<ico_syc_thumb_info_t*>(const_cast<void*>(detail));
CicoHSAppInfo *appinfo = hs_instance->GetAppInfo(thumb_info->appid);
if (appinfo == NULL) {
- ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_ERROR %s"
- "(%d[%x]) no appinfo",
- thumb_info->appid, thumb_info->surface, thumb_info->surface);
+ ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_ERROR %s(%02x) "
+ "no appinfo", thumb_info->appid, thumb_info->surface);
return;
}
ICO_DBG("CicoHomeScreen::EventCallBack : ICO_SYC_EV_THUMB_ERROR %s(%02x)",
hs_instance->menu_window->SetThumbnail(thumb_info->appid, NULL);
}
else if (event == ICO_SYC_EV_LAYER_ATTR_CHANGE) {
+
}
else if (event == ICO_SYC_EV_USERLIST) {
+
}
else if (event == ICO_SYC_EV_AUTH_FAIL) {
+
}
else if (event == ICO_SYC_EV_RES_ACQUIRE) {
+
}
else if (event == ICO_SYC_EV_RES_DEPRIVE) {
+
}
else if (event == ICO_SYC_EV_RES_WAITING) {
+
}
else if (event == ICO_SYC_EV_RES_REVERT) {
+
}
else if (event == ICO_SYC_EV_RES_RELEASE) {
+
}
else if (event == ICO_SYC_EV_INPUT_SET) {
+
}
else if (event == ICO_SYC_EV_INPUT_UNSET) {
+
}
else if (event == ICO_SYC_EV_STATE_CHANGE) {
ico_syc_state_info_t *state_info =
ecore_main_loop_thread_safe_call_async(CicoHomeScreen::SetNightMode, NULL);
}
}
- ICO_DBG("CicoHomeScreen::EventCallBack: end");
+// ICO_DBG("CicoHomeScreen::EventCallBack: end");
}
/*--------------------------------------------------------------------------*/
/* Get screen size */
CicoHSWindowController::GetFullScreenSize(orientation,
- &full_width, &full_height);
+ &full_width,&full_height);
ICO_DBG("full screen size x=%d y=%d",full_width,full_height);
moveZoneAnimation.name = (char*)config->ConfigGetString("switchzone",
"animation",
- ICO_SYC_WIN_ANIMATION_FADE);
+ ICO_HS_ANIMATION_FADE);
moveZoneAnimation.time = config->ConfigGetInteger("switchzone",
"animatime", 400);
CicoHomeScreen::CreateControlBarWindow(void)
{
/*create window*/
- ICO_DBG("CicoHomeScreen::CreateControlBarWindow: Enter");
+ ICO_DBG("CicoHomeScreen::CreateControlBarWindow");
ctl_bar_window = new CicoHSControlBarWindow();
- ctl_bar_window->CreateControlBarWindow(ICO_HS_MENU_WINDOW_POS_X,
- bg_height - ctl_bar_height,
- ctl_bar_width, ctl_bar_height);
+ ctl_bar_window->CreateControlBarWindow(ICO_HS_MENU_WINDOW_POS_X,bg_height -
+ ctl_bar_height,ctl_bar_width,
+ ctl_bar_height);
ctl_bar_window->ShowWindow();
- ICO_DBG("CicoHomeScreen::CreateControlBarWindow: Leave");
}
/*--------------------------------------------------------------------------*/
moveZoneAnimation.name = (char*)config->ConfigGetString("switchzone",
"animation",
- ICO_SYC_WIN_ANIMATION_FADE);
+ ICO_HS_ANIMATION_FADE);
moveZoneAnimation.time = config->ConfigGetInteger("switchzone",
"animatime", 400);
// debug log
ico_syc_animation_t animation;
ICO_DBG("CicoHomeScreen::ChangeMode: MENU->APP");
if (pattern == ICO_HS_SHOW_HIDE_PATTERN_SLIDE) {
- animation.name = (char*)ICO_SYC_WIN_ANIMATION_SLIDE_TOTOP;
+ animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_SLIDE;
}
else {
- animation.name = (char*)ICO_SYC_WIN_ANIMATION_FADE;
+ animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_FADE;
}
animation.time = ICO_HS_MENU_ANIMATION_DURATION;
hs_instance->menu_window->Hide(&animation);
ico_syc_animation_t animation;
ICO_DBG("CicoHomeScreen::ChangeMode: APP->MENU");
if (pattern == ICO_HS_SHOW_HIDE_PATTERN_SLIDE) {
- animation.name = (char*)ICO_SYC_WIN_ANIMATION_SLIDE_TOTOP;
+ animation.name = (char*)ICO_HS_MENU_SHOW_ANIMATION_SLIDE;
}
else {
- animation.name = (char*)ICO_SYC_WIN_ANIMATION_FADE;
+ animation.name = (char*)ICO_HS_MENU_SHOW_ANIMATION_FADE;
}
animation.time = ICO_HS_MENU_ANIMATION_DURATION;
hs_instance->menu_window->Show(&animation);
// regulation action
hs_instance->ctl_bar_window->SetRegulation();
ico_syc_animation_t animation;
- animation.name = (char*)ICO_SYC_WIN_ANIMATION_SLIDE_TOTOP;
+ animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_SLIDE;
animation.time = ICO_HS_MENU_ANIMATION_DURATION;
hs_instance->menu_window->Hide(&animation);
}
ico_syc_animation_t animation;
- animation.name = (char*)ICO_SYC_WIN_ANIMATION_FADE;
+ animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_FADE;
animation.time = ICO_HS_MENU_ANIMATION_DURATION;
ico_syc_show(appinfo->GetAppId(), appinfo->GetLastSurface(), &animation);
}
ico_syc_animation_t animation;
- animation.name = (char*)ICO_SYC_WIN_ANIMATION_FADE;
+ animation.name = (char*)ICO_HS_MENU_HIDE_ANIMATION_FADE;
animation.time = ICO_HS_MENU_ANIMATION_DURATION;
int surface = ai->GetLastSurface();
#define __CICO_HOMESCREEN_COMMON_H__
#include <ico_log.h>
+#include <ico-uxf-weston-plugin/ico_window_mgr-client-protocol.h>
#include "ico_syc_sysdef.h"
#define ICO_OK 0
#define ICO_HS_BACK_WINDOW_IMAGE_FILE_PATH "/opt/usr/media/Images/Home_default.jpg"
/*name of image file (in config image directry)*/
-#define ICO_HS_IMAGE_FILE_MENU_BACK_GROUND_BLANK "bg.png"
-#define ICO_HS_IMAGE_FILE_MENU_BACK_GROUND_PICTURE "bg_bk.png"
+#define ICO_HS_IMAGE_FILE_MENU_BACK_GROUND "bg.png"
#define ICO_HS_IMAGE_FILE_MENU_PAGEPOINTER_P "pagePointer_p.png"
#define ICO_HS_IMAGE_FILE_MENU_PAGEPOINTER_N "pagePointer_n.png"
#define ICO_HS_IMAGE_FILE_CONTROL_BAR_BUTTON_NIHGT "applist_on.png"
#define ICO_HS_IMAGE_FILE_CONTROL_BAR_BUTTON_NIHGT2 "applist_on_2.png"
+#define ICO_HS_LIFECYCLE_CONTROLLER_SETTING_PATH "/usr/apps/org.tizen.ico.system-controller/res/config/system.xml"
+
/*config name*/
#define ICO_HS_CONFIG_HOMESCREEN "homescreen"
#define ICO_HS_CONFIG_ONSCREEN "onscreen"
#define ICO_HS_CONFIG_HSTRY_DEF3 "org.tizen.ico.login"
#define ICO_HS_CONFIG_HSTRY_SPL ';'
+#define ICO_HS_ANIMATION_SLIDE "Slide"
+#define ICO_HS_ANIMATION_SLIDE "Slide"
+#define ICO_HS_ANIMATION_FADE "Fade"
+#define ICO_HS_ANIMATION_FADE "Fade"
#define ICO_HS_ANIMATION_DURATION (400)
#endif
AM_CPPFLAGS = $(GCC_CXXFLAGS)
AM_CXXFLAGS = $(GCC_CXXFLAGS)
-COMMON_LIBS = -lm -lwebsockets -lsecurity-server-client
+COMMON_LIBS = -lm -lwebsockets -lico-uxf-weston-plugin -lsecurity-server-client
noinst_PROGRAMS = \
HomeScreen
CicoHSServer.cpp \
CicoHSMessage.cpp \
CicoHSAppControl.cpp \
- CicoHSCommandArg.cpp
+ CicoHSCommandArg.cpp
HomeScreen_CFLAGS= \
@CAPIAPPFWAPPLICATION_CFLAGS@ \
install -m 0644 home_screen_bg.edj $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/res/edj
install -m 0644 home_screen_touch.edj $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/res/edj
install -m 0644 $(top_srcdir)/res/org.tizen.ico.homescreen/res/images/bg.png $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/res/images
- install -m 0644 $(top_srcdir)/res/org.tizen.ico.homescreen/res/images/bg_bk.png $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/res/images
install -m 0644 $(top_srcdir)/res/org.tizen.ico.homescreen/res/images/ctrl.png $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/res/images
install -m 0644 $(top_srcdir)/res/org.tizen.ico.homescreen/res/images/applist_off.png $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/res/images
install -m 0644 $(top_srcdir)/res/org.tizen.ico.homescreen/res/images/applist_off_2.png $(INSTALL_ROOT)/usr/apps/org.tizen.ico.homescreen/res/images
#include "ico_syc_type.h"
#include "ico_syc_appresctl.h"
#include "CicoOSClient.h"
-#include "CicoConf.h"
-#include "CicoSystemConfig.h"
using namespace std;
return true;
}
-bool
+bool
CicoOSPopWindow::acquireRes()
{
ICO_TRA("Enter");
ICO_TRA("Leave");
}
-bool
+bool
CicoOSPopWindow::releaseRes()
{
ICO_TRA("Enter");
ecore_wl_screen_size_get(&display_width, &display_height);
ICO_DBG("display size w/h=%d/%d", display_width, display_height);
-
-#if 1 /* 2014/07/16 ecore_wl_screen_size_get() bug */
- if ((display_width <= 0) || (display_height <= 0)) {
- const CicoSCDisplayConf* dispconf = CicoSystemConfig::getInstance()
- ->findDisplayConfbyId(0);
- if (dispconf) {
- // if Ecore has no full screen size, get from configuration
- display_width = dispconf->width;
- display_height = dispconf->height;
- ICO_DBG("Screen size w/h=%d/%d from Config", display_width, display_height);
- }
- else {
- // if Ecore and config has no full screen size, fixed vaule
- display_width = 1080;
- display_height = 1920;
- ICO_DBG("Screen size w/h=1080/1920 fixed");
- }
- }
-#endif /* 2014/07/16 ecore_wl_screen_size_get() bug */
-
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);
#include <Edje.h>
#include <ico_log.h>
#include "CicoStatusBar.h"
-#include "CicoConf.h"
-#include "CicoSystemConfig.h"
using namespace std;
}
ecore_wl_screen_size_get(&width_, &height_);
-#if 1 /* 2014/07/16 ecore_wl_screen_size_get() bug */
- if ((width_ <= 0) || (height_ <= 0)) {
- const CicoSCDisplayConf* dispconf = CicoSystemConfig::getInstance()
- ->findDisplayConfbyId(0);
- if (dispconf) {
- // if Ecore has no full screen size, get from configuration
- width_ = dispconf->width;
- height_ = dispconf->height;
- ICO_DBG("Screen size w/h=%d/%d from Config", width_, height_);
- }
- else {
- // if Ecore and config has no full screen size, fixed vaule
- width_ = 1080;
- height_ = 1920;
- ICO_DBG("Screen size w/h=1080/1920 fixed");
- }
- }
-#endif /* 2014/07/16 ecore_wl_screen_size_get() bug */
-
ecore_evas_size_min_set(window_, width_, STATUSBAR_HEIGHT);
ecore_evas_size_max_set(window_, width_, STATUSBAR_HEIGHT);
try {
int ret = ICO_SYC_EOK;
- (void) CicoSystemConfig::getInstance();
+ CicoSystemConfig::getInstance()->load("/usr/apps/org.tizen.ico.system-controller/res/config/system.xml");
initAulListenXSignal();
@MURPHYECORE_LIBS@ \
@MURPHYRESOURCE_LIBS@ \
$(UWS_LIBS) \
- $(GENIVI_LIBS)
+ $(GENIVI_LIBS) \
+ $(WESTONPLUGIN_LIBS)
CLEANFILES = $(BUILT_SOURCES)
+#SUBDIRS=\
+# system-controller \
+# homescreen
+
SUBDIRS=\
system-controller
--- /dev/null
+AM_CFLAGS = $(GCC_CFLAGS)
+AM_CPPFLAGS = $(GCC_CFLAGS)
+
+bin_PROGRAMS = \
+ ico_set_vehicleinfo \
+ ico_send_hscommand
+
+check_PROGRAMS = \
+ ico_set_vehicleinfo
+
+ico_set_vehicleinfo_SOURCES = \
+ ico_set_vehicleinfo.c
+ico_set_vehicleinfo_LDADD = -lwebsockets
+
+ico_send_hscommand_SOURCES = \
+ ico_send_hscommand.c
+ico_send_hscommand_CFLAGS = -I../include $(UWS_CFLAGS)
+#ico_send_hscommand_LDADD = $(UWS_LIBS) -lwebsockets -ldlog
+ico_send_hscommand_LDADD = $(UWS_LIBS)
+
--- /dev/null
+#!/bin/sh
+
+# Define
+SCREEN_IS_FHD=1
+GUI_TEST_NEXT_DAT=gui-test-FHD-next.dat
+GUI_TEST_DAT=gui-test-FHD.dat
+# for GUI test launch
+LAUNCH_APP=org.tizen.music-player
+LAUNCH_APP_SEAT=0
+LAUNCH_APP_INDEX=0
+LAUNCH_APP_SEATCNT=0
+LAUNCH_APP_X=0
+LAUNCH_APP_Y=0
+SHIFT_X=576
+SHIFT_Y=28
+
+#determin screen size 768x1024 or 1080x1920
+/bin/grep "ico_uxf_window_screen_size_get width=768 height=1024" $HOMESCREEN_LOG
+if [ "$?" = 0 ]; then
+ SCREEN_IS_FHD=0
+ SHIFT_X=0
+ SHIFT_Y=0
+ GUI_TEST_NEXT_DAT=gui-test-XGA-next.dat
+ GUI_TEST_DAT=gui-test-XGA.dat
+fi
+
+#determin launch app index/position on application list
+for str in `/bin/grep "ons_load_config: appid=$LAUNCH_APP" $ONSCREEN_LOG`
+do
+ para=`echo $str|cut -d "=" -f 1`
+ val=`echo $str|cut -d "=" -f 2`
+ if [ "$para" = "seat" ]; then
+ LAUNCH_APP_SEAT=$val
+ fi
+ if [ "$para" = "idx" ]; then
+ LAUNCH_APP_INDEX=$val
+ fi
+ if [ "$para" = "seatcnt" ]; then
+ LAUNCH_APP_SEATCNT=$val
+ fi
+done
+
+echo $LAUNCH_APP_INDEX
+
+LAUNCH_APP_X=`expr $LAUNCH_APP_INDEX % 5 \* 130 + 124 + $SHIFT_X`
+LAUNCH_APP_Y=`expr $LAUNCH_APP_INDEX / 5 \* 130 + 374 + $SHIFT_Y`
+
+/bin/cp testdata/$GUI_TEST_DAT testdata/gui-test.dat
+
+if [ $LAUNCH_APP_SEATCNT = 2 ]; then
+ if [ $LAUNCH_APP_SEAT = 0 ]; then
+ cat testdata/$GUI_TEST_NEXT_DAT >> testdata/gui-test.dat
+ fi
+elif [ $LAUNCH_APP_SEATCNT -gt 2 ]; then
+ num=0
+ if [ $LAUNCH_APP_SEAT = 0 ]; then
+ num=`expr $LAUNCH_APP_SEATCNT - 1`
+ elif [ $LAUNCH_APP_SEAT -gt 1 ]; then
+ num=`expr $LAUNCH_APP_SEATCNT - $LAUNCH_APP_SEAT`
+ fi
+ for i in `seq 1 1 $num`; do
+ cat testdata/$GUI_TEST_NEXT_DAT >> testdata/gui-test.dat
+ done
+fi
+
+cat testdata/gui-test-launch-template.dat >> testdata/gui-test.dat
+sed -i "s/COORD_X/$LAUNCH_APP_X/g" testdata/gui-test.dat
+sed -i "s/COORD_Y/$LAUNCH_APP_Y/g" testdata/gui-test.dat
+
+
--- /dev/null
+#!/bin/sh
+
+# 1 Delete log file
+rm -fr /var/log/weston.log
+
+# 2 Weston/Wayland Envionment
+export XDG_RUNTIME_DIR=/tmp/run-root
+export QT_QPA_PLATFORM=wayland
+export ELM_ENGINE=wayland_egl
+export ECORE_EVAS_ENGINE=wayland_egl
+#export ELM_ENGINE=wayland_shm
+#export ECORE_EVAS_ENGINE=wayland_shm
+export EVAS_FONT_DPI=72
+export ECORE_IMF_MODULE=isf
+export ELM_MODULES="ctxpopup_copypasteUI>entry/api:datetime_input_ctxpopup>datetime/api"
+export ELM_SCALE="0.7"
+export ELM_PROFILE=mobile
+
+# 3 Start Device Input Controller for eGalax TouchPanel
+/usr/bin/ico_ictl-touch_egalax -t
+sleep 0.3
+
+# 4 Start Weston
+ORG_UMASK=`umask`
+umask 000
+/usr/bin/weston --backend=drm-backend.so --idle-time=0 --log=/var/log/weston.log &
+sleep 0.5
+if [ -f $XDG_RUNTIME_DIR/wayland-0 ] ; then
+ chmod 0777 $XDG_RUNTIME_DIR/wayland-0
+fi
+umask $ORG_UMASK
+
+# 5 start app core daemon
+sleep 1
+/usr/bin/launchpad_preloading_preinitializing_daemon &
+
+# 6 start homescreen
+rm -fr /tmp/log
+mkdir /tmp/log/
+chmod -R 0777 /tmp/log
+/usr/bin/launch_app org.tizen.ico.homescreen &
+
+# 7 start test shell
+sleep 5
+./homescreen-test.sh
--- /dev/null
+#!/bin/sh
+
+## log file
+mkdir /var/log/ico > /dev/null 2>&1
+export HOMESCREEN_LOG=/var/log/ico/org.tizen.ico.homescreen.log
+export ONSCREEN_LOG=/var/log/ico/org.tizen.ico.onscreen.log
+
+## make dat
+./homescreen-test-makedat.sh
+
+## GUI test
+ico_send_inputevent -m < testdata/gui-test.dat
+
+## CUI test
+#Hide tile screen
+ico_send_hscommand json/hide-tile.json
+sleep 3
+#Show tile screen
+ico_send_hscommand json/show-tile.json
+sleep 3
+#Show application
+ico_send_hscommand json/hide-tile.json
+sleep 3
+ico_send_hscommand json/show-app1.json
+sleep 3
+#Move and resize application
+ico_send_hscommand json/geom-app1-1.json
+sleep 3
+ico_send_hscommand json/geom-app1-2.json
+sleep 3
+ico_send_hscommand json/geom-app1-3.json
+sleep 3
+#Terminate application
+ico_send_hscommand json/term-app1.json
+sleep 3
+ico_send_hscommand json/show-tile.json
+sleep 3
+#Terminate application
+ico_send_hscommand json/hide-tile.json
+sleep 3
+ico_send_hscommand json/exec-app1.json
+sleep 3
+#Application on tile screen
+ico_send_hscommand json/show-tile.json
+sleep 3
+
+## Check Error
+FOUND_ERR=0
+/bin/grep -i "err" $HOMESCREEN_LOG
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep -i "err" $ONSCREEN_LOG
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep -i "fail" $HOMESCREEN_LOG
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+/bin/grep -i "fail" $ONSCREEN_LOG
+if [ "$?" != "1" ] ; then
+ FOUND_ERR=1
+fi
+
+## delete dat file
+rm -f testdata/gui-test.dat
+
+echo " "
+echo " "
+if [ $FOUND_ERR = 0 ] ; then
+ echo "org.tizen.ico.homescreen Test: OK"
+else
+ echo "org.tizen.ico.homescreen Test: Please check the upper log whether there is not a critical bug"
+fi
+
--- /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
+ *
+ */
+/**
+ * @brief applicatoin that send a command to homescreen
+ *
+ * @date Feb-15-2013
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <pthread.h>
+#include <unistd.h>
+
+#include <ico_uws.h>
+
+#include "home_screen.h"
+#include "home_screen_res.h"
+
+
+/*============================================================================*/
+/* Define data types */
+/*============================================================================*/
+#define ICO_HSCMD_WS_TIMEOUT 0.05
+#define ICO_HSCMD_WS_ADDRESS "127.0.0.1"
+#define ICO_HSCMD_WS_PROTOCOL_NAME ICO_HS_PROTOCOL_CM
+
+//#define hscmd_trace(...)
+#define hscmd_trace(fmt, arg...) fprintf(stderr, ""fmt"\n",##arg)
+
+/*============================================================================*/
+/* static(internal) functions prototype */
+/*============================================================================*/
+static void hscmd_callback_uws(const struct ico_uws_context *context,
+ const ico_uws_evt_e event, const void *id,
+ const ico_uws_detail *detail, void *data);
+
+static void hscmd_create_ws_context(void);
+static void hscmd_destroy_ws_context(void);
+static void hscmd_ws_service_loop(void);
+static void hscmd_usage(const char *prog);
+
+/*============================================================================*/
+/* variabe & table */
+/*============================================================================*/
+static int hscmd_ws_port = ICO_HS_WS_PORT;
+static int hscmd_ws_connected = 0;
+static struct ico_uws_context *hscmd_uws_context = NULL;
+static void *hscmd_uws_id = NULL;
+static FILE *hscmd_fp;
+static int hscnd_send_end = 0;
+
+/*============================================================================*/
+/* functions */
+/*============================================================================*/
+/*--------------------------------------------------------------------------*/
+/*
+ * @brief hscmd_callback_uws
+ * callback function from UWS
+ *
+ * @param[in] context context
+ * @param[in] event event kinds
+ * @param[in] id client id
+ * @param[in] detail event detail
+ * @param[in] data user data
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+hscmd_callback_uws(const struct ico_uws_context *context,
+ const ico_uws_evt_e event, const void *id,
+ const ico_uws_detail *detail, void *data)
+{
+ unsigned char msg[ICO_HS_TEMP_BUF_SIZE];
+ unsigned char *send;
+ char *in;
+ long fsize;
+ int len;
+
+ hscmd_trace("hscmd_callback_uws %p", context);
+
+ switch (event) {
+ case ICO_UWS_EVT_OPEN:
+ hscmd_trace("hscmd_callback_uws: ICO_UWS_EVT_OPEN(id=%d)", (int)id);
+ hscmd_uws_id = (void *)id;
+ len = sprintf((char *)msg, "%s %s", ICO_HS_MSG_HEAD_CM, HS_REQ_ANS_HELLO);
+ ico_uws_send((struct ico_uws_context *)context, (void *)id, msg, len);
+ break;
+
+ case ICO_UWS_EVT_CLOSE:
+ hscmd_trace("hscmd_callback_uws: ICO_UWS_EVT_CLOSE(id=%d)", (int)id);
+ hscmd_uws_context = NULL;
+ hscmd_uws_id = NULL;
+ break;
+
+ case ICO_UWS_EVT_RECEIVE:
+ hscmd_trace("hscmd_callback_uws: ICO_UWS_EVT_RECEIVE(id=%d, msg=%s, len=%d)",
+ (int)id, (char *)detail->_ico_uws_message.recv_data,
+ detail->_ico_uws_message.recv_len);
+ in = (char *)detail->_ico_uws_message.recv_data;
+
+ if(strncmp("ANS HELLO", in, 9) == 0) {
+ fseek(hscmd_fp, 0, SEEK_END);
+ fsize = ftell(hscmd_fp);
+ fseek(hscmd_fp, 0L, SEEK_SET);
+
+ len = (int)fsize + 4;
+ send = (void *)malloc(len);
+
+ memset(send, 0, len);
+
+ sprintf((char *)send, "%s ", ICO_HS_MSG_HEAD_CM);
+
+ fread(send + 4, 1, fsize, hscmd_fp);
+ hscmd_trace("hscmd_callback_uws: send (%s)", send);
+
+ ico_uws_send((struct ico_uws_context *)context, (void *)id, send, len);
+
+ hscnd_send_end = 1;
+ }
+ break;
+
+ case ICO_UWS_EVT_ERROR:
+ hscmd_trace("hscmd_callback_uws: ICO_UWS_EVT_ERROR(id=%d, err=%d)",
+ (int)id, detail->_ico_uws_error.code);
+ break;
+
+ case ICO_UWS_EVT_ADD_FD:
+ hscmd_trace("hscmd_callback_uws: ICO_UWS_EVT_ADD_FD(id=%d, fd=%d)",
+ (int)id, detail->_ico_uws_fd.fd);
+ break;
+
+ case ICO_UWS_EVT_DEL_FD:
+ hscmd_trace("hscmd_callback_uws: ICO_UWS_EVT_DEL_FD(id=%d, fd=%d)",
+ (int)id, detail->_ico_uws_fd.fd);
+ break;
+
+ default:
+ break;
+ }
+
+ return;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief hscmd_create_ws_context
+ * connect to the homescreen using websocket.
+ *
+ * @param[in] none
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+hscmd_create_ws_context(void)
+{
+ int ret;
+ char uri[ICO_HS_TEMP_BUF_SIZE];
+
+ /* set up URI "ws://HOST:PORT" */
+ sprintf(uri, "ws://%s:%d", ICO_HS_WS_HOST, hscmd_ws_port);
+
+ hscmd_uws_context = ico_uws_create_context(uri, ICO_HS_PROTOCOL);
+
+ hscmd_ws_connected = 0;
+ if (hscmd_uws_context == NULL) {
+ fprintf(stderr, "libwebsocket_create_context failed.\n");
+ } else {
+ /* set callback */
+ ret = ico_uws_set_event_cb(hscmd_uws_context, hscmd_callback_uws, NULL);
+ if (ret != ICO_UWS_ERR_NONE) {
+ hscmd_trace("hscmd_create_ws_context: cannnot set callback");
+ }
+ hscmd_ws_connected = 1;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief hscmd_destroy_ws_context
+ * destroy websokets connection.
+ *
+ * @param[in] none
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+hscmd_destroy_ws_context(void)
+{
+ if (hscmd_uws_context) {
+ ico_uws_service(hscmd_uws_context);
+ usleep(50 * 1000);
+ ico_uws_unset_event_cb(hscmd_uws_context);
+ ico_uws_close(hscmd_uws_context);
+ hscmd_uws_context = NULL;
+ hscmd_ws_connected = 0;
+ }
+}
+
+static void
+hscmd_ws_service_loop(void)
+{
+ while (hscmd_ws_connected) {
+ ico_uws_service(hscmd_uws_context);
+ usleep(50 * 1000);
+ if (hscnd_send_end == 1) {
+ hscmd_destroy_ws_context();
+ }
+ }
+}
+
+static void
+hscmd_usage(const char *prog)
+{
+ fprintf(stderr, "Usage: %s filename\n", prog);
+ exit(0);
+}
+
+/*--------------------------------------------------------------------------*/
+/*
+ * @brief test command tools
+ * send json format command to
+ * main routine
+ *
+ * @param main() finction's standard parameter (argc,argv)
+ * @return result
+ * @retval 0 success
+ * @retval 1 failed
+ */
+/*--------------------------------------------------------------------------*/
+int
+main(int argc, char *argv[])
+{
+
+ /* read json file */
+ if (argc < 1) {
+ hscmd_usage(argv[0]);
+ }
+
+ hscmd_fp = fopen(argv[1], "rb");
+ if (hscmd_fp == NULL) {
+ hscmd_usage(argv[0]);
+ }
+
+ /* Init websockets */
+ hscmd_create_ws_context();
+
+ hscmd_ws_service_loop();
+
+ hscmd_destroy_ws_context();
+
+ fclose(hscmd_fp);
+
+ return 0;
+}
+
--- /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
+ *
+ */
+/**
+ * @brief System Test Tool for set VehicleInfo
+ *
+ * @date Apr-09-2013
+ */
+
+#define MSG_INTERFACE 0 /* 1= Message Queue Interface */
+#define LWS_INTERFACE 1 /* 1= WebSockets Interface */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <pthread.h>
+#include <sys/ioctl.h>
+#include <sys/ipc.h>
+#include <sys/msg.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#if LWS_INTERFACE > 0 /* WebSocket Interface */
+#include <libwebsockets.h>
+#endif /*LWS_INTERFACE*/ /* WebSocket Interface */
+
+#define TYPE_NULL 0
+#define TYPE_BOOL 1
+#define TYPE_BYTE 2
+#define TYPE_INT16 3
+#define TYPE_UINT16 4
+#define TYPE_INT32 5
+#define TYPE_UINT32 6
+#define TYPE_DOUBLE 7
+#define TYPE_STRING 8
+#define TYPE_SHIFT 12
+
+#if LWS_INTERFACE > 0 /* WebSocket Interface */
+#define LWS_DEFAULTIP "127.0.0.1" /* websockets default ip(localhost) */
+#define LWS_DEFAULTPORT 25010 /* websockets default port */
+#define LWS_PROTOCOLNAME "standarddatamessage-only"
+ /* websockets protocol name */
+#endif /*LWS_INTERFACE*/ /* WebSocket Interface */
+
+static const struct {
+ char *prop;
+ char *eventtype;
+ unsigned char datatype[4];
+} vehicleinfo_key[] = {
+ { "VehicleSpeed", "VELOCITY", {TYPE_INT32, TYPE_NULL, 0,0} },
+ { "Speed", "VELOCITY", {TYPE_INT32, TYPE_NULL, 0,0} },
+ { "Velocity", "VELOCITY", {TYPE_INT32, TYPE_NULL, 0,0} },
+ { "Location", "LOCATION", {TYPE_DOUBLE, TYPE_DOUBLE, TYPE_DOUBLE, TYPE_NULL} },
+ { "Direction", "DIRECTION", {TYPE_DOUBLE, TYPE_NULL, 0,0} },
+ { "EngineSpeed", "ENGINE_SPEED", {TYPE_INT32, TYPE_NULL, 0, 0} },
+ { "Engine", "ENGINE_SPEED", {TYPE_INT32, TYPE_NULL, 0, 0} },
+ { "Shift", "SHIFT", {TYPE_SHIFT, TYPE_BYTE, TYPE_NULL, 0} },
+ { "ShiftPosition", "SHIFT", {TYPE_SHIFT, TYPE_BYTE, TYPE_NULL, 0} },
+ { "Break_Signal", "BRAKE_SIGNAL", {TYPE_BOOL, TYPE_NULL, 0,0} },
+ { "BreakSignal", "BRAKE_SIGNAL", {TYPE_BOOL, TYPE_NULL, 0,0} },
+ { "Break", "BRAKE_SIGNAL", {TYPE_BOOL, TYPE_NULL, 0,0} },
+ { "Blinker", "TURN_SIGNAL", {TYPE_INT32, TYPE_NULL, 0, 0} },
+ { "Winker", "TURN_SIGNAL", {TYPE_INT32, TYPE_NULL, 0, 0} },
+ { "TurnSignal", "TURN_SIGNAL", {TYPE_INT32, TYPE_NULL, 0, 0} },
+ { "Turn", "TURN_SIGNAL", {TYPE_INT32, TYPE_NULL, 0, 0} },
+ { "lightStatus", "LIGHTSTATUS", {TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_BOOL} },
+ { "light", "LIGHTSTATUS", {TYPE_BOOL, TYPE_BOOL, TYPE_BOOL, TYPE_BOOL} },
+ { "WATER_TEMP", "WATER_TEMP", {TYPE_INT32, TYPE_NULL, 0, 0} },
+ { "\0", "\0", {TYPE_NULL, 0,0,0} } };
+
+struct KeyDataMsg_t
+{
+#if MSG_INTERFACE > 0 /* Message Queue Interface */
+ long mtype;
+#endif /*MSG_INTERFACE*/ /* Message Queue Interface */
+ char KeyEventType[64];
+ struct timeval recordtime;
+ struct KeyData
+ {
+ int common_status;
+ char status[];
+ } data;
+};
+
+#if MSG_INTERFACE > 0 /* Message Queue Interface */
+static int sndqueuekey = 55555;
+static int sndqueueid = 0;
+
+static int mqid = -1;
+#endif /*MSG_INTERFACE*/ /* Message Queue Interface */
+
+#if LWS_INTERFACE > 0 /* WebSocket Interface */
+static struct libwebsocket_context *context = NULL;
+ /* websockets context */
+static struct libwebsocket *websocket = NULL;
+ /* websockets connection */
+static int connected = 0; /* connection flag */
+
+static int lws_callback(struct libwebsocket_context *context, struct libwebsocket *wsi,
+ enum libwebsocket_callback_reasons reason,
+ void *user, void *in, size_t len);
+
+static struct libwebsocket_protocols protocols[] = {
+ {LWS_PROTOCOLNAME, lws_callback, 0},
+ {NULL, NULL, -1}
+ };
+#endif /*LWS_INTERFACE*/ /* WebSocket Interface */
+
+#if MSG_INTERFACE > 0 /* Message Queue Interface */
+static void
+init_comm(const int mqkey)
+{
+ char dummy[256];
+
+ if (mqkey == 0) {
+ mqid = -1;
+ }
+ else {
+ mqid = msgget(mqkey, 0);
+ if (mqid < 0) {
+ mqid = msgget(mqkey, IPC_CREAT);
+ }
+ if (mqid < 0) {
+ fprintf(stderr, "Can not create message queue(%d(0x%x))[%d]\n",
+ mqkey, mqkey, errno);
+ return;
+ }
+ while (msgrcv(mqid, dummy, sizeof(dummy)-sizeof(long), 0, IPC_NOWAIT) > 0) ;
+ }
+}
+#endif /*MSG_INTERFACE*/ /* Message Queue Interface */
+
+#if LWS_INTERFACE > 0 /* WebSocket Interface */
+static int
+lws_callback(struct libwebsocket_context *context, struct libwebsocket *wsi,
+ enum libwebsocket_callback_reasons reason, void *user,
+ void *in, size_t len)
+{
+ if (reason == LWS_CALLBACK_CLIENT_ESTABLISHED) {
+ connected = 1;
+ }
+ /* do nothing */
+ return 0;
+}
+
+static void
+init_comm(const int port, const char *spadr)
+{
+ int rep;
+
+ context = libwebsocket_create_context(CONTEXT_PORT_NO_LISTEN,
+ spadr, protocols,
+ libwebsocket_internal_extensions,
+ NULL, NULL, -1, -1, 0);
+ if (context == NULL) {
+ fprintf(stderr, "Can not create libwebsockets context(ip=%s port=%d)\n",
+ spadr, port);
+ exit(2);
+ }
+
+ connected = 0;
+ websocket = libwebsocket_client_connect(context, spadr, port,
+ 0, "/", spadr, "websocket",
+ protocols[0].name, -1);
+ if (websocket == NULL) {
+ fprintf(stderr, "Can not connect libwebsockets context(ip=%s port=%d)\n",
+ spadr, port);
+ exit(2);
+ }
+ /* wait for connection */
+ for (rep = 0; rep < (2*1000); rep += 50) {
+ if (connected) break;
+ libwebsocket_service(context, 50);
+ }
+}
+#endif /*LWS_INTERFACE*/ /* WebSocket Interface */
+
+static void
+init_vehicleinfo(void)
+{
+#if MSG_INTERFACE > 0 /* Message Queue Interface */
+ sndqueueid = msgget(sndqueuekey, 0);
+ if (sndqueueid < 0) {
+ fprintf(stderr, "Send Message Queue(%d(0x%x)) dose not exist[%d].\n",
+ sndqueuekey, sndqueuekey, errno);
+ }
+#endif /*MSG_INTERFACE*/ /* Message Queue Interface */
+}
+
+static void
+set_vehicleinfo(const char *cmd)
+{
+ int i, j;
+ int idx, key, pt;
+ int msgsize;
+ char prop[64];
+ char value[128];
+ int sec, msec;
+ struct {
+ struct KeyDataMsg_t msg;
+ char dummy[128];
+ } msg;
+#if LWS_INTERFACE > 0 /* WebSocket Interface */
+ unsigned char buf[LWS_SEND_BUFFER_PRE_PADDING + 512 + LWS_SEND_BUFFER_POST_PADDING];
+ unsigned char *bufpt = &buf[LWS_SEND_BUFFER_PRE_PADDING];
+#endif /*LWS_INTERFACE*/ /* WebSocket Interface */
+
+ j = 0;
+ for (i = 0; cmd[i]; i++) {
+ if ((cmd[i] == '=') || (cmd[i] == ' ')) break;
+ if (j < (int)(sizeof(prop)-1)) {
+ prop[j++] = cmd[i];
+ }
+ }
+
+ prop[j] = 0;
+ j = 0;
+ if (cmd[i] != 0) {
+ for (i++; cmd[i]; i++) {
+ if (cmd[i] == ' ') continue;
+ if (j < (int)(sizeof(value)-1)) {
+ value[j++] = cmd[i];
+ }
+ }
+ }
+ value[j] = 0;
+
+ if (strcasecmp(prop, "sleep") == 0) {
+ sec = 0;
+ msec = 0;
+ for (i = 0; value[i]; i++) {
+ if (value[i] == '.') break;
+ sec = sec * 10 + (value[i] & 0x0f);
+ }
+ if (value[i] == '.') {
+ i++;
+ if (value[i] != 0) {
+ msec = (value[i] & 0x0f) * 100;
+ i++;
+ }
+ if (value[i] != 0) {
+ msec = msec + (value[i] & 0x0f) * 10;
+ i++;
+ }
+ if (value[i] != 0) {
+ msec = msec + (value[i] & 0x0f);
+ }
+ }
+ if (sec > 0) sleep(sec);
+ if (msec > 0) usleep(msec * 1000);
+
+ return;
+ }
+
+ for (key = 0; vehicleinfo_key[key].prop[0]; key++) {
+ if (strcasecmp(prop, vehicleinfo_key[key].prop) == 0) break;
+ }
+ if (! vehicleinfo_key[key].prop[0]) {
+ fprintf(stderr, "VehicleInfo UnKnown property[%s]\n", prop);
+ return;
+ }
+
+ memset(&msg, 0, sizeof(msg));
+#if MSG_INTERFACE > 0 /* Message Queue Interface */
+ msg.msg.mtype = 1;
+#endif /*MSG_INTERFACE*/ /* Message Queue Interface */
+ strcpy(msg.msg.KeyEventType, vehicleinfo_key[key].eventtype);
+ gettimeofday(&(msg.msg.recordtime), NULL);
+#if MSG_INTERFACE > 0 /* Message Queue Interface */
+ msgsize = sizeof(msg) - 128 - sizeof(long);
+#endif /*MSG_INTERFACE*/ /* Message Queue Interface */
+#if LWS_INTERFACE > 0 /* WebSocket Interface */
+ msgsize = sizeof(msg) - 128;
+#endif /*LWS_INTERFACE*/ /* WebSocket Interface */
+
+ i = 0;
+ pt = 0;
+ for (idx = 0; idx < 4; idx++) {
+ if (vehicleinfo_key[key].datatype[idx] == TYPE_NULL) break;
+
+ if (value[i]) {
+ for (j = i; value[j]; j++) {
+ if ((value[j] == ',') || (value[j] == ';') ||
+ (value[j] == ':') || (value[j] == ' ')) break;
+ }
+ if (value[j] != 0) {
+ value[j++] = 0;
+ }
+ switch (vehicleinfo_key[key].datatype[idx] % 10) {
+ case TYPE_BOOL:
+ case TYPE_BYTE:
+ if (vehicleinfo_key[key].datatype[idx] == TYPE_SHIFT) {
+ if ((strcasecmp(&value[i], "sp") == 0) ||
+ (strcasecmp(&value[i], "s0") == 0)) {
+ strcpy(&value[i], "0");
+ }
+ else if (strcasecmp(&value[i], "sr") == 0) {
+ strcpy(&value[i], "1");
+ }
+ else if (strcasecmp(&value[i], "sn") == 0) {
+ strcpy(&value[i], "2");
+ }
+ else if ((strcasecmp(&value[i], "sd") == 0) ||
+ (strcasecmp(&value[i], "s4") == 0)) {
+ strcpy(&value[i], "4");
+ }
+ else if ((strcasecmp(&value[i], "s1") == 0) ||
+ (strcasecmp(&value[i], "sl") == 0)) {
+ strcpy(&value[i], "5");
+ }
+ else if (strcasecmp(&value[i], "s2") == 0) {
+ strcpy(&value[i], "6");
+ }
+ else if (strcasecmp(&value[i], "s3") == 0) {
+ strcpy(&value[i], "7");
+ }
+ }
+ msg.msg.data.status[pt++] = strtoul(&value[i], (char **)0, 0);
+ msgsize += 1;
+ break;
+ case TYPE_INT16:
+ case TYPE_UINT16:
+ *((short *)&msg.msg.data.status[pt]) = strtol(&value[i], (char **)0, 0);
+ pt += sizeof(short);
+ msgsize += sizeof(short);
+ break;
+ case TYPE_INT32:
+ case TYPE_UINT32:
+ *((int *)&msg.msg.data.status[pt]) = strtol(&value[i], (char **)0, 0);
+ pt += sizeof(int);
+ msgsize += sizeof(int);
+ break;
+ case TYPE_DOUBLE:
+ *((double *)&msg.msg.data.status[pt]) = strtod(&value[i], (char **)0);
+ pt += sizeof(double);
+ msgsize += sizeof(double);
+ break;
+ default:
+ break;
+ }
+ i = j;
+ }
+ else {
+ switch (vehicleinfo_key[key].datatype[idx]) {
+ case TYPE_BOOL:
+ case TYPE_BYTE:
+ msgsize += 1;
+ break;
+ case TYPE_INT16:
+ case TYPE_UINT16:
+ msgsize += sizeof(short);
+ break;
+ case TYPE_INT32:
+ case TYPE_UINT32:
+ msgsize += sizeof(int);
+ break;
+ case TYPE_DOUBLE:
+ msgsize += sizeof(double);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+#if MSG_INTERFACE > 0 /* Message Queue Interface */
+ if (msgsnd(sndqueueid, &msg, msgsize, 0) < 0) {
+ fprintf(stderr, "Message Queue(%d(0x%x)) send error[%d].\n",
+ sndqueuekey, sndqueuekey, errno);
+ }
+#endif /*MSG_INTERFACE*/ /* Message Queue Interface */
+#if LWS_INTERFACE > 0 /* WebSocket Interface */
+ memcpy(bufpt, &msg, msgsize);
+ if (libwebsocket_write(websocket, bufpt, msgsize, LWS_WRITE_BINARY) < 0) {
+ fprintf(stderr, "libwebsockets send error\n"); fflush(stderr);
+ }
+#endif /*LWS_INTERFACE*/ /* WebSocket Interface */
+}
+
+static void
+usage(const char *prog)
+{
+#if LWS_INTERFACE > 0 /* WebSocket Interface */
+ fprintf(stderr, "Usage: %s [-port=port] [-ip=ip_addr] [propaty=value] [propaty=value] ...\n", prog);
+#endif /*LWS_INTERFACE*/ /* WebSocket Interface */
+#if MSG_INTERFACE > 0 /* Message Queue Interface */
+ fprintf(stderr, "Usage: %s [-ambkey=key] [-mq[=key]] [propaty=value] [propaty=value] ...\n", prog);
+#endif /*MSG_INTERFACE*/ /* Message Queue Interface */
+ exit(0);
+}
+
+int
+main(int argc, char *argv[])
+{
+ int i, j;
+#if LWS_INTERFACE > 0 /* WebSocket Interface */
+ int port = LWS_DEFAULTPORT;
+ char spadr[64];
+#endif /*LWS_INTERFACE*/ /* WebSocket Interface */
+#if MSG_INTERFACE > 0 /* Message Queue Interface */
+ int mqkey = 0;
+ struct {
+ long mtype;
+ char buf[240];
+ } mqbuf;
+#endif /*MSG_INTERFACE*/ /* Message Queue Interface */
+ char buf[240];
+
+#if LWS_INTERFACE > 0 /* WebSocket Interface */
+ strcpy(spadr, LWS_DEFAULTIP);
+#endif /*LWS_INTERFACE*/ /* WebSocket Interface */
+
+ j = 0;
+ for (i = 1; i < argc; i++) {
+ if (argv[i][0] == '-') {
+#if MSG_INTERFACE > 0 /* Message Queue Interface */
+ if (strncasecmp(argv[i], "-ambkey=", 8) == 0) {
+ sndqueuekey = strtoul(&argv[i][8], (char **)0, 0);
+ }
+ else if (strncasecmp(argv[i], "-mq", 3) == 0) {
+ if (argv[i][3] == '=') {
+ mqkey = strtol(&argv[i][4], (char **)0, 0);
+ }
+ else {
+ mqkey = 55552; /* default message queue key */
+ }
+ }
+#endif /*MSG_INTERFACE*/ /* Message Queue Interface */
+#if LWS_INTERFACE > 0 /* WebSocket Interface */
+ if (strncasecmp(argv[i], "-port=", 6) == 0) {
+ port = strtoul(&argv[i][6], (char **)0, 0);
+ }
+ else if (strncasecmp(argv[i], "-ip=", 4) == 0) {
+ memset(spadr, 0, sizeof(spadr));
+ strncpy(spadr, &argv[i][4], sizeof(spadr)-1);
+ }
+#endif /*LWS_INTERFACE*/ /* WebSocket Interface */
+ else {
+ usage(argv[0]);
+ }
+ }
+ else {
+ j++;
+ }
+ }
+
+#if MSG_INTERFACE > 0 /* Message Queue Interface */
+ init_comm(mqkey);
+#endif /*MSG_INTERFACE*/ /* Message Queue Interface */
+#if LWS_INTERFACE > 0 /* WebSocket Interface */
+ init_comm(port, spadr);
+#endif /*LWS_INTERFACE*/ /* WebSocket Interface */
+
+ init_vehicleinfo();
+
+#if MSG_INTERFACE > 0 /* Message Queue Interface */
+ if (mqid >= 0) {
+ while (1) {
+ memset(&mqbuf, 0, sizeof(mqbuf));
+ if (msgrcv(mqid, &mqbuf, sizeof(mqbuf)-sizeof(long), 0, 0) < 0) break;
+ k = 0;
+ j = -1;
+ for (i = 0; mqbuf.buf[i]; i++) {
+ if ((mqbuf.buf[i] == '#') || (mqbuf.buf[i] == '\n')
+ || (mqbuf.buf[i] == '\r')) break;
+ if (mqbuf.buf[i] == '\t') buf[k++] = ' ';
+ else buf[k++] = mqbuf.buf[i];
+ if ((j < 0) && (mqbuf.buf[i] != ' ')) j = i;
+ }
+ if (j < 0) continue;
+ buf[k] = 0;
+ set_vehicleinfo(&buf[j]);
+ }
+ msgctl(mqid, IPC_RMID, NULL);
+ }
+ else
+#endif /*MSG_INTERFACE*/ /* Message Queue Interface */
+ if (j <= 0) {
+ while (fgets(buf, sizeof(buf), stdin)) {
+ j = -1;
+ for (i = 0; buf[i]; i++) {
+ if ((buf[i] == '#') || (buf[i] == '\n') || (buf[i] == '\r')) break;
+ if (buf[i] == '\t') buf[i] = ' ';
+ if ((j < 0) && (buf[i] != ' ')) j = i;
+ }
+ if (j < 0) continue;
+ buf[i] = 0;
+ set_vehicleinfo(&buf[j]);
+ }
+ }
+ else {
+ for (i = 1; i < argc; i++) {
+ if (argv[i][0] == '-') continue;
+ set_vehicleinfo(argv[i]);
+ }
+ }
+#if LWS_INTERFACE > 0 /* WebSocket Interface */
+ if (context) {
+ libwebsocket_context_destroy(context);
+ }
+#endif /*LWS_INTERFACE*/ /* WebSocket Interface */
+
+ exit(0);
+}
+
--- /dev/null
+{
+ "application": [
+ {
+ "program": {
+ "id":"org.tizen.music-player",
+ "execute":"org.tizen.music-player"
+ },
+ "window": [
+ {
+ "resize":"0,100,100",
+ "move":"0,0,64",
+ "visible_raise":"0,1,1"
+ }
+ ]
+ }
+ ]
+}
--- /dev/null
+{
+ "application": [
+ {
+ "program": {
+ "id":"org.tizen.music-player"
+ },
+ "window": [
+ {
+ "resize":"0,200,200",
+ "move":"0,100,164",
+ "visible_raise":"0,1,1"
+ }
+ ]
+ }
+ ]
+}
--- /dev/null
+{
+ "application": [
+ {
+ "program": {
+ "id":"org.tizen.music-player"
+ },
+ "window": [
+ {
+ "resize":"0,400,400",
+ "move":"0,200,264",
+ "visible_raise":"0,1,1"
+ }
+ ]
+ }
+ ]
+}
--- /dev/null
+{
+ "application": [
+ {
+ "program": {
+ "id":"org.tizen.music-player"
+ },
+ "window": [
+ {
+ "resize":"0,800,800",
+ "move":"0,300,364",
+ "visible_raise":"0,1,1"
+ }
+ ]
+ }
+ ]
+}
--- /dev/null
+{
+ "application": [
+ {
+ "program": {
+ "id":"TOUCH_SCREEN"
+ },
+ "window": [
+ {
+ "hide":"0"
+ }
+ ]
+ }
+ ]
+}
--- /dev/null
+{
+ "application": [
+ {
+ "program": {
+ "id":"org.tizen.music-player"
+ },
+ "window": [
+ {
+ "resize":"0,100,100",
+ "move":"0,0,64",
+ "visible_raise":"0,1,1"
+ }
+ ]
+ }
+ ]
+}
--- /dev/null
+{
+ "application": [
+ {
+ "program": {
+ "id":"TOUCH_SCREEN"
+ },
+ "window": [
+ {
+ "show":"0"
+ }
+ ]
+ }
+ ]
+}
--- /dev/null
+{
+ "application": [
+ {
+ "program": {
+ "id":"org.tizen.music-player",
+ "terminate":"org.tizen.music-player"
+ },
+ "window": [
+ {
+ "resize":"0,100,100",
+ "move":"0,0,64",
+ "visible_raise":"0,1,1"
+ }
+ ]
+ }
+ ]
+}
--- /dev/null
+XY=800,794
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
--- /dev/null
+#wait for starting weston
+sleep 5
+
+#Change button pushed at tile screen
+XY=960,30
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#Change button pushed at application screen
+XY=960,30
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#Application is selected
+XY=1466,242
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#Hide shown application
+XY=960,30
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#Holiding down a application tile
+XY=1466,242
+sleep 0.1
+Button=Down
+sleep 3
+Button=Up
+sleep 2
+
+#Cancel selected on confirmation screen
+XY=1115,664
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#OK selected on confirmation screen
+XY=1466,242
+sleep 0.1
+Button=Down
+sleep 3
+Button=Up
+sleep 2
+XY=669,664
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#Application list button is pushed
+XY=335,32
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#Next selected on applicaton list
+XY=800,794
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#Cancel selected on applicaton list
+XY=1115,794
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#application icon selected on applicaton list
+XY=335,32
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+
--- /dev/null
+XY=221,774
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
--- /dev/null
+#wait for starting weston
+sleep 5
+
+#Change button pushed at tile screen
+XY=384,30
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#Change button pushed at application screen
+XY=384,30
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#Application is selected
+XY=666,168
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#Hide shown application
+XY=384,30
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#Holiding down a application tile
+XY=666,168
+sleep 0.1
+Button=Down
+sleep 3
+Button=Up
+sleep 2
+
+#Cancel selected on confirmation screen
+XY=546,628
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#OK selected on confirmation screen
+XY=666,168
+sleep 0.1
+Button=Down
+sleep 3
+Button=Up
+sleep 2
+XY=221,628
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#Application list button is pushed
+XY=666,920
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#Next selected on applicaton list
+XY=221,744
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#Cancel selected on applicaton list
+XY=546,744
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+#application icon selected on applicaton list
+XY=666,920
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
+
+
--- /dev/null
+XY=COORD_X,COORD_Y
+sleep 0.1
+Button=Down
+sleep 0.1
+Button=Up
+sleep 2
test_target_flag = -I../../../include $(AIL_CFLAGS) $(OPT_CFLAGS) \
@ECORE_CFLAGS@ @EINA_CFLAGS@ \
+ -I/usr/include/ico-uxf-weston-plugin \
-I/usr/include/ico-util
test_target_lib = ../../../lib/apps-framework/.libs/libico-appfw.so \
@ECORE_LIBS@ @EINA_LIBS@ \
AM_CFLAGS = $(GCC_CFLAGS)
AM_CPPFLAGS = $(GCC_CXXFLAGS)
-COMMON_LIBS = -L/usr/local/lib -lm -lwebsockets
+COMMON_LIBS = -L/usr/local/lib -lm -lwebsockets -lico-uxf-weston-plugin
noinst_PROGRAMS = \
DummyHomeScreen
@WAYLANDCLIENT_CFLAGS@ \
@CAPIAPPFWAPPLICATION_CFLAGS@ \
-I/usr/include/ico-util \
+ -I/usr/include/ico-uxf-weston-plugin \
-I../../../include
DummyHomeScreen_LDADD = \
@WAYLANDCLIENT_LIBS@ \
@CAPIAPPFWAPPLICATION_LIBS@ \
-L/usr/lib \
+ -lico-uxf-weston-plugin \
-lico-util \
../../../lib/apps-framework/.libs/libico-appfw.so \
-lreadline
export abs_builddir
wayland_client_lib = -lwayland-client
-wayland_ivi_client_lib = $(GENIVI_LIBS)
+wayland_ivi_client_lib = -lico-uxf-weston-plugin
+wayland_ivi_client_inc = -I/usr/include/ico-uxf-weston-plugin
appfw_client_lib = ../lib/apps-framework/.libs/libico-appfw.so
-AM_CFLAGS = $(GCC_CFLAGS) -I../include -I/usr/include/ico-util
+AM_CFLAGS = $(GCC_CFLAGS) -I../include -I/usr/include/ico-util $(wayland_ivi_client_inc)
AM_LDFLAGS = -module -avoid-version -rpath $(libdir) $(GLIB_LIBS)
bin_PROGRAMS = \
- ico_change_loginuser
+ ico_change_loginuser \
+ ico_clear_screen
check_LTLIBRARIES = $(TESTS)
-check_PROGRAMS = ico_login_user
+check_PROGRAMS = ico_clear_screen ico_login_user
+
+ico_clear_screen_SOURCES = \
+ ico_clear_screen.c
+ico_clear_screen_LDADD = $(SIMPLE_CLIENT_LIBS) -lico-util $(wayland_ivi_client_lib) $(wayland_client_lib) -lwayland-egl -lEGL -lGLESv2
ico_change_loginuser = \
ico_change_loginuser.c
--- /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
+ *
+ */
+/**
+ * @brief Display screen clear tool
+ *
+ * @date Sep-30-2013
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <signal.h>
+#include "ico_clear_screen.h"
+#include <ico-uxf-weston-plugin/ico_window_mgr-client-protocol.h>
+
+static struct display *_display;
+static int signal_flag = 0;
+
+static void
+sigterm_catch(int signo)
+{
+ signal_flag = 1;
+
+ if (_display->ico_window_mgr) {
+ ico_window_mgr_layout_surface(_display->ico_window_mgr, -1, -1,
+ -1, -1, -1, -1, 0);
+ }
+}
+
+void
+wayland_dispatch_nonblock(struct wl_display *display)
+{
+ int nread;
+
+ /* Check wayland input */
+ do {
+ /* Flush send data */
+ wl_display_flush(display);
+
+ nread = 0;
+ if (ioctl(wl_display_get_fd(display), FIONREAD, &nread) < 0) {
+ nread = 0;
+ }
+ if (nread >= 8) {
+ /* Read event from wayland */
+ wl_display_dispatch(display);
+ }
+ } while (nread > 0);
+}
+
+EGLDisplay
+opengl_init(struct wl_display *display, EGLConfig *rconf, EGLContext *rctx)
+{
+ EGLDisplay dpy; /* EGL dsplay id */
+ EGLint major, minor;
+ EGLint num_configs;
+ EGLConfig conf = 0;
+ EGLContext ctx;
+
+ static const EGLint config_attribs[] = {
+ EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ EGL_ALPHA_SIZE, 1,
+ EGL_DEPTH_SIZE, 1,
+ EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+ EGL_NONE
+ };
+ static const EGLint context_attribs[] = {
+ EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE
+ };
+
+ dpy = eglGetDisplay((EGLNativeDisplayType)display);
+ if (! dpy) {
+ fprintf(stderr, "eglGetDisplay Error\n");
+ return NULL;
+ }
+
+ if (eglInitialize(dpy, &major, &minor) == EGL_FALSE) {
+ fprintf(stderr, "eglInitialize Error\n");
+ return NULL;
+ }
+
+ if (eglBindAPI(EGL_OPENGL_ES_API) == EGL_FALSE) {
+ fprintf(stderr, "eglBindAPI Error\n");
+ return NULL;
+ }
+
+ if (eglChooseConfig(dpy, config_attribs, &conf, 1, &num_configs) == EGL_FALSE) {
+ fprintf(stderr, "eglChooseConfig Error\n");
+ return NULL;
+ }
+
+ ctx = eglCreateContext(dpy, conf, EGL_NO_CONTEXT, context_attribs);
+ if (! ctx) {
+ fprintf(stderr, "eglCreateContext Error\n");
+ return NULL;
+ }
+ *rconf = conf;
+ *rctx = ctx;
+
+ wayland_dispatch_nonblock(display);
+
+ return(dpy);
+}
+
+EGLSurface
+opengl_create_window(struct display *display, struct wl_surface *surface,
+ EGLDisplay dpy, EGLConfig conf, EGLContext ctx,
+ const int width, const int height, const unsigned int color,
+ const int displayno, const int posx, const int posy)
+{
+ struct wl_egl_window *egl_window;
+ EGLSurface egl_surface;
+
+ static const EGLint surface_attribs[] = {
+ EGL_ALPHA_FORMAT, EGL_ALPHA_FORMAT_PRE, EGL_NONE
+ };
+
+ egl_window = wl_egl_window_create(surface, width, height);
+ egl_surface = eglCreateWindowSurface(dpy, conf, (EGLNativeWindowType)egl_window,
+ surface_attribs);
+ eglMakeCurrent(dpy, egl_surface, egl_surface, ctx);
+ glViewport(0, 0, width, height);
+
+ wayland_dispatch_nonblock(display->display);
+
+ opengl_clear_window(color);
+
+ opengl_swap_buffer(display->display, dpy, egl_surface);
+
+ ico_window_mgr_set_animation(display->ico_window_mgr, 0,
+ ICO_WINDOW_MGR_ANIMATION_TYPE_HIDE|
+ ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW,
+ display->animation, display->animatime);
+ ico_window_mgr_layout_surface(display->ico_window_mgr, 0, display->init_layer,
+ posx, posy, width, height, 1);
+ return(egl_surface);
+}
+
+void
+opengl_clear_window(const unsigned int color)
+{
+ double r, g, b, a;
+
+ r = (double)((color>>16) & 0x0ff);
+ r = r / 256.0;
+ g = (double)((color>>8) & 0x0ff);
+ g = g / 256.0;
+ b = (double)(color & 0x0ff);
+ b = b / 256.0;
+ a = (double)((color>>24) & 0x0ff);
+ a = (a + 1.0) / 256.0;
+
+ glClearColor(r, g, b, a);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT| GL_STENCIL_BUFFER_BIT);
+}
+
+void
+opengl_swap_buffer(struct wl_display *display, EGLDisplay dpy, EGLSurface egl_surface)
+{
+ eglSwapBuffers(dpy, egl_surface);
+
+ wayland_dispatch_nonblock(display);
+}
+
+void
+shell_surface_ping(void *data, struct wl_shell_surface *wl_shell_surface, uint32_t serial)
+{
+}
+
+void
+shell_surface_configure(void *data, struct wl_shell_surface *wl_shell_surface,
+uint32_t edges, int32_t width, int32_t height)
+{
+}
+
+void
+shell_surface_popup_done(void *data, struct wl_shell_surface *wl_shell_surface)
+{
+}
+
+void
+output_handle_geometry(void *data, struct wl_output *wl_output, int x, int y,
+ int physical_width, int physical_height, int subpixel,
+ const char *make, const char *model, int32_t transform)
+{
+ struct output *output = (struct output*)data;
+
+ output->x = x;
+ output->y = y;
+}
+
+void
+output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags,
+ int width, int height, int refresh)
+{
+ struct output *output = (struct output*)data;
+
+ if (flags & WL_OUTPUT_MODE_CURRENT) {
+ output->width = width;
+ output->height = height;
+ }
+}
+
+void
+handle_global(void *data, struct wl_registry *registry, uint32_t id,
+ const char *interface, uint32_t version) {
+ struct display *display = (struct display*)data;
+ struct output *output;
+
+ if (strcmp(interface, "wl_compositor") == 0) {
+ display->compositor = (struct wl_compositor*)wl_registry_bind(display->registry, id,
+ &wl_compositor_interface, 1);
+ }
+ else if (strcmp(interface, "wl_output") == 0) {
+ if (display->num_output < MAX_DISPLAY) {
+ output = (struct output*)malloc(sizeof *output);
+ output->display = display;
+ output->output = (struct wl_output*)wl_registry_bind(display->registry, id, &wl_output_interface, 1);
+ wl_output_add_listener(output->output, &output_listener, output);
+ display->output[display->num_output++] = output;
+ }
+ }
+ else if (strcmp(interface, "wl_shell") == 0) {
+ display->shell = (struct wl_shell*)wl_registry_bind(display->registry, id, &wl_shell_interface, 1);
+ }
+ else if (strcmp(interface, "ico_window_mgr") == 0) {
+ display->ico_window_mgr = (struct ico_window_mgr *)wl_registry_bind(display->registry, id, &ico_window_mgr_interface, 1);
+ }
+}
+
+void
+surface_enter(void *data, struct wl_surface *wl_surface, struct wl_output *output)
+{
+ struct surface *surface = (struct surface *)data;
+
+ surface->output = (struct output*)wl_output_get_user_data(output);
+}
+
+void
+surface_leave(void *data, struct wl_surface *wl_surface, struct wl_output *output)
+{
+ struct surface *surface = (struct surface*)data;
+
+ surface->output = NULL;
+
+}
+
+void
+sleep_with_wayland(struct wl_display *display, int msec)
+{
+ int nread;
+ int fd;
+
+ fd = wl_display_get_fd(display);
+
+ do {
+ /* Flush send data */
+ wl_display_flush(display);
+
+ /* Check wayland input */
+ nread = 0;
+ if (ioctl(fd, FIONREAD, &nread) < 0) {
+ nread = 0;
+ }
+ if (nread >= 8) {
+ /* Read event from wayland */
+ wl_display_dispatch(display);
+ }
+ msec -= 20;
+ if (msec >= 0) usleep(20*1000);
+ } while (msec > 0);
+}
+
+void
+create_surface(struct display *display, const char *title) {
+ struct surface *surface;
+
+ if (display->num_surface >= MAX_SURFACE) {
+ exit(1);
+ }
+ surface = (struct surface *)malloc(sizeof(struct surface));
+ assert(surface);
+ memset(surface, 0, sizeof(struct surface));
+ surface->display = display;
+ display->surface[display->num_surface++] = surface;
+ surface->surface = wl_compositor_create_surface(display->compositor);
+ wl_surface_add_listener(surface->surface, &surface_listener, surface);
+
+ if (display->shell) {
+ surface->shell_surface = wl_shell_get_shell_surface(display->shell,
+ surface->surface);
+ if (surface->shell_surface) {
+ wl_shell_surface_add_listener(surface->shell_surface,
+ &shell_surface_listener, display);
+ wl_shell_surface_set_toplevel(surface->shell_surface);
+ wl_shell_surface_set_title(surface->shell_surface, title);
+ }
+ }
+ wl_display_flush(display->display);
+ poll(NULL, 0, 100);
+
+ wl_display_roundtrip(display->display);
+
+ surface->dpy = opengl_init(display->display, &surface->conf, &surface->ctx);
+ if (surface->dpy) {
+ surface->egl_surface = opengl_create_window(display,
+ surface->surface,
+ surface->dpy,
+ surface->conf,
+ surface->ctx,
+ display->init_width,
+ display->init_height,
+ display->init_color,
+ display->displayno,
+ display->init_posx,
+ display->init_posy);
+ clear_surface(surface);
+ }
+}
+
+void
+clear_surface(struct surface *surface)
+{
+ struct display *display = surface->display;
+
+ opengl_clear_window(display->init_color);
+ opengl_swap_buffer(display->display,
+ surface->dpy, surface->egl_surface);
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+ char sname[64];
+
+ _display = malloc(sizeof(struct display));
+ memset(_display, 0, sizeof(struct display));
+
+ _display->displayno = 0;
+ _display->init_color = 0xff000000;
+ _display->init_width = 1920;
+ _display->init_height = 1920;
+ _display->init_layer = 201;
+ strcpy(_display->animation, "fade");
+ _display->animatime = 600;
+
+ for (i = 1; i < (argc-1); i++) {
+ if (strcasecmp(argv[i], "-display") == 0) {
+ i++;
+ _display->displayno = strtol(argv[i], (char **)0, 0);
+ }
+ else if (strcasecmp(argv[i], "-width") == 0) {
+ i++;
+ _display->init_width = strtol(argv[i], (char **)0, 0);
+ }
+ else if (strcasecmp(argv[i], "-height") == 0) {
+ i++;
+ _display->init_height = strtol(argv[i], (char **)0, 0);
+ }
+ else if (strcasecmp(argv[i], "-color") == 0) {
+ i++;
+ _display->init_color = strtoul(argv[i], (char **)0, 0);
+ }
+ else if (strcasecmp(argv[i], "-layer") == 0) {
+ i++;
+ _display->init_layer = strtol(argv[i], (char **)0, 0);
+ }
+ else if (strcasecmp(argv[i], "-animation") == 0) {
+ i++;
+ memset(_display->animation, 0, sizeof(_display->animation));
+ strncpy(_display->animation, argv[i], sizeof(_display->animation)-1);
+ }
+ else if (strcasecmp(argv[i], "-animatime") == 0) {
+ i++;
+ _display->animatime = strtol(argv[i], (char **)0, 0);
+ }
+ else {
+ fprintf(stderr,
+ "usage: %s [-display no][-layer layer][-color aarrggbb][-width width]"
+ "[-height height]\n", argv[0]);
+ exit(1);
+ }
+ }
+
+ _display->display = wl_display_connect(NULL);
+ if (! _display->display) {
+ fprintf(stderr, "can not connect to wayland\n");
+ return 1;
+ }
+ _display->registry = wl_display_get_registry(_display->display);
+ wl_registry_add_listener(_display->registry, ®istry_listener, _display);
+
+ wl_display_dispatch(_display->display);
+ sleep_with_wayland(_display->display, 300);
+
+ sprintf(sname, "Clear-Screen-%d-%d", getpid(), _display->displayno);
+ create_surface(_display, sname);
+
+ signal_flag = 0;
+ signal(SIGTERM, sigterm_catch);
+
+ while (signal_flag == 0) {
+ sleep_with_wayland(_display->display, 50);
+ }
+ for (i = 0; i < (450/50); i++) {
+ sleep_with_wayland(_display->display, 50);
+ }
+ return 0;
+}
+
--- /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
+ *
+ */
+/**
+ * @brief Display screen clear tool
+ *
+ * @date Sep-30-2013
+ */
+
+#ifndef _CLEAR_SCREEN_H_
+#define _CLEAR_SCREEN_H_
+
+#include <sys/ioctl.h>
+#include <GLES2/gl2.h>
+#include <EGL/egl.h>
+#include <wayland-client.h>
+#include <wayland-client-protocol.h>
+#include <wayland-egl.h>
+#include <wayland-util.h>
+#include <poll.h>
+#include <assert.h>
+
+#define MAX_CON_NAME 127
+#define MAX_DISPLAY 4
+#define MAX_SURFACE 4
+
+struct display {
+ struct wl_display *display;
+ struct wl_registry *registry;
+ struct wl_compositor *compositor;
+ struct wl_shell *shell;
+ struct ico_window_mgr *ico_window_mgr;
+ struct ico_exinput *ico_exinput;
+ struct input *input;
+ int num_output;
+ struct output *output[MAX_DISPLAY];
+ int num_surface;
+ struct surface *surface[MAX_SURFACE];
+ unsigned int init_color;
+ int init_width;
+ int init_height;
+ int init_layer;
+ int displayno;
+ int init_posx;
+ int init_posy;
+ char animation[64];
+ int animatime;
+ char connect[MAX_CON_NAME + 1];
+};
+
+struct input {
+ struct display *display;
+ struct wl_seat *seat;
+ struct wl_pointer *pointer;
+ struct wl_keyboard *keyboard;
+ float x, y;
+ uint32_t button_mask;
+ struct surface *pointer_focus;
+ struct surface *keyboard_focus;
+ uint32_t last_key, last_key_state;
+};
+
+struct output {
+ struct display *display;
+ struct wl_output *output;
+ int x, y;
+ int width, height;
+ int trans;
+};
+
+struct surface {
+ struct display *display;
+ struct wl_surface *surface;
+ struct wl_shell_surface *shell_surface;
+ struct output *output;
+ EGLDisplay dpy;
+ EGLConfig conf;
+ EGLContext ctx;
+ EGLSurface egl_surface;
+};
+
+void wayland_dispatch_nonblock(struct wl_display *display);
+void sleep_with_wayland(struct wl_display *display, int msec);
+void wait_with_wayland(struct wl_display *display, int msec, int *endflag);
+int sec_str_2_value(const char *ssec);
+EGLDisplay opengl_init(struct wl_display *display, EGLConfig *rconf, EGLContext *rctx);
+EGLSurface opengl_create_window(struct display *display, struct wl_surface *surface,
+ EGLDisplay dpy, EGLConfig conf, EGLContext ctx,
+ const int width, const int height, const unsigned int color,
+ const int displayno, const int posx, const int posy);
+void opengl_clear_window(const unsigned int color);
+void opengl_swap_buffer(struct wl_display *display, EGLDisplay dpy, EGLSurface egl_surface);
+void create_surface(struct display *display, const char *title);
+void clear_surface(struct surface *surface);
+void shell_surface_ping(void *data, struct wl_shell_surface *wl_shell_surface, uint32_t serial);
+void shell_surface_configure(void *data, struct wl_shell_surface *wl_shell_surface,
+ uint32_t edges, int32_t width, int32_t height);
+void shell_surface_popup_done(void *data, struct wl_shell_surface *wl_shell_surface);
+void output_handle_geometry(void *data, struct wl_output *wl_output, int x, int y,
+ int physical_width, int physical_height, int subpixel,
+ const char *make, const char *model, int32_t transform);
+void output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags,
+ int width, int height, int refresh);
+void handle_global(void *data, struct wl_registry *registry, uint32_t id,
+ const char *interface, uint32_t version);
+void surface_enter(void *data, struct wl_surface *wl_surface, struct wl_output *output);
+void surface_leave(void *data, struct wl_surface *wl_surface, struct wl_output *output);
+
+const struct wl_shell_surface_listener shell_surface_listener = {
+ shell_surface_ping,
+ shell_surface_configure,
+ shell_surface_popup_done
+};
+
+const struct wl_output_listener output_listener = {
+ output_handle_geometry,
+ output_handle_mode
+};
+
+const struct wl_registry_listener registry_listener = {
+ handle_global
+};
+
+const struct wl_surface_listener surface_listener = {
+ surface_enter,
+ surface_leave
+};
+
+#endif /*_CLEAR_SCREEN_H_*/
--- /dev/null
+AM_CFLAGS = $(GCC_CFLAGS)
+AM_CPPFLAGS = $(GCC_CXXFLAGS)
+
+noinst_PROGRAMS = \
+ ico_send_notification \
+ ico_send_notification2 \
+ ico_dump_notification \
+ ico_del_notification
+
+check_PROGRAMS = \
+ ico_send_notification \
+ ico_send_notification2 \
+ ico_dump_notification \
+ ico_dump_notification
+
+#
+#
+#
+ico_send_notification_SOURCES = \
+ send_notification.cpp
+
+ico_send_notification_CXXFLAGS = \
+ $(NOTIFICATION_CFLAGS)
+
+ico_send_notification_LDADD = \
+ $(NOTIFICATION_LIBS)
+
+ico_send_notification2_SOURCES = \
+ send_notification2.cpp
+
+ico_send_notification2_CXXFLAGS = \
+ $(NOTIFICATION_CFLAGS)
+
+ico_send_notification2_LDADD = \
+ $(NOTIFICATION_LIBS) \
+ $(APPSVC_LIBS)
+
+#
+#
+#
+ico_dump_notification_SOURCES = \
+ dump_notification.cpp
+
+ico_dump_notification_CXXFLAGS = \
+ $(NOTIFICATION_CFLAGS)
+
+ico_dump_notification_LDADD = \
+ $(NOTIFICATION_LIBS)
+
+#
+#
+#
+ico_del_notification_SOURCES = \
+ del_notification.cpp
+
+ico_del_notification_CXXFLAGS = \
+ $(NOTIFICATION_CFLAGS)
+
+ico_del_notification_LDADD = \
+ $(NOTIFICATION_LIBS)
--- /dev/null
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <iostream>
+#include <string>
+#include "notification.h"
+using namespace std;
+
+int
+main(int argc, char **argv)
+{
+ notification_error_e err = NOTIFICATION_ERROR_NONE;
+
+ if (argc == 2) {
+ if (0 == strcmp("--all", argv[1])) {
+ printf("delete all notifications\n");
+ err = notification_delete_all_by_type("", NOTIFICATION_TYPE_NOTI);
+ if (NOTIFICATION_ERROR_NONE != err) {
+ printf("notification_delete_group_by_priv_id failed(%d).\n", err);
+ return -1;
+ }
+ err = notification_delete_all_by_type("", NOTIFICATION_TYPE_ONGOING);
+ if (NOTIFICATION_ERROR_NONE != err) {
+ printf("notification_delete_group_by_priv_id failed(%d).\n", err);
+ return -1;
+ }
+ return 0;
+ }
+ }
+
+ if (argc < 3) {
+ printf("%s [--ongoing] pkgname priv_id\n", argv[0]);
+ return -1;
+ }
+ int n_geta = 1;
+ notification_type_e nType = NOTIFICATION_TYPE_NOTI;
+ string sargv1(argv[1]);
+ if (0 == sargv1.compare("--ongoing")) {
+ nType = NOTIFICATION_TYPE_ONGOING;
+ n_geta = 2;
+ if (argc < 4) {
+ printf("%s --ongoing pkgname priv_id\n", argv[0]);
+ return -1;
+ }
+ }
+
+ char *pkgname = argv[n_geta];
+ int priv_id = atoi(argv[n_geta+1]);
+ err = notification_delete_by_priv_id(pkgname, nType, priv_id);
+ if (err != NOTIFICATION_ERROR_NONE) {
+ printf("notification_delete_by_priv_id failed(%d).\n", err);
+ return -1;
+ }
+
+ return 0;
+}
--- /dev/null
+#include <stdio.h>
+#include <iostream>
+#include "notification.h"
+using namespace std;
+
+int
+main()
+{
+ cout << "Notification TestProgram Start=========" << endl;
+
+ //notification variable declaration
+ notification_error_e err = NOTIFICATION_ERROR_NONE;
+ notification_list_h noti_list = NULL;
+
+ err = notification_get_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
+ if (err != NOTIFICATION_ERROR_NONE) {
+ cout << "Failed to get notificationList <error code>:"<< err << endl;
+ return -1;
+ }
+
+ if (NULL == noti_list){
+ cout <<"Nothing NotificationList" <<endl;
+ return -1;
+ }
+
+ printf("gid | typ | pid | %-30s | %-30s | content\n", "pkgname", "title");
+ printf("----+-----+-----+--------------------------------+--------------------------------+--------------------------------\n");
+ //notification_list_h getlist = notification_list_get_head(noti_list);
+ notification_list_h getlist = notification_list_get_tail(noti_list);
+ do {
+ notification_h noti = notification_list_get_data(getlist);
+
+
+ notification_type_e type = NOTIFICATION_TYPE_NONE;
+ err = notification_get_type(noti, &type);
+ if (NOTIFICATION_ERROR_NONE != err) {
+ printf("notification_set_text() failed(%d).\n", err);
+ return -1;
+ }
+
+ int grpid = 0;
+ int privid = 0;
+ err = notification_get_id(noti, &grpid, &privid);
+ if (NOTIFICATION_ERROR_NONE != err) {
+ printf("notification_set_text() failed(%d).\n", err);
+ return -1;
+ }
+
+ char *caller_pkgname = NULL;
+ err = notification_get_pkgname(noti, &caller_pkgname);
+ if (NOTIFICATION_ERROR_NONE != err) {
+ printf("notification_get_pkgname() failed(%d).\n", err);
+ return -1;
+ }
+
+ char *title = NULL;
+ err = notification_get_text(noti,
+ NOTIFICATION_TEXT_TYPE_TITLE,
+ &title);
+ if (NOTIFICATION_ERROR_NONE != err) {
+ printf("notification_set_text() failed(%d).\n", err);
+ return -1;
+ }
+
+ char *content = NULL;
+ err = notification_get_text(noti,
+ NOTIFICATION_TEXT_TYPE_CONTENT,
+ &content);
+ if (NOTIFICATION_ERROR_NONE != err) {
+ printf("notification_get_text() failed(%d).\n", err);
+ return -1;
+ }
+
+ printf("%3d | %3d | %3d | %-30s | %-30s | %-30s\n",
+ grpid, type, privid, caller_pkgname, title, content);
+
+ //getlist = notification_list_get_next(getlist);
+ getlist = notification_list_get_prev(getlist);
+ } while (getlist != NULL);
+
+
+ cout << "Notification_TestProgram End!=========" << endl;
+ return 0;
+}
--- /dev/null
+#include <cstdio>
+#include <iostream>
+#include <string>
+#include <functional>
+#include <algorithm>
+#include "notification.h"
+using namespace std;
+
+const char *
+errorToString(notification_error_e error)
+{
+ const char *strerr = NULL;
+
+ switch (error) {
+ case NOTIFICATION_ERROR_NONE:
+ strerr = "NOTIFICATION_ERROR_NONE";
+ break;
+ case NOTIFICATION_ERROR_INVALID_DATA:
+ strerr = "NOTIFICATION_ERROR_INVALID_DATA";
+ break;
+ case NOTIFICATION_ERROR_NO_MEMORY:
+ strerr = "NOTIFICATION_ERROR_NO_MEMORY";
+ break;
+ case NOTIFICATION_ERROR_FROM_DB:
+ strerr = "NOTIFICATION_ERROR_FROM_DB";
+ break;
+ case NOTIFICATION_ERROR_ALREADY_EXIST_ID:
+ strerr = "NOTIFICATION_ERROR_ALREADY_EXIST_ID";
+ break;
+ case NOTIFICATION_ERROR_FROM_DBUS:
+ strerr = "NOTIFICATION_ERROR_FROM_DBUS";
+ break;
+ case NOTIFICATION_ERROR_NOT_EXIST_ID:
+ strerr = "NOTIFICATION_ERROR_NOT_EXIST_ID";
+ break;
+ case NOTIFICATION_ERROR_IO:
+ strerr = "NOTIFICATION_ERROR_IO";
+ break;
+ case NOTIFICATION_ERROR_SERVICE_NOT_READY:
+ strerr = "NOTIFICATION_ERROR_SERVICE_NOT_READY";
+ break;
+ case NOTIFICATION_ERROR_PERMISSION_DENIED:
+ strerr = "NOTIFICATION_ERROR_PERMISSION_DENIED";
+ break;
+ default:
+ strerr = "UNKOWN";
+ break;
+ }
+
+ return strerr;
+}
+
+int
+insert_notification(notification_type_e type,
+ int group_id,
+ int priv_id,
+ const char *pkgname,
+ const char *title,
+ const char *content,
+ const char *icon)
+{
+ notification_h noti = notification_new(type,
+ group_id,
+ priv_id);
+ if (NULL == noti) {
+ cout << "notification_new() failed." << endl;
+ return -1;
+ }
+
+ //set Pkgname
+ if (NULL == pkgname) {
+ return -1;
+ }
+
+ notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
+
+ noti_err = notification_set_pkgname(noti, pkgname);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ printf("notification_set_pkgname failed(%s).\n",
+ errorToString(noti_err));
+ return -1;
+ }
+
+ //set Title
+ if (NULL == title) {
+ return -1;
+ }
+ noti_err = notification_set_text(noti,
+ NOTIFICATION_TEXT_TYPE_TITLE,
+ title,
+ NULL,
+ NOTIFICATION_VARIABLE_TYPE_NONE);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ cout << "Failed to set notification title <error code>:"<< noti_err<<endl;
+ return -1;
+ }
+
+ //set Content
+ if (NULL == content) {
+ return -1;
+ }
+ noti_err = notification_set_text(noti,
+ NOTIFICATION_TEXT_TYPE_CONTENT,
+ content,
+ NULL,
+ NOTIFICATION_VARIABLE_TYPE_NONE);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ cout << "Failed to set notification content <error code>:"<< noti_err<<endl;
+ return -1;
+ }
+
+ //set Icon_path
+ if (NULL == icon) {
+ return -1;
+ }
+ noti_err = notification_set_icon(noti, icon);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ cout <<"Failed to set icon_path <error code>:"<< noti_err <<endl;
+ return -1;
+ }
+
+ //insert to DB and appear on the notification_area
+ //noti_err = notification_update(noti);
+ int private_id = 0;
+ noti_err = notification_insert(noti, &private_id);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ printf("notification_insert failed(%s).\n",
+ errorToString(noti_err));
+ return -1;
+ }
+
+ //free to notification
+ noti_err = notification_free(noti);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ cout <<"Failed to free notification <error code>:"<< noti_err <<endl;
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+main(int argc, char **argv)
+{
+ const char* msgTyp = "TYPE_NOTI";
+ notification_type_e nType = NOTIFICATION_TYPE_NOTI;
+
+ if (argc == 2) {
+ string sargv1(argv[1]);
+ if (0 == sargv1.compare("--ongoing")) {
+ msgTyp = "TYPE_ONGOING";
+ nType = NOTIFICATION_TYPE_ONGOING;
+ }
+ }
+
+ cout << "Notification TestProgram Start("<<msgTyp<<")=========" <<endl;
+
+ insert_notification(nType,
+ NOTIFICATION_GROUP_ID_DEFAULT,
+ NOTIFICATION_PRIV_ID_NONE,
+ "org.tizen.dialer",
+ "test_title",
+ "0123456789012345678901234",
+ "/usr/share/icons/default/small/org.tizen.dialer.png");
+
+ insert_notification(nType,
+ NOTIFICATION_GROUP_ID_NONE,
+ NOTIFICATION_PRIV_ID_NONE,
+ "GV3ySIINq7.GhostCluster",
+ "test_title",
+ "test_content",
+ "/opt/share/icons/default/small/GV3ySIINq7.GhostCluster.png");
+
+ insert_notification(nType,
+ NOTIFICATION_GROUP_ID_NONE,
+ NOTIFICATION_PRIV_ID_NONE,
+ "ODBQpKvkS1.Settings",
+ "test_title",
+ "test_content",
+ "/opt/share/icons/default/small/ODBQpKvkS1.Settings.png");
+
+ insert_notification(nType,
+ NOTIFICATION_GROUP_ID_NONE,
+ NOTIFICATION_PRIV_ID_NONE,
+ "lYjFlj49Q4.saythis",
+ "test_title",
+ "test_content",
+ "/opt/share/icons/default/small/lYjFlj49Q4.saythis.png");
+
+ insert_notification(nType,
+ NOTIFICATION_GROUP_ID_NONE,
+ NOTIFICATION_PRIV_ID_NONE,
+ "t8j6HTRpuz.MediaPlayer",
+ "test_title",
+ "test_content",
+ "/opt/share/icons/default/small/t8j6HTRpuz.MediaPlayer.png");
+
+ cout << "Notification_TestProgram End!=========" <<endl;
+ return 0;
+}
--- /dev/null
+#include <cstdio>
+#include <iostream>
+#include <string>
+#include <functional>
+#include <algorithm>
+#include <appsvc/appsvc.h>
+#include "notification.h"
+using namespace std;
+
+const char *
+errorToString(notification_error_e error)
+{
+ const char *strerr = NULL;
+
+ switch (error) {
+ case NOTIFICATION_ERROR_NONE:
+ strerr = "NOTIFICATION_ERROR_NONE";
+ break;
+ case NOTIFICATION_ERROR_INVALID_DATA:
+ strerr = "NOTIFICATION_ERROR_INVALID_DATA";
+ break;
+ case NOTIFICATION_ERROR_NO_MEMORY:
+ strerr = "NOTIFICATION_ERROR_NO_MEMORY";
+ break;
+ case NOTIFICATION_ERROR_FROM_DB:
+ strerr = "NOTIFICATION_ERROR_FROM_DB";
+ break;
+ case NOTIFICATION_ERROR_ALREADY_EXIST_ID:
+ strerr = "NOTIFICATION_ERROR_ALREADY_EXIST_ID";
+ break;
+ case NOTIFICATION_ERROR_FROM_DBUS:
+ strerr = "NOTIFICATION_ERROR_FROM_DBUS";
+ break;
+ case NOTIFICATION_ERROR_NOT_EXIST_ID:
+ strerr = "NOTIFICATION_ERROR_NOT_EXIST_ID";
+ break;
+ case NOTIFICATION_ERROR_IO:
+ strerr = "NOTIFICATION_ERROR_IO";
+ break;
+ case NOTIFICATION_ERROR_SERVICE_NOT_READY:
+ strerr = "NOTIFICATION_ERROR_SERVICE_NOT_READY";
+ break;
+ case NOTIFICATION_ERROR_PERMISSION_DENIED:
+ strerr = "NOTIFICATION_ERROR_PERMISSION_DENIED";
+ break;
+ default:
+ strerr = "UNKOWN";
+ break;
+ }
+
+ return strerr;
+}
+
+int
+insert_notification(notification_type_e type,
+ int group_id,
+ int priv_id,
+ const char *pkgname,
+ const char *title,
+ const char *content,
+ const char *icon)
+{
+ notification_h noti = notification_new(type,
+ group_id,
+ priv_id);
+ if (NULL == noti) {
+ cout << "notification_new() failed." << endl;
+ return -1;
+ }
+
+ //set Pkgname
+ if (NULL == pkgname) {
+ return -1;
+ }
+
+ notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
+
+ noti_err = notification_set_pkgname(noti, pkgname);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ printf("notification_set_pkgname failed(%s).\n",
+ errorToString(noti_err));
+ return -1;
+ }
+
+ //set Title
+ if (NULL == title) {
+ return -1;
+ }
+ noti_err = notification_set_text(noti,
+ NOTIFICATION_TEXT_TYPE_TITLE,
+ title,
+ NULL,
+ NOTIFICATION_VARIABLE_TYPE_NONE);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ cout << "Failed to set notification title <error code>:"<< noti_err<<endl;
+ return -1;
+ }
+
+ //set Content
+ if (NULL == content) {
+ return -1;
+ }
+ noti_err = notification_set_text(noti,
+ NOTIFICATION_TEXT_TYPE_CONTENT,
+ content,
+ NULL,
+ NOTIFICATION_VARIABLE_TYPE_NONE);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ cout << "Failed to set notification content <error code>:"<< noti_err<<endl;
+ return -1;
+ }
+
+ //set Icon_path
+ if (NULL == icon) {
+ return -1;
+ }
+ noti_err = notification_set_icon(noti, icon);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ cout <<"Failed to set icon_path <error code>:"<< noti_err <<endl;
+ return -1;
+ }
+
+ bundle *b = NULL;
+ b = bundle_create();
+ appsvc_set_pkgname(b, "org.tizen.dialer");
+ noti_err = notification_set_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, "Launch", NULL, b);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ printf("Failed to set notification execute option: %d", noti_err);
+ return -1;
+ }
+
+
+ //insert to DB and appear on the notification_area
+ //noti_err = notification_update(noti);
+ int private_id = 0;
+ noti_err = notification_insert(noti, &private_id);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ printf("notification_insert failed(%s).\n",
+ errorToString(noti_err));
+ return -1;
+ }
+
+ //free to notification
+ noti_err = notification_free(noti);
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ cout <<"Failed to free notification <error code>:"<< noti_err <<endl;
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+main(int argc, char **argv)
+{
+ const char* msgTyp = "TYPE_NOTI";
+ notification_type_e nType = NOTIFICATION_TYPE_NOTI;
+
+ if (argc == 2) {
+ string sargv1(argv[1]);
+ if (0 == sargv1.compare("--ongoing")) {
+ msgTyp = "TYPE_ONGOING";
+ nType = NOTIFICATION_TYPE_ONGOING;
+ }
+ }
+
+ cout << "Notification TestProgram Start("<<msgTyp<<")=========" <<endl;
+
+ insert_notification(nType,
+ NOTIFICATION_GROUP_ID_DEFAULT,
+ NOTIFICATION_PRIV_ID_NONE,
+ "org.tizen.dialer",
+ "Incoming call",
+ "888-8888",
+ "/usr/share/icons/default/small/org.tizen.dialer.png");
+
+ cout << "Notification_TestProgram End!=========" <<endl;
+ return 0;
+}