2017-06-13 09:22:57 +08:00
|
|
|
// Prototypes for executing builtin_bind function.
|
2017-06-13 08:19:13 +08:00
|
|
|
#ifndef FISH_BUILTIN_BIND_H
|
|
|
|
#define FISH_BUILTIN_BIND_H
|
|
|
|
|
2017-10-03 16:29:48 +08:00
|
|
|
#include "common.h"
|
|
|
|
|
2017-06-13 08:19:13 +08:00
|
|
|
#define DEFAULT_BIND_MODE L"default"
|
|
|
|
|
|
|
|
class parser_t;
|
|
|
|
struct io_streams_t;
|
2017-10-03 16:29:48 +08:00
|
|
|
struct bind_cmd_opts_t;
|
|
|
|
|
|
|
|
class builtin_bind_t {
|
|
|
|
public:
|
|
|
|
int builtin_bind(parser_t &parser, io_streams_t &streams, wchar_t **argv);
|
|
|
|
private:
|
|
|
|
bind_cmd_opts_t *opts;
|
|
|
|
|
2018-09-18 17:52:25 +08:00
|
|
|
void list(const wchar_t *bind_mode, bool user, io_streams_t &streams);
|
|
|
|
void key_names(bool all, io_streams_t &streams);
|
2017-10-03 16:29:48 +08:00
|
|
|
void function_names(io_streams_t &streams);
|
|
|
|
bool add(const wchar_t *seq, const wchar_t *const *cmds, size_t cmds_len,
|
2018-09-18 17:52:25 +08:00
|
|
|
const wchar_t *mode, const wchar_t *sets_mode, bool terminfo, bool user,
|
2017-10-03 16:29:48 +08:00
|
|
|
io_streams_t &streams);
|
2018-09-18 17:52:25 +08:00
|
|
|
bool erase(wchar_t **seq, bool all, const wchar_t *mode, bool use_terminfo, bool user,
|
2017-10-03 16:29:48 +08:00
|
|
|
io_streams_t &streams);
|
|
|
|
bool get_terminfo_sequence(const wchar_t *seq, wcstring *out_seq, io_streams_t &streams);
|
|
|
|
bool insert(int optind, int argc, wchar_t **argv,
|
|
|
|
io_streams_t &streams);
|
|
|
|
void list_modes(io_streams_t &streams);
|
2018-09-18 17:52:25 +08:00
|
|
|
bool list_one(const wcstring &seq, const wcstring &bind_mode, bool user, io_streams_t &streams);
|
|
|
|
bool list_one(const wcstring &seq, const wcstring &bind_mode, bool user, bool preset, io_streams_t &streams);
|
2017-10-03 16:29:48 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
inline int builtin_bind(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|
|
|
builtin_bind_t bind;
|
|
|
|
return bind.builtin_bind(parser, streams, argv);
|
|
|
|
}
|
2017-06-13 08:19:13 +08:00
|
|
|
|
|
|
|
#endif
|