From c09057943cccdb625a9c61a42d9b6ecb5bd6dd1e Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Thu, 31 Jan 2013 02:30:36 +0000 Subject: [PATCH] Add touch_effect retrieve function. Change-Id: I2eed2487e4a1035487e7492ba6c6085b610e439f --- include/livebox-service.h | 6 ++++++ packaging/liblivebox-service.spec | 2 +- src/livebox-service.c | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/include/livebox-service.h b/include/livebox-service.h index ada9b53..fcf77d9 100644 --- a/include/livebox-service.h +++ b/include/livebox-service.h @@ -59,6 +59,12 @@ extern int livebox_service_size_type(int width, int height); extern int livebox_service_mouse_event(const char *pkgid); /*! + * \param[in] pkgid Livebox's appid + * \return true(1) / false(0) + */ +extern int livebox_service_touch_effect(const char *pkgid); + +/*! */ extern int livebox_service_trigger_update(const char *pkgname, const char *cluster, const char *category); diff --git a/packaging/liblivebox-service.spec b/packaging/liblivebox-service.spec index abda310..24067a9 100644 --- a/packaging/liblivebox-service.spec +++ b/packaging/liblivebox-service.spec @@ -1,6 +1,6 @@ Name: liblivebox-service Summary: Service API for gathering installed livebox information. -Version: 0.3.1 +Version: 0.3.2 Release: 1 Group: framework/livebox License: Flora License diff --git a/src/livebox-service.c b/src/livebox-service.c index 85fc4c0..0e39885 100644 --- a/src/livebox-service.c +++ b/src/livebox-service.c @@ -746,6 +746,43 @@ out: return ret; } +EAPI int livebox_service_touch_effect(const char *pkgid) +{ + sqlite3_stmt *stmt; + sqlite3 *handle; + int ret; + + handle = open_db(); + if (!handle) + return 0; + + ret = sqlite3_prepare_v2(handle, "SELECT touch_effect FROM client WHERE pkgid = ?", -1, &stmt, NULL); + if (ret != SQLITE_OK) { + ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); + close_db(handle); + return 0; + } + + ret = sqlite3_bind_text(stmt, 1, pkgid, -1, NULL); + if (ret != SQLITE_OK) { + ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); + ret = 0; + goto out; + } + + ret = sqlite3_step(stmt); + if (ret == SQLITE_ROW) + ret = !!sqlite3_column_int(stmt, 0); + else + ret = 1; + +out: + sqlite3_reset(stmt); + sqlite3_finalize(stmt); + close_db(handle); + return ret; +} + EAPI int livebox_service_mouse_event(const char *pkgid) { sqlite3_stmt *stmt; -- 2.7.4