mpv/input
wm4 fb9bbf2a0d command: split big command handler switch into separate functions
This gets rid of run_command() and its big switch statement, which was
an idiotically big function of almost 1000 lines.

The switch is replaced with a callback per command, and each command is
now implemented in its own function. Command IDs are not needed anymore,
so the mp_command_type enum disappears.

There should be no functional changes, but since this refactors 64
commands, regressions are possible.

The handler() parameter is void*, because in theory the input code is
supposed to be independent of the player core code. For example, you
should be able to reuse the command parser code for some other part of
mpv. In practice, the variable containing command list is defined in the
player core anyway, so you could say this doesn't work. But I'm still
trying to hold onto this idea, so I went with void*.
2018-05-03 01:20:01 +03:00
..
cmd_list.c input: remove some explicit uses of command IDs 2018-05-03 01:20:01 +03:00
cmd_list.h command: split big command handler switch into separate functions 2018-05-03 01:20:01 +03:00
cmd_parse.c command: split big command handler switch into separate functions 2018-05-03 01:20:01 +03:00
cmd_parse.h input: remove some explicit uses of command IDs 2018-05-03 01:20:01 +03:00
event.c Use - as command-name separator everywhere 2016-07-14 22:37:42 +02:00
event.h input/event.h: add include guard 2016-03-15 22:44:15 +01:00
input.c input: remove some explicit uses of command IDs 2018-05-03 01:20:01 +03:00
input.h input: make command argument list a dynamic array 2018-01-10 20:36:27 -08:00
ipc-dummy.c build: change how some OS specific source files are selected 2017-06-29 10:30:16 +02:00
ipc-unix.c all: replace mpv_detach_destroy() with mpv_destroy() 2018-03-15 00:00:04 -07:00
ipc-win.c all: replace mpv_detach_destroy() with mpv_destroy() 2018-03-15 00:00:04 -07:00
ipc.c ipc: raise json nesting limit 2017-05-03 20:47:11 +02:00
keycodes.c input: merge mouse wheel and axis keycodes 2017-09-03 20:31:44 +10:00
keycodes.h input: fix error in MP_KEY_IS_WHEEL 2017-09-03 20:46:06 +10:00
pipe-win32.c osdep: rename atomics.h to atomic.h 2016-09-07 11:26:25 +02:00