From 3301b57d4bb35daaecaea44736aa75d4a034d387 Mon Sep 17 00:00:00 2001 From: kojima Date: Fri, 11 Mar 2005 01:56:06 +0000 Subject: [PATCH] applied patch to use more gnustepish paths for some internal data files --- NEWS | 17 +++++++++-------- WINGs/WINGs/WUtil.h | 3 +++ WINGs/memory.c | 13 +++++++++++++ WPrefs.app/Appearance.c | 2 +- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index 62abdbfd..00272652 100644 --- a/NEWS +++ b/NEWS @@ -332,9 +332,10 @@ behavior regarding workspaces you can now (use WPrefs.app to do this). Client supplied icons --------------------- -Window Maker saves the client supplied icons in ~/GNUstep/.AppInfo/WindowMaker -in XPM format for later use when the app is no longer running (to have the -image to display for docked icons for example). +Window Maker saves the client supplied icons in +~/GNUstep/Library/WindowMaker/CachedPixmaps in XPM format for later use +when the app is no longer running (to have the image to display for docked +icons for example). Until recently the XPM images saved by Window Maker were incorrect, but a recent fix in the code to save XPM's fixed them. But with this fix, all @@ -342,12 +343,12 @@ previously saved XPM's in that directory are no longer readable (they give wrong images on screen or fail to load). To avoid the need for the user to fix this by hand editing WMWindowAttributes -and removing all references to icons in ~/GNUstep/.AppInfo/WindowMaker which -can be annoying, new code was added to Window Maker to permit the regeneration -of images in ~/GNUstep/.AppInfo/WindowMaker if they are missing. +and removing all references to icons in ~/GNUstep/Library/WindowMaker/CachedPixmaps +which can be annoying, new code was added to Window Maker to permit the +regeneration of images in ~/GNUstep/Library/WindowMaker/CachedPixmaps if they are missing. With this addition, all you need to do to fix your old broken images, is to -delete all *.xpm files from ~/GNUstep/.AppInfo/WindowMaker. Next time the +delete all *.xpm files from ~/GNUstep/Library/WindowMaker/CachedPixmaps. Next time the application that is supplying an icon image will start the icon will be recreated if missing, but this time it will be saved with the new XPM save code which produces good XPM images. @@ -1213,7 +1214,7 @@ Persistent Program Suplied Icons Application supplied icons are now stored, so that the dock will keep showing them after the app is exited. The icons are stored at -~/GNUstep/.AppInfo/WindowMaker/ +~/GNUstep/Library/WindowMaker/CachedPixmaps Sound support diff --git a/WINGs/WINGs/WUtil.h b/WINGs/WINGs/WUtil.h index 9a1c7b83..1a76b174 100644 --- a/WINGs/WINGs/WUtil.h +++ b/WINGs/WINGs/WUtil.h @@ -234,9 +234,12 @@ char* wexpandpath(char *path); char* wgethomedir(); void* wmalloc(size_t size); +void* wmalloc0(size_t size); void* wrealloc(void *ptr, size_t newsize); void wfree(void *ptr); +#define wnew(type, count) wmalloc(sizeof(type)*count) +#define wnew0(type, count) wmalloc0(sizeof(type)*count) void wrelease(void *ptr); void* wretain(void *ptr); diff --git a/WINGs/memory.c b/WINGs/memory.c index efd69baf..0ae75edd 100644 --- a/WINGs/memory.c +++ b/WINGs/memory.c @@ -110,6 +110,19 @@ wmalloc(size_t size) } +void* +wmalloc0(size_t size) +{ + void *ptr= wmalloc(size); + if (!ptr) + return NULL; + + memset(ptr, 0, size); + + return ptr; +} + + void* wrealloc(void *ptr, size_t newsize) { diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c index 4ff6eea8..a98cb284 100644 --- a/WPrefs.app/Appearance.c +++ b/WPrefs.app/Appearance.c @@ -1726,7 +1726,7 @@ createPanel(Panel *p) char *tmp; Bool ok = True; - panel->fprefix = wstrconcat(wusergnusteppath(), "/.AppInfo"); + panel->fprefix = wstrconcat(wusergnusteppath(), "/Library/WindowMaker/WPrefs"); if (access(panel->fprefix, F_OK)!=0) { if (mkdir(panel->fprefix, 0755) < 0) {