Enlightenment CVS committal

Author  : handyande
Project : misc
Module  : engage

Dir     : misc/engage/src


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


Log Message:
Fix icon grabbing - wrks now, just need to crop - again, feel free to jump in
Added grab_icons option, set it to 0 to stop this code from running
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/config.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- config.c    11 Apr 2004 14:31:51 -0000      1.2
+++ config.c    11 Apr 2004 23:03:44 -0000      1.3
@@ -13,6 +13,7 @@
   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("engage.options.size", 32);
   ecore_config_default_int("engage.options.spacing", 4);
@@ -32,6 +33,7 @@
   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.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.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- engage.h    11 Apr 2004 21:11:44 -0000      1.3
+++ engage.h    11 Apr 2004 23:03:44 -0000      1.4
@@ -68,6 +68,7 @@
   int             width, height;
   char           *icon_path;
   OD_Mode         mode;
+  int             grab_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.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- icon.c      11 Apr 2004 21:47:18 -0000      1.3
+++ icon.c      11 Apr 2004 23:03:44 -0000      1.4
@@ -67,15 +67,15 @@
 
   od_icon_mapping_get(winclass, &name, &icon_name);
   char           *icon_path = od_icon_path_get(icon_name);
-#if 1
-#  ifdef HAVE_IMLIB
-  OD_Icon        *ret = od_icon_grab(title, win);
+  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
-  OD_Icon        *ret = od_icon_new(title, icon_path);
+  ret = od_icon_new(title, icon_path);
 #  endif
-#else
-  OD_Icon        *ret = od_icon_new(title, icon_path);
-#endif
   fprintf(stderr, "new minwin: icon_path=\"%s\"\n", icon_path);
   ret->type = minimised_window;
   ret->data.minwin.window = win;
@@ -105,15 +105,15 @@
   imlib_context_set_dither_mask(0);
   imlib_context_set_drawable(hints->icon_pixmap);
   
-  printf("size is %d, %d, %d, %d\n", x, y, w, h);
-  //XSync(dsp, False);
-//img = imlib_create_image_from_drawable(hints->icon_mask, x, y, w, h, 0);
   img = imlib_create_image_from_drawable(0, x, y, w, h, 0);
   imlib_context_set_image(img);
+  imlib_context_set_mask(hints->icon_mask);
 
-  evas_object_image_pixels_import(ret->icon, imlib_image_get_data());
-  imlib_free_image();
+  imlib_image_set_format("argb");
+  evas_object_image_size_set(ret->icon, w, h);
+  evas_object_image_data_copy_set(ret->icon, imlib_image_get_data_for_reading_only());
 
+  imlib_free_image();
   XFree(hints);
   return ret;
 }




-------------------------------------------------------
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