[vlc-devel] commit: Lua dialogs: introduce "dlg:flush()" ( Jean-Philippe André )

git version control git at videolan.org
Wed Feb 3 17:21:55 CET 2010


vlc | branch: master | Jean-Philippe André <jpeg at videolan.org> | Wed Feb  3 10:48:55 2010 +0100| [24706cde957b064cbd979f09782bd48af315e500] | committer: Jean-Philippe André 

Lua dialogs: introduce "dlg:flush()"

After the next commit, you'll have to flush a dialog in order to
update it immediately on the screen.
Flush sends an update signal to the UI dialog provider.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=24706cde957b064cbd979f09782bd48af315e500
---

 modules/misc/lua/libs/dialog.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/modules/misc/lua/libs/dialog.c b/modules/misc/lua/libs/dialog.c
index e8dc5e2..2e26cc9 100644
--- a/modules/misc/lua/libs/dialog.c
+++ b/modules/misc/lua/libs/dialog.c
@@ -52,6 +52,7 @@ static int vlclua_dialog_create( lua_State *L );
 static int vlclua_dialog_delete( lua_State *L );
 static int vlclua_dialog_show( lua_State *L );
 static int vlclua_dialog_hide( lua_State *L );
+static int vlclua_dialog_flush( lua_State *L );
 
 static int vlclua_dialog_add_button( lua_State *L );
 static int vlclua_dialog_add_label( lua_State *L );
@@ -98,6 +99,7 @@ static const luaL_Reg vlclua_dialog_reg[] = {
     { "show", vlclua_dialog_show },
     { "hide", vlclua_dialog_hide },
     { "close", vlclua_dialog_delete },
+    { "flush", vlclua_dialog_flush },
 
     { "add_button", vlclua_dialog_add_button },
     { "add_label", vlclua_dialog_add_label },
@@ -311,6 +313,22 @@ static int vlclua_dialog_hide( lua_State *L )
 }
 
 
+/** Flush the dialog */
+static int vlclua_dialog_flush( lua_State *L )
+{
+    vlc_object_t *p_mgr = vlclua_get_this( L );
+
+    extension_dialog_t **pp_dlg =
+            (extension_dialog_t**) luaL_checkudata( L, 1, "dialog" );
+    if( !pp_dlg || !*pp_dlg )
+        return luaL_error( L, "Can't get pointer to dialog" );
+    extension_dialog_t *p_dlg = *pp_dlg;
+
+    dialog_ExtensionUpdate( p_mgr, p_dlg );
+
+    return 1;
+}
+
 /**
  * Create a button: add_button
  * Arguments: text, function (as string)




More information about the vlc-devel mailing list