Slight transformation of the x-macros used in keybindings to make them

2008-10-22  Thomas Thurman  <tthurman@gnome.org>

        Slight transformation of the x-macros used in keybindings
        to make them clearer: write handler names out in full
        because the old suffix system was confusing to people
        skim-reading, and switched the order of the last two
        parameters so more would generally fit on a screen.

        * src/core/keybindings.c, src/core/schema-bindings.c
          src/core/prefs.c: sympathy changes
        * src/core/window-bindings.h, src/core/screen-bindings.h:
          transformation as above


svn path=/trunk/; revision=3970
This commit is contained in:
Thomas Thurman
2008-10-22 01:02:45 +00:00
committed by Thomas James Alexander Thurman
parent fd01dbaaea
commit 671b69a251
6 changed files with 293 additions and 368 deletions

View File

@@ -55,25 +55,16 @@ typedef void (* MetaKeyHandlerFunc) (MetaDisplay *display,
MetaKeyBinding *binding);
/* Prototypes for handlers */
#define item(name, suffix, param, flags, description, stroke) \
#define keybind(name, handler, param, flags, stroke, description) \
static void \
handle_##name (MetaDisplay *display,\
MetaScreen *screen,\
MetaWindow *window,\
XEvent *event,\
MetaKeyBinding *binding);
handler (MetaDisplay *display,\
MetaScreen *screen,\
MetaWindow *window,\
XEvent *event,\
MetaKeyBinding *binding);
#include "window-bindings.h"
#undef item
#define item(name, suffix, param, flags, description, stroke) \
static void \
handle_##name (MetaDisplay *display,\
MetaScreen *screen,\
MetaWindow *window,\
XEvent *event,\
MetaKeyBinding *binding);
#include "screen-bindings.h"
#undef item
#undef keybind
/* These can't be bound to anything, but they are used to handle
* various other events. TODO: Possibly we should include them as event
@@ -134,11 +125,10 @@ struct _MetaKeyBinding
const MetaKeyHandler *handler;
};
#define keybind(name, handler, param, flags, stroke, description) \
{ #name, handler, param, flags },
static const MetaKeyHandler screen_handlers[] = {
#define item(name, suffix, param, flags, description, stroke) \
{ #name suffix, handle_##name, param, flags },
#include "screen-bindings.h"
#undef item
{ NULL, NULL, 0, 0 }
};
@@ -146,12 +136,10 @@ static const MetaKeyHandler window_handlers[] = {
/* TODO: Are window bindings only ever called on non-null windows?
* If so, we can remove the check from all of them.
*/
#define item(name, suffix, param, flags, description, stroke) \
{ #name suffix, handle_##name, param, flags },
#include "window-bindings.h"
#undef item
{ NULL, NULL, 0, 0 }
};
#undef keybind
static void
reload_keymap (MetaDisplay *display)