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:
. Change layer for drag select box
. Add support for background files

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- ewl_iconbox.c       22 Sep 2005 04:14:27 -0000      1.22
+++ ewl_iconbox.c       2 Oct 2005 00:57:41 -0000       1.23
@@ -76,6 +76,16 @@
                ewl_iconbox_inner_pane_calculate(EWL_ICONBOX(w));
                /*ewl_iconbox_icon_arrange(ib); */
                ewl_callback_append(EWL_WIDGET(ib), EWL_CALLBACK_CONFIGURE, 
configure, NULL);
+
+               /*Handle the background, if any*/
+               if (ib->background) {
+                       evas_object_clip_set(ib->background, 
EWL_WIDGET(ib)->fx_clip_box);
+                       evas_object_move(ib->background, CURRENT_X(ib), 
CURRENT_Y(ib));
+                       evas_object_layer_set(ib->background, -1000);
+
+                       evas_object_image_fill_set(ib->background, 0,0, 
CURRENT_W(ib), CURRENT_H(ib));
+                       evas_object_resize(ib->background, CURRENT_W(ib), 
CURRENT_H(ib));
+               }
        }
 }
 
@@ -222,13 +232,13 @@
        /* Create the selector / selector floater */
        ib->select_floater = ewl_floater_new(ib->ewl_iconbox_pane_inner);
        ewl_object_fill_policy_set(EWL_OBJECT(ib->select_floater), 
EWL_FLAG_FILL_FILL);
-       ib->select =ewl_button_new("");
+       ib->select =ewl_button_new(NULL);
        
        ewl_container_child_append(EWL_CONTAINER(ib->select_floater), 
ib->select);
        ewl_container_child_append(EWL_CONTAINER(ib->ewl_iconbox_pane_inner), 
ib->select_floater);
        
        ewl_object_custom_size_set(EWL_OBJECT(ib->select), 80, 40);
-       ewl_widget_layer_set(EWL_WIDGET(ib->select_floater), 1000);
+       ewl_widget_layer_set(EWL_WIDGET(ib->select_floater), -1);
        ewl_widget_color_set(EWL_WIDGET(ib->select), 128, 50, 70, 128);
        ib->drag_box = 0;
 
@@ -266,6 +276,9 @@
        ewl_object_custom_size_set(EWL_OBJECT(ib->entry_box), 50, 15);
        ewl_object_fill_policy_set(EWL_OBJECT(ib->entry_floater), 
EWL_FLAG_FILL_SHRINK);
        ewl_container_child_append(EWL_CONTAINER(ib->ewl_iconbox_pane_inner), 
ib->entry_floater);
+
+
+       
        
 
        /* Bind a callback to keypress on the entry, so we can update the label 
*/
@@ -288,6 +301,30 @@
 }
 
 
+void ewl_iconbox_background_set(Ewl_IconBox* ib, char* file) {
+       /*Add a background image*/
+       {
+               Ewl_Embed      *emb;
+               emb = ewl_embed_widget_find(EWL_WIDGET(ib));
+               if (emb) {
+                       ib->background = evas_object_image_add(emb->evas);
+                       evas_object_image_file_set(ib->background, file, NULL);
+
+                       evas_object_clip_set(ib->background, 
EWL_WIDGET(ib)->fx_clip_box);
+                       evas_object_move(ib->background, CURRENT_X(ib), 
CURRENT_Y(ib));
+                       evas_object_layer_set(ib->background, -1000);
+
+                       evas_object_image_fill_set(ib->background, 0,0, 
CURRENT_W(ib), CURRENT_H(ib));
+                       evas_object_resize(ib->background, CURRENT_W(ib), 
CURRENT_H(ib));
+                       
+                       evas_object_show(ib->background);
+               } else {
+                       printf("////////////////////////// Could not find top 
level widget\n");
+               }
+       }
+}
+
+
 /* ----------- */
 void ewl_iconbox_arrange_cb(Ewl_Widget *w, void *ev_data, void *user_data) {
        Ewl_IconBox* ib = EWL_ICONBOX(user_data);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_iconbox.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ewl_iconbox.h       17 Aug 2005 18:07:52 -0000      1.7
+++ ewl_iconbox.h       2 Oct 2005 00:57:41 -0000       1.8
@@ -79,6 +79,9 @@
        int xdown, ydown;                  /* Last icon button down x/y, for 
edge resistence */
        int dx, dy;                        /* Drag start x/y */
 
+       /*Background*/
+       Evas_Object* background;
+
        /* Objects for label editing..*/
        Ewl_Widget* entry;
        Ewl_Widget* entry_floater;
@@ -109,6 +112,7 @@
 Ewl_IconBox_Icon* ewl_iconbox_icon_add(Ewl_IconBox* iconbox, char* name, char* 
icon_file);
 void ewl_iconbox_clear(Ewl_IconBox* iconbox);
 void ewl_iconbox_icon_image_set(Ewl_IconBox_Icon* icon, char* filename);
+void ewl_iconbox_background_set(Ewl_IconBox* ib, char* file);
 
 
 /* Internal callbacks */




-------------------------------------------------------
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