e_comp_wl: e_comp_wl_pid_output_configured_resolution_get
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 23 Apr 2019 07:13:05 +0000 (16:13 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 23 Apr 2019 07:13:05 +0000 (16:13 +0900)
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 e451cc6985adc6069f552f0b4f2613ca6b345e56..839620236321dd4b0a1a6a8e0d712dc55149de12 100644 (file)
@@ -6632,4 +6632,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 4bd2ce1f1231fc64b7a4251011f622f32dd0b48a..a81d69b44dd1b15a8ac06ff008df969775e0baab 100644 (file)
@@ -584,5 +584,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