Implement the body of orientation notify API
authorSung-jae Park <nicesj.park@samsung.com>
Tue, 21 Apr 2015 11:46:23 +0000 (20:46 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Tue, 21 Apr 2015 11:46:23 +0000 (20:46 +0900)
[model] Redwood,Kiran,B3(Wearable)
[binary_type] AP
[customer] Docomo/Orange/ATT/Open
[issue#] N/A
[problem]
[cause]
[solution]
[team] HomeTF
[request]
[horizontal_expansion]

Change-Id: If6151e8cac387f86a6c05a4778d43650684e7a02

widget_viewer/include/widget_viewer.h
widget_viewer/src/widget.c
widget_viewer_evas/src/widget_viewer_evas.c

index ba2cc84..142d4a4 100755 (executable)
@@ -1625,6 +1625,9 @@ extern int widget_viewer_set_auto_launch_handler(widget_auto_launch_handler_cb c
 extern int widget_viewer_get_affected_extra_buffer(widget_h handle, int gbar, int *idx, unsigned int *resource_id);
 
 extern int widget_viewer_get_instance_id(widget_h handle, char **instance_id);
+
+extern int widget_viewer_notify_orientation_of_viewer(int orientation);
+
 /**
  * @}
  */
index 70a8279..58c5db7 100755 (executable)
@@ -3943,6 +3943,25 @@ EAPI int widget_viewer_notify_resumed_status_of_viewer(void)
        return master_rpc_request_only(NULL, packet);
 }
 
+EAPI int widget_viewer_notify_orientation_of_viewer(int orientation)
+{
+       struct packet *packet;
+       unsigned int cmd = CMD_ORIENTATION;
+
+       if (orientation < 0 || orientation > 360) {
+               ErrPrint("Invalid parameter: %d\n", orientation);
+               return WIDGET_ERROR_INVALID_PARAMETER;
+       }
+
+       packet = packet_create_noack((const char *)&cmd, "di", util_timestamp(), orientation);
+       if (!packet) {
+               ErrPrint("Failed to create a orientation packet\n");
+               return WIDGET_ERROR_FAULT;
+       }
+
+       return master_rpc_request_only(NULL, packet);
+}
+
 EAPI int widget_viewer_sync_buffer(widget_h handle, int gbar)
 {
        if (!handle || handle->state != WIDGET_STATE_CREATE) {
index 52c4e02..4279dff 100755 (executable)
@@ -6086,7 +6086,7 @@ EAPI int widget_viewer_evas_notify_paused_status_of_viewer(void)
 
 EAPI int widget_viewer_evas_notify_orientation_of_viewer(int orientation)
 {
-       return WIDGET_ERROR_NOT_SUPPORTED;
+       return widget_viewer_notify_orientation_of_viewer(orientation);
 }
 
 EAPI Evas_Object *widget_viewer_evas_add_widget(Evas_Object *parent, const char *widget_id, const char *content_info, double period)