During a discussion with Rodney Dawes about making life easier for the

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

        During a discussion with Rodney Dawes about making life easier
        for the translators, he pointed out that the short and long
        forms of almost all the keybindings say much the same thing
        in different words.  I believe this is an unconscionable burden
        to place on translators, and have therefore merged the short
        and long descriptions into the short description.  The long
        is now a general explanation of the format, plus possibly a
        notice about reversibility.  Closes #469361, and should solve
        the l10n issue previously mentioned.

        * src/core/keybindings.c: reflect changes in *-bindings.h
        * src/core/schema-bindings.c: reflect changes in *-bindings.h
        * src/core/prefs.c: reflect changes in *-bindings.h
        * src/core/window-bindings.h: Add flags field, always the same
          currently, so that it's the same as screen-bindings.h.
          Also, lose ONLY_BOUND_BY_DEFAULT, since we already had a
          rather more elegant way to perform the same effect.
          And merge the long and short descriptions.
        * src/core/screen-bindings.h (, item): Merge the long and
          short descriptions.


svn path=/trunk/; revision=3966
This commit is contained in:
Thomas Thurman 2008-10-18 04:33:14 +00:00 committed by Thomas James Alexander Thurman
parent a8f1a61242
commit 493408167b
6 changed files with 233 additions and 345 deletions

View File

@ -1,3 +1,26 @@
2008-10-18 Thomas Thurman <tthurman@gnome.org>
During a discussion with Rodney Dawes about making life easier
for the translators, he pointed out that the short and long
forms of almost all the keybindings say much the same thing
in different words. I believe this is an unconscionable burden
to place on translators, and have therefore merged the short
and long descriptions into the short description. The long
is now a general explanation of the format, plus possibly a
notice about reversibility. Closes #469361, and should solve
the l10n issue previously mentioned.
* src/core/keybindings.c: reflect changes in *-bindings.h
* src/core/schema-bindings.c: reflect changes in *-bindings.h
* src/core/prefs.c: reflect changes in *-bindings.h
* src/core/window-bindings.h: Add flags field, always the same
currently, so that it's the same as screen-bindings.h.
Also, lose ONLY_BOUND_BY_DEFAULT, since we already had a
rather more elegant way to perform the same effect.
And merge the long and short descriptions.
* src/core/screen-bindings.h (, item): Merge the long and
short descriptions.
2008-10-17 Murray Cumming <murrayc@murrayc.com> 2008-10-17 Murray Cumming <murrayc@murrayc.com>
* configure.in: Call GNOME_DOC_INIT() so we can use the gnome-doc-utils * configure.in: Call GNOME_DOC_INIT() so we can use the gnome-doc-utils

View File

@ -55,7 +55,7 @@ typedef void (* MetaKeyHandlerFunc) (MetaDisplay *display,
MetaKeyBinding *binding); MetaKeyBinding *binding);
/* Prototypes for handlers */ /* Prototypes for handlers */
#define item(name, suffix, param, short, long, stroke) \ #define item(name, suffix, param, flags, description, stroke) \
static void \ static void \
handle_##name (MetaDisplay *display,\ handle_##name (MetaDisplay *display,\
MetaScreen *screen,\ MetaScreen *screen,\
@ -65,7 +65,7 @@ handle_##name (MetaDisplay *display,\
#include "window-bindings.h" #include "window-bindings.h"
#undef item #undef item
#define item(name, suffix, param, can_reverse, short, long, stroke) \ #define item(name, suffix, param, flags, description, stroke) \
static void \ static void \
handle_##name (MetaDisplay *display,\ handle_##name (MetaDisplay *display,\
MetaScreen *screen,\ MetaScreen *screen,\
@ -135,7 +135,7 @@ struct _MetaKeyBinding
}; };
static const MetaKeyHandler screen_handlers[] = { static const MetaKeyHandler screen_handlers[] = {
#define item(name, suffix, param, flags, short, long, stroke) \ #define item(name, suffix, param, flags, description, stroke) \
{ #name suffix, handle_##name, param, flags }, { #name suffix, handle_##name, param, flags },
#include "screen-bindings.h" #include "screen-bindings.h"
#undef item #undef item
@ -143,14 +143,11 @@ static const MetaKeyHandler screen_handlers[] = {
}; };
static const MetaKeyHandler window_handlers[] = { static const MetaKeyHandler window_handlers[] = {
/* FIXME: The flags=1 thing is pretty ugly here, but it'll really have /* TODO: Are window bindings only ever called on non-null windows?
* to wait until and if we merge the window and screen binding files.
*
* TODO: Are window bindings only ever called on non-null windows?
* If so, we can remove the check from all of them. * If so, we can remove the check from all of them.
*/ */
#define item(name, suffix, param, short, long, stroke) \ #define item(name, suffix, param, flags, description, stroke) \
{ #name suffix, handle_##name, param, 1 }, { #name suffix, handle_##name, param, flags },
#include "window-bindings.h" #include "window-bindings.h"
#undef item #undef item
{ NULL, NULL, 0, 0 } { NULL, NULL, 0, 0 }

View File

@ -1815,21 +1815,18 @@ meta_prefs_set_num_workspaces (int n_workspaces)
#endif /* HAVE_GCONF */ #endif /* HAVE_GCONF */
} }
#define item(name, suffix, param, flags, description, stroke) \
{ #name suffix, NULL, flags & BINDING_REVERSES },
static MetaKeyPref screen_bindings[] = { static MetaKeyPref screen_bindings[] = {
#define item(name, suffix, param, has_inverse, short, long, stroke) \
{ #name suffix, NULL, has_inverse },
#include "screen-bindings.h" #include "screen-bindings.h"
#undef item
{ NULL, NULL, FALSE} { NULL, NULL, FALSE}
}; };
static MetaKeyPref window_bindings[] = { static MetaKeyPref window_bindings[] = {
#define item(name, suffix, param, short, long, stroke) \
{ #name suffix, NULL, FALSE },
#include "window-bindings.h" #include "window-bindings.h"
#undef item
{ NULL, NULL, FALSE } { NULL, NULL, FALSE }
}; };
#undef item
#ifndef HAVE_GCONF #ifndef HAVE_GCONF
typedef struct typedef struct
@ -1839,14 +1836,14 @@ typedef struct
} MetaSimpleKeyMapping; } MetaSimpleKeyMapping;
/* FIXME: This would be neater if the array only contained entries whose /* FIXME: This would be neater if the array only contained entries whose
* default keystroke was non-null. You can do this by defining * default keystroke was non-null. You COULD do this by defining
* ONLY_BOUND_BY_DEFAULT around various blocks at the cost of making * ONLY_BOUND_BY_DEFAULT around various blocks at the cost of making
* the bindings file way more complicated. However, we could stop this being * the bindings file way more complicated. However, we could stop this being
* data and move it into code. Then the compiler would optimise away * data and move it into code. Then the compiler would optimise away
* the problem lines. * the problem lines.
*/ */
static MetaSimpleKeyMapping screen_string_bindings[] = { static MetaSimpleKeyMapping screen_string_bindings[] = {
#define item(name, suffix, param, is_reverse, short, long, keystroke) \ #define item(name, suffix, param, flags, description, keystroke) \
{ #name suffix, keystroke }, { #name suffix, keystroke },
#include "screen-bindings.h" #include "screen-bindings.h"
#undef item #undef item
@ -1854,12 +1851,10 @@ static MetaSimpleKeyMapping screen_string_bindings[] = {
}; };
static MetaSimpleKeyMapping window_string_bindings[] = { static MetaSimpleKeyMapping window_string_bindings[] = {
#define ONLY_BOUND_BY_DEFAULT #define item(name, suffix, param, flags, description, keystroke) \
#define item(name, suffix, param, short, long, keystroke) \
{ #name suffix, keystroke }, { #name suffix, keystroke },
#include "window-bindings.h" #include "window-bindings.h"
#undef item #undef item
#undef ONLY_BOUND_BY_DEFAULT
{ NULL, NULL } { NULL, NULL }
}; };

View File

@ -35,15 +35,18 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <glib.h> #include <glib.h>
#include "config.h"
#define _(x) x #define _(x) x
static void single_stanza (gboolean is_window, char *name, char *default_value, static void single_stanza (gboolean is_window, const char *name,
gboolean can_reverse, gboolean going_backwards, const char *default_value,
char *short_description, char *long_description); gboolean can_reverse,
const char *description);
char *liberal, *could_go_backwards, *could_go_forwards; char *about_keybindings, *about_reversible_keybindings;
const char* window_string = \ const char* window_string = \
" <schema>\n" \ " <schema>\n" \
@ -61,26 +64,20 @@ const char* window_string = \
" </schema>\n\n\n"; " </schema>\n\n\n";
static void static void
single_stanza (gboolean is_window, char *name, char *default_value, single_stanza (gboolean is_window, const char *name,
gboolean can_reverse, gboolean going_backwards, const char *default_value,
char *short_description, char *long_description) gboolean can_reverse,
const char *description)
{ {
char *keybinding_type = is_window? "window": "global"; char *keybinding_type = is_window? "window": "global";
char *escaped_default_value; char *escaped_default_value, *escaped_description;
if (short_description == NULL || long_description == NULL) if (description==NULL)
/* it must be undocumented, so it can't be in this table */ return; /* it must be undocumented, so it can't go in this table */
return;
/* Escape the text. The old values point at constants (literals, actually) escaped_description = g_markup_escape_text (description, -1);
* so it doesn't matter that we lose the reference. escaped_default_value = default_value==NULL? "disabled":
*/ g_markup_escape_text (description, -1);
short_description = g_markup_escape_text (short_description, -1);
long_description = g_markup_escape_text (long_description, -1);
escaped_default_value = g_markup_escape_text (
default_value? default_value: "disabled",
-1);
printf (" <schema>\n"); printf (" <schema>\n");
printf (" <key>/schemas/apps/metacity/%s_keybindings/%s</key>\n", printf (" <key>/schemas/apps/metacity/%s_keybindings/%s</key>\n",
@ -90,34 +87,19 @@ single_stanza (gboolean is_window, char *name, char *default_value,
printf (" <owner>metacity</owner>\n"); printf (" <owner>metacity</owner>\n");
printf (" <type>string</type>\n"); printf (" <type>string</type>\n");
printf (" <default>%s</default>\n", escaped_default_value); printf (" <default>%s</default>\n", escaped_default_value);
printf (" <locale name=\"C\">\n"); printf (" <locale name=\"C\">\n");
printf (" <short>%s</short>\n", short_description); printf (" <short>%s</short>\n", description);
printf (" <long>\n"); printf (" <long>%s</long>\n",
printf (" %s\n", long_description); can_reverse? about_reversible_keybindings:
about_keybindings);
if (can_reverse)
{
/* I don't think this is very useful, tbh: */
if (default_value != NULL)
{
printf (" (Traditionally %s)\n", escaped_default_value);
}
if (going_backwards)
printf ("%s\n", could_go_forwards);
else
printf ("%s\n", could_go_backwards);
}
printf (" %s\n", liberal);
printf (" </long>\n");
printf (" </locale>\n"); printf (" </locale>\n");
printf (" </schema>\n\n\n"); printf (" </schema>\n\n");
g_free (escaped_description);
if (default_value!=NULL)
g_free (escaped_default_value); g_free (escaped_default_value);
g_free (short_description);
g_free (long_description);
} }
static void produce_bindings (); static void produce_bindings ();
@ -150,20 +132,14 @@ produce_bindings ()
if (!feof (metacity_schemas_in_in)) if (!feof (metacity_schemas_in_in))
{ {
#define item(name, suffix, param, short, long, keystroke) \ #define item(name, suffix, param, flags, description, keystroke) \
single_stanza (TRUE, #name suffix, \ single_stanza ( \
keystroke, \ flags & BINDING_PER_WINDOW, \
FALSE, FALSE, \ #name suffix, \
short, long);
#include "window-bindings.h"
#undef item
#define item(name, suffix, param, flags, short, long, keystroke) \
single_stanza (FALSE, #name suffix, \
keystroke, \ keystroke, \
flags & BINDING_REVERSES, \ flags & BINDING_REVERSES, \
flags & BINDING_IS_REVERSED, \ description);
short, long); #include "window-bindings.h"
#include "screen-bindings.h" #include "screen-bindings.h"
#undef item #undef item
} }
@ -187,27 +163,28 @@ main ()
* are hardcoded (in gtk/gtkaccelgroup.c; it's not metacity's fault). * are hardcoded (in gtk/gtkaccelgroup.c; it's not metacity's fault).
* "disabled" must also stay as it is. * "disabled" must also stay as it is.
*/ */
liberal = g_markup_escape_text(_("The format looks like \"<Control>a\" or " about_keybindings = g_markup_escape_text(_( \
"<Shift><Alt>F1\". \n"\ "The format looks like \"<Control>a\" or <Shift><Alt>F1\".\n\n"\
"The parser is fairly liberal and allows "\ "The parser is fairly liberal and allows "\
"lower or upper case, and also abbreviations such as \"<Ctl>\" and " \ "lower or upper case, and also abbreviations such as \"<Ctl>\" and " \
"\"<Ctrl>\". If you set the option to the special string " \ "\"<Ctrl>\". If you set the option to the special string " \
"\"disabled\", then there will be no keybinding for this action."), -1); "\"disabled\", then there will be no keybinding for this action."),
-1);
/* These were more dissimilar at some point but have been regularised about_reversible_keybindings = g_markup_escape_text(_( \
* for the translators' benefit. "The format looks like \"<Control>a\" or <Shift><Alt>F1\".\n\n"\
*/ "The parser is fairly liberal and allows "\
could_go_backwards = g_markup_escape_text (_("Holding the \"shift\" key " "lower or upper case, and also abbreviations such as \"<Ctl>\" and " \
"while using this binding reverses the direction of movement."), -1); "\"<Ctrl>\". If you set the option to the special string " \
"\"disabled\", then there will be no keybinding for this action.\n\n"\
could_go_forwards = g_markup_escape_text (_("Holding the \"shift\" key " "This keybinding may be reversed by holding down the \"shift\" key; "
"while using this binding makes the direction go forward again."), -1); "therefore, \"shift\" cannot be one of the keys it uses."),
-1);
produce_bindings (); produce_bindings ();
g_free (could_go_forwards); g_free (about_keybindings);
g_free (could_go_backwards); g_free (about_reversible_keybindings);
g_free (liberal);
return 0; return 0;
} }

View File

@ -62,9 +62,7 @@
* *
* 5) a short description. Mostly, you won't use this. * 5) a short description. Mostly, you won't use this.
* It must be marked translatable (i.e. inside "_(...)"). * It must be marked translatable (i.e. inside "_(...)").
* 6) like short, except long. Don't include all the stuff about * 6) a string representing the default binding.
* the parser being fairly liberal.
* 7) a string representing the default binding.
* If this is NULL, the action is unbound by default. * If this is NULL, the action is unbound by default.
* *
* Don't try to do XML entity escaping anywhere in the strings. * Don't try to do XML entity escaping anywhere in the strings.
@ -96,51 +94,39 @@
item (switch_to_workspace, "_1", 1, 0, item (switch_to_workspace, "_1", 1, 0,
_("Switch to workspace 1"), _("Switch to workspace 1"),
_("The keybinding that switches to workspace 1."),
NULL) NULL)
item (switch_to_workspace, "_2", 2, 0, item (switch_to_workspace, "_2", 2, 0,
_("Switch to workspace 2"), _("Switch to workspace 2"),
_("The keybinding that switches to workspace 2."),
NULL) NULL)
item (switch_to_workspace, "_3", 3, 0, item (switch_to_workspace, "_3", 3, 0,
_("Switch to workspace 3"), _("Switch to workspace 3"),
_("The keybinding that switches to workspace 3."),
NULL) NULL)
item (switch_to_workspace, "_4", 4, 0, item (switch_to_workspace, "_4", 4, 0,
_("Switch to workspace 4"), _("Switch to workspace 4"),
_("The keybinding that switches to workspace 4."),
NULL) NULL)
item (switch_to_workspace, "_5", 5, 0, item (switch_to_workspace, "_5", 5, 0,
_("Switch to workspace 5"), _("Switch to workspace 5"),
_("The keybinding that switches to workspace 5."),
NULL) NULL)
item (switch_to_workspace, "_6", 6, 0, item (switch_to_workspace, "_6", 6, 0,
_("Switch to workspace 6"), _("Switch to workspace 6"),
_("The keybinding that switches to workspace 6."),
NULL) NULL)
item (switch_to_workspace, "_7", 7, 0, item (switch_to_workspace, "_7", 7, 0,
_("Switch to workspace 7"), _("Switch to workspace 7"),
_("The keybinding that switches to workspace 7."),
NULL) NULL)
item (switch_to_workspace, "_8", 8, 0, item (switch_to_workspace, "_8", 8, 0,
_("Switch to workspace 8"), _("Switch to workspace 8"),
_("The keybinding that switches to workspace 8."),
NULL) NULL)
item (switch_to_workspace, "_9", 9, 0, item (switch_to_workspace, "_9", 9, 0,
_("Switch to workspace 9"), _("Switch to workspace 9"),
_("The keybinding that switches to workspace 9."),
NULL) NULL)
item (switch_to_workspace, "_10", 10, 0, item (switch_to_workspace, "_10", 10, 0,
_("Switch to workspace 10"), _("Switch to workspace 10"),
_("The keybinding that switches to workspace 10."),
NULL) NULL)
item (switch_to_workspace, "_11", 11, 0, item (switch_to_workspace, "_11", 11, 0,
_("Switch to workspace 11"), _("Switch to workspace 11"),
_("The keybinding that switches to workspace 11."),
NULL) NULL)
item (switch_to_workspace, "_12", 12, 0, item (switch_to_workspace, "_12", 12, 0,
_("Switch to workspace 12"), _("Switch to workspace 12"),
_("The keybinding that switches to workspace 12."),
NULL) NULL)
/* META_MOTION_* are negative, and so distinct from workspace numbers, /* META_MOTION_* are negative, and so distinct from workspace numbers,
@ -152,27 +138,19 @@ item (switch_to_workspace, "_12", 12, 0,
*/ */
item (switch_to_workspace, "_left", META_MOTION_LEFT, 0, item (switch_to_workspace, "_left", META_MOTION_LEFT, 0,
_("Switch to workspace on the left"), _("Switch to workspace on the left of the current workspace"),
_("The keybinding that switches to the workspace on the left "
"of the current workspace."),
"<Control><Alt>Left") "<Control><Alt>Left")
item (switch_to_workspace, "_right", META_MOTION_RIGHT, 0, item (switch_to_workspace, "_right", META_MOTION_RIGHT, 0,
_("Switch to workspace on the right"), _("Switch to workspace on the right of the current workspace"),
_("The keybinding that switches to the workspace on the right "
"of the current workspace."),
"<Control><Alt>Right") "<Control><Alt>Right")
item (switch_to_workspace, "_up", META_MOTION_UP, 0, item (switch_to_workspace, "_up", META_MOTION_UP, 0,
_("Switch to workspace above this one"), _("Switch to workspace above the current workspace"),
_("The keybinding that switches to the workspace above "
"the current workspace."),
"<Control><Alt>Up") "<Control><Alt>Up")
item (switch_to_workspace, "_down", META_MOTION_DOWN, 0, item (switch_to_workspace, "_down", META_MOTION_DOWN, 0,
_("Switch to workspace below this one"), _("Switch to workspace below the current workspace"),
_("The keybinding that switches to the workspace below "
"the current workspace."),
"<Control><Alt>Down") "<Control><Alt>Down")
/***********************************/ /***********************************/
@ -185,126 +163,107 @@ item (switch_to_workspace, "_down", META_MOTION_DOWN, 0,
*/ */
item (switch, "_group", META_TAB_LIST_GROUP, BINDING_REVERSES, item (switch, "_group", META_TAB_LIST_GROUP, BINDING_REVERSES,
_("Move between windows of an application with popup"), _("Move between windows of an application, using a popup window"),
_("The keybinding used to move focus between windows of an" NULL)
"application, using a popup window."), NULL)
item (switch, "_group_backwards", META_TAB_LIST_GROUP, REVERSES_AND_REVERSED, item (switch, "_group_backwards", META_TAB_LIST_GROUP, REVERSES_AND_REVERSED,
_("Move backwards between windows of an application with popup"), _("Move backwards between windows of an application, "
_("The keybinding used to move focus backwards between windows" "using a popup window"),
"of an application, using a popup window."), NULL) NULL)
item (switch, "_windows", META_TAB_LIST_NORMAL, BINDING_REVERSES, item (switch, "_windows", META_TAB_LIST_NORMAL, BINDING_REVERSES,
_("Move between windows with popup"), _("Move between windows, using a popup window"),
_("The keybinding used to move focus between windows, " "<Alt>Tab")
"using a popup window."), "<Alt>Tab")
item (switch, "_windows_backwards",META_TAB_LIST_NORMAL, REVERSES_AND_REVERSED, item (switch, "_windows_backwards",META_TAB_LIST_NORMAL, REVERSES_AND_REVERSED,
_("Move focus backwards between windows using popup display"), _("Move backwards between windows, using a popup window"),
_("The keybinding used to move focus backwards between windows, " NULL)
"using a popup window."), NULL)
item (switch, "_panels", META_TAB_LIST_DOCKS, BINDING_REVERSES, item (switch, "_panels", META_TAB_LIST_DOCKS, BINDING_REVERSES,
_("Move between panels and the desktop with popup"), _("Move between panels and the desktop, using a popup window"),
_("The keybinding used to move focus between panels and the desktop, " "<Control><Alt>Tab")
"using a popup window."), "<Control><Alt>Tab")
item (switch, "_panels_backwards", META_TAB_LIST_DOCKS, REVERSES_AND_REVERSED, item (switch, "_panels_backwards", META_TAB_LIST_DOCKS, REVERSES_AND_REVERSED,
_("Move backwards between panels and the desktop with popup"), _("Move backwards between panels and the desktop, "
_("The keybinding used to move focus backwards between panels " "using a popup window"),
"and the desktop, using a popup window."), NULL) NULL)
item (cycle, "_group", META_TAB_LIST_GROUP, BINDING_REVERSES, item (cycle, "_group", META_TAB_LIST_GROUP, BINDING_REVERSES,
_("Move between windows of an application immediately"), _("Move between windows of an application immediately"),
_("The keybinding used to move focus between windows of an " "<Alt>F6")
"application without a popup window."), "<Alt>F6")
item (cycle, "_group_backwards", META_TAB_LIST_GROUP, REVERSES_AND_REVERSED, item (cycle, "_group_backwards", META_TAB_LIST_GROUP, REVERSES_AND_REVERSED,
_("Move backwards between windows of an application immediately"), _("Move backwards between windows of an application immediately"),
_("The keybinding used to move focus backwards between windows " NULL)
"of an application without a popup window."), NULL)
item (cycle, "_windows", META_TAB_LIST_NORMAL, BINDING_REVERSES, item (cycle, "_windows", META_TAB_LIST_NORMAL, BINDING_REVERSES,
_("Move between windows immediately"), _("Move between windows immediately"),
_("The keybinding used to move focus between windows without " "<Alt>Escape")
"a popup window."), "<Alt>Escape")
item (cycle, "_windows_backwards",META_TAB_LIST_NORMAL, REVERSES_AND_REVERSED, item (cycle, "_windows_backwards",META_TAB_LIST_NORMAL, REVERSES_AND_REVERSED,
_("Move backwards between windows immediately"), _("Move backwards between windows immediately"),
_("The keybinding used to move focus backwards between windows " NULL)
"without a popup window."), NULL)
item (cycle, "_panels", META_TAB_LIST_DOCKS, BINDING_REVERSES, item (cycle, "_panels", META_TAB_LIST_DOCKS, BINDING_REVERSES,
_("Move between panels and the desktop immediately"), _("Move between panels and the desktop immediately"),
_("The keybinding used to move focus between panels and " "<Control><Alt>Escape")
"the desktop, without a popup window."), "<Control><Alt>Escape")
item (cycle, "_panels_backwards", META_TAB_LIST_DOCKS, REVERSES_AND_REVERSED, item (cycle, "_panels_backwards", META_TAB_LIST_DOCKS, REVERSES_AND_REVERSED,
_("Move backward between panels and the desktop immediately"), _("Move backwards between panels and the desktop immediately"),
_("The keybinding used to move focus backwards between panels and " NULL)
"the desktop, without a popup window."), NULL)
/***********************************/ /***********************************/
item (show_desktop, "", 0, 0, item (show_desktop, "", 0, 0,
_("Hide all windows and focus desktop"), _("Hide all normal windows and set focus to the desktop background"),
_("The keybinding used to hide all normal windows and set the "
"focus to the desktop background."),
"<Control><Alt>d") "<Control><Alt>d")
item (panel, "_main_menu", META_KEYBINDING_ACTION_PANEL_MAIN_MENU, 0, item (panel, "_main_menu", META_KEYBINDING_ACTION_PANEL_MAIN_MENU, 0,
_("Show the panel menu"), _("Show the panel's main menu"),
_("The keybinding which shows the panel's main menu."),
"<Alt>F1") "<Alt>F1")
item (panel, "_run_dialog", META_KEYBINDING_ACTION_PANEL_RUN_DIALOG, 0, item (panel, "_run_dialog", META_KEYBINDING_ACTION_PANEL_RUN_DIALOG, 0,
_("Show the panel run application dialog"), _("Show the panel's \"Run Application\" dialog box"),
_("The keybinding which display's the panel's \"Run Application\" "
"dialog box."),
"<Alt>F2") "<Alt>F2")
/* Yes, the param is offset by one. Historical reasons. (Maybe worth fixing /* Yes, the param is offset by one. Historical reasons. (Maybe worth fixing
* at some point.) The short and long are NULL here because the stanza is * at some point.) The description is NULL here because the stanza is
* irregularly shaped in metacity.schemas.in. This will probably be fixed * irregularly shaped in metacity.schemas.in. This will probably be fixed
* as well. * as well.
*/ */
item (run_command, "_1", 0, 0, NULL, NULL, NULL) item (run_command, "_1", 0, 0, NULL, NULL)
item (run_command, "_2", 1, 0, NULL, NULL, NULL) item (run_command, "_2", 1, 0, NULL, NULL)
item (run_command, "_3", 2, 0, NULL, NULL, NULL) item (run_command, "_3", 2, 0, NULL, NULL)
item (run_command, "_4", 3, 0, NULL, NULL, NULL) item (run_command, "_4", 3, 0, NULL, NULL)
item (run_command, "_5", 4, 0, NULL, NULL, NULL) item (run_command, "_5", 4, 0, NULL, NULL)
item (run_command, "_6", 5, 0, NULL, NULL, NULL) item (run_command, "_6", 5, 0, NULL, NULL)
item (run_command, "_7", 6, 0, NULL, NULL, NULL) item (run_command, "_7", 6, 0, NULL, NULL)
item (run_command, "_8", 7, 0, NULL, NULL, NULL) item (run_command, "_8", 7, 0, NULL, NULL)
item (run_command, "_9", 8, 0, NULL, NULL, NULL) item (run_command, "_9", 8, 0, NULL, NULL)
item (run_command, "_10", 9, 0, NULL, NULL, NULL) item (run_command, "_10", 9, 0, NULL, NULL)
item (run_command, "_11", 10, 0, NULL, NULL, NULL) item (run_command, "_11", 10, 0, NULL, NULL)
item (run_command, "_12", 11, 0, NULL, NULL, NULL) item (run_command, "_12", 11, 0, NULL, NULL)
item (run_command, "_13", 12, 0, NULL, NULL, NULL) item (run_command, "_13", 12, 0, NULL, NULL)
item (run_command, "_14", 13, 0, NULL, NULL, NULL) item (run_command, "_14", 13, 0, NULL, NULL)
item (run_command, "_15", 14, 0, NULL, NULL, NULL) item (run_command, "_15", 14, 0, NULL, NULL)
item (run_command, "_16", 15, 0, NULL, NULL, NULL) item (run_command, "_16", 15, 0, NULL, NULL)
item (run_command, "_17", 16, 0, NULL, NULL, NULL) item (run_command, "_17", 16, 0, NULL, NULL)
item (run_command, "_18", 17, 0, NULL, NULL, NULL) item (run_command, "_18", 17, 0, NULL, NULL)
item (run_command, "_19", 18, 0, NULL, NULL, NULL) item (run_command, "_19", 18, 0, NULL, NULL)
item (run_command, "_20", 19, 0, NULL, NULL, NULL) item (run_command, "_20", 19, 0, NULL, NULL)
item (run_command, "_21", 20, 0, NULL, NULL, NULL) item (run_command, "_21", 20, 0, NULL, NULL)
item (run_command, "_22", 21, 0, NULL, NULL, NULL) item (run_command, "_22", 21, 0, NULL, NULL)
item (run_command, "_23", 22, 0, NULL, NULL, NULL) item (run_command, "_23", 22, 0, NULL, NULL)
item (run_command, "_24", 23, 0, NULL, NULL, NULL) item (run_command, "_24", 23, 0, NULL, NULL)
item (run_command, "_25", 24, 0, NULL, NULL, NULL) item (run_command, "_25", 24, 0, NULL, NULL)
item (run_command, "_26", 25, 0, NULL, NULL, NULL) item (run_command, "_26", 25, 0, NULL, NULL)
item (run_command, "_27", 26, 0, NULL, NULL, NULL) item (run_command, "_27", 26, 0, NULL, NULL)
item (run_command, "_28", 27, 0, NULL, NULL, NULL) item (run_command, "_28", 27, 0, NULL, NULL)
item (run_command, "_29", 28, 0, NULL, NULL, NULL) item (run_command, "_29", 28, 0, NULL, NULL)
item (run_command, "_30", 29, 0, NULL, NULL, NULL) item (run_command, "_30", 29, 0, NULL, NULL)
item (run_command, "_31", 30, 0, NULL, NULL, NULL) item (run_command, "_31", 30, 0, NULL, NULL)
item (run_command, "_32", 31, 0, NULL, NULL, NULL) item (run_command, "_32", 31, 0, NULL, NULL)
item (run_command, "_screenshot", 32, 0, item (run_command, "_screenshot", 32, 0,
_("Take a screenshot"), _("Take a screenshot"),
_("The keybinding which invokes the panel's screenshot utility."),
"Print") "Print")
item (run_command, "_window_screenshot", 33, 0, item (run_command, "_window_screenshot", 33, 0,
_("Take a screenshot of a window"), _("Take a screenshot of a window"),
_("The keybinding which invokes the panel's screenshot utility "
"to take a screenshot of a window."),
"<Alt>Print") "<Alt>Print")
item (run_terminal, "", 0, 0, item (run_terminal, "", 0, 0,
_("Run a terminal"), _("Run a terminal"),
_("The keybinding which invokes a terminal."),
NULL) NULL)
/* No descriptions because this is undocumented */ /* No description because this is undocumented */
item (set_spew_mark, "", 0, 0, NULL, NULL, NULL) item (set_spew_mark, "", 0, 0, NULL, NULL)
#undef REVERSES_AND_REVERSED #undef REVERSES_AND_REVERSED

View File

@ -43,26 +43,23 @@
* process. * process.
* *
* The arguments to item() are: * The arguments to item() are:
* 1) name: the name of the binding; a bareword identifier * 1) the name of the binding; a bareword identifier
* 2) suffix: a string to add to the binding name to make the handler name * 2) a suffix to add to the binding name to make the handler name
* (usually the empty string) * (usually the empty string)
* 3) param: an integer parameter to pass to the handler * 3) an integer parameter to pass to the handler
* 4) short: a short description. Mostly, you won't use this. * 4) a set of boolean flags, ORed together.
* This is used in *this* file for completeness, but at present
* is not checked anywhere. We use the flag BINDING_PER_WINDOW
* on all window-based bindings (i.e. every binding in this file).
* 5) a short description. Mostly, you won't use this.
* It must be marked translatable (i.e. inside "_(...)"). * It must be marked translatable (i.e. inside "_(...)").
* 5) long: like short, except long. Don't include all the stuff about * 6) a string representing the default binding.
* the parser being fairly liberal.
* 6) keystroke: a string representing the default binding.
* If this is NULL, the action is unbound by default. * If this is NULL, the action is unbound by default.
* *
* Don't try to do XML entity escaping anywhere in the strings. * Don't try to do XML entity escaping anywhere in the strings.
* *
* Some code out there wants only the entries which have a default
* binding (i.e. whose sixth parameter is not NULL). You can get only these
* by defining ONLY_BOUND_BY_DEFAULT before you include this file.
*
* Possible future work: * Possible future work:
* - merge with screen-bindings.h somehow * - merge with screen-bindings.h somehow
* - ONLY_BOUND_BY_DEFAULT is crack, get rid of it
* - "suffix" is confusing; write it out in full * - "suffix" is confusing; write it out in full
*/ */
@ -70,126 +67,103 @@
#error "item () must be defined when you include window-bindings.h" #error "item () must be defined when you include window-bindings.h"
#endif #endif
item (activate_window_menu, "", 0, /***********************************/
_("Activate window menu"), /* FIXME: this is duplicated from screen-bindings.h; find a better
_("The keybinding used to activate the window menu."), * solution, which may involve merging the two files */
#ifndef _BINDINGS_DEFINED_CONSTANTS
#define _BINDINGS_DEFINED_CONSTANTS 1
#define BINDING_PER_WINDOW 0x01
#define BINDING_REVERSES 0x02
#define BINDING_IS_REVERSED 0x04
/* FIXME: There is somewhere better for these; remove them */
#define PANEL_MAIN_MENU -1
#define PANEL_RUN_DIALOG -2
#endif /* _BINDINGS_DEFINED_CONSTANTS */
item (activate_window_menu, "", 0, BINDING_PER_WINDOW,
_("Activate the window menu"),
"<Alt>Space") "<Alt>Space")
#ifndef ONLY_BOUND_BY_DEFAULT item (toggle_fullscreen, "", 0, BINDING_PER_WINDOW,
item (toggle_fullscreen, "", 0,
_("Toggle fullscreen mode"), _("Toggle fullscreen mode"),
_("The keybinding used to toggle fullscreen mode."),
NULL) NULL)
item (toggle_maximized, "", 0, item (toggle_maximized, "", 0, BINDING_PER_WINDOW,
_("Toggle maximization state"), _("Toggle maximization state"),
_("The keybinding used to toggle maximization."),
NULL) NULL)
item (toggle_above, "", 0, item (toggle_above, "", 0, BINDING_PER_WINDOW,
_("Toggle always on top state"), _("Toggle whether a window will always be visible over other windows"),
_("The keybinding used to toggle always on top. A window that is "
"always on top will always be visible over other overlapping "
"windows."),
NULL) NULL)
#endif /* ONLY_BOUND_BY_DEFAULT */
item (maximize, "", 0, item (maximize, "", 0, BINDING_PER_WINDOW,
_("Maximize window"), _("Maximize window"),
_("The keybinding used to maximize a window."),
"<Alt>F10") "<Alt>F10")
item (unmaximize, "", 0, item (unmaximize, "", 0, BINDING_PER_WINDOW,
_("Unmaximize window"), _("Unmaximize window"),
_("The keybinding used to unmaximize a window."),
"<Alt>F5") "<Alt>F5")
#ifndef ONLY_BOUND_BY_DEFAULT item (toggle_shaded, "", 0, BINDING_PER_WINDOW,
item (toggle_shaded, "", 0,
_("Toggle shaded state"), _("Toggle shaded state"),
_("The keybinding used to toggle shaded/unshaded state."),
NULL) NULL)
#endif /* ONLY_BOUND_BY_DEFAULT */ item (minimize, "", 0, BINDING_PER_WINDOW,
item (minimize, "", 0,
_("Minimize window"), _("Minimize window"),
_("The keybinding used to minimize a window."),
"<Alt>F9") "<Alt>F9")
item (close, "", 0, item (close, "", 0, BINDING_PER_WINDOW,
_("Close window"), _("Close window"),
_("The keybinding used to close a window."),
"<Alt>F4") "<Alt>F4")
item (begin_move, "", 0, item (begin_move, "", 0, BINDING_PER_WINDOW,
_("Move window"), _("Move window"),
_("The keybinding used to enter \"move mode\" "
"and begin moving a window using the keyboard."),
"<Alt>F7") "<Alt>F7")
item (begin_resize, "", 0, item (begin_resize, "", 0, BINDING_PER_WINDOW,
_("Resize window"), _("Resize window"),
("The keybinding used to enter \"resize mode\" "
"and begin resizing a window using the keyboard."),
"<Alt>F8") "<Alt>F8")
#ifndef ONLY_BOUND_BY_DEFAULT item (toggle_on_all_workspaces, "", 0, BINDING_PER_WINDOW,
_("Toggle whether window is on all workspaces or just one"),
item (toggle_on_all_workspaces, "", 0,
_("Toggle window on all workspaces"),
_("The keybinding used to toggle whether the window is on all "
"workspaces or just one."),
NULL) NULL)
item (move_to_workspace, "_1", 1, BINDING_PER_WINDOW,
item (move_to_workspace, "_1", 1,
_("Move window to workspace 1"), _("Move window to workspace 1"),
_("The keybinding used to move a window to workspace 1."),
NULL) NULL)
item (move_to_workspace, "_2", 2, item (move_to_workspace, "_2", 2, BINDING_PER_WINDOW,
_("Move window to workspace 2"), _("Move window to workspace 2"),
_("The keybinding used to move a window to workspace 2."),
NULL) NULL)
item (move_to_workspace, "_3", 3, item (move_to_workspace, "_3", 3, BINDING_PER_WINDOW,
_("Move window to workspace 3"), _("Move window to workspace 3"),
_("The keybinding used to move a window to workspace 3."),
NULL) NULL)
item (move_to_workspace, "_4", 4, item (move_to_workspace, "_4", 4, BINDING_PER_WINDOW,
_("Move window to workspace 4"), _("Move window to workspace 4"),
_("The keybinding used to move a window to workspace 4."),
NULL) NULL)
item (move_to_workspace, "_5", 5, item (move_to_workspace, "_5", 5, BINDING_PER_WINDOW,
_("Move window to workspace 5"), _("Move window to workspace 5"),
_("The keybinding used to move a window to workspace 5."),
NULL) NULL)
item (move_to_workspace, "_6", 6, item (move_to_workspace, "_6", 6, BINDING_PER_WINDOW,
_("Move window to workspace 6"), _("Move window to workspace 6"),
_("The keybinding used to move a window to workspace 6."),
NULL) NULL)
item (move_to_workspace, "_7", 7, item (move_to_workspace, "_7", 7, BINDING_PER_WINDOW,
_("Move window to workspace 7"), _("Move window to workspace 7"),
_("The keybinding used to move a window to workspace 7."),
NULL) NULL)
item (move_to_workspace, "_8", 8, item (move_to_workspace, "_8", 8, BINDING_PER_WINDOW,
_("Move window to workspace 8"), _("Move window to workspace 8"),
_("The keybinding used to move a window to workspace 8."),
NULL) NULL)
item (move_to_workspace, "_9", 9, item (move_to_workspace, "_9", 9, BINDING_PER_WINDOW,
_("Move window to workspace 9"), _("Move window to workspace 9"),
_("The keybinding used to move a window to workspace 9."),
NULL) NULL)
item (move_to_workspace, "_10", 10, item (move_to_workspace, "_10", 10, BINDING_PER_WINDOW,
_("Move window to workspace 10"), _("Move window to workspace 10"),
_("The keybinding used to move a window to workspace 10."),
NULL) NULL)
item (move_to_workspace, "_11", 11, item (move_to_workspace, "_11", 11, BINDING_PER_WINDOW,
_("Move window to workspace 11"), _("Move window to workspace 11"),
_("The keybinding used to move a window to workspace 11."),
NULL) NULL)
item (move_to_workspace, "_12", 12, item (move_to_workspace, "_12", 12, BINDING_PER_WINDOW,
_("Move window to workspace 12"), _("Move window to workspace 12"),
_("The keybinding used to move a window to workspace 12."),
NULL) NULL)
#endif /* ONLY_BOUND_BY_DEFAULT */
/* META_MOTION_* are negative, and so distinct from workspace numbers, /* META_MOTION_* are negative, and so distinct from workspace numbers,
* which are always zero or positive. * which are always zero or positive.
* If you make use of these constants, you will need to include workspace.h * If you make use of these constants, you will need to include workspace.h
@ -198,101 +172,64 @@ item (move_to_workspace, "_12", 12,
* workspace.h, of course. * workspace.h, of course.
*/ */
item (move_to_workspace, "_left", META_MOTION_LEFT, item (move_to_workspace, "_left", META_MOTION_LEFT, BINDING_PER_WINDOW,
_("Move window one workspace to the left"), _("Move window one workspace to the left"),
_("The keybinding used to move a window one workspace to the left."),
"<Control><Shift><Alt>Left") "<Control><Shift><Alt>Left")
item (move_to_workspace, "_right", META_MOTION_RIGHT, item (move_to_workspace, "_right", META_MOTION_RIGHT, BINDING_PER_WINDOW,
_("Move window one workspace to the right"), _("Move window one workspace to the right"),
_("The keybinding used to move a window one workspace to the right."),
"<Control><Shift><Alt>Right") "<Control><Shift><Alt>Right")
item (move_to_workspace, "_up", META_MOTION_UP, item (move_to_workspace, "_up", META_MOTION_UP, BINDING_PER_WINDOW,
_("Move window one workspace up"), _("Move window one workspace up"),
_("The keybinding used to move a window one workspace up."),
"<Control><Shift><Alt>Up") "<Control><Shift><Alt>Up")
item (move_to_workspace, "_down", META_MOTION_DOWN, item (move_to_workspace, "_down", META_MOTION_DOWN, BINDING_PER_WINDOW,
_("Move window one workspace down"), _("Move window one workspace down"),
_("The keybinding used to move a window one workspace down."),
"<Control><Shift><Alt>Down") "<Control><Shift><Alt>Down")
#ifndef ONLY_BOUND_BY_DEFAULT item (raise_or_lower, "", 0, BINDING_PER_WINDOW,
_("Raise window if it's covered by another window, otherwise lower it"),
item (raise_or_lower, "", 0,
_("Raise obscured window, otherwise lower"),
_("This keybinding changes whether a window is above or below "
"other windows. If the window is covered by another one, it "
"raises the window above all others, and if the window is "
"already fully visible, it lowers it below all others."),
NULL) NULL)
item (raise, "", 0, item (raise, "", 0, BINDING_PER_WINDOW,
_("Raise window above other windows"), _("Raise window above other windows"),
_("This keybinding raises the window above other windows."),
NULL) NULL)
item (lower, "", 0, item (lower, "", 0, BINDING_PER_WINDOW,
_("Lower window below other windows"), _("Lower window below other windows"),
_("This keybinding lowers a window below other windows."),
NULL) NULL)
item (maximize_vertically, "", 0, item (maximize_vertically, "", 0, BINDING_PER_WINDOW,
_("Maximize window vertically"), _("Maximize window vertically"),
_("This keybinding resizes a window to fill available "
"vertical space."),
NULL) NULL)
item (maximize_horizontally, "", 0, item (maximize_horizontally, "", 0, BINDING_PER_WINDOW,
_("Maximize window horizontally"), _("Maximize window horizontally"),
_("This keybinding resizes a window to fill available "
"horizontal space."),
NULL) NULL)
item (move_to_corner_nw, "", 0, item (move_to_corner_nw, "", 0, BINDING_PER_WINDOW,
_("Move window to north-west corner"), _("Move window to north-west (top left) corner"),
_("This keybinding moves a window into the north-west (top left) "
"corner of the screen."),
NULL) NULL)
item (move_to_corner_ne, "", 0, item (move_to_corner_ne, "", 0, BINDING_PER_WINDOW,
_("Move window to north-east corner"), _("Move window to north-east (top right) corner"),
_("This keybinding moves a window into the north-east (top right) "
"corner of the screen."),
NULL) NULL)
item (move_to_corner_sw, "", 0, item (move_to_corner_sw, "", 0, BINDING_PER_WINDOW,
_("Move window to south-west corner"), _("Move window to south-west (bottom left) corner"),
_("This keybinding moves a window into the north-east (bottom left) "
"corner of the screen."),
NULL) NULL)
item (move_to_corner_se, "", 0, item (move_to_corner_se, "", 0, BINDING_PER_WINDOW,
_("Move window to south-east corner"), _("Move window to south-east (bottom right) corner"),
_("This keybinding moves a window into the north-east (bottom right) "
"corner of the screen."),
NULL) NULL)
item (move_to_side_n, "", 0, item (move_to_side_n, "", 0, BINDING_PER_WINDOW,
_("Move window to north side of screen"), _("Move window to north (top) side of screen"),
_("This keybinding moves a window against the north (top) "
"side of the screen."),
NULL) NULL)
item (move_to_side_s, "", 0, item (move_to_side_s, "", 0, BINDING_PER_WINDOW,
_("Move window to south side of screen"), _("Move window to south (bottom) side of screen"),
_("This keybinding moves a window against the south (bottom) "
"side of the screen."),
NULL) NULL)
item (move_to_side_e, "", 0, item (move_to_side_e, "", 0, BINDING_PER_WINDOW,
_("Move window to east side of screen"), _("Move window to east (right) side of screen"),
_("This keybinding moves a window against the east (right) "
"side of the screen."),
NULL) NULL)
item (move_to_side_w, "", 0, item (move_to_side_w, "", 0, BINDING_PER_WINDOW,
_("Move window to west side of screen"), _("Move window to west (left) side of screen"),
_("This keybinding moves a window against the west (left) "
"side of the screen."),
NULL) NULL)
item (move_to_center, "", 0, BINDING_PER_WINDOW,
item (move_to_center, "", 0,
_("Move window to center of screen"), _("Move window to center of screen"),
_("This keybinding moves a window into the center "
"of the screen."),
NULL) NULL)
#endif /* ONLY_BOUND_BY_DEFAULT */
/* eof window-bindings.h */ /* eof window-bindings.h */