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
       via  968e2c11fa01ed021ce3f585dbbe6e76ad2fa4bf (commit)
       via  c61e5bfeb8a036191e1a2517b694d05b7c871900 (commit)
       via  32fe186c54eefbee60d856288a07c6dbcbd8f687 (commit)
       via  910a851f35f5f6c2b8b2dc6119314bde12bab33f (commit)
      from  fc5c0fe1a41eeab563b09be6d02eadcbbb643ac2 (commit)

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/968e2c11fa01ed021ce3f585dbbe6e76ad2fa4bf

commit 968e2c11fa01ed021ce3f585dbbe6e76ad2fa4bf
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Wed Jun 6 08:41:01 2012 +0200

    New functions in icon.c
    
    This patch creates some functions:
    
    1. Rename getnameforicon() to get_name_for_icon()
    2. New function get_icon_cache_path, to get the icon cache folder
       ($HOME + GNUstep/Library/WindowMaker/CachedPixmaps). This folder
       is defined now in the preprocessor. Not used yet, in next commits.
    3. New function get_wwindow_image_from_wmhints to read the image from
       X11 wmhints. Previous code at wIconStore() now changed.

diff --git a/src/icon.c b/src/icon.c
index 2a6d774..9be2c25 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -49,6 +49,7 @@
 extern WPreferences wPreferences;
 
 #define MOD_MASK wPreferences.modifier_mask
+#define CACHE_ICON_PATH "/Library/WindowMaker/CachedPixmaps"
 
 extern Cursor wCursor[WCUR_LAST];
 
@@ -397,7 +398,7 @@ Bool wIconChangeImageFile(WIcon * icon, char *file)
        return !error;
 }
 
-static char *getnameforicon(WWindow * wwin)
+static char *get_name_for_icon(WWindow *wwin)
 {
        char *prefix, *suffix;
        char *path;
@@ -450,6 +451,41 @@ static char *getnameforicon(WWindow * wwin)
        return path;
 }
 
+static char *get_icon_cache_path(void)
+{
+       char *prefix, *path;
+       int len, ret;
+
+       prefix = wusergnusteppath();
+       len = strlen(prefix) + strlen(CACHE_ICON_PATH) + 1;
+       path = wmalloc(len);
+       snprintf(path, len, "%s%s", prefix, CACHE_ICON_PATH);
+
+       ret = create_path(path);
+
+       if (ret == 0)
+               return path;
+
+       /* Fail */
+       wfree(path);
+       return NULL;
+}
+
+static RImage *get_wwindow_image_from_wmhints(WWindow *wwin, WIcon *icon)
+{
+       RImage *image;
+
+       if (wwin->wm_hints &&
+           (wwin->wm_hints->flags & IconPixmapHint) &&
+           wwin->wm_hints->icon_pixmap != None) {
+               image = 
RCreateImageFromDrawable(icon->core->screen_ptr->rcontext,
+                                                wwin->wm_hints->icon_pixmap,
+                                                (wwin->wm_hints->flags & 
IconMaskHint)
+                                                ? wwin->wm_hints->icon_mask : 
None);
+       }
+       return image;
+}
+
 /*
  * wIconStore--
  *     Stores the client supplied icon at 
~/GNUstep/Library/WindowMaker/CachedPixmaps
@@ -468,7 +504,7 @@ char *wIconStore(WIcon * icon)
        if (!wwin)
                return NULL;
 
-       path = getnameforicon(wwin);
+       path = get_name_for_icon(wwin);
        if (!path)
                return NULL;
 
@@ -476,14 +512,10 @@ char *wIconStore(WIcon * icon)
        if (access(path, F_OK) == 0)
                 return path;
 
-       if (wwin->net_icon_image) {
+       if (wwin->net_icon_image)
                image = RRetainImage(wwin->net_icon_image);
-       } else if (wwin->wm_hints && (wwin->wm_hints->flags & IconPixmapHint)
-           && wwin->wm_hints->icon_pixmap != None) {
-               image = 
RCreateImageFromDrawable(icon->core->screen_ptr->rcontext,
-                                                wwin->wm_hints->icon_pixmap, 
(wwin->wm_hints->flags & IconMaskHint)
-                                                ? wwin->wm_hints->icon_mask : 
None);
-       }
+       else
+               image = get_wwindow_image_from_wmhints(wwin, icon);
 
        if (!image) {
                wfree(path);

http://repo.or.cz/w/wmaker-crm.git/commit/c61e5bfeb8a036191e1a2517b694d05b7c871900

commit c61e5bfeb8a036191e1a2517b694d05b7c871900
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Wed Jun 6 07:50:05 2012 +0200

    Function wDefaultFillAttributes() rewritten
    
    The function wDefaultFillAttributes can be changed a lot:
    
    1. Initialitation to NULL: If the pointers are initialized to NULL
       then, the "if's" don't need the else block:
    
       WMPropList *value, *dw, *dc, *dn, *da;
       dw = dc = dn = da = NULL;
    
       if's:
    
       = if (instance)
       =     key2 = WMCreatePLString(instance);
       - else
       -     key2 = NULL;
    
    2. Added StrConcatDot in the class + instance block:
    
       = if (class && instance) {
       +     buffer = StrConcatDot(instance, class);
       -     buffer = wmalloc(strlen(class) + strlen(instance) + 2);
       -     sprintf(buffer, "%s.%s", instance, class);
    
    3. init_wdefaults(scr); moved above. This function is used only
       to load the default value "AnyWindow" (value "*"), to search
       the default value. Can be moved above without problems.
    
    4. Preprocessor code of APPLY_VAL moved to the top of the file.
    
    5. New function get_value_from_instanceclass() to do the rest of
       the (repetitive) code. This function is called to create the
       proplist, search the value, and return the proplist.
    
    EXTRA:
    
    1. Added StrConcatDot (like dot 2) in wDefaultChangeIcon()
    2. Added a comment in get_value()

diff --git a/src/wdefaults.c b/src/wdefaults.c
index e627dd4..8d1ef54 100644
--- a/src/wdefaults.c
+++ b/src/wdefaults.c
@@ -42,6 +42,10 @@
 #include "defaults.h"
 #include "icon.h"
 
+#define APPLY_VAL(value, flag, attrib) +    if (value) {attr->flag = 
getBool(attrib, value); +    if (mask) mask->flag = 1;}
+
 /* Global stuff */
 extern WPreferences wPreferences;
 extern WDDomain *WDWindowAttributes;
@@ -125,6 +129,7 @@ static void init_wdefaults(WScreen * scr)
        No = WMCreatePLString("No");
 }
 
+/* Returns the correct WMPropList, using instance+class or instance, or class, 
or default */
 static WMPropList *get_value(WMPropList * dict_win, WMPropList * dict_class, 
WMPropList * dict_name,
                             WMPropList * dict_any, WMPropList * option, 
WMPropList * default_value,
                             Bool useGlobalDefault)
@@ -161,6 +166,28 @@ static WMPropList *get_value(WMPropList * dict_win, 
WMPropList * dict_class, WMP
        return default_value;
 }
 
+static WMPropList *get_value_from_instanceclass(char *value)
+{
+       WMPropList *key, *val = NULL;
+
+       if (!value)
+               return NULL;
+
+       key = WMCreatePLString(value);
+
+       WMPLSetCaseSensitive(True);
+
+       if (WDWindowAttributes->dictionary)
+               val = key ? 
WMGetFromPLDictionary(WDWindowAttributes->dictionary, key) : NULL;
+
+       if (key)
+               WMReleasePropList(key);
+
+       WMPLSetCaseSensitive(False);
+
+       return val;
+}
+
 /*
  *----------------------------------------------------------------------
  * wDefaultFillAttributes--
@@ -176,58 +203,27 @@ void
 wDefaultFillAttributes(WScreen * scr, char *instance, char *class,
                       WWindowAttributes * attr, WWindowAttributes * mask, Bool 
useGlobalDefault)
 {
-       WMPropList *value, *key1, *key2, *key3, *dw, *dc, *dn, *da;
+       WMPropList *value, *dw, *dc, *dn, *da;
+       char *buffer;
 
-       if (class && instance) {
-               char *buffer;
+       dw = dc = dn = da = NULL;
 
-               buffer = wmalloc(strlen(class) + strlen(instance) + 2);
-               sprintf(buffer, "%s.%s", instance, class);
-               key1 = WMCreatePLString(buffer);
+       if (!ANoTitlebar)
+               init_wdefaults(scr);
+
+       if (class && instance) {
+               buffer = StrConcatDot(instance, class);
+               dw = get_value_from_instanceclass(buffer);
                wfree(buffer);
-       } else {
-               key1 = NULL;
        }
 
-       if (instance)
-               key2 = WMCreatePLString(instance);
-       else
-               key2 = NULL;
-
-       if (class)
-               key3 = WMCreatePLString(class);
-       else
-               key3 = NULL;
-
-       if (!ANoTitlebar)
-               init_wdefaults(scr);
+       dn = get_value_from_instanceclass(instance);
+       dc = get_value_from_instanceclass(class);
 
        WMPLSetCaseSensitive(True);
 
-       if (WDWindowAttributes->dictionary) {
-               dw = key1 ? 
WMGetFromPLDictionary(WDWindowAttributes->dictionary, key1) : NULL;
-               dn = key2 ? 
WMGetFromPLDictionary(WDWindowAttributes->dictionary, key2) : NULL;
-               dc = key3 ? 
WMGetFromPLDictionary(WDWindowAttributes->dictionary, key3) : NULL;
-               if (useGlobalDefault)
-                       da = 
WMGetFromPLDictionary(WDWindowAttributes->dictionary, AnyWindow);
-               else
-                       da = NULL;
-       } else {
-               dw = NULL;
-               dn = NULL;
-               dc = NULL;
-               da = NULL;
-       }
-       if (key1)
-               WMReleasePropList(key1);
-       if (key2)
-               WMReleasePropList(key2);
-       if (key3)
-               WMReleasePropList(key3);
-
-#define APPLY_VAL(value, flag, attrib) -    if (value) {attr->flag = 
getBool(attrib, value); -    if (mask) mask->flag = 1;}
+       if ((WDWindowAttributes->dictionary) && (useGlobalDefault))
+               da = WMGetFromPLDictionary(WDWindowAttributes->dictionary, 
AnyWindow);
 
        /* get the data */
        value = get_value(dw, dc, dn, da, ANoTitlebar, No, useGlobalDefault);
@@ -477,8 +473,8 @@ void wDefaultChangeIcon(WScreen * scr, char *instance, char 
*class, char *file)
 
        if (instance && class) {
                char *buffer;
-               buffer = wmalloc(strlen(instance) + strlen(class) + 2);
-               sprintf(buffer, "%s.%s", instance, class);
+
+               buffer = StrConcatDot(instance, class);
                key = WMCreatePLString(buffer);
                wfree(buffer);
        } else if (instance) {

http://repo.or.cz/w/wmaker-crm.git/commit/32fe186c54eefbee60d856288a07c6dbcbd8f687

commit 32fe186c54eefbee60d856288a07c6dbcbd8f687
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Wed Jun 6 07:38:53 2012 +0200

    WScreen argument removed in get_generic_value()
    
    The argument "src" is removed in the function get_generic_value()
    because it is not used.
    
    The function wDefaultGetIconFile() is moved close to
    wDefaultGetStartWorkspace() because both are similar.

diff --git a/src/wdefaults.c b/src/wdefaults.c
index dd91b91..e627dd4 100644
--- a/src/wdefaults.c
+++ b/src/wdefaults.c
@@ -317,7 +317,7 @@ wDefaultFillAttributes(WScreen * scr, char *instance, char 
*class,
        WMPLSetCaseSensitive(False);
 }
 
-static WMPropList *get_generic_value(WScreen *scr, char *instance, char *class,
+static WMPropList *get_generic_value(char *instance, char *class,
                                     WMPropList *option, Bool noDefault)
 {
        WMPropList *value, *key, *dict;
@@ -378,28 +378,6 @@ static WMPropList *get_generic_value(WScreen *scr, char 
*instance, char *class,
        return value;
 }
 
-/* Get the name of the Icon File. If noDefault is False, then, default value 
included */
-char *wDefaultGetIconFile(WScreen * scr, char *instance, char *class, Bool 
noDefault)
-{
-       WMPropList *value;
-       char *tmp;
-
-       if (!ANoTitlebar)
-               init_wdefaults(scr);
-
-       if (!WDWindowAttributes->dictionary)
-               return NULL;
-
-       value = get_generic_value(scr, instance, class, AIcon, noDefault);
-
-       if (!value)
-               return NULL;
-
-       tmp = getString(AIcon, value);
-
-       return tmp;
-}
-
 RImage *wDefaultGetImage(WScreen * scr, char *winstance, char *wclass, int 
max_size)
 {
        char *file_name;
@@ -442,7 +420,7 @@ int wDefaultGetStartWorkspace(WScreen * scr, char 
*instance, char *class)
        if (!WDWindowAttributes->dictionary)
                return -1;
 
-       value = get_generic_value(scr, instance, class, AStartWorkspace, False);
+       value = get_generic_value(instance, class, AStartWorkspace, False);
 
        if (!value)
                return -1;
@@ -458,6 +436,28 @@ int wDefaultGetStartWorkspace(WScreen * scr, char 
*instance, char *class)
        return w;
 }
 
+/* Get the name of the Icon File. If noDefault is False, then, default value 
included */
+char *wDefaultGetIconFile(WScreen *scr, char *instance, char *class, Bool 
noDefault)
+{
+       WMPropList *value;
+       char *tmp;
+
+       if (!ANoTitlebar)
+               init_wdefaults(scr);
+
+       if (!WDWindowAttributes->dictionary)
+               return NULL;
+
+       value = get_generic_value(instance, class, AIcon, noDefault);
+
+       if (!value)
+               return NULL;
+
+       tmp = getString(AIcon, value);
+
+       return tmp;
+}
+
 void wDefaultChangeIcon(WScreen * scr, char *instance, char *class, char *file)
 {
        WDDomain *db = WDWindowAttributes;

http://repo.or.cz/w/wmaker-crm.git/commit/910a851f35f5f6c2b8b2dc6119314bde12bab33f

commit 910a851f35f5f6c2b8b2dc6119314bde12bab33f
Author: Amadeusz Sławiński <[email protected]>
Date:   Sun Jun 3 18:42:16 2012 +0200

    Fix "implicit declaration of function"

diff --git a/src/actions.c b/src/actions.c
index 4cf1f3d..61be535 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -45,6 +45,7 @@
 #include "winspector.h"
 #include "workspace.h"
 #include "xinerama.h"
+#include "usermenu.h"
 
 /****** Global Variables ******/
 
diff --git a/src/usermenu.c b/src/usermenu.c
index b81e3c8..22d089f 100644
--- a/src/usermenu.c
+++ b/src/usermenu.c
@@ -74,6 +74,7 @@
 #include "actions.h"
 #include "funcs.h"
 #include "keybind.h"
+#include "xmodifier.h"
 
 #include "framewin.h"
 

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

Summary of changes:
 src/actions.c   |    1 +
 src/icon.c      |   50 +++++++++++++++++----
 src/usermenu.c  |    1 +
 src/wdefaults.c |  136 +++++++++++++++++++++++++++----------------------------
 4 files changed, 109 insertions(+), 79 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].

Reply via email to