SUBDIRS= \
lib \
src \
+ tool \
tests
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
-AC_INIT([org.tizen.ico.homescreen], [0.0.1], [])
+AC_INIT([org.tizen.ico.homescreen], [0.9.05], [])
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_HEADERS([config.h])
src/Makefile
src/syscond/Makefile
src/homescreen/Makefile
- tests/Makefile
+ tool/Makefile
+ tests/Makefile
tests/system-controller/Makefile
tests/system-controller/apps-framework/Makefile])
AC_PROG_RANLIB([ranlib])
/*--------------------------------------------------------------------------*/
void ico_syc_disconnect(void);
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief ico_syc_service
+ * Service for communication to System Controller.
+ *
+ * @param none
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+void ico_syc_service(void);
#ifdef __cplusplus
}
-I/usr/include/ico-util
libico_appfw_la_LIBADD = $(OPT_LIBS) $(WL_LIBS) $(AUL_LIBS) $(UWS_LIBS) $(COMMON_LIBS) @ECORE_LIBS@
-libico_appfw_la_LDFLAGS = -version-info 0:1:0
+libico_appfw_la_LDFLAGS = -version-info 0:9:0
libico_appfw_la_SOURCES = \
ico_syc_appresctl.c \
ico_syc_common.c \
void *user_data);
static void _add_queue(void *data, size_t len);
static int _get_event_from_cmd(int command);
-static int _exec_callback(void *user_data);
+static void _exec_callback(void *user_data);
static Eina_Bool _ecore_fd_cb(void *data, Ecore_Fd_Handler *handler);
static void _add_poll_fd(int fd);
static void _del_poll_fd(int fd);
* @retval 0 success (always success)
*/
/*--------------------------------------------------------------------------*/
-static int
+static void
_exec_callback(void *user_data)
{
recv_info_t *recv_data = NULL;
if (syc_callback == NULL) {
_DBG("not setting callback function");
- return ICO_SYC_ERR_NONE;
+ return;
}
while (g_queue_is_empty(recv_info_q) != TRUE) {
/* mutex unlock */
pthread_mutex_unlock(&q_mutex);
}
-
- return ICO_SYC_ERR_NONE;
}
/*--------------------------------------------------------------------------*/
}
/* recive message */
ico_uws_service(uws_context);
- _exec_callback(syc_user_data);
+ ecore_main_loop_thread_safe_call_async(_exec_callback, syc_user_data);
}
pthread_exit(0);
return;
}
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief ico_syc_service
+ * Service for communication to System Controller.
+ *
+ * @param none
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+ICO_API void
+ico_syc_service(void)
+{
+ /* close the connection */
+ if (uws_context != NULL) {
+ ico_uws_service(uws_context);
+ }
+}
+
/*============================================================================*/
/* internal common function */
/*============================================================================*/
*/
//==========================================================================
+#include <string>
+using namespace std;
+
#include "CicoSCPolicyManager.h"
#include "CicoStateMachine.h"
#include "CicoState.h"
}
return false;
}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief notify connected
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCPolicyManager::notifyConnected(const string & appid)
+{
+ // Notify regulation changed state
+ CicoSCMessage *message = new CicoSCMessage();
+ message->addRootObject("command", MSG_CMD_NOTIFY_CHANGED_STATE);
+ message->addArgObject(MSG_PRMKEY_STATEID, ICO_SYC_STATE_REGULATION);
+ if (true == m_policyStates[STID_DRVREGULATION_ON]->isActive()) {
+ message->addArgObject(MSG_PRMKEY_STATE, ICO_SYC_STATE_ON);
+ }
+ else {
+ message->addArgObject(MSG_PRMKEY_STATE, ICO_SYC_STATE_OFF);
+ }
+ CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
+
+ // Notify NightMode changed state
+ message = new CicoSCMessage();
+ message->addRootObject("command", MSG_CMD_NOTIFY_CHANGED_STATE);
+ message->addArgObject(MSG_PRMKEY_STATEID, ICO_SYC_STATE_NIGHTMODE);
+ if (true == m_policyStates[STID_NIGHTMODE_ON]->isActive()) {
+ message->addArgObject(MSG_PRMKEY_STATE, ICO_SYC_STATE_ON);
+ }
+ else {
+ message->addArgObject(MSG_PRMKEY_STATE, ICO_SYC_STATE_OFF);
+ }
+ CicoSCServer::getInstance()->sendMessageToHomeScreen(message);
+}
// vim:set expandtab ts=4 sw=4:
#include <map>
#include <vector>
+#include <string>
using namespace std;
//==========================================================================
bool getSoundZoneState(int zoneid) const;
bool getInputState(int input) const;
+ // notify connected process
+ void notifyConnected(const std::string & appid);
+
private:
// default constructor
CicoSCPolicyManager();
// initialize state machine
int initStateMachine(void);
+
private:
bool m_initialized;
DBusConnection *m_dbusConnection;
req = popCurDispResOwerReq(req);
chgzone = newreq->dispzoneid;
}
- else {
- ICO_DBG("already ower appid=%s", req->appid);
- ICO_DBG("CicoSCResourceManager::acquireDisplayResource Leave(true)");
- return true;
- }
}
// if exist in wating request list, pop request
ICO_DBG("CicoSCResourceManager::releaseDisplayResource Enter"
"(newreq=0x%08x)", newreq);
- // if exist current ower request, pop request
- resource_request_t *req = popCurDispResOwerReq(newreq);
- if (NULL == req) {
- // if exist in wating request list, pop request
- req = popWaitingDispResReq(newreq);
+ // if exist in wating request list, pop request
+ resource_request_t *req = popWaitingDispResReq(newreq);
+ if (NULL != req) {
+ delResourceRequest(req);
+ delResourceRequest(newreq);
+ ICO_DBG("CicoSCResourceManager::releaseDisplayResource Leave");
+ return;
}
+ // if exist current ower request, pop request
+ req = popCurDispResOwerReq(newreq);
if (NULL != req) {
delResourceRequest(req);
}
if (true == active) {
resource_request_t* popreq = popWaitingDispResReq(*itr);
updateDisplayResource(popreq);
+ m_winCtrl->active(popreq->surfaceid, -1);
break;
}
}
ICO_DBG("CicoSCResourceManager::receiveChangedState Leave");
}
+//--------------------------------------------------------------------------
+/**
+ * @brief get policy manager instance
+ *
+ * @return resource manager instace
+ */
+//--------------------------------------------------------------------------
+CicoSCPolicyManager *
+CicoSCResourceManager::getPolicyManager(void)
+{
+ return m_policyMgr;
+}
+
void
CicoSCResourceManager::updateDisplayResource(resource_request_t *req,
int chgzoneid)
if (itr->second == req) {
ICO_DBG("already ower appid=%s pid=%d surfaceid=0x%08X",
req->appid, req->pid, req->surfaceid);
+ // show request window
+ m_winCtrl->show(req->surfaceid, req->animation, req->animationTime);
+ m_winCtrl->active(req->surfaceid, -1);
return;
}
resource_request_t *popreq = popCurDispResOwerReq(itr->second);
}
if (NULL != m_winCtrl) {
- if (-1 == chgzoneid) {
- // show request window
- m_winCtrl->show(req->surfaceid, req->animation, req->animationTime);
- }
- else {
+ if (-1 != chgzoneid) {
// move request window
m_winCtrl->setGeometry(req->surfaceid, req->dispzone,
req->animation, req->animationTime,
req->animation, req->animationTime);
- m_winCtrl->show(req->surfaceid, NULL, 0);
}
+ // show request window
+ m_winCtrl->show(req->surfaceid, req->animation, req->animationTime);
}
// state change to acquired
req->state = RES_STATE_ACQUIRED;
dumpWaitingDispResReq();
#endif //DEBUG
updateDisplayResource(req);
+ m_winCtrl->active(req->surfaceid, -1);
break;
}
}
// show current window
// TODO animation?
m_winCtrl->show((*itr2)->surfaceid, NULL, 0);
+ m_winCtrl->active((*itr2)->surfaceid, -1);
}
break;
}
current->prio);
if (true == active) {
if (NULL != m_winCtrl) {
- // hide current window
+ // show current window
// TODO animation?
m_winCtrl->show(current->surfaceid, NULL, 0);
+ m_winCtrl->active(current->surfaceid, -1);
}
}
}
// receive changed state
void receiveChangedState(int state);
+ // get resource manager instance
+ CicoSCPolicyManager * getPolicyManager(void);
+
private:
// assignment operator
CicoSCResourceManager& operator=(const CicoSCResourceManager &object);
#include "CicoSCUserManager.h"
#include "CicoSCUser.h"
#include "CicoSCResourceManager.h"
+#include "CicoSCPolicyManager.h"
class CicoSCUwsHandler
{
//--------------------------------------------------------------------------
/**
+ * @brief set policy manager instance
+ *
+ * @param [in] policyMgr policy manager instance
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCServer::setPolicyMgr(CicoSCPolicyManager *policyMgr)
+{
+ m_policyMgr = policyMgr;
+}
+
+//--------------------------------------------------------------------------
+/**
* @brief startup server
*
* @param [in] port websocket port
ecore_main_fd_handler_active_set(handler->ecoreFdHandler, flags);
+ notifyConnected(handler->appid);
break;
}
}
return false;
}
+
+//--------------------------------------------------------------------------
+/**
+ * @brief notify information to homescreen on connected
+ *
+ * @param [in] appid application id
+ */
+//--------------------------------------------------------------------------
+void
+CicoSCServer::notifyConnected(const std::string & appid)
+{
+ const CicoSCUser *loginUser = m_userMgr->getLoginUser();
+ if (NULL == loginUser) {
+ ICO_WRN("homescreen unknown");
+ return;
+ }
+
+ // if appid equal homescreen
+ if (0 == loginUser->homescreen.compare(appid)) {
+ if (NULL != m_policyMgr) {
+ m_policyMgr->notifyConnected(appid);
+ }
+ }
+}
// vim:set expandtab ts=4 sw=4:
#define __CICO_SC_SERVER_H__
#include <list>
-using namespace std;
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <signal.h>
-#include <string.h>
-#include <math.h>
-#include <stdbool.h>
-#include <sys/epoll.h>
-
-#include <getopt.h>
+#include <string>
#include <Ecore.h>
#include <Eina.h>
class CicoSCInputController;
class CicoSCUserManager;
class CicoSCResourceManager;
+class CicoSCPolicyManager;
//==========================================================================
/**
// set resource manager instance
void setResourceMgr(CicoSCResourceManager* resourceMgr);
+ // set resource manager instance
+ void setPolicyMgr(CicoSCPolicyManager* policyMgr);
+
// startup server
int startup(int port, const char *protocol);
// send message to application client
- int sendMessage(const string & appid, CicoSCMessage* msg);
+ int sendMessage(const std::string & appid, CicoSCMessage* msg);
// send message to homescreen
int sendMessageToHomeScreen(CicoSCMessage* msg);
CicoSCUwsHandler* findUwsHandler(const Ecore_Fd_Handler *ecoreFdHandler);
// find websocket handle by appid
- CicoSCUwsHandler* findUwsHandler(const string & appid);
+ CicoSCUwsHandler* findUwsHandler(const std::string & appid);
// query whether the handler exists
bool isExistUwsHandler(const CicoSCUwsHandler *handler);
+ // notify connected appilication
+ void notifyConnected(const std::string & appid);
+
private:
static CicoSCServer* ms_myInstance; ///< this class instance
CicoSCInputController *m_inputCtrl; ///< input controller instance
CicoSCUserManager *m_userMgr; ///< user manager instance
CicoSCResourceManager *m_resourceMgr; ///< resource manager instance
+ CicoSCPolicyManager *m_policyMgr; ///< policy manager instance
+
+ /// websocket handler list
+ std::list<CicoSCUwsHandler*> m_uwsHandlerList;
+
+ /// send message queue
+ std::list<CicoSCMessage*> m_sendMsgQueue;
- list<CicoSCUwsHandler*> m_uwsHandlerList;///< websocket handler list
- list<CicoSCMessage*> m_sendMsgQueue; ///< send message queue
- list<CicoSCCommand*> m_recvCmdQueue; ///< recieve message queue
+ /// recieve message queue
+ std::list<CicoSCCommand*> m_recvCmdQueue;
};
#endif // __CICO_SC_SERVER_H__
// vim:set expandtab ts=4 sw=4:
// change login user
m_login = conf->name;
+ saveLastUser();
ICO_DBG("login user changed (user=%s)", m_login.c_str());
ICO_INF("%s", tmpText);
flagFileOff();
stream >> m_login;
stream.close();
+ // check login name is valid
+ if (false == m_login.empty()) {
+ bool bValid = false;
+ vector<CicoSCUser*>::iterator it = m_userList.begin();
+ while (it != m_userList.end()) {
+ if (0 == (*it)->name.compare(m_login)) {
+ bValid = true;
+ break;
+ }
+ ++it;
+ }
+ if (false == bValid) {
+ ICO_WRN("last user NG!, user name \"%s\" clear", m_login.c_str());
+ m_login.clear();
+ }
+ }
+
ICO_DBG("CicoSCUserManager::loadLastUser Leave(EOK)");
}
return;
}
+ // get login user object
+ CicoSCUser* loginUser = NULL;
+ loginUser = const_cast<CicoSCUser*>(findUserConfbyName(m_login));
+ // check login user
+ if (NULL == loginUser) {
+ // login user does not exist in the user list
+ ICO_DBG("CicoSCUserManager::setLastInfo Leave(ENXIO)");
+ return;
+ }
+
// check weather file exists
struct stat st;
string dir = m_parentDir + m_login + ICO_SYC_LASTINFO_DIR;
string info;
std::ifstream stream;
stream.open(infofile.c_str());
- stream >> info;
+ std::getline(stream, info);
stream.close();
// get appid (erase ".txt" from filename)
filename.erase(index, filename.size());
- // set last information
- setLastInfo(filename, info);
+ // create new object
+ CicoSCLastInfo* lastInfo = new CicoSCLastInfo;
+ // set application's information
+ lastInfo->appid = filename;
+ lastInfo->lastinfo = info;
+ // add to list
+ loginUser->lastInfoList.push_back(lastInfo);
}
free(filelist[i]);
}
// get information
const CicoSCUser* getLoginUser(void);
- const vector<CicoSCUser*>& getUserList(void);
- const vector<std::string>& getHomeScreenList(void);
+ const std::vector<CicoSCUser*>& getUserList(void);
+ const std::vector<std::string>& getHomeScreenList(void);
// change user
void changeUser(const std::string & name, const std::string & passwd);
bool killingAppsAndHS(const std::string& usrnm);
// working user directory make
- void getWorkingDir(const std::string& usr, string& dir);
+ void getWorkingDir(const std::string& usr, std::string& dir);
// launch homescreen request
bool launchHomescreenReq(const std::string& usr,
#lib_LTLIBRARIES =\
# libico-system-controller.la
+libico_system_controller_la_LDFLAGS = -version-info 0:9:0
libico_system_controller_la_SOURCES = \
CicoSCAilItems.cpp \
CicoSCAulItems.cpp \
return;
}
+ resource_request_t *findreq = ico_syc_mrp_find_request(req->id,
+ req->appid);
+ if (NULL != findreq) {
+ if (req->pid != findreq->pid) {
+ ICO_DBG("ico_syc_mrp_del_request: pid not match");
+ return;
+ }
+ }
+ else {
+ ICO_DBG("ico_syc_mrp_del_request: not found in req list");
+ return;
+ }
+
ICO_DBG("ico_syc_mrp_del_request: "
"del request %p to mrp_reqs list", req);
mrp_list_delete(&req->hook);
+* Tue Oct 08 2013 Shibata Makoto <shibata@mac.tec.toyota.co.jp> accepted/tizen/20131003.220120@49e6831
+- 0.9.05 release.
+-- bugfix: The page which does not exist by scrolling downward in a menu screen is displayed.
+-- addition: Notice of the operation event to application except the application history flick operation.
+-- addition: Prohibition of the application history operation of the driving mode.
+-- addition: Addition of two tools. ico_clear_screen and ico_change_loginuser.
+-- bugfix: TIVI-1935 - Input focus is not switched to the new top most app when switching via gesture
+
* Thu Sep 26 2013 Shibata Makoto <shibata@mac.tec.toyota.co.jp> accepted/tizen/20130919.204217@93c93da
- 0.9.04 release
-- addition of the application operation history.
Name: ico-uxf-homescreen
Summary: Sample homescreen and system controller
-Version: 0.9.04
-Release: 1.2
+Version: 0.9.05
+Release: 1.3
Group: Graphics & UI Framework/Automotive UI
License: Apache-2.0
URL: ""
Source0: %{name}-%{version}.tar.bz2
BuildRequires: pkgconfig(wayland-client) >= 1.2
-BuildRequires: ico-uxf-weston-plugin-devel >= 0.9.05
+BuildRequires: ico-uxf-weston-plugin-devel >= 0.9.06
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(ecore-wayland)
BuildRequires: pkgconfig(murphy-ecore)
BuildRequires: pkgconfig(murphy-resource)
BuildRequires: boost-devel
-BuildRequires: ico-uxf-utilities-devel >= 0.2.04
+BuildRequires: mesa-devel
+BuildRequires: ico-uxf-utilities-devel
Requires: weston >= 1.2
-Requires: ico-uxf-weston-plugin >= 0.9.05
-Requires: ico-uxf-utilities >= 0.2.04
+Requires: ico-uxf-weston-plugin >= 0.9.06
+Requires: ico-uxf-utilities
%description
Sample homescreen application and system controller daemon
mkdir -p ${STATUSBARDIR}/res/edj
mkdir -p ${STATUSBARDIR}/res/config
mkdir -p ${STATUSBARDIR}/bin
+mkdir -p %{_bindir}
cp -rf data/apps/org.tizen.ico.statusbar %{buildroot}/usr/apps/
install -m 0755 src/homescreen/StatusBar ${STATUSBARDIR}/bin/
install -m 0644 res/org.tizen.ico.homescreen/res/images/time*.png ${STATUSBARDIR}/res/images
install -m 0644 data/share/packages/org.tizen.ico.statusbar.xml %{buildroot}/usr/share/packages
cp res/org.tizen.ico.homescreen/res/apps/org.tizen.ico.statusbar/* ${STATUSBARDIR}/res/config
+cp tool/ico_clear_screen %{buildroot}%{_bindir}
+cp tool/ico_change_loginuser %{buildroot}%{_bindir}
%post
/sbin/ldconfig
/usr/lib/systemd/user/ico-system-controller.service
/usr/lib/systemd/user/ico-uxf-wait-launchpad-ready.path
/usr/lib/systemd/user/weston.target.wants/ico-uxf-wait-launchpad-ready.path
+%{_bindir}/ico_clear_screen
+%{_bindir}/ico_change_loginuser
%attr(644,app,app) /home/app/ico/defaultApps.info
%attr(755,app,app) /home/app/ico
/home/app/ico/defaultApps.info
+++ /dev/null
-# OpenPF System Configurations
-# /usr/apps/org.tizen.ico.homescreen/res/config/app_attr.conf
-# Sep-30-2013
-#
-
-[app-attributes]
-# attributes of HomeScreen
-org.tizen.ico.homescreen=Menu;kind=HomeScreen;run=Center;noauto;type=menu
-org.tizen.ico.onscreen=Menu;kind=HomeScreen;run=Center;noauto;type=menu
-org.tizen.ico.statusbar=Menu;kind=HomeScreen;run=Center;noauto;type=menu
-org.tizen.ico.app-samplenavi=Map
-
-# attrinutes of native applictions
-org.tizen.soft-keyboard=Menu;kind=SysApp;dispzone=SysApp;layer=SoftKeyboard
-org.tizen.setting=CarSetting;kind=SysApp.audio
-org.tizen.music-player=Map
-
-# attributes of web applications
-MediaPlayer=Map
-MyMediaPlayer=Map
-MeterWidget=Map
-GhostCluster=Map
-WinkerLeft=Camera.Left;kind=Maker;dispzone=SysApp.Left;layer=InterruptApp
-WinkerLeft.1=NoDisplay;auto;Animation=Slide.toRight;invisiblecpu=no;noconfigure
-WinkerRight=Camera.Right;kind=Maker;dispzone=SysApp.Right;layer=InterruptApp
-WinkerRight.1=NoDisplay;auto;Animation=Slide.toLeft;invisiblecpu=no;noconfigure
-
shortcut_app1=
shortcut_app2=
shortcut_app3=
+
+[standardswitch]
+# trigger home switch keyname
+homekeyname=h
+
+# trigger back switch keyname
+backkeyname=b
+
+# trigger menu switch keyname
+menukeyname=l
+++ /dev/null
-## OpenPF System Configurations
-## /opt/apps/org.tizen.ico.homescreen/res/config/system.conf
-## May-15-2013
-
-## System ECUs
-[host]
-## Center Display ECU
-# ECU name
-0=Center
-# ECU type
-0.type=Center
-# IP address(if environment valiable'SYSHOSTIP0' NOT defined)
-0.ip=127.0.0.1
-# This ECU has HomeScreen(null:no, not null:applicationId of HomeScreen)
-0.homescreen=org.tizen.ico.homescreen
-#
-
-## Displays
-[display]
-## Center Display
-# Display name
-0=Center
-# ECU name
-0.host=Center
-# Display Number
-0.displayno=0
-# Wayland connection name(ex.'wayland-0')
-0.wayland=wayland-0
-# Display Type
-0.type=Center
-# Display Size
-#0.width=1920
-#0.height=1080
-0.width=1080
-0.height=1920
-# number of Layers
-0.layer=5
-# inch (in 0.1 inchs)
-0.inch=101
-# Display Layer
-0.layer.0=BackGround
-0.layer.1=HomeScreen
-0.layer.2=Application
-0.layer.3=SoftKeyboard
-0.layer.4=InterruptApp
-0.layer.5=Touch
-0.layer.6=OnScreen;menuoverlap
-# Display Zone
-## id=name;x;y;width;height[;overlap-zone;overlap-zone;...]
-## if 'id=name', size is all of display, no overlap
-0.zone.0=Base
-0.zone.1=Full;0;64;dispw;disph-64;Upper;Lower;UpperLeft;UpperRight;LowerLeft;LowerRight
-0.zone.2=Upper;0;64;dispw;disph-64/2;Full;UpperLeft;UpperRight
-0.zone.3=Lower;0;heigh-64/2+64;dispw;disph-64/2;Full;LowerLeft;LowerRight
-0.zone.4=UpperLeft;0;64;dispw/2;disph-64/2;Full;Upper
-0.zone.5=UpperRight;dispw/2;64;dispw/2;disph-64/2;Full;Upper
-0.zone.6=LowerLeft;0;heigh-64/2+64;dispw/2;disph-64/2;Full;Lower
-0.zone.7=LowerRight;dispw/2;heigh-64/2+64;dispw/2;disph-64/2;Full;Lower
-0.zone.8=SysApp;0;64;dispw;disph-64
-0.zone.9=SysApp.Left;0;64;dispw/2-140;disph-64
-0.zone.10=SysApp.Right;dispw/2+140;64;dispw/2-140;disph-64
-#
-## Sound
-[sound]
-## Center ECU
-# Sound device name
-0=Center
-# ECU name
-0.host=Center
-# Device Number
-0.soundno=0
-# Sound Zone
-## id=name[;overlap;overlap-zone;overlap-zone;...]
-0.zone.0=Base
-0.zone.1=Full
-0.zone.2=Driver
-
-## Port Numbers
-[port]
-# AppsController Port Number
-appscontrollerport=18081
-# PulseAudio UIFW-PlugIn Port Number
-soundpluginport=8088
-
-## Application Category name
-[category]
-0=Menu
-0.type=system
-0.view=always
-0.sound=always
-0.input=always
-0.priority=4
-1=Message
-1.type=message
-1.view=always
-1.sound=always
-1.input=always
-1.priority=5
-2=Map
-2.type=map
-2.view=always
-2.sound=always
-2.input=always
-2.priority=3
-3=Driving
-3.type=maker
-3.view=run
-3.sound=run
-3.input=run
-3.priority=2
-4=CarSetting
-4.type=maker
-4.view=shift_park
-4.sound=shift_park
-4.input=shift_park
-4.priority=2
-5=Camera.Back
-5.type=maker
-5.view=shift_back
-5.sound=shift_back
-5.input=shift_back
-5.priority=6
-6=Camera.Left
-6.type=maker
-6.view=blinker_left
-6.sound=blinker_left
-6.input=blinker_left
-6.priority=6
-7=Camera.Right
-7.type=maker
-7.view=blinker_right
-7.sound=blinker_right
-7.input=blinker_right
-7.priority=6
-8=Entertainment
-8.type=unknown
-8.view=parked
-8.sound=parked
-8.input=parked
-8.priority=0
-9=Entertainment.audio
-9.type=unknown
-9.view=parked
-9.sound=always
-9.input=always
-9.priority=0
-10=Entertainment.visual
-10.type=unknown
-10.view=always
-10.sound=parked
-10.input=always
-10.priority=0
-#
-## Application Kind
-[kind]
-0=Almighty
-0.privilege=almighty
-0.priority=5
-1=HomeScreen
-1.privilege=system
-1.priority=4
-2=SysApp
-2.privilege=system
-2.priority=3
-3=SysApp.audio
-3.privilege=system.audio
-3.priority=3
-4=SysApp.visual
-4.privilege=system.visible
-4.priority=3
-5=Maker
-5.privilege=maker
-5.priority=2
-6=Certificate
-6.privilege=certificate
-6.priority=1
-7=UnKnown
-7.privilege=none
-7.priority=0
-#
-## Input Sw
-[input]
-0=DrivingForceGT
-0.sw.0=JS_UpDown
-0.sw.1=JS_LR
-0.sw.2=JS_Cross;org.tizen.ico.app-soundsample
-0.sw.3=JS_Square;org.tizen.ico.homescreen
-0.sw.4=JS_Circle;org.tizen.ico.app-soundsample
-0.sw.5=JS_Triangle;org.tizen.ico.homescreen
-#
-## Default target
-[default]
-host=Center
-kind=UnKnown
-category=Entertainment.audio
-display=Center
-layer=Application
-displayzone=Full
-sound=Center
-soundzone=Full
-inputdev=DrivingForceGT
-inputsw=JS_UpDown
-#
-## default transition
-[transition]
-transition=none
-#
-## Log
-[log]
-# loglevel:ERROR=4,CRITICAL=8,WARNING=16,INFO=64,DEBUG=128
-loglevel=128
-# log flush on log output
-logflush=yes
-
<userconfig>
<users>
<user>
- <name>Alice</name>
+ <name>Daddy</name>
<passwd></passwd>
<hs>org.tizen.ico.homescreen</hs>
</user>
<user>
- <name>Bob</name>
+ <name>Mommy</name>
<passwd></passwd>
<hs>org.tizen.ico.homescreen</hs>
</user>
<default>
<user>
- <name>Alice</name>
+ <name>Daddy</name>
</user>
</default>
#include <vector>
#include <utility>
#include <cstdio>
+#include <cstring>
#include <aul/aul.h>
#include <sys/stat.h>
+#include <cerrno>
#include "CicoHSAppHistory.h"
+#include "CicoHomeScreenCommon.h"
+#include "CicoHomeScreen.h"
#include "CicoLog.h"
using namespace std;
ICO_DBG("constructor");
m_user.clear();
m_path.clear();
+ m_pathD.clear();
m_flagPath.clear();
+ m_hs = NULL;
homeSwipe();
}
* @param flagpath control flag file path
*/
CicoHSAppHistory::CicoHSAppHistory(const char* user, const char* path,
- const char* flagpath)
- :m_user(user), m_path(path), m_flagPath(flagpath)
+ const char* pathD, const char* flagpath)
+ :m_user(user), m_path(path), m_pathD(pathD), m_flagPath(flagpath)
{
- ICO_DBG("constructor %s, %s, %s", user, path, flagpath);
+ ICO_DBG("constructor %s, %s", user, path, pathD, flagpath);
+ m_hs = NULL;
homeSwipe();
}
* @param flagpath control flag file path
*/
CicoHSAppHistory::CicoHSAppHistory(const string& user, const string& path,
- const string& flagpath)
- :m_user(user), m_path(path), m_flagPath(flagpath)
+ const string& pathD, const string& flagpath)
+ :m_user(user), m_path(path), m_pathD(pathD), m_flagPath(flagpath)
{
- ICO_DBG("constructor %s, %s, %s", user.c_str(), path.c_str(), flagpath.c_str());
+ ICO_DBG("constructor %s, %s", user.c_str(), flagpath.c_str());
+ m_hs = NULL;
homeSwipe();
}
writeAppHistory();
m_user.clear();
m_path.clear();
+ m_pathD.clear();
m_flagPath.clear();
}
}
/**
+ * @brief read application history
+ * @param app appid's and sub display status store vector
+ */
+bool CicoHSAppHistory::readAppHistory(vector<pairAppidSubd>& apps)
+{
+ ICO_DBG("start");
+ apps.clear();
+
+ string fpath(m_path);
+ struct stat stat_buf;
+ if ((true == fpath.empty()) || (0 != stat(fpath.c_str(), &stat_buf))) {
+ ICO_DBG("file path ng(%d, %s)", errno, fpath.c_str());
+ fpath = m_pathD;
+ if ((true == fpath.empty()) || (0 != stat(fpath.c_str(), &stat_buf))) {
+ ICO_DBG("file path ng(%d, %s)", errno, fpath.c_str());
+ return false;
+ }
+ }
+
+ ICO_DBG("read history %s", fpath.c_str());
+ string tagApp;
+ ifstream ifs(fpath.c_str());
+ char sBuff[128];
+ int szF = strlen(DEF_SUBDISPLAY_TAG);
+ while(ifs >> tagApp) {
+ if (true == tagApp.empty()) {
+ continue;
+ }
+ bool bFLAG = false;
+ strcpy(sBuff, tagApp.c_str());
+ int szR = strlen(sBuff);
+ if (szF < szR) {
+ if (0 == strcmp(&sBuff[(szR-szF)], DEF_SUBDISPLAY_TAG)) {
+ bFLAG = true;
+ sBuff[(szR-szF)] = '\0';
+ tagApp = sBuff;
+ }
+ }
+ ICO_DBG("read [%d]=(%s, %d)", apps.size(), sBuff, bFLAG);
+ apps.push_back(pairAppidSubd(sBuff,bFLAG));
+ }
+ ifs.close();
+ return true;
+}
+
+/**
* @brief write application history
*/
bool CicoHSAppHistory::writeAppHistory()
ICO_DBG("end false file none");
return false;
}
+ const char* pSubD = getAppidSubDispBySystem();
vector<string> vs;
list<string>::iterator p = m_appHistoryList.begin();
for (; p != m_appHistoryList.end(); ++p) {
if (true == filterChk(m_filterW, (*p).c_str())) {
continue; // continue of for p
}
- vs.push_back(*p);
+ string tmp(*p);
+ if (0 == tmp.compare(pSubD)) {
+ tmp += DEF_SUBDISPLAY_TAG;
+ }
+ vs.push_back(tmp);
}
if (0 == vs.size()) {
remove(m_path.c_str());
}
/**
+ * @brief get sub display used appid
+ * @return const char*
+ */
+const char* CicoHSAppHistory::getAppidSubDispBySystem() const
+{
+ static const char* pSubD = "";
+ if (NULL != m_hs) {
+ const char* p = m_hs->GetSubDisplayAppid();
+ if (NULL != p) {
+ return p;
+ }
+ }
+ return pSubD;
+}
+
+/**
* @brief next swipe app and appid get
* @ret appid
* @retval empty is stopped
#include <vector>
#include <utility>
+#define DEF_SUBDISPLAY_TAG ":SUBDISPLAY"
+
+typedef std::pair<std::string, bool> pairAppidSubd;
+
+class CicoHomeScreen;
+
class CicoHSAppHistory
{
public:
CicoHSAppHistory();
- CicoHSAppHistory(const char* user, const char* path, const char* flagpath);
+ CicoHSAppHistory(const char* user, const char* path, const char* pathD,
+ const char* flagpath);
CicoHSAppHistory(const std::string& user, const std::string& path,
- const std::string& flagpath);
+ const std::string& pathD, const std::string& flagpath);
virtual ~CicoHSAppHistory();
// get
const std::string& getUser() const;
const std::string& getPath() const;
+ const std::string& getPathDef() const;
const std::list<std::string>& getAppHistory() const;
// operate
bool force_flagoff();
void setFilterManage(std::vector<std::string>& filter);
void setFilterWrite(std::vector<std::string>& filter);
-protected:
+
+ bool readAppHistory(std::vector<pairAppidSubd>& apps);
bool writeAppHistory();
+ void setHomeScreen(CicoHomeScreen* p);
+protected:
bool filterChk(std::vector<std::string>& filter, const char* tgt) const;
+ const char* getAppidSubDispBySystem() const;
protected:
std::string m_user; // login-user name
std::string m_path; // history application file path
+ std::string m_pathD; // history application file path default
std::string m_flagPath; // flag file path
std::list<std::string> m_appHistoryList; // history application list
std::vector<std::string> m_filterM; // history manage filter string
std::vector<std::string> m_filterW; // history write filter string
std::list<std::string>::iterator m_swipeCurr;
std::string m_swipeStr;
+ CicoHomeScreen* m_hs;
};
/**
return m_path;
}
+/**
+ * @brief get file path default
+ * @ret file path
+ */
+inline const std::string& CicoHSAppHistory::getPathDef() const
+{
+ return m_pathD;
+}
/**
* @brief get history appid list
m_filterW = filter; // history write filter string
}
+inline void CicoHSAppHistory::setHomeScreen(CicoHomeScreen* hs)
+{
+ m_hs = hs;
+}
#endif // CICOHSAPPHISTORY_H
#include "CicoHSAppHistory.h"
#include "CicoHSAppHistoryExt.h"
#include "Cico_aul_listen_app.h"
+#include "CicoHomeScreenCommon.h"
+#include "CicoHomeScreen.h"
#include "CicoLog.h"
using namespace std;
setHandler();
setWaitTime(DEFAULT_WAIT_TIME);
m_lastStartupApp.clear();
+ m_subDispApp.clear();
+ m_empty.clear();
}
/**
* @param flagpath control flag file path
*/
CicoHSAppHistoryExt::CicoHSAppHistoryExt(const char* user, const char* path,
- const char* flagpath)
- :CicoHSAppHistory(user, path, flagpath)
+ const char* pathD, const char* flagpath)
+ :CicoHSAppHistory(user, path, pathD, flagpath)
{
resetCounter();
setHandler();
setWaitTime(DEFAULT_WAIT_TIME);
m_lastStartupApp.clear();
+ m_subDispApp.clear();
+ m_empty.clear();
}
/**
*/
CicoHSAppHistoryExt::CicoHSAppHistoryExt(const string& user,
const string& path,
+ const string& pathD,
const string& flagpath)
- :CicoHSAppHistory(user, path, flagpath)
+ :CicoHSAppHistory(user, path, pathD, flagpath)
{
resetCounter();
setHandler();
setWaitTime(DEFAULT_WAIT_TIME);
m_lastStartupApp.clear();
+ m_subDispApp.clear();
+ m_empty.clear();
}
/**
ICO_DBG("timer set(%x) %s, %d", data, appid, data->id);
ecore_timer_add(m_waitTimer, ico_CHSAHE_timeout, data);
m_lCdt.push_back(data);
- m_currentAppid = appid;
+ m_waitSelApp = appid;
}
/**
ICO_DBG("free %x", data);
delete data; // area free
}
- if (true == m_currentAppid.empty()) {
+ if (true == m_waitSelApp.empty()) {
ICO_DBG("end appid lost");
return;
}
if (id == getCounter()) {
+ string appid(m_waitSelApp);
ICO_DBG("Match id");
- moveHistoryHead(m_currentAppid);
- m_currentAppid.clear();
+ moveHistoryHead(m_waitSelApp);
+ m_waitSelApp.clear();
+ if (m_hs) {
+ m_hs->requestWaitActivation(appid);
+ }
}
ICO_DBG("end");
}
void CicoHSAppHistoryExt::activeApp(const char* appid)
{
ICO_DBG("start %s", appid);
- if (true == m_currentAppid.empty()) {
+ if (true == m_waitSelApp.empty()) {
#if 1
moveHistoryHead(appid);
#endif
ICO_DBG("end current none");
return;
}
- if (m_currentAppid == appid) { // touch operate app
- moveHistoryHead(m_currentAppid);
- m_currentAppid.clear();
+ if (m_waitSelApp == appid) { // touch operate app
+ moveHistoryHead(m_waitSelApp);
+ m_waitSelApp.clear();
ICO_DBG("end touch operate app");
return;
}
- ICO_DBG("end no match curr(%s)", m_currentAppid.c_str());
-#if 1
- moveHistoryHead(appid);
-#endif
+ ICO_DBG("end no match select app(%s)", m_waitSelApp.c_str());
#if 1
- m_currentAppid.clear();
+ if (true == moveHistoryHead(appid)) {
+ m_waitSelApp.clear();
+ }
#endif
return;
}
string tmp(m_bkTmp);
m_bkTmp.clear();
int i = 0;
+ const char* pAppidSubD = getAppidSubDispBySystem();
list<string>::iterator p = m_appHistoryList.begin();
while (p != m_appHistoryList.end()) {
if (i != 0) {
m_bkTmp += ',';
}
m_bkTmp += *p;
+ if (0 == (*p).compare(pAppidSubD)) {
+ m_bkTmp += "(S)";
+ }
i++;
++p;
}
ICO_DBG("true, %d %d", m_bkTmp.size(), tmp.size());
return true;
}
+
bool CicoHSAppHistoryExt::addAppHistory(const string& app)
{
bool r;
}
return r;
}
+
bool CicoHSAppHistoryExt::delAppHistory(const string& app)
{
bool r;
if (true == chgChk()) {
writeAppHistory();
}
+ if (true == isStartupChecking()) {
+ if (0 == m_lastStartupApp.compare(app)) {
+ m_lastStartupApp.clear();
+ }
+ if (0 == m_subDispApp.compare(app)) {
+ m_subDispApp.clear();
+ }
+ startupEntryFinish(app);
+ if (true == isFinish()) {
+ if (NULL != m_hs) {
+ m_hs->finishStartup();
+ }
+ }
+ }
return r;
}
/**
*/
const string& CicoHSAppHistoryExt::nextSwipe()
{
- m_swipeStr.clear();
- if (false == m_lastStartupApp.empty()) {
+ if (true == isStartupChecking()) {
ICO_DBG("Next empty! stoped");
- return m_swipeStr;
+ return m_empty;
}
if (m_swipeCurr == m_appHistoryList.begin()) {
ICO_DBG("Next empty! stoped");
- return m_swipeStr;
+ return m_empty;
}
--m_swipeCurr;
m_swipeStr = *m_swipeCurr;
if (true == update_pairPidAppid(m_swipeStr)) {
*m_swipeCurr = m_swipeStr;
}
+ const char* pAppidSubD = getAppidSubDispBySystem();
+ if (0 == m_swipeStr.compare(pAppidSubD)) {
+ if (m_swipeCurr == m_appHistoryList.begin()) {
+ ++m_swipeCurr; // back
+ m_swipeStr = *m_swipeCurr;
+ ICO_DBG("begin is sub display appid");
+ return m_empty;
+ }
+ --m_swipeCurr; // one more
+ m_swipeStr = *m_swipeCurr;
+ if (true == update_pairPidAppid(m_swipeStr)) {
+ *m_swipeCurr = m_swipeStr;
+ }
+ }
ICO_DBG("Next %s", m_swipeStr.c_str());
return m_swipeStr;
}
*/
const string& CicoHSAppHistoryExt::prevSwipe()
{
- m_swipeStr.clear();
- if (false == m_lastStartupApp.empty()) {
+ if (true == isStartupChecking()) {
+ ICO_DBG("Next empty! stoped");
+ return m_empty;
+ }
+ if (m_swipeCurr == m_appHistoryList.end()) {
ICO_DBG("Next empty! stoped");
- return m_swipeStr;
+ return m_empty;
}
++m_swipeCurr;
if (m_swipeCurr == m_appHistoryList.end()) {
--m_swipeCurr;
ICO_DBG("Prev empty! stoped");
- return m_swipeStr;
+ return m_empty;
}
m_swipeStr = *m_swipeCurr;
if (true == update_pairPidAppid(m_swipeStr)) {
*m_swipeCurr = m_swipeStr;
}
+ const char* pAppidSubD = getAppidSubDispBySystem();
+ if (0 == m_swipeStr.compare(pAppidSubD)) {
+ ++m_swipeCurr;
+ if (m_swipeCurr == m_appHistoryList.end()) {
+ --m_swipeCurr;
+ --m_swipeCurr;
+ m_swipeStr = *m_swipeCurr;
+ if (true == update_pairPidAppid(m_swipeStr)) {
+ *m_swipeCurr = m_swipeStr;
+ }
+ ICO_DBG("old history appid is sub display");
+ return m_empty;
+ }
+ m_swipeStr = *m_swipeCurr;
+ if (true == update_pairPidAppid(m_swipeStr)) {
+ *m_swipeCurr = m_swipeStr;
+ }
+ }
ICO_DBG("Prev %s", m_swipeStr.c_str());
return m_swipeStr;
}
if (true == update_pairPidAppid(m_swipeStr)) {
*m_swipeCurr = m_swipeStr;
}
+ const char* pAppidSubD = getAppidSubDispBySystem();
+ if (0 == m_swipeStr.compare(pAppidSubD)) {
+ if (1 < m_appHistoryList.size()) {
+ prevSwipe();
+ }
+ else {
+ m_swipeStr.clear();
+ }
+ }
}
+ ICO_DBG("swipe home is %s", m_swipeStr.c_str());
return m_swipeStr;
}
/**
+ * @brief get near entry history
+ * @ret appid
+ */
+const string& CicoHSAppHistoryExt::getNearHistory()
+{
+ ICO_TRA("start");
+ list<string>::iterator p = m_appHistoryList.begin();
+ if (p == m_appHistoryList.end()) {
+ // NO history
+ ICO_TRA("end no history");
+ return m_empty;
+ }
+ const char* pAppidSubD = getAppidSubDispBySystem();
+ if (0 != (*p).compare(pAppidSubD)) {
+ // on history
+ ICO_TRA("end near history is %s", (*p).c_str());
+ return *p;
+ }
+ ++p;
+ if (p == m_appHistoryList.end()) {
+ // NO history
+ ICO_TRA("end no history");
+ return m_empty;
+ }
+ ICO_TRA("end near history is %s", (*p).c_str());
+ return *p;
+}
+
+/**
* @brief get swipe current appid
* @ret appid
*/
{
ICO_DBG("add pid=%d, appid=%s", pid, appid.c_str());
m_vpbpa.push_back(pairBoolPidAppid(false, pairPidAppid(pid, appid)));
- if (false == d) {
- m_lastStartupApp = appid;
+ if (true == d) {
+ m_subDispApp = appid;
}
+ else {
+ m_lastStartupApp = appid;
+ }
}
/**
}
}
+void CicoHSAppHistoryExt::startupEntryFinish(const string& appid)
+{
+ vector<pairBoolPidAppid>::iterator it = m_vpbpa.begin();
+ while (it != m_vpbpa.end()) {
+ if (0 == (*it).second.second.compare(appid)) {
+ ICO_DBG("FINISH!! %d, %s", (*it).second.first,
+ (*it).second.second.c_str());
+ (*it).first = true;
+ }
+ it++;
+ }
+}
+
/**
* @brief is finish start-up check
* @ret bool
{
public:
CicoHSAppHistoryExt();
- CicoHSAppHistoryExt(const char* user, const char* path, const char* flagpath);
+ CicoHSAppHistoryExt(const char* user, const char* path, const char* pathD,
+ const char* flagpath);
CicoHSAppHistoryExt(const std::string& user, const std::string& path,
- const std::string& flagpath);
+ const std::string& pathD, const std::string& flagpath);
virtual ~CicoHSAppHistoryExt();
void setWaitTime(double msec);
virtual bool addAppHistory(const std::string& app);
virtual bool delAppHistory(const std::string& app);
virtual bool moveHistoryHead(const std::string& app);
+ const std::string& getNearHistory();
// AUL I/F
int appLaunch(int pid, const char* appid, int aulstt);
void selectApp(int pid);
void selectApp(const std::string& appid);
void selectApp(const char* appid);
+ const std::string& getSelectApp() const;
// time out selected app
void determined(CHSAHE_data_t* data);
void startupCheckAdd(int pid, const std::string& appid, bool d = false);
bool isStartupChecking() const;
void startupEntryFinish(int pid);
+ void startupEntryFinish(const std::string& appid);
bool isFinish();
void stopStartupCheck();
- const std::string& lastStartupApp() const;
+ const std::string& getLastStartupAppid() const;
+ const std::string& getSubDispAppid() const;
+ bool chgChk();
protected:
enum {
COUNTER_START = 1,
int resetCounter();
int getCounter();
int nextCounter();
- bool chgChk();
protected:
std::vector<pairPidAppid> m_vppa;
std::vector<int> m_aulstt;
int m_cnt;
- std::string m_currentAppid;
+ std::string m_waitSelApp;
std::list<CHSAHE_data_t*> m_lCdt;
double m_waitTimer; // ex.) 1sec = 1.0
std::string m_bkTmp;
std::vector<pairBoolPidAppid> m_vpbpa;
std::string m_lastStartupApp;
+ std::string m_subDispApp;
+ std::string m_empty;
};
/**
return true;
}
+/**
+ * @brief get last start-up appid
+ * @retuen appid Valid only application startup
+ * @retval empty is application startup finish or no have history
+*/
-
-inline const std::string& CicoHSAppHistoryExt::lastStartupApp() const
+inline const std::string& CicoHSAppHistoryExt::getLastStartupAppid() const
{
return m_lastStartupApp;
}
+/**
+ * @brief get history sub display appid
+ * @return appid
+ * @retval empty is no have history sub display
+ */
+inline const std::string& CicoHSAppHistoryExt::getSubDispAppid() const
+{
+ return m_subDispApp;
+}
+
+/**
+ * @brief get select App entry appid
+ * @ret appid
+ * @retval empty is time out or none select
+ */
+inline const std::string& CicoHSAppHistoryExt::getSelectApp() const
+{
+ return m_waitSelApp;
+}
+
#endif // CICOHSAPPHISTORYEXT_H
CicoHomeScreenConfig config;
config.Initialize(ICO_HOMESCREEN_CONFIG_FILE);
- const char *value = config.ConfigGetString("switchzone", "keyname", NULL);
- changeZoneKeyName = value[0];
+ const char *value = config.ConfigGetString("switchzone", "keyname", "m");
+ if (strlen(value) > (sizeof(changeZoneKeyName) - 1)) {
+ ICO_WRN("[switchzone] keyname is strlen overflow. use default keyname(m)");
+ }
+ else {
+ memset(changeZoneKeyName, 0, sizeof(changeZoneKeyName));
+ strncpy(changeZoneKeyName, value, strlen(value));
+ }
+
+ value = config.ConfigGetString("standardswitch", "homekeyname", "h");
+ if (strlen(value) > (sizeof(homeKeyName) - 1)) {
+ ICO_WRN("[standardswitch] keyname is strlen overflow. use default keyname(h)");
+ }
+ else {
+ memset(homeKeyName, 0, sizeof(homeKeyName));
+ strncpy(homeKeyName, value, strlen(value));
+ }
+
+ value = config.ConfigGetString("standardswitch", "backkeyname", "b");
+ if (strlen(value) > (sizeof(backKeyName) - 1)) {
+ ICO_WRN("[standardswitch] keyname is strlen overflow. use default keyname(b)");
+ }
+ else {
+ memset(backKeyName, 0, sizeof(backKeyName));
+ strncpy(backKeyName, value, strlen(value));
+ }
+
+ value = config.ConfigGetString("standardswitch", "menukeyname", "l");
+ menuKeyName[0] = value[0];
+ if (strlen(value) > (sizeof(menuKeyName) - 1)) {
+ ICO_WRN("[standardswitch] keyname is strlen overflow. use default keyname(l)");
+ }
+ else {
+ memset(menuKeyName, 0, sizeof(menuKeyName));
+ strncpy(menuKeyName, value, strlen(value));
+ }
+ ICO_DBG("Assigned key config : changeZone[%s]", changeZoneKeyName);
+ ICO_DBG("Assigned key config : home[%s]", homeKeyName);
+ ICO_DBG("Assigned key config : back[%s]", backKeyName);
+ ICO_DBG("Assigned key config : menu[%s]", menuKeyName);
char tmp_str[16];
for (unsigned int ii = 0; ii < ICO_HS_CONTROL_BAR_SHORTCUT_MAX_NUM; ii++) {
char img_path[ICO_HS_MAX_PATH_BUFF_LEN];
/*create window*/
- ret = CreateWindow(ICO_HS_CONTROL_BAR_WINDOW_TITLE,pos_x,pos_y,width,height,EINA_TRUE);
+ ret = CreateWindow(ICO_HS_CONTROL_BAR_WINDOW_TITLE,
+ pos_x, pos_y, width, height, EINA_TRUE);
if(ret != ICO_OK){
return ret;
}
evas_object_event_callback_add(background, EVAS_CALLBACK_KEY_DOWN,
CicoHSControlBarWindow::evasKeyDownCB, this);
+ // key grab
evas_object_focus_set(background, EINA_FALSE);
- Eina_Bool eret = evas_object_key_grab(background, "m", 0, 0, EINA_TRUE);
+ Eina_Bool eret = evas_object_key_grab(background, (const char*)changeZoneKeyName,
+ 0, 0, EINA_TRUE);
+ if (EINA_FALSE == eret) {
+ ICO_WRN("evas_object_key_grab failed.");
+ }
+ eret = evas_object_key_grab(background, (const char*)homeKeyName,
+ 0, 0, EINA_TRUE);
+ if (EINA_FALSE == eret) {
+ ICO_WRN("evas_object_key_grab failed.");
+ }
+ eret = evas_object_key_grab(background, (const char*)backKeyName,
+ 0, 0, EINA_TRUE);
+ if (EINA_FALSE == eret) {
+ ICO_WRN("evas_object_key_grab failed.");
+ }
+ eret = evas_object_key_grab(background, (const char*)menuKeyName,
+ 0, 0, EINA_TRUE);
if (EINA_FALSE == eret) {
ICO_WRN("evas_object_key_grab failed.");
}
/*--------------------------------------------------------------------------*/
/**
- * @brief CicoHSControlBarWindow::GetChangeZoneKeyName
- * get change zone key name
+ * @brief CicoHSControlBarWindow::SetMenuWindowID
+ * set appid and surface
*
* @param[in] none
* @return none
*/
/*--------------------------------------------------------------------------*/
-char
-CicoHSControlBarWindow::GetChangeZoneKeyName(void)
+void
+CicoHSControlBarWindow::SetWindowID(const char *appid,int surface)
{
- return changeZoneKeyName;
+ strncpy(this->appid,appid,ICO_HS_MAX_PROCESS_NAME);
+ this->surface = surface;
}
/*--------------------------------------------------------------------------*/
/**
- * @brief CicoHSControlBarWindow::SetMenuWindowID
- * set appid and surface
+ * @brief CicoHSControlBarWindow::TouchShortcut
+ * touch shortcut button
*
* @param[in] none
* @return none
*/
/*--------------------------------------------------------------------------*/
void
-CicoHSControlBarWindow::SetWindowID(const char *appid,int surface)
+CicoHSControlBarWindow::TouchShortcut(const char *appid)
{
- strncpy(this->appid,appid,ICO_HS_MAX_PROCESS_NAME);
- this->surface = surface;
+ ICO_DBG("CicoHSControlBarWindow::TouchShortcut Enter");
+
+ if (appid != NULL) {
+ ICO_DBG("CicoHSControlBarWindow::TouchShortcut appid = [%s]", appid);
+ CicoHomeScreen::ExecuteApp(appid);
+ }
+
+ ICO_DBG("CicoHSControlBarWindow::TouchShortcut Leave");
}
//--------------------------------------------------------------------------
*/
//--------------------------------------------------------------------------
void
-CicoHSControlBarWindow::evasKeyDownCB(void *data, Evas *evas,
- Evas_Object *obj, void *info)
+CicoHSControlBarWindow::onKeyDown(void *data, Evas *evas,
+ Evas_Object *obj, void *info)
{
Evas_Event_Key_Down *evinfo = NULL;
evinfo = (Evas_Event_Key_Down*)info;
- CicoHSControlBarWindow *ctrlbarwin = (CicoHSControlBarWindow*)(data);
- ICO_DBG("KeyDownCB: keyname=%s, key=%d",
+ ICO_DBG("onKeyDown: keyname=%s, key=%d",
evinfo->keyname, (char)*evinfo->key);
- if (evinfo->keyname[0] == ctrlbarwin->GetChangeZoneKeyName()) {
+ if (0 == strcmp(evinfo->keyname, changeZoneKeyName)) {
CicoHomeScreen::ChangeZone();
}
+ else if (0 == strcmp(evinfo->keyname, homeKeyName)) {
+ TouchHome();
+ }
+ else if (0 == strcmp(evinfo->keyname, backKeyName)) {
+ // TODO not assinded funciton
+ }
+ else if (0 == strcmp(evinfo->keyname, menuKeyName)) {
+ // TODO not assinded funciton
+ }
}
-/*--------------------------------------------------------------------------*/
+//--------------------------------------------------------------------------
/**
- * @brief CicoHSControlBarWindow::TouchShortcut
- * touch shortcut button
+ * @brief key up event callback function
*
- * @param[in] none
- * @return none
+ * @pamam [in] data user data
+ * @param [in] evas evas instcance
+ * @param [in] obj evas object instcance
+ * @param [in] info event information(Evas_Event_Key_Down)
*/
-/*--------------------------------------------------------------------------*/
+//--------------------------------------------------------------------------
void
-CicoHSControlBarWindow::TouchShortcut(const char *appid)
+CicoHSControlBarWindow::evasKeyDownCB(void *data, Evas *evas,
+ Evas_Object *obj, void *info)
{
- ICO_DBG("CicoHSControlBarWindow::TouchShortcut Enter");
-
- if (appid != NULL) {
- ICO_DBG("CicoHSControlBarWindow::TouchShortcut appid = [%s]", appid);
- CicoHomeScreen::ExecuteApp(appid);
- }
-
- ICO_DBG("CicoHSControlBarWindow::TouchShortcut Leave");
+ CicoHSControlBarWindow *ctrlbarwin = (CicoHSControlBarWindow*)(data);
+ ctrlbarwin->onKeyDown(data, evas, obj, info);
}
-
// vim: set expandtab ts=4 sw=4:
void SetNightMode(void);
void SetRegulation(void);
- char GetChangeZoneKeyName(void);
void AddShortcut(Evas *evas, int width);
void TouchShortcut(const char *appid);
+ void onKeyDown(void *data, Evas *evas, Evas_Object *obj, void *info);
+
protected:
// assignment operator
CicoHSControlBarWindow operator=(const CicoHSControlBarWindow&);
Evas *evas; ///! evas instance
Evas_Object *background; ///! background evas object instance
Evas_Object *menu_btn; ///! menu button evas object instance
- char changeZoneKeyName; ///! change zone key name
+ char changeZoneKeyName[8]; ///! change zone key name
+ char homeKeyName[8]; ///! home button assigned key name
+ char backKeyName[8]; ///! back button assigned key name
+ char menuKeyName[8]; ///! menu button assigned key name
const char *shortcut_appid[ICO_HS_CONTROL_BAR_SHORTCUT_MAX_NUM];
Evas_Object *shortcut[ICO_HS_CONTROL_BAR_SHORTCUT_MAX_NUM];
-
};
#endif
// vim: set expandtab ts=4 sw=4:
CicoHSFlickTouch::TouchDownFlick, this);
evas_object_event_callback_add(background, EVAS_CALLBACK_MOUSE_UP,
CicoHSFlickTouch::TouchUpFlick, this);
+ evas_object_event_callback_add(background, EVAS_CALLBACK_MOUSE_MOVE,
+ CicoHSFlickTouch::TouchMoveFlick, this);
/* move and show window */
evas_object_move(background, 0, 0);
#include "CicoHSFlickTouch.h"
#include "CicoHSAppInfo.h"
#include "CicoHomeScreen.h"
+#include "CicoHSSystemState.h"
#include "ico_syc_inputctl.h"
#include <linux/input.h>
int CicoHSFlickTouch::touch_lasttime;
Ecore_Timer *CicoHSFlickTouch::timer;
+bool CicoHSFlickTouch::touch_down;
bool CicoHSFlickTouch::long_act;
+bool CicoHSFlickTouch::set_xy_pos;
int CicoHSFlickTouch::num_windows;
CicoHSFlickInputWindow* CicoHSFlickTouch::flick_windows[ICO_HS_MAX_FLICKWINDOWS];
{
timer = NULL;
num_windows = 0;
+ touch_down = false;
long_act = false;
+ set_xy_pos = false;
ctl_bar_window = ctl_bar;
app_history = apphist;
info = reinterpret_cast<Evas_Event_Mouse_Down*>(event_info);
window = (CicoHSFlickInputWindow *)data;
- touch_state_b_x = info->output.x + window->GetPosX();
- touch_state_b_y = info->output.y + window->GetPosY();
+
+ if ((info->output.x < 0) || (info->output.y < 0) ||
+ (info->output.x >= 4096) || (info->output.y >= 4096)) {
+ ICO_DBG("TouchDownFlick: illegal position(%d/%d)", info->output.x, info->output.y);
+ }
+ else if (set_xy_pos == false) {
+ set_xy_pos = true;
+ touch_state_b_x = info->output.x + window->GetPosX();
+ touch_state_b_y = info->output.y + window->GetPosY();
+ }
+ if (touch_down) {
+ ICO_DBG("TouchDownFlick: dual touch down, Skip");
+ return;
+ }
gettimeofday(&ctime, NULL);
touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
- ICO_DBG("TouchDownFlick: x/y=%d/%d", touch_state_b_x, touch_state_b_y);
+ ICO_DBG("TouchDownFlick: x/y=%d/%d->%d/%d", info->output.x, info->output.y,
+ touch_state_b_x, touch_state_b_y);
+ touch_down = true;
long_act = false;
timer = ecore_timer_add(ICO_HS_FLICK_TOUCH_LONG_PUSH_THREASHOLD_TIME_SECONDS,
LongPushed,NULL);
long_act = true;
timer = NULL;
-#if 0 /* not yet support */
/* send ABS_X/Y */
+ ICO_DBG("LongPushed: Not Flick, send Touch Down event to application");
ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
ABS_Z, (touch_state_b_x << 16) | touch_state_b_y);
/* send TOUCH Down */
BTN_TOUCH, 1);
/* send ABS_X/Y */
ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
- ABS_Z, (touch_state_b_x << 16) | touch_state_b_y);
-#endif
- touch_state_b_x = 0;
- touch_state_b_y = 0;
+ ABS_Z, ((touch_state_b_x+1) << 16) | (touch_state_b_y+1));
return ECORE_CALLBACK_CANCEL;
}
std::string histapp;
std::string curapp;
+ info = reinterpret_cast<Evas_Event_Mouse_Up*>(event_info);
+ window = (CicoHSFlickInputWindow *)data;
+ touch_state_a_x = info->output.x + window->GetPosX();
+ touch_state_a_y = info->output.y + window->GetPosY();
+ set_xy_pos = false;
+
+ ICO_DBG("TouchUpFlick: x/y=%d/%d->%d/%d (before %d/%d)",
+ info->output.x, info->output.y,
+ touch_state_b_x, touch_state_b_y, touch_state_a_x, touch_state_a_y);
+
if(timer != NULL){
ecore_timer_del(timer);
timer = NULL;
}
- /* long push*/
- if(long_act == true){
+ /* long push */
+ if((touch_down == false) || (long_act == true)) {
ICO_DBG("TouchUpFlick: timedout");
- long_act = false;
- return;
- }
+ touch_down = false;
- info = reinterpret_cast<Evas_Event_Mouse_Up*>(event_info);
- window = (CicoHSFlickInputWindow *)data;
- touch_state_a_x = info->output.x + window->GetPosX();
- touch_state_a_y = info->output.y + window->GetPosY();
+ /* send touch release event */
+ gettimeofday(&ctime, NULL);
+ touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
- ICO_DBG("TouchUpFlick: x/y=%d/%d->%d/%d",
- touch_state_b_x, touch_state_b_y, touch_state_a_x, touch_state_a_y);
+ /* send ABS_X/Y */
+ ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
+ ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
+ /* send TOUCH Up */
+ ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
+ BTN_TOUCH, 0);
+ /* send ABS_X/Y */
+ ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
+ ABS_Z, ((touch_state_a_x+1) << 16) | (touch_state_a_y+1));
+ return;
+ }
+ touch_down = false;
sub = touch_state_a_x - touch_state_b_x;
/* check slide left to right or right to left */
if (sub > ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE) {
if (touch_state_b_x < ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE) {
-
- /* flick at left side to right = back before application*/
- ICO_DBG("TouchUpFlick: Flick left side to right");
-
- /* get before application */
- curapp = app_history->getSwipeCurrentAppid();
- histapp = app_history->prevSwipe();
- ICO_DBG("TouchUpFlick: Flick left to right(cur/prev=%s/%s)",
- curapp.c_str(), histapp.c_str());
- if (histapp.empty()) {
- ICO_DBG("TouchUpFlick: Flick left to right(prev not exist)");
+ if (CicoHSSystemState::getInstance()->getRegulation() == true) {
+ ICO_DBG("TouchUpFlick: Flick left side to right, but Regulation=ON");
}
else {
- animation.time = ICO_HS_FLICK_TOUCH_FLICK_ANIMA_TIME |
- ICO_SYC_WIN_SURF_RAISE | ICO_SYC_WIN_SURF_NORESCTL;
-
- /* show before application with slide to right */
- appinfo = CicoHomeScreen::GetAppInfo(histapp.c_str());
- if (appinfo) {
- animation.name = (char *)"slide.toright";
- for (idx = 0; ; idx++) {
- wininfo = appinfo->GetWindowInfo(idx);
- if (! wininfo) break;
- ICO_DBG("TouchUpFlick: %s.%d surface=%08x",
- wininfo->appid, idx, wininfo->surface);
- ico_syc_show(wininfo->appid, wininfo->surface, &animation);
- }
- }
- else {
- ICO_DBG("TouchUpFlick: prev app(%s) dose not exist", histapp.c_str());
- }
+ /* flick at left side to right = back before application*/
+ ICO_DBG("TouchUpFlick: Flick left side to right");
- /* hide current applicaiton with slide to right */
- if (curapp.empty()) {
- ICO_DBG("TouchUpFlick: Flick left to right(current not exist)");
+ /* get before application */
+ curapp = app_history->getSwipeCurrentAppid();
+ histapp = app_history->prevSwipe();
+ ICO_DBG("TouchUpFlick: Flick left to right(cur/prev=%s/%s)",
+ curapp.c_str(), histapp.c_str());
+ if (histapp.empty()) {
+ ICO_DBG("TouchUpFlick: Flick left to right(prev not exist)");
}
else {
animation.time = ICO_HS_FLICK_TOUCH_FLICK_ANIMA_TIME |
- ICO_SYC_WIN_SURF_NORESCTL;
- appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
+ ICO_SYC_WIN_SURF_RAISE | ICO_SYC_WIN_SURF_NORESCTL;
+
+ /* show before application with slide to right */
+ appinfo = CicoHomeScreen::GetAppInfo(histapp.c_str());
if (appinfo) {
- animation.name = (char *)"slide.toleft";
+ animation.name = (char *)"slide.toright";
for (idx = 0; ; idx++) {
wininfo = appinfo->GetWindowInfo(idx);
if (! wininfo) break;
ICO_DBG("TouchUpFlick: %s.%d surface=%08x",
wininfo->appid, idx, wininfo->surface);
- ico_syc_hide(wininfo->appid, wininfo->surface, &animation);
+ ico_syc_show(wininfo->appid, wininfo->surface, &animation);
}
}
else {
- ICO_DBG("TouchUpFlick: current app(%s) dose not exist",
- curapp.c_str());
+ ICO_DBG("TouchUpFlick: prev app(%s) dose not exist", histapp.c_str());
+ }
+
+ /* hide current applicaiton with slide to right */
+ if (curapp.empty()) {
+ ICO_DBG("TouchUpFlick: Flick left to right(current not exist)");
}
+ else {
+ animation.time = ICO_HS_FLICK_TOUCH_FLICK_ANIMA_TIME |
+ ICO_SYC_WIN_SURF_NORESCTL;
+ appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
+ if (appinfo) {
+ animation.name = (char *)"slide.toleft";
+ for (idx = 0; ; idx++) {
+ wininfo = appinfo->GetWindowInfo(idx);
+ if (! wininfo) break;
+ ICO_DBG("TouchUpFlick: %s.%d surface=%08x",
+ wininfo->appid, idx, wininfo->surface);
+ ico_syc_hide(wininfo->appid, wininfo->surface, &animation);
+ }
+ }
+ else {
+ ICO_DBG("TouchUpFlick: current app(%s) dose not exist",
+ curapp.c_str());
+ }
+ }
+ /* set history timer */
+ app_history->selectApp(histapp.c_str());
}
- /* set history timer */
- app_history->selectApp(histapp.c_str());
}
flick = 1;
}
}
}
else if (sub < (-1 * ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE)) {
- if (touch_state_b_x > (full_width - ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE)) {
- /* flick at right side to left = go next applicaton */
-
- /* get next application */
- curapp = app_history->getSwipeCurrentAppid();
- histapp = app_history->nextSwipe();
- ICO_DBG("TouchUpFlick: Flick right to left(cur/next=%s/%s)",
- curapp.c_str(), histapp.c_str());
- if (histapp.empty()) {
- ICO_DBG("TouchUpFlick: Flick right to left(next not exist)");
+ if (touch_state_b_x >
+ (full_width - ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE)) {
+ if (CicoHSSystemState::getInstance()->getRegulation() == true) {
+ ICO_DBG("TouchUpFlick: Flick right side to left, but Regulation=ON");
}
else {
- animation.time = ICO_HS_FLICK_TOUCH_FLICK_ANIMA_TIME |
- ICO_SYC_WIN_SURF_RAISE | ICO_SYC_WIN_SURF_NORESCTL;
-
- /* show next application with slide to left */
- appinfo = CicoHomeScreen::GetAppInfo(histapp.c_str());
- if (appinfo) {
- animation.name = (char *)"slide.toleft";
- for (idx = 0; ; idx++) {
- wininfo = appinfo->GetWindowInfo(idx);
- if (! wininfo) break;
- ICO_DBG("TouchUpFlick: %s.%d surface=%08x",
- wininfo->appid, idx, wininfo->surface);
- ico_syc_show(wininfo->appid, wininfo->surface, &animation);
- }
- }
- else {
- ICO_DBG("TouchUpFlick: next app(%s) dose not exist", histapp.c_str());
- }
+ /* flick at right side to left = go next applicaton */
- /* hide current applicaiton with slide to left */
- if (curapp.empty()) {
- ICO_DBG("TouchUpFlick: Flick right to left(current not exist)");
+ /* get next application */
+ curapp = app_history->getSwipeCurrentAppid();
+ histapp = app_history->nextSwipe();
+ ICO_DBG("TouchUpFlick: Flick right to left(cur/next=%s/%s)",
+ curapp.c_str(), histapp.c_str());
+ if (histapp.empty()) {
+ ICO_DBG("TouchUpFlick: Flick right to left(next not exist)");
}
else {
animation.time = ICO_HS_FLICK_TOUCH_FLICK_ANIMA_TIME |
- ICO_SYC_WIN_SURF_NORESCTL;
- appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
+ ICO_SYC_WIN_SURF_RAISE | ICO_SYC_WIN_SURF_NORESCTL;
+
+ /* show next application with slide to left */
+ appinfo = CicoHomeScreen::GetAppInfo(histapp.c_str());
if (appinfo) {
- animation.name = (char *)"slide.toright";
+ animation.name = (char *)"slide.toleft";
for (idx = 0; ; idx++) {
wininfo = appinfo->GetWindowInfo(idx);
if (! wininfo) break;
ICO_DBG("TouchUpFlick: %s.%d surface=%08x",
wininfo->appid, idx, wininfo->surface);
- ico_syc_hide(wininfo->appid, wininfo->surface, &animation);
+ ico_syc_show(wininfo->appid, wininfo->surface, &animation);
}
}
else {
- ICO_DBG("TouchUpFlick: current app(%s) dose not exist",
- curapp.c_str());
+ ICO_DBG("TouchUpFlick: next app(%s) dose not exist", histapp.c_str());
}
+
+ /* hide current applicaiton with slide to left */
+ if (curapp.empty()) {
+ ICO_DBG("TouchUpFlick: Flick right to left(current not exist)");
+ }
+ else {
+ animation.time = ICO_HS_FLICK_TOUCH_FLICK_ANIMA_TIME |
+ ICO_SYC_WIN_SURF_NORESCTL;
+ appinfo = CicoHomeScreen::GetAppInfo(curapp.c_str());
+ if (appinfo) {
+ animation.name = (char *)"slide.toright";
+ for (idx = 0; ; idx++) {
+ wininfo = appinfo->GetWindowInfo(idx);
+ if (! wininfo) break;
+ ICO_DBG("TouchUpFlick: %s.%d surface=%08x",
+ wininfo->appid, idx, wininfo->surface);
+ ico_syc_hide(wininfo->appid, wininfo->surface, &animation);
+ }
+ }
+ else {
+ ICO_DBG("TouchUpFlick: current app(%s) dose not exist",
+ curapp.c_str());
+ }
+ }
+ /* set history timer */
+ app_history->selectApp(histapp.c_str());
}
- /* set history timer */
- app_history->selectApp(histapp.c_str());
}
flick = 1;
}
if (touch_state_b_y < ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE) {
/* flick at top side to buttom = unknown */
ICO_DBG("TouchUpFlick: Flick top side to buttom");
+ flick = 1;
}
else {
ICO_DBG("TouchUpFlick: Flick top side to buttom, but nop");
+ flick = -1;
}
}
else if (sub < (-1 * ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE)) {
- if (touch_state_b_y > (full_width - ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE)) {
+ if (touch_state_b_y >
+ (full_width - ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE)) {
/* flick at buttom side to top = show home menu screen */
ICO_DBG("TouchUpFlick: Flick buttom side to top");
+ flick = 1;
if (ctl_bar_window) {
ctl_bar_window->TouchHome();
}
}
else {
ICO_DBG("TouchUpFlick: Flick buttom side to top, but nop");
+ flick = -1;
}
}
#endif
- touch_state_b_x = 0;
- touch_state_b_y = 0;
-
-#if 0 /* not yet support */
if (flick <= 0) {
/* send touch press event */
+ ICO_DBG("TouchUpFlick: Not Flick, send event to application");
/* send ABS_X/Y */
ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
ABS_Z, (touch_state_b_x << 16) | touch_state_b_y);
BTN_TOUCH, 1);
/* send ABS_X/Y */
ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
- ABS_Z, (touch_state_b_x << 16) | touch_state_b_y);
+ ABS_Z, ((touch_state_b_x+1) << 16) | (touch_state_b_y+1));
/* send touch release event */
gettimeofday(&ctime, NULL);
BTN_TOUCH, 0);
/* send ABS_X/Y */
ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
+ ABS_Z, ((touch_state_a_x+1) << 16) | (touch_state_a_y+1));
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief CicoHSFlickTouch::TouchMoveFlick
+ * touch move action at flick input window
+ *
+ * @param[in] data CicoHSFlickInputWindow object
+ * @param[in] evas evas
+ * @param[in] obj object
+ * @param[in] event_info event information
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+void
+CicoHSFlickTouch::TouchMoveFlick(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_Move *info;
+ CicoHSFlickInputWindow *window;
+ struct timeval ctime;
+
+ info = reinterpret_cast<Evas_Event_Mouse_Move*>(event_info);
+
+ ICO_DBG("TouchMoveFlick: button=%x cur.x/y=%d/%d prv.x/y=%d/%d",
+ info->buttons, info->cur.output.x, info->cur.output.y,
+ info->prev.output.x, info->prev.output.y);
+
+ window = (CicoHSFlickInputWindow *)data;
+ if ((info->cur.output.x < 0) || (info->cur.output.y < 0) ||
+ (info->cur.output.x >= 4096) || (info->cur.output.y >= 4096)) {
+ ICO_DBG("TouchMoveFlick: Illegal position(x/y=%d/%d), Skip",
+ info->cur.output.x, info->cur.output.y);
+ return;
+ }
+ if (set_xy_pos == false) {
+ set_xy_pos = true;
+ touch_state_b_x = info->cur.output.x + window->GetPosX();
+ touch_state_b_y = info->cur.output.y + window->GetPosY();
+ }
+ touch_state_a_x = info->cur.output.x + window->GetPosX();
+ touch_state_a_y = info->cur.output.y + window->GetPosY();
+
+ /* long push */
+ if((touch_down == false) || (long_act == true)) {
+ ICO_DBG("TouchMoveFlick: not down(%d) or timedout(%d)",
+ (int)touch_down, (int)long_act);
+
+ if(timer != NULL){
+ ecore_timer_del(timer);
+ timer = NULL;
+ }
+
+ /* send ABS_X/Y */
+ gettimeofday(&ctime, NULL);
+ touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
+
+ ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
+ ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
+ return;
+ }
+
+ if (abs(touch_state_b_y - touch_state_a_y)
+ > ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_MOVE_Y) {
+ /* slide to top or buttom over threashold, flick cancel */
+ ICO_DBG("TouchMoveFlick: over Y direction");
+ if(timer != NULL){
+ ecore_timer_del(timer);
+ timer = NULL;
+ }
+ long_act = true;
+
+ /* send ABS_X/Y */
+ ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 2,
+ ABS_Z, (touch_state_b_x << 16) | touch_state_b_y);
+ /* send TOUCH Down */
+ ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime - 1,
+ BTN_TOUCH, 1);
+ /* send ABS_X/Y */
+ gettimeofday(&ctime, NULL);
+ touch_lasttime = (ctime.tv_sec * 1000 + ctime.tv_usec/1000);
+ ico_syc_send_input("\0", 0, ICO_SYC_INPUT_TYPE_TOUCH, 0, touch_lasttime,
ABS_Z, (touch_state_a_x << 16) | touch_state_a_y);
}
-#endif
}
#include "CicoHSControlBarWindow.h"
#include "CicoHSAppHistoryExt.h"
-#define ICO_HS_FLICK_TOUCH_FLICK_WIDTH 60
-#define ICO_HS_FLICK_TOUCH_FLICK_HEIGHT 60
+#define ICO_HS_FLICK_TOUCH_FLICK_WIDTH 80
+#define ICO_HS_FLICK_TOUCH_FLICK_HEIGHT 80
#define ICO_HS_FLICK_TOUCH_DISTANCE_XY 200
#define ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_DISTANCE 100
+#define ICO_HS_FLICK_TOUCH_FLICK_THREASHOLD_MOVE_Y 80
#define ICO_HS_FLICK_TOUCH_LONG_PUSH_THREASHOLD_TIME_SECONDS 2.5d
#define ICO_HS_FLICK_TOUCH_FLICK_ANIMA_TIME 300
static void Finalize(void);
static void TouchDownFlick(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static void TouchUpFlick(void *data, Evas *evas, Evas_Object *obj, void *event_info);
+ static void TouchMoveFlick(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static Eina_Bool LongPushed(void *data);
private:
static int touch_lasttime;
static Ecore_Timer *timer;
+ static bool touch_down;
static bool long_act;
+ static bool set_xy_pos;
static int num_windows;
static CicoHSFlickInputWindow* flick_windows[ICO_HS_MAX_FLICKWINDOWS];
static CicoHSAppHistoryExt* app_history;
CicoHSMenuWindow::DownNextMenu(void)
{
for (int i = 0; i < all_category_num; i++) {
- if (category_info[i].tile_num > 0) {
- if (current_page == category_info[i].page) {
- if (subcurrent_page >= category_info[i].subpage_max){
- return;
- }
+ if (current_page == category_info[i].page) {
+ if (subcurrent_page >= category_info[i].subpage_max){
+ return;
}
}
}
{
int subpage_max = 0;
for (int i = 0; i < all_category_num ; i++) {
- if (category_info[i].tile_num > 0) {
- if (current_page == category_info[i].page) {
- subpage_max = category_info[i].subpage_max;
- break;
- }
+ if (current_page == category_info[i].page) {
+ subpage_max = category_info[i].subpage_max;
+ break;
}
}
return;
}
}
+ hs_instance->requestChangeZone(appinfo);
+ ICO_TRA("CicoHomeScreen::ChangeZone Leave");
+}
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief change application display zone for appinfo
+ */
+/*--------------------------------------------------------------------------*/
+void
+CicoHomeScreen::requestChangeZone(CicoHSAppInfo* appinfo)
+{
int surface = appinfo->GetLastSurface();
- ICO_TRA("appid=%s, lastsurface=%d",
- appinfo->GetAppId(), appinfo->GetLastSurface());
+ ICO_TRA("Enter appid=%s, lastsurface=%d", appinfo->GetAppId(), surface);
ico_hs_window_info* wininfo = appinfo->GetWindowInfobySurface(surface);
if (NULL == wininfo) {
- ICO_TRA("CicoHomeScreen::ChangeZone Leave(not found wininfo)");
+ ICO_TRA("Leave(not found wininfo)");
return;
}
ICO_DBG("wininfo=%p", wininfo);
- const char *dispzone = hs_instance->moveZoneName;
- if (NULL != hs_instance->GetSubDisplayAppInfo()) {
+ const char *dispzone = moveZoneName;
+ if (NULL != GetSubDisplayAppInfo()) {
dispzone = appinfo->GetDefaultZone();
}
if (NULL == dispzone) {
+ ICO_TRA("Leave(not found dispzone)");
return;
}
.width = 0,
.height = 0
};
+
+ int layer = HS_LAYER_APPLICATION;
+ if (NULL == hs_instance->GetSubDisplayAppInfo()) {
+ layer = HS_LAYER_2NDDISP_APP;
+ }
+
+ ico_syc_change_layer(wininfo->appid, wininfo->surface, layer);
ico_syc_move(wininfo->appid, wininfo->surface, &move,
&hs_instance->moveZoneAnimation);
- if (NULL != hs_instance->GetSubDisplayAppInfo()) {
- hs_instance->SetSubDisplayAppInfo(NULL);
- hs_instance->ChangeActive(wininfo->appid, wininfo->surface);
+ if (NULL != GetSubDisplayAppInfo()) {
+ if (m_appHis) {
+ const string& wapp = m_appHis->getSelectApp();
+ ICO_DBG("\"%s\"->\"%s\"", wapp.c_str(), wininfo->appid);
+ if ((false == wapp.empty()) &&
+ (0 != wapp.compare(wininfo->appid))) {
+ cancelWaitActivation(wapp);
+ }
+ }
+ ICO_TRA("reset sub display");
+ SetSubDisplayAppInfo(NULL);
+ ChangeActive(wininfo->appid, wininfo->surface);
}
else {
- hs_instance->SetSubDisplayAppInfo(wininfo->appid);
+ ICO_TRA("set sub display");
+ SetSubDisplayAppInfo(wininfo->appid);
+ }
+
+ if (m_appHis) {
+ if (true == m_appHis->chgChk()) {
+ m_appHis->writeAppHistory();
+ }
+ m_appHis->homeSwipe();
}
- ICO_TRA("CicoHomeScreen::ChangeZone Leave");
+ ICO_TRA("Leave");
}
/*--------------------------------------------------------------------------*/
/**
* @brief update current sub display application information
*
- * @param [in] appid application id
*/
/*--------------------------------------------------------------------------*/
CicoHSAppInfo *
/*--------------------------------------------------------------------------*/
/**
+ * @brief update current sub display application appid
+ *
+ * @return appid application id
+ * @retval NULL : sub display application nothing
+ * @retval not NULL : appid
+ */
+/*--------------------------------------------------------------------------*/
+const char*
+CicoHomeScreen::GetSubDisplayAppid(void)
+{
+ if (NULL == sub_display_appinfo) {
+ return NULL;
+ }
+ const char* pR = sub_display_appinfo->GetAppId();
+ if ((NULL == pR) || (0 == pR) || (0 == strlen(pR))) {
+ return NULL;
+ }
+ return pR;
+}
+/*--------------------------------------------------------------------------*/
+/**
* @brief CicoHomeScreen::ExecuteApp_i
* execute and showing application
*
void
CicoHomeScreen::ExecuteApp_i(const char *appid)
{
+ ICO_TRA("start %s", appid);
CicoHSAppInfo *appinfo = GetAppInfo(appid);
if (appinfo == NULL) {
+ ICO_TRA("end get appinfo is NULL");
return;
}
-
- if (appinfo->GetStatus() == false) {
- //execute
- appinfo->Execute();
- ICO_DBG("CicoHomeScreen::ExecuteApp_i: execute app %s",appid);
- }
- else {
- //raise
- RaiseApplicationWindow(appinfo->GetAppId(),appinfo->GetLastSurface());
- ICO_DBG("CicoHomeScreen::ExecuteApp_i: raise app %s",appid);
- m_appHis->moveHistoryHead(appid);
+ if (sub_display_appinfo != appinfo) {
+ if (appinfo->GetStatus() == false) {
+ //execute
+ appinfo->Execute();
+ ICO_DBG("execute app %s", appid);
+ }
+ else {
+ //raise
+ if (m_appHis) {
+ const string& wapp = m_appHis->getSelectApp();
+ if (false == wapp.empty()) {
+ cancelWaitActivation(wapp);
+ }
+ }
+ RaiseApplicationWindow(appinfo->GetAppId(),
+ appinfo->GetLastSurface());
+ ICO_DBG("raise app %s", appid);
+ m_appHis->moveHistoryHead(appid);
+ }
}
/* hide HomeScreen layer */
if (GetMode() == ICO_HS_MODE_MENU) {
ChangeMode(ICO_HS_SHOW_HIDE_PATTERN_FADE);
}
+ ICO_TRA("end");
}
/*--------------------------------------------------------------------------*/
#if 0
ico_syc_show(win_info->appid, win_info->surface, &animation);
#else
- const string& lastStartupApp = m_appHis->lastStartupApp();
+ const string& lastStartupApp = m_appHis->getLastStartupAppid();
if (true == lastStartupApp.empty()) {
ICO_DBG("show (empty) %s", win_info->appid);
ico_syc_show(win_info->appid, win_info->surface, &animation);
}
- else if (0 == lastStartupApp.compare(win_info->appid)) {
- ICO_DBG("show (last) %s", win_info->appid);
- ico_syc_show(win_info->appid, win_info->surface, &animation);
- }
else {
- ICO_DBG("hide (no last) %s", win_info->appid);
- ico_syc_hide(win_info->appid, win_info->surface, &animation);
+ bool bShow = false;
+#if 0
+ const string& subDispApp = m_appHis->getSubDispAppid();
+#endif
+ if (0 == lastStartupApp.compare(win_info->appid)) {
+ bShow = true;
+ }
+#if 0
+ if (0 == subDispApp.compare(win_info->appid)) {
+ bShow = true;
+ }
+#endif
+ if (true == bShow) {
+ ICO_DBG("show (last) %s", win_info->appid);
+ ico_syc_show(win_info->appid, win_info->surface, &animation);
+ }
+ else {
+ ICO_DBG("hide (no last) %s", win_info->appid);
+ ico_syc_hide(win_info->appid, win_info->surface, &animation);
+ }
}
#endif
ICO_DBG("CicoHomeScreen::ShowApplicationWindow Leave");
/*--------------------------------------------------------------------------*/
void
CicoHomeScreen::InitializeAppHistory(const string& user, const string& path,
+ const string& pathD,
const string& flagpath)
{
ICO_DBG("start %s, %s, %s", user.c_str(), path.c_str(), flagpath.c_str());
ICO_DBG("end");
return;
}
- m_appHis = new CicoHSAppHistoryExt(user, path, flagpath);
+ m_appHis = new CicoHSAppHistoryExt(user, path, pathD, flagpath);
m_appHis->force_flagoff();
+ m_appHis->setHomeScreen(this);
const char* val;
val = config->ConfigGetString(ICO_HS_CONFIG_HISTORY,
hs_instance->flick_input_windows[idx]->Show();
}
hs_instance->SetMode(ICO_HS_MODE_APPLICATION);
+ CicoHSAppInfo *appinfo = hs_instance->GetActiveAppInfo();
+ if (NULL != appinfo) {
+ ico_syc_change_active(appinfo->GetAppId(), appinfo->GetLastSurface());
+ }
}
else if (hs_instance->GetMode() ==ICO_HS_MODE_APPLICATION) {
ico_syc_animation_t animation;
* @return none
*/
/*--------------------------------------------------------------------------*/
-void CicoHomeScreen::startupCheckAdd(int pid, const std::string& appid)
+void CicoHomeScreen::startupCheckAdd(int pid, const std::string& appid,
+ bool bSubDisp)
{
if (NULL != m_appHis) {
- m_appHis->startupCheckAdd(pid, appid);
+ m_appHis->startupCheckAdd(pid, appid, bSubDisp);
}
}
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief CicoHomeScreen::startupCheck
+ * start-up application check
+ *
+ * @param[in] appid check target
+ */
+/*--------------------------------------------------------------------------*/
void CicoHomeScreen::startupCheck(const char* appid)
{
- ICO_DBG("start");
+ ICO_TRA("start");
if (NULL == life_cycle_controller) {
- ICO_DBG("end");
+ ICO_TRA("end");
return;
}
if (NULL == m_appHis) {
- ICO_DBG("end");
+ ICO_TRA("end");
return;
}
if (false == m_appHis->isStartupChecking()) {
- ICO_DBG("end");
+ ICO_TRA("end");
return;
}
m_appHis->update_appid();
vector<int> pids;
life_cycle_controller->getPIDs(appid, pids);
if (0 == pids.size()) {
- ICO_DBG("end");
+ ICO_TRA("end");
return;
}
vector<int>::iterator it = pids.begin();
++it;
}
if (false == m_appHis->isFinish()) {
- ICO_DBG("end");
+ ICO_TRA("end");
return;
}
+ finishStartup();
+ ICO_TRA("end");
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief CicoHomeScreen::finishStartup
+ * start-up application check
+ *
+ * @param[in] appid check target
+ */
+/*--------------------------------------------------------------------------*/
+
+void CicoHomeScreen::finishStartup(void)
+{
+ ICO_TRA("start");
+
+ string last = m_appHis->getLastStartupAppid();
+ const string& subDisp = m_appHis->getSubDispAppid();
+
list<string> h = m_appHis->getAppHistory();
- string last = m_appHis->lastStartupApp();
- list<string>::iterator it_h = h.begin();
+ // last appid is empty then get new last appid
if (true == last.empty()) {
- list<string>::iterator it_hb = h.end();
- --it_hb;
- last = *it_hb;
+ list<string>::iterator it_h = h.begin();
+ while (it_h != h.end()) {
+ if (0 != subDisp.compare(*it_h)) {
+ last = *it_h;
+ }
+ ++it_h;
+ }
}
-
+
list<string>::reverse_iterator rit_h = h.rbegin();
while(rit_h != h.rend()) {
CicoHSAppInfo *ai = GetAppInfo((*rit_h).c_str());
{
const char* appid = ai->GetAppId();
int surface = ai->GetLastSurface();
-
- if (0 != last.compare(appid)) {
+ if ((0 != last.compare(appid)) && (0 != subDisp.compare(appid))) {
ico_syc_show(appid, surface, NULL);
ico_syc_hide(appid, surface, NULL);
}
++rit_h;
}
- CicoHSAppInfo *ai = GetAppInfo(last.c_str());
+ CicoHSAppInfo *ai = GetAppInfo(subDisp.c_str());
+ if (ai != NULL) {
+ requestChangeZone(ai);
+ }
+
+ ai = GetAppInfo(last.c_str());
if (ai != NULL) {
const char* appid = ai->GetAppId();
int surface = ai->GetLastSurface();
}
m_appHis->stopStartupCheck();
- ICO_DBG("end");
+ ICO_TRA("end");
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief CicoHomeScreen::readStartupApp
+ * read start-up application data
+ *
+ * @param[in] appid check target
+ */
+/*--------------------------------------------------------------------------*/
+void CicoHomeScreen::readStartupApp(std::vector<pairAppidSubd>& apps)
+{
+ ICO_DBG("start");
+ if (NULL == m_appHis) {
+ apps.clear();
+ }
+ else {
+ m_appHis->readAppHistory(apps);
+ }
+ ICO_DBG("end (%d)", (int)apps.size());
+ return;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief CicoHomeScreen::cancelWaitActivation
+ * cancel wait Activation time out(Swipe move operate)
+ *
+ * @param app appid
+ * @param bOldShow true is home appid show / false is no show
+ */
+/*--------------------------------------------------------------------------*/
+void CicoHomeScreen::cancelWaitActivation(const std::string& app)
+{
+ const char* appid = app.c_str();
+ ICO_TRA("start %s", appid);
+ CicoHSAppInfo *ai = GetAppInfo(appid);
+ if (NULL == ai) {
+ ICO_DBG("end %d", appid);
+ return;
+ }
+ int surface = ai->GetLastSurface();
+ ico_syc_hide(appid, surface, NULL);
+ ICO_TRA("end");
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief CicoHomeScreen::requestWaitActivation
+ * request wait Activation time out(Swipe move operate)
+ *
+ * @param app appid
+ */
+/*--------------------------------------------------------------------------*/
+void CicoHomeScreen::requestWaitActivation(const std::string& app)
+{
+ const char* appid = app.c_str();
+ ICO_TRA("start %s", appid);
+ CicoHSAppInfo *ai = GetAppInfo(appid);
+ if (NULL == ai) {
+ ICO_DBG("end %d", appid);
+ return;
+ }
+ int surface = ai->GetLastSurface();
+ ico_syc_change_active(appid, surface);
+ ICO_TRA("end");
}
// vim: set expandtab ts=4 sw=4:
#include "CicoSCSystemConfig.h"
#include "CicoSCLifeCycleController.h"
+#include "CicoHSAppHistory.h"
#include "CicoHSAppHistoryExt.h"
/* display position and size */
~CicoHomeScreen(void);
int Initialize(int orientation,CicoHomeScreenConfig *config);
void InitializeAppHistory(const std::string& user, const std::string& path,
+ const std::string& pathD,
const std::string& flagpath);
void Finalize(void);
int StartRelations();
static bool GetAppStatus(const char *appid);
void ChangeActive(const char *appid, int surface);
static void ChangeZone(void);
+ void requestChangeZone(CicoHSAppInfo* appinfo);
static CicoHSAppInfo *GetAppInfo(const char *appid);
void SetMode(int mode);
int GetMode(void);
// update current sub displaye applicatin information
void SetSubDisplayAppInfo(const char *appid);
CicoHSAppInfo* GetSubDisplayAppInfo(void);
+ const char* GetSubDisplayAppid(void);
// order of the start-up window
- void startupCheckAdd(int pid, const std::string& appid);
+ void startupCheckAdd(int pid, const std::string& appid,
+ bool bSubDisp = false);
void startupCheck(const char* appid);
-
+ void finishStartup(void);
+ void readStartupApp(std::vector<pairAppidSubd>& apps);
+ void cancelWaitActivation(const std::string& app);
+ void requestWaitActivation(const std::string& app);
private:
int GetProcessWindow(const char *appid);
static void EventCallBack(ico_syc_ev_e event,const void* detail,void* user_data);
#define HS_LAYER_CURSOR ICO_WINDOW_MGR_V_LAYER_CURSOR
/* layer of Cursor */
+#define HS_LAYER_2NDDISP_APP 3 // second display application layer
+
/* config history name */
#define ICO_HS_CONFIG_HSTRY_KEY1 "timer"
#define ICO_HS_CONFIG_HSTRY_DEF1 "1"
#include "CicoSCConf.h"
#include "CicoSCSystemConfig.h"
#include "Cico_aul_listen_app.h"
+#include "CicoHomeScreen.h"
using namespace std;
ICO_DBG("main: create homescreen ");
/* application history class init. before call launchApps */
- home_screen->InitializeAppHistory(g_login_user_name, x.filePath, flagPath);
+ home_screen->InitializeAppHistory(g_login_user_name, x.filePath,
+ x.filePathD, flagPath);
/* application history launch */
x.hs = home_screen;
ecore_timer_add(0.01, launchApps, &x);
/*--------------------------------------------------------------------------*/
static Eina_Bool launchApps(void* data)
{
+ ICO_DBG("start");
launcApps_data_t* x = (launcApps_data_t*) data;
- ICO_DBG("launcApps start");
- string fpath(x->filePath);
- struct stat stat_buf;
- if (0 != stat(fpath.c_str(), &stat_buf)) {
- ICO_DBG("launcApps end false(%d, %s)", errno, fpath.c_str());
- fpath = x->filePathD;
- if (0 != stat(fpath.c_str(), &stat_buf)) {
- ICO_DBG("launcApps end false(%d, %s)", errno, fpath.c_str());
- return ECORE_CALLBACK_CANCEL;
- }
- }
- vector<string> apps;
- string tagApp;
- ifstream ifs(fpath.c_str());
- while(ifs >> tagApp) {
- if (true == tagApp.empty()) {
- continue;
- }
- apps.push_back(tagApp);
+ if ((NULL == x) || (NULL == x->hs)) {
+ ICO_DBG("end");
+ return ECORE_CALLBACK_CANCEL;
}
+
+ vector<pairAppidSubd> apps;
+ x->hs->readStartupApp(apps);
+
int sz = apps.size();
for (int i =sz; i > 0; i--) {
- int pid = aul_launch_app(apps[i-1].c_str(), NULL);
- ICO_DBG("aul_launch_app %d:appid(%s), pid(%d)", i, apps[i-1].c_str(), pid);
+ string appid = apps[i-1].first;
+ bool bFLAG = apps[i-1].second;
+ int pid = aul_launch_app(appid.c_str(), NULL);
+ ICO_DBG("aul_launch_app[%d]%d:%s:%d", i, pid, appid.c_str(), (int)bFLAG);
if ((0 < pid) && (NULL != x->hs)) {
- x->hs->startupCheckAdd(pid, apps[i-1]);
+ x->hs->startupCheckAdd(pid, appid, bFLAG);
}
}
- ICO_DBG("launcApps end read is %s", fpath.c_str());
+ ICO_DBG("end");
return ECORE_CALLBACK_CANCEL;
}
server->setInputCtrl(inputctrl);
server->setUserMgr(usermgr);
server->setResourceMgr(resourcemgr);
+ server->setPolicyMgr(resourcemgr->getPolicyManager());
server->startup(18081, (const char*)"ico_syc_protocol");
ret = CicoSCWayland::getInstance()->intialize();
CicoSCWayland::getInstance()->addEcoreMainWlFdHandler();
usermgr->initialize();
-
-
}
catch (const std::exception& e) {
std::cerr << e.what() << std::endl;
--- /dev/null
+export abs_builddir
+
+wayland_client_lib = -lwayland-client
+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 $(wayland_ivi_client_inc)
+AM_LDFLAGS = -module -avoid-version -rpath $(libdir) $(GLIB_LIBS)
+
+bin_PROGRAMS = \
+ ico_clear_screen \
+ ico_change_loginuser
+
+check_LTLIBRARIES = $(TESTS)
+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
+ico_change_loginuser_LDADD = $(SIMPLE_CLIENT_LIBS) $(appfw_client_lib) -lico-util
+
--- /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 Login Tool to change login user
+ *
+ * @date Sep-30-2013
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <ico_syc_common.h>
+#include <ico_syc_error.h>
+#include <ico_syc_userctl.h>
+#include <ico_log.h>
+
+/*============================================================================*/
+/* Function prototype for static(internal) functions */
+/*============================================================================*/
+static void _sysctl_callback(const ico_syc_ev_e event, const void *detail,
+ void *user_data);
+
+/*============================================================================*/
+/* Tables and Variables */
+/*============================================================================*/
+/* original stdout file discriptor */
+static FILE *org_stdout;
+/* new user name */
+static char newuser[128];
+/* program name */
+static char progname[128];
+
+/*============================================================================*/
+/* Function */
+/*============================================================================*/
+/**
+ * @brief _sysctl_callback
+ */
+static void
+_sysctl_callback(const ico_syc_ev_e event, const void *detail, void *user_data)
+{
+ ico_syc_userlist_t *userlist;
+ int i;
+
+ switch (event) {
+ case ICO_SYC_EV_USERLIST:
+ userlist = (ico_syc_userlist_t *)detail;
+
+ fprintf(org_stdout, "%s: # of users = %d\n", progname, userlist->user_num);
+ ICO_INF("%s: # of users = %d", progname, userlist->user_num);
+ for (i = 0; i < userlist->user_num; i++) {
+ if (strcmp(userlist->user_login, userlist->userlist[i])) {
+ fprintf(org_stdout, "%s:%2d. %s *\n", progname, i+1, userlist->userlist[i]);
+ ICO_INF("%s:%2d. %s *", progname, i+1, userlist->userlist[i]);
+ }
+ else {
+ fprintf(org_stdout, "%s:%2d. %s\n", progname, i+1, userlist->userlist[i]);
+ ICO_INF("%s:%2d. %s", progname, i+1, userlist->userlist[i]);
+ }
+ }
+ (void)ico_syc_disconnect();
+ ico_log_close();
+ break;
+ case ICO_SYC_EV_AUTH_FAIL:
+ fprintf(org_stdout, "%s: fail to authenticate user<%s>\n", progname, newuser);
+ ICO_ERR("%s: fail to authenticate user<%s>", progname, newuser);
+ (void)ico_syc_disconnect();
+ ico_log_close();
+ break;
+ default:
+ ICO_WRN("other event (%d)", event);
+ break;
+ }
+}
+
+/**
+ * @brief main
+ */
+int
+main(int argc, char *argv[])
+{
+ int retry;
+ int ret;
+
+ strncpy(progname, argv[0], sizeof(progname));
+ progname[sizeof(progname)-1] = 0;
+
+ /* setting the log output */
+ org_stdout = stdout;
+ ico_log_open("ico_change_loginuser");
+
+ memset(newuser, 0, sizeof(newuser));
+ if (argc > 1) {
+ strncpy(newuser, argv[1], sizeof(newuser)-1);
+ ICO_INF("%s: change user to <%s>", progname, newuser);
+ }
+ else {
+ ICO_INF("%s: user list", progname);
+ }
+
+ /* connect to SystemController */
+ ret = ico_syc_connect(_sysctl_callback, NULL);
+ if (ret != ICO_SYC_ERR_NONE) {
+ ICO_WRN("%s: ico_syc_connect failed (ret: %d)", progname, ret);
+ ico_log_close();
+ fprintf(org_stdout, "%s: ico_syc_connect failed (ret: %d)\n", progname, ret);
+ exit(1);
+ }
+ /* connect wait 200 ms */
+ for (retry = 0; retry < (200/20); retry++) {
+ /* service for conection of SystemController */
+ ico_syc_service();
+ usleep(20*1000);
+ }
+ if (argc <= 1) {
+ /* get userlist */
+ (void)ico_syc_get_userlist();
+ }
+ else {
+ /* change login user */
+ (void)ico_syc_change_user(newuser, "\0");
+ }
+
+ /* wait 300 ms */
+ for (retry = 0; retry < (300/20); retry++) {
+ /* service for send/receive */
+ ico_syc_service();
+ usleep(20*1000);
+ }
+
+ (void)ico_syc_disconnect();
+ ico_log_close();
+ 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
+ */
+
+#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_set_visible(_display->ico_window_mgr, ICO_WINDOW_MGR_V_MAINSURFACE,
+ ICO_WINDOW_MGR_VISIBLE_HIDE, ICO_WINDOW_MGR_V_NOCHANGE,
+ ICO_WINDOW_MGR_FLAGS_ANIMATION |
+ ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE);
+ }
+}
+
+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, ICO_WINDOW_MGR_V_MAINSURFACE,
+ ICO_WINDOW_MGR_ANIMATION_TYPE_HIDE|
+ ICO_WINDOW_MGR_ANIMATION_TYPE_SHOW,
+ display->animation, display->animatime);
+ ico_window_mgr_set_positionsize(display->ico_window_mgr, ICO_WINDOW_MGR_V_MAINSURFACE,
+ displayno, posx, posy,
+ ICO_WINDOW_MGR_V_NOCHANGE, ICO_WINDOW_MGR_V_NOCHANGE,
+ ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE);
+ ico_window_mgr_set_window_layer(display->ico_window_mgr, ICO_WINDOW_MGR_V_MAINSURFACE,
+ display->init_layer);
+ ico_window_mgr_set_layer_visible(display->ico_window_mgr, display->init_layer, 1);
+ ico_window_mgr_set_visible(display->ico_window_mgr, ICO_WINDOW_MGR_V_MAINSURFACE,
+ ICO_WINDOW_MGR_VISIBLE_SHOW, ICO_WINDOW_MGR_RAISE_RAISE,
+ ICO_WINDOW_MGR_FLAGS_ANIMATION |
+ ICO_WINDOW_MGR_FLAGS_NO_CONFIGURE);
+ 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_*/