diff options
author | Sung-jae Park <nicesj.park@tizendev.org> | 2013-04-10 21:06:48 +0900 |
---|---|---|
committer | Gerrit Code Review <gerrit2@kim11> | 2013-04-10 21:06:48 +0900 |
commit | a1e4f04bf2b653fbc81b8ed2ad25e1a66cd3af37 (patch) | |
tree | 02f6036f4f7d96376fa44c917730002342e5ee52 | |
parent | 85077c1577ea8dab39512ae24ecbd606d5a1e52b (diff) | |
parent | 070299ba47cd7ac64c5f82b091227d04d9c258f8 (diff) | |
download | livebox-service-a1e4f04bf2b653fbc81b8ed2ad25e1a66cd3af37.tar.gz livebox-service-a1e4f04bf2b653fbc81b8ed2ad25e1a66cd3af37.tar.bz2 livebox-service-a1e4f04bf2b653fbc81b8ed2ad25e1a66cd3af37.zip |
Merge "Sync with the private repository" into tizen_2.1
-rw-r--r-- | include/livebox-service.h | 42 | ||||
-rw-r--r-- | src/livebox-service.c | 69 |
2 files changed, 108 insertions, 3 deletions
diff --git a/include/livebox-service.h b/include/livebox-service.h index 0f4c337..2b8ffd9 100644 --- a/include/livebox-service.h +++ b/include/livebox-service.h @@ -38,6 +38,37 @@ enum livebox_size_type { LB_SIZE_TYPE_UNKNOWN = 0xFFFF, }; +enum livebox_script_event { + LB_SCRIPT_ACCESS_EVENT = 0x00001000, + LB_SCRIPT_MOUSE_EVENT = 0x00002000, + LB_SCRIPT_KEY_EVENT = 0x00004000, + + LB_SCRIPT_ACCESS_HIGHLIGHT = LB_SCRIPT_ACCESS_EVENT | 0x00000000, + LB_SCRIPT_ACCESS_HIGHLIGHT_NEXT = LB_SCRIPT_ACCESS_EVENT | 0x00000001, + LB_SCRIPT_ACCESS_HIGHLIGHT_PREV = LB_SCRIPT_ACCESS_EVENT | 0x00000002, + LB_SCRIPT_ACCESS_ACTIVATE = LB_SCRIPT_ACCESS_EVENT | 0x00000004, + LB_SCRIPT_ACCESS_VALUE_CHANGE = LB_SCRIPT_ACCESS_EVENT | 0x00000008, + LB_SCRIPT_ACCESS_SCROLL = LB_SCRIPT_ACCESS_EVENT | 0x00000010, + LB_SCRIPT_ACCESS_UNHIGHLIGHT = LB_SCRIPT_ACCESS_EVENT | 0x00000020, + + LB_SCRIPT_MOUSE_DOWN = LB_SCRIPT_MOUSE_EVENT | 0x00000000, + LB_SCRIPT_MOUSE_MOVE = LB_SCRIPT_MOUSE_EVENT | 0x00000001, + LB_SCRIPT_MOUSE_UP = LB_SCRIPT_MOUSE_EVENT | 0x00000002, + LB_SCRIPT_MOUSE_IN = LB_SCRIPT_MOUSE_EVENT | 0x00000004, + LB_SCRIPT_MOUSE_OUT = LB_SCRIPT_MOUSE_EVENT | 0x00000008, + + LB_SCRIPT_KEY_DOWN = LB_SCRIPT_KEY_EVENT | 0x00000000, + LB_SCRIPT_KEY_UP = LB_SCRIPT_KEY_EVENT | 0x00000000, +}; + +enum livebox_access_status { + LB_ACCESS_STATUS_DONE, + LB_ACCESS_STATUS_FIRST, /*!< Reach to the first item */ + LB_ACCESS_STATUS_LAST, /*!< Reach to the last item */ + LB_ACCESS_STATUS_READ, /* TTS done */ + LB_ACCESS_STATUS_ERROR, +}; + /*! * \brief * \param[in] type @@ -65,9 +96,18 @@ extern int livebox_service_mouse_event(const char *pkgid); /*! * \brief * \param[in] pkgid Livebox's appid + * \param[in] size_type + * \return true(1) / false(0) + */ +extern int livebox_service_touch_effect(const char *pkgid, int size_type); + +/*! + * \brief + * \param[in] pkgid Livebox's appid + * \param[in] size_type * \return true(1) / false(0) */ -extern int livebox_service_touch_effect(const char *pkgid); +extern int livebox_service_need_frame(const char *pkgid, int size_type); /*! * \brief diff --git a/src/livebox-service.c b/src/livebox-service.c index 3e1ae97..e29e8dd 100644 --- a/src/livebox-service.c +++ b/src/livebox-service.c @@ -856,7 +856,65 @@ out: return pkgid; } -EAPI int livebox_service_touch_effect(const char *pkgid) +EAPI int livebox_service_need_frame(const char *pkgid, int size_type) +{ + char *lbid; + sqlite3_stmt *stmt; + sqlite3 *handle; + int ret; + + handle = open_db(); + if (!handle) { + ErrPrint("Unable to open a DB\n"); + return 0; + } + + ret = sqlite3_prepare_v2(handle, "SELECT need_frame FROM box_size WHERE pkgid = ? AND size_type = ?", -1, &stmt, NULL); + if (ret != SQLITE_OK) { + ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); + close_db(handle); + return 0; + } + + /*! + */ + lbid = livebox_service_pkgname(pkgid); + if (!lbid) { + ErrPrint("Invalid appid (%s)\n", pkgid); + ret = 0; + goto out; + } + + ret = sqlite3_bind_text(stmt, 1, lbid, -1, SQLITE_TRANSIENT); + free(lbid); + if (ret != SQLITE_OK) { + ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); + ret = 0; + goto out; + } + + ret = sqlite3_bind_int(stmt, 2, size_type); + 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 = 0; + ErrPrint("There is no such result\n"); + } +out: + sqlite3_reset(stmt); + sqlite3_finalize(stmt); + close_db(handle); + return ret; +} + +EAPI int livebox_service_touch_effect(const char *pkgid, int size_type) { char *lbid; sqlite3_stmt *stmt; @@ -869,7 +927,7 @@ EAPI int livebox_service_touch_effect(const char *pkgid) return 1; } - ret = sqlite3_prepare_v2(handle, "SELECT touch_effect FROM client WHERE pkgid = ?", -1, &stmt, NULL); + ret = sqlite3_prepare_v2(handle, "SELECT touch_effect FROM box_size WHERE pkgid = ? AND size_type = ?", -1, &stmt, NULL); if (ret != SQLITE_OK) { ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); close_db(handle); @@ -897,6 +955,13 @@ EAPI int livebox_service_touch_effect(const char *pkgid) goto out; } + ret = sqlite3_bind_int(stmt, 2, size_type); + if (ret != SQLITE_OK) { + ErrPrint("Error: %s\n", sqlite3_errmsg(handle)); + ret = 1; + goto out; + } + ret = sqlite3_step(stmt); if (ret == SQLITE_ROW) { ret = !!sqlite3_column_int(stmt, 0); |