From: devilhorns Date: Sat, 3 Dec 2011 04:41:30 +0000 (+0000) Subject: Ecore_X(cb): Add function for backlight_available so that E will work X-Git-Tag: build/2012-07-04.173327~634 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a2cba622f5c13daf5f4ec78191047a3118bda412;p=profile%2Fivi%2Fecore.git Ecore_X(cb): Add function for backlight_available so that E will work again :) git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@65838 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/ecore_x/xcb/ecore_xcb_randr.c b/src/lib/ecore_x/xcb/ecore_xcb_randr.c index 510da49..edfad58 100644 --- a/src/lib/ecore_x/xcb/ecore_xcb_randr.c +++ b/src/lib/ecore_x/xcb/ecore_xcb_randr.c @@ -2449,6 +2449,45 @@ ecore_x_randr_output_backlight_level_set(Ecore_X_Window root, return EINA_FALSE; } +/* + * @brief check if a backlight is available + * @return whether a blacklight is available + */ +EAPI Eina_Bool +ecore_x_randr_output_backlight_available(void) +{ +#ifdef ECORE_XCB_RANDR + Ecore_X_Atom _backlight; + xcb_intern_atom_cookie_t acookie; + xcb_intern_atom_reply_t *areply; +#endif + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + CHECK_XCB_CONN; + +#ifdef ECORE_XCB_RANDR + RANDR_CHECK_1_2_RET(EINA_FALSE); + + acookie = + xcb_intern_atom_unchecked(_ecore_xcb_conn, 1, + strlen("Backlight"), "Backlight"); + areply = xcb_intern_atom_reply(_ecore_xcb_conn, acookie, NULL); + + if (!areply) + { + ERR("Backlight property is not suppported on this server or driver"); + return EINA_FALSE; + } + else + { + _backlight = areply->atom; + free(areply); + return EINA_TRUE; + } +#endif + return EINA_FALSE; +} + EAPI int ecore_x_randr_edid_version_get(unsigned char *edid, unsigned long edid_length) {