[vlc-devel] commit: Revert "Lua dialogs: remove show() and hide()" ( Jean-Philippe André )
git version control
git at videolan.org
Thu Feb 4 03:11:37 CET 2010
vlc | branch: master | Jean-Philippe André <jpeg at videolan.org> | Thu Feb 4 02:00:09 2010 +0100| [6db774279e14c3a8315b70f80dc79cd18d7d3bf3] | committer: Jean-Philippe André
Revert "Lua dialogs: remove show() and hide()"
This reverts commit 67d36fd7c71ff213ac363d092d59290b1a943980.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6db774279e14c3a8315b70f80dc79cd18d7d3bf3
---
modules/misc/lua/extension.c | 2 +-
modules/misc/lua/libs/dialog.c | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 1 deletions(-)
diff --git a/modules/misc/lua/extension.c b/modules/misc/lua/extension.c
index b703860..2a6f404 100644
--- a/modules/misc/lua/extension.c
+++ b/modules/misc/lua/extension.c
@@ -83,7 +83,7 @@ static void inputItemMetaChanged( const vlc_event_t *p_event,
**/
int Open_Extension( vlc_object_t *p_this )
{
- msg_Dbg( p_this, "Opening Lua Extensions module" );
+ msg_Dbg( p_this, "Opening EXPERIMENTAL Lua Extension module" );
extensions_manager_t *p_mgr = ( extensions_manager_t* ) p_this;
diff --git a/modules/misc/lua/libs/dialog.c b/modules/misc/lua/libs/dialog.c
index 2364dc6..4f8a0a3 100644
--- a/modules/misc/lua/libs/dialog.c
+++ b/modules/misc/lua/libs/dialog.c
@@ -50,6 +50,8 @@
/* Dialog functions */
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 void lua_SetDialogUpdate( lua_State *L, int flag );
static int lua_GetDialogUpdate( lua_State *L );
@@ -97,6 +99,8 @@ static int DeleteWidget( extension_dialog_t *p_dialog,
extension_widget_t *p_widget );
static const luaL_Reg vlclua_dialog_reg[] = {
+ { "show", vlclua_dialog_show },
+ { "hide", vlclua_dialog_hide },
{ "close", vlclua_dialog_delete },
{ "flush", vlclua_dialog_flush },
@@ -284,6 +288,40 @@ static int vlclua_dialog_delete( lua_State *L )
return 1;
}
+/** Show the dialog */
+static int vlclua_dialog_show( 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;
+
+ p_dlg->b_hide = false;
+ lua_SetDialogUpdate( L, 1 );
+
+ return 1;
+}
+
+/** Hide the dialog */
+static int vlclua_dialog_hide( 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;
+
+ p_dlg->b_hide = true;
+ lua_SetDialogUpdate( L, 1 );
+
+ return 1;
+}
+
/** Flush the dialog */
static int vlclua_dialog_flush( lua_State *L )
More information about the vlc-devel
mailing list