Send status of setting window to clietnt 45/81845/2
authorRoman Peresipkyn <r.peresipkyn@samsung.com>
Thu, 28 Jul 2016 15:00:55 +0000 (18:00 +0300)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Fri, 5 Aug 2016 01:19:41 +0000 (18:19 -0700)
Change-Id: Ic78d25499c6231e9d68671a3c05a77b24657b1e2

protocol/eom-client-protocol.h
protocol/eom-protocol.c
protocol/eom-server-protocol.h
protocol/eom.xml
src/e_mod_main.c

index 7172c5f..1fcd29d 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);
 };
 
 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 58400a7..333d0cd 100644 (file)
@@ -196,12 +196,14 @@ struct wl_eom_interface {
 #define WL_EOM_OUTPUT_TYPE     2
 #define WL_EOM_OUTPUT_MODE     3
 #define WL_EOM_OUTPUT_ATTRIBUTE        4
+#define WL_EOM_OUTPUT_SET_WINDOW       5
 
 #define WL_EOM_OUTPUT_COUNT_SINCE_VERSION      1
 #define WL_EOM_OUTPUT_INFO_SINCE_VERSION       1
 #define WL_EOM_OUTPUT_TYPE_SINCE_VERSION       1
 #define WL_EOM_OUTPUT_MODE_SINCE_VERSION       1
 #define WL_EOM_OUTPUT_ATTRIBUTE_SINCE_VERSION  1
+#define WL_EOM_OUTPUT_SET_WINDOW_SINCE_VERSION 1
 
 static inline void
 wl_eom_send_output_count(struct wl_resource *resource_, uint32_t count)
@@ -233,6 +235,12 @@ wl_eom_send_output_attribute(struct wl_resource *resource_, uint32_t output_id,
        wl_resource_post_event(resource_, WL_EOM_OUTPUT_ATTRIBUTE, output_id, attribute, attribute_state, error);
 }
 
+static inline void
+wl_eom_send_output_set_window(struct wl_resource *resource_, uint32_t output_id, uint32_t error)
+{
+       wl_resource_post_event(resource_, WL_EOM_OUTPUT_SET_WINDOW, output_id, error);
+}
+
 #ifdef  __cplusplus
 }
 #endif
index 699d499..ff50650 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>
 
index 5d193ad..37aa0e2 100644 (file)
@@ -1434,8 +1434,6 @@ _e_eom_window_set_internal(struct wl_resource *resource, int output_id, E_Client
    eom_client = _e_eom_client_get_by_resource(resource);
    RETURNIFTRUE(eom_client == NULL, "eom_client is NULL");
 
-   RETURNIFTRUE(eom_client->current == EINA_FALSE, "not current client is going to set its window");
-
    eom_output = _e_eom_output_get_by_id(output_id);
    RETURNIFTRUE(eom_output == NULL, "eom_output is NULL");
 
@@ -1450,6 +1448,11 @@ _e_eom_window_set_internal(struct wl_resource *resource, int output_id, E_Client
 
    /* ec is used in buffer_change callback for distinguishing external ec and its buffers */
    eom_client->ec = ec;
+
+   if (eom_client->current == EINA_TRUE)
+     wl_eom_send_output_set_window(resource, eom_output->id, WL_EOM_ERROR_NONE);
+   else
+     wl_eom_send_output_set_window(resource, eom_output->id, WL_EOM_ERROR_OUTPUT_OCCUPIED);
 }
 
 static Eina_Bool