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  515fe87df990ba09d0edb9b5669603e2ec8f40c2 (commit)
       via  01fd881ad825a0d271582e32b555b96d99273428 (commit)
      from  c70622e2454b21fe6c678cc8fd6cef06207cab92 (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/515fe87df990ba09d0edb9b5669603e2ec8f40c2

commit 515fe87df990ba09d0edb9b5669603e2ec8f40c2
Author: Rodolfo Garc??a Pe??as (kix) <[email protected]>
Date:   Tue Jan 17 21:43:58 2012 +0100

    WPrefs: Remove duplicated function captureShortcut()
    
    The function captureShortcut() is implemented in both files 
KeyboardShortcuts.c
    and Menu.c, with just a minor difference regarding the conversion to upper 
case.
    
    To unify them, define a new function which includes a new boolean 
paramenter to
    dictate whether the upper case conversion should be done or not.

diff --git a/WPrefs.app/KeyboardShortcuts.c b/WPrefs.app/KeyboardShortcuts.c
index 4ea7fa4..4fd5305 100644
--- a/WPrefs.app/KeyboardShortcuts.c
+++ b/WPrefs.app/KeyboardShortcuts.c
@@ -52,7 +52,7 @@ typedef struct _Panel {
        WMColor *gray;
        WMFont *font;
 
-        /**/ char capturing;
+       Bool capturing;
        char **shortcuts;
        int actionCount;
 } _Panel;
@@ -230,23 +230,27 @@ static void XConvertCase(register KeySym sym, KeySym * 
lower, KeySym * upper)
 }
 #endif
 
-static char *captureShortcut(Display * dpy, _Panel * panel)
+char *capture_shortcut(Display *dpy, Bool *capturing, Bool convert_case)
 {
        XEvent ev;
        KeySym ksym, lksym, uksym;
        char buffer[64];
        char *key = NULL;
 
-       while (panel->capturing) {
+       while (*capturing) {
                XAllowEvents(dpy, AsyncKeyboard, CurrentTime);
                WMNextEvent(dpy, &ev);
                if (ev.type == KeyPress && ev.xkey.keycode != 0) {
                        ksym = XKeycodeToKeysym(dpy, ev.xkey.keycode, 0);
                        if (!IsModifierKey(ksym)) {
-                               XConvertCase(ksym, &lksym, &uksym);
-                               key = XKeysymToString(uksym);
-
-                               panel->capturing = 0;
+                               if (convert_case) {
+                                       XConvertCase(ksym, &lksym, &uksym);
+                                       key = XKeysymToString(uksym);
+                               } else {
+                                       key = XKeysymToString(ksym);
+                               }
+
+                               *capturing = 0;
                                break;
                        }
                }
@@ -296,7 +300,7 @@ static void captureClick(WMWidget * w, void *data)
                WMSetLabelText(panel->instructionsL,
                               _("Press the desired shortcut key(s) or click 
Cancel to stop capturing."));
                XGrabKeyboard(dpy, WMWidgetXID(panel->parent), True, 
GrabModeAsync, GrabModeAsync, CurrentTime);
-               shortcut = captureShortcut(dpy, panel);
+               shortcut = capture_shortcut(dpy, &panel->capturing, 1);
                if (shortcut) {
                        int row = WMGetListSelectedItemRow(panel->actLs);
 
diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c
index 21a9fe1..6784c47 100644
--- a/WPrefs.app/Menu.c
+++ b/WPrefs.app/Menu.c
@@ -176,6 +176,8 @@ static Bool shouldRemoveItem(struct WEditMenuDelegate 
*delegate, WEditMenu * men
 
 static void freeItemData(ItemData * data);
 
+extern char *capture_shortcut(Display *dpy, Bool *capturing, Bool 
convert_case);
+
 static WEditMenuDelegate menuDelegate = {
        NULL,
        menuItemCloned,
@@ -254,58 +256,6 @@ static void browseForFile(WMWidget * self, void 
*clientData)
        wfree(oldprog);
 }
 
-static char *captureShortcut(Display * dpy, _Panel * panel)
-{
-       XEvent ev;
-       KeySym ksym;
-       char buffer[64];
-       char *key = NULL;
-
-       while (panel->capturing) {
-               XAllowEvents(dpy, AsyncKeyboard, CurrentTime);
-               WMNextEvent(dpy, &ev);
-               if (ev.type == KeyPress && ev.xkey.keycode != 0) {
-                       ksym = XKeycodeToKeysym(dpy, ev.xkey.keycode, 0);
-                       if (!IsModifierKey(ksym)) {
-                               key = XKeysymToString(ksym);
-                               panel->capturing = 0;
-                               break;
-                       }
-               }
-               WMHandleEvent(&ev);
-       }
-
-       if (!key)
-               return NULL;
-
-       buffer[0] = 0;
-
-       if (ev.xkey.state & ControlMask) {
-               strcat(buffer, "Control+");
-       }
-       if (ev.xkey.state & ShiftMask) {
-               strcat(buffer, "Shift+");
-       }
-       if (ev.xkey.state & Mod1Mask) {
-               strcat(buffer, "Mod1+");
-       }
-       if (ev.xkey.state & Mod2Mask) {
-               strcat(buffer, "Mod2+");
-       }
-       if (ev.xkey.state & Mod3Mask) {
-               strcat(buffer, "Mod3+");
-       }
-       if (ev.xkey.state & Mod4Mask) {
-               strcat(buffer, "Mod4+");
-       }
-       if (ev.xkey.state & Mod5Mask) {
-               strcat(buffer, "Mod5+");
-       }
-       strcat(buffer, key);
-
-       return wstrdup(buffer);
-}
-
 static void sgrabClicked(WMWidget * w, void *data)
 {
        _Panel *panel = (_Panel *) data;
@@ -322,7 +272,7 @@ static void sgrabClicked(WMWidget * w, void *data)
                panel->capturing = 1;
                WMSetButtonText(w, _("Cancel"));
                XGrabKeyboard(dpy, WMWidgetXID(panel->parent), True, 
GrabModeAsync, GrabModeAsync, CurrentTime);
-               shortcut = captureShortcut(dpy, panel);
+               shortcut = capture_shortcut(dpy, &panel->capturing, 0);
                if (shortcut) {
                        WMSetTextFieldText(panel->shortT, shortcut);
                        updateMenuItem(panel, panel->currentItem, 
panel->shortT);

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

commit 01fd881ad825a0d271582e32b555b96d99273428
Author: Rodolfo Garc??a Pe??as (kix) <[email protected]>
Date:   Tue Jan 17 19:32:44 2012 +0100

    WINGs: Remove proplist-compat.h
    
    It is not needed to compile Window Maker and it is not used by other
    applications (tested in Debian). Therefore the file should be removed.

diff --git a/WINGs/WINGs/Makefile.am b/WINGs/WINGs/Makefile.am
index b77333b..088f1fe 100644
--- a/WINGs/WINGs/Makefile.am
+++ b/WINGs/WINGs/Makefile.am
@@ -5,4 +5,4 @@ AUTOMAKE_OPTIONS =
 # is this a kluge? if so, how should i do it?
 includedir = @includedir@/WINGs
 
-include_HEADERS = WINGs.h WUtil.h WINGsP.h proplist-compat.h
+include_HEADERS = WINGs.h WUtil.h WINGsP.h
diff --git a/WINGs/WINGs/proplist-compat.h b/WINGs/WINGs/proplist-compat.h
deleted file mode 100644
index 18ec457..0000000
--- a/WINGs/WINGs/proplist-compat.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * This header file is provided for old libPropList compatibility.
- * DO _NOT_ USE this except for letting your old libPropList-based code to
- * work with the new property list code from WINGs, with minimal changes.
- *
- * All code written with old libPropList functions should work, given
- * that the following changes are made:
- *
- * 1. Replace all
- *       #include <proplist.h>
- *    with
- *       #include <WINGs/proplist-compat.h>
- *    in your code.
- *
- * 2. Change all calls to PLSave() to have the extra filename parameter like:
- *       PLSave(proplist_t proplist, char* filename, Bool atomically)
- *
- * 3. The PLSetStringCmpHook() function is no longer available. There is a
- *    similar but simpler function provided which is enough for practical
- *    purposes:
- *       PLSetCaseSensitive(Bool caseSensitive)
- *
- * 4. The following functions do no longer exist. They were removed because
- *    they were based on concepts borrowed from UserDefaults which conflict
- *    with the retain/release mechanism:
- *       PLSynchronize(), PLDeepSynchronize(), PLShallowSynchronize()
- *       PLSetFilename(), PLGetFilename()
- *       PLGetContainer()
- *    You should change your code to not use them anymore.
- *
- * 5. The following functions are no longer available. They were removed
- *    because they also used borrowed concepts which have no place in a
- *    property list as defined in the OpenStep specifications. Also these
- *    functions were hardly ever used in programs to our knowledge.
- *       PLGetDomainNames(), PLGetDomain(), PLSetDomain(), PLDeleteDomain()
- *       PLRegister(), PLUnregister()
- *    You should also change your code to not use them anymore (in case you
- *    ever used them anyway ;-) ).
- *
- * 6. Link your program with libWINGs or libWUtil instead of libPropList.
- *    (libWINGs should be used for GUI apps, while libWUtil for non-GUI apps)
- *
- *
- * Our recommandation is to rewrite your code to use the new functions and
- * link against libWINGs/libWUtil. We do not recommend you to keep using old
- * libPropList function names. This file is provided just to allow existing
- * libropList based applications to run with minimal changes with the new
- * proplist code from WINGs before their authors get the time to rewrite
- * them. New proplist code from WINGs provide a better integration with the
- * other data types from WINGs, not to mention that the proplist code in WINGs
- * is actively maintained while the old libPropList is dead.
- *
- */
-
-
-#ifndef _PROPLIST_COMPAT_H_
-#define _PROPLIST_COMPAT_H_
-
-#include <WINGs/WUtil.h>
-
-
-typedef WMPropList* proplist_t;
-
-
-#ifndef YES
-#define YES True
-#endif
-
-#ifndef NO
-#define NO False
-#endif
-
-
-#define PLSetCaseSensitive(c) WMPLSetCaseSensitive(c)
-
-#define PLMakeString(bytes) WMCreatePLString(bytes)
-#define PLMakeData(bytes, length) WMCreatePLDataWithBytes(bytes, length)
-#define PLMakeArrayFromElements WMCreatePLArray
-#define PLMakeDictionaryFromEntries WMCreatePLDictionary
-
-#define PLRetain(pl) WMRetainPropList(pl)
-#define PLRelease(pl) WMReleasePropList(pl)
-
-#define PLInsertArrayElement(array, pl, pos) WMInsertInPLArray(array, pos, pl)
-#define PLAppendArrayElement(array, pl) WMAddToPLArray(array, pl)
-#define PLRemoveArrayElement(array, pos) WMDeleteFromPLArray(array, pos)
-#define PLInsertDictionaryEntry(dict, key, value) WMPutInPLDictionary(dict, 
key, value)
-#define PLRemoveDictionaryEntry(dict, key) WMRemoveFromPLDictionary(dict, key)
-#define PLMergeDictionaries(dest, source) WMMergePLDictionaries(dest, source, 
False)
-
-#define PLGetNumberOfElements(pl) WMGetPropListItemCount(pl)
-
-#define PLIsString(pl) WMIsPLString(pl)
-#define PLIsData(pl) WMIsPLData(pl)
-#define PLIsArray(pl) WMIsPLArray(pl)
-#define PLIsDictionary(pl) WMIsPLDictionary(pl)
-#define PLIsSimple(pl) (WMIsPLString(pl) || WMIsPLData(pl))
-#define PLIsCompound(pl) (WMIsPLArray(pl) || WMIsPLDictionary(pl))
-#define PLIsEqual(pl1, pl2) WMIsPropListEqualTo(pl1, pl2)
-
-#define PLGetString(pl) WMGetFromPLString(pl)
-#define PLGetDataBytes(pl) WMGetPLDataBytes(pl)
-#define PLGetDataLength(pl) WMGetPLDataLength(pl)
-#define PLGetArrayElement(pl, index) WMGetFromPLArray(pl, index)
-#define PLGetDictionaryEntry(pl, key) WMGetFromPLDictionary(pl, key)
-#define PLGetAllDictionaryKeys(pl) WMGetPLDictionaryKeys(pl)
-
-#define PLShallowCopy(pl) WMShallowCopyPropList(pl)
-#define PLDeepCopy(pl) WMDeepCopyPropList(pl)
-
-#define PLGetProplistWithDescription(desc) 
WMCreatePropListFromDescription(desc)
-#define PLGetDescriptionIndent(pl, level) WMGetPropListDescription(pl, True)
-#define PLGetDescription(pl) WMGetPropListDescription(pl, False)
-#define PLGetStringDescription(pl) WMGetPropListDescription(pl, False)
-#define PLGetDataDescription(pl) WMGetPropListDescription(pl, False)
-
-#define PLGetProplistWithPath(file) WMReadPropListFromFile(file)
-#define PLSave(pl, file, atm) WMWritePropListToFile(pl, file)
-
-
-/* Unsupported functions. Do not ask for them. They're evil :P */
-#define PLSetStringCmpHook(fn) error_PLSetStringCmpHook_is_not_supported
-#define PLDeepSynchronize(pl) error_PLDeepSynchronize_is_not_supported
-#define PLSynchronize(pl) error_PLSynchronize_is_not_supported
-#define PLShallowSynchronize(pl) error_PLShallowSynchronize_is_not_supported
-#define PLSetFilename(pl, filename) error_PLSetFilename_is_not_supported
-#define PLGetFilename(pl, filename) error_PLGetFilename_is_not_supported
-#define PLGetContainer(pl) error_PLGetContainer_is_not_supported
-
-#define PLGetDomainNames error_PLGetDomainNames_is_not_supported
-#define PLGetDomain(name) error_PLGetDomain_is_not_supported
-#define PLSetDomain(name, value, kickme) error_PLSetDomain_is_not_supported
-#define PLDeleteDomain(name, kickme) error_PLDeleteDomain_is_not_supported
-#define PLRegister(name, callback) error_PLRegister_is_not_supported
-#define PLUnregister(name) error_PLUnregister_is_not_supported
-
-
-#endif

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

Summary of changes:
 WINGs/WINGs/Makefile.am        |    2 +-
 WINGs/WINGs/proplist-compat.h  |  138 ----------------------------------------
 WPrefs.app/KeyboardShortcuts.c |   18 +++--
 WPrefs.app/Menu.c              |   56 +---------------
 4 files changed, 15 insertions(+), 199 deletions(-)
 delete mode 100644 WINGs/WINGs/proplist-compat.h


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 ("Fork from the last available CVS version of Window Maker")


-- 
To unsubscribe, send mail to [email protected].

Reply via email to