This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.
The branch, next has been updated
discards 3d505fed02d764cbcf491c1a4c3f6350b7f64bd9 (commit)
via fc8eab6cb1b1962d7da91e12751a875fcebfe7b5 (commit)
via 50252eb597088a99e8de2b7a8e99678ad78ee947 (commit)
via 092f41dff1b9f03186c5dd54c709fc48c0c616e9 (commit)
via ca124f3a9ed666d80e2a62c3230ac1f517351103 (commit)
via 39d810385156c824792cb0e29e1e90251674e2be (commit)
via 3fd75bf1aebd1a57cfe9c582bc05443ebf859cea (commit)
via f485d1f83fc49757cf687d81dfe352ce6d199412 (commit)
via 4fc4e84b9ac55868c09045c7c19d8aacfe3dfd66 (commit)
via a3576243a99c8173309af0cfebd027a0e9f77cfe (commit)
via 1b0ed30b9b77ad3c7bc3a2a4a4b79d8f817ba1a3 (commit)
via 0db76b822d69486a63230a0597284f90d593e4b7 (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (3d505fed02d764cbcf491c1a4c3f6350b7f64bd9)
N -- N -- N (fc8eab6cb1b1962d7da91e12751a875fcebfe7b5)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/fc8eab6cb1b1962d7da91e12751a875fcebfe7b5
commit fc8eab6cb1b1962d7da91e12751a875fcebfe7b5
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sat Apr 14 13:54:22 2012 +0200
WindowMaker: getnameforicon() function splitted
The function getnameforicon() is splitted in two:
getnameforicon + get_cached_pixmap_folder
to do a better understanding and clean code.
diff --git a/src/icon.c b/src/icon.c
index 73dae74..e7910c7 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -398,30 +398,14 @@ Bool wIconChangeImageFile(WIcon * icon, char *file)
return !error;
}
-static char *getnameforicon(WWindow * wwin)
+/* This function returns the user folder for cached pixmaps */
+static char * get_cached_pixmap_folder(void)
{
- char *prefix, *suffix;
- char *path;
+ char *prefix, *path;
int len;
- if (wwin->wm_class && wwin->wm_instance) {
- int len = strlen(wwin->wm_class) + strlen(wwin->wm_instance) +
2;
- suffix = wmalloc(len);
- snprintf(suffix, len, "%s.%s", wwin->wm_instance,
wwin->wm_class);
- } else if (wwin->wm_class) {
- int len = strlen(wwin->wm_class) + 1;
- suffix = wmalloc(len);
- snprintf(suffix, len, "%s", wwin->wm_class);
- } else if (wwin->wm_instance) {
- int len = strlen(wwin->wm_instance) + 1;
- suffix = wmalloc(len);
- snprintf(suffix, len, "%s", wwin->wm_instance);
- } else {
- return NULL;
- }
-
prefix = wusergnusteppath();
- len = strlen(prefix) + 64 + strlen(suffix);
+ len = strlen(prefix) + 64;
path = wmalloc(len + 1);
snprintf(path, len, "%s/Library/WindowMaker", prefix);
@@ -429,23 +413,41 @@ static char *getnameforicon(WWindow * wwin)
if (mkdir(path, S_IRUSR | S_IWUSR | S_IXUSR)) {
werror(_("could not create directory %s"), path);
wfree(path);
- wfree(suffix);
return NULL;
}
}
+
strcat(path, "/CachedPixmaps");
if (access(path, F_OK) != 0) {
if (mkdir(path, S_IRUSR | S_IWUSR | S_IXUSR) != 0) {
werror(_("could not create directory %s"), path);
wfree(path);
- wfree(suffix);
return NULL;
}
}
- strcat(path, "/");
- strcat(path, suffix);
- strcat(path, ".xpm");
+ return path;
+}
+
+static char *getnameforicon(WWindow * wwin)
+{
+ char *prefix, *suffix, *path;
+ int len;
+
+ if (!wwin->wm_class && !wwin->wm_instance)
+ return NULL;
+
+ prefix = get_cached_pixmap_folder();
+ if (!prefix)
+ return NULL;
+
+ suffix = StrConcatDot(wwin->wm_instance, wwin->wm_class, False);
+
+ len = strlen(prefix) + strlen(suffix) + 6;
+ path = wmalloc(len);
+ snprintf(path, len, "%s/%s.xpm", prefix, suffix);
+
+ wfree(prefix);
wfree(suffix);
return path;
http://repo.or.cz/w/wmaker-crm.git/commit/50252eb597088a99e8de2b7a8e99678ad78ee947
commit 50252eb597088a99e8de2b7a8e99678ad78ee947
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sat Apr 14 13:24:55 2012 +0200
WindowMaker: StrConcatDot used in rootmenu.c
StrConcatDot used in rootmenu.c to simplify code.
diff --git a/src/rootmenu.c b/src/rootmenu.c
index b2b28ce..a76c0d8 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -299,16 +299,13 @@ static void legalPanelCommand(WMenu * menu, WMenuEntry *
entry)
static char * getLocalizedMenuFile(char *menu)
{
char *buffer, *ptr, *locale;
- int len;
if (!Locale)
return NULL;
- len = strlen(menu) + strlen(Locale) + 8;
- buffer = wmalloc(len);
+ buffer = StrConcatDot(menu, Locale, True);
/* try menu.locale_name */
- snprintf(buffer, len, "%s.%s", menu, Locale);
if (access(buffer, F_OK) == 0)
return buffer;
http://repo.or.cz/w/wmaker-crm.git/commit/092f41dff1b9f03186c5dd54c709fc48c0c616e9
commit 092f41dff1b9f03186c5dd54c709fc48c0c616e9
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sat Apr 14 12:08:49 2012 +0200
WindowMaker: StrConcatDot used in application.c wdefaults.c
The function StrConcatDot is used in application.c and defaults.c
to simplify the code.
diff --git a/src/application.c b/src/application.c
index 584c0aa..ed38be2 100644
--- a/src/application.c
+++ b/src/application.c
@@ -128,25 +128,10 @@ void wApplicationSaveIconPathFor(char *iconPath, char
*wm_instance, char *wm_cla
WMPropList *dict = WDWindowAttributes->dictionary;
WMPropList *adict, *key, *iconk;
WMPropList *val;
- char *tmp;
- int i;
-
- i = 0;
- if (wm_instance)
- i += strlen(wm_instance);
- if (wm_class)
- i += strlen(wm_class);
-
- tmp = wmalloc(i + 8);
- *tmp = 0;
- if (wm_class && wm_instance) {
- sprintf(tmp, "%s.%s", wm_instance, wm_class);
- } else {
- if (wm_instance)
- strcat(tmp, wm_instance);
- if (wm_class)
- strcat(tmp, wm_class);
- }
+ char *tmp = NULL;
+
+ if (wm_class || wm_instance)
+ tmp = StrConcatDot(wm_instance, wm_class, False);
key = WMCreatePLString(tmp);
wfree(tmp);
diff --git a/src/wdefaults.c b/src/wdefaults.c
index d97d438..3491572 100644
--- a/src/wdefaults.c
+++ b/src/wdefaults.c
@@ -330,8 +330,7 @@ static WMPropList *get_generic_value(WScreen *scr, char
*instance, char *class,
if (class && instance) {
char *buffer;
- buffer = wmalloc(strlen(class) + strlen(instance) + 2);
- sprintf(buffer, "%s.%s", instance, class);
+ buffer = StrConcatDot(instance, class, True);
key = WMCreatePLString(buffer);
wfree(buffer);
http://repo.or.cz/w/wmaker-crm.git/commit/ca124f3a9ed666d80e2a62c3230ac1f517351103
commit ca124f3a9ed666d80e2a62c3230ac1f517351103
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sat Apr 14 12:01:28 2012 +0200
WindowMaker: EscapeWM_CLASS splitted
The function EscapeWM_CLASS is splited now, using the new
static function escape_word(). This new function includes
the code called twice by EscapeWM_CLASS.
EscapeWM_CLASS uses now StrConcatDot to simplify the code.
diff --git a/src/misc.c b/src/misc.c
index 9fbc746..0946946 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -877,57 +877,46 @@ char *GetShortcutString(char *text)
return buffer;
}
-char *EscapeWM_CLASS(char *name, char *class)
+static char * escape_word(char *word)
{
- char *ret;
- char *ename = NULL, *eclass = NULL;
+ char *eword;
int i, j, l;
+ l = strlen(word);
+ eword = wmalloc(l * 2 + 1);
+ j = 0;
+ for (i = 0; i < l; i++) {
+ if ((word[i] == '\') || (word[i] == '.'))
+ eword[j++] = '\';
+
+ eword[j++] = word[i];
+ }
+ eword[j] = 0;
+
+ return(eword);
+}
+
+char *EscapeWM_CLASS(char *name, char *class)
+{
+ char *ret = NULL, *ename = NULL, *eclass = NULL;
+
if (!name && !class)
return NULL;
- if (name) {
- l = strlen(name);
- ename = wmalloc(l * 2 + 1);
- j = 0;
- for (i = 0; i < l; i++) {
- if (name[i] == '\') {
- ename[j++] = '\';
- } else if (name[i] == '.') {
- ename[j++] = '\';
- }
- ename[j++] = name[i];
- }
- ename[j] = 0;
- }
- if (class) {
- l = strlen(class);
- eclass = wmalloc(l * 2 + 1);
- j = 0;
- for (i = 0; i < l; i++) {
- if (class[i] == '\') {
- eclass[j++] = '\';
- } else if (class[i] == '.') {
- eclass[j++] = '\';
- }
- eclass[j++] = class[i];
- }
- eclass[j] = 0;
- }
+ if (name)
+ ename = escape_word(name);
- if (ename && eclass) {
- int len = strlen(ename) + strlen(eclass) + 4;
- ret = wmalloc(len);
- snprintf(ret, len, "%s.%s", ename, eclass);
- wfree(ename);
- wfree(eclass);
- } else if (ename) {
- ret = wstrdup(ename);
+ if (class)
+ eclass = escape_word(class);
+
+ if (ename || eclass)
+ ret = StrConcatDot(ename, eclass, False);
+
+ if (ename)
wfree(ename);
- } else {
- ret = wstrdup(eclass);
+
+ if (eclass)
wfree(eclass);
- }
return ret;
}
http://repo.or.cz/w/wmaker-crm.git/commit/39d810385156c824792cb0e29e1e90251674e2be
commit 39d810385156c824792cb0e29e1e90251674e2be
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sat Apr 14 11:57:29 2012 +0200
WindowMaker: StrConcatDot is now used in session.c
The function StrConcatDot can be used now in session.c
to simplify the code.
Added "-1" to avoid overflow problems in buffers.
diff --git a/src/session.c b/src/session.c
index 2d020c7..7d1263f 100644
--- a/src/session.c
+++ b/src/session.c
@@ -176,7 +176,7 @@ static WMPropList *makeWindowState(WWindow * wwin,
WApplication * wapp)
Window win;
int i;
unsigned mask;
- char *class, *instance, *command = NULL, buffer[512];
+ char *class, *instance, *command = NULL, *buf1, buffer[512];
WMPropList *win_state, *cmd, *name, *workspace;
WMPropList *shaded, *miniaturized, *hidden, *geometry;
WMPropList *dock, *shortcut;
@@ -191,24 +191,17 @@ static WMPropList *makeWindowState(WWindow * wwin,
WApplication * wapp)
return NULL;
if (PropGetWMClass(win, &class, &instance)) {
- if (class && instance)
- snprintf(buffer, sizeof(buffer), "%s.%s", instance,
class);
- else if (instance)
- snprintf(buffer, sizeof(buffer), "%s", instance);
- else if (class)
- snprintf(buffer, sizeof(buffer), ".%s", class);
- else
- snprintf(buffer, sizeof(buffer), ".");
+ buf1 = StrConcatDot(instance, class, True);
+ snprintf(buffer, sizeof(buffer) - 1, "%s", buf1);
+ wfree(buf1);
name = WMCreatePLString(buffer);
cmd = WMCreatePLString(command);
- /*sprintf(buffer, "%d", wwin->frame->workspace+1);
- workspace = WMCreatePLString(buffer); */
workspace =
WMCreatePLString(scr->workspaces[wwin->frame->workspace]->name);
shaded = wwin->flags.shaded ? sYes : sNo;
miniaturized = wwin->flags.miniaturized ? sYes : sNo;
hidden = wwin->flags.hidden ? sYes : sNo;
- snprintf(buffer, sizeof(buffer), "%ix%i+%i+%i",
+ snprintf(buffer, sizeof(buffer) - 1, "%ix%i+%i+%i",
wwin->client.width, wwin->client.height,
wwin->frame_x, wwin->frame_y);
geometry = WMCreatePLString(buffer);
@@ -218,7 +211,7 @@ static WMPropList *makeWindowState(WWindow * wwin,
WApplication * wapp)
mask |= 1 << i;
}
- snprintf(buffer, sizeof(buffer), "%u", mask);
+ snprintf(buffer, sizeof(buffer) - 1, "%u", mask);
shortcut = WMCreatePLString(buffer);
win_state = WMCreatePLDictionary(sName, name,
http://repo.or.cz/w/wmaker-crm.git/commit/3fd75bf1aebd1a57cfe9c582bc05443ebf859cea
commit 3fd75bf1aebd1a57cfe9c582bc05443ebf859cea
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sat Apr 14 11:29:14 2012 +0200
WindowMaker: New get_texture_image function
The new function get_texture_image includes the common code of
wTextureMakePixmap() and wTextureMakeTGradient()
diff --git a/src/texture.c b/src/texture.c
index a18ed22..dca7b98 100644
--- a/src/texture.c
+++ b/src/texture.c
@@ -36,6 +36,7 @@
extern WPreferences wPreferences;
static void bevelImage(RImage * image, int relief);
+static RImage * get_texture_image(WScreen *scr, char *pixmap_file);
WTexSolid *wTextureMakeSolid(WScreen * scr, XColor * color)
{
@@ -265,20 +266,10 @@ WTexPixmap *wTextureMakePixmap(WScreen * scr, int style,
char *pixmap_file, XCol
WTexPixmap *texture;
XGCValues gcv;
RImage *image;
- char *file;
- file = FindImage(wPreferences.pixmap_path, pixmap_file);
- if (!file) {
- wwarning(_("image file "%s" used as texture could not be
found."), pixmap_file);
+ image = get_texture_image(scr, pixmap_file);
+ if (!image)
return NULL;
- }
- image = RLoadImage(scr->rcontext, file, 0);
- if (!image) {
- wwarning(_("could not load texture pixmap "%s":%s"), file,
RMessageForError(RErrorCode));
- wfree(file);
- return NULL;
- }
- wfree(file);
texture = wmalloc(sizeof(WTexture));
memset(texture, 0, sizeof(WTexture));
@@ -303,20 +294,10 @@ WTexTGradient *wTextureMakeTGradient(WScreen * scr, int
style, RColor * from, RC
WTexTGradient *texture;
XGCValues gcv;
RImage *image;
- char *file;
- file = FindImage(wPreferences.pixmap_path, pixmap_file);
- if (!file) {
- wwarning(_("image file "%s" used as texture could not be
found."), pixmap_file);
- return NULL;
- }
- image = RLoadImage(scr->rcontext, file, 0);
- if (!image) {
- wwarning(_("could not load texture pixmap "%s":%s"), file,
RMessageForError(RErrorCode));
- wfree(file);
+ image = get_texture_image(scr, pixmap_file);
+ if (!image)
return NULL;
- }
- wfree(file);
texture = wmalloc(sizeof(WTexture));
memset(texture, 0, sizeof(WTexture));
@@ -341,6 +322,27 @@ WTexTGradient *wTextureMakeTGradient(WScreen * scr, int
style, RColor * from, RC
return texture;
}
+static RImage * get_texture_image(WScreen *scr, char *pixmap_file)
+{
+ char *file;
+ RImage *image;
+
+ file = FindImage(wPreferences.pixmap_path, pixmap_file);
+ if (!file) {
+ wwarning(_("image file "%s" used as texture could not be
found."), pixmap_file);
+ return NULL;
+ }
+ image = RLoadImage(scr->rcontext, file, 0);
+ if (!image) {
+ wwarning(_("could not load texture pixmap "%s":%s"), file,
RMessageForError(RErrorCode));
+ wfree(file);
+ return NULL;
+ }
+ wfree(file);
+
+ return image;
+}
+
RImage *wTextureRenderImage(WTexture * texture, int width, int height, int
relief)
{
RImage *image = NULL;
http://repo.or.cz/w/wmaker-crm.git/commit/f485d1f83fc49757cf687d81dfe352ce6d199412
commit f485d1f83fc49757cf687d81dfe352ce6d199412
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sat Apr 14 11:23:46 2012 +0200
WindowMaker: usermenu uses now StrConcatDot
The new StrConcatDot function can be used now in usermenu.c
diff --git a/src/usermenu.c b/src/usermenu.c
index e0acc57..b43b258 100644
--- a/src/usermenu.c
+++ b/src/usermenu.c
@@ -334,14 +334,15 @@ static WMenu *readUserMenuFile(WScreen * scr, char
*file_name)
WMenu *wUserMenuGet(WScreen * scr, WWindow * wwin)
{
WMenu *menu = NULL;
- char buffer[100];
- char *path = NULL;
- char *tmp;
+ char *tmp, *tmp1, *path = NULL;
+
if (wwin->wm_instance && wwin->wm_class) {
- int len = strlen(wwin->wm_instance) + strlen(wwin->wm_class) +
7;
+ tmp1 = StrConcatDot(wwin->wm_instance, wwin->wm_class, True);
+ int len = strlen(tmp1) + 6;
tmp = wmalloc(len);
- snprintf(tmp, len, "%s.%s.menu", wwin->wm_instance,
wwin->wm_class);
+ snprintf(tmp, len, "%s.menu", tmp1);
path = wfindfile(DEF_USER_MENU_PATHS, tmp);
+ wfree(tmp1);
wfree(tmp);
if (!path)
http://repo.or.cz/w/wmaker-crm.git/commit/4fc4e84b9ac55868c09045c7c19d8aacfe3dfd66
commit 4fc4e84b9ac55868c09045c7c19d8aacfe3dfd66
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sat Apr 14 11:21:39 2012 +0200
WindowMaker: wdefaults uses now StrConcatDot
The new StrConcatDot function can be used now in wdefaults.c
diff --git a/src/wdefaults.c b/src/wdefaults.c
index d89671b..d97d438 100644
--- a/src/wdefaults.c
+++ b/src/wdefaults.c
@@ -1,3 +1,4 @@
+
/* wdefaults.c - window specific defaults
*
* Window Maker window manager
@@ -181,8 +182,7 @@ wDefaultFillAttributes(WScreen * scr, char *instance, char
*class,
if (class && instance) {
char *buffer;
- buffer = wmalloc(strlen(class) + strlen(instance) + 2);
- sprintf(buffer, "%s.%s", instance, class);
+ buffer = StrConcatDot(instance, class, True);
key1 = WMCreatePLString(buffer);
wfree(buffer);
} else {
@@ -465,6 +465,7 @@ void wDefaultChangeIcon(WScreen * scr, char *instance, char
*class, char *file)
WDDomain *db = WDWindowAttributes;
WMPropList *icon_value = NULL, *value, *attr, *key, *def_win, *def_icon
= NULL;
WMPropList *dict = db->dictionary;
+ char *buffer = NULL;
int same = 0;
if (!dict) {
@@ -477,16 +478,10 @@ void wDefaultChangeIcon(WScreen * scr, char *instance,
char *class, char *file)
WMPLSetCaseSensitive(True);
- if (instance && class) {
- char *buffer;
- buffer = wmalloc(strlen(instance) + strlen(class) + 2);
- sprintf(buffer, "%s.%s", instance, class);
+ if (instance || class) {
+ buffer = StrConcatDot(instance, class, False);
key = WMCreatePLString(buffer);
wfree(buffer);
- } else if (instance) {
- key = WMCreatePLString(instance);
- } else if (class) {
- key = WMCreatePLString(class);
} else {
key = WMRetainPropList(AnyWindow);
}
http://repo.or.cz/w/wmaker-crm.git/commit/a3576243a99c8173309af0cfebd027a0e9f77cfe
commit a3576243a99c8173309af0cfebd027a0e9f77cfe
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sat Apr 14 11:08:56 2012 +0200
WindowMaker: StrConcatStr include new argument
StrConcatDot concats the first and second argument with a dot.
The function char *StrConcatDot(char *a, char *b) is now
char *StrConcatDot(char *a, char *b, Bool alwaysdot).
This new argument will be used to simplify the code in next patches.
Now:
If alwaysdot is True, the dot is added always,
If alwaysdot is False, the dot is added only if first and second argument
exist
diff --git a/src/funcs.h b/src/funcs.h
index e827504..e320a07 100644
--- a/src/funcs.h
+++ b/src/funcs.h
@@ -79,7 +79,7 @@ int calcIntersectionArea(int x1, int y1, int w1, int h1,
char *MakeCPPArgs(char *path);
#endif
-char * StrConcatDot(char *a, char *b);
+char *StrConcatDot(char *a, char *b, Bool alwaysdot);
char * ExpandOptions(WScreen *scr, char *cmdline);
char * ShrinkString(WMFont *font, char *string, int width);
char * FindImage(char *paths, char *file);
diff --git a/src/misc.c b/src/misc.c
index fd283c2..9fbc746 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1048,20 +1048,33 @@ Bool UpdateDomainFile(WDDomain * domain)
return result;
}
-char *StrConcatDot(char *a, char *b)
+/* Concats the first and second argument with a point.
+ * If alwayspoint is True, the point is added always,
+ * If alwayspoint is False, the point is added only
+ * if first and second argument exists
+ */
+char *StrConcatDot(char *a, char *b, Bool alwayspoint)
{
- int len;
+ int len, fail = 0;
char *str;
- if (!a)
+ if (!a) {
a = "";
- if (!b)
+ fail++;
+ }
+
+ if (!b) {
b = "";
+ fail++;
+ }
- len = strlen(a) + strlen(b) + 4;
+ len = strlen(a) + strlen(b) + 2 - fail + 1 ;
str = wmalloc(len);
- snprintf(str, len, "%s.%s", a, b);
+ if (!alwayspoint && fail > 0)
+ snprintf(str, len, "%s%s", a, b);
+ else
+ snprintf(str, len, "%s.%s", a, b);
return str;
}
diff --git a/src/window.c b/src/window.c
index f05be9e..bd02044 100644
--- a/src/window.c
+++ b/src/window.c
@@ -781,7 +781,7 @@ WWindow *wManageWindow(WScreen *scr, Window window)
/* // only enter here if PropGetWMClass() succeds */
PropGetWMClass(wwin->main_window, &class, &instance);
- buffer = StrConcatDot(instance, class);
+ buffer = StrConcatDot(instance, class, True);
index = WMFindInArray(scr->fakeGroupLeaders, matchIdentifier,
(void *)buffer);
if (index != WANotFound) {
diff --git a/src/winspector.c b/src/winspector.c
index 37ae0b2..1d74313 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -463,7 +463,7 @@ static void saveSettings(WMButton * button, InspectorPanel
* panel)
WDDomain *db = WDWindowAttributes;
WMPropList *dict = db->dictionary;
WMPropList *winDic, *appDic, *value, *key, *key2;
- char *icon_file;
+ char *icon_file, *buffer;
int flags = 0;
int different = 0, different2 = 0;
@@ -475,9 +475,7 @@ static void saveSettings(WMButton * button, InspectorPanel
* panel)
else if (WMGetButtonSelected(panel->clsRb) != 0)
key = WMCreatePLString(wwin->wm_class);
else if (WMGetButtonSelected(panel->bothRb) != 0) {
- char *buffer;
-
- buffer = StrConcatDot(wwin->wm_instance, wwin->wm_class);
+ buffer = StrConcatDot(wwin->wm_instance, wwin->wm_class, True);
key = WMCreatePLString(buffer);
wfree(buffer);
} else if (WMGetButtonSelected(panel->defaultRb) != 0) {
@@ -639,7 +637,7 @@ static void saveSettings(WMButton * button, InspectorPanel
* panel)
char *class = wapp->main_window_desc->wm_class;
char *buffer;
- buffer = StrConcatDot(instance, class);
+ buffer = StrConcatDot(instance, class, True);
key2 = WMCreatePLString(buffer);
wfree(buffer);
http://repo.or.cz/w/wmaker-crm.git/commit/1b0ed30b9b77ad3c7bc3a2a4a4b79d8f817ba1a3
commit 1b0ed30b9b77ad3c7bc3a2a4a4b79d8f817ba1a3
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sat Apr 14 02:27:33 2012 +0200
WindowMaker: Header files clean code
Changes:
- Spaces replaced by tabs in the structs
- Removed unused variables:
- has_titlebar, never used
- Functions sort by return type
diff --git a/src/defaults.h b/src/defaults.h
index 9174e81..95ddff2 100644
--- a/src/defaults.h
+++ b/src/defaults.h
@@ -22,42 +22,32 @@
#define WMDEFAULTS_H_
typedef struct WDDomain {
- char *domain_name;
- WMPropList *dictionary;
- char *path;
- time_t timestamp;
+ char *domain_name;
+ WMPropList *dictionary;
+ char *path;
+ time_t timestamp;
} WDDomain;
-#if 0
-WMPropList* wDefaultsInit(int screen_number);
-#endif
-
-
-WDDomain* wDefaultsInitDomain(char *domain, Bool requireDictionary);
+WDDomain * wDefaultsInitDomain(char *domain, Bool requireDictionary);
void wDefaultsMergeGlobalMenus(WDDomain *menuDomain);
void wReadDefaults(WScreen *scr, WMPropList *new_dict);
-
void wDefaultUpdateIcons(WScreen *scr);
-
void wReadStaticDefaults(WMPropList *dict);
-
void wDefaultsCheckDomains(void *arg);
-
void wSaveDefaults(WScreen *scr);
+void wDefaultFillAttributes(WScreen *scr, char *instance, char *class,
+ WWindowAttributes *attr, WWindowAttributes *mask,
+ Bool useGlobalDefault);
+
-char *wDefaultGetIconFile(WScreen *scr, char *instance, char *class,
+char * wDefaultGetIconFile(WScreen *scr, char *instance, char *class,
Bool noDefault);
-RImage *wDefaultGetImage(WScreen *scr, char *winstance, char *wclass, int
max_size);
+RImage * wDefaultGetImage(WScreen *scr, char *winstance, char *wclass, int
max_size);
-void wDefaultFillAttributes(WScreen *scr, char *instance, char *class,
- WWindowAttributes *attr, WWindowAttributes *mask,
- Bool useGlobalDefault);
int wDefaultGetStartWorkspace(WScreen *scr, char *instance, char *class);
-
void wDefaultChangeIcon(WScreen *scr, char *instance, char* class, char *file);
-
#endif /* WMDEFAULTS_H_ */
diff --git a/src/funcs.h b/src/funcs.h
index f64a40f..e827504 100644
--- a/src/funcs.h
+++ b/src/funcs.h
@@ -28,103 +28,75 @@
#include "defaults.h"
typedef void (WCallBack)(void *cdata);
-
typedef void (WDeathHandler)(pid_t pid, unsigned int status, void *cdata);
void Shutdown(WShutdownMode mode);
-
void RestoreDesktop(WScreen *scr);
-
void Exit(int status) __attribute__((noreturn));
-
void Restart(char *manager, Bool abortOnFailure);
-
void SetupEnvironment(WScreen *scr);
-
void DispatchEvent(XEvent *event);
-
void UpdateSwitchMenu(WScreen *scr, WWindow *wwin, int action);
-
-Bool wRootMenuPerformShortcut(XEvent *event);
-
void wRootMenuBindShortcuts(Window window);
-
void OpenRootMenu(WScreen *scr, int x, int y, int keyboard);
-
void OpenSwitchMenu(WScreen *scr, int x, int y, int keyboard);
-
void InitializeSwitchMenu(void);
-
void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard);
-
void OpenWindowMenu2(WWindow *wwin, int x, int y, int keyboard);
-
void OpenMiniwindowMenu(WWindow *wwin, int x, int y);
-
void CloseWindowMenu(WScreen *scr);
-
void DestroyWindowMenu(WScreen *scr);
-
-WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata);
-
void wColormapInstallForWindow(WScreen *scr, WWindow *wwin);
-
void wColormapInstallRoot(WScreen *scr);
-
void wColormapUninstallRoot(WScreen *scr);
-
void wColormapAllowClientInstallation(WScreen *scr, Bool starting);
+void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head);
+void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool
class_only);
+void SendHelperMessage(WScreen *scr, char type, int workspace, char *msg);
+void UnescapeWM_CLASS(char *str, char **name, char **class);
+void ExecuteShellCommand(WScreen *scr, char *command);
+void ExecExitScript();
+void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
+ unsigned int width, unsigned int height);
-Pixmap LoadIcon(WScreen *scr, char *path, char *mask, int title_height);
+void ParseWindowName(WMPropList *value, char **winstance, char **wclass,
+ char *where);
-void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head);
+void wHackedGrabButton(unsigned int button, unsigned int modifiers,
+ Window grab_window, Bool owner_events,
+ unsigned int event_mask, int pointer_mode,
+ int keyboard_mode, Window confine_to, Cursor cursor);
-int calcIntersectionArea(int x1, int y1, int w1, int h1,
- int x2, int y2, int w2, int h2);
+WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata);
-void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
- unsigned int width, unsigned int height);
+Pixmap LoadIcon(WScreen *scr, char *path, char *mask, int title_height);
-void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool
class_only);
+int calcIntersectionArea(int x1, int y1, int w1, int h1,
+ int x2, int y2, int w2, int h2);
#ifdef USECPP
char *MakeCPPArgs(char *path);
#endif
-char *StrConcatDot(char *a, char *b);
-
-char *ExpandOptions(WScreen *scr, char *cmdline);
-
-void ExecuteShellCommand(WScreen *scr, char *command);
+char * StrConcatDot(char *a, char *b);
+char * ExpandOptions(WScreen *scr, char *cmdline);
+char * ShrinkString(WMFont *font, char *string, int width);
+char * FindImage(char *paths, char *file);
+char * GetShortcutString(char *text);
+char * EscapeWM_CLASS(char *name, char *class);
+Bool wRootMenuPerformShortcut(XEvent *event);
Bool RelaunchWindow(WWindow *wwin);
-
Bool IsDoubleClick(WScreen *scr, XEvent *event);
+Bool UpdateDomainFile(WDDomain *domain);
-WWindow *NextToFocusAfter(WWindow *wwin);
-WWindow *NextToFocusBefore(WWindow *wwin);
+WWindow * NextToFocusAfter(WWindow *wwin);
+WWindow * NextToFocusBefore(WWindow *wwin);
void SlideWindow(Window win, int from_x, int from_y, int to_x, int to_y);
-char *ShrinkString(WMFont *font, char *string, int width);
-
-char *FindImage(char *paths, char *file);
-
-RImage*wGetImageForWindowName(WScreen *scr, char *winstance, char *wclass);
-
-void ParseWindowName(WMPropList *value, char **winstance, char **wclass,
- char *where);
-
-void SendHelperMessage(WScreen *scr, char type, int workspace, char *msg);
-
-char *GetShortcutString(char *text);
-
-char *EscapeWM_CLASS(char *name, char *class);
-
-void UnescapeWM_CLASS(char *str, char **name, char **class);
-
-Bool UpdateDomainFile(WDDomain *domain);
+RImage * wGetImageForWindowName(WScreen *scr, char *winstance, char *wclass);
#ifdef NUMLOCK_HACK
void wHackedGrabKey(int keycode, unsigned int modifiers,
@@ -132,25 +104,16 @@ void wHackedGrabKey(int keycode, unsigned int modifiers,
int keyboard_mode);
#endif
-void wHackedGrabButton(unsigned int button, unsigned int modifiers,
- Window grab_window, Bool owner_events,
- unsigned int event_mask, int pointer_mode,
- int keyboard_mode, Window confine_to, Cursor cursor);
-
-
-void ExecExitScript();
-
/****** I18N Wrapper for XFetchName,XGetIconName ******/
Bool wFetchName(Display *dpy, Window win, char **winname);
Bool wGetIconName(Display *dpy, Window win, char **iconname);
/* Free returned string it when done. (applies to the next 2 functions) */
-char* GetCommandForWindow(Window win);
-char* GetProgramNameForWindow(Window win);
+char * GetCommandForWindow(Window win);
+char * GetProgramNameForWindow(Window win);
Bool GetCommandForPid(int pid, char ***argv, int *argc);
int getWVisualID(int screen);
-
#endif
diff --git a/src/icon.h b/src/icon.h
index 9786995..09b4190 100644
--- a/src/icon.h
+++ b/src/icon.h
@@ -26,52 +26,50 @@
#include "window.h"
#include "funcs.h"
-
#define TILE_NORMAL 0
#define TILE_CLIP 1
-
typedef struct WIcon {
- WCoreWindow *core;
- WWindow *owner; /* owner window */
- char *icon_name; /* the icon name hint */
+ WCoreWindow *core;
+ WWindow *owner; /* owner window */
+ char *icon_name; /* the icon name hint */
- Window icon_win; /* client suplied icon window */
+ Window icon_win; /* client suplied icon window */
- char *file; /* the file with the icon image */
- RImage *file_image; /* the image from the file */
+ char *file; /* the file with the icon image */
+ RImage *file_image; /* the image from the file */
- unsigned int tile_type:4;
- unsigned int show_title:1;
- unsigned int has_titlebar:1;
- unsigned int force_paint:1; /* True for icon update and repaint */
- unsigned int selected:1;
- unsigned int step:3; /* selection cycle step */
- unsigned int shadowed:1; /* If the icon is to be blured */
- unsigned int mapped:1;
- unsigned int highlighted:1;
+ unsigned int tile_type:4;
+ unsigned int show_title:1;
+ unsigned int force_paint:1; /* True for icon update and repaint */
+ unsigned int selected:1;
+ unsigned int step:3; /* selection cycle step */
+ unsigned int shadowed:1; /* If the icon is to be blured */
+ unsigned int mapped:1;
+ unsigned int highlighted:1;
- Pixmap pixmap;
+ Pixmap pixmap;
- WMHandlerID handlerID; /* timer handler ID for cycling
select
- * color */
+ WMHandlerID handlerID; /* timer handler ID for cycling select
+ * color */
} WIcon;
-WIcon *wIconCreateWithIconFile(WScreen *scr, char *iconfile, int tile);
-WIcon *wIconCreate(WWindow *wwin);
+WIcon * wIconCreateWithIconFile(WScreen *scr, char *iconfile, int tile);
+WIcon * wIconCreate(WWindow *wwin);
+
void wIconDestroy(WIcon *icon);
void wIconPaint(WIcon *icon);
void wIconUpdate(WIcon *icon);
+void wIconSelect(WIcon *icon);
void wIconChangeTitle(WIcon *icon, char *new_title);
+
Bool wIconChangeImageFile(WIcon *icon, char *file);
-void wIconSelect(WIcon *icon);
-RImage *wIconValidateIconSize(WScreen *scr, RImage *icon, int max_size);
+RImage * wIconValidateIconSize(WScreen *scr, RImage *icon, int max_size);
-char *wIconStore(WIcon *icon);
+char * wIconStore(WIcon *icon);
#ifdef NEWAPPICON
void wIconSetHighlited(WIcon *icon, Bool flag);
#endif /* NEWAPPICON */
-
#endif /* WMICON_H_ */
http://repo.or.cz/w/wmaker-crm.git/commit/0db76b822d69486a63230a0597284f90d593e4b7
commit 0db76b822d69486a63230a0597284f90d593e4b7
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sun Apr 15 20:20:29 2012 +0200
wIconStore(): do not save the icon if it exists
The function wIconStore() doesn't write a new file overwriting the
previous icon if the icon file exists.
diff --git a/src/icon.c b/src/icon.c
index e8382bb..73dae74 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -473,6 +473,10 @@ char *wIconStore(WIcon * icon)
if (!path)
return NULL;
+ /* If icon exists, exit */
+ if (access(path, F_OK) == 0)
+ return path;
+
if (wwin->net_icon_image) {
image = RRetainImage(wwin->net_icon_image);
} else if (wwin->wm_hints && (wwin->wm_hints->flags & IconPixmapHint)
-----------------------------------------------------------------------
Summary of changes:
src/application.c | 23 ++----------
src/defaults.h | 32 ++++++-----------
src/funcs.h | 99 ++++++++++++++++------------------------------------
src/icon.c | 52 ++++++++++++++-------------
src/icon.h | 50 +++++++++++++--------------
src/misc.c | 98 +++++++++++++++++++++++++++-------------------------
src/rootmenu.c | 5 +--
src/session.c | 19 +++-------
src/texture.c | 50 ++++++++++++++-------------
src/usermenu.c | 11 +++---
src/wdefaults.c | 18 +++------
src/window.c | 2 +-
src/winspector.c | 8 ++---
13 files changed, 196 insertions(+), 271 deletions(-)
repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
--
wmaker-crm.git ("The Window Maker window manager")
--
To unsubscribe, send mail to [email protected].