forked from enlightenment/efl
Added Ravenlock's DPMS code for ecore_x.
SVN revision: 28335
This commit is contained in:
parent
864ffd4973
commit
c6652505b7
|
@ -51,6 +51,7 @@ ecore_x_pixmap.c \
|
|||
ecore_x_gc.c \
|
||||
ecore_x_xinerama.c \
|
||||
ecore_x_screensaver.c \
|
||||
ecore_x_dpms.c \
|
||||
ecore_x_private.h
|
||||
|
||||
libecore_x_la_LIBADD = \
|
||||
|
@ -98,4 +99,5 @@ ecore_x_pixmap.c \
|
|||
ecore_x_gc.c \
|
||||
ecore_x_xinerama.c \
|
||||
ecore_x_screensaver.c \
|
||||
ecore_x_dpms.c \
|
||||
ecore_x_private.h
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -18,6 +18,7 @@
|
|||
#include <X11/extensions/XShm.h>
|
||||
#include <X11/extensions/shape.h>
|
||||
#include <X11/extensions/sync.h>
|
||||
#include <X11/extensions/dpms.h>
|
||||
#ifdef ECORE_XCURSOR
|
||||
#include <X11/Xcursor/Xcursor.h>
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue