Add ecore_x_randr_crtc_info_get function.

NB: This will save us Many X round-trips in the new randr dialog.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 83728
This commit is contained in:
Christopher Michael 2013-02-07 09:32:24 +00:00 committed by Christopher Michael
parent 913f50642c
commit 20d1df8a23
1 changed files with 36 additions and 0 deletions

View File

@ -1779,6 +1779,42 @@ ecore_x_randr_crtc_pos_relative_set(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc
#endif
}
/*
* @since 1.8
*/
EAPI Ecore_X_Randr_Crtc_Info *
ecore_x_randr_crtc_info_get(Ecore_X_Window root, const Ecore_X_Randr_Crtc crtc)
{
#ifdef ECORE_XRANDR
XRRScreenResources *res = NULL;
if (_randr_version < RANDR_VERSION_1_2) return NULL;
/* try to get the screen resources from Xrandr */
if ((res = _ecore_x_randr_screen_resources_get(_ecore_x_disp, root)))
{
XRRCrtcInfo *info = NULL;
Ecore_X_Randr_Crtc_Info *ret = NULL;
/* try to get crtc info */
if ((info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
{
if ((ret = malloc(sizeof(Ecore_X_Randr_Crtc_Info))))
memcpy(ret, info, sizeof(Ecore_X_Randr_Crtc_Info));
/* free the crtc info */
XRRFreeCrtcInfo(info);
}
/* free the resources */
XRRFreeScreenResources(res);
return ret;
}
#endif
return NULL;
}
/*
* @brief Add given mode to given output.
*