Enlightenment CVS committal

Author  : handyande
Project : misc
Module  : engage

Dir     : misc/engage/src


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


Log Message:
Simple autohide for now, animation should be added and a few tidies preformed
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/config.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- config.c    24 Jun 2004 08:41:26 -0000      1.32
+++ config.c    26 Jul 2004 20:52:28 -0000      1.33
@@ -70,6 +70,8 @@
   ecore_config_int_create_bound("engage.options.grab_app_icons", 1, 0, 1, 1,
                                 'G', "grab-app",
                                 "Capture the icons of all running applications");
+  ecore_config_int_create_bound("engage.options.auto_hide", 0, 0, 1, 1, 'A',
+                                "auto-hide", "Auto hide the engage bar");
 
   ecore_config_int_create("engage.options.size", 32, 's', "size",
                           "Size of icons in default state");
@@ -111,7 +113,8 @@
     ecore_config_int_get("engage.options.grab_min_icons");
   options.grab_app_icons =
     ecore_config_int_get("engage.options.grab_app_icons");
-
+  options.auto_hide = ecore_config_int_get("engage.options.auto_hide");
+  
   options.size = ecore_config_int_get("engage.options.size");
   options.spacing = ecore_config_int_get("engage.options.spacing");
   options.zoom = ecore_config_int_get("engage.options.zoom");
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/engage.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- engage.h    25 May 2004 15:01:44 -0000      1.14
+++ engage.h    26 Jul 2004 20:52:28 -0000      1.15
@@ -33,6 +33,8 @@
 void            od_config_menu_draw(Evas_Coord x, Evas_Coord y);
 
 void            od_window_init();
+void            od_window_hide();
+void            od_window_unhide();
 
 void            od_dock_init();
 void            od_dock_add_applnk(OD_Icon * applnk);
@@ -78,6 +80,7 @@
   OD_Mode         mode;
   int             grab_min_icons, grab_app_icons;
 
+  int             auto_hide;
   int             size, spacing, arrow_size;    // icon-*
   double          zoomfactor, dock_zoom_duration;
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/window.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- window.c    30 Jun 2004 09:49:59 -0000      1.21
+++ window.c    26 Jul 2004 20:52:28 -0000      1.22
@@ -13,7 +13,9 @@
 Ecore_Evas     *ee;
 Evas           *evas;
 Ecore_X_Window  od_window;
+int             od_hidden;
 static Ecore_Timer *mouse_focus_timer = NULL;
+int             fullheight;
 
 static void     handle_delete_request(Ecore_Evas * _ee);
 static void     handle_pre_render_cb(Ecore_Evas * _ee);
@@ -27,18 +29,23 @@
                                   void *event);
 static void     handle_menu_draw(void *data, Evas * e, Evas_Object * obj,
                                  void *event);
-
+static void     od_window_set_hidden(int hidden);
 int
 od_window_hide_timer_cb(void *data)
 {
+  int               ret;
+
+  ret = 1;
   if (mouse_focus_timer) {
     if (dock.state == zooming || dock.state == zoomed) {
       od_dock_zoom_out();
       mouse_focus_timer = NULL;
-      return (0);
+      ret = 0;
     }
   }
-  return (1);
+  if (options.auto_hide)
+    od_window_hide();
+  return (ret);
 }
 static void
 handle_pre_render_cb(Ecore_Evas * _ee)
@@ -75,6 +82,9 @@
   if (mouse_focus_timer)
     ecore_timer_del(mouse_focus_timer);
   mouse_focus_timer = NULL;
+
+  if (options.auto_hide)
+    od_window_unhide();
 }
 static void
 handle_mouse_out(Ecore_Evas * _ee)
@@ -117,7 +127,9 @@
   options.width = w;
   options.height = h;
   ecore_config_int_set("engage.options.width", w);
-  ecore_config_int_set("engage.options.height", h);
+/* FIXME this cannot be stored, as mode 1 resizes the window, and will mess
+ * things up if stored 
+  ecore_config_int_set("engage.options.height", h); */
 }
 
 void
@@ -130,6 +142,7 @@
   Evas_Object    *o;
   Evas_Object    *eventer;
 
+  fullheight = options.height;
   // determine the desktop size
   dsp = ecore_x_display_get();
   def = DefaultScreen(dsp);
@@ -222,6 +235,9 @@
     evas_object_show(o);
 #endif
   }
+
+  if (options.auto_hide)
+    od_window_hide();
 }
 
 static void
@@ -309,3 +325,60 @@
     od_config_menu_draw(ev->canvas.x, ev->canvas.y);
 #endif
 }
+
+void
+od_window_hide(void) {
+  od_window_set_hidden(1);
+}
+
+void
+od_window_unhide(void) {
+  od_window_set_hidden(0);
+}
+
+static void
+od_window_set_hidden(int hidden) {
+
+  Ecore_X_Display *dsp;
+  Screen         *scr;
+  int             def;
+  int             res_x, res_y;
+  int             height;
+  Evas_Object    *o;
+  Evas_Object    *eventer;
+
+  if (od_hidden != hidden) {
+
+    od_hidden = hidden;
+
+    /* We really should use edje and just resize / hide the main object which
+       would not include the esmart background, but until then... */
+
+    if (options.mode == 1) {
+    /* cannot use the nice way below, as it will screw up the esmart bg */
+    /* hack to get round broken ecore_x calls */
+    // determine the desktop size
+    dsp = ecore_x_display_get();
+    def = DefaultScreen(dsp);
+    scr = ScreenOfDisplay(dsp, def);
+    res_x = scr->width;
+    res_y = scr->height;
+
+    if (hidden)
+      height = 2;
+    else
+      height = fullheight;
+           
+    ecore_x_window_resize(od_window, options.width, height);
+    ecore_x_window_prop_xy_set(od_window, (res_x - options.width) / 2, res_y - 
height);
+    } else {
+      if (hidden)
+        height = 3000;
+      else
+        height = fullheight;
+               
+      evas_output_viewport_set(evas, 0, 0 + (fullheight - height),
+                               options.width, height);
+    }
+  }
+}




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to