mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Modularise config/kbdbind
This commit is contained in:
parent
eee3ecdbbc
commit
5dcac5c32d
@ -16,6 +16,7 @@
|
||||
#include "config/options.h"
|
||||
#include "intl/gettext/libintl.h"
|
||||
#include "main/event.h"
|
||||
#include "main/module.h"
|
||||
#include "terminal/kbd.h"
|
||||
#include "util/memory.h"
|
||||
#include "util/string.h"
|
||||
@ -515,8 +516,8 @@ static struct action_list action_table[KEYMAP_MAX] = {
|
||||
#undef ACTION_
|
||||
|
||||
|
||||
void
|
||||
init_keymaps(void)
|
||||
static void
|
||||
init_keymaps(struct module *xxx)
|
||||
{
|
||||
enum keymap_id keymap_id;
|
||||
|
||||
@ -527,8 +528,8 @@ init_keymaps(void)
|
||||
add_default_keybindings();
|
||||
}
|
||||
|
||||
void
|
||||
free_keymaps(void)
|
||||
static void
|
||||
free_keymaps(struct module *xxx)
|
||||
{
|
||||
enum keymap_id keymap_id;
|
||||
|
||||
@ -948,3 +949,13 @@ bind_config_string(struct string *file)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct module kbdbind_module = struct_module(
|
||||
/* name: */ "Keyboard Bindings",
|
||||
/* options: */ NULL,
|
||||
/* hooks: */ NULL,
|
||||
/* submodules: */ NULL,
|
||||
/* data: */ NULL,
|
||||
/* init: */ init_keymaps,
|
||||
/* done: */ free_keymaps
|
||||
);
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "util/string.h"
|
||||
|
||||
struct listbox_item;
|
||||
struct module;
|
||||
|
||||
/* Used for holding enum <keymap>_action values. */
|
||||
typedef long action_id_T;
|
||||
@ -114,9 +115,6 @@ struct keybinding {
|
||||
};
|
||||
|
||||
|
||||
void init_keymaps(void);
|
||||
void free_keymaps(void);
|
||||
|
||||
struct keybinding *add_keybinding(enum keymap_id keymap_id, action_id_T action_id, struct term_event_keyboard *kbd, int event);
|
||||
int keybinding_exists(enum keymap_id keymap_id, struct term_event_keyboard *kbd, action_id_T *action_id);
|
||||
void free_keybinding(struct keybinding *);
|
||||
@ -207,4 +205,6 @@ unsigned char *get_keystroke(action_id_T action_id, enum keymap_id keymap_id);
|
||||
void add_actions_to_string(struct string *string, action_id_T actions[],
|
||||
enum keymap_id keymap_id, struct terminal *term);
|
||||
|
||||
extern struct module kbdbind_module;
|
||||
|
||||
#endif
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "config/cmdline.h"
|
||||
#include "config/conf.h"
|
||||
#include "config/home.h"
|
||||
#include "config/kbdbind.h"
|
||||
#include "config/options.h"
|
||||
#include "dialogs/menu.h"
|
||||
#include "document/document.h"
|
||||
@ -130,7 +129,6 @@ init(void)
|
||||
register_modules_options(builtin_modules);
|
||||
set_sigcld();
|
||||
get_system_name();
|
||||
init_keymaps();
|
||||
|
||||
/* XXX: OS/2 has some stupid bug and the pipe must be created before
|
||||
* socket :-/. -- Mikulas */
|
||||
@ -298,7 +296,6 @@ terminate_all_subsystems(void)
|
||||
free_charsets_lookup();
|
||||
free_colors_lookup();
|
||||
done_modules(main_modules);
|
||||
free_keymaps();
|
||||
free_conv_table();
|
||||
check_bottom_halves();
|
||||
done_home();
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
#include "bfu/dialog.h"
|
||||
#include "bookmarks/bookmarks.h"
|
||||
#include "config/kbdbind.h"
|
||||
#include "config/timer.h"
|
||||
#include "config/urlhist.h"
|
||||
#include "cookies/cookies.h"
|
||||
@ -33,6 +34,7 @@
|
||||
|
||||
struct module *main_modules[] = {
|
||||
&document_module,
|
||||
&kbdbind_module,
|
||||
NULL /* XXX: Keep this */
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user