Enlightenment CVS committal

Author  : handyande
Project : misc
Module  : engage

Dir     : misc/engage/src


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


Log Message:
Extended use of grabbed icons
grab_min_icons is the new place for controlling minimised windows icons,
grap_app_icons if on will allow X icons to override mappings on the applinks
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/config.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- config.c    11 Apr 2004 23:03:44 -0000      1.3
+++ config.c    13 Apr 2004 12:34:26 -0000      1.4
@@ -13,7 +13,8 @@
   ecore_config_default_int("engage.options.height", 100);
   options.icon_path = PACKAGE_DATA_DIR "/icons/";
   ecore_config_default_int_bound("engage.options.mode", OM_ONTOP, 0, 1, 1);
-  ecore_config_default_int_bound("engage.options.grab_icons", 1, 0, 1, 1);
+  ecore_config_default_int_bound("engage.options.grab_min_icons", 1, 0, 1, 1);
+  ecore_config_default_int_bound("engage.options.grab_app_icons", 1, 0, 1, 1);
 
   ecore_config_default_int("engage.options.size", 32);
   ecore_config_default_int("engage.options.spacing", 4);
@@ -33,7 +34,10 @@
   options.width = ecore_config_get_int("engage.options.width");
   options.height = ecore_config_get_int("engage.options.height");
   options.mode = ecore_config_get_int("engage.options.mode");
-  options.grab_icons = ecore_config_get_int("engage.options.grab_icons");
+  options.grab_min_icons =
+    ecore_config_get_int("engage.options.grab_min_icons");
+  options.grab_app_icons =
+    ecore_config_get_int("engage.options.grab_app_icons");
 
   options.size = ecore_config_get_int("engage.options.size");
   options.spacing = ecore_config_get_int("engage.options.spacing");
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/engage.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- engage.h    11 Apr 2004 23:03:44 -0000      1.4
+++ engage.h    13 Apr 2004 12:34:26 -0000      1.5
@@ -47,6 +47,10 @@
 OD_Icon        *od_icon_new_dicon(const char *command, const char *name,
                                   const char *icon_name);
 OD_Icon        *od_icon_new_minwin(Ecore_X_Window win);
+
+#ifdef HAVE_IMLIB
+void           *od_icon_grab(OD_Icon * icon, Ecore_X_Window win);
+#endif
 void            od_icon_del(OD_Icon * od_icon);
 void            od_icon_arrow_show(OD_Icon * icon);
 void            od_icon_arrow_hide(OD_Icon * icon);
@@ -68,7 +72,7 @@
   int             width, height;
   char           *icon_path;
   OD_Mode         mode;
-  int             grab_icons;
+  int             grab_min_icons, grab_app_icons;
 
   int             size, spacing, arrow_size;    // icon-*
   double          zoomfactor, dock_zoom_duration;
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/icon.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- icon.c      12 Apr 2004 08:59:40 -0000      1.5
+++ icon.c      13 Apr 2004 12:34:26 -0000      1.6
@@ -18,9 +18,6 @@
 Evas_List      *icon_paths = NULL;
 
 static OD_Icon *od_icon_new(const char *name, const char *icon_path);
-#ifdef HAVE_IMLIB
-static OD_Icon *od_icon_grab(const char *name, Ecore_X_Window win);
-#endif
 static void     od_icon_mapping_get(const char *winclass, char **name, char 
**icon_name);       // DON'T free returned
 static char    *od_icon_path_get(const char *icon_name);
 
@@ -68,14 +65,11 @@
   od_icon_mapping_get(winclass, &name, &icon_name);
   char           *icon_path = od_icon_path_get(icon_name);
   OD_Icon        *ret;
-#ifdef HAVE_IMLIB
-  if (options.grab_icons == 0) 
-    ret = od_icon_new(title, icon_path);
-  else
-    ret = od_icon_grab(title, win);
-#  else
   ret = od_icon_new(title, icon_path);
-#  endif
+#ifdef HAVE_IMLIB
+  if (options.grab_min_icons != 0)
+    od_icon_grab(ret, win);
+#endif
   fprintf(stderr, "new minwin: icon_path=\"%s\"\n", icon_path);
   ret->type = minimised_window;
   ret->data.minwin.window = win;
@@ -86,15 +80,14 @@
 }
 
 #ifdef HAVE_IMLIB
-OD_Icon        *
-od_icon_grab(const char *name, Ecore_X_Window win)
+void
+od_icon_grab(OD_Icon * icon, Ecore_X_Window win)
 {
-  XWMHints *hints;
-  Imlib_Image img;
-  Display    *dsp;
-  int         scr, x, y, w, h;
-  OD_Icon    *ret = od_icon_new(name, od_icon_path_get(""));
-  Pixmap      pmap, mask;
+  XWMHints       *hints;
+  Imlib_Image     img;
+  Display        *dsp;
+  int             scr, x, y, w, h;
+  Pixmap          pmap, mask;
 
   dsp = ecore_x_display_get();
   scr = DefaultScreen(dsp);
@@ -121,13 +114,13 @@
   img = imlib_create_image_from_drawable(mask, x, y, w, h, 0);
   imlib_context_set_image(img);
 
-  evas_object_image_size_set(ret->icon, w, h);
-  evas_object_image_data_copy_set(ret->icon, imlib_image_get_data_for_reading_only());
+  evas_object_image_size_set(icon->icon, w, h);
+  evas_object_image_data_copy_set(icon->icon,
+                                  imlib_image_get_data_for_reading_only());
 
   imlib_free_image();
 
 done:
-  return ret;
 }
 #endif
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/window.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- window.c    11 Apr 2004 21:55:14 -0000      1.4
+++ window.c    13 Apr 2004 12:34:26 -0000      1.5
@@ -77,7 +77,7 @@
     ecore_x_window_prop_layer_set(od_window, ECORE_X_WINDOW_LAYER_BELOW);
 
   ecore_evas_show(ee);
-  
+
   if (options.mode == OM_BELOW) {
 #ifdef HAVE_TRANS_BG
     o = esmart_trans_x11_new(evas);
@@ -97,7 +97,7 @@
     evas_object_move(o, 0, 0);
     evas_object_resize(o, options.width, options.height);
     evas_object_name_set(o, "trans");
-    evas_object_show(o);                            
+    evas_object_show(o);
 #endif
   }
 }
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/wm.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- wm.c        10 Apr 2004 20:47:39 -0000      1.1
+++ wm.c        13 Apr 2004 12:34:26 -0000      1.2
@@ -1,4 +1,5 @@
 #include "engage.h"
+#include "config.h"
 #include "Ecore_X.h"
 #include <X11/Xatom.h>
 #include <X11/Xutil.h>
@@ -186,6 +187,10 @@
           od_dock_add_minwin(wfresh->minwin);
         } else
           wfresh->minwin = NULL;
+#ifdef HAVE_IMLIB
+        if (options.grab_app_icons)
+          od_icon_grab(wfresh->applnk, wfresh->id);
+#endif
       }
 
       free(title);




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to