summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-03-04 11:03:28 +0000
committerSung-jae Park <nicesj.park@samsung.com>2013-03-04 11:03:28 +0000
commit49e43deacc97f47dbb58b1449a672d2f3ceb247c (patch)
tree1ff88bf3bb6d539f0a8cc77915188e95acbb570a
parentc97fd16a6c48a3832415a9cdd587b642721113bd (diff)
downloadprovider-49e43deacc97f47dbb58b1449a672d2f3ceb247c.tar.gz
provider-49e43deacc97f47dbb58b1449a672d2f3ceb247c.tar.bz2
provider-49e43deacc97f47dbb58b1449a672d2f3ceb247c.zip
Add PD move event
Change-Id: I4751496b4921f49238b31d600a9fd8280e100277
-rw-r--r--include/provider.h14
-rw-r--r--packaging/libprovider.spec2
-rw-r--r--src/provider.c27
3 files changed, 40 insertions, 3 deletions
diff --git a/include/provider.h b/include/provider.h
index 2e196cf..5046cec 100644
--- a/include/provider.h
+++ b/include/provider.h
@@ -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 X position of a livebox from this PD */
+ double y; /*!< Relative Y 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
diff --git a/packaging/libprovider.spec b/packaging/libprovider.spec
index 2b6ab72..cc7c84c 100644
--- a/packaging/libprovider.spec
+++ b/packaging/libprovider.spec
@@ -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
diff --git a/src/provider.c b/src/provider.c
index 5afe4dc..4636c4d 100644
--- a/src/provider.c
+++ b/src/provider.c
@@ -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,
},