summaryrefslogtreecommitdiffstats
path: root/input/input.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-10-25 07:05:47 +0300
committerUoti Urpala <uau@mplayer2.org>2011-10-25 07:05:47 +0300
commit8b5efd6455370c02211f9fec2a3dbb74f5d0fcbc (patch)
tree4a8222fbf5ed2c8e7b7766435820183ff641c97d /input/input.c
parentb200583403219136363b755afab2b05c0937a928 (diff)
downloadmpv-8b5efd6455370c02211f9fec2a3dbb74f5d0fcbc.tar.bz2
mpv-8b5efd6455370c02211f9fec2a3dbb74f5d0fcbc.tar.xz
libmenu: remove OSD menu functionality (--menu)
Something like the OSD menu functionality could be useful. However the current implementation has several problems and would require a relatively large amount of work to get into good shape. As far as I know there are few users of the existing functionality. Nobody is working on the existing code and keeping it compiling at all while changing other code would require extra work. So delete the menu code and some related code elsewhere that's used by nothing else.
Diffstat (limited to 'input/input.c')
-rw-r--r--input/input.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/input/input.c b/input/input.c
index 29b462a49f..7c02be5fa9 100644
--- a/input/input.c
+++ b/input/input.c
@@ -174,7 +174,6 @@ static const mp_cmd_t mp_cmds[] = {
{ MP_CMD_SWITCH_RATIO, "switch_ratio", 0, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } },
{ MP_CMD_VO_FULLSCREEN, "vo_fullscreen", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } },
{ MP_CMD_VO_ONTOP, "vo_ontop", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } },
- { MP_CMD_FILE_FILTER, "file_filter", 1, { { MP_CMD_ARG_INT, {0}}, {-1,{0}}}},
{ MP_CMD_VO_ROOTWIN, "vo_rootwin", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } },
{ MP_CMD_VO_BORDER, "vo_border", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } },
{ MP_CMD_SCREENSHOT, "screenshot", 0, { {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
@@ -192,14 +191,6 @@ static const mp_cmd_t mp_cmds[] = {
{ MP_CMD_DVDNAV, "dvdnav", 1, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } },
#endif
-#ifdef CONFIG_MENU
- { MP_CMD_MENU, "menu",1, { {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } },
- { MP_CMD_SET_MENU, "set_menu",1, { {MP_CMD_ARG_STRING, {0}}, {MP_CMD_ARG_STRING, {0}}, {-1,{0}} } },
- { MP_CMD_CHELP, "help", 0, { {-1,{0}} } },
- { MP_CMD_CEXIT, "exit", 0, { {-1,{0}} } },
- { MP_CMD_CHIDE, "hide", 0, { {MP_CMD_ARG_INT,{3000}}, {-1,{0}} } },
-#endif
-
{ MP_CMD_GET_VO_FULLSCREEN, "get_vo_fullscreen", 0, { {-1,{0}} } },
{ MP_CMD_GET_SUB_VISIBILITY, "get_sub_visibility", 0, { {-1,{0}} } },
{ MP_CMD_KEYDOWN_EVENTS, "key_down_event", 1, { {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
@@ -570,12 +561,6 @@ struct input_fd {
int pos, size;
};
-struct cmd_filter {
- mp_input_cmd_filter filter;
- void *ctx;
- struct cmd_filter *next;
-};
-
struct cmd_bind_section {
struct cmd_bind *cmd_binds;
char *section;
@@ -630,11 +615,6 @@ struct input_ctx {
};
-static struct cmd_filter *cmd_filters = NULL;
-
-// Callback to allow the menu filter to grab the incoming keys
-int (*mp_input_key_cb)(int code) = NULL;
-
int async_quit_request;
static int print_key_list(m_option_t *cfg);
@@ -1099,17 +1079,6 @@ static int default_cmd_func(int fd, char *buf, int l)
}
-void mp_input_add_cmd_filter(mp_input_cmd_filter func, void *ctx)
-{
- struct cmd_filter *filter = talloc_ptrtype(NULL, filter);
-
- filter->filter = func;
- filter->ctx = ctx;
- filter->next = cmd_filters;
- cmd_filters = filter;
-}
-
-
static char *find_bind_for_key(const struct cmd_bind *binds, int n, int *keys)
{
int j;
@@ -1203,14 +1172,6 @@ static mp_cmd_t *interpret_key(struct input_ctx *ictx, int code)
if (unmod < 256 && unmod != KEY_ENTER && unmod != KEY_TAB)
code &= ~KEY_MODIFIER_SHIFT;
- if (mp_input_key_cb) {
- if (code & MP_KEY_DOWN)
- return NULL;
- code &= ~(MP_KEY_DOWN | MP_NO_REPEAT_KEY);
- if (mp_input_key_cb(code))
- return NULL;
- }
-
if (code & MP_KEY_DOWN) {
if (ictx->num_key_down > MP_MAX_KEY_DOWN) {
mp_tmsg(MSGT_INPUT, MSGL_ERR, "Too many key down events "
@@ -1483,16 +1444,6 @@ mp_cmd_t *mp_input_get_cmd(struct input_ctx *ictx, int time, int peek_only)
} else
ret = queue->first;
- for (struct cmd_filter *cf = cmd_filters; cf; cf = cf->next) {
- if (cf->filter(ret, cf->ctx)) {
- // The filter ate the cmd, so remove it from the queue
- queue_pop(queue);
- mp_cmd_free(ret);
- // Retry with next command
- return mp_input_get_cmd(ictx, 0, peek_only);
- }
- }
-
if (!peek_only)
queue_pop(queue);