Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
Tag: branch-exp
E.h draw.c fx.c iconify.c
Log Message:
Use imlib2 for icon grabbing. Reduce PixImg usage.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.314.2.13
retrieving revision 1.314.2.14
diff -u -3 -r1.314.2.13 -r1.314.2.14
--- E.h 15 Aug 2004 07:55:45 -0000 1.314.2.13
+++ E.h 15 Aug 2004 08:15:21 -0000 1.314.2.14
@@ -1255,15 +1255,6 @@
#define DITEM_SLIDER 8
#define DITEM_AREA 9
-typedef struct _PixImg
-{
- XImage *xim;
- XShmSegmentInfo *shminfo;
- Pixmap pmap;
- GC gc;
-}
-PixImg;
-
typedef struct _drawqueue
{
Window win;
@@ -1744,15 +1735,6 @@
/* draw.c */
void HandleDrawQueue(void);
char IsPropagateEwinOnQueue(EWin * ewin);
-void EFillPixmap(Window win, Pixmap pmap, int x, int y, int w,
- int h);
-void EPastePixmap(Window win, Pixmap pmap, int x, int y, int w,
- int h);
-void EBlendRemoveShape(EWin * ewin, Pixmap pmap, int x, int y);
-PixImg *ECreatePixImg(Window win, int w, int h);
-void EDestroyPixImg(PixImg * pi);
-void EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2,
- PixImg * dst, int x, int y, int w, int h);
void ScaleLine(Pixmap dest, Window src, int dx, int dy, int sw,
int pw, int sy, int sh);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/draw.c,v
retrieving revision 1.51
retrieving revision 1.51.2.1
diff -u -3 -r1.51 -r1.51.2.1
--- draw.c 25 Jul 2004 09:34:43 -0000 1.51
+++ draw.c 15 Aug 2004 08:15:21 -0000 1.51.2.1
@@ -268,7 +268,7 @@
EDBUG_RETURN(0);
}
-void
+static void
EFillPixmap(Window win, Pixmap pmap, int x, int y, int w, int h)
{
XGCValues gcv;
@@ -280,7 +280,7 @@
XFreeGC(disp, gc);
}
-void
+static void
EPastePixmap(Window win, Pixmap pmap, int x, int y, int w, int h)
{
XGCValues gcv;
@@ -292,7 +292,16 @@
XFreeGC(disp, gc);
}
-PixImg *
+typedef struct _PixImg
+{
+ XImage *xim;
+ XShmSegmentInfo *shminfo;
+ Pixmap pmap;
+ GC gc;
+}
+PixImg;
+
+static PixImg *
ECreatePixImg(Window win, int w, int h)
{
XGCValues gcv;
@@ -356,7 +365,7 @@
return NULL;
}
-void
+static void
EDestroyPixImg(PixImg * pi)
{
if (!pi)
@@ -372,7 +381,7 @@
Efree(pi);
}
-void
+static void
EBlendRemoveShape(EWin * ewin, Pixmap pmap, int x, int y)
{
XGCValues gcv;
@@ -438,7 +447,7 @@
XCopyArea(disp, pmap, VRoot.win, gc, x, y, w, h, x, y);
}
-void
+static void
EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
int w, int h)
{
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/fx.c,v
retrieving revision 1.41.2.1
retrieving revision 1.41.2.2
diff -u -3 -r1.41.2.1 -r1.41.2.2
--- fx.c 8 Aug 2004 00:24:23 -0000 1.41.2.1
+++ fx.c 15 Aug 2004 08:15:21 -0000 1.41.2.2
@@ -42,31 +42,36 @@
}
FXHandler;
-void FX_Ripple_Init(const char *name);
-void FX_Ripple_Desk(void);
-void FX_Ripple_Quit(void);
-void FX_Ripple_Pause(void);
-void FX_Raindrops_Init(const char *name);
-void FX_Raindrops_Desk(void);
-void FX_Raindrops_Quit(void);
-void FX_Raindrops_Pause(void);
-void FX_Waves_Init(const char *name);
-void FX_Waves_Desk(void);
-void FX_Waves_Quit(void);
-void FX_Waves_Pause(void);
-void FX_ImageSpinner_Init(const char *name);
-void FX_ImageSpinner_Desk(void);
-void FX_ImageSpinner_Quit(void);
-void FX_ImageSpinner_Pause(void);
+static void FX_Ripple_Init(const char *name);
+static void FX_Ripple_Desk(void);
+static void FX_Ripple_Quit(void);
+static void FX_Ripple_Pause(void);
+
+#ifdef E_FX_RAINDROPS /* FIXME */
+static void FX_Raindrops_Init(const char *name);
+static void FX_Raindrops_Desk(void);
+static void FX_Raindrops_Quit(void);
+static void FX_Raindrops_Pause(void);
+#endif
+static void FX_Waves_Init(const char *name);
+static void FX_Waves_Desk(void);
+static void FX_Waves_Quit(void);
+static void FX_Waves_Pause(void);
+static void FX_ImageSpinner_Init(const char *name);
+static void FX_ImageSpinner_Desk(void);
+static void FX_ImageSpinner_Quit(void);
+static void FX_ImageSpinner_Pause(void);
static FXHandler fx_handlers[] = {
{"ripples",
FX_Ripple_Init, FX_Ripple_Desk, FX_Ripple_Quit, FX_Ripple_Pause,
0, 0},
+#ifdef E_FX_RAINDROPS /* FIXME */
{"raindrops",
FX_Raindrops_Init, FX_Raindrops_Desk, FX_Raindrops_Quit,
FX_Raindrops_Pause,
0, 0},
+#endif
{"waves",
FX_Waves_Init, FX_Waves_Desk, FX_Waves_Quit, FX_Waves_Pause,
0, 0},
@@ -320,7 +325,7 @@
data = NULL;
}
-void
+static void
FX_Ripple_Init(const char *name)
{
fx_ripple_count = 0;
@@ -329,7 +334,7 @@
name = NULL;
}
-void
+static void
FX_Ripple_Desk(void)
{
EFreePixmap(disp, fx_ripple_above);
@@ -337,7 +342,7 @@
fx_ripple_above = 0;
}
-void
+static void
FX_Ripple_Quit(void)
{
RemoveTimerEvent("FX_RIPPLE_TIMEOUT");
@@ -345,7 +350,7 @@
fx_ripple_waterh, False);
}
-void
+static void
FX_Ripple_Pause(void)
{
static char paused = 0;
@@ -362,6 +367,7 @@
}
}
+#ifdef E_FX_RAINDROPS /* FIXME - Requires eliminating use of PixImg */
/****************************************************************************/
/****************************** RAIN DROPS **********************************/
@@ -601,7 +607,7 @@
data = NULL;
}
-void
+static void
FX_Raindrops_Init(const char *name)
{
int i;
@@ -618,13 +624,13 @@
name = NULL;
}
-void
+static void
FX_Raindrops_Desk(void)
{
fx_raindrops_win = 0;
}
-void
+static void
FX_Raindrops_Quit(void)
{
int i;
@@ -644,7 +650,7 @@
fx_raindrops_win = 0;
}
-void
+static void
FX_Raindrops_Pause(void)
{
static char paused = 0;
@@ -660,6 +666,7 @@
paused = 0;
}
}
+#endif /* E_FX_RAINDROPS */
/****************************************************************************/
@@ -814,7 +821,7 @@
data = NULL;
}
-void
+static void
FX_Waves_Init(const char *name)
{
fx_wave_count = 0;
@@ -823,7 +830,7 @@
name = NULL;
}
-void
+static void
FX_Waves_Desk(void)
{
XFreePixmap(disp, fx_wave_above);
@@ -831,7 +838,7 @@
fx_wave_above = 0;
}
-void
+static void
FX_Waves_Quit(void)
{
RemoveTimerEvent("FX_WAVE_TIMEOUT");
@@ -839,7 +846,7 @@
FX_WAVE_WATERH, False);
}
-void
+static void
FX_Waves_Pause(void)
{
static char paused = 0;
@@ -930,7 +937,7 @@
data = NULL;
}
-void
+static void
FX_ImageSpinner_Init(const char *name)
{
fx_imagespinner_count = 3;
@@ -938,13 +945,13 @@
fx_imagespinner_params = Estrdup(name);
}
-void
+static void
FX_ImageSpinner_Desk(void)
{
fx_imagespinner_win = desks.desk[desks.current].win;
}
-void
+static void
FX_ImageSpinner_Quit(void)
{
RemoveTimerEvent("FX_IMAGESPINNER_TIMEOUT");
@@ -955,7 +962,7 @@
fx_imagespinner_win = 0;
}
-void
+static void
FX_ImageSpinner_Pause(void)
{
static char paused = 0;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/iconify.c,v
retrieving revision 1.116.2.7
retrieving revision 1.116.2.8
diff -u -3 -r1.116.2.7 -r1.116.2.8
--- iconify.c 10 Aug 2004 19:36:30 -0000 1.116.2.7
+++ iconify.c 15 Aug 2004 08:15:21 -0000 1.116.2.8
@@ -730,6 +730,7 @@
int x, y;
unsigned int w, h, depth, bw;
Window rt;
+ Imlib_Image im;
if (!ewin->client.icon_pmap)
return;
@@ -738,36 +739,21 @@
h = 0;
EGetGeometry(disp, ewin->client.icon_pmap, &rt, &x, &y, &w, &h, &bw, &depth);
- ewin->icon_pmm.type = 0;
ewin->icon_w = (int)w;
ewin->icon_h = (int)h;
- ewin->icon_pmm.pmap = ECreatePixmap(disp, VRoot.win, w, h, VRoot.depth);
- ewin->icon_pmm.mask = 0;
- if (ewin->client.icon_mask)
- ewin->icon_pmm.mask = ECreatePixmap(disp, VRoot.win, w, h, 1);
-
- if (depth == 1)
- {
- GC gc;
- XGCValues gcv;
-
- gc = XCreateGC(disp, ewin->icon_pmm.pmap, 0, &gcv);
- XSetForeground(disp, gc, WhitePixel(disp, VRoot.scr));
- XFillRectangle(disp, ewin->icon_pmm.pmap, gc, 0, 0, w, h);
- XSetClipOrigin(disp, gc, 0, 0);
- XSetClipMask(disp, gc, ewin->client.icon_pmap);
- XSetForeground(disp, gc, BlackPixel(disp, VRoot.scr));
- XFillRectangle(disp, ewin->icon_pmm.pmap, gc, 0, 0, w, h);
- XFreeGC(disp, gc);
- }
- else
- EPastePixmap(ewin->icon_pmm.pmap, ewin->client.icon_pmap, 0, 0, w, h);
-
- if (ewin->client.icon_mask)
- EPastePixmap(ewin->icon_pmm.mask, ewin->client.icon_mask, 0, 0, w, h);
+ if (w < 1 || h < 1)
+ return;
- if ((ewin->icon_w < 1) || (ewin->icon_h < 1))
- FreePmapMask(&ewin->icon_pmm);
+ imlib_context_set_colormap(None);
+ imlib_context_set_drawable(ewin->client.icon_pmap);
+ im = imlib_create_image_from_drawable(ewin->client.icon_mask, 0, 0, w, h, 0);
+ imlib_context_set_image(im);
+ imlib_image_set_has_alpha(1);
+ imlib_context_set_colormap(VRoot.cmap);
+ imlib_context_set_drawable(VRoot.win);
+ ewin->icon_pmm.type = 1;
+ imlib_render_pixmaps_for_whole_image(&ewin->icon_pmm.pmap,
+ &ewin->icon_pmm.mask);
}
static void
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs