From d6c99bcda2b4e2791c6b147f5ba9d9cd95c7be7f Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 6 Aug 2015 00:31:47 +0200 Subject: lua: implement input_enable_section/input_disable_section via commands Removes some more internal API calls from the Lua scripting backend. Which is good, because ideally the scripting backend would use libmpv functions only. One awkwardness is that mouse sections are still not supported by the public commands (and probably will never), so flags like allow-hide- cursor make no sense to an outside user. Also, the way flags are passed to the Lua function changes. But that's ok, because they're only undocumented internal functions, and not supposed to be used by script users. osc.lua only does due to historical reasons. --- input/cmd_list.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'input') diff --git a/input/cmd_list.c b/input/cmd_list.c index 250f451955..3640cce460 100644 --- a/input/cmd_list.c +++ b/input/cmd_list.c @@ -162,8 +162,10 @@ const struct mp_cmd_def mp_cmds[] = { { MP_CMD_ENABLE_INPUT_SECTION, "enable-section", { ARG_STRING, - OARG_CHOICE(0, ({"default", 0}, - {"exclusive", 1})), + OARG_FLAGS(0, ({"default", 0}, + {"exclusive", MP_INPUT_EXCLUSIVE}, + {"allow-hide-cursor", MP_INPUT_ALLOW_HIDE_CURSOR}, + {"allow-vo-dragging", MP_INPUT_ALLOW_VO_DRAGGING})), }}, { MP_CMD_DISABLE_INPUT_SECTION, "disable-section", { ARG_STRING } }, { MP_CMD_DEFINE_INPUT_SECTION, "define-section", { -- cgit v1.2.3