Hello,

Attached is a patch and supporting files to add a DPMS configuration
panel. Wasn't sure what form was preferred for the 'supporting files' so I just attached them. If there is a preferred means for submitting them please let me know.

It simply allows a user to Enable/Disable DPMS.  As well as specify if
Standby, Suspend, or Off are enabled (as well as their respective timeouts).

--
Regards,
Ravenlock
? e17/apps/e/src/bin/e_dpms.c
? e17/apps/e/src/bin/e_dpms.h
? e17/apps/e/src/bin/e_int_config_dpms.c
? e17/apps/e/src/bin/e_int_config_dpms.h
Index: e17/apps/e/src/bin/Makefile.am
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/Makefile.am,v
retrieving revision 1.168
diff -u -r1.168 Makefile.am
--- e17/apps/e/src/bin/Makefile.am      17 Dec 2006 11:24:59 -0000      1.168
+++ e17/apps/e/src/bin/Makefile.am      26 Jan 2007 17:34:04 -0000
@@ -137,9 +137,11 @@
 e_int_config_color_classes.h \
 e_int_config_mime.h \
 e_int_config_mime_edit.h \
+e_int_config_dpms.h \
 e_deskpreview.h \
 e_exebuf.h \
 e_desklock.h \
+e_dpms.h \
 e_int_config_modules.h \
 e_exehist.h \
 e_color_class.h \
@@ -294,9 +296,11 @@
 e_int_config_color_classes.c \
 e_int_config_mime.c \
 e_int_config_mime_edit.c \
+e_int_config_dpms.c \
 e_deskpreview.c \
 e_exebuf.c \
 e_desklock.c \
+e_dpms.c \
 e_int_config_modules.c \
 e_exehist.c \
 e_color_class.c \
Index: e17/apps/e/src/bin/e_config.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.225
diff -u -r1.225 e_config.c
--- e17/apps/e/src/bin/e_config.c       7 Jan 2007 23:45:35 -0000       1.225
+++ e17/apps/e/src/bin/e_config.c       26 Jan 2007 17:34:04 -0000
@@ -474,18 +474,26 @@
    E_CONFIG_VAL(D, T, desklock_background, STR);
    E_CONFIG_VAL(D, T, desklock_auth_method, INT);
    E_CONFIG_VAL(D, T, desklock_login_box_zone, INT);
    E_CONFIG_VAL(D, T, desklock_autolock, INT);
    E_CONFIG_VAL(D, T, desklock_use_timeout, INT);
    E_CONFIG_VAL(D, T, desklock_timeout, DOUBLE);
    E_CONFIG_VAL(D, T, desklock_disable_screensaver, INT);
    E_CONFIG_VAL(D, T, desklock_use_custom_screensaver, INT);
    E_CONFIG_VAL(D, T, desklock_custom_screensaver_cmd, STR);
    E_CONFIG_VAL(D, T, display_res_restore, INT);
    E_CONFIG_VAL(D, T, display_res_width, INT);
    E_CONFIG_VAL(D, T, display_res_height, INT);
    E_CONFIG_VAL(D, T, display_res_hz, INT);
    E_CONFIG_VAL(D, T, display_res_rotation, INT);
    
+   E_CONFIG_VAL(D, T, dpms_enable, INT);
+   E_CONFIG_VAL(D, T, dpms_standby_enable, INT);
+   E_CONFIG_VAL(D, T, dpms_suspend_enable, INT);
+   E_CONFIG_VAL(D, T, dpms_off_enable, INT);
+   E_CONFIG_VAL(D, T, dpms_standby_timeout, INT);
+   E_CONFIG_VAL(D, T, dpms_suspend_timeout, INT);
+   E_CONFIG_VAL(D, T, dpms_off_timeout, INT);
+   
    E_CONFIG_VAL(D, T, border_raise_on_mouse_action, INT);
    E_CONFIG_VAL(D, T, border_raise_on_focus, INT);
    E_CONFIG_VAL(D, T, desk_flip_wrap, INT);
@@ -1297,9 +1305,19 @@
    IFCFG(0x0108);
    e_config->desk_auto_switch = 0;
    IFCFGEND;
-   
-   e_config->config_version = E_CONFIG_FILE_VERSION;
 
+   IFCFG(0x0109);
+   e_config->dpms_enable = 0;
+   e_config->dpms_standby_enable = 0;
+   e_config->dpms_suspend_enable = 0;
+   e_config->dpms_off_enable = 0;
+   e_config->dpms_standby_timeout = 0;
+   e_config->dpms_suspend_timeout = 0;
+   e_config->dpms_off_timeout = 0;
+   IFCFGEND;
+     
+   e_config->config_version = E_CONFIG_FILE_VERSION;   
+     
 #if 0 /* example of new config */
    IFCFG(0x0090); /* the version # where this value(s) was introduced */
    e_config->new_value = 10; /* set the value(s) */
@@ -1397,6 +1415,13 @@
    E_CONFIG_LIMIT(e_config->desk_flip_wrap, 0, 1);
    E_CONFIG_LIMIT(e_config->remember_internal_windows, 0, 1);
    E_CONFIG_LIMIT(e_config->desk_auto_switch, 0, 1);
+   E_CONFIG_LIMIT(e_config->dpms_enable, 0, 1);
+   E_CONFIG_LIMIT(e_config->dpms_standby_enable, 0, 1);
+   E_CONFIG_LIMIT(e_config->dpms_suspend_enable, 0, 1);
+   E_CONFIG_LIMIT(e_config->dpms_off_enable, 0, 1);
+   E_CONFIG_LIMIT(e_config->dpms_standby_timeout, 0, 5400);
+   E_CONFIG_LIMIT(e_config->dpms_suspend_timeout, 0, 5400);
+   E_CONFIG_LIMIT(e_config->dpms_off_timeout, 0, 5400);
    
    /* FIXME: disabled auto apply because it causes problems */
    e_config->cfgdlg_auto_apply = 0;
Index: e17/apps/e/src/bin/e_config.h
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.140
diff -u -r1.140 e_config.h
--- e17/apps/e/src/bin/e_config.h       7 Jan 2007 23:45:35 -0000       1.140
+++ e17/apps/e/src/bin/e_config.h       26 Jan 2007 17:34:04 -0000
@@ -52,7 +52,7 @@
 /* increment this whenever a new set of config values are added but the users
  * config doesn't need to be wiped - simply new values need to be put in
  */
-#define E_CONFIG_FILE_GENERATION 0x0108
+#define E_CONFIG_FILE_GENERATION 0x0109
 #define E_CONFIG_FILE_VERSION    ((E_CONFIG_FILE_EPOCH << 16) | 
E_CONFIG_FILE_GENERATION)
 
 #define E_EVAS_ENGINE_DEFAULT      0
@@ -227,12 +227,20 @@
    const char *desklock_background; // GUI
    int         desklock_auth_method; // GUI
    int         desklock_login_box_zone; // GUI
    int         desklock_autolock; // GUI
    int         desklock_use_timeout; // GUI
    double      desklock_timeout; // GUI
    int         desklock_disable_screensaver; // GUI
    int         desklock_use_custom_screensaver; //GUI
    const char *desklock_custom_screensaver_cmd; // GUI
+   
+   int         dpms_enable;
+   int         dpms_standby_enable;
+   int         dpms_standby_timeout;
+   int         dpms_suspend_enable;
+   int         dpms_suspend_timeout;
+   int         dpms_off_enable;
+   int         dpms_off_timeout;
    
    int         display_res_restore; // GUI
    int         display_res_width; // GUI
Index: e17/apps/e/src/bin/e_configure.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_configure.c,v
retrieving revision 1.88
diff -u -r1.88 e_configure.c
--- e17/apps/e/src/bin/e_configure.c    10 Jan 2007 19:26:39 -0000      1.88
+++ e17/apps/e/src/bin/e_configure.c    26 Jan 2007 17:34:04 -0000
@@ -412,7 +412,8 @@
    _e_configure_item_add(cat, _("Virtual Desktops"), "enlightenment/desktops", 
e_int_config_desks);
    _e_configure_item_add(cat, _("Screen Resolution"), 
"enlightenment/screen_resolution", e_int_config_display);
    _e_configure_item_add(cat, _("Screen Lock"), "enlightenment/desklock", 
e_int_config_desklock);
-   
+   _e_configure_item_add(cat, _("DPMS Settings"), "enlightenment/dpms", 
e_int_config_dpms);
+
    cat = _e_configure_category_add(eco, _("Keyboard & Mouse"), 
"enlightenment/behavior");
    _e_configure_item_add(cat, _("Key Bindings"), "enlightenment/keys", 
e_int_config_keybindings);
    _e_configure_item_add(cat, _("Mouse Bindings"), 
"enlightenment/mouse_clean", e_int_config_mousebindings);
Index: e17/apps/e/src/bin/e_includes.h
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_includes.h,v
retrieving revision 1.144
diff -u -r1.144 e_includes.h
--- e17/apps/e/src/bin/e_includes.h     17 Dec 2006 11:24:59 -0000      1.144
+++ e17/apps/e/src/bin/e_includes.h     26 Jan 2007 17:34:05 -0000
@@ -101,6 +101,7 @@
 #include "e_int_config_winlist.h"
 #include "e_int_config_display.h"
 #include "e_int_config_desklock.h"
+#include "e_int_config_dpms.h"
 #include "e_int_config_exebuf.h"
 #include "e_int_config_apps.h"
 #include "e_int_config_cfgdialogs.h"
@@ -113,6 +114,7 @@
 #include "e_deskpreview.h"
 #include "e_exebuf.h"
 #include "e_desklock.h"
+#include "e_dpms.h"
 #include "e_int_config_modules.h"
 #include "e_exehist.h"
 #include "e_color_class.h"
Index: e17/apps/e/src/bin/e_main.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_main.c,v
retrieving revision 1.199
diff -u -r1.199 e_main.c
--- e17/apps/e/src/bin/e_main.c 17 Dec 2006 11:24:59 -0000      1.199
+++ e17/apps/e/src/bin/e_main.c 26 Jan 2007 17:34:06 -0000
@@ -769,6 +769,14 @@
      }
    _e_main_shutdown_push(e_exebuf_shutdown);
 
+   TS("dpms");     
+   /* setup dpms */
+   if (!e_dpms_init())
+     {
+       e_error_message_show(_("Enlightenment cannot configure the DPMS 
settings."));
+       _e_main_shutdown(-1);
+     }
+     
    TS("desklock");
    /* setup desklock */
    if (!e_desklock_init())
? e17/libs/ecore/src/lib/ecore_x/ecore_x_dpms.c
Index: e17/libs/ecore/src/lib/ecore_x/Makefile.am
===================================================================
RCS file: /var/cvs/e/e17/libs/ecore/src/lib/ecore_x/Makefile.am,v
retrieving revision 1.30
diff -u -r1.30 Makefile.am
--- e17/libs/ecore/src/lib/ecore_x/Makefile.am  7 Aug 2006 07:03:12 -0000       
1.30
+++ e17/libs/ecore/src/lib/ecore_x/Makefile.am  26 Jan 2007 17:02:36 -0000
@@ -51,6 +51,7 @@
 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_gc.c \
 ecore_x_xinerama.c \
 ecore_x_screensaver.c \
+ecore_x_dpms.c \
 ecore_x_private.h
Index: e17/libs/ecore/src/lib/ecore_x/ecore_x_private.h
===================================================================
RCS file: /var/cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_x_private.h,v
retrieving revision 1.56
diff -u -r1.56 ecore_x_private.h
--- e17/libs/ecore/src/lib/ecore_x/ecore_x_private.h    5 Nov 2006 15:14:49 
-0000       1.56
+++ e17/libs/ecore/src/lib/ecore_x/ecore_x_private.h    26 Jan 2007 17:02:36 
-0000
@@ -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
/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */
 #include "e.h"
 
 EAPI int
 e_dpms_init(void)
 {
   int standby=0, suspend=0, off=0;
    
   ecore_x_dpms_enabled_set(e_config->dpms_enable);

   if (e_config->dpms_standby_enable)
      standby = e_config->dpms_standby_timeout;

   if (e_config->dpms_suspend_enable)
      suspend = e_config->dpms_suspend_timeout;

   if (e_config->dpms_off_enable)
      off = e_config->dpms_off_timeout;

   ecore_x_dpms_timeouts_set(standby, suspend, off);
   
   return 1;
   
 }
#ifdef E_TYPEDEFS
#else
#ifndef E_DPMS_H
#define E_DPMS_H

EAPI int e_dpms_init(void);

#endif
#endif
#include "e.h"

static void *_create_data(E_Config_Dialog *cfd);
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);

static int  _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data 
*cfdata);
static Evas_Object  *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas,
                                           E_Config_Dialog_Data *cfdata);

static int  _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data 
*cfdata);
static Evas_Object  *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas,
                                              E_Config_Dialog_Data *cfdata);


/******************************************************************************************/

static void _cb_standby_slider_change(void *data, Evas_Object *obj);
static void _cb_suspend_slider_change(void *data, Evas_Object *obj);
static void _cb_off_slider_change(void *data, Evas_Object *obj);

/*******************************************************************************************/

struct _E_Config_Dialog_Data
{
   E_Config_Dialog *cfd;
   
   Evas_Object *standby_slider;
   Evas_Object *suspend_slider;
   Evas_Object *off_slider;
   
   int enable_dpms;
   int enable_standby;
   int enable_suspend;
   int enable_off;

   /*
    * The following timeouts are represented as minutes
    * while the underlying e_config variables are in seconds
    */ 
   double standby_timeout;  
   double suspend_timeout;
   double off_timeout;
   
};

static E_Dialog *dpms_dialog = NULL;

static void
_cb_dpms_dialog_ok(void *data, E_Dialog *dia)
{
   e_object_del(E_OBJECT(dpms_dialog));
   dpms_dialog = NULL;
}

static int
_e_int_config_dpms_capable()
{
   
   if (ecore_x_dpms_capable()) return 1;
   
   if (dpms_dialog) e_object_del(E_OBJECT(dpms_dialog));
   dpms_dialog = e_dialog_new(e_container_current_get(e_manager_current_get()), 
"E", "_dpms_dialog");
   if (!dpms_dialog) return 0;
      
   e_dialog_title_set(dpms_dialog, _("Display Power Management Signaling"));
   e_dialog_text_set(dpms_dialog, _("The current display server does not <br>"
                                        "have the DPMS extension."));
   e_dialog_icon_set(dpms_dialog, "enlightenment/dpms", 64);
   e_dialog_button_add(dpms_dialog, _("Ok"), NULL,
                       _cb_dpms_dialog_ok, NULL);
   
   e_dialog_button_focus_num(dpms_dialog, 1);
   e_win_centered_set(dpms_dialog->win, 1);
   e_dialog_show(dpms_dialog);
   return 0;
   
}

EAPI E_Config_Dialog *
e_int_config_dpms(E_Container *con)
{
   E_Config_Dialog *cfd;
   E_Config_Dialog_View *v;
   
   if ( (e_config_dialog_find("E", "_config_dpms_dialog"))
        || (!_e_int_config_dpms_capable()) 
      ) return NULL;

   v = E_NEW(E_Config_Dialog_View, 1);
   
   v->create_cfdata = _create_data;
   v->free_cfdata = _free_data;
   /* The "advanced" dialog is sufficiently basic that I prefer to use it as 
such */
   v->basic.apply_cfdata = _advanced_apply_data;       // was: 
_basic_apply_data;
   v->basic.create_widgets = _advanced_create_widgets; // was: 
_basic_create_widgets;
   v->advanced.apply_cfdata = NULL;                    // was: 
_advanced_apply_data;
   v->advanced.create_widgets = NULL;                  // was: 
_advanced_create_widgets;
   
   v->override_auto_apply = 1;
   
   cfd = e_config_dialog_new(con,
                             _("DPMS Settings"),
                             "E", "_config_dpms_dialog",
                             "enlightenment/dpms", 0, v, NULL);
   return cfd;
}

static void
_fill_data(E_Config_Dialog_Data *cfdata)
{

   cfdata->enable_dpms = e_config->dpms_enable;
   cfdata->enable_standby = e_config->dpms_standby_enable;
   cfdata->standby_timeout = e_config->dpms_standby_timeout / 60;
   cfdata->enable_suspend = e_config->dpms_suspend_enable;
   cfdata->suspend_timeout = e_config->dpms_suspend_timeout / 60;
   cfdata->enable_off = e_config->dpms_off_enable;
   cfdata->off_timeout = e_config->dpms_off_timeout / 60;
   
}

static void *
_create_data(E_Config_Dialog *cfd)
{
   E_Config_Dialog_Data *cfdata;

   cfdata = E_NEW(E_Config_Dialog_Data, 1);
   cfdata->cfd = cfd;
   
   cfdata->standby_slider = NULL;
   cfdata->suspend_slider = NULL;
   cfdata->off_slider = NULL;
   
  _fill_data(cfdata);
  return cfdata;
}

static void
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
   if (!cfdata) return;

   cfdata->standby_slider=NULL;
   cfdata->suspend_slider=NULL;
   cfdata->off_slider=NULL;

   E_FREE(cfdata);
}

static int
_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
   e_config->dpms_enable = cfdata->enable_dpms;
   e_config->dpms_standby_enable = cfdata->enable_standby;
   e_config->dpms_suspend_enable = cfdata->enable_suspend;
   e_config->dpms_off_enable = cfdata->enable_off;   

   e_config->dpms_standby_timeout = cfdata->standby_timeout * 60;
   e_config->dpms_suspend_timeout = cfdata->suspend_timeout * 60;
   e_config->dpms_off_timeout = cfdata->off_timeout * 60;
   
   e_dpms_init();
 
   e_config_save_queue();

}

static int
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{

   /*
    * NOTE:  Since the BASIC interface does not allow you to manipulate
    *   the suspend and off features,  I have decided to have them disabled
    *   when applying changes from this dialog.
    *
    *   I do this because the timeouts must always satisfy the following:
    *       standby <= suspend <= off
    *   and if you use the basic dialog, and increase the standby timeout
    *   you might very well unknowingly push it right up to the off timout. 
    *   at which point, you monitor will turn off, instead of going into 
    *   standby.  Which could be annoying.  
    */  
   cfdata->enable_suspend = 0;
   cfdata->enable_off = 0;

   _apply_data(cfd, cfdata);
   return 1;
   
}

static Evas_Object *
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data 
*cfdata)
{
   Evas_Object *o, *of, *ob;
   o = e_widget_list_add(evas, 0, 0);

   ob = e_widget_check_add(evas, _("Enable DPMS"), &(cfdata->enable_dpms));
   e_widget_list_object_append(o, ob, 1, 1 ,0);   
   
   of = e_widget_framelist_add(evas, _("DPMS Timer(s)"), 0);

   ob = e_widget_check_add(evas, _("Standby"), &(cfdata->enable_standby));
   e_widget_framelist_object_append(of, ob);
   ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"),
                            1.0, 90.0,
                            1.0, 0, &(cfdata->standby_timeout), NULL,
                            200);
   e_widget_on_change_hook_set(ob, _cb_standby_slider_change, cfdata);
   cfdata->standby_slider = ob;
   e_widget_framelist_object_append(of, ob);
   
   e_widget_list_object_append(o, of, 1, 1, 0.5);
   e_dialog_resizable_set(cfd->dia, 0);
   return o;
}

/* advanced window */
static int
_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
  
   _apply_data(cfd, cfdata);
   return 1;
   
}

static Evas_Object *
_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data 
*cfdata)
{
   Evas_Object *o, *of, *ob;
   E_Radio_Group *rg;
   o = e_widget_list_add(evas, 0, 0);

   ob = e_widget_check_add(evas, _("Enable DPMS"), &(cfdata->enable_dpms));
   e_widget_list_object_append(o, ob, 1, 1, 0);   
   
   of = e_widget_framelist_add(evas, _("DPMS Timer(s)"), 0);

   ob = e_widget_check_add(evas, _("Standby"), &(cfdata->enable_standby));
   e_widget_framelist_object_append(of, ob);
   ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"),
                            1.0, 90.0,
                            1.0, 0, &(cfdata->standby_timeout), NULL,
                            200);
   e_widget_on_change_hook_set(ob, _cb_standby_slider_change, cfdata);   
   cfdata->standby_slider = ob;
   e_widget_framelist_object_append(of, ob);
   
   ob = e_widget_check_add(evas, _("Suspend"), &(cfdata->enable_suspend));
   e_widget_framelist_object_append(of, ob);
   ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"),
                            1.0, 90.0,
                            1.0, 0, &(cfdata->suspend_timeout), NULL,
                            200);
   e_widget_on_change_hook_set(ob, _cb_suspend_slider_change, cfdata);
   cfdata->suspend_slider = ob;
   e_widget_framelist_object_append(of, ob);

   ob = e_widget_check_add(evas, _("Off"), &(cfdata->enable_off));
   e_widget_framelist_object_append(of, ob);
   ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"),
                            1.0, 90.0,
                            1.0, 0, &(cfdata->off_timeout), NULL,
                            200);
   e_widget_on_change_hook_set(ob, _cb_off_slider_change, cfdata);
   cfdata->off_slider = ob;
   e_widget_framelist_object_append(of, ob);

   e_widget_list_object_append(o, of, 1, 1, 0.5);
   
   e_dialog_resizable_set(cfd->dia, 0);
   return o;   
  
}

/* general functionality/callbacks */
static void
_cb_standby_slider_change(void *data, Evas_Object *obj)
{
   E_Config_Dialog_Data *cfdata = data;

   /* standby-slider */
   if (cfdata->standby_timeout > cfdata->suspend_timeout)
   {
      cfdata->suspend_timeout = cfdata->standby_timeout;
      if (cfdata->suspend_slider)
         e_widget_slider_value_double_set(cfdata->suspend_slider, 
cfdata->suspend_timeout);

      if (cfdata->suspend_timeout > cfdata->off_timeout)
      {
         cfdata->off_timeout = cfdata->suspend_timeout;
         if (cfdata->off_slider)
            e_widget_slider_value_double_set(cfdata->off_slider, 
cfdata->off_timeout);
      }      
   }

}

static void
_cb_suspend_slider_change(void *data, Evas_Object *obj)
{
   E_Config_Dialog_Data *cfdata = data;

   /* suspend-slider */
   if (cfdata->suspend_timeout > cfdata->off_timeout)
   {
      cfdata->off_timeout = cfdata->suspend_timeout;
      if (cfdata->off_slider)
         e_widget_slider_value_double_set(cfdata->off_slider, 
cfdata->off_timeout);
   }
   if (cfdata->suspend_timeout < cfdata->standby_timeout)
   {   
      cfdata->standby_timeout = cfdata->suspend_timeout;
      if (cfdata->standby_slider)
         e_widget_slider_value_double_set(cfdata->standby_slider, 
cfdata->standby_timeout);
   }

}

static void
_cb_off_slider_change(void *data, Evas_Object *obj)
{
   E_Config_Dialog_Data *cfdata = data;

   /* off-slider */
   if (cfdata->off_timeout < cfdata->suspend_timeout)
   {
      cfdata->suspend_timeout = cfdata->off_timeout;
      if (cfdata->suspend_slider)
         e_widget_slider_value_double_set(cfdata->suspend_slider, 
cfdata->suspend_timeout);
      
      if (cfdata->suspend_timeout < cfdata->standby_timeout)
      {   
         cfdata->standby_timeout = cfdata->suspend_timeout;
         if (cfdata->standby_slider)
            e_widget_slider_value_double_set(cfdata->standby_slider, 
cfdata->standby_timeout);
      }
   }
   
}
#ifdef E_TYPEDEFS
#else
#ifndef E_INT_CONFIG_DPMS_H
#define E_INT_CONFIG_DPMS_H

EAPI E_Config_Dialog *e_int_config_dpms(E_Container *con);

#endif
#endif
/*
 * 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); 

}
-------------------------------------------------------------------------
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-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to