Enlightenment CVS committal

Author  : codewarrior
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_icon_layout.c e_icon_layout.h 


Log Message:
- add ability to freeze / thaw clip so we can scroll without moving it with us

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_icon_layout.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_icon_layout.c     14 Oct 2005 11:18:00 -0000      1.1
+++ e_icon_layout.c     14 Oct 2005 11:51:30 -0000      1.2
@@ -16,6 +16,7 @@
    Evas_Object     *clip;
    Evas_Object     *obj;
    int              frozen;
+   int              clip_frozen;
    unsigned char    changed : 1;
    Evas_List       *items;
 };
@@ -252,6 +253,28 @@
     }      
 }
 
+void
+e_icon_layout_clip_freeze(Evas_Object *obj)
+{
+   E_Smart_Data *sd;
+   
+   if ((!obj) || !(sd = evas_object_smart_data_get(obj)))
+     return;
+   
+   sd->clip_frozen = 1;
+}
+
+void
+e_icon_layout_clip_thaw(Evas_Object *obj)
+{
+   E_Smart_Data *sd;
+   
+   if ((!obj) || !(sd = evas_object_smart_data_get(obj)))
+     return;
+   
+   sd->clip_frozen = 0;
+}
+
 /* local subsystem functions */
 static E_Icon_Layout_Item *
 _e_icon_layout_smart_adopt(E_Smart_Data *sd, Evas_Object *obj)
@@ -398,8 +421,8 @@
    sd->yc = 0;
    sd->clip = evas_object_rectangle_add(evas_object_evas_get(obj));
    evas_object_smart_member_add(sd->clip, obj);
-   evas_object_move(sd->clip, -100000, -100000);
-   evas_object_resize(sd->clip, 200000, 200000);
+   evas_object_move(sd->clip, 0, 0);
+   evas_object_resize(sd->clip, 0, 0);
    evas_object_color_set(sd->clip, 255, 255, 255, 255);
    evas_object_smart_data_set(obj, sd);
 }
@@ -516,6 +539,9 @@
        Evas_List *l;
        Evas_Coord dx, dy;
        
+       if(!sd->clip_frozen)
+        evas_object_move(sd->clip, x, y);
+       
        dx = x - sd->x;
        dy = y - sd->y;
        for (l = sd->items; l; l = l->next)
@@ -538,6 +564,7 @@
    sd = evas_object_smart_data_get(obj);
    if (!sd) return;
    if ((w == sd->w) && (h == sd->h)) return;
+   evas_object_resize(sd->clip, w, h);
    sd->w = w;
    sd->h = h;
    sd->changed = 1;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_icon_layout.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_icon_layout.h     14 Oct 2005 11:18:00 -0000      1.1
+++ e_icon_layout.h     14 Oct 2005 11:51:30 -0000      1.2
@@ -18,6 +18,8 @@
 EAPI void         e_icon_layout_unpack            (Evas_Object *obj);
 EAPI void         e_icon_layout_spacing_set(Evas_Object *obj, Evas_Coord xs, 
Evas_Coord ys);
 EAPI void         e_icon_layout_redraw_force      (Evas_Object *obj);
+EAPI void         e_icon_layout_clip_freeze       (Evas_Object *obj);
+EAPI void         e_icon_layout_clip_thaw         (Evas_Object *obj);
 
 #endif
 #endif




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to