Enlightenment CVS committal

Author  : handyande
Project : misc
Module  : engage

Dir     : misc/engage/src


Modified Files:
        config.c dock.c engage.h icon.c window.c 


Log Message:
Remove legacy arrow code, allowing a small speedup
fix build_icon bug with spaced titles
slow zooming down a little - looks calming ;)
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/config.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- config.c    5 Oct 2004 21:51:26 -0000       1.40
+++ config.c    6 Oct 2004 15:20:18 -0000       1.41
@@ -121,9 +121,7 @@
   ecore_config_float_create("engage.options.zoom_factor", 2.0, 'Z',
                             "zoom-factor",
                             "Zoom factor of the icons - 1.0 == 100% == nozoom");
-  ecore_config_int_create("engage.options.arrow_size", 6, 'a', "arrow-size",
-                          "Size (in pixels) of the status arrows");
-  ecore_config_float_create("engage.options.zoom_duration", 0.1, 'd',
+  ecore_config_float_create("engage.options.zoom_duration", 0.2, 'd',
                             "zoom-time",
                             "Time taken (in seconds) for icons to zoom");
 
@@ -160,7 +158,6 @@
   options.zoom = ecore_config_int_get("engage.options.zoom");
   ecore_config_listen("zoom", "engage.options.zoom", zoom_listener, 0, NULL);
   options.zoomfactor = ecore_config_float_get("engage.options.zoom_factor");
-  options.arrow_size = ecore_config_int_get("engage.options.arrow_size");
   options.dock_zoom_duration =
     ecore_config_float_get("engage.options.zoom_duration");
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/dock.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- dock.c      5 Oct 2004 21:51:26 -0000       1.12
+++ dock.c      6 Oct 2004 15:20:19 -0000       1.13
@@ -17,7 +17,7 @@
 void
 od_dock_init()
 {
-  int             height = (int) options.size + 2 * (int) options.arrow_size;
+  int             height = (int) options.size + ARROW_SPACE_DOUBLE;
   int            *pic1 = (int *) malloc(sizeof(int) * height);
   int            *pic2 = (int *) malloc(sizeof(int) * height);
   int             y;
@@ -101,7 +101,7 @@
                        } \
                }
   x = 0.5 * (options.width - width);
-  y = options.height - options.arrow_size - 0.5 * options.size;
+  y = options.height - ARROW_SPACE - 0.5 * options.size;
 
   POSITION(dock.applnks);
   x += 0.5 * options.spacing;
@@ -138,10 +138,7 @@
     evas_object_resize(icon->icon, size, size);
     evas_object_move(icon->icon,
                      dock.x + relative_x - 0.5 * size,
-                     options.height - options.arrow_size - size);
-    evas_object_move(icon->arrow,
-                     dock.x + relative_x - options.arrow_size,
-                     options.height - options.arrow_size);
+                     options.height - ARROW_SPACE - size);
 
     if (fabs(relative_x) < 0.5 * size && dock.state != unzoomed)
       od_icon_tt_show(icon);
@@ -153,9 +150,9 @@
 
       evas_object_geometry_get(icon->tt_txt, NULL, NULL, &w, &h);
       evas_object_move(icon->tt_txt, dock.x + relative_x - 0.5 * w,
-                       options.height - 2.0 * options.arrow_size - size - h);
+                       options.height - ARROW_SPACE_DOUBLE - size - h);
       evas_object_move(icon->tt_shd, dock.x + relative_x - 0.5 * w + 1.0,
-                       options.height - 2.0 * options.arrow_size - size - h +
+                       options.height - ARROW_SPACE_DOUBLE - size - h +
                        1.0);
     }
 
@@ -181,31 +178,29 @@
     middle2 = middle2_disp + dock.x;
 
     evas_object_move(dock.background[OD_BG_LEFT], dock.left_end,
-                     options.height - options.size - 2.0 * options.arrow_size);
+                     options.height - options.size - ARROW_SPACE_DOUBLE);
     evas_object_move(dock.background[OD_BG_RIGHT], dock.right_end,
-                     options.height - options.size - 2.0 * options.arrow_size);
+                     options.height - options.size - ARROW_SPACE_DOUBLE);
     if (dock.minwins) {
       evas_object_move(dock.background[OD_BG_MIDDLE], middle,
-                       options.height - options.size -
-                       2.0 * options.arrow_size);
+                       options.height - options.size - ARROW_SPACE_DOUBLE);
       evas_object_show(dock.background[OD_BG_MIDDLE]);
     } else
       evas_object_hide(dock.background[OD_BG_MIDDLE]);
     if (dock.sysicons) { 
       evas_object_move(dock.background[OD_BG_MIDDLE2], middle2,
-                       options.height - options.size -
-                       2.0 * options.arrow_size);
+                       options.height - options.size - ARROW_SPACE_DOUBLE);
       evas_object_show(dock.background[OD_BG_MIDDLE2]);
     } else
       evas_object_hide(dock.background[OD_BG_MIDDLE2]);
     evas_object_image_fill_set(dock.background[OD_BG_FILL], 0.0, 0.0,
                                dock.right_end - dock.left_end - 1.0,
-                               options.size + 2.0 * options.arrow_size);
+                               options.size + ARROW_SPACE_DOUBLE);
     evas_object_resize(dock.background[OD_BG_FILL],
                        dock.right_end - dock.left_end - 1.0,
-                       options.size + 2.0 * options.arrow_size);
+                       options.size + ARROW_SPACE_DOUBLE);
     evas_object_move(dock.background[OD_BG_FILL], dock.left_end + 1.0,
-                     options.height - options.size - 2.0 * options.arrow_size);
+                     options.height - options.size - ARROW_SPACE_DOUBLE);
   }
 
   od_tray_move(dock.right_end - tray_width - 2);
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/engage.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- engage.h    6 Oct 2004 13:34:42 -0000       1.20
+++ engage.h    6 Oct 2004 15:20:19 -0000       1.21
@@ -11,6 +11,9 @@
 
 #include "e17_tmp/e.h"
 
+#define ARROW_SPACE 6
+#define ARROW_SPACE_DOUBLE 12 /* ARROW_SPACE * 2 is less efficient */
+
 typedef enum { false = 0, true = 1 } bool;
 typedef struct _OD_Options OD_Options;
 typedef struct _OD_Window OD_Window;
@@ -87,7 +90,7 @@
   int             grab_min_icons, grab_app_icons;
 
   int             auto_hide;
-  int             size, spacing, arrow_size;    // icon-*
+  int             size, spacing;    // icon-*
   double          zoomfactor, dock_zoom_duration;
 
   unsigned        tt_txt_color, tt_shd_color, bg_fore, bg_back; // color - ARGB
@@ -123,7 +126,7 @@
 #define OD_ICON_STATE_BOUNCING                 0x00000008
 
 struct _OD_Icon {
-  Evas_Object    *icon, *pic, *tt_txt, *tt_shd, *arrow;
+  Evas_Object    *icon, *pic, *tt_txt, *tt_shd;
   unsigned        state;        // see above
   char           *name, *icon_file, *winclass;
   double          x, y;         // relative to evas
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/icon.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- icon.c      6 Oct 2004 13:34:42 -0000       1.36
+++ icon.c      6 Oct 2004 15:20:19 -0000       1.37
@@ -333,8 +333,6 @@
     evas_object_del(icon->tt_txt);
   if (icon->tt_shd)
     evas_object_del(icon->tt_shd);
-  if (icon->arrow)
-    evas_object_del(icon->arrow);
   assert(icon->name);
   free(icon->name);
   free(icon);
@@ -346,36 +344,6 @@
   assert(icon);
   assert(icon->icon);
   edje_object_signal_emit(icon->icon, "engage,app,opened", "");
-#if 0
-  if (icon->arrow)
-    evas_object_show(icon->arrow);
-  else {
-    icon->arrow = evas_object_image_add(evas);
-    int             height = (int) options.arrow_size;
-    int             width = 1 + 2 * (int) options.arrow_size;
-    int            *pattern = (int *) malloc(sizeof(int) * width * height);
-
-    int             x, y;
-
-    for (y = 0; y < height; y++) {
-      for (x = 0; x < width; x++)
-        pattern[y * width + x] = (x + y < 3 * height / 2 ||
-                                  y - x <
-                                  -height / 2 ? 0x00000000 : 0xff000000);
-    }
-
-    evas_object_image_alpha_set(icon->arrow, 1);
-    evas_object_image_size_set(icon->arrow, width, height);
-    evas_object_image_smooth_scale_set(icon->arrow, 0);
-    evas_object_image_data_copy_set(icon->arrow, pattern);
-    evas_object_image_data_update_add(icon->arrow, 0, 0, width, height);
-    evas_object_image_fill_set(icon->arrow, 0.0, 0.0, width, height);
-    evas_object_resize(icon->arrow, width, height);
-    evas_object_layer_set(icon->arrow, 100);
-    evas_object_show(icon->arrow);
-    free(pattern);
-  }
-#endif
 }
 
 void
@@ -384,10 +352,6 @@
   assert(icon);
   assert(icon->icon);
   edje_object_signal_emit(icon->icon, "engage,app,closed", "");
-#if 0
-  if (icon->arrow)
-    evas_object_hide(icon->arrow);
-#endif
 }
 
 void
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/window.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- window.c    5 Oct 2004 21:51:26 -0000       1.23
+++ window.c    6 Oct 2004 15:20:19 -0000       1.24
@@ -300,7 +300,7 @@
   Evas_Event_Mouse_Move *ev = (Evas_Event_Mouse_Move *) event;
 
   if (ev->cur.canvas.y >=
-      (options.height - options.arrow_size - options.size * dock.zoom) &&
+      (options.height - ARROW_SPACE - options.size * dock.zoom) &&
       ev->cur.canvas.y <= options.height && ev->cur.canvas.x > dock.left_end &&
       ev->cur.canvas.x < dock.right_end) {
     dock.x = ev->cur.canvas.x;




-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to