From 79b17caa73f4a89ebe09330f50eebd021245d1dd Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 16 Apr 2001 00:10:58 +0000 Subject: [PATCH] Added WMCreateBlendedPixmapFromRImage() --- WINGs/ChangeLog | 1 + WINGs/WINGs/WINGs.h | 3 +++ WINGs/wpixmap.c | 19 +++++++++++++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/WINGs/ChangeLog b/WINGs/ChangeLog index caedff2f..03fd6ce7 100644 --- a/WINGs/ChangeLog +++ b/WINGs/ChangeLog @@ -28,6 +28,7 @@ Changes since wmaker 0.64.0: - replaced bags with arrays wherever appropriate. This will improve performance a bit. - replaced some recursive code with iterative code in selection.c +- added WMCreateBlendedPixmapFromRImage() changes since wmaker 0.63.1: diff --git a/WINGs/WINGs/WINGs.h b/WINGs/WINGs/WINGs.h index b8a512ae..8ad523ea 100644 --- a/WINGs/WINGs/WINGs.h +++ b/WINGs/WINGs/WINGs.h @@ -737,6 +737,9 @@ WMSize WMGetPixmapSize(WMPixmap *pixmap); WMPixmap *WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName); +WMPixmap* WMCreateBlendedPixmapFromRImage(WMScreen *scrPtr, RImage *image, + RColor *color); + WMPixmap *WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName, RColor *color); diff --git a/WINGs/wpixmap.c b/WINGs/wpixmap.c index be8f8083..a879a463 100644 --- a/WINGs/wpixmap.c +++ b/WINGs/wpixmap.c @@ -49,8 +49,8 @@ WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth, Bool masked) pixPtr->pixmap = XCreatePixmap(scrPtr->display, W_DRAWABLE(scrPtr), width, height, depth); if (masked) { - pixPtr->mask = XCreatePixmap(scrPtr->display, W_DRAWABLE(scrPtr), - width, height, 1); + pixPtr->mask = XCreatePixmap(scrPtr->display, W_DRAWABLE(scrPtr), + width, height, 1); } else { pixPtr->mask = None; } @@ -128,6 +128,21 @@ WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image, int threshold) } +WMPixmap* +WMCreateBlendedPixmapFromRImage(WMScreen *scrPtr, RImage *image, RColor *color) +{ + WMPixmap *pixPtr; + RImage *copy; + + copy = RCloneImage(image); + RCombineImageWithColor(copy, color); + pixPtr = WMCreatePixmapFromRImage(scrPtr, copy, 0); + RDestroyImage(copy); + + return pixPtr; +} + + WMPixmap* WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName, RColor *color) {