aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/ecore/src/lib/ecore_x/ecore_x_dpms.c
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2007-02-13 02:29:01 +0000
committerChristopher Michael <cpmichael1@comcast.net>2007-02-13 02:29:01 +0000
commitc6652505b7a3ac301f0f86e8beb15f5377617931 (patch)
tree5aade43130aa6850f67207fe08cb31a4ab813252 /legacy/ecore/src/lib/ecore_x/ecore_x_dpms.c
parentadd ecore_dlist_sort() and ecore_dlist_mergesort() (diff)
downloadefl-c6652505b7a3ac301f0f86e8beb15f5377617931.tar.gz
Added Ravenlock's DPMS code for ecore_x.
SVN revision: 28335
Diffstat (limited to 'legacy/ecore/src/lib/ecore_x/ecore_x_dpms.c')
-rw-r--r--legacy/ecore/src/lib/ecore_x/ecore_x_dpms.c112
1 files changed, 112 insertions, 0 deletions
diff --git a/legacy/ecore/src/lib/ecore_x/ecore_x_dpms.c b/legacy/ecore/src/lib/ecore_x/ecore_x_dpms.c
new file mode 100644
index 0000000000..19b46c2a42
--- /dev/null
+++ b/legacy/ecore/src/lib/ecore_x/ecore_x_dpms.c
@@ -0,0 +1,112 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
+/*
+ * DPMS code
+ */
+#include "Ecore.h"
+#include "ecore_x_private.h"
+#include "Ecore_X.h"
+#include "Ecore_X_Atoms.h"
+
+/* Are we capable */
+EAPI int
+ecore_x_dpms_capable(void)
+{
+ return DPMSCapable(_ecore_x_disp);
+}
+
+/* Are we enabled */
+EAPI int
+ecore_x_dpms_enabled_get(void)
+{
+ unsigned char state;
+ unsigned short power_lvl;
+
+ DPMSInfo(_ecore_x_disp, &power_lvl, &state);
+ return state;
+}
+
+/* Enable/Disable DPMS */
+EAPI void
+ecore_x_dpms_enabled_set(int enabled)
+{
+ if (enabled)
+ DPMSEnable(_ecore_x_disp);
+ else
+ DPMSDisable(_ecore_x_disp);
+}
+
+/* Set all timeouts to known values */
+EAPI int
+ecore_x_dpms_timeouts_set(int standby, int suspend, int off)
+{
+ return DPMSSetTimeouts(_ecore_x_disp,
+ standby,
+ suspend,
+ off);
+}
+
+/* Get/Set Timeouts */
+EAPI int
+ecore_x_dpms_timeout_standby_get()
+{
+ unsigned short standby, suspend, off;
+
+ DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off);
+ return standby;
+}
+
+EAPI int
+ecore_x_dpms_timeout_suspend_get()
+{
+ unsigned short standby, suspend, off;
+
+ DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off);
+ return suspend;
+}
+
+EAPI int
+ecore_x_dpms_timeout_off_get()
+{
+ unsigned short standby, suspend, off;
+
+ DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off);
+ return off;
+}
+
+EAPI void
+ecore_x_dpms_timeout_standby_set(int new_timeout)
+{
+ unsigned short standby, suspend, off;
+
+ DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off);
+ DPMSSetTimeouts(_ecore_x_disp,
+ new_timeout,
+ suspend,
+ off);
+}
+
+EAPI void
+ecore_x_dpms_timeout_suspend_set(int new_timeout)
+{
+ unsigned short standby, suspend, off;
+
+ DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off);
+ DPMSSetTimeouts(_ecore_x_disp,
+ standby,
+ new_timeout,
+ off);
+}
+
+EAPI void
+ecore_x_dpms_timeout_off_set(int new_timeout)
+{
+ unsigned short standby, suspend, off;
+
+ DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off);
+ DPMSSetTimeouts(_ecore_x_disp,
+ standby,
+ suspend,
+ new_timeout);
+}