Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_border.c 


Log Message:


alt+left mouse drag! WHERD!

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- e_border.c  2 Dec 2004 10:07:50 -0000       1.11
+++ e_border.c  4 Dec 2004 03:55:23 -0000       1.12
@@ -48,6 +48,7 @@
 static int  _e_border_cb_mouse_up(void *data, int type, void *event);
 static int  _e_border_cb_mouse_move(void *data, int type, void *event);
 static int  _e_border_cb_mouse_wheel(void *data, int type, void *event);
+static int  _e_border_cb_grab_replay(void *data, int type, void *event);
 
 static void _e_border_eval(E_Border *bd);
 static void _e_border_resize_limit(E_Border *bd, int *w, int *h);
@@ -76,6 +77,7 @@
    handlers = evas_list_append(handlers, 
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_IN, 
_e_border_cb_window_focus_in, NULL));
    handlers = evas_list_append(handlers, 
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT, 
_e_border_cb_window_focus_out, NULL));
    handlers = evas_list_append(handlers, 
ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, 
_e_border_cb_client_message, NULL));
+   ecore_x_passive_grab_replay_func_set(_e_border_cb_grab_replay, NULL);
    return 1;
 }
 
@@ -106,6 +108,14 @@
    bd->w = 1;
    bd->h = 1;
    bd->win = ecore_x_window_override_new(bd->container->win, 0, 0, bd->w, 
bd->h);
+   /* FIXME: use config list of bindings */
+   ecore_x_window_button_grab(bd->win,
+                             1, 
+                             ECORE_X_EVENT_MASK_MOUSE_DOWN |
+                             ECORE_X_EVENT_MASK_MOUSE_UP |
+                             ECORE_X_EVENT_MASK_MOUSE_MOVE,
+                             ECORE_X_MODIFIER_ALT,
+                             0);
    bd->bg_ecore_evas = ecore_evas_software_x11_new(NULL, bd->win, 0, 0, bd->w, 
bd->h);
    ecore_evas_software_x11_direct_resize_set(bd->bg_ecore_evas, 1);
    e_canvas_add(bd->bg_ecore_evas);
@@ -423,6 +433,11 @@
    e_canvas_del(bd->bg_ecore_evas);
    ecore_evas_free(bd->bg_ecore_evas);
    ecore_x_window_del(bd->client.shell_win);
+   /* FIXME: use config list of bindings */
+   ecore_x_window_button_ungrab(bd->win,
+                               1,
+                               ECORE_X_MODIFIER_ALT,
+                               0);
    ecore_x_window_del(bd->win);
    bd->container->clients = evas_list_remove(bd->container->clients, bd);
    borders = evas_list_remove(borders, bd);
@@ -1002,6 +1017,31 @@
    
    ev = event;
    bd = data;
+   if (ev->event_win == bd->win)
+     {
+       printf("GRABPRESS!\n");
+       if ((ev->button >= 1) && (ev->button <= 3))
+         {
+            bd->mouse.last_down[ev->button - 1].mx = ev->root.x;
+            bd->mouse.last_down[ev->button - 1].my = ev->root.y;
+            bd->mouse.last_down[ev->button - 1].x = bd->x;
+            bd->mouse.last_down[ev->button - 1].y = bd->y;
+            bd->mouse.last_down[ev->button - 1].w = bd->w;
+            bd->mouse.last_down[ev->button - 1].h = bd->h;
+         }
+       bd->mouse.current.mx = ev->root.x;
+       bd->mouse.current.my = ev->root.y;
+       /* FIXME: decide that this is a button binding and what to do */
+       if (ev->button == 1)
+         {
+            if (!bd->moving)
+              {
+                 bd->moving = 1;
+                 _e_border_moveinfo_gather(bd, "mouse,1");
+                 e_border_raise(bd);
+              }
+         }
+     }
    if (ev->win != bd->event_win) return 1;
    if ((ev->button >= 1) && (ev->button <= 3))
      {
@@ -1033,6 +1073,27 @@
    
    ev = event;
    bd = data;
+   if (ev->event_win == bd->win)
+     {
+       printf("GRABRELEASE!\n");
+       if ((ev->button >= 1) && (ev->button <= 3))
+         {
+            bd->mouse.last_up[ev->button - 1].mx = ev->root.x;
+            bd->mouse.last_up[ev->button - 1].my = ev->root.y;
+            bd->mouse.last_up[ev->button - 1].x = bd->x;
+            bd->mouse.last_up[ev->button - 1].y = bd->y;
+         }
+       bd->mouse.current.mx = ev->root.x;
+       bd->mouse.current.my = ev->root.y;
+       /* FIXME: decide that this is a button binding and what to do */
+       if (ev->button == 1)
+         {
+            if (bd->moving)
+              {
+                 bd->moving = 0;
+              }
+         }
+     }
    if (ev->win != bd->event_win) return 1;
    if ((ev->button >= 1) && (ev->button <= 3))
      {
@@ -1056,7 +1117,12 @@
    
    ev = event;
    bd = data;
-   if (ev->win != bd->event_win) return 1;
+   if (ev->event_win == bd->win)
+     {
+       printf("GRABMOVE2!\n");
+     }
+   if ((ev->win != bd->event_win) &&
+       (ev->event_win != bd->win)) return 1;
    bd->mouse.current.mx = ev->root.x;
    bd->mouse.current.my = ev->root.y;
    if (bd->moving)
@@ -1115,6 +1181,22 @@
    return 1;
 }
 
+static int 
+_e_border_cb_grab_replay(void *data, int type, void *event)
+{
+   if (type == ECORE_X_EVENT_MOUSE_BUTTON_DOWN)
+     {
+       Ecore_X_Event_Mouse_Button_Down *e;
+       E_Border *bd;
+       
+       e = event;
+       bd = e_border_find_by_client_window(e->win);
+       if (!bd) bd = e_border_find_by_client_window(e->event_win);
+       /* FIXME: return 1 if we pass this click on... */
+     }
+   return 0;
+}
+
 static void
 _e_border_eval(E_Border *bd)
 {




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to