Enlightenment CVS committal

Author  : atmosphere
Project : e17
Module  : apps/iconbar

Dir     : e17/apps/iconbar/src


Modified Files:
        iconbar.c iconbar.h main.c 


Log Message:
support min/max sizes in iconbar.


===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/iconbar/src/iconbar.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- iconbar.c   16 Jan 2004 08:12:55 -0000      1.8
+++ iconbar.c   17 Jan 2004 01:34:05 -0000      1.9
@@ -48,7 +48,17 @@
   
   return iconbar;
 }
+Evas_Object *
+iconbar_gui_get(Evas_Object *o)
+{
+    Iconbar *ib = NULL;
 
+    if((ib = evas_object_smart_data_get(o)))
+    {
+       return(ib->gui);
+    }
+    return(NULL);
+}
 /* set the path for data (bits, order, icons) */
 void
 iconbar_path_set(Evas_Object *obj, char *path)
@@ -56,13 +66,21 @@
   Iconbar *ib = evas_object_smart_data_get(obj);
   char buf[2048];
 
+  if(ib->path) free(ib->path);
   ib->path = (char *)strdup(path);
 
   snprintf(buf, sizeof(buf) - 1, "%s/iconbar.eet", ib->path);
-  ib->gui = edje_object_add(evas_object_evas_get(ib->obj));
-  edje_object_file_set(ib->gui, buf, "iconbar");
-
-  if (!ib->gui)
+  if((ib->gui = edje_object_add(evas_object_evas_get(ib->obj))))
+  {
+    if(!edje_object_file_set(ib->gui, buf, "iconbar"))
+    {
+       evas_object_del(ib->gui);
+       ib->gui = NULL;
+       if(ib->path) free(ib->path);
+       return;
+    }
+  }
+  else
   {
     printf("no bits!\n");
     return;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/iconbar/src/iconbar.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- iconbar.h   12 Dec 2003 20:21:34 -0000      1.2
+++ iconbar.h   17 Jan 2004 01:34:05 -0000      1.3
@@ -45,6 +45,7 @@
 };
 
 Evas_Object *iconbar_new(Evas *evas);
+Evas_Object *iconbar_gui_get(Evas_Object *o);
 Evas_Smart *iconbar_smart_get();
 double iconbar_icons_length_get(Iconbar *ib);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/iconbar/src/main.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- main.c      15 Jan 2004 06:05:32 -0000      1.7
+++ main.c      17 Jan 2004 01:34:05 -0000      1.8
@@ -26,8 +26,10 @@
 int
 main(int argc, char **argv)
 {
-  int i, withdrawn = 0;
   char buf[2048];
+  int i, withdrawn = 0;
+  Evas_Coord edjew, edjeh;
+  Evas_Object *edje = NULL;
 
   for (i = 1; i < argc; i++)
   {
@@ -47,7 +49,6 @@
   ecore_evas_callback_move_set(ee, resize);
 
 
-  ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, cb_exit, ee);
 
   ecore_evas_callback_delete_request_set(ee, cb_exit);
   ecore_evas_callback_destroy_set(ee, cb_exit);
@@ -79,6 +80,16 @@
   if (e_file_exists(buf))
   {
     iconbar_path_set(iconbar, buf);
+    if((edje = iconbar_gui_get(iconbar)))
+    {
+       edje_object_size_min_get(edje, &edjew, &edjeh);
+       if((edjew > 0) && (edjeh > 0))
+           ecore_evas_size_min_set(ee, (int)edjew, (int)edjeh);
+       
+       edje_object_size_max_get(edje, &edjew, &edjeh);
+       if((edjew > 0) && (edjeh > 0))
+           ecore_evas_size_max_set(ee, (int)edjew, (int)edjeh);
+    }
   }
 
   else




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to