Proccessing errors sended by EOM server 46/81846/2
authorRoman Peresipkyn <r.peresipkyn@samsung.com>
Thu, 28 Jul 2016 15:03:36 +0000 (18:03 +0300)
committerRoman Peresipkyn <r.peresipkyn@samsung.com>
Fri, 29 Jul 2016 10:38:43 +0000 (13:38 +0300)
Change-Id: I6d7a34602fcc8dd97e4e10bbfea133f058e6526d
Signed-off-by: Roman Peresipkyn <r.peresipkyn@samsung.com>
src/wayland/eom-wayland.c
src/wayland/protocol/eom-client-protocol.h
src/wayland/protocol/eom-protocol.c
src/wayland/protocol/eom.xml

index bb43799..30d81bd 100644 (file)
@@ -83,6 +83,7 @@ typedef struct _EomWaylandOutput {
        enum wl_eom_mode eom_mode;
        enum wl_eom_attribute eom_attribute;
        enum wl_eom_attribute_state eom_attribute_state;
+       enum wl_eom_error error;
 
        /* client info */
        EomWaylandClientInfo *client_info;
@@ -539,6 +540,7 @@ _eom_wl_eom_output_info(void *data,
        eom_wl_output->physical_height = h_mm;
        eom_wl_output->eom_status = connection;
        eom_wl_output->client_info = &wl_client_info;
+       eom_wl_output->error = WL_EOM_ERROR_NONE;
 
        wl_list_insert(&eom_client_info->eom_wl_output_list, &eom_wl_output->link);
 }
@@ -629,7 +631,28 @@ _eom_wl_eom_output_attribute(void *data,
                _eom_wayland_client_call_notify(eom_wl_output,
                        EOM_OUTPUT_NOTIFY_ATTRIBUTE_CHANGED);
        }
+
+       eom_wl_output->error = error;
 }
+
+static void
+_eom_wl_eom_output_set_window(void *data,
+                        struct wl_eom *wl_eom,
+                        uint32_t output_id,
+                        uint32_t error)
+{
+       EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *)data;
+       EomWaylandOutput *eom_wl_output = NULL;
+
+       INFO("SET_WINODW - id : %d, error : %d\n", output_id, error);
+
+       eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
+               &eom_client_info->eom_wl_output_list, output_id);
+       RET_IF_FAIL(eom_wl_output != NULL);
+
+       eom_wl_output->error = error;
+}
+
 /*LCOV_EXCL_STOP*/
 static const struct wl_eom_listener eom_wl_eom_listener = {
        _eom_wl_eom_output_count,
@@ -637,6 +660,7 @@ static const struct wl_eom_listener eom_wl_eom_listener = {
        _eom_wl_eom_output_type,
        _eom_wl_eom_output_mode,
        _eom_wl_eom_output_attribute,
+       _eom_wl_eom_output_set_window,
 };
 
 
@@ -932,7 +956,8 @@ eom_wayland_client_set_attribute(eom_output_id output_id,
        wl_display_dispatch(wl_client_info.display);
        wl_display_roundtrip(wl_client_info.display);
 
-       ret = 1;
+       if (eom_wl_output->error == WL_EOM_ERROR_NONE)
+               ret = 1;
 
        array = g_array_new(FALSE, FALSE, sizeof(GValue));
        g_value_init(&v, G_TYPE_INT);
@@ -984,7 +1009,15 @@ eom_wayland_client_set_window(eom_output_id output_id, Evas_Object *win)
                }
        }
 
-       ret = 1;
+       /* TODO:
+         * wait for the result of set_window.
+         * this should be the blocking call.
+         */
+       wl_display_dispatch(wl_client_info.display);
+       wl_display_roundtrip(wl_client_info.display);
+
+       if (eom_wl_output->error == WL_EOM_ERROR_NONE)
+               ret = 1;
 
        array = g_array_new(FALSE, FALSE, sizeof(GValue));
        g_value_init(&v, G_TYPE_INT);
index e2c812a..3fca4db 100644 (file)
@@ -152,6 +152,7 @@ enum wl_eom_attribute_state {
  * @output_type: (none)
  * @output_mode: (none)
  * @output_attribute: (none)
+ * @output_set_window: (none)
  *
  * ***** TODO ******
  */
@@ -217,6 +218,15 @@ struct wl_eom_listener {
                                 uint32_t attribute,
                                 uint32_t attribute_state,
                                 uint32_t error);
+       /**
+        * output_set_window - (none)
+        * @output_id: (none)
+        * @error: (none)
+        */
+       void (*output_set_window)(void *data,
+                                 struct wl_eom *wl_eom,
+                                 uint32_t output_id,
+                                 uint32_t error);
 };
 /*LCOV_EXCL_START*/
 static inline int
index 3db1593..c032027 100644 (file)
@@ -33,11 +33,12 @@ static const struct wl_message wl_eom_events[] = {
        { "output_type", "uuu", types + 0 },
        { "output_mode", "uu", types + 0 },
        { "output_attribute", "uuuu", types + 0 },
+       { "output_set_window", "uu", types + 0 },
 };
 
 WL_EXPORT const struct wl_interface wl_eom_interface = {
        "wl_eom", 1,
        4, wl_eom_requests,
-       5, wl_eom_events,
+       6, wl_eom_events,
 };
 
index 32c4ed6..2397a57 100644 (file)
       <arg name="error" type="uint"/>
     </event>
 
+    <event name="output_set_window">
+      <arg name="output_id" type="uint"/>
+      <arg name="error" type="uint"/>
+    </event>
+
   </interface>
 </protocol>