Enlightenment CVS committal

Author  : lordchaos
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_iconbox.c ewl_iconbox.h 


Log Message:
Icon remove code

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -3 -r1.44 -r1.45
--- ewl_iconbox.c       23 Oct 2005 08:15:32 -0000      1.44
+++ ewl_iconbox.c       23 Oct 2005 09:58:12 -0000      1.45
@@ -626,11 +626,40 @@
 
 
 
-void ewl_iconbox_icon_remove(Ewl_IconBox_Icon* icon)
-{
-       /*printf("Removing icon: %s", ewl_border_text_get(EWL_BORDER(icon)));*/
-}
+void ewl_iconbox_icon_remove(Ewl_IconBox* ib, Ewl_IconBox_Icon* icon) {
+       Ewl_IconBox_Icon* list_item;
+
+       if (ib->ewl_iconbox_icon_list) {
+               Ecore_List* new_icon_list = ecore_list_new();
+               
+               ecore_list_goto_first(ib->ewl_iconbox_icon_list);
+               while((list_item = 
(Ewl_IconBox_Icon*)ecore_list_next(ib->ewl_iconbox_icon_list)) != NULL) {
+                       
+                       if (list_item == icon) {
+                               
ewl_floater_follow_set(EWL_FLOATER(EWL_ICONBOX_ICON(list_item)->floater), NULL);
+                               ewl_widget_destroy(EWL_WIDGET(list_item));      
        
+
+                               if (ib->drag_icon == icon) {
+                                       ib->drag_icon = NULL;
+                               }
+                               if (ib->edit_icon == icon) {
+                                       ib->edit_icon = NULL;
+                               }
+                               if (ib->select_icon == icon) {
+                                       ib->select_icon = NULL;
+                               }
+                               
+                       } else {
+                               ecore_list_append(new_icon_list, list_item);
+                       }
+               }
 
+               ecore_list_destroy(ib->ewl_iconbox_icon_list);
+               ib->ewl_iconbox_icon_list = new_icon_list;
+       }
+
+
+}
 
 
 
@@ -1027,7 +1056,6 @@
 void ewl_iconbox_configure_cb(Ewl_Widget *w, void *ev_data, void *user_data)
 {
        /*printf ("Got a configure\n");*/
-       int xx,yy,ww,hh;
 
        Ewl_IconBox* ib = EWL_ICONBOX(w);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- ewl_iconbox.h       23 Oct 2005 08:15:32 -0000      1.19
+++ ewl_iconbox.h       23 Oct 2005 09:58:12 -0000      1.20
@@ -126,6 +126,7 @@
 void ewl_iconbox_background_set(Ewl_IconBox* ib, char* file);
 void ewl_iconbox_context_menu_item_add(Ewl_IconBox* ib, Ewl_Widget* item);
 void ewl_iconbox_icon_menu_item_add(Ewl_IconBox* ib, Ewl_Widget* item);
+void ewl_iconbox_icon_remove(Ewl_IconBox* ib, Ewl_IconBox_Icon* icon);
 void ewl_iconbox_scrollpane_recalculate(Ewl_IconBox* ib);
 Ecore_List* ewl_iconbox_get_selection(Ewl_IconBox* ib);
 




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to