Enlightenment CVS committal

Author  : sndev
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        Makefile.am e_config.c e_config.h e_configure.c e_desklock.c 
        e_includes.h e_int_config_keybindings.c 
Added Files:
        e_int_config_desklock.c e_int_config_desklock.h 


Log Message:

More work on Desktop Locking:

* the config dialog is created. Now every one can set his/her personal password 
to
  unlock the desktop. Pam support is comming soon also.
* a little bit redesined look and feel.
* the config version is increased, since the new item is introduced.

Some bug fixes in Keybinding config dialog.

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/Makefile.am,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -3 -r1.110 -r1.111
--- Makefile.am 19 Feb 2006 23:53:35 -0000      1.110
+++ Makefile.am 22 Feb 2006 14:35:04 -0000      1.111
@@ -132,6 +132,7 @@
 e_int_config_performance.h \
 e_int_config_winlist.h \
 e_int_config_display.h \
+e_int_config_desklock.h \
 e_int_config_exebuf.h \
 e_int_config_cfgdialogs.h \
 e_deskpreview.h \
@@ -258,6 +259,7 @@
 e_int_config_performance.c \
 e_int_config_winlist.c \
 e_int_config_display.c \
+e_int_config_desklock.c \
 e_int_config_exebuf.c \
 e_int_config_cfgdialogs.c \
 e_deskpreview.c \
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -3 -r1.146 -r1.147
--- e_config.c  19 Feb 2006 23:53:35 -0000      1.146
+++ e_config.c  22 Feb 2006 14:35:04 -0000      1.147
@@ -457,6 +457,7 @@
    E_CONFIG_VAL(D, T, cfgdlg_default_mode, INT); /**/
    E_CONFIG_LIST(D, T, gadcons, _e_config_gadcon_edd);
    E_CONFIG_LIST(D, T, shelves, _e_config_shelf_edd);
+   E_CONFIG_VAL(D, T, desklock_personal_passwd, STR);
 
    e_config = e_config_domain_load("e", _e_config_edd);
    if (e_config)
@@ -608,6 +609,7 @@
        e_config->cfgdlg_auto_apply = 0;
        e_config->cfgdlg_default_mode = 0;
        e_config->gadcons = NULL;
+       e_config->desklock_personal_passwd = NULL;
        
        /* FIXME: fill up default gadcons! */
          {
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -3 -r1.83 -r1.84
--- e_config.h  17 Feb 2006 10:25:23 -0000      1.83
+++ e_config.h  22 Feb 2006 14:35:04 -0000      1.84
@@ -49,7 +49,7 @@
  * versioning feature. the value of this is really irrelevant - just as
  * long as it increases every time we change something
  */
-#define E_CONFIG_FILE_VERSION 138
+#define E_CONFIG_FILE_VERSION 139
 
 #define E_EVAS_ENGINE_DEFAULT      0
 #define E_EVAS_ENGINE_SOFTWARE_X11 1
@@ -110,7 +110,7 @@
    Evas_List  *font_defaults;
    Evas_List  *themes;
    Evas_List  *mouse_bindings;
-   Evas_List  *key_bindings;
+   Evas_List  *key_bindings; // GUI
    Evas_List  *signal_bindings;
    Evas_List  *wheel_bindings;
    Evas_List  *path_append_data;
@@ -210,6 +210,7 @@
    int         cfgdlg_default_mode; // GUI   
    Evas_List  *gadcons;
    Evas_List  *shelves;
+   char              *desklock_personal_passwd; // GUI
 };
 
 struct _E_Config_Module
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_configure.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- e_configure.c       15 Feb 2006 20:28:55 -0000      1.36
+++ e_configure.c       22 Feb 2006 14:35:04 -0000      1.37
@@ -70,6 +70,7 @@
    e_configure_standard_item_add(eco, "enlightenment/mouse", _("Cursor 
Settings"), e_int_config_cursor);
    e_configure_standard_item_add(eco, "enlightenment/desktops", _("Desktop 
Settings"), e_int_config_desks);
    e_configure_standard_item_add(eco, "enlightenment/desktops", _("Display 
Settings"), e_int_config_display);
+   e_configure_standard_item_add(eco, "enlightenment/desktops", _("Desktop 
Lock Settings"), e_int_config_desklock);
    e_configure_standard_item_add(eco, "enlightenment/e", _("Focus Settings"), 
e_int_config_focus);
    e_configure_standard_item_add(eco, "enlightenment/e", _("Key Binding 
Settings"), e_int_config_keybindings);
    e_configure_standard_item_add(eco, "enlightenment/favorites", _("Menu 
Settings"), e_int_config_menus);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_desklock.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_desklock.c        21 Feb 2006 00:19:56 -0000      1.2
+++ e_desklock.c        22 Feb 2006 14:35:04 -0000      1.3
@@ -5,15 +5,27 @@
 
 #define PASSWD_LEN 256
 
+
+/**************************** private data ******************************/
 static Ecore_X_Window elock_wnd = 0;
 static Evas_List *handlers = NULL;
-static E_Popup *elock_wnd_popup = NULL;
 
+static E_Popup *elock_wnd_popup = NULL;
 static Evas_Object *bg_object = NULL;
-static Evas_Object *passwd_entry = NULL;
+
+struct _E_Desklock_Data
+{
+  Ecore_X_Window  elock_wnd;
+  Evas_List      *handlers;
+  Evas_List      *popus_wnd;
+  Evas_Object    *bg_object;
+};
+//static Evas_Object *passwd_entry = NULL;
 
 static char passwd[PASSWD_LEN]="";
 
+/***********************************************************************/
+
 static int _e_desklock_cb_key_down(void *data, int type, void *event);
 static int _e_desklock_cb_mouse_down(void *data, int type, void *event);
 static int _e_desklock_cb_mouse_up(void *data, int type, void *event);
@@ -29,8 +41,6 @@
 {
   //Evas_List  *managers, *l, *l2, *l3;
   Evas_Object *eo;
-  int x, y, w, h;
-  //Evas_List *elock_wnd_list = NULL;
   
   E_Zone  *zone = NULL;
 
@@ -45,12 +55,7 @@
     ecore_x_window_show(elock_wnd);
     e_grabinput_get(elock_wnd, 0, elock_wnd);
 
-    x = zone->x;
-    y = zone->y;
-    w = zone->w;
-    h = zone->h;
-
-    elock_wnd_popup = e_popup_new(zone, x, y, w, h);
+    elock_wnd_popup = e_popup_new(zone, zone->x, zone->y, zone->w, zone->h);
     evas_event_feed_mouse_move(elock_wnd_popup->evas, -1000000, -1000000,
                               ecore_x_current_time_get(), NULL);
 
@@ -72,9 +77,9 @@
     e_theme_edje_object_set(bg_object, "base/theme/desklock", 
"widgets/desklock/main");
 
 
-    e_popup_move_resize(elock_wnd_popup, x, y, w, h);
+    e_popup_move_resize(elock_wnd_popup, zone->x, zone->y, zone->w, zone->h);
     evas_object_move(bg_object, 0, 0);
-    evas_object_resize(bg_object, w, h);
+    evas_object_resize(bg_object, zone->w, zone->h);
     evas_object_show(bg_object);
     e_popup_edje_bg_object_set(elock_wnd_popup, bg_object);
 
@@ -101,8 +106,6 @@
   }
 
   /*
-  // TODO: I think that creation of the elock_wnd can be moved into the 
e_main.c.
-  // Actually this lock wnd can be created just once. And then used.
   managers = e_manager_list();
 
   for (l = managers; l; l = l->next)
@@ -223,8 +226,8 @@
   else if (!strcmp(ev->keysymbol, "KP_Enter"))
     {
       // here we have to go to auth
-      if (1 || strcmp(passwd, "password") == 0)
-       e_desklock_hide(); // Actually, escape MUST be ignored.
+      if (strcmp(passwd, e_config->desklock_personal_passwd) == 0)
+       e_desklock_hide();
       else
        ; // report about invalid password
       memset(passwd, 0, sizeof(char) * PASSWD_LEN);
@@ -233,8 +236,8 @@
   else if (!strcmp(ev->keysymbol, "Return"))
     {
       // here we have to go to auth
-      if (1 || strcmp(passwd, "password") == 0)
-       e_desklock_hide(); // Actually, escape MUST be ignored.
+      if (strcmp(passwd, e_config->desklock_personal_passwd) == 0)
+       e_desklock_hide();
       else
        ; // report about invalid password
       memset(passwd, 0, sizeof(char) * PASSWD_LEN);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_includes.h,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -3 -r1.91 -r1.92
--- e_includes.h        19 Feb 2006 23:53:35 -0000      1.91
+++ e_includes.h        22 Feb 2006 14:35:04 -0000      1.92
@@ -111,6 +111,7 @@
 #include "e_int_config_performance.h"
 #include "e_int_config_winlist.h"
 #include "e_int_config_display.h"
+#include "e_int_config_desklock.h"
 #include "e_int_config_exebuf.h"
 #include "e_int_config_cfgdialogs.h"
 #include "e_deskpreview.h"
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_int_config_keybindings.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_int_config_keybindings.c  19 Feb 2006 16:34:22 -0000      1.2
+++ e_int_config_keybindings.c  22 Feb 2006 14:35:04 -0000      1.3
@@ -8,6 +8,15 @@
 #define ILIST_ICON_WITH_KEYBIND            "enlightenment/e"
 #define ILIST_ICON_WITHOUT_KEYBIND  ""
 
+#define        _DEFAULT_ACTION 0
+#define _NONDEFAULT_ACTION  1
+
+#define EDIT_RESTRICT_NONE  (0 << 0)
+#define EDIT_RESTRICT_ACTION (1 << 0)
+#define EDIT_RESTRICT_PARAMS (1 << 1)
+
+#define E_BINDING_CONTEXT_NUMBER  10
+
 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);
@@ -38,143 +47,12 @@
 typedef struct _E_Smart_Item             E_Smart_Item;
 typedef struct _E_Smart_Data             E_Smart_Data;
 
-struct _E_Smart_Data
-{ 
-   Evas_Coord   x, y, w, h;
-   
-   Evas_Object   *smart_obj;
-   Evas_Object   *box_obj;
-   Evas_List     *items;
-   int            selected;
-   Evas_Coord     icon_w, icon_h;
-   unsigned char  selector : 1;
-};
-
-struct _E_Smart_Item
-{
-   E_Smart_Data  *sd;
-   Evas_Object   *base_obj;
-   Evas_Object   *icon_obj;
-   void         (*func) (void *data, void *data2);
-   void         (*func_hilight) (void *data, void *data2);
-   void          *data;
-   void          *data2;
-};
-
-struct _E_Widget_IList_Data
-{
-   Evas_Object *o_widget, *o_scrollframe, *o_ilist;
-   Evas_List *callbacks;
-   char **value;
-};
-
-struct _E_Widget_Radio_Data
-{
-   E_Radio_Group *group;
-   Evas_Object *o_radio;
-   int valnum;
-};
-
-struct _E_Widget_Checkbox_Data
-{
-  Evas_Object *o_check;
-  int *valptr;
-};
-
-struct _E_Widget_Button_Data
-{
-   Evas_Object *o_button;
-   Evas_Object *o_icon;
-   void (*func) (void *data, void *data2);
-   void *data;
-   void *data2;   
-};
-
-struct _E_Widget_Entry_Data
-{
-   Evas_Object *o_entry;
-   Evas_Object *obj;
-   char **valptr;
-   void (*on_change_func) (void *data, Evas_Object *obj);
-   void  *on_change_data;
-};
-#define E_BINDING_CONTEXT_NUMBER  10
-
-struct _E_Config_KeyBind
-{
-  int acn;
-  Evas_List *bk_list;
-};
-
-struct _E_Config_Dialog_Data
-{
-  Evas_List *key_bindings;
-
-  int cur_eckb_kb_sel;
-  E_Config_KeyBind  *cur_eckb;
-  Evas *evas;
-
-  int binding_context;
-  struct
-    {
-      int shift;
-      int ctrl;
-      int alt;
-      int win;
-    } bind_mod;
-  char *key_bind;
-  char *key_action;
-  char *key_params;
-
-  struct
-    {
-      Evas_Object *ilist;
-      /*Evas_Object *btn_add;
-      Evas_Object *btn_del;*/
-      
-      Evas_Object *btn_prev_keybind;
-      Evas_Object *btn_next_keybind;
-      Evas_Object *btn_add_keybind;
-      Evas_Object *btn_del_keybind;
-
-      Evas_Object *bind_context[E_BINDING_CONTEXT_NUMBER];
-      struct
-       {
-         Evas_Object *shift;
-         Evas_Object *ctrl;
-         Evas_Object *alt;
-         Evas_Object *win;
-       } bind_mod_obj;
-      Evas_Object *key_bind;
-      Evas_Object *key_action;
-      Evas_Object *key_params;
-    } gui;
-};
-
-EAPI E_Config_Dialog *
-e_int_config_keybindings(E_Container *con)
-{
-  E_Config_Dialog *cfd;
-  E_Config_Dialog_View *v;
-
-  v = E_NEW(E_Config_Dialog_View, 1);
-
-  v->create_cfdata = _create_data;
-  v->free_cfdata = _free_data;
-  v->basic.apply_cfdata = _basic_apply_data;
-  v->basic.create_widgets = _basic_create_widgets;
-
-  cfd = e_config_dialog_new(con, _("Key Binding Settings"), NULL, 0, v, NULL);
-  return cfd;
-}
-
-typedef struct
+/*typedef struct
 {
   char *key;
   int  modifiers;
   int  context;
-}KEY_ACTION_BINDING;
-
+}KEY_ACTION_BINDING;*/
 
 typedef struct
 {
@@ -185,13 +63,6 @@
   int  restrictions;
 }ACTION;
 
-#define        _DEFAULT_ACTION 0
-#define _NONDEFAULT_ACTION  1
-
-#define EDIT_RESTRICT_NONE  (0 << 0)
-#define EDIT_RESTRICT_ACTION (1 << 0)
-#define EDIT_RESTRICT_PARAMS (1 << 1)
-
 const ACTION actions_predefined_names[ ] = {
   {"Flip Desktop Left", "desk_flip_by", "-1 0", _DEFAULT_ACTION,
                                                EDIT_RESTRICT_ACTION | 
EDIT_RESTRICT_PARAMS },
@@ -335,6 +206,136 @@
   {NULL, NULL, NULL, _NONDEFAULT_ACTION, EDIT_RESTRICT_NONE }
 };
 
+struct _E_Smart_Data
+{ 
+   Evas_Coord   x, y, w, h;
+   
+   Evas_Object   *smart_obj;
+   Evas_Object   *box_obj;
+   Evas_List     *items;
+   int            selected;
+   Evas_Coord     icon_w, icon_h;
+   unsigned char  selector : 1;
+};
+
+struct _E_Smart_Item
+{
+   E_Smart_Data  *sd;
+   Evas_Object   *base_obj;
+   Evas_Object   *icon_obj;
+   void         (*func) (void *data, void *data2);
+   void         (*func_hilight) (void *data, void *data2);
+   void          *data;
+   void          *data2;
+};
+
+struct _E_Widget_IList_Data
+{
+   Evas_Object *o_widget, *o_scrollframe, *o_ilist;
+   Evas_List *callbacks;
+   char **value;
+};
+
+struct _E_Widget_Radio_Data
+{
+   E_Radio_Group *group;
+   Evas_Object *o_radio;
+   int valnum;
+};
+
+struct _E_Widget_Checkbox_Data
+{
+  Evas_Object *o_check;
+  int *valptr;
+};
+
+struct _E_Widget_Button_Data
+{
+   Evas_Object *o_button;
+   Evas_Object *o_icon;
+   void (*func) (void *data, void *data2);
+   void *data;
+   void *data2;   
+};
+
+struct _E_Widget_Entry_Data
+{
+   Evas_Object *o_entry;
+   Evas_Object *obj;
+   char **valptr;
+   void (*on_change_func) (void *data, Evas_Object *obj);
+   void  *on_change_data;
+};
+
+struct _E_Config_KeyBind
+{
+  int acn;
+  Evas_List *bk_list;
+};
+
+struct _E_Config_Dialog_Data
+{
+  Evas_List *key_bindings;
+
+  int cur_eckb_kb_sel;
+  E_Config_KeyBind  *cur_eckb;
+  Evas *evas;
+
+  int binding_context;
+  struct
+    {
+      int shift;
+      int ctrl;
+      int alt;
+      int win;
+    } bind_mod;
+  char *key_bind;
+  char *key_action;
+  char *key_params;
+
+  struct
+    {
+      Evas_Object *ilist;
+      /*Evas_Object *btn_add;
+      Evas_Object *btn_del;*/
+      
+      Evas_Object *btn_prev_keybind;
+      Evas_Object *btn_next_keybind;
+      Evas_Object *btn_add_keybind;
+      Evas_Object *btn_del_keybind;
+
+      Evas_Object *bind_context[E_BINDING_CONTEXT_NUMBER];
+      struct
+       {
+         Evas_Object *shift;
+         Evas_Object *ctrl;
+         Evas_Object *alt;
+         Evas_Object *win;
+       } bind_mod_obj;
+      Evas_Object *key_bind;
+      Evas_Object *key_action;
+      Evas_Object *key_params;
+    } gui;
+};
+
+
+EAPI E_Config_Dialog *
+e_int_config_keybindings(E_Container *con)
+{
+  E_Config_Dialog *cfd;
+  E_Config_Dialog_View *v;
+
+  v = E_NEW(E_Config_Dialog_View, 1);
+
+  v->create_cfdata = _create_data;
+  v->free_cfdata = _free_data;
+  v->basic.apply_cfdata = _basic_apply_data;
+  v->basic.create_widgets = _basic_create_widgets;
+
+  cfd = e_config_dialog_new(con, _("Key Binding Settings"), NULL, 0, v, NULL);
+  return cfd;
+}
+
 static void
 _fill_keybindings_data(E_Config_Dialog_Data *cfdata)
 {
@@ -446,9 +447,9 @@
   cfdata = E_NEW(E_Config_Dialog_Data, 1);
   
   cfdata->binding_context = E_BINDING_CONTEXT_ANY;
-  cfdata->key_bind = NULL;
-  cfdata->key_action = NULL;
-  cfdata->key_params = NULL;
+  cfdata->key_bind = strdup("");
+  cfdata->key_action = strdup("");
+  cfdata->key_params = strdup("");
   return cfdata;
 }
 
@@ -461,12 +462,9 @@
   E_Config_Binding_Key *bk;
 
 
-  if (cfdata->key_bind)
-    E_FREE(cfdata->key_bind);
-  if (cfdata->key_action)
-    E_FREE(cfdata->key_action);
-  if (cfdata->key_params)
-    E_FREE(cfdata->key_params);
+  E_FREE(cfdata->key_bind);
+  E_FREE(cfdata->key_action);
+  E_FREE(cfdata->key_params);
 
   size = evas_list_count(cfdata->key_bindings);
   for (i = 0; i < size; i++)
@@ -480,10 +478,9 @@
              bk = evas_list_nth(eckb->bk_list, j);
              if (bk)
                {
-                 if (bk->key) E_FREE(bk->key);
-                 if (bk->action) E_FREE(bk->action);
-                 if (bk->params) E_FREE(bk->params);
-
+                 E_FREE(bk->key);
+                 E_FREE(bk->action);
+                 E_FREE(bk->params);
                  E_FREE(bk);
                }
            }
@@ -558,7 +555,7 @@
            }
        }
     }
-
+  e_config_save_queue();
   return 1;
 }
 
@@ -781,7 +778,7 @@
     e_widget_table_object_append(oft, of2, 1, 0, 1, 1, 1, 1, 1, 1);
   }
   e_widget_list_object_append(o, oft, 1, 1, 0.5);
-  e_dialog_resizable_set(cfd->dia, 1);
+  e_dialog_resizable_set(cfd->dia, 0);
   return o;
 }
 




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to