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

include/livebox.h
live.viewer/src/lb.c
packaging/liblivebox-viewer.spec
src/livebox.c

index cfb3068..1b3d711 100644 (file)
@@ -520,6 +520,15 @@ extern int livebox_create_pd(struct livebox *handler, ret_cb_t cb, void *data);
 extern int livebox_create_pd_with_position(struct livebox *handler, double x, double y, ret_cb_t cb, void *data);
 
 /*!
+ * \brief PD position is updated.
+ * \param[in] handler
+ * \param[in] x 0.0 ~ 1.0
+ * \param[in] y 0.0 ~ 1.0
+ * \return int 0 if succeed to send request for updating position of the PD.
+ */
+extern int livebox_move_pd(struct livebox *handler, double x, double y);
+
+/*!
  * \brief Destroy the PD of given handler if it is created.
  * \param[in] handler
  * \param[in] cb
index 0ad95cd..cbe928b 100644 (file)
@@ -82,7 +82,7 @@ static int update_pd_canvas(struct livebox *handle, Evas_Object *image)
                        data = livebox_acquire_pdfb(handle);
                        if (data) {
                                evas_object_image_data_set(image, NULL);
-                               evas_object_image_colorspace_set(canvas, EVAS_COLORSPACE_ARGB8888);
+                               evas_object_image_colorspace_set(image, EVAS_COLORSPACE_ARGB8888);
                                evas_object_image_alpha_set(image, EINA_TRUE);
                                evas_object_image_size_set(image, w, h);
                                evas_object_image_smooth_scale_set(image, EINA_TRUE);
index dfbaa3d..f24782d 100644 (file)
@@ -1,6 +1,6 @@
 Name: liblivebox-viewer
 Summary: Library for developing the application.
-Version: 0.9.8
+Version: 0.9.9
 Release: 1
 Group: framework/livebox
 License: Flora License
index 6ca3adc..3356ac6 100644 (file)
@@ -1019,6 +1019,34 @@ EAPI int livebox_create_pd_with_position(struct livebox *handler, double x, doub
        return master_rpc_async_request(handler, packet, 0, pd_create_cb, create_cb_info(cb, data));
 }
 
+EAPI int livebox_move_pd(struct livebox *handler, double x, double y)
+{
+       struct packet *packet;
+
+       if (!handler) {
+               ErrPrint("Handler is NIL\n");
+               return -EINVAL;
+       }
+
+       if (!handler->pd.data.fb || handler->state != CREATE || !handler->id) {
+               ErrPrint("Handler is not valid\n");
+               return -EINVAL;
+       }
+
+       if (!handler->is_pd_created) {
+               DbgPrint("PD is not created\n");
+               return -EINVAL;
+       }
+
+       packet = packet_create_noack("pd_move", "ssdd", handler->pkgname, handler->id, x, y);
+       if (!packet) {
+               ErrPrint("Failed to build param\n");
+               return -EFAULT;
+       }
+
+       return master_rpc_request_only(handler, packet);
+}
+
 EAPI int livebox_activate(const char *pkgname, ret_cb_t cb, void *data)
 {
        struct packet *packet;