Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_actions.c e_config.c e_zone.c e_zone.h 


Log Message:


mouse buttons on desktop are now configurable. you can configurew what
buttons do what - default is what it was. you will need to rm your config to
get this...

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_actions.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_actions.c 30 Apr 2005 07:03:31 -0000      1.6
+++ e_actions.c 5 May 2005 08:33:16 -0000       1.7
@@ -369,99 +369,100 @@
 }
 ACT_FN_GO(menu_show)
 {
-   E_Zone *zone;
+   E_Zone *zone = NULL;
 
    /* menu is active - abort */
    if (e_menu_grab_window_get()) return;
    if (!obj) return;
    if (obj->type == E_MANAGER_TYPE)
+     zone = e_util_zone_current_get((E_Manager *)obj);
+   else if (obj->type == E_ZONE_TYPE)
+     zone = (E_Zone *)obj;
+   if (zone)
      {
-       zone = e_util_zone_current_get((E_Manager *)obj);
-       if (zone)
+       if (params)
          {
-            if (params)
+            E_Menu *m = NULL;
+            
+            m = _e_actions_menu_find(params);  
+            if (m)
               {
-                 E_Menu *m = NULL;
+                 int x, y;
                  
-                 m = _e_actions_menu_find(params);     
-                 if (m)
-                   {
-                      int x, y;
-                      
-                      /* FIXME: this is a bit of a hack... setting m->con - 
bad hack */
-                      m->zone = zone;
-                      ecore_x_pointer_xy_get(zone->container->win, &x, &y);
-                      e_menu_post_deactivate_callback_set(m, 
_e_actions_cb_menu_end, NULL);
-                      e_menu_activate_mouse(m, zone, x, y, 1, 1,
-                                            E_MENU_POP_DIRECTION_DOWN);
-                   }
+                 /* FIXME: this is a bit of a hack... setting m->con - bad 
hack */
+                 m->zone = zone;
+                 ecore_x_pointer_xy_get(zone->container->win, &x, &y);
+                 e_menu_post_deactivate_callback_set(m, 
_e_actions_cb_menu_end, NULL);
+                 e_menu_activate_mouse(m, zone, x, y, 1, 1,
+                                       E_MENU_POP_DIRECTION_DOWN);
               }
          }
      }
 }
 ACT_FN_GO_MOUSE(menu_show)
 {
-   E_Zone *zone;
+   E_Zone *zone = NULL;
 
    /* menu is active - abort */
    if (e_menu_grab_window_get()) return;
    if (!obj) return;
    if (obj->type == E_MANAGER_TYPE)
+     zone = e_util_zone_current_get((E_Manager *)obj);
+   else if (obj->type == E_ZONE_TYPE)
+     zone = (E_Zone *)obj;
+   if (zone)
      {
-       zone = e_util_zone_current_get((E_Manager *)obj);
-       if (zone)
+       if (params)
          {
-            if (params)
+            E_Menu *m = NULL;
+            
+            m = _e_actions_menu_find(params);  
+            if (m)
               {
-                 E_Menu *m = NULL;
+                 int x, y;
                  
-                 m = _e_actions_menu_find(params);     
-                 if (m)
-                   {
-                      int x, y;
-                      
-                      /* FIXME: this is a bit of a hack... setting m->con - 
bad hack */
-                      m->zone = zone;
-                      x = ev->root.x;
-                      y = ev->root.y;
-                      x -= zone->container->x;
-                      y -= zone->container->y;
-                      e_menu_post_deactivate_callback_set(m, 
_e_actions_cb_menu_end, NULL);
-                      e_menu_activate_mouse(m, zone, x, y, 1, 1,
-                                            E_MENU_POP_DIRECTION_DOWN);
-                   }
+                 /* FIXME: this is a bit of a hack... setting m->con - bad 
hack */
+                 m->zone = zone;
+                 x = ev->root.x;
+                 y = ev->root.y;
+                 x -= zone->container->x;
+                 y -= zone->container->y;
+                 e_menu_post_deactivate_callback_set(m, 
_e_actions_cb_menu_end, NULL);
+                 e_menu_activate_mouse(m, zone, x, y, 1, 1,
+                                       E_MENU_POP_DIRECTION_DOWN);
+                 e_util_container_fake_mouse_up_all_later(zone->container);
               }
          }
      }
 }
 ACT_FN_GO_KEY(menu_show)
 {
-   E_Zone *zone;
+   E_Zone *zone = NULL;
 
    /* menu is active - abort */
    if (e_menu_grab_window_get()) return;
    if (!obj) return;
    if (obj->type == E_MANAGER_TYPE)
+     zone = e_util_zone_current_get((E_Manager *)obj);
+   else if (obj->type == E_ZONE_TYPE)
+     zone = (E_Zone *)obj;
+   if (zone)
      {
-       zone = e_util_zone_current_get((E_Manager *)obj);
-       if (zone)
+       if (params)
          {
-            if (params)
+            E_Menu *m = NULL;
+            
+            m = _e_actions_menu_find(params);  
+            if (m)
               {
-                 E_Menu *m = NULL;
+                 int x, y;
                  
-                 m = _e_actions_menu_find(params);     
-                 if (m)
-                   {
-                      int x, y;
-                      
-                      /* FIXME: this is a bit of a hack... setting m->con - 
bad hack */
-                      m->zone = zone;
-                      ecore_x_pointer_xy_get(zone->container->win, &x, &y);
-                      e_menu_post_deactivate_callback_set(m, 
_e_actions_cb_menu_end, NULL);
-                      e_menu_activate_key(m, zone, x, y, 1, 1,
-                                          E_MENU_POP_DIRECTION_DOWN);
-                   }
+                 /* FIXME: this is a bit of a hack... setting m->con - bad 
hack */
+                 m->zone = zone;
+                 ecore_x_pointer_xy_get(zone->container->win, &x, &y);
+                 e_menu_post_deactivate_callback_set(m, 
_e_actions_cb_menu_end, NULL);
+                 e_menu_activate_key(m, zone, x, y, 1, 1,
+                                     E_MENU_POP_DIRECTION_DOWN);
               }
          }
      }
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- e_config.c  5 May 2005 06:45:47 -0000       1.37
+++ e_config.c  5 May 2005 08:33:17 -0000       1.38
@@ -240,6 +240,33 @@
             eb->action = strdup("window_menu");
             eb->params = strdup("");
             e_config->mouse_bindings = 
evas_list_append(e_config->mouse_bindings, eb);
+
+            eb = E_NEW(E_Config_Binding_Mouse, 1);
+            eb->context = E_BINDING_CONTEXT_ZONE;
+            eb->button = 1;
+            eb->modifiers = 0;
+            eb->any_mod = 0;
+            eb->action = strdup("menu_show");
+            eb->params = strdup("main");
+            e_config->mouse_bindings = 
evas_list_append(e_config->mouse_bindings, eb);
+
+            eb = E_NEW(E_Config_Binding_Mouse, 1);
+            eb->context = E_BINDING_CONTEXT_ZONE;
+            eb->button = 2;
+            eb->modifiers = 0;
+            eb->any_mod = 0;
+            eb->action = strdup("menu_show");
+            eb->params = strdup("clients");
+            e_config->mouse_bindings = 
evas_list_append(e_config->mouse_bindings, eb);
+
+            eb = E_NEW(E_Config_Binding_Mouse, 1);
+            eb->context = E_BINDING_CONTEXT_ZONE;
+            eb->button = 3;
+            eb->modifiers = 0;
+            eb->any_mod = 0;
+            eb->action = strdup("menu_show");
+            eb->params = strdup("favorites");
+            e_config->mouse_bindings = 
evas_list_append(e_config->mouse_bindings, eb);
          }
          {
             E_Config_Binding_Key *eb;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_zone.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -3 -r1.44 -r1.45
--- e_zone.c    3 May 2005 13:44:43 -0000       1.44
+++ e_zone.c    5 May 2005 08:33:17 -0000       1.45
@@ -328,7 +328,20 @@
    ev = (Evas_Event_Mouse_Down *)event_info;
    zone = data;
    if (e_menu_grab_window_get()) return;
-    
+
+   if (!zone->cur_mouse_action)
+     {
+       if (ecore_event_current_type_get() == ECORE_X_EVENT_MOUSE_BUTTON_DOWN)
+         {
+            Ecore_X_Event_Mouse_Button_Down *ev2;
+            
+            ev2 = ecore_event_current_event_get();
+            zone->cur_mouse_action =
+              e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_ZONE,
+                                                 E_OBJECT(zone), ev2);
+         }
+     }
+#if 0  /* FIXME: nuke this later once the new configurable bindings settle */
    if (ev->button == 1)
      {
        E_Menu *m;
@@ -361,6 +374,7 @@
                              E_MENU_POP_DIRECTION_DOWN);
        e_util_container_fake_mouse_up_all_later(zone->container);
      }
+#endif   
 }
 
 static void
@@ -371,6 +385,31 @@
    
    ev = (Evas_Event_Mouse_Up *)event_info;      
    zone = data;
+   if (zone->cur_mouse_action)
+     {
+       if (ecore_event_current_type_get() == ECORE_X_EVENT_MOUSE_BUTTON_UP)
+         {
+            Ecore_X_Event_Mouse_Button_Up *ev2;
+            
+            ev2 = ecore_event_current_event_get();
+            if (zone->cur_mouse_action->func.end_mouse)
+              zone->cur_mouse_action->func.end_mouse(E_OBJECT(zone), "", ev2);
+            else if (zone->cur_mouse_action->func.end)
+              zone->cur_mouse_action->func.end(E_OBJECT(zone), "");
+         }
+       zone->cur_mouse_action = NULL;
+     }
+   else
+     {
+       if (ecore_event_current_type_get() == ECORE_X_EVENT_MOUSE_BUTTON_UP)
+         {
+            Ecore_X_Event_Mouse_Button_Up *ev2;
+            
+            ev2 = ecore_event_current_event_get();
+            e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_ZONE,
+                                             E_OBJECT(zone), ev2);
+         }
+     }
 }
 
 static void
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_zone.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- e_zone.h    30 Apr 2005 04:21:55 -0000      1.21
+++ e_zone.h    5 May 2005 08:33:17 -0000       1.22
@@ -39,6 +39,8 @@
        Ecore_Timer *timer;
        E_Direction direction;
    } flip;
+   
+   E_Action *cur_mouse_action;
 };
 
 struct _E_Event_Zone_Desk_Count_Set




-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit 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