Add PD move event
authorSung-jae Park <nicesj.park@samsung.com>
Mon, 4 Mar 2013 11:03:28 +0000 (11:03 +0000)
committerSung-jae Park <nicesj.park@samsung.com>
Mon, 4 Mar 2013 11:03:28 +0000 (11:03 +0000)
Change-Id: I4751496b4921f49238b31d600a9fd8280e100277

include/provider.h
packaging/libprovider.spec
src/provider.c

index 2e196cf..5046cec 100644 (file)
@@ -73,6 +73,7 @@ struct event_arg {
 
                EVENT_PD_CREATE, /*!< Only for the buffer type */
                EVENT_PD_DESTROY, /*!< Only for the buffer type */
+               EVENT_PD_MOVE, /*!< Only for the buffer type */
 
                EVENT_LB_PAUSE, /*!< Freeze the update timer of a specified livebox */
                EVENT_LB_RESUME, /*!< Thaw the update timer of a specified livebox */
@@ -88,14 +89,22 @@ struct event_arg {
                        int w; /*!< PD buffer is created with width "w" */
                        int h; /*!< PD buffer is created with height "h" */
 
-                       double x; /*!< Relative position of a livebox from this PD */
-                       double y; /*!< Relative position of a livebox from this PD */
+                       double x; /*!< Relative position of a livebox from this PD */
+                       double y; /*!< Relative position of a livebox from this PD */
                } pd_create;
 
                struct {
                } pd_destroy;
 
                struct {
+                       int w; /*!< PD buffer width */
+                       int h; /*!< PD buffer height */
+
+                       double x; /*!< Relative X position of a livebox from this PD */
+                       double y; /*!< Relative Y position of a livebox from this PD */
+               } pd_move;
+
+               struct {
                        const char *content; /*!< Content info */
                        int timeout; /*!< Timeout */
                        int has_script; /*!< Livebox has script (buffer is created from the master) */
@@ -239,6 +248,7 @@ struct event_handler {
         */
        int (*pd_create)(struct event_arg *arg, void *data);
        int (*pd_destroy)(struct event_arg *arg, void *data);
+       int (*pd_move)(struct event_arg *arg, void *data);
 
        /*!
         * \note
index 2b6ab72..cc7c84c 100644 (file)
@@ -1,6 +1,6 @@
 Name: libprovider
 Summary: Library for developing the livebox service provider.
-Version: 0.5.14
+Version: 0.5.15
 Release: 1
 Group: framework/livebox
 License: Flora License
index 5afe4dc..4636c4d 100644 (file)
@@ -538,6 +538,29 @@ out:
        return NULL;
 }
 
+struct packet *master_pd_move(pid_t pid, int handle, const struct packet *packet)
+{
+       struct event_arg arg;
+       int ret;
+
+       ret = packet_get(packet, "ssiidd", &arg.pkgname, &arg.id, &arg.info.pd_move.w, &arg.info.pd_move.h, &arg.info.pd_move.x, &arg.info.pd_move.y);
+       if (ret != 6) {
+               ErrPrint("Invalid packet\n");
+               ret = -EINVAL;
+               goto out;
+       }
+
+       arg.type = EVENT_PD_MOVE;
+
+       if (s_info.table.pd_move)
+               ret = s_info.table.pd_move(&arg, s_info.data);
+       else
+               ret = -ENOSYS;
+
+out:
+       return NULL;
+}
+
 struct packet *master_pd_destroy(pid_t pid, int handle, const struct packet *packet)
 {
        struct event_arg arg;
@@ -788,6 +811,10 @@ static struct method s_table[] = {
                .handler = master_pd_destroy,
        },
        {
+               .cmd = "pd_move",
+               .handler = master_pd_move,
+       },
+       {
                .cmd = "pd_mouse_up",
                .handler = provider_buffer_pd_mouse_up,
        },