Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_evas


Modified Files:
      Tag: SPLIT
        Ecore_Evas.h ecore_evas_fb.c ecore_evas_private.h 
        ecore_evas_x.c 


Log Message:


now handle mouse properly during rotate.. and cenrtralise some code...

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_evas/Attic/Ecore_Evas.h,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -u -3 -r1.1.2.13 -r1.1.2.14
--- Ecore_Evas.h        12 Feb 2003 23:29:41 -0000      1.1.2.13
+++ Ecore_Evas.h        13 Feb 2003 01:57:47 -0000      1.1.2.14
@@ -3,7 +3,6 @@
 
 /* FIXME:
  * to do soon:
- * - on rotation cursor pos needs to update & have synthetic move
  * - iconfication api needs to work
  * - maximization api nees to work
  * - attach keyed data to an ecore_evas canvas
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_evas/Attic/ecore_evas_fb.c,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -3 -r1.1.2.5 -r1.1.2.6
--- ecore_evas_fb.c     12 Feb 2003 23:29:43 -0000      1.1.2.5
+++ ecore_evas_fb.c     13 Feb 2003 01:57:47 -0000      1.1.2.6
@@ -14,6 +14,44 @@
 static Ecore_Event_Handler *ecore_evas_event_handlers[5];
 static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;
 
+static void
+_ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y)
+{
+   int fbw, fbh;
+   
+   ee->mouse.x = x;
+   ee->mouse.y = y;
+   ecore_fb_size_get(&fbw, &fbh);
+   if (ee->prop.cursor.object)
+     {
+       evas_object_show(ee->prop.cursor.object);
+        if (ee->rotation == 0)
+         evas_object_move(ee->prop.cursor.object,
+                          x - ee->prop.cursor.hot.x,
+                          y - ee->prop.cursor.hot.y);
+       else if (ee->rotation == 90)
+         evas_object_move(ee->prop.cursor.object,
+                          (fbh - ee->h) + ee->h - y - 1 - ee->prop.cursor.hot.x,
+                          x - ee->prop.cursor.hot.y);
+       else if (ee->rotation == 180)
+         evas_object_move(ee->prop.cursor.object,
+                          (fbw - ee->w) + ee->w - x - 1 - ee->prop.cursor.hot.x,
+                          (fbh - ee->h) + ee->h - y - 1 - ee->prop.cursor.hot.y);
+       else if (ee->rotation == 270)
+         evas_object_move(ee->prop.cursor.object,
+                          y - ee->prop.cursor.hot.x,
+                          (fbw - ee->w) + ee->w - x - 1 - ee->prop.cursor.hot.y);
+     }
+   if (ee->rotation == 0)
+     evas_event_feed_mouse_move(ee->evas, x, y);
+   else if (ee->rotation == 90)
+     evas_event_feed_mouse_move(ee->evas, (fbh - ee->h) + ee->h - y - 1, x);
+   else if (ee->rotation == 180)
+     evas_event_feed_mouse_move(ee->evas, (fbw - ee->w) + ee->w - x - 1, (fbh - 
+ee->h) + ee->h - y - 1);
+   else if (ee->rotation == 270)
+     evas_event_feed_mouse_move(ee->evas, y, (fbw - ee->w) + ee->w - x - 1);   
+}
+
 static Ecore_Evas *
 _ecore_evas_fb_match(void)
 {
@@ -60,20 +98,11 @@
 {
    Ecore_Evas *ee;
    Ecore_Fb_Event_Mouse_Button_Down *e;
-   int fbw, fbh;
    
    e = event;
    ee = _ecore_evas_fb_match();
    if (!ee) return 1; /* pass on event */
-   ecore_fb_size_get(&fbw, &fbh);
-   if (ee->rotation == 0)
-     evas_event_feed_mouse_move(ee->evas, e->x, e->y);
-   else if (ee->rotation == 90)
-     evas_event_feed_mouse_move(ee->evas, (fbh - ee->h) + ee->h - e->y - 1, e->x);
-   else if (ee->rotation == 180)
-     evas_event_feed_mouse_move(ee->evas, (fbw - ee->w) + ee->w - e->x - 1, (fbh - 
ee->h) + ee->h - e->y - 1);
-   else if (ee->rotation == 270)
-     evas_event_feed_mouse_move(ee->evas, e->y, (fbw - ee->w) + ee->w - e->x - 1);
+   _ecore_evas_mouse_move_process(ee, e->x, e->y);
    evas_event_feed_mouse_down(ee->evas, e->button);
    return 0; /* dont pass it on */
 }
@@ -83,20 +112,11 @@
 {
    Ecore_Evas *ee;
    Ecore_Fb_Event_Mouse_Button_Up *e;
-   int fbw, fbh;
    
    e = event;
    ee = _ecore_evas_fb_match();
    if (!ee) return 1; /* pass on event */
-   ecore_fb_size_get(&fbw, &fbh);
-   if (ee->rotation == 0)
-     evas_event_feed_mouse_move(ee->evas, e->x, e->y);
-   else if (ee->rotation == 90)
-     evas_event_feed_mouse_move(ee->evas, (fbh - ee->h) + ee->h - e->y - 1, e->x);
-   else if (ee->rotation == 180)
-     evas_event_feed_mouse_move(ee->evas, (fbw - ee->w) + ee->w - e->x - 1, (fbh - 
ee->h) + ee->h - e->y - 1);
-   else if (ee->rotation == 270)
-     evas_event_feed_mouse_move(ee->evas, e->y, (fbw - ee->w) + ee->w - e->x - 1);
+   _ecore_evas_mouse_move_process(ee, e->x, e->y);
    evas_event_feed_mouse_up(ee->evas, e->button);
    return 0; /* dont pass it on */
 }
@@ -106,40 +126,11 @@
 {
    Ecore_Evas *ee;
    Ecore_Fb_Event_Mouse_Move *e;
-   int fbw, fbh;
    
    e = event;
    ee = _ecore_evas_fb_match();
    if (!ee) return 1; /* pass on event */
-   ecore_fb_size_get(&fbw, &fbh);
-   if (ee->prop.cursor.object)
-     {
-       evas_object_show(ee->prop.cursor.object);
-        if (ee->rotation == 0)
-         evas_object_move(ee->prop.cursor.object,
-                          e->x - ee->prop.cursor.hot.x,
-                          e->y - ee->prop.cursor.hot.y);
-       else if (ee->rotation == 90)
-         evas_object_move(ee->prop.cursor.object,
-                          (fbh - ee->h) + ee->h - e->y - 1 - ee->prop.cursor.hot.x,
-                          e->x - ee->prop.cursor.hot.y);
-       else if (ee->rotation == 180)
-         evas_object_move(ee->prop.cursor.object,
-                          (fbw - ee->w) + ee->w - e->x - 1 - ee->prop.cursor.hot.x,
-                          (fbh - ee->h) + ee->h - e->y - 1 - ee->prop.cursor.hot.y);
-       else if (ee->rotation == 270)
-         evas_object_move(ee->prop.cursor.object,
-                          e->y - ee->prop.cursor.hot.x,
-                          (fbw - ee->w) + ee->w - e->x - 1 - ee->prop.cursor.hot.y);
-     }
-   if (ee->rotation == 0)
-     evas_event_feed_mouse_move(ee->evas, e->x, e->y);
-   else if (ee->rotation == 90)
-     evas_event_feed_mouse_move(ee->evas, (fbh - ee->h) + ee->h - e->y - 1, e->x);
-   else if (ee->rotation == 180)
-     evas_event_feed_mouse_move(ee->evas, (fbw - ee->w) + ee->w - e->x - 1, (fbh - 
ee->h) + ee->h - e->y - 1);
-   else if (ee->rotation == 270)
-     evas_event_feed_mouse_move(ee->evas, e->y, (fbw - ee->w) + ee->w - e->x - 1);
+   _ecore_evas_mouse_move_process(ee, e->x, e->y);
    return 0; /* dont pass it on */
 }
 
@@ -253,6 +244,7 @@
      evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
    else
      evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
+   _ecore_evas_mouse_move_process(ee, ee->mouse.x, ee->mouse.y);
    if (ee->func.fn_resize) ee->func.fn_resize(ee);
 }
 
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_evas/Attic/ecore_evas_private.h,v
retrieving revision 1.1.2.12
retrieving revision 1.1.2.13
diff -u -3 -r1.1.2.12 -r1.1.2.13
--- ecore_evas_private.h        12 Feb 2003 23:29:43 -0000      1.1.2.12
+++ ecore_evas_private.h        13 Feb 2003 01:57:47 -0000      1.1.2.13
@@ -89,7 +89,15 @@
    short       rotation;
    char        shaped  : 1;
    char        visible : 1;
+   
+   struct {
+      int      x, y;
+   } mouse;
 
+   struct {
+      int      w, h;
+   } expecting_resize;
+   
    struct {
       char           *title;
       char           *name;
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_evas/Attic/ecore_evas_x.c,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -3 -r1.1.2.5 -r1.1.2.6
--- ecore_evas_x.c      12 Feb 2003 23:29:43 -0000      1.1.2.5
+++ ecore_evas_x.c      13 Feb 2003 01:57:47 -0000      1.1.2.6
@@ -14,6 +14,41 @@
 static Ecore_Event_Handler *ecore_evas_event_handlers[15];
 static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;
 
+static void
+_ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y)
+{
+   ee->mouse.x = x;
+   ee->mouse.y = y;
+   if (ee->prop.cursor.object)
+     {
+       evas_object_show(ee->prop.cursor.object);
+       if (ee->rotation == 0)
+         evas_object_move(ee->prop.cursor.object, 
+                          x - ee->prop.cursor.hot.x,
+                          y - ee->prop.cursor.hot.y);
+       else if (ee->rotation == 90)
+         evas_object_move(ee->prop.cursor.object, 
+                          ee->h - y - 1 - ee->prop.cursor.hot.x,
+                          x - ee->prop.cursor.hot.y);
+       else if (ee->rotation == 180)
+         evas_object_move(ee->prop.cursor.object, 
+                          ee->w - x - 1 - ee->prop.cursor.hot.x,
+                          ee->h - y - 1 - ee->prop.cursor.hot.y);
+       else if (ee->rotation == 270)
+         evas_object_move(ee->prop.cursor.object, 
+                          y - ee->prop.cursor.hot.x,
+                          ee->w - x - 1 - ee->prop.cursor.hot.y);
+     }
+   if (ee->rotation == 0)
+     evas_event_feed_mouse_move(ee->evas, x, y);
+   else if (ee->rotation == 90)
+     evas_event_feed_mouse_move(ee->evas, ee->h - y - 1, x);
+   else if (ee->rotation == 180)
+     evas_event_feed_mouse_move(ee->evas, ee->w - x - 1, ee->h - y - 1);
+   else if (ee->rotation == 270)
+     evas_event_feed_mouse_move(ee->evas, y, ee->w - x - 1);
+}
+
 static Ecore_Evas *
 _ecore_evas_x_match(Window win)
 {
@@ -111,14 +146,7 @@
    ee = _ecore_evas_x_match(e->win);
    if (!ee) return 1; /* pass on event */
    _ecore_evas_modifer_locks_update(ee, e->modifiers);
-   if (ee->rotation == 0)
-     evas_event_feed_mouse_move(ee->evas, e->x, e->y);
-   else if (ee->rotation == 90)
-     evas_event_feed_mouse_move(ee->evas, ee->h - e->y - 1, e->x);
-   else if (ee->rotation == 180)
-     evas_event_feed_mouse_move(ee->evas, ee->w - e->x - 1, ee->h - e->y - 1);
-   else if (ee->rotation == 270)
-     evas_event_feed_mouse_move(ee->evas, e->y, ee->w - e->x - 1);
+   _ecore_evas_mouse_move_process(ee, e->x, e->y);
    evas_event_feed_mouse_down(ee->evas, e->button);
    return 0; /* dont pass it on */
 }
@@ -133,15 +161,8 @@
    ee = _ecore_evas_x_match(e->win);
    if (!ee) return 1; /* pass on event */
    _ecore_evas_modifer_locks_update(ee, e->modifiers);   
-   if (ee->rotation == 0)
-     evas_event_feed_mouse_move(ee->evas, e->x, e->y);
-   else if (ee->rotation == 90)
-     evas_event_feed_mouse_move(ee->evas, ee->h - e->y - 1, e->x);
-   else if (ee->rotation == 180)
-     evas_event_feed_mouse_move(ee->evas, ee->w - e->x - 1, ee->h - e->y - 1);
-   else if (ee->rotation == 270)
-     evas_event_feed_mouse_move(ee->evas, e->y, ee->w - e->x - 1); 
-  evas_event_feed_mouse_up(ee->evas, e->button);
+   _ecore_evas_mouse_move_process(ee, e->x, e->y);
+   evas_event_feed_mouse_up(ee->evas, e->button);
    return 0; /* dont pass it on */
 }
 
@@ -154,35 +175,8 @@
    e = event;
    ee = _ecore_evas_x_match(e->win);
    if (!ee) return 1; /* pass on event */
-   if (ee->prop.cursor.object)
-     {
-       evas_object_show(ee->prop.cursor.object);
-       if (ee->rotation == 0)
-         evas_object_move(ee->prop.cursor.object, 
-                          e->x - ee->prop.cursor.hot.x,
-                          e->y - ee->prop.cursor.hot.y);
-       else if (ee->rotation == 90)
-         evas_object_move(ee->prop.cursor.object, 
-                          ee->h - e->y - 1 - ee->prop.cursor.hot.x,
-                          e->x - ee->prop.cursor.hot.y);
-       else if (ee->rotation == 180)
-         evas_object_move(ee->prop.cursor.object, 
-                          ee->w - e->x - 1 - ee->prop.cursor.hot.x,
-                          ee->h - e->y - 1 - ee->prop.cursor.hot.y);
-       else if (ee->rotation == 270)
-         evas_object_move(ee->prop.cursor.object, 
-                          e->y - ee->prop.cursor.hot.x,
-                          ee->w - e->x - 1 - ee->prop.cursor.hot.y);
-     }
-   _ecore_evas_modifer_locks_update(ee, e->modifiers);   
-   if (ee->rotation == 0)
-     evas_event_feed_mouse_move(ee->evas, e->x, e->y);
-   else if (ee->rotation == 90)
-     evas_event_feed_mouse_move(ee->evas, ee->h - e->y - 1, e->x);
-   else if (ee->rotation == 180)
-     evas_event_feed_mouse_move(ee->evas, ee->w - e->x - 1, ee->h - e->y - 1);
-   else if (ee->rotation == 270)
-     evas_event_feed_mouse_move(ee->evas, e->y, ee->w - e->x - 1);
+   _ecore_evas_modifer_locks_update(ee, e->modifiers);
+   _ecore_evas_mouse_move_process(ee, e->x, e->y);
    return 0; /* dont pass it on */
 }
 
@@ -195,37 +189,10 @@
    e = event;
    ee = _ecore_evas_x_match(e->win);
    if (!ee) return 1; /* pass on event */
-   if (ee->prop.cursor.object)
-     {
-       evas_object_show(ee->prop.cursor.object);
-       if (ee->rotation == 0)
-         evas_object_move(ee->prop.cursor.object, 
-                          e->x - ee->prop.cursor.hot.x,
-                          e->y - ee->prop.cursor.hot.y);
-       else if (ee->rotation == 90)
-         evas_object_move(ee->prop.cursor.object, 
-                          ee->h - e->y - 1 - ee->prop.cursor.hot.x,
-                          e->x - ee->prop.cursor.hot.y);
-       else if (ee->rotation == 180)
-         evas_object_move(ee->prop.cursor.object, 
-                          ee->w - e->x - 1 - ee->prop.cursor.hot.x,
-                          ee->h - e->y - 1 - ee->prop.cursor.hot.y);
-       else if (ee->rotation == 270)
-         evas_object_move(ee->prop.cursor.object, 
-                          e->y - ee->prop.cursor.hot.x,
-                          ee->w - e->x - 1 - ee->prop.cursor.hot.y);
-     }
    if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
    _ecore_evas_modifer_locks_update(ee, e->modifiers);
    evas_event_feed_mouse_in(ee->evas);
-   if (ee->rotation == 0)
-     evas_event_feed_mouse_move(ee->evas, e->x, e->y);
-   else if (ee->rotation == 90)
-     evas_event_feed_mouse_move(ee->evas, ee->h - e->y - 1, e->x);
-   else if (ee->rotation == 180)
-     evas_event_feed_mouse_move(ee->evas, ee->w - e->x - 1, ee->h - e->y - 1);
-   else if (ee->rotation == 270)
-     evas_event_feed_mouse_move(ee->evas, e->y, ee->w - e->x - 1);
+   _ecore_evas_mouse_move_process(ee, e->x, e->y);
    return 0; /* dont pass it on */
 }
 
@@ -239,14 +206,7 @@
    ee = _ecore_evas_x_match(e->win);
    if (!ee) return 1; /* pass on event */
    _ecore_evas_modifer_locks_update(ee, e->modifiers);   
-   if (ee->rotation == 0)
-     evas_event_feed_mouse_move(ee->evas, e->x, e->y);
-   else if (ee->rotation == 90)
-     evas_event_feed_mouse_move(ee->evas, ee->h - e->y - 1, e->x);
-   else if (ee->rotation == 180)
-     evas_event_feed_mouse_move(ee->evas, ee->w - e->x - 1, ee->h - e->y - 1);
-   else if (ee->rotation == 270)
-     evas_event_feed_mouse_move(ee->evas, e->y, ee->w - e->x - 1);
+   _ecore_evas_mouse_move_process(ee, e->x, e->y);
    evas_event_feed_mouse_out(ee->evas);
    if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
    if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
@@ -390,6 +350,15 @@
             ecore_evas_shaped_set(ee, 0);
             ecore_evas_shaped_set(ee, 1);
          }
+       if ((ee->expecting_resize.w > 0) &&
+           (ee->expecting_resize.h > 0))
+         {
+            if ((ee->expecting_resize.w == ee->w) &&
+                (ee->expecting_resize.h == ee->h))
+              _ecore_evas_mouse_move_process(ee, ee->mouse.x, ee->mouse.y);
+            ee->expecting_resize.w = 0;
+            ee->expecting_resize.h = 0;
+         }
        if (ee->func.fn_resize) ee->func.fn_resize(ee); 
      }
    return 0; /* dont pass it on */
@@ -618,7 +587,11 @@
        einfo->info.rotation = rotation;
        evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
        if (!ee->prop.fullscreen)
-         ecore_x_window_resize(ee->engine.x.win_container, ee->h, ee->w);
+         {
+            ecore_x_window_resize(ee->engine.x.win_container, ee->h, ee->w);
+            ee->expecting_resize.w = ee->h;
+            ee->expecting_resize.h = ee->w;
+         }
        else
          {
             int w, h;
@@ -635,6 +608,7 @@
                  evas_output_size_set(ee->evas, ee->h, ee->w);
                  evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
               }
+            if (ee->func.fn_resize) ee->func.fn_resize(ee);    
          }
        ecore_evas_size_min_get(ee, &minw, &minh);
        ecore_evas_size_max_get(ee, &maxw, &maxh);
@@ -651,12 +625,13 @@
        einfo->info.rotation = rotation;
        evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
        ee->rotation = rotation;
+       _ecore_evas_mouse_move_process(ee, ee->mouse.x, ee->mouse.y);
+       if (ee->func.fn_resize) ee->func.fn_resize(ee); 
      }
    if ((ee->rotation == 90) || (ee->rotation == 270))
      evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
    else
      evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
-   if (ee->func.fn_resize) ee->func.fn_resize(ee);     
 }
 
 static void




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to