Enlightenment CVS committal

Author  : englebass
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_x


Modified Files:
        ecore_x_dpms.c 


Log Message:
Support for system which do not have DPMS at all.

===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_x_dpms.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ecore_x_dpms.c      13 Mar 2007 11:14:44 -0000      1.4
+++ ecore_x_dpms.c      13 Mar 2007 16:05:57 -0000      1.5
@@ -49,8 +49,12 @@
 EAPI int
 ecore_x_dpms_capable_get(void)
 {
+#ifdef ECORE_XDPMS
    if (!_dpms_available) return 0;
    return DPMSCapable(_ecore_x_disp);
+#else
+   return 0;
+#endif
 }
 
 /**
@@ -61,12 +65,16 @@
 EAPI int
 ecore_x_dpms_enabled_get(void)
 {
+#ifdef ECORE_XDPMS
    unsigned char state;
    unsigned short power_lvl;
 
    if (!_dpms_available) return 0;
    DPMSInfo(_ecore_x_disp, &power_lvl, &state);
    return state;
+#else
+   return 0;
+#endif
 }
 
 /**
@@ -77,11 +85,13 @@
 EAPI void
 ecore_x_dpms_enabled_set(int enabled)
 {
+#ifdef ECORE_XDPMS
    if (!_dpms_available) return;
    if (enabled)
      DPMSEnable(_ecore_x_disp);
    else
      DPMSDisable(_ecore_x_disp);
+#endif
 }
 
 /**
@@ -94,9 +104,11 @@
 EAPI void
 ecore_x_dpms_timeouts_get(unsigned int *standby, unsigned int *suspend, 
unsigned int *off)
 {
+#ifdef ECORE_XDPMS
    if (!_dpms_available) return;
    DPMSGetTimeouts(_ecore_x_disp, (unsigned short *)standby, 
                   (unsigned short *)suspend, (unsigned short *)off);
+#endif
 }
 
 /**
@@ -109,8 +121,12 @@
 EAPI int
 ecore_x_dpms_timeouts_set(unsigned int standby, unsigned int suspend, unsigned 
int off)
 {
+#ifdef ECORE_XDPMS
    if (!_dpms_available) return 0;
    return DPMSSetTimeouts(_ecore_x_disp, standby, suspend, off);
+#else
+   return 0;
+#endif
 }
 
 /**
@@ -121,11 +137,15 @@
 EAPI unsigned int
 ecore_x_dpms_timeout_standby_get()
 {
+#ifdef ECORE_XDPMS
    unsigned short standby, suspend, off;
 
    if (!_dpms_available) return 0;
    DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off);
    return standby;
+#else
+   return 0;
+#endif
 }
 
 /**
@@ -137,11 +157,15 @@
 EAPI unsigned int
 ecore_x_dpms_timeout_suspend_get()
 {
+#ifdef ECORE_XDPMS
    unsigned short standby, suspend, off;
 
    if (!_dpms_available) return 0;
    DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off);
    return suspend;
+#else
+   return 0;
+#endif
 }
 
 /**
@@ -153,11 +177,15 @@
 EAPI unsigned int
 ecore_x_dpms_timeout_off_get()
 {
+#ifdef ECORE_XDPMS
    unsigned short standby, suspend, off;
 
    if (!_dpms_available) return 0;
    DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off);
    return off;
+#else
+   return 0;
+#endif
 }
 
 /**
@@ -168,11 +196,13 @@
 EAPI void
 ecore_x_dpms_timeout_standby_set(unsigned int new_timeout)
 {
+#ifdef ECORE_XDPMS
    unsigned short standby, suspend, off;
 
    if (!_dpms_available) return;
    DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off);
    DPMSSetTimeouts(_ecore_x_disp, new_timeout, suspend, off);
+#endif
 }
 
 /**
@@ -183,11 +213,13 @@
 EAPI void
 ecore_x_dpms_timeout_suspend_set(unsigned int new_timeout)
 {
+#ifdef ECORE_XDPMS
    unsigned short standby, suspend, off;
 
    if (!_dpms_available) return;
    DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off);
    DPMSSetTimeouts(_ecore_x_disp, standby, new_timeout, off);
+#endif
 }
 
 /**
@@ -198,9 +230,11 @@
 EAPI void
 ecore_x_dpms_timeout_off_set(unsigned int new_timeout)
 {
+#ifdef ECORE_XDPMS
    unsigned short standby, suspend, off;
 
    if (!_dpms_available) return;
    DPMSGetTimeouts(_ecore_x_disp, &standby, &suspend, &off);
    DPMSSetTimeouts(_ecore_x_disp, standby, suspend, new_timeout);
+#endif
 }



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to