1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-02-13 04:15:50 +01:00

For libwraster:

---------------

- Added retain/release mechanism to RImage by adding RRetainImage() and
  RReleaseImage(). RDestroyImage() is an alias to RReleaseImage() now, but
  will be removed in a future release because it no longer fits with the
  semantics. Will be kept for a while to allow a smoother transition.
  More about in wrlib/NEWS


For WINGs:
----------

- Small API change:
  1. Renamed WMSetApplicationIconImage(), WMGetApplicationIconImage() and
     WMSetWindowMiniwindowImage() to respectively WMSetApplicationIconPixmap(),
     WMGetApplicationIconPixmap() and WMSetWindowMiniwindowPixmap()
     They operate on a WMPixmap which is practically an X Pixmap with no alpha
     channel information and the new name is more suggestive and also leaves
     room for the new functions added for operating on images with alpha info.
  2. Added WMSetApplicationIconImage() and WMGetApplicationIconImage() which
     operate on an RImage and store alpha information too.
  3. Added WMGetApplicationIconBlendedPixmap() which will take the image with
     alpha set by WMSetApplicationIconImage() and will blend it with a color.
     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
  correctly in panels and wherever else needed. More about in WINGs/NEWS.
- updated panels to use the newly available RImages if present and fallback
  to old WMPixmaps if not, to properly show alpha blended images.
- replaced some still left malloc's with wmalloc's.


For Window Maker:
-----------------
- Fixed wrong mapping position of the "Docked Applications Panel" for some
  icons.
- Smoother animation for the smiley =)
- Made images with alpha blending be shown correctly in the panels and the
  icon chooser.
- The icon image set to be shown in panels ("Logo.WMPanel") will be
  automatically updated if its entry in WMWindowAttributes changes (without
  a need to restart as until now).


*** Note!!! ***

If you are developing applications with one of libwraster or libWINGs
then you should look to wrlib/NEWS and WINGs/NEWS to see what changed
and how should you update your code.
This commit is contained in:
dan
2001-04-21 07:12:21 +00:00
parent eb11184ef0
commit 36e46831e0
52 changed files with 782 additions and 466 deletions

View File

@@ -29,6 +29,23 @@ Changes since wmaker 0.64.0:
performance a bit.
- replaced some recursive code with iterative code in selection.c
- added WMCreateBlendedPixmapFromRImage()
- Small API change:
1. Renamed WMSetApplicationIconImage(), WMGetApplicationIconImage() and
WMSetWindowMiniwindowImage() to respectively WMSetApplicationIconPixmap(),
WMGetApplicationIconPixmap() and WMSetWindowMiniwindowPixmap()
They operate on a WMPixmap which is practically an X Pixmap with no alpha
channel information and the new name is more suggestive and also leaves
room for the new functions added for operating on images with alpha info.
2. Added WMSetApplicationIconImage() and WMGetApplicationIconImage() which
operate on an RImage and store alpha information too.
3. Added WMGetApplicationIconBlendedPixmap() which will take the image with
alpha set by WMSetApplicationIconImage() and will blend it with a color.
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
correctly in panels and wherever else needed. More about in NEWS.
- updated panels to use the newly available RImages if present and fallback
to old WMPixmaps if not, to properly show alpha blended images.
- replaced some still left malloc's with wmalloc's.
changes since wmaker 0.63.1:

77
WINGs/NEWS Normal file
View File

@@ -0,0 +1,77 @@
*** Sat Apr 21 09:12:09 EEST 2001 -Dan
API change
----------
To allow a correct display of icon images with alpha blending in panels and
other places where a WINGs based application may use them the following
changes took place:
1. The following functions were renamed:
- WMSetApplicationIconImage() --> WMSetApplicationIconPixmap()
- WMGetApplicationIconImage() --> WMGetApplicationIconPixmap()
- WMSetWindowMiniwindowImage() --> WMSetWindowMiniwindowPixmap()
2. The following functions were added:
- WMSetApplicationIconImage(WMScreen *scr, RImage *image)
- RImage* WMGetApplicationIconImage(WMScreen *scr)
- WMPixmap* WMGetApplicationIconBlendedPixmap(WMScreen *scr, RColor *color)
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()
to make them more suggestive about what they do and to make room for the
new functions that operate on RImages (that hold alpha information).
Since the corresponding WMGet... functions only retrieve the stored
image/pixmap from the application, I'll outline how the WMSet...
functions operate:
All WM...IconPixmap() functions operate on WMPixmaps
All WM...IconImage() functions operate on RImages
- WMSetApplicationIconImage() will set the RImage to be used in panels
and will also convert the RImage to a WMPixmap with a threshold of 128
and will use that pixmap for the appicon image. If that doesn't satisfy
you, you can make a call to WMSetApplicationIconPixmap() on your own to
set whatever WMPixmap you see fit for the appicon.
- WMSetApplicationIconPixmap() will set the WMPixmap to be used for the
appicon and for the panels
If you use only one of the above functions, the corresponding image/pixmap
will be used everywhere where needed (panels and appicon), but the pixmap
version will not be able to handle alpha blending correctly.
If you use both WMSetApplicationIconImage() and WMSetApplicationIconPixmap()
then the RImage will have priority in panels, and the WMPixmap will only be
used for the appicon. This allows you to better control what icon is
displayed in the appicon, in case the default conversion of the RImage to a
pixmap with a threshold of 128 is not good enough, or in case you want a
different icon to be shown in the appicon than in panels.
Also this new function was added:
- WMGetApplicationIconBlendedPixmap() will use the RImage set with
WMSetApplicationIconImage() if available and will blend it with the color
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
WMReleasePixmap() on it after you finish with it. Passing a NULL pointer
instead of a color will make the RImage be blended with the default color
of the WINGs widgets: '#aeaaae' making it suitable to be assigned to any
WINGs widget.
To make your existing code work as before all you need to do is to rename
the following functions:
- WMSetApplicationIconImage() --> WMSetApplicationIconPixmap()
- WMGetApplicationIconImage() --> WMGetApplicationIconPixmap()
- WMSetWindowMiniwindowImage() --> WMSetWindowMiniwindowPixmap()
But if you want to take advantage of the new abilities to show alpha
blended images you need to start using the new functions.

View File

@@ -102,7 +102,7 @@ int main(int argc, char **argv)
pixmap = WMCreatePixmapFromXPMData(scr, GNUSTEP_XPM);
WMSetApplicationIconImage(scr, pixmap);
WMSetApplicationIconPixmap(scr, pixmap);
WMReleasePixmap(pixmap);
if (panelType == SAVE_PANEL_TYPE) {
sPanel = WMGetSavePanel(scr);

View File

@@ -88,8 +88,8 @@ int main(int argc, char **argv)
scr = WMCreateSimpleApplicationScreen(dpy);
pixmap = WMCreatePixmapFromXPMData(scr, GNUSTEP_XPM);
WMSetApplicationIconImage(scr, pixmap); WMReleasePixmap(pixmap);
WMSetApplicationIconPixmap(scr, pixmap); WMReleasePixmap(pixmap);
if ((result = WMRunInputPanel(scr, NULL, title, prompt, initial, "OK", "Cancel")) != NULL)
printf("%s\n", result);

View File

@@ -357,12 +357,12 @@ testGradientButtons(WMScreen *scr)
back = RRenderGradient(60, 24, &dark, &light, RGRD_DIAGONAL);
RBevelImage(back, RBEV_RAISED2);
pix1 = WMCreatePixmapFromRImage(scr, back, 0);
RDestroyImage(back);
RReleaseImage(back);
back = RRenderGradient(60, 24, &dark, &light, RGRD_DIAGONAL);
RBevelImage(back, RBEV_SUNKEN);
pix2 = WMCreatePixmapFromRImage(scr, back, 0);
RDestroyImage(back);
RReleaseImage(back);
color = WMWhiteColor(scr);
altColor = WMCreateNamedColor(scr, "red", True);
@@ -1283,7 +1283,7 @@ main(int argc, char **argv)
/*
* Makes the logo be used in standard dialog panels.
*/
WMSetApplicationIconImage(scr, pixmap); WMReleasePixmap(pixmap);
WMSetApplicationIconPixmap(scr, pixmap); WMReleasePixmap(pixmap);
/*
* Do some test stuff.

View File

@@ -467,7 +467,7 @@ typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
int *minSize, int *maxSize);
typedef WMWidget *WMMatrixCreateCellProc(WMMatrix *mPtr);
typedef WMWidget* WMMatrixCreateCellProc(WMMatrix *mPtr);
@@ -595,20 +595,20 @@ void WMInitializeApplication(char *applicationName, int *argc, char **argv);
void WMSetResourcePath(char *path);
/* don't free the returned string */
char *WMGetApplicationName();
char* WMGetApplicationName();
/* Try to locate resource file. ext may be NULL */
char *WMPathForResourceOfType(char *resource, char *ext);
char* WMPathForResourceOfType(char *resource, char *ext);
WMScreen *WMOpenScreen(const char *display);
WMScreen* WMOpenScreen(const char *display);
WMScreen *WMCreateScreenWithRContext(Display *display, int screen,
WMScreen* WMCreateScreenWithRContext(Display *display, int screen,
RContext *context);
WMScreen *WMCreateScreen(Display *display, int screen);
WMScreen* WMCreateScreen(Display *display, int screen);
WMScreen *WMCreateSimpleApplicationScreen(Display *display);
WMScreen* WMCreateSimpleApplicationScreen(Display *display);
void WMScreenMainLoop(WMScreen *scr);
@@ -616,23 +616,30 @@ void WMBreakModalLoop(WMScreen *scr);
void WMRunModalLoop(WMScreen *scr, WMView *view);
RContext *WMScreenRContext(WMScreen *scr);
RContext* WMScreenRContext(WMScreen *scr);
Display *WMScreenDisplay(WMScreen *scr);
Display* WMScreenDisplay(WMScreen *scr);
int WMScreenDepth(WMScreen *scr);
void WMSetApplicationIconImage(WMScreen *app, WMPixmap *icon);
void WMSetApplicationIconImage(WMScreen *app, RImage *image);
WMPixmap *WMGetApplicationIconImage(WMScreen *app);
RImage* WMGetApplicationIconImage(WMScreen *app);
void WMSetApplicationIconPixmap(WMScreen *app, WMPixmap *icon);
WMPixmap* WMGetApplicationIconPixmap(WMScreen *app);
/* If color==NULL it will use the default color for panels: ae/aa/ae */
WMPixmap* WMGetApplicationIconBlendedPixmap(WMScreen *scr, RColor *color);
void WMSetApplicationIconWindow(WMScreen *scr, Window window);
void WMSetFocusToWidget(WMWidget *widget);
WMEventHook *WMHookEventHandler(WMEventHook *handler);
WMEventHook* WMHookEventHandler(WMEventHook *handler);
int WMHandleEvent(XEvent *event);
@@ -682,22 +689,22 @@ WMPoint WMGetDraggingInfoImageLocation(WMDraggingInfo *info);
/* ....................................................................... */
WMFont *WMCreateFontSet(WMScreen *scrPtr, char *fontName);
WMFont* WMCreateFontSet(WMScreen *scrPtr, char *fontName);
WMFont *WMCreateNormalFont(WMScreen *scrPtr, char *fontName);
WMFont* WMCreateNormalFont(WMScreen *scrPtr, char *fontName);
WMFont *WMCreateFont(WMScreen *scrPtr, char *fontName);
WMFont* WMCreateFont(WMScreen *scrPtr, char *fontName);
WMFont *WMRetainFont(WMFont *font);
WMFont* WMRetainFont(WMFont *font);
void WMReleaseFont(WMFont *font);
unsigned int WMFontHeight(WMFont *font);
/*
WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
WMFont* WMUserFontOfSize(WMScreen *scrPtr, int size);
WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
WMFont* WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
*/
@@ -705,50 +712,50 @@ void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
WMFont *WMSystemFontOfSize(WMScreen *scrPtr, int size);
WMFont* WMSystemFontOfSize(WMScreen *scrPtr, int size);
WMFont *WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
WMFont* WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
XFontSet WMGetFontFontSet(WMFont *font);
WMFont *WMNormalizeFont(WMScreen *scr, WMFont *font);
WMFont* WMNormalizeFont(WMScreen *scr, WMFont *font);
WMFont *WMStrengthenFont(WMScreen *scr, WMFont *font);
WMFont* WMStrengthenFont(WMScreen *scr, WMFont *font);
WMFont *WMUnstrengthenFont(WMScreen *scr, WMFont *font);
WMFont* WMUnstrengthenFont(WMScreen *scr, WMFont *font);
WMFont *WMEmphasizeFont(WMScreen *scr, WMFont *font);
WMFont* WMEmphasizeFont(WMScreen *scr, WMFont *font);
WMFont *WMUnemphasizeFont(WMScreen *scr, WMFont *font);
WMFont* WMUnemphasizeFont(WMScreen *scr, WMFont *font);
WMFont *WMGetFontOfSize(WMScreen *scr, WMFont *font, int size);
WMFont* WMGetFontOfSize(WMScreen *scr, WMFont *font, int size);
/* ....................................................................... */
WMPixmap *WMRetainPixmap(WMPixmap *pixmap);
WMPixmap* WMRetainPixmap(WMPixmap *pixmap);
void WMReleasePixmap(WMPixmap *pixmap);
WMPixmap *WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
WMPixmap* WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
Bool masked);
WMPixmap *WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
WMPixmap* WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
Pixmap mask, int width, int height,
int depth);
WMPixmap *WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image,
WMPixmap* WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image,
int threshold);
WMPixmap *WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
WMPixmap* WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
WMSize WMGetPixmapSize(WMPixmap *pixmap);
WMPixmap *WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
WMPixmap* WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
WMPixmap* WMCreateBlendedPixmapFromRImage(WMScreen *scrPtr, RImage *image,
RColor *color);
WMPixmap *WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
WMPixmap* WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
RColor *color);
void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
@@ -757,18 +764,18 @@ Pixmap WMGetPixmapXID(WMPixmap *pixmap);
Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
WMPixmap *WMGetSystemPixmap(WMScreen *scr, int image);
WMPixmap* WMGetSystemPixmap(WMScreen *scr, int image);
/* ....................................................................... */
WMColor *WMDarkGrayColor(WMScreen *scr);
WMColor* WMDarkGrayColor(WMScreen *scr);
WMColor *WMGrayColor(WMScreen *scr);
WMColor* WMGrayColor(WMScreen *scr);
WMColor *WMBlackColor(WMScreen *scr);
WMColor* WMBlackColor(WMScreen *scr);
WMColor *WMWhiteColor(WMScreen *scr);
WMColor* WMWhiteColor(WMScreen *scr);
void WMSetColorInGC(WMColor *color, GC gc);
@@ -781,13 +788,13 @@ void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
void WMReleaseColor(WMColor *color);
WMColor *WMRetainColor(WMColor *color);
WMColor* WMRetainColor(WMColor *color);
WMColor *WMCreateRGBColor(WMScreen *scr, unsigned short red,
WMColor* WMCreateRGBColor(WMScreen *scr, unsigned short red,
unsigned short green, unsigned short blue,
Bool exact);
WMColor *WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
unsigned short WMRedComponentOfColor(WMColor *color);
@@ -795,7 +802,7 @@ unsigned short WMGreenComponentOfColor(WMColor *color);
unsigned short WMBlueComponentOfColor(WMColor *color);
char *WMGetColorRGBDescription(WMColor *color);
char* WMGetColorRGBDescription(WMColor *color);
/* ....................................................................... */
@@ -812,7 +819,7 @@ int WMWidthOfString(WMFont *font, char *text, int length);
/* ....................................................................... */
WMScreen *WMWidgetScreen(WMWidget *w);
WMScreen* WMWidgetScreen(WMWidget *w);
unsigned int WMScreenWidth(WMScreen *scr);
@@ -844,7 +851,7 @@ void WMDestroyWidget(WMWidget *widget);
void WMHangData(WMWidget *widget, void *data);
void *WMGetHangedData(WMWidget *widget);
void* WMGetHangedData(WMWidget *widget);
unsigned int WMWidgetWidth(WMWidget *w);
@@ -867,7 +874,7 @@ WMPoint WMGetViewPosition(WMView *view);
WMPoint WMGetViewScreenPosition(WMView *view);
WMWidget *WMWidgetOfView(WMView *view);
WMWidget* WMWidgetOfView(WMView *view);
void WMSetViewNextResponder(WMView *view, WMView *responder);
@@ -898,14 +905,14 @@ void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
/* ....................................................................... */
WMWindow *WMCreateWindow(WMScreen *screen, char *name);
WMWindow* WMCreateWindow(WMScreen *screen, char *name);
WMWindow *WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
WMWindow* WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
WMWindow *WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
WMWindow* WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
int style);
WMWindow *WMCreatePanelForWindow(WMWindow *owner, char *name);
WMWindow* WMCreatePanelForWindow(WMWindow *owner, char *name);
void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
@@ -913,7 +920,7 @@ void WMSetWindowTitle(WMWindow *wPtr, char *title);
void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
void WMSetWindowMiniwindowImage(WMWindow *win, WMPixmap *pixmap);
void WMSetWindowMiniwindowPixmap(WMWindow *win, WMPixmap *pixmap);
void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
@@ -954,9 +961,9 @@ void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
#define WMCreateSwitchButton(parent) \
WMCreateButton((parent), WBTSwitch)
WMButton *WMCreateButton(WMWidget *parent, WMButtonType type);
WMButton* WMCreateButton(WMWidget *parent, WMButtonType type);
WMButton *WMCreateCustomButton(WMWidget *parent, int behaviourMask);
WMButton* WMCreateCustomButton(WMWidget *parent, int behaviourMask);
void WMSetButtonImageDefault(WMButton *bPtr);
@@ -1002,15 +1009,15 @@ void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
/* ....................................................................... */
WMLabel *WMCreateLabel(WMWidget *parent);
WMLabel* WMCreateLabel(WMWidget *parent);
void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
void WMSetLabelImage(WMLabel *lPtr, WMPixmap *image);
WMPixmap *WMGetLabelImage(WMLabel *lPtr);
WMPixmap* WMGetLabelImage(WMLabel *lPtr);
char *WMGetLabelText(WMLabel *lPtr);
char* WMGetLabelText(WMLabel *lPtr);
void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
@@ -1028,7 +1035,7 @@ void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
/* ....................................................................... */
WMFrame *WMCreateFrame(WMWidget *parent);
WMFrame* WMCreateFrame(WMWidget *parent);
void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
@@ -1038,14 +1045,14 @@ void WMSetFrameTitle(WMFrame *fPtr, char *title);
/* ....................................................................... */
WMTextField *WMCreateTextField(WMWidget *parent);
WMTextField* WMCreateTextField(WMWidget *parent);
void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
/* you can free the returned string */
char *WMGetTextFieldText(WMTextField *tPtr);
char* WMGetTextFieldText(WMTextField *tPtr);
void WMSetTextFieldText(WMTextField *tPtr, char *text);
@@ -1053,7 +1060,7 @@ void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
void WMSetTextFieldFont(WMTextField *tPtr, WMFont *font);
WMFont *WMGetTextFieldFont(WMTextField *tPtr);
WMFont* WMGetTextFieldFont(WMTextField *tPtr);
void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
@@ -1082,7 +1089,7 @@ extern char *WMTextDidEndEditingNotification;
/* ....................................................................... */
WMScroller *WMCreateScroller(WMWidget *parent);
WMScroller* WMCreateScroller(WMWidget *parent);
void WMSetScrollerParameters(WMScroller *sPtr, float floatValue,
float knobProportion);
@@ -1102,7 +1109,7 @@ extern char *WMScrollerDidScrollNotification;
/* ....................................................................... */
WMList *WMCreateList(WMWidget *parent);
WMList* WMCreateList(WMWidget *parent);
void WMSetListAllowMultipleSelection(WMList *lPtr, Bool flag);
@@ -1110,7 +1117,7 @@ void WMSetListAllowEmptySelection(WMList *lPtr, Bool flag);
#define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
WMListItem *WMInsertListItem(WMList *lPtr, int row, char *text);
WMListItem* WMInsertListItem(WMList *lPtr, int row, char *text);
void WMSortListItems(WMList *lPtr);
@@ -1118,9 +1125,9 @@ void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
WMListItem *WMGetListItem(WMList *lPtr, int row);
WMListItem* WMGetListItem(WMList *lPtr, int row);
WMArray *WMGetListItems(WMList *lPtr);
WMArray* WMGetListItems(WMList *lPtr);
void WMRemoveListItem(WMList *lPtr, int row);
@@ -1182,7 +1189,7 @@ extern char *WMListSelectionDidChangeNotification;
/* ....................................................................... */
WMBrowser *WMCreateBrowser(WMWidget *parent);
WMBrowser* WMCreateBrowser(WMWidget *parent);
void WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag);
@@ -1202,7 +1209,7 @@ void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
WMListItem *WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
WMListItem* WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
void WMSortBrowserColumn(WMBrowser *bPtr, int column);
@@ -1213,10 +1220,10 @@ void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
/* free the returned string */
char *WMGetBrowserPath(WMBrowser *bPtr);
char* WMGetBrowserPath(WMBrowser *bPtr);
/* free the returned string */
char *WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
char* WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
/* free the returned array */
WMArray* WMGetBrowserPaths(WMBrowser *bPtr);
@@ -1226,7 +1233,7 @@ void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
void *clientData);
WMListItem *WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
WMListItem* WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
@@ -1238,7 +1245,7 @@ int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
WMList *WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
WMList* WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
@@ -1253,7 +1260,7 @@ void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
Bool WMMenuItemIsSeparator(WMMenuItem *item);
WMMenuItem *WMCreateMenuItem(void);
WMMenuItem* WMCreateMenuItem(void);
void WMDestroyMenuItem(WMMenuItem *item);
@@ -1261,7 +1268,7 @@ Bool WMGetMenuItemEnabled(WMMenuItem *item);
void WMSetMenuItemEnabled(WMMenuItem *item, Bool flag);
char *WMGetMenuItemShortcut(WMMenuItem *item);
char* WMGetMenuItemShortcut(WMMenuItem *item);
unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
@@ -1269,19 +1276,19 @@ void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
void *WMGetMenuItemRepresentedObject(WMMenuItem *item);
void* WMGetMenuItemRepresentedObject(WMMenuItem *item);
void WMSetMenuItemRepresentedObject(WMMenuItem *item, void *object);
void WMSetMenuItemAction(WMMenuItem *item, WMAction *action, void *data);
WMAction *WMGetMenuItemAction(WMMenuItem *item);
WMAction* WMGetMenuItemAction(WMMenuItem *item);
void *WMGetMenuItemData(WMMenuItem *item);
void* WMGetMenuItemData(WMMenuItem *item);
void WMSetMenuItemTitle(WMMenuItem *item, char *title);
char *WMGetMenuItemTitle(WMMenuItem *item);
char* WMGetMenuItemTitle(WMMenuItem *item);
void WMSetMenuItemState(WMMenuItem *item, int state);
@@ -1289,40 +1296,40 @@ int WMGetMenuItemState(WMMenuItem *item);
void WMSetMenuItemPixmap(WMMenuItem *item, WMPixmap *pixmap);
WMPixmap *WMGetMenuItemPixmap(WMMenuItem *item);
WMPixmap* WMGetMenuItemPixmap(WMMenuItem *item);
void WMSetMenuItemOnStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
WMPixmap *WMGetMenuItemOnStatePixmap(WMMenuItem *item);
WMPixmap* WMGetMenuItemOnStatePixmap(WMMenuItem *item);
void WMSetMenuItemOffStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
WMPixmap *WMGetMenuItemOffStatePixmap(WMMenuItem *item);
WMPixmap* WMGetMenuItemOffStatePixmap(WMMenuItem *item);
void WMSetMenuItemMixedStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
WMPixmap *WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
WMPixmap* WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
/*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
*/
/* ....................................................................... */
WMPopUpButton *WMCreatePopUpButton(WMWidget *parent);
WMPopUpButton* WMCreatePopUpButton(WMWidget *parent);
void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
void *clientData);
void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
WMMenuItem *WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
WMMenuItem* WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
WMMenuItem *WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
WMMenuItem* WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
char *title);
void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
@@ -1338,9 +1345,9 @@ int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
/* don't free the returned data */
char *WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
char* WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
WMMenuItem *WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
WMMenuItem* WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
@@ -1351,7 +1358,7 @@ Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
/* ....................................................................... */
WMProgressIndicator *WMCreateProgressIndicator(WMWidget *parent);
WMProgressIndicator* WMCreateProgressIndicator(WMWidget *parent);
void WMSetProgressIndicatorMinValue(WMProgressIndicator *progressindicator, int value);
@@ -1368,7 +1375,7 @@ int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
/* ....................................................................... */
WMColorPanel *WMGetColorPanel(WMScreen *scrPtr);
WMColorPanel* WMGetColorPanel(WMScreen *scrPtr);
void WMFreeColorPanel(WMColorPanel *panel);
@@ -1378,7 +1385,7 @@ void WMCloseColorPanel(WMColorPanel *panel);
void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
WMColor *WMGetColorPanelColor(WMColorPanel *panel);
WMColor* WMGetColorPanelColor(WMColorPanel *panel);
void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
@@ -1388,11 +1395,11 @@ extern char *WMColorPanelColorChangedNotification;
/* ....................................................................... */
WMColorWell *WMCreateColorWell(WMWidget *parent);
WMColorWell* WMCreateColorWell(WMWidget *parent);
void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
WMColor *WMGetColorWellColor(WMColorWell *cPtr);
WMColor* WMGetColorWellColor(WMColorWell *cPtr);
void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
@@ -1402,7 +1409,7 @@ extern char *WMColorWellDidChangeNotification;
/* ...................................................................... */
WMScrollView *WMCreateScrollView(WMWidget *parent);
WMScrollView* WMCreateScrollView(WMWidget *parent);
void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
unsigned int height);
@@ -1419,9 +1426,9 @@ void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
WMScroller *WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
WMScroller* WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
WMScroller *WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
WMScroller* WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
@@ -1429,7 +1436,7 @@ void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
/* ....................................................................... */
WMSlider *WMCreateSlider(WMWidget *parent);
WMSlider* WMCreateSlider(WMWidget *parent);
int WMGetSliderMinValue(WMSlider *slider);
@@ -1454,13 +1461,15 @@ void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
/* ....................................................................... */
WMSplitView *WMCreateSplitView(WMWidget *parent);
WMSplitView* WMCreateSplitView(WMWidget *parent);
Bool WMGetSplitViewVertical(WMSplitView *sPtr);
void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
int WMGetSplitViewSubviewsCount(WMSplitView *sPtr); /* ??? remove ??? */
WMView *WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
WMView* WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
/* remove the first subview == view */
void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
@@ -1484,14 +1493,13 @@ int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
/* ...................................................................... */
WMRuler *WMCreateRuler (WMWidget *parent);
WMRuler* WMCreateRuler (WMWidget *parent);
WMRulerMargins *WMGetRulerMargins(WMRuler *rPtr);
WMRulerMargins* WMGetRulerMargins(WMRuler *rPtr);
void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin,
WMRulerMargins *anotherMargin);
Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin, WMRulerMargins *anotherMargin);
int WMGetGrabbedRulerMargin(WMRuler *rPtr);
@@ -1511,8 +1519,8 @@ void WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData);
#define WMCreateText(parent) WMCreateTextForDocumentType \
((parent), (NULL), (NULL))
WMText *WMCreateTextForDocumentType(WMWidget *parent,
WMAction *parser, WMAction *writer);
WMText* WMCreateTextForDocumentType(WMWidget *parent, WMAction *parser,
WMAction *writer);
void WMSetTextDelegate(WMText *tPtr, WMTextDelegate *delegate);
@@ -1552,11 +1560,11 @@ int WMGetTextIgnoresNewline(WMText *tPtr);
void WMSetTextDefaultFont(WMText *tPtr, WMFont *font);
WMFont * WMGetTextDefaultFont(WMText *tPtr);
WMFont* WMGetTextDefaultFont(WMText *tPtr);
void WMSetTextDefaultColor(WMText *tPtr, WMColor *color);
WMColor * WMGetTextDefaultColor(WMText *tPtr);
WMColor* WMGetTextDefaultColor(WMText *tPtr);
void WMSetTextRelief(WMText *tPtr, WMReliefType relief);
@@ -1574,24 +1582,24 @@ void WMAppendTextStream(WMText *tPtr, char *text);
((tPtr), (NULL))
/* free the text */
char * WMGetTextStream(WMText *tPtr);
char* WMGetTextStream(WMText *tPtr);
/* free the text */
char * WMGetTextSelectedStream(WMText *tPtr);
char* WMGetTextSelectedStream(WMText *tPtr);
/* destroy the array */
WMArray * WMGetTextObjects(WMText *tPtr);
WMArray* WMGetTextObjects(WMText *tPtr);
/* destroy the array */
WMArray* WMGetTextSelectedObjects(WMText *tPtr);
void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
WMColor *WMGetTextSelectionColor(WMText *tPtr);
WMColor* WMGetTextSelectionColor(WMText *tPtr);
void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
WMFont *WMGetTextSelectionFont(WMText *tPtr);
WMFont* WMGetTextSelectionFont(WMText *tPtr);
void WMSetTextSelectionUnderlined(WMText *tPtr, int underlined);
@@ -1600,30 +1608,33 @@ int WMGetTextSelectionUnderlined(WMText *tPtr);
void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
Bool WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
Bool caseSensitive);
Bool caseSensitive);
Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
/* parser related stuff... use only if implementing a new parser */
void *WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
WMColor *color, unsigned short first, unsigned short extraInfo);
void *WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
WMColor *color, unsigned short first, unsigned short extraInfo);
void* WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
WMColor *color, unsigned short first,
unsigned short extraInfo);
void* WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
WMColor *color, unsigned short first,
unsigned short extraInfo);
void* WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
WMColor *color, unsigned short first,
unsigned short length);
void *WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
WMColor *color, unsigned short first, unsigned short length);
void WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
unsigned int kanji, unsigned int underlined, int script,
WMRulerMargins *margins);
unsigned int kanji, unsigned int underlined,
int script, WMRulerMargins *margins);
/* do NOT free the margins */
void WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
unsigned int *kanji, unsigned int *underlined, int *script,
WMRulerMargins *margins);
unsigned int *kanji, unsigned int *underlined,
int *script, WMRulerMargins *margins);
int WMGetTextInsertType(WMText *tPtr);
@@ -1637,14 +1648,14 @@ void WMPrependTextBlock(WMText *tPtr, void *vtb);
void WMAppendTextBlock(WMText *tPtr, void *vtb);
void *WMRemoveTextBlock(WMText *tPtr);
void* WMRemoveTextBlock(WMText *tPtr);
void WMDestroyTextBlock(WMText *tPtr, void *vtb);
/* ....................................................................... */
WMTabView *WMCreateTabView(WMWidget *parent);
WMTabView* WMCreateTabView(WMWidget *parent);
void WMSetTabViewType(WMTabView *tPtr, WMTabViewType type);
@@ -1658,10 +1669,10 @@ void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
WMTabViewItem *WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
WMTabViewItem* WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
int identifier, char *label);
WMTabViewItem *WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
WMTabViewItem* WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
void WMSelectFirstTabViewItem(WMTabView *tPtr);
@@ -1671,7 +1682,7 @@ void WMSelectNextTabViewItem(WMTabView *tPtr);
void WMSelectPreviousTabViewItem(WMTabView *tPtr);
WMTabViewItem *WMGetSelectedTabViewItem(WMTabView *tPtr);
WMTabViewItem* WMGetSelectedTabViewItem(WMTabView *tPtr);
void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
@@ -1680,24 +1691,24 @@ void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
WMTabViewItem *WMCreateTabViewItemWithIdentifier(int identifier);
WMTabViewItem* WMCreateTabViewItemWithIdentifier(int identifier);
int WMGetTabViewItemIdentifier(WMTabViewItem *item);
void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
char *WMGetTabViewItemLabel(WMTabViewItem *item);
char* WMGetTabViewItemLabel(WMTabViewItem *item);
void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
WMView *WMGetTabViewItemView(WMTabViewItem *item);
WMView* WMGetTabViewItemView(WMTabViewItem *item);
void WMDestroyTabViewItem(WMTabViewItem *item);
/* ....................................................................... */
WMBox *WMCreateBox(WMWidget *parent);
WMBox* WMCreateBox(WMWidget *parent);
void WMSetBoxBorderWidth(WMBox *box, unsigned width);
@@ -1718,19 +1729,19 @@ int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
char *otherButton);
/* you can free the returned string */
char *WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
char* WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
char *defaultText, char *okButton, char *cancelButton);
WMAlertPanel *WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
WMAlertPanel* WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
char *msg, char *defaultButton,
char *alternateButton, char *otherButton);
WMInputPanel *WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
WMInputPanel* WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
char *msg, char *defaultText, char *okButton,
char *cancelButton);
WMGenericPanel *WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
WMGenericPanel* WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
char *title, char *defaultButton,
char *alternateButton);
@@ -1743,9 +1754,9 @@ void WMDestroyGenericPanel(WMGenericPanel *panel);
/* ....................................................................... */
/* only 1 instance per WMScreen */
WMOpenPanel *WMGetOpenPanel(WMScreen *scrPtr);
WMOpenPanel* WMGetOpenPanel(WMScreen *scrPtr);
WMSavePanel *WMGetSavePanel(WMScreen *scrPtr);
WMSavePanel* WMGetSavePanel(WMScreen *scrPtr);
void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
@@ -1756,7 +1767,7 @@ void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
/* you can free the returned string */
char *WMGetFilePanelFileName(WMFilePanel *panel);
char* WMGetFilePanelFileName(WMFilePanel *panel);
void WMFreeFilePanel(WMFilePanel *panel);
@@ -1765,13 +1776,13 @@ int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
WMView *WMGetFilePanelAccessoryView(WMFilePanel *panel);
WMView* WMGetFilePanelAccessoryView(WMFilePanel *panel);
/* ...................................................................... */
/* only 1 instance per WMScreen */
WMFontPanel *WMGetFontPanel(WMScreen *scr);
WMFontPanel* WMGetFontPanel(WMScreen *scr);
void WMShowFontPanel(WMFontPanel *panel);
@@ -1780,9 +1791,9 @@ void WMHideFontPanel(WMFontPanel *panel);
void WMSetFontPanelFont(WMFontPanel *panel, WMFont *font);
/* you can free the returned string */
char *WMGetFontPanelFontName(WMFontPanel *panel);
char* WMGetFontPanelFontName(WMFontPanel *panel);
WMFont *WMGetFontPanelFont(WMFontPanel *panel);
WMFont* WMGetFontPanelFont(WMFontPanel *panel);
#ifdef __cplusplus
}

View File

@@ -136,7 +136,8 @@ typedef struct W_Screen {
W_FocusInfo *focusInfo;
struct W_Pixmap *applicationIcon;
RImage *applicationIconImage; /* image (can have alpha channel) */
struct W_Pixmap *applicationIconPixmap; /* pixmap - no alpha channel */
Window applicationIconWindow;
struct W_Window *windowList; /* list of windows in the app */

View File

@@ -27,16 +27,16 @@ extern struct W_Application WMApplication;
void
WMSetApplicationIconWindow(WMScreen *scr, Window window)
{
{
scr->applicationIconWindow = window;
if (scr->groupLeader) {
XWMHints *hints;
hints = XGetWMHints(scr->display, scr->groupLeader);
hints->flags |= IconWindowHint;
hints->icon_window = window;
XSetWMHints(scr->display, scr->groupLeader, hints);
XFree(hints);
}
@@ -44,21 +44,52 @@ WMSetApplicationIconWindow(WMScreen *scr, Window window)
void
WMSetApplicationIconImage(WMScreen *scr, WMPixmap *icon)
{
if (scr->applicationIcon)
WMReleasePixmap(scr->applicationIcon);
scr->applicationIcon = WMRetainPixmap(icon);
WMSetApplicationIconImage(WMScreen *scr, RImage *image)
{
WMPixmap *icon;
if (scr->applicationIconImage == image)
return;
if (scr->applicationIconImage)
RReleaseImage(scr->applicationIconImage);
scr->applicationIconImage = RRetainImage(image);
/* TODO: check whether we should set the pixmap only if there's none yet */
if (image!=NULL && (icon=WMCreatePixmapFromRImage(scr, image, 128))!=NULL) {
WMSetApplicationIconPixmap(scr, icon);
WMReleasePixmap(icon);
}
}
RImage*
WMGetApplicationIconImage(WMScreen *scr)
{
return scr->applicationIconImage;
}
void
WMSetApplicationIconPixmap(WMScreen *scr, WMPixmap *icon)
{
if (scr->applicationIconPixmap == icon)
return;
if (scr->applicationIconPixmap)
WMReleasePixmap(scr->applicationIconPixmap);
scr->applicationIconPixmap = WMRetainPixmap(icon);
if (scr->groupLeader) {
XWMHints *hints;
hints = XGetWMHints(scr->display, scr->groupLeader);
hints->flags |= IconPixmapHint|IconMaskHint;
hints->icon_pixmap = icon->pixmap;
hints->icon_mask = icon->mask;
hints->icon_pixmap = (icon!=NULL ? icon->pixmap : None);
hints->icon_mask = (icon!=NULL ? icon->mask : None);
XSetWMHints(scr->display, scr->groupLeader, hints);
XFree(hints);
}
@@ -66,9 +97,35 @@ WMSetApplicationIconImage(WMScreen *scr, WMPixmap *icon)
WMPixmap*
WMGetApplicationIconImage(WMScreen *scr)
WMGetApplicationIconPixmap(WMScreen *scr)
{
return scr->applicationIcon;
return scr->applicationIconPixmap;
}
WMPixmap*
WMGetApplicationIconBlendedPixmap(WMScreen *scr, RColor *color)
{
WMPixmap *pix;
if (scr->applicationIconImage) {
RColor gray;
gray.red = 0xae;
gray.green = 0xaa;
gray.blue = 0xae;
gray.alpha = 0;
if (!color)
color = &gray;
pix = WMCreateBlendedPixmapFromRImage(scr, scr->applicationIconImage,
color);
} else {
pix = NULL;
}
return pix;
}
@@ -104,12 +161,17 @@ W_InitApplication(WMScreen *scr)
hints->flags = WindowGroupHint;
hints->window_group = leader;
if (scr->applicationIcon) {
hints->flags |= IconPixmapHint;
hints->icon_pixmap = scr->applicationIcon->pixmap;
if (scr->applicationIcon->mask) {
/* This code will never actually be reached, because to have
* scr->applicationIconPixmap set we need to have a screen first,
* but this function is called in the screen creation process.
* -Dan
*/
if (scr->applicationIconPixmap) {
hints->flags |= IconPixmapHint;
hints->icon_pixmap = scr->applicationIconPixmap->pixmap;
if (scr->applicationIconPixmap->mask) {
hints->flags |= IconMaskHint;
hints->icon_mask = scr->applicationIcon->mask;
hints->icon_mask = scr->applicationIconPixmap->mask;
}
}

View File

@@ -604,7 +604,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
RDestroyImage(image);
RReleaseImage(image);
if (pixmap)
W_PaintText(W_VIEW(panel->grayBrightnessS), pixmap->pixmap,
@@ -680,7 +680,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
RDestroyImage(image);
RReleaseImage(image);
if (pixmap)
W_PaintText(W_VIEW(panel->rgbRedS), pixmap->pixmap, panel->font12,
@@ -713,7 +713,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
RDestroyImage(image);
RReleaseImage(image);
if (pixmap)
W_PaintText(W_VIEW(panel->rgbGreenS), pixmap->pixmap, panel->font12,
@@ -747,7 +747,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
RDestroyImage(image);
RReleaseImage(image);
if (pixmap)
W_PaintText(W_VIEW(panel->rgbBlueS), pixmap->pixmap, panel->font12,
@@ -807,7 +807,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
RDestroyImage(image);
RReleaseImage(image);
if (pixmap)
W_PaintText(W_VIEW(panel->cmykCyanS), pixmap->pixmap, panel->font12,
@@ -841,7 +841,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
RDestroyImage(image);
RReleaseImage(image);
if (pixmap)
W_PaintText(W_VIEW(panel->cmykMagentaS), pixmap->pixmap, panel->font12,
@@ -875,7 +875,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
RDestroyImage(image);
RReleaseImage(image);
if (pixmap)
W_PaintText(W_VIEW(panel->cmykYellowS), pixmap->pixmap, panel->font12,
@@ -910,7 +910,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
image = RRenderGradient(141, 16, &from, &to, RGRD_HORIZONTAL);
pixmap = WMCreatePixmapFromRImage(scrPtr, image, 0);
RDestroyImage(image);
RReleaseImage(image);
if (pixmap)
W_PaintText(W_VIEW(panel->cmykBlackS), pixmap->pixmap, panel->font12,
@@ -1175,7 +1175,7 @@ WMFreeColorPanel(WMColorPanel *panel)
XFreePixmap(scr->display, panel->selectionImg);
if (panel->selectionBackImg)
XFreePixmap(scr->display, panel->selectionBackImg);
RDestroyImage(panel->customPaletteImg);
RReleaseImage(panel->customPaletteImg);
/* structs */
if (panel->lastBrowseDir)
@@ -2202,7 +2202,7 @@ wheelRender(W_ColorPanel *panel)
XFreePixmap(scr->display, panel->wheelImg);
RConvertImage(scr->rcontext, image, &panel->wheelImg);
RDestroyImage(image);
RReleaseImage(image);
/* Check if backimage exists. If it doesn't, allocate and fill it */
if (!panel->selectionBackImg) {
@@ -2477,7 +2477,7 @@ wheelUpdateBrightnessGradient(W_ColorPanel *panel, CPColor topColor)
sliderImg = RRenderGradient(16, 153, &(topColor.rgb), &to, RGRD_VERTICAL);
sliderPxmp = WMCreatePixmapFromRImage(WMWidgetScreen(panel->win),
sliderImg, 0);
RDestroyImage(sliderImg);
RReleaseImage(sliderImg);
WMSetSliderImage(panel->wheelBrightnessS, sliderPxmp);
WMReleasePixmap(sliderPxmp);
}
@@ -2823,7 +2823,7 @@ hsbUpdateBrightnessGradient(W_ColorPanel *panel)
sliderImg = RRenderGradient(141, 16, &from, &(to.rgb), RGRD_HORIZONTAL);
sliderPxmp = WMCreatePixmapFromRImage(scr, sliderImg, 0);
RDestroyImage(sliderImg);
RReleaseImage(sliderImg);
if (sliderPxmp)
W_PaintText(W_VIEW(panel->hsbBrightnessS), sliderPxmp->pixmap,
@@ -2858,7 +2858,7 @@ hsbUpdateSaturationGradient(W_ColorPanel *panel)
sliderImg = RRenderGradient(141, 16, &(from.rgb), &(to.rgb),
RGRD_HORIZONTAL);
sliderPxmp = WMCreatePixmapFromRImage(scr, sliderImg, 0);
RDestroyImage(sliderImg);
RReleaseImage(sliderImg);
if (sliderPxmp)
W_PaintText(W_VIEW(panel->hsbSaturationS), sliderPxmp->pixmap,
@@ -2894,7 +2894,7 @@ hsbUpdateHueGradient(W_ColorPanel *panel)
sliderImg = RRenderMultiGradient(141, 16, colors, RGRD_HORIZONTAL);
sliderPxmp = WMCreatePixmapFromRImage(scr, sliderImg, 0);
RDestroyImage(sliderImg);
RReleaseImage(sliderImg);
if (sliderPxmp)
W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap,
@@ -2948,7 +2948,7 @@ customRenderSpectrum(W_ColorPanel *panel)
}
}
if (panel->customPaletteImg) {
RDestroyImage(panel->customPaletteImg);
RReleaseImage(panel->customPaletteImg);
panel->customPaletteImg = NULL;
}
panel->customPaletteImg = spectrum;
@@ -2969,7 +2969,7 @@ customSetPalette(W_ColorPanel *panel)
scaledImg = RScaleImage(panel->customPaletteImg, customPaletteWidth,
customPaletteHeight);
RConvertImage(scr->rcontext, scaledImg, &image);
RDestroyImage(scaledImg);
RReleaseImage(scaledImg);
XCopyArea(scr->display, image, panel->customPaletteContentView->window,
scr->copyGC, 0, 0, customPaletteWidth, customPaletteHeight, 0, 0);
@@ -3195,7 +3195,7 @@ customPaletteMenuNewFromFile(W_ColorPanel *panel)
tmpImg = RLoadImage(scr->rcontext, filepath, 0);
if (tmpImg) {
if (panel->customPaletteImg)
RDestroyImage(panel->customPaletteImg);
RReleaseImage(panel->customPaletteImg);
panel->customPaletteImg = tmpImg;
customSetPalette(panel);
@@ -3399,7 +3399,7 @@ customPaletteHistoryCallback(WMWidget *w, void *data)
tmp = RLoadImage(scr->rcontext, filename, 0);
if (tmp) {
if (panel->customPaletteImg) {
RDestroyImage(panel->customPaletteImg);
RReleaseImage(panel->customPaletteImg);
panel->customPaletteImg = NULL;
}
panel->customPaletteImg = tmp;

View File

@@ -179,7 +179,8 @@ makeFilePanel(WMScreen *scrPtr, char *name, char *title)
{
WMFilePanel *fPtr;
WMFont *largeFont;
WMPixmap *icon;
fPtr = wmalloc(sizeof(WMFilePanel));
memset(fPtr, 0, sizeof(WMFilePanel));
@@ -197,7 +198,13 @@ makeFilePanel(WMScreen *scrPtr, char *name, char *title)
WMResizeWidget(fPtr->iconLabel, 64, 64);
WMMoveWidget(fPtr->iconLabel, 0, 0);
WMSetLabelImagePosition(fPtr->iconLabel, WIPImageOnly);
WMSetLabelImage(fPtr->iconLabel, scrPtr->applicationIcon);
icon = WMGetApplicationIconBlendedPixmap(scrPtr, (RColor*)NULL);
if (icon) {
WMSetLabelImage(fPtr->iconLabel, icon);
WMReleasePixmap(icon);
} else {
WMSetLabelImage(fPtr->iconLabel, scrPtr->applicationIconPixmap);
}
fPtr->titleLabel = WMCreateLabel(fPtr->win);
WMResizeWidget(fPtr->titleLabel, PWIDTH-64, 64);

View File

@@ -419,85 +419,85 @@ loadPixmaps(WMScreen *scr)
tmp = RGetSubImage(image, 0, 0, 24, 24);
RCombineImageWithColor(tmp, &gray);
scr->homeIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
/* make it have a white background */
tmp = RGetSubImage(image, 0, 0, 24, 24);
RCombineImageWithColor(tmp, &white);
scr->altHomeIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
/* trash can */
tmp = RGetSubImage(image, 104, 0, 24, 24);
RCombineImageWithColor(tmp, &white);
scr->trashcanIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
tmp = RGetSubImage(image, 104, 0, 24, 24);
RCombineImageWithColor(tmp, &white);
scr->altTrashcanIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
/* create dir */
tmp = RGetSubImage(image, 104, 24, 24, 24);
RCombineImageWithColor(tmp, &white);
scr->createDirIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
tmp = RGetSubImage(image, 104, 24, 24, 24);
RCombineImageWithColor(tmp, &white);
scr->altCreateDirIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
/* diskettes */
tmp = RGetSubImage(image, 24, 80, 24, 24);
RCombineImageWithColor(tmp, &white);
scr->disketteIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
tmp = RGetSubImage(image, 24, 80, 24, 24);
RCombineImageWithColor(tmp, &white);
scr->altDisketteIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
/* unmount */
tmp = RGetSubImage(image, 0, 80, 24, 24);
RCombineImageWithColor(tmp, &white);
scr->unmountIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
tmp = RGetSubImage(image, 0, 80, 24, 24);
RCombineImageWithColor(tmp, &white);
scr->altUnmountIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
/* Magnifying Glass Icon for ColorPanel */
tmp = RGetSubImage(image, 24, 0, 40, 32);
RCombineImageWithColor(tmp, &gray);
scr->magnifyIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
/* ColorWheel Icon for ColorPanel */
tmp = RGetSubImage(image, 0, 25, 24, 24);
scr->wheelIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
/* GrayScale Icon for ColorPanel */
tmp = RGetSubImage(image, 65, 0, 40, 24);
scr->grayIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
/* RGB Icon for ColorPanel */
tmp = RGetSubImage(image, 25, 33, 40, 24);
scr->rgbIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
/* CMYK Icon for ColorPanel */
tmp = RGetSubImage(image, 65, 25, 40, 24);
scr->cmykIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
/* HSB Icon for ColorPanel */
tmp = RGetSubImage(image, 0, 57, 40, 24);
scr->hsbIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
/* CustomColorPalette Icon for ColorPanel */
tmp = RGetSubImage(image, 81, 57, 40, 24);
scr->customPaletteIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
/* ColorList Icon for ColorPanel */
tmp = RGetSubImage(image, 41, 57, 40, 24);
scr->colorListIcon = WMCreatePixmapFromRImage(scr, tmp, 128);
RDestroyImage(tmp);
RReleaseImage(tmp);
RDestroyImage(image);
RReleaseImage(image);
#if 0
scr->defaultObjectIcon =

View File

@@ -103,8 +103,9 @@ WMCreateAlertPanel(WMScreen *scrPtr, WMWindow *owner,
WMAlertPanel *panel;
int dw=0, aw=0, ow=0, w;
WMBox *hbox;
WMPixmap *icon;
panel = wmalloc(sizeof(WMAlertPanel));
memset(panel, 0, sizeof(WMAlertPanel));
@@ -137,9 +138,12 @@ WMCreateAlertPanel(WMScreen *scrPtr, WMWindow *owner,
WMSetLabelImagePosition(panel->iLbl, WIPImageOnly);
WMMapWidget(panel->iLbl);
WMAddBoxSubview(hbox, WMWidgetView(panel->iLbl), False, True, 64, 0, 10);
if (scrPtr->applicationIcon) {
WMSetLabelImage(panel->iLbl, scrPtr->applicationIcon);
icon = WMGetApplicationIconBlendedPixmap(scrPtr, (RColor*)NULL);
if (icon) {
WMSetLabelImage(panel->iLbl, icon);
WMReleasePixmap(icon);
} else {
WMSetLabelImage(panel->iLbl, scrPtr->applicationIconPixmap);
}
if (title) {
@@ -521,8 +525,9 @@ WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
WMGenericPanel *panel;
int dw=0, aw=0, w;
WMBox *hbox;
WMPixmap *icon;
panel = wmalloc(sizeof(WMGenericPanel));
memset(panel, 0, sizeof(WMGenericPanel));
@@ -555,9 +560,12 @@ WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
WMSetLabelImagePosition(panel->iLbl, WIPImageOnly);
WMMapWidget(panel->iLbl);
WMAddBoxSubview(hbox, WMWidgetView(panel->iLbl), False, True, 64, 0, 10);
if (scrPtr->applicationIcon) {
WMSetLabelImage(panel->iLbl, scrPtr->applicationIcon);
icon = WMGetApplicationIconBlendedPixmap(scrPtr, (RColor*)NULL);
if (icon) {
WMSetLabelImage(panel->iLbl, icon);
WMReleasePixmap(icon);
} else {
WMSetLabelImage(panel->iLbl, scrPtr->applicationIconPixmap);
}
if (title) {

View File

@@ -36,10 +36,7 @@ WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth, Bool masked)
{
WMPixmap *pixPtr;
pixPtr = malloc(sizeof(WMPixmap));
if (!pixPtr) {
return NULL;
}
pixPtr = wmalloc(sizeof(WMPixmap));
pixPtr->screen = scrPtr;
pixPtr->width = width;
pixPtr->height = height;
@@ -65,10 +62,7 @@ WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap, Pixmap mask,
{
WMPixmap *pixPtr;
pixPtr = malloc(sizeof(WMPixmap));
if (!pixPtr) {
return NULL;
}
pixPtr = wmalloc(sizeof(WMPixmap));
pixPtr->screen = scrPtr;
pixPtr->pixmap = pixmap;
pixPtr->mask = mask;
@@ -81,8 +75,6 @@ WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap, Pixmap mask,
}
WMPixmap*
WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName)
{
@@ -95,7 +87,7 @@ WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName)
pixPtr = WMCreatePixmapFromRImage(scrPtr, image, 127);
RDestroyImage(image);
RReleaseImage(image);
return pixPtr;
}
@@ -112,10 +104,7 @@ WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image, int threshold)
return NULL;
}
pixPtr = malloc(sizeof(WMPixmap));
if (!pixPtr) {
return NULL;
}
pixPtr = wmalloc(sizeof(WMPixmap));
pixPtr->screen = scrPtr;
pixPtr->pixmap = pixmap;
pixPtr->mask = mask;
@@ -135,9 +124,12 @@ WMCreateBlendedPixmapFromRImage(WMScreen *scrPtr, RImage *image, RColor *color)
RImage *copy;
copy = RCloneImage(image);
if (!copy)
return NULL;
RCombineImageWithColor(copy, color);
pixPtr = WMCreatePixmapFromRImage(scrPtr, copy, 0);
RDestroyImage(copy);
RReleaseImage(copy);
return pixPtr;
}
@@ -158,7 +150,7 @@ WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName, RColor *color)
pixPtr = WMCreatePixmapFromRImage(scrPtr, image, 0);
RDestroyImage(image);
RReleaseImage(image);
return pixPtr;
}
@@ -176,7 +168,7 @@ WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data)
pixPtr = WMCreatePixmapFromRImage(scrPtr, image, 127);
RDestroyImage(image);
RReleaseImage(image);
return pixPtr;
}

View File

@@ -563,7 +563,7 @@ WMSetWindowDocumentEdited(WMWindow *win, Bool flag)
void
WMSetWindowMiniwindowImage(WMWindow *win, WMPixmap *pixmap)
WMSetWindowMiniwindowPixmap(WMWindow *win, WMPixmap *pixmap)
{
if ((win->miniImage && !pixmap) || (!win->miniImage && pixmap)) {
if (win->miniImage)