Enlightenment CVS committal

Author  : sebastid
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_dialog.c e_dialog.h 


Log Message:
Urf.

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_dialog.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- e_dialog.c  24 Sep 2005 02:49:55 -0000      1.15
+++ e_dialog.c  24 Sep 2005 03:11:37 -0000      1.16
@@ -19,7 +19,7 @@
 static void _e_dialog_free(E_Dialog *dia);
 static void _e_dialog_cb_button_clicked(void *data, Evas_Object *obj, const 
char *emission, const char *source);
 static void _e_dialog_cb_delete(E_Win *win);
-static int  _e_dialog_key_down_cb(void *data, int type, void *event);
+static void _e_dialog_cb_key_down(void *data, Evas *e, Evas_Object *obj, void 
*event);
 
 /* local subsystem globals */
 
@@ -74,9 +74,13 @@
    edje_object_part_swallow(dia->bg_object, "buttons_swallow", o);
    evas_object_show(o);
 
+   o = evas_object_rectangle_add(e_win_evas_get(dia->win));
+   dia->event_object = o;
+   evas_object_key_grab(o, "Tab", 0, ~0, 0);
+   evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, 
_e_dialog_cb_key_down, dia);
+
    dia->focused = NULL;
-   dia->key_down_handler = ecore_event_handler_add(ECORE_X_EVENT_KEY_DOWN, 
_e_dialog_key_down_cb, dia);
-   
+ 
    return dia;
 }
 
@@ -215,7 +219,7 @@
    if (dia->icon_object) evas_object_del(dia->icon_object);
    if (dia->box_object) evas_object_del(dia->box_object);
    if (dia->bg_object) evas_object_del(dia->bg_object);
-   ecore_event_handler_del(dia->key_down_handler);
+   if (dia->event_object) evas_object_del(dia->event_object);
    e_object_del(E_OBJECT(dia->win));
    free(dia);
 }
@@ -233,10 +237,10 @@
 }
 
 /* TODO: Implement shift-tab and left arrow */
-static int
-_e_dialog_key_down_cb(void *data, int type, void *event)
+static void
+_e_dialog_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event)
 {
-   Ecore_X_Event_Key_Down *ev;
+   Evas_Event_Key_Down *ev;
    E_Dialog *dia;
 
    ev = event;
@@ -278,19 +282,15 @@
             db = dia->focused->data;
             edje_object_signal_emit(db->obj, "focus", "");
          }
-       return 1;
      }
-
-   if ((!strcmp(ev->keyname, "Enter") || !strcmp(ev->keyname, "Return") ||
-       !strcmp(ev->keyname, "Space")) && dia->focused)
+   else if ((!strcmp(ev->keyname, "Enter") || !strcmp(ev->keyname, "Return") ||
+            !strcmp(ev->keyname, "Space")) && dia->focused)
      {
        E_Dialog_Button *db;
 
        db = evas_list_data(dia->focused);
        edje_object_signal_emit(db->obj, "click", "");      
      }
-
-   return 1;
 }
 
 static void
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_dialog.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_dialog.h  24 Sep 2005 01:59:26 -0000      1.3
+++ e_dialog.h  24 Sep 2005 03:11:37 -0000      1.4
@@ -20,9 +20,9 @@
    Evas_Object         *box_object;
    Evas_Object         *text_object;
    Evas_Object         *icon_object;
+   Evas_Object         *event_object;
    Evas_List           *buttons;
    Evas_List           *focused;
-   Ecore_Event_Handler *key_down_handler;
    void                *data;
 };
 




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to