]> git.sesse.net Git - nageru/blobdiff - theme.cpp
Implement HTMLInput::execute_javascript_async().
[nageru] / theme.cpp
index bc57b0d209cb329571c594ed904991c6ff57d150..091495f9cae0e78836a7b6c7f3f42480ffbadb0d 100644 (file)
--- a/theme.cpp
+++ b/theme.cpp
@@ -431,6 +431,32 @@ int HTMLInput_set_url(lua_State* L)
        return 0;
 }
 
+int HTMLInput_reload(lua_State* L)
+{
+       assert(lua_gettop(L) == 1);
+       CEFCapture **video_input = (CEFCapture **)luaL_checkudata(L, 1, "HTMLInput");
+       (*video_input)->reload();
+       return 0;
+}
+
+int HTMLInput_set_max_fps(lua_State* L)
+{
+       assert(lua_gettop(L) == 2);
+       CEFCapture **video_input = (CEFCapture **)luaL_checkudata(L, 1, "HTMLInput");
+       int max_fps = lrint(luaL_checknumber(L, 2));
+       (*video_input)->set_max_fps(max_fps);
+       return 0;
+}
+
+int HTMLInput_execute_javascript_async(lua_State* L)
+{
+       assert(lua_gettop(L) == 2);
+       CEFCapture **video_input = (CEFCapture **)luaL_checkudata(L, 1, "HTMLInput");
+       string js = checkstdstring(L, 2);
+       (*video_input)->execute_javascript_async(js);
+       return 0;
+}
+
 int HTMLInput_get_signal_num(lua_State* L)
 {
        assert(lua_gettop(L) == 1);
@@ -648,9 +674,11 @@ const luaL_Reg VideoInput_funcs[] = {
 };
 
 const luaL_Reg HTMLInput_funcs[] = {
-       // TODO: reload, execute_javascript, perhaps set_max_fps?
        { "new", HTMLInput_new },
        { "set_url", HTMLInput_set_url },
+       { "reload", HTMLInput_reload },
+       { "set_max_fps", HTMLInput_set_max_fps },
+       { "execute_javascript_async", HTMLInput_execute_javascript_async },
        { "get_signal_num", HTMLInput_get_signal_num },
        { NULL, NULL }
 };