e_output: add e_output_size_get 47/132247/4
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 1 Jun 2017 05:28:28 +0000 (14:28 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 7 Jun 2017 05:37:50 +0000 (14:37 +0900)
e_output_size_get function gets the size of the output.

Change-Id: Iaaef2b33d7f1f3c6ef74cdd4152828dd036611db

src/bin/e_output.c
src/bin/e_output.h

index 735be0e..e27b9e2 100644 (file)
@@ -208,7 +208,7 @@ e_output_new(E_Comp_Screen *e_comp_screen, int index)
    size = strlen(name) + 4;
 
    id = calloc(1, size);
-   if (!id) return NULL;
+   if (!id) goto fail;
    snprintf(id, size, "%s-%d", name, index);
 
    output->id = id;
@@ -656,6 +656,15 @@ e_output_dpms_set(E_Output *output, E_OUTPUT_DPMS val)
    return EINA_TRUE;
 }
 
+EINTERN void
+e_output_size_get(E_Output *output, int *w, int *h)
+{
+   EINA_SAFETY_ON_NULL_RETURN(output);
+
+   *w = output->config.mode.w;
+   *h = output->config.mode.h;
+}
+
 static char *
 _e_output_drm_model_get(Ecore_Drm_Output *output)
 {
index 5ea06c9..9f26aed 100644 (file)
@@ -83,6 +83,7 @@ EINTERN Eina_Bool         e_output_hwc_setup(E_Output *output);
 EINTERN E_Output_Mode   * e_output_best_mode_find(E_Output *output);
 EINTERN Eina_Bool         e_output_connected(E_Output *output);
 EINTERN Eina_Bool         e_output_dpms_set(E_Output *output, E_OUTPUT_DPMS val);
+EINTERN void              e_output_size_get(E_Output *output, int *w, int *h);
 E_API E_Output          * e_output_find(const char *id);
 E_API const Eina_List   * e_output_planes_get(E_Output *output);
 E_API void                e_output_util_planes_print(void);