Enlightenment CVS committal

Author  : atmosphere
Project : e17
Module  : proto

Dir     : e17/proto/esmart/src/draggies


Modified Files:
        dragable.c dragable.h 


Log Message:
remove unneeded edje include, also strip out the different dragable types,
since it's going go the way i originally intended :)  Thank Spanky for the
spanking.


===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/esmart/src/draggies/dragable.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- dragable.c  6 Jan 2004 18:14:15 -0000       1.1
+++ dragable.c  13 Jan 2004 18:04:15 -0000      1.2
@@ -40,38 +40,6 @@
              drag->first = drag->clicked = 1;
              drag->cx = e->canvas.x;
              drag->cy = e->canvas.y;
-             switch (drag->type)
-               {
-                 /*
-                    case DRAGGIES_TYPE_RESIZE_L:
-                    ecore_evas_gravity_set(drag->ee, 4);
-                    break;
-                    case DRAGGIES_TYPE_RESIZE_R:
-                    ecore_evas_gravity_set(drag->ee, 6);
-                    break;
-                    case DRAGGIES_TYPE_RESIZE_T:
-                    ecore_evas_gravity_set(drag->ee, 2);
-                    break;
-                    case DRAGGIES_TYPE_RESIZE_B:
-                    ecore_evas_gravity_set(drag->ee, 8);
-                    break;
-                    case DRAGGIES_TYPE_RESIZE_TR:
-                    ecore_evas_gravity_set(drag->ee, 3);
-                    break;
-                    case DRAGGIES_TYPE_RESIZE_TL:
-                    ecore_evas_gravity_set(drag->ee, 1);
-                    break;
-                    case DRAGGIES_TYPE_RESIZE_BL:
-                    ecore_evas_gravity_set(drag->ee, 7);
-                    break;
-                    case DRAGGIES_TYPE_RESIZE_BR:
-                    ecore_evas_gravity_set(drag->ee, 9);
-                    break;
-                    default:
-                    ecore_evas_gravity_set(drag->ee, 1);
-                    break;
-                  */
-               }
            }
        }
     }
@@ -90,7 +58,6 @@
          if (drag->clicked)
            {
              double dx, dy;
-             Evas_Coord ox, oy, ow, oh;
 
              ecore_evas_geometry_get (drag->ee, &x, &y, &w, &h);
              dx = (drag->cx - e->cur.canvas.x);
@@ -98,63 +65,17 @@
              if ((dx < 1) && (dy < 1))
                return;
 
-             drag->cx = e->cur.canvas.x;
-             drag->cy = e->cur.canvas.y;
-             switch (drag->type)
+             ecore_evas_move (drag->ee, x - (int) dx, y - (int) dy);
+             if (!drag->first)
+               {
+                 drag->cx = e->cur.canvas.x + dx;
+                 drag->cy = e->cur.canvas.y + dy;
+               }
+             else
                {
-               case DRAGGIES_TYPE_RESIZE_L:
-                 ecore_evas_move_resize (drag->ee, x + (int) dx, y,
-                                         w - (int) dx, h);
-                 break;
-               case DRAGGIES_TYPE_RESIZE_R:
-                 ecore_evas_resize (drag->ee, w - (int) dx, h);
-                 drag->cx -= dx;
-                 break;
-               case DRAGGIES_TYPE_RESIZE_T:
-                 ecore_evas_move_resize (drag->ee, x, y - (int) dy,
-                                         w, h + (int) dy);
-                 break;
-               case DRAGGIES_TYPE_RESIZE_B:
-                 ecore_evas_resize (drag->ee, w, h - (int) dy);
-                 drag->cy -= dy;
-                 break;
-               case DRAGGIES_TYPE_RESIZE_TL:
-                 ecore_evas_move_resize (drag->ee, x - (int) dx, y -
-                                         (int) dy, w + (int) dx,
-                                         h + (int) dy);
-                 break;
-               case DRAGGIES_TYPE_RESIZE_TR:
-                 ecore_evas_move_resize (drag->ee, x, y - (int) dy, w -
-                                         (int) dx, h + (int) dy);
-                 drag->cy += dy;
-                 drag->cx += dx;
-                 break;
-               case DRAGGIES_TYPE_RESIZE_BL:
-                 ecore_evas_move_resize (drag->ee, x - (int) dx,
-                                         y - (int) dy,
-                                         w - (int) dx, h - (int) dy);
-                 break;
-               case DRAGGIES_TYPE_RESIZE_BR:
-                 /* Gravity */
-                 ecore_evas_resize (drag->ee, w - (int) dx, h - (int) dy);
-                 drag->cy -= dy;
-                 drag->cx -= dx;
-                 break;
-                 /* default: is Moving */
-               default:
-                 ecore_evas_move (drag->ee, x - (int) dx, y - (int) dy);
-                 if (!drag->first)
-                   {
-                     drag->cx = e->cur.canvas.x + dx;
-                     drag->cy = e->cur.canvas.y + dy;
-                   }
-                 else
-                   {
-                     drag->cx = e->cur.canvas.x;
-                     drag->cy = e->cur.canvas.y;
-                     drag->first = 0;
-                   }
-                 break;
+                 drag->cx = e->cur.canvas.x;
+                 drag->cy = e->cur.canvas.y;
+                 drag->first = 0;
                }
            }
        }
@@ -215,15 +136,3 @@
        }
     }
 }
-void
-esmart_draggies_type_set (Evas_Object * o, Esmart_Draggies_Type type)
-{
-  Esmart_Draggies *drag = NULL;
-  if (o)
-    {
-      if ((drag = (Esmart_Draggies *) evas_object_data_get (o, "Dragger")))
-       {
-         drag->type = type;
-       }
-    }
-}
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/esmart/src/draggies/dragable.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- dragable.h  6 Jan 2004 18:14:15 -0000       1.1
+++ dragable.h  13 Jan 2004 18:04:15 -0000      1.2
@@ -2,30 +2,12 @@
 #define ESMART_DRAGGIES_H
 
 #include<Evas.h>
-#include<Edje.h>
+#include<Ecore.h>
 #include<Ecore_Evas.h>
 
-/**
- * Different dragable types
- */
-enum _Esmart_Draggies_Type
-{
-  DRAGGIES_TYPE_MOVER = 0,
-  DRAGGIES_TYPE_RESIZE_L,
-  DRAGGIES_TYPE_RESIZE_R,
-  DRAGGIES_TYPE_RESIZE_T,
-  DRAGGIES_TYPE_RESIZE_B,
-  DRAGGIES_TYPE_RESIZE_BR,
-  DRAGGIES_TYPE_RESIZE_BL,
-  DRAGGIES_TYPE_RESIZE_TR,
-  DRAGGIES_TYPE_RESIZE_TL
-};
-typedef enum _Esmart_Draggies_Type Esmart_Draggies_Type;
 
 /**
  * How to use Esmart Draggies.
- *
- * Assign it to an edje part, that's dragable and unconfined
  */
 typedef struct _Esmart_Draggies Esmart_Draggies;
 
@@ -33,15 +15,13 @@
 {
   Ecore_Evas *ee;              /* The ecore_evas that should move */
   Evas_Coord cx, cy, cw, ch;   /* current mouse x/y ecore_evas h/w */
-  Esmart_Draggies_Type type;   /* Resizer or Dragger */
   int clicked;                 /* Whether the mouse is down now or not */
-  int first;                   /* Whether the mouse is down now or not */
+  int first;                   /* Whether it's the first move or not */
   int button;                  /* the button that handles dragging */
 };
 
 Evas_Object *esmart_draggies_new (Ecore_Evas * evas);
 void esmart_draggies_free (Evas_Object * o);
-void esmart_draggies_type_set (Evas_Object * o, Esmart_Draggies_Type type);
 void esmart_draggies_button_set (Evas_Object * o, int button);
 
 #endif




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to