mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
Renamed WMGetApplicationIconBlendedPixmap() to
WMCreateApplicationIconBlendedPixmap() to avoid confusion. This is because this function does generate a new WMPixmap from the available icon image by combining it with the specified color and you need to call WMReleasePixmap() on the generated pixmap after you're done with it. This is unlike the case of WMGetApplicationIconPixmap() where it just returns a pointer to the existing application icon pixmap that was set before and where you don't need to release it after you're done working with it. To avoid this confusion about when you need to release and when not, one is using Get (get existing, no release needed), while the other is now using Create (generate a new pixmap, release required) in their name. Since this change was made to a function that was just added to the API in the previous commit, no modification is needed to the existing applications that use WINGs.
This commit is contained in:
@@ -38,8 +38,8 @@ Changes since wmaker 0.64.0:
|
|||||||
room for the new functions added for operating on images with alpha info.
|
room for the new functions added for operating on images with alpha info.
|
||||||
2. Added WMSetApplicationIconImage() and WMGetApplicationIconImage() which
|
2. Added WMSetApplicationIconImage() and WMGetApplicationIconImage() which
|
||||||
operate on an RImage and store alpha information too.
|
operate on an RImage and store alpha information too.
|
||||||
3. Added WMGetApplicationIconBlendedPixmap() which will take the image with
|
3. Added WMCreateApplicationIconBlendedPixmap() which will take the image
|
||||||
alpha set by WMSetApplicationIconImage() and will blend it with a color.
|
set by WMSetApplicationIconImage() and will combine it with a color.
|
||||||
If color is NULL it will blend using the default panel color (#aeaaae)
|
If color is NULL it will blend using the default panel color (#aeaaae)
|
||||||
All these changes will allow WINGs to handle images with alpha blending
|
All these changes will allow WINGs to handle images with alpha blending
|
||||||
correctly in panels and wherever else needed. More about in NEWS.
|
correctly in panels and wherever else needed. More about in NEWS.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ changes took place:
|
|||||||
2. The following functions were added:
|
2. The following functions were added:
|
||||||
- WMSetApplicationIconImage(WMScreen *scr, RImage *image)
|
- WMSetApplicationIconImage(WMScreen *scr, RImage *image)
|
||||||
- RImage* WMGetApplicationIconImage(WMScreen *scr)
|
- RImage* WMGetApplicationIconImage(WMScreen *scr)
|
||||||
- WMPixmap* WMGetApplicationIconBlendedPixmap(WMScreen *scr, RColor *color)
|
- WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *col)
|
||||||
|
|
||||||
As you can see the old functions that operated on WMPixmap images (which are
|
As you can see the old functions that operated on WMPixmap images (which are
|
||||||
basically X Pixmaps that lack alpha information) were renamed to ...Pixmap()
|
basically X Pixmaps that lack alpha information) were renamed to ...Pixmap()
|
||||||
@@ -54,7 +54,7 @@ different icon to be shown in the appicon than in panels.
|
|||||||
|
|
||||||
Also this new function was added:
|
Also this new function was added:
|
||||||
|
|
||||||
- WMGetApplicationIconBlendedPixmap() will use the RImage set with
|
- WMCreateApplicationIconBlendedPixmap() will use the RImage set with
|
||||||
WMSetApplicationIconImage() if available and will blend it with the color
|
WMSetApplicationIconImage() if available and will blend it with the color
|
||||||
you passed. This will make the image show well on a background of that
|
you passed. This will make the image show well on a background of that
|
||||||
color. If the RImage was not set it will return NULL. You need to call
|
color. If the RImage was not set it will return NULL. You need to call
|
||||||
|
|||||||
@@ -633,7 +633,7 @@ void WMSetApplicationIconPixmap(WMScreen *app, WMPixmap *icon);
|
|||||||
WMPixmap* WMGetApplicationIconPixmap(WMScreen *app);
|
WMPixmap* WMGetApplicationIconPixmap(WMScreen *app);
|
||||||
|
|
||||||
/* If color==NULL it will use the default color for panels: ae/aa/ae */
|
/* If color==NULL it will use the default color for panels: ae/aa/ae */
|
||||||
WMPixmap* WMGetApplicationIconBlendedPixmap(WMScreen *scr, RColor *color);
|
WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *color);
|
||||||
|
|
||||||
void WMSetApplicationIconWindow(WMScreen *scr, Window window);
|
void WMSetApplicationIconWindow(WMScreen *scr, Window window);
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ WMGetApplicationIconPixmap(WMScreen *scr)
|
|||||||
|
|
||||||
|
|
||||||
WMPixmap*
|
WMPixmap*
|
||||||
WMGetApplicationIconBlendedPixmap(WMScreen *scr, RColor *color)
|
WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *color)
|
||||||
{
|
{
|
||||||
WMPixmap *pix;
|
WMPixmap *pix;
|
||||||
|
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ makeFilePanel(WMScreen *scrPtr, char *name, char *title)
|
|||||||
WMResizeWidget(fPtr->iconLabel, 64, 64);
|
WMResizeWidget(fPtr->iconLabel, 64, 64);
|
||||||
WMMoveWidget(fPtr->iconLabel, 0, 0);
|
WMMoveWidget(fPtr->iconLabel, 0, 0);
|
||||||
WMSetLabelImagePosition(fPtr->iconLabel, WIPImageOnly);
|
WMSetLabelImagePosition(fPtr->iconLabel, WIPImageOnly);
|
||||||
icon = WMGetApplicationIconBlendedPixmap(scrPtr, (RColor*)NULL);
|
icon = WMCreateApplicationIconBlendedPixmap(scrPtr, (RColor*)NULL);
|
||||||
if (icon) {
|
if (icon) {
|
||||||
WMSetLabelImage(fPtr->iconLabel, icon);
|
WMSetLabelImage(fPtr->iconLabel, icon);
|
||||||
WMReleasePixmap(icon);
|
WMReleasePixmap(icon);
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ WMCreateAlertPanel(WMScreen *scrPtr, WMWindow *owner,
|
|||||||
WMSetLabelImagePosition(panel->iLbl, WIPImageOnly);
|
WMSetLabelImagePosition(panel->iLbl, WIPImageOnly);
|
||||||
WMMapWidget(panel->iLbl);
|
WMMapWidget(panel->iLbl);
|
||||||
WMAddBoxSubview(hbox, WMWidgetView(panel->iLbl), False, True, 64, 0, 10);
|
WMAddBoxSubview(hbox, WMWidgetView(panel->iLbl), False, True, 64, 0, 10);
|
||||||
icon = WMGetApplicationIconBlendedPixmap(scrPtr, (RColor*)NULL);
|
icon = WMCreateApplicationIconBlendedPixmap(scrPtr, (RColor*)NULL);
|
||||||
if (icon) {
|
if (icon) {
|
||||||
WMSetLabelImage(panel->iLbl, icon);
|
WMSetLabelImage(panel->iLbl, icon);
|
||||||
WMReleasePixmap(icon);
|
WMReleasePixmap(icon);
|
||||||
@@ -560,7 +560,7 @@ WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
|
|||||||
WMSetLabelImagePosition(panel->iLbl, WIPImageOnly);
|
WMSetLabelImagePosition(panel->iLbl, WIPImageOnly);
|
||||||
WMMapWidget(panel->iLbl);
|
WMMapWidget(panel->iLbl);
|
||||||
WMAddBoxSubview(hbox, WMWidgetView(panel->iLbl), False, True, 64, 0, 10);
|
WMAddBoxSubview(hbox, WMWidgetView(panel->iLbl), False, True, 64, 0, 10);
|
||||||
icon = WMGetApplicationIconBlendedPixmap(scrPtr, (RColor*)NULL);
|
icon = WMCreateApplicationIconBlendedPixmap(scrPtr, (RColor*)NULL);
|
||||||
if (icon) {
|
if (icon) {
|
||||||
WMSetLabelImage(panel->iLbl, icon);
|
WMSetLabelImage(panel->iLbl, icon);
|
||||||
WMReleasePixmap(icon);
|
WMReleasePixmap(icon);
|
||||||
|
|||||||
@@ -1202,7 +1202,7 @@ wShowInfoPanel(WScreen *scr)
|
|||||||
panel->win = WMCreateWindow(scr->wmscreen, "info");
|
panel->win = WMCreateWindow(scr->wmscreen, "info");
|
||||||
WMResizeWidget(panel->win, 382, 230);
|
WMResizeWidget(panel->win, 382, 230);
|
||||||
|
|
||||||
logo = WMGetApplicationIconBlendedPixmap(scr->wmscreen, (RColor*)NULL);
|
logo = WMCreateApplicationIconBlendedPixmap(scr->wmscreen, (RColor*)NULL);
|
||||||
if (!logo) {
|
if (!logo) {
|
||||||
logo = WMRetainPixmap(WMGetApplicationIconPixmap(scr->wmscreen));
|
logo = WMRetainPixmap(WMGetApplicationIconPixmap(scr->wmscreen));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user