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