e_comp_wl: add e_comp_wl_pid_output_configured_resolution_get 82/204382/5
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 23 Apr 2019 07:13:05 +0000 (16:13 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 26 Apr 2019 01:36:49 +0000 (01:36 +0000)
This function provide the size of the configured_resolution
of the e_comp_wl_output.

Change-Id: I98344fba6b4ce6e6fca4388e64821ed3a7b49d36

src/bin/e_comp_wl.c
src/bin/e_comp_wl.h

index 0fe4c904b316ba21ce642886fd9d876feca4a7f1..71e5a2023edd927634c145a3a431106bbeafa550 100644 (file)
@@ -6765,4 +6765,45 @@ e_comp_wl_pid_output_configured_resolution_send(pid_t pid, int w, int h)
      }
 
    return EINA_TRUE;
-}
\ No newline at end of file
+}
+
+EINTERN Eina_Bool
+e_comp_wl_pid_output_configured_resolution_get(pid_t pid, int *w, int *h)
+{
+   E_Comp_Wl_Output *output;
+   pid_t output_pid = 0;
+   Eina_List *l = NULL, *l2 = NULL;
+   struct wl_resource *resource = NULL;
+   Eina_Bool found = EINA_FALSE;
+
+   EINA_SAFETY_ON_TRUE_RETURN_VAL(pid <= 0, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(w, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(h, EINA_FALSE);
+
+   EINA_LIST_FOREACH(e_comp_wl->outputs, l, output)
+     {
+        /* if we have bound resources, send updates */
+        EINA_LIST_FOREACH(output->resources, l2, resource)
+          {
+             wl_client_get_credentials(wl_resource_get_client(resource), &output_pid, NULL, NULL);
+             if (output_pid == pid)
+               {
+                  *w = output->configured_resolution_w;
+                  *h = output->configured_resolution_h;
+                  found = EINA_TRUE;
+                  break;
+               }
+          }
+
+        if (found) break;
+     }
+
+   if (!found)
+     {
+        *w = output->w;
+        *h = output->h;
+        return EINA_FALSE;
+     }
+
+   return EINA_TRUE;
+}
index f49ef1ba7887740cf36857171d70d2887b756eac..529c97044022b9c5a2a80c0164d5e34b4359ef3f 100644 (file)
@@ -606,5 +606,6 @@ EINTERN void e_comp_wl_trace_serial_debug(Eina_Bool on);
 EINTERN Eina_Bool e_comp_wl_commit_sync_configure(E_Client *ec);
 
 EINTERN Eina_Bool         e_comp_wl_pid_output_configured_resolution_send(pid_t pid, int w, int h);
+EINTERN Eina_Bool         e_comp_wl_pid_output_configured_resolution_get(pid_t pid, int *w, int *h);
 # endif
 #endif