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.michael@samsung.com>
This commit is contained in:
Chris Michael 2018-02-21 12:16:31 -05:00
parent 9f63fac2d2
commit fc4f66c6c2
3 changed files with 38 additions and 0 deletions

View File

@ -824,6 +824,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
*

View File

@ -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;
}

View File

@ -234,6 +234,7 @@ struct _Ecore_Drm2_Output
struct
{
const char *to;
Ecore_Drm2_Relative_Mode mode;
} relative;