Ecore_X(cb): Add function for backlight_available so that E will work
authordevilhorns <devilhorns@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 3 Dec 2011 04:41:30 +0000 (04:41 +0000)
committerdevilhorns <devilhorns@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 3 Dec 2011 04:41:30 +0000 (04:41 +0000)
again :)

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@65838 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_x/xcb/ecore_xcb_randr.c

index 510da49..edfad58 100644 (file)
@@ -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)
 {