X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=keymap.h;h=aceb5eb5777ee6a6977b3a2ea1e9bffaa3875176;hp=a88bbf46167a812b375297f37a608b4dbcbe69fa;hb=e4704214cabdd0b6e10b27cff5e2194959559809;hpb=6833ce8bdca2d64e14485118f2a4417b7e1cb1b1 diff --git a/keymap.h b/keymap.h index a88bbf4..aceb5eb 100644 --- a/keymap.h +++ b/keymap.h @@ -1,25 +1,16 @@ /* + * Copyright notice from original mutt: * Copyright (C) 1996-2000,2 Michael R. Elkins - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - */ + * + * This file is part of mutt-ng, see http://www.muttng.org/. + * It's licensed under the GNU General Public License, + * please see the file GPL in the top level source directory. + */ #ifndef KEYMAP_H #define KEYMAP_H -#include "mapping.h" +#include /* maximal length of a key binding sequence used for buffer in km_bindkey */ #define MAX_SEQ 8 @@ -27,31 +18,28 @@ /* type for key storage, the rest of mutt works fine with int type */ typedef short keycode_t; -void km_bind (char *, int, int, char *, char *); -void km_bindkey (char *, int, int); +void km_bind (const char *, int, int, char *, char *); +void km_bindkey (const char *, int, int); int km_dokey (int); /* entry in the keymap tree */ -struct keymap_t -{ - char *macro; /* macro expansion (op == OP_MACRO) */ - char *descr; /* description of a macro for the help menu */ - struct keymap_t *next; /* next key in map */ - short op; /* operation to perform */ - short eq; /* number of leading keys equal to next entry */ - short len; /* length of key sequence (unit: sizeof (keycode_t)) */ - keycode_t *keys; /* key sequence */ +struct keymap_t { + char *macro; /* macro expansion (op == OP_MACRO) */ + char *descr; /* description of a macro for the help menu */ + struct keymap_t *next; /* next key in map */ + short op; /* operation to perform */ + short eq; /* number of leading keys equal to next entry */ + short len; /* length of key sequence (unit: sizeof (keycode_t)) */ + keycode_t *keys; /* key sequence */ }; -char *km_keyname (int); +const char *km_keyname (int); int km_expand_key (char *, size_t, struct keymap_t *); struct keymap_t *km_find_func (int, int); void km_init (void); void km_error_key (int); -void mutt_what_key (void); -enum -{ +enum { MENU_ALIAS, MENU_ATTACH, MENU_COMPOSE, @@ -62,18 +50,10 @@ enum MENU_PAGER, MENU_POST, MENU_QUERY, - - MENU_PGP, - MENU_SMIME, - -#ifdef MIXMASTER - MENU_MIX, -#endif - - - + MENU_KEY_SELECT_PGP, + MENU_KEY_SELECT_SMIME, MENU_MAX }; @@ -85,34 +65,16 @@ extern int LastKey; extern struct mapping_t Menus[]; -struct binding_t -{ - char *name; /* name of the function */ - int op; /* function id number */ - char *seq; /* default key binding */ +struct binding_t { + const char *name; /* name of the function */ + int op; /* function id number */ + const char *seq; /* default key binding */ }; struct binding_t *km_get_table (int menu); -extern struct binding_t OpGeneric[]; -extern struct binding_t OpPost[]; -extern struct binding_t OpMain[]; -extern struct binding_t OpAttach[]; -extern struct binding_t OpPager[]; -extern struct binding_t OpCompose[]; -extern struct binding_t OpBrowser[]; -extern struct binding_t OpEditor[]; -extern struct binding_t OpQuery[]; -extern struct binding_t OpAlias[]; - -extern struct binding_t OpPgp[]; - -extern struct binding_t OpSmime[]; - -#ifdef MIXMASTER -extern struct binding_t OpMix[]; -#endif - -#include "keymap_defs.h" +#define MUTT_FUNCTIONS_PROTO +#include "functions.def" #endif /* KEYMAP_H */ +#include "keymap_defs.h"