devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fc4f66c6c234d95d807342927044f5ce9276e9a9
commit fc4f66c6c234d95d807342927044f5ce9276e9a9 Author: Chris Michael <cp.mich...@samsung.com> Date: Wed Feb 21 12:16:31 2018 -0500 ecore-drm2: Add API to get/set which output is relative to another In order to know which output we should clone, we need a way to store/retrieve the output which should be cloned. This patch adds a small api we can use in randr config dialog to get/set that value. @feature Signed-off-by: Chris Michael <cp.mich...@samsung.com> --- src/lib/ecore_drm2/Ecore_Drm2.h | 23 +++++++++++++++++++++++ src/lib/ecore_drm2/ecore_drm2_outputs.c | 14 ++++++++++++++ src/lib/ecore_drm2/ecore_drm2_private.h | 1 + 3 files changed, 38 insertions(+) diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h index 7904813c8c..8b987b920f 100644 --- a/src/lib/ecore_drm2/Ecore_Drm2.h +++ b/src/lib/ecore_drm2/Ecore_Drm2.h @@ -825,6 +825,29 @@ EAPI void ecore_drm2_output_relative_mode_set(Ecore_Drm2_Output *output, Ecore_D EAPI Ecore_Drm2_Relative_Mode ecore_drm2_output_relative_mode_get(Ecore_Drm2_Output *output); /** + * Set which output a given output is relative to + * + * @param output The output for which to set relative + * @param relative The output for which the first output is relative to + * + * @ingroup Ecore_Drm2_Output_Group + * @since 1.21 + */ +EAPI void ecore_drm2_output_relative_to_set(Ecore_Drm2_Output *output, const char *relative); + +/** + * Get which output is relative to a given output + * + * @param output The output for which to retrieve relative + * + * @return The name of the output which is relative to the given output or NULL + * + * @ingroup Ecore_Drm2_Output_Group + * @since 1.21 + */ +EAPI const char *ecore_drm2_output_relative_to_get(Ecore_Drm2_Output *output); + +/** * @defgroup Ecore_Drm2_Fb_Group Drm framebuffer functions * * Functions that deal with setup of framebuffers diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index 3bb0ada0ac..d1f7ad0d07 100644 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c @@ -1668,3 +1668,17 @@ ecore_drm2_output_relative_mode_get(Ecore_Drm2_Output *output) EINA_SAFETY_ON_NULL_RETURN_VAL(output, ECORE_DRM2_RELATIVE_MODE_UNKNOWN); return output->relative.mode; } + +EAPI void +ecore_drm2_output_relative_to_set(Ecore_Drm2_Output *output, const char *relative) +{ + EINA_SAFETY_ON_NULL_RETURN(output); + eina_stringshare_replace(&output->relative.to, relative); +} + +EAPI const char * +ecore_drm2_output_relative_to_get(Ecore_Drm2_Output *output) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL); + return output->relative.to; +} diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h index c2a59e4eee..490f1665e4 100644 --- a/src/lib/ecore_drm2/ecore_drm2_private.h +++ b/src/lib/ecore_drm2/ecore_drm2_private.h @@ -234,6 +234,7 @@ struct _Ecore_Drm2_Output struct { + const char *to; Ecore_Drm2_Relative_Mode mode; } relative; --