Add touch effect.
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 31 Jan 2013 02:28:59 +0000 (02:28 +0000)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 31 Jan 2013 02:28:59 +0000 (02:28 +0000)
Change-Id: I1d590814d5169e6e6a62832206e2e0689c36590c

packaging/com.samsung.data-provider-master.spec
pkgmgr_livebox/livebox.xml
pkgmgr_livebox/src/service_register.c

index 5bc2a37..4cd25f1 100644 (file)
@@ -1,6 +1,6 @@
 Name: com.samsung.data-provider-master
 Summary: Master service provider for liveboxes.
-Version: 0.15.2
+Version: 0.15.3
 Release: 1
 Group: framework/livebox
 License: Flora License
index 4a4d440..8c436dd 100644 (file)
@@ -12,7 +12,7 @@
 
        <setup>com.samsung.nicesj</setup>
 
-       <box type="image" mouse_event="false">
+       <box type="image" mouse_event="false" touch_effect="true">
                <size preview="ABSPATH">1x1</size>
                <size preview="ABSPATH">2x1</size>
                <size>2x2</size>
index a89a0db..786e9ba 100644 (file)
  *
  *
  * client
- * +-------+------+---------+-------------+---------+---------+-----------+-------+-------------+
- * | pkgid | Icon |  Name   | auto_launch | pd_size | content | nodisplay | setup | mouse_event |
- * +-------+------+---------+-------------+---------+---------+-----------+-------+-------------+
- * |   -   |   -  |    -    |      -      |    -    |    -    |     -     |   -   |      -      }
- * +-------+------+---------+-------------+---------+---------+-----------+-------+-------------+
- * CREATE TABLE client ( pkgid TEXT PRIMARY KEY NOT NULL, icon TEXT, name TEXT, auto_launch TEXT, pd_size TEXT, content TEXT DEFAULT "default", nodisplay INTEGER, setup TEXT, mouse_event INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) )
+ * +-------+------+---------+-------------+---------+---------+-----------+-------+-------------+--------------+
+ * | pkgid | Icon |  Name   | auto_launch | pd_size | content | nodisplay | setup | mouse_event | touch_effect |
+ * +-------+------+---------+-------------+---------+---------+-----------+-------+-------------+--------------+
+ * |   -   |   -  |    -    |      -      |    -    |    -    |     -     |   -   |      -      }       -      |
+ * +-------+------+---------+-------------+---------+---------+-----------+-------+-------------+--------------+
+ * CREATE TABLE client ( pkgid TEXT PRIMARY KEY NOT NULL, icon TEXT, name TEXT, auto_launch TEXT, pd_size TEXT, content TEXT DEFAULT "default", nodisplay INTEGER, setup TEXT, mouse_event INTEGER, touch_effect INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) )
  *
  * = auto_launch = UI-APPID
  * = pd_size = WIDTHxHEIGHT
@@ -170,6 +170,7 @@ struct livebox {
        int primary; /* Is this primary livebox? */
        int nodisplay;
        int mouse_event; /* Mouse event processing option for livebox */
+       int touch_effect; /* Touch effect of a livebox */
 
        enum lb_type lb_type;
        xmlChar *lb_src;
@@ -600,7 +601,7 @@ static inline int db_create_client(void)
 
        ddl = "CREATE TABLE client (" \
                "pkgid TEXT PRIMARY KEY NOT NULL, icon TEXT, name TEXT, " \
-               "auto_launch TEXT, pd_size TEXT, content TEXT DEFAULT 'default', nodisplay INTEGER, setup TEXT, mouse_event INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE)";
+               "auto_launch TEXT, pd_size TEXT, content TEXT DEFAULT 'default', nodisplay INTEGER, setup TEXT, mouse_event INTEGER, touch_effect INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE)";
        if (sqlite3_exec(s_info.handle, ddl, NULL, NULL, &err) != SQLITE_OK) {
                ErrPrint("Failed to execute the DDL (%s)\n", err);
                return -EIO;
@@ -618,7 +619,7 @@ static inline int db_insert_client(struct livebox *livebox)
        int ret;
        sqlite3_stmt *stmt;
 
-       dml = "INSERT INTO client ( pkgid, icon, name, auto_launch, pd_size, content, nodisplay, setup, mouse_event ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
+       dml = "INSERT INTO client ( pkgid, icon, name, auto_launch, pd_size, content, nodisplay, setup, mouse_event, touch_effect ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
        ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
                DbgPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
@@ -688,6 +689,13 @@ static inline int db_insert_client(struct livebox *livebox)
                goto out;
        }
 
+       ret = sqlite3_bind_int(stmt, 10, livebox->touch_effect);
+       if (ret != SQLITE_OK) {
+               DbgPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
+               ret = -EIO;
+               goto out;
+       }
+
        ret = 0;
        if (sqlite3_step(stmt) != SQLITE_DONE) {
                DbgPrint("Error: %s\n", sqlite3_errmsg(s_info.handle));
@@ -1707,6 +1715,20 @@ static inline void update_box(struct livebox *livebox, xmlNodePtr node)
                }
        }
 
+       if (!xmlHasProp(node, (const xmlChar *)"touch_effect")) {
+               livebox->touch_effect = 1;
+       } else {
+               xmlChar *touch_effect;
+               touch_effect = xmlGetProp(node, (const xmlChar *)"touch_effect");
+               if (!touch_effect) {
+                       ErrPrint("touch_effect is NIL\n");
+                       livebox->touch_effect = 1;
+               } else {
+                       livebox->touch_effect = !xmlStrcasecmp(touch_effect, (const xmlChar *)"true");
+                       xmlFree(touch_effect);
+               }
+       }
+
        for (node = node->children; node; node = node->next) {
                if (!xmlStrcasecmp(node->name, (const xmlChar *)"size")) {
                        xmlChar *size;