Add mouse_event attribute
authorSung-jae Park <nicesj.park@samsung.com>
Wed, 23 Jan 2013 03:07:28 +0000 (03:07 +0000)
committerSung-jae Park <nicesj.park@samsung.com>
Wed, 23 Jan 2013 03:07:28 +0000 (03:07 +0000)
Change-Id: I53537eb3816a0b35b89a3509758a1d64df101f79

include/livebox-service.h
packaging/liblivebox-service.spec
src/livebox-service.c

index f9f8383..7fdd3f0 100644 (file)
@@ -38,6 +38,7 @@ enum livebox_size_type {
  * \param[in] type
  * \param[out] width
  * \param[out] height
+ * \return 0 for success
  */
 extern int livebox_service_get_size(int type, int *width, int *height);
 
@@ -49,6 +50,12 @@ extern int livebox_service_get_size(int type, int *width, int *height);
 extern int livebox_service_size_type(int width, int height);
 
 /*!
+ * \param[in] pkgid Livebox's appid
+ * \return true(1) / false(0)
+ */
+extern int livebox_service_mouse_event(const char *pkgid);
+
+/*!
  */
 extern int livebox_service_trigger_update(const char *pkgname, const char *cluster, const char *category);
 
index 1205bcf..df9690f 100644 (file)
@@ -1,6 +1,6 @@
 Name: liblivebox-service
 Summary: Library for the development of a livebox service
-Version: 0.2.10
+Version: 0.2.11
 Release: 1
 Group: main/app
 License: Flora License
index 292834f..1632389 100644 (file)
@@ -725,6 +725,43 @@ out:
        return ret;
 }
 
+EAPI int livebox_service_mouse_event(const char *pkgid)
+{
+       sqlite3_stmt *stmt;
+       sqlite3 *handle;
+       int ret;
+
+       handle = open_db();
+       if (!handle)
+               return 0;
+
+       ret = sqlite3_prepare_v2(handle, "SELECT mouse_event 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 = 0;
+
+out:
+       sqlite3_reset(stmt);
+       sqlite3_finalize(stmt);
+       close_db(handle);
+       return ret;
+}
+
 EAPI char *livebox_service_preview(const char *pkgid, int size_type)
 {
        sqlite3_stmt *stmt;