]> git.sesse.net Git - vlc/blobdiff - mozilla/vlcshell.cpp
Implemented the retrieval of the versions, files and mirrors. Both the size and the...
[vlc] / mozilla / vlcshell.cpp
index fcf2c635159703ad7dc62e564e3b9bbe83952dda..eb05e9cae02d92774386817b06e6658cbc7b3ecb 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * vlcshell.cpp: a VLC plugin for Mozilla
  *****************************************************************************
- * Copyright (C) 2002-2005 VideoLAN
+ * Copyright (C) 2002-2005 the VideoLAN team
  * $Id$
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
@@ -47,7 +47,7 @@
 #include <npapi.h>
 
 /* This is from mozilla java, do we really need it? */
-#if 0 
+#if 0
 #include <jri.h>
 #endif
 
@@ -92,6 +92,9 @@
 #   define VOUT_PLUGINS "xvideo,x11,dummy"
 #   define AOUT_PLUGINS "oss,dummy"
 
+static unsigned int i_previous_height = 100000;
+static unsigned int i_previous_width = 100000;
+
 static void Redraw( Widget w, XtPointer closure, XEvent *event );
 static void Resize( Widget w, XtPointer closure, XEvent *event );
 #endif
@@ -336,7 +339,7 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
         {
             if( !strcmp( argn[i], "loop" ) )
             {
-                if( !strcmp( argv[i], "yes" ) )
+                if( !strcmp( argv[i], "1" ) || !strcmp( argv[i], "yes" ) )
                 {
                     value.b_bool = VLC_TRUE;
                     VLC_VariableSet( p_plugin->i_vlc, "conf::loop", value );
@@ -387,7 +390,7 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
         }
         else if( !strcmp( argn[i], "autoplay" ) )
         {
-            if( !strcmp( argv[i], "yes" ) )
+            if( !strcmp( argv[i], "1" ) || !strcmp( argv[i], "yes" ) )
             {
                 p_plugin->b_autoplay = 1;
             }
@@ -411,7 +414,7 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
 #if USE_LIBVLC
         else if( !strcmp( argn[i], "fullscreen" ) )
         {
-            if( !strcmp( argv[i], "yes" ) )
+            if( !strcmp( argv[i], "1" ) || !strcmp( argv[i], "yes" ) )
             {
                 value.b_bool = VLC_TRUE;
                 VLC_VariableSet( p_plugin->i_vlc, "conf::fullscreen", value );
@@ -419,7 +422,7 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
         }
         else if( !strcmp( argn[i], "mute" ) )
         {
-            if( !strcmp( argv[i], "yes" ) )
+            if( !strcmp( argv[i], "1" ) || !strcmp( argv[i], "yes" ) )
             {
                 VLC_VolumeMute( p_plugin->i_vlc );
             }
@@ -661,6 +664,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
     XResizeWindow( p_plugin->p_display, p_plugin->window,
                    p_plugin->i_width, p_plugin->i_height );
     Widget w = XtWindowToWidget( p_plugin->p_display, p_plugin->window );
+
     XtAddEventHandler( w, ExposureMask, FALSE,
                        (XtEventHandler)Redraw, p_plugin );
     XtAddEventHandler( w, StructureNotifyMask, FALSE,
@@ -945,6 +949,15 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
     }
 #endif /* X11_RESIZE_DEBUG */
 
+    if( p_plugin->i_height == i_previous_height &&
+        p_plugin->i_width == i_previous_width )
+    {
+        return;
+    }
+    i_previous_height = p_plugin->i_height;
+    i_previous_width  = p_plugin->i_width;
+
+
     i_ret = XResizeWindow( p_plugin->p_display, p_plugin->window,
             p_plugin->i_width, p_plugin->i_height );