Enlightenment CVS committal

Author  : atmosphere
Project : e17
Module  : proto

Dir     : e17/proto/esmart/src/thumb


Modified Files:
        E_Thumb.c 


Log Message:
e_thumb_freshen fixup
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/esmart/src/thumb/E_Thumb.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- E_Thumb.c   29 Feb 2004 22:22:13 -0000      1.14
+++ E_Thumb.c   1 Mar 2004 05:53:45 -0000       1.15
@@ -34,21 +34,25 @@
   if (file)
     {
       E_Thumb *e = NULL;
-      Evas_Smart *s = NULL;
-      s = evas_smart_new ("E_Thumb",
-                         _e_thumb_add,
-                         _e_thumb_del,
-                         _e_thumb_layer_set,
-                         _e_thumb_raise,
-                         _e_thumb_lower,
-                         _e_thumb_stack_above,
-                         _e_thumb_stack_below,
-                         _e_thumb_move,
-                         _e_thumb_resize,
-                         _e_thumb_show,
-                         _e_thumb_hide,
-                         _e_thumb_color_set,
-                         _e_thumb_clip_set, _e_thumb_clip_unset, NULL);
+      static Evas_Smart *s = NULL;
+
+      if (!s)
+       {
+         s = evas_smart_new ("E_Thumb",
+                             _e_thumb_add,
+                             _e_thumb_del,
+                             _e_thumb_layer_set,
+                             _e_thumb_raise,
+                             _e_thumb_lower,
+                             _e_thumb_stack_above,
+                             _e_thumb_stack_below,
+                             _e_thumb_move,
+                             _e_thumb_resize,
+                             _e_thumb_show,
+                             _e_thumb_hide,
+                             _e_thumb_color_set,
+                             _e_thumb_clip_set, _e_thumb_clip_unset, NULL);
+       }
       result = evas_object_smart_add (evas, s);
 
       if ((e = (E_Thumb *) evas_object_smart_data_get (result)))
@@ -142,16 +146,14 @@
              imlib_context_set_image (tmp);
 
              result = evas_object_image_add (evas_object_evas_get (o));
-             evas_object_image_alpha_set (result, 1);
              if (e->info->w == 0)
                e->info->w = imlib_image_get_width ();
              if (e->info->h == 0)
                e->info->h = imlib_image_get_height ();
              evas_object_image_size_set (result, e->info->w, e->info->h);
-
+             evas_object_image_alpha_set (result, imlib_image_has_alpha ());
              evas_object_image_data_copy_set (result,
-                                              imlib_image_get_data_for_reading_only
-                                              ());
+                                              imlib_image_get_data ());
              imlib_free_image_and_decache ();
            }
        }
@@ -187,29 +189,31 @@
        {
          if (epsilon_exists (e->e) == EPSILON_FAIL)
            {
+             if (e->info)
+               epsilon_info_free (e->info);
+             e->info = NULL;
              if (e->image)
                evas_object_del (e->image);
-             if (epsilon_exists (e->e) == EPSILON_FAIL)
+             e->image = NULL;
+
+             if (epsilon_generate (e->e) == EPSILON_OK)
                {
-                 if (epsilon_generate (e->e) == EPSILON_OK)
+                 result = EPSILON_OK;
+                 evas_image_cache_flush (evas_object_evas_get (o));
+                 e->image = evas_object_image_add (evas_object_evas_get (o));
+                 evas_object_image_file_set (e->image,
+                                             epsilon_thumb_file_get (e->
+                                                                     e),
+                                             NULL);
+                 if (!evas_object_image_load_error_get (e->image))
                    {
-                     result = EPSILON_OK;
-                     evas_image_cache_flush (evas_object_evas_get (o));
-                     e->image =
-                       evas_object_image_add (evas_object_evas_get (o));
-                     evas_object_image_file_set (e->image,
-                                                 epsilon_thumb_file_get (e->
-                                                                         e),
-                                                 NULL);
-                     if (!evas_object_image_load_error_get (e->image))
-                       {
-                         evas_object_image_size_get (e->image, &e->tw,
-                                                     &e->th);
-                         evas_object_repeat_events_set (e->image, 1);
-                         evas_object_show (e->image);
-                         evas_object_resize (o, e->w, e->h);
-                       }
+                     evas_object_image_size_get (e->image, &e->tw, &e->th);
+                     evas_object_repeat_events_set (e->image, 1);
+                     evas_object_show (e->image);
+                     evas_object_resize (o, e->w, e->h);
                    }
+                 if (!e->info)
+                   e->info = epsilon_info_get (e->e);
                }
            }
        }




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to