Enlightenment CVS committal

Author  : horms
Project : e17
Module  : apps/entice

Dir     : e17/apps/entice/src/bin


Modified Files:
        event.c image.c image.h 


Log Message:
Added flip functionality ('h' and 'v')
Moved key binding for unimplemted help functionality from 'h' to '?'

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/event.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- event.c     14 Feb 2003 09:55:29 -0000      1.5
+++ event.c     14 Feb 2003 10:15:09 -0000      1.6
@@ -198,7 +198,7 @@
      {
        e_fade_info_in(0, NULL);
      }
-   else if (!strcmp(e->key, "h"))
+   else if (!strcmp(e->key, "?"))
      {
        /* FIXME: display help */
      }
@@ -213,6 +213,14 @@
    else if (!strcmp(e->key, "l"))
      {
        e_rotate_l_current_image();
+     }
+   else if (!strcmp(e->key, "h"))
+     {
+       e_flip_h_current_image();
+     }
+   else if (!strcmp(e->key, "v"))
+     {
+       e_flip_v_current_image();
      }
    else if (!strcmp(e->key, "p"))
      {
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/image.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- image.c     14 Feb 2003 09:55:29 -0000      1.6
+++ image.c     14 Feb 2003 10:15:09 -0000      1.7
@@ -223,6 +223,84 @@
 }
 
 static void
+e_flip_object(Evas_Object *obj, int direction)
+{
+   int w;
+   int h;
+   DATA32 *image_data;
+   Imlib_Image image;
+
+   if (!obj)
+       return;
+
+   /* Get image data from Evas */
+   evas_object_image_size_get(obj, &w, &h);
+   image_data = evas_object_image_data_get(obj, 0);
+   if (!image_data)
+     {
+         evas_object_image_data_set(obj, image_data);
+         return;
+     }
+
+   /* Set up imlib image */
+   image = imlib_create_image_using_copied_data(w, h, image_data);
+   evas_object_image_data_set(obj, image_data);
+   imlib_context_set_image(image);
+
+   /* Flip image */
+   if (direction==1)
+         imlib_image_flip_horizontal();
+   else
+         imlib_image_flip_vertical();
+
+   /* Get image data from Imblib */
+   image_data = imlib_image_get_data_for_reading_only();
+
+   /* Set Evas Image Data */
+   evas_object_image_size_set(obj, w, h);
+   evas_object_image_data_copy_set(obj, image_data);
+
+   /* Free Imlib image */
+   imlib_image_put_back_data(image_data);
+   imlib_free_image();
+}
+
+static void
+e_flip_current_image(int direction)
+{
+   Image *im;
+
+   if (!current_image || !current_image->data)
+       return;
+
+   im = (Image *) (current_image->data);
+
+   /* Flip image */
+   e_flip_object(o_image, direction);
+   e_flip_object(o_mini_image, direction);
+   e_flip_object(im->o_thumb, direction);
+
+   /* Update Display */
+   e_handle_resize();
+   e_fix_icons();
+   e_scroll_list(0, NULL);
+   e_fade_scroller_in(0, (void *)1);
+
+}
+
+void
+e_flip_h_current_image(void)
+{
+       e_flip_current_image(1);
+}
+
+void
+e_flip_v_current_image(void)
+{
+       e_flip_current_image(2);
+}
+
+static void
 e_rotate_object(Evas_Object *obj, int rotation)
 {
    int w;
@@ -236,6 +314,11 @@
    /* Get image data from Evas */
    evas_object_image_size_get(obj, &w, &h);
    image_data = evas_object_image_data_get(obj, 0);
+   if (!image_data)
+     {
+         evas_object_image_data_set(obj, image_data);
+         return;
+     }
 
    /* Set up imlib image */
    image = imlib_create_image_using_copied_data(w, h, image_data);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/image.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- image.h     14 Feb 2003 09:55:29 -0000      1.6
+++ image.h     14 Feb 2003 10:15:10 -0000      1.7
@@ -16,6 +16,9 @@
 void                e_rotate_r_current_image(void);
 void                e_rotate_l_current_image(void);
 
+void                e_flip_h_current_image(void);
+void                e_flip_v_current_image(void);
+
 void                e_delete_current_image(void);
 void                e_display_current_image(void);
 




-------------------------------------------------------
This SF.NET email is sponsored by: FREE  SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your  SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to