Enlightenment CVS committal

Author  : handyande
Project : misc
Module  : engage

Dir     : misc/engage/src


Modified Files:
        config.c config_menu.c dock.c engage.h 


Log Message:
Engage options += stretch

===================================================================
RCS file: /cvs/e/misc/engage/src/config.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -3 -r1.64 -r1.65
--- config.c    7 Sep 2006 08:41:04 -0000       1.64
+++ config.c    10 Sep 2006 18:38:23 -0000      1.65
@@ -24,6 +24,14 @@
 }
 
 int
+stretch_listener(const char *key, const Ecore_Config_Type type, const int tag,
+                void *data)
+{ 
+  options.stretch = ecore_config_boolean_get(key);
+  return 1;
+}
+
+int
 theme_listener(const char *key, const Ecore_Config_Type type, const int tag,
                void *data)
 {
@@ -107,8 +115,10 @@
                           "Size of icons in default state");
   ecore_config_int_create("engage.options.spacing", 4, 'S', "spacing",
                           "Space in pixels between each icon");
+  ecore_config_boolean_create("engage.options.stretch", 0, 'y', "stretch",
+                              "Stretch the bar whilst zooming icons");
   ecore_config_boolean_create("engage.options.zoom", 1, 'z', "zoom",
-                                "Should we zoom icons?");
+                              "Should we zoom icons?");
   ecore_config_float_create("engage.options.zoom_factor", 2.0, 'Z',
                             "zoom-factor",
                             "Zoom factor of the icons - 1.0 == 100% == 
nozoom");
@@ -158,17 +168,19 @@
   
   options.size = ecore_config_int_get("engage.options.size");
   options.spacing = ecore_config_int_get("engage.options.spacing");
+  options.stretch = ecore_config_boolean_get("engage.options.stretch");
+  ecore_config_listen("stretch", "engage.options.stretch", stretch_listener, 
0, NULL);
   options.zoom = ecore_config_boolean_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.dock_zoom_duration =
-    ecore_config_float_get("engage.options.zoom_duration");
+  ecore_config_float_get("engage.options.zoom_duration");
 
   options.bg_fore = ecore_config_argbint_get("engage.options.bg_fore");
-  ecore_config_listen("colour", "engage.options.bg_fore", 
+  ecore_config_listen("colourfg", "engage.options.bg_fore", 
                       colour_listener, BG_FORE, NULL);
   options.bg_back = ecore_config_argbint_get("engage.options.bg_back");
-  ecore_config_listen("colour", "engage.options.bg_back", 
+  ecore_config_listen("colourbg", "engage.options.bg_back", 
                       colour_listener, BG_BACK, NULL);
 
   options.icon_appear_duration =
===================================================================
RCS file: /cvs/e/misc/engage/src/config_menu.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- config_menu.c       6 Sep 2006 21:27:18 -0000       1.1
+++ config_menu.c       10 Sep 2006 18:38:23 -0000      1.2
@@ -8,8 +8,19 @@
 Etk_Widget *_od_config_menu_app;
 Etk_Widget *_od_config_menu_app_keep, *_od_config_menu_app_remove;
 
-void _od_config_menu_zooming_cb(Etk_Object *object, void *data) {
-  ecore_config_int_set("engage.options.zoom", options.zoom ? 0 : 1);
+void _od_config_menu_zoom_none_cb(Etk_Object *object, void *data) {
+  ecore_config_int_set("engage.options.zoom", 0);
+  ecore_config_int_set("engage.options.stretch", 0);
+}
+
+void _od_config_menu_zoom_zoom_cb(Etk_Object *object, void *data) {
+  ecore_config_int_set("engage.options.zoom", 1);
+  ecore_config_int_set("engage.options.stretch", 0);
+}
+
+void _od_config_menu_zoom_both_cb(Etk_Object *object, void *data) {
+  ecore_config_int_set("engage.options.zoom", 1);
+  ecore_config_int_set("engage.options.stretch", 1);
 }
 
 void _od_config_menu_config_cb(Etk_Object *object, void *data) {
@@ -45,9 +56,22 @@
 //  etk_signal_connect("activated", ETK_OBJECT(menu_item), 
ETK_CALLBACK(_od_config_menu_app_remove_cb), NULL);
   _od_config_menu_app_remove = menu_item;
 
-  menu_item = etk_menu_item_new_with_label("Icon Zooming");
+  menu_item = etk_menu_item_image_new_with_label("Zoom Mode");
+  sub_menu = etk_menu_new();
   etk_menu_shell_append(ETK_MENU_SHELL(menu), ETK_MENU_ITEM(menu_item));
-  etk_signal_connect("activated", ETK_OBJECT(menu_item), 
ETK_CALLBACK(_od_config_menu_zooming_cb), NULL);
+  etk_menu_item_submenu_set(ETK_MENU_ITEM(menu_item), ETK_MENU(sub_menu));
+  etk_widget_show(sub_menu);
+
+  menu_item = etk_menu_item_new_with_label("None");
+  etk_menu_shell_append(ETK_MENU_SHELL(sub_menu), ETK_MENU_ITEM(menu_item));
+  etk_signal_connect("activated", ETK_OBJECT(menu_item), 
ETK_CALLBACK(_od_config_menu_zoom_none_cb), NULL);
+  menu_item = etk_menu_item_new_with_label("Zoom Only");
+  etk_menu_shell_append(ETK_MENU_SHELL(sub_menu), ETK_MENU_ITEM(menu_item));
+  etk_signal_connect("activated", ETK_OBJECT(menu_item), 
ETK_CALLBACK(_od_config_menu_zoom_zoom_cb), NULL);
+  menu_item = etk_menu_item_new_with_label("Zoom and Stretch");
+  etk_menu_shell_append(ETK_MENU_SHELL(sub_menu), ETK_MENU_ITEM(menu_item));
+  etk_signal_connect("activated", ETK_OBJECT(menu_item), 
ETK_CALLBACK(_od_config_menu_zoom_both_cb), NULL);
+
   menu_item = 
etk_menu_item_image_new_from_stock(ETK_STOCK_DOCUMENT_PROPERTIES);
   etk_menu_item_label_set(ETK_MENU_ITEM(menu_item), "Configuration");
   etk_menu_shell_append(ETK_MENU_SHELL(menu), ETK_MENU_ITEM(menu_item));
===================================================================
RCS file: /cvs/e/misc/engage/src/dock.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- dock.c      18 Aug 2006 11:47:05 -0000      1.22
+++ dock.c      10 Sep 2006 18:38:23 -0000      1.23
@@ -222,21 +222,29 @@
       ((sqrt_ff_1 - sqrt_ffxx) / (sqrt_ff_1 - f)
       )
       + 1.0;
-    *disp = (options.size + options.spacing) *
-      ((dock.zoom - 1.0) * (zoom_factor - 1.0) *
-       (range *
-        (x * (2 * sqrt_ff_1 - sqrt_ffxx) -
-         ff * atan(x / sqrt_ffxx)) / (2.0 * (sqrt_ff_1 - f))
-       )
-       + d);
+    if (options.stretch) {
+      *disp = (options.size + options.spacing) *
+        ((dock.zoom - 1.0) * (zoom_factor - 1.0) *
+         (range *
+          (x * (2 * sqrt_ff_1 - sqrt_ffxx) -
+           ff * atan(x / sqrt_ffxx)) / (2.0 * (sqrt_ff_1 - f))
+         )
+         + d);
+    } else {
+      *disp = d * (options.size + options.spacing);
+    }
   } else {
     *zoom = 1.0;
-    *disp = (options.size + options.spacing) *
-      ((dock.zoom - 1.0) * (zoom_factor - 1.0) *
-       (range * (sqrt_ff_1 - ff * atan(1.0 / sqrt_ff_1)) /
-        (2.0 * (sqrt_ff_1 - f))
-       )
-       + range + fabs(d) - range);
+    if (options.stretch) {
+      *disp = (options.size + options.spacing) *
+        ((dock.zoom - 1.0) * (zoom_factor - 1.0) *
+         (range * (sqrt_ff_1 - ff * atan(1.0 / sqrt_ff_1)) /
+          (2.0 * (sqrt_ff_1 - f))
+         )
+         + range + fabs(d) - range);
+    } else {
+      *disp = (range + fabs(d) - range) * (options.size + options.spacing);
+    }
     if (d < 0.0)
       *disp = -(*disp);
   }
===================================================================
RCS file: /cvs/e/misc/engage/src/engage.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- engage.h    6 Sep 2006 21:27:18 -0000       1.33
+++ engage.h    10 Sep 2006 18:38:23 -0000      1.34
@@ -91,7 +91,7 @@
 OD_Window      *od_wm_window_current_by_window_class_get(const char *);
 
 struct _OD_Options {
-  int             width, height, reserve, zoom;
+  int             width, height, reserve, zoom, stretch;
 #ifdef XINERAMA
   int             head;
 #endif



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to