Enlightenment CVS committal

Author  : handyande
Project : misc
Module  : engage

Dir     : misc/engage/src


Modified Files:
        Makefile.am engage.h icon.c 


Log Message:
Some icon grabbing code initially for minimised windows, not working yet, in step 
anyone who can fix it
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- Makefile.am 11 Apr 2004 14:31:51 -0000      1.2
+++ Makefile.am 11 Apr 2004 21:11:44 -0000      1.3
@@ -6,7 +6,8 @@
 -I$(top_srcdir)/lib \
 @evas_cflags@ \
 @ecore_cflags@ \
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@ \
[EMAIL PROTECTED]@
 
 bin_PROGRAMS = engage
 
@@ -20,5 +21,5 @@
 userconfig.c
 
 
-engage_LDADD = @evas_libs@ @ecore_libs@ @esmart_libs@
+engage_LDADD = @evas_libs@ @ecore_libs@ @esmart_libs@ @imlib_libs@
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/engage.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- engage.h    11 Apr 2004 14:31:51 -0000      1.2
+++ engage.h    11 Apr 2004 21:11:44 -0000      1.3
@@ -2,6 +2,7 @@
 #define _OD_ENGAGE_H
 
 #include <Ecore.h>
+#include <Ecore_X.h>
 #include <Ecore_Evas.h>
 #include <Ecore_Config.h>
 #include <stdlib.h>
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/icon.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- icon.c      10 Apr 2004 20:47:39 -0000      1.1
+++ icon.c      11 Apr 2004 21:11:44 -0000      1.2
@@ -1,5 +1,11 @@
 #include "engage.h"
 #include "limits.h"
+#include "config.h"
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#ifdef HAVE_IMLIB
+#include <Imlib2.h>
+#endif
 // for stat
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -12,6 +18,9 @@
 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);
 
@@ -58,8 +67,15 @@
 
   od_icon_mapping_get(winclass, &name, &icon_name);
   char           *icon_path = od_icon_path_get(icon_name);
+#if 0
+#  ifdef HAVE_IMLIB
+  OD_Icon        *ret = od_icon_grab(title, win);
+#  else
   OD_Icon        *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;
@@ -69,6 +85,38 @@
   return ret;
 }
 
+#ifdef HAVE_IMLIB
+OD_Icon        *
+od_icon_grab(const char *name, 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(""));
+
+  dsp = ecore_x_display_get();
+  scr = DefaultScreen(dsp);
+  hints = XGetWMHints(dsp, win);
+  imlib_context_set_display(dsp);
+  imlib_context_set_visual(DefaultVisual(dsp, scr));
+  imlib_context_set_colormap(DefaultColormap(dsp, scr));
+  imlib_context_set_dither_mask(0);
+  imlib_context_set_drawable(hints->icon_pixmap);
+  
+  ecore_x_pixmap_geometry_get(hints->icon_pixmap, &x, &y, &w, &h);
+  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);
+      
+  //evas_object_image_pixels_import(ret->icon, imlib_image_get_data());
+  //imlib_free_image();
+
+  XFree(hints);
+  return ret;
+}
+#endif
+
 OD_Icon        *
 od_icon_new(const char *name, const char *icon_file)
 {




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