From 6f0ecfbb0633312234325306c5e100838c1c868f Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Thu, 1 Jun 2017 14:28:28 +0900 Subject: [PATCH] e_output: add e_output_size_get e_output_size_get function gets the size of the output. Change-Id: Iaaef2b33d7f1f3c6ef74cdd4152828dd036611db --- src/bin/e_output.c | 11 ++++++++++- src/bin/e_output.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/bin/e_output.c b/src/bin/e_output.c index 735be0e..e27b9e2 100644 --- a/src/bin/e_output.c +++ b/src/bin/e_output.c @@ -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) { diff --git a/src/bin/e_output.h b/src/bin/e_output.h index 5ea06c9..9f26aed 100644 --- a/src/bin/e_output.h +++ b/src/bin/e_output.h @@ -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); -- 2.7.4