Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_winlist.c 


Log Message:


handle grabbed mouse butotna nd wheel events... wheel controsl selected
window in winlist - buttons passed onto binding system

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_winlist.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- e_winlist.c 13 Jun 2005 11:00:41 -0000      1.12
+++ e_winlist.c 13 Jun 2005 15:56:15 -0000      1.13
@@ -24,6 +24,9 @@
 static int _e_winlist_cb_event_border_remove(void *data, int type,  void 
*event);
 static int _e_winlist_cb_key_down(void *data, int type, void *event);
 static int _e_winlist_cb_key_up(void *data, int type, void *event);
+static int _e_winlist_cb_mouse_down(void *data, int type, void *event);
+static int _e_winlist_cb_mouse_up(void *data, int type, void *event);
+static int _e_winlist_cb_mouse_wheel(void *data, int type, void *event);
 static int _e_winlist_scroll_timer(void *data);
 static int _e_winlist_warp_timer(void *data);
 static int _e_winlist_animator(void *data);
@@ -51,8 +54,6 @@
 static Ecore_Timer *scroll_timer = NULL;
 static Ecore_Timer *animator = NULL;
 
-/* FIXME: add mouse downa nd up handlers and pass events to bindings from them 
incase mouse binding starst winlist */
-
 /* externally accessible functions */
 int
 e_winlist_init(void)
@@ -147,6 +148,15 @@
    handlers = evas_list_append
      (handlers, ecore_event_handler_add
       (ECORE_X_EVENT_KEY_UP, _e_winlist_cb_key_up, NULL));
+   handlers = evas_list_append
+     (handlers, ecore_event_handler_add
+      (ECORE_X_EVENT_MOUSE_BUTTON_DOWN, _e_winlist_cb_mouse_down, NULL));
+   handlers = evas_list_append
+     (handlers, ecore_event_handler_add
+      (ECORE_X_EVENT_MOUSE_BUTTON_UP, _e_winlist_cb_mouse_up, NULL));
+   handlers = evas_list_append
+     (handlers, ecore_event_handler_add
+      (ECORE_X_EVENT_MOUSE_WHEEL, _e_winlist_cb_mouse_wheel, NULL));
    
    e_popup_show(winlist);
    return 1;
@@ -590,6 +600,52 @@
 }
 
 static int
+_e_winlist_cb_mouse_down(void *data, int type, void *event)
+{
+   Ecore_X_Event_Mouse_Button_Down *ev;
+   
+   ev = event;
+   if (ev->win != input_window) return 1;
+   e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_WINLIST,
+                                     E_OBJECT(winlist->zone), ev);
+   return 1;
+}
+
+static int
+_e_winlist_cb_mouse_up(void *data, int type, void *event)
+{
+   Ecore_X_Event_Mouse_Button_Up *ev;
+   
+   ev = event;
+   if (ev->win != input_window) return 1;
+   e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_WINLIST,
+                                   E_OBJECT(winlist->zone), ev);
+   return 1;
+}
+
+static int
+_e_winlist_cb_mouse_wheel(void *data, int type, void *event)
+{
+   Ecore_X_Event_Mouse_Wheel *ev;
+   
+   ev = event;
+   if (ev->win != input_window) return 1;
+   if (ev->z < 0) /* up */
+     {
+       int i;
+       
+       for (i = ev->z; i < 0; i++) e_winlist_prev();
+     }
+   else if (ev->z > 0) /* down */
+     {
+       int i;
+       
+       for (i = ev->z; i > 0; i--) e_winlist_next();
+     }
+   return 1;
+}
+
+static int
 _e_winlist_scroll_timer(void *data)
 {
    if (scroll_to)




-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to