]> git.sesse.net Git - vlc/blobdiff - projects/mozilla/vlcshell.cpp
Remove references to mozilla-config.h, remove linkage with libnspr and other xpcom...
[vlc] / projects / mozilla / vlcshell.cpp
index a2ecf86cc3b4ae6b554347ff5a2bd2060b3f2c1d..575c2b1b91710d5707b6443cface096c34a0e8ff 100644 (file)
 #include <string.h>
 #include <stdlib.h>
 
-/* Mozilla stuff */
-#ifdef HAVE_MOZILLA_CONFIG_H
-#   include <mozilla-config.h>
-#endif
-
 /* This is from mozilla java, do we really need it? */
 #if 0
 #include <jri.h>
@@ -154,12 +149,9 @@ NPError NPP_SetValue( NPP instance, NPNVariable variable, void *value )
  * Mac-only API calls
  *****************************************************************************/
 #ifdef XP_MACOSX
-int16 NPP_HandleEvent( NPP instance, void * event )
+int16_t NPP_HandleEvent( NPP instance, void * event )
 {
     static UInt32 lastMouseUp = 0;
-    libvlc_exception_t ex;
-    libvlc_exception_init(&ex);
-
     if( instance == NULL )
     {
         return false;
@@ -182,8 +174,7 @@ int16 NPP_HandleEvent( NPP instance, void * event )
             if( (myEvent->when - lastMouseUp) < GetDblTime() )
             {
                 /* double click */
-                p_plugin->toggle_fullscreen(&ex);
-                libvlc_exception_clear(&ex);
+                p_plugin->toggle_fullscreen();
             }
             return true;
         }
@@ -201,24 +192,23 @@ int16 NPP_HandleEvent( NPP instance, void * event )
             {
                 bool hasVout = false;
 
-                if( p_plugin->playlist_isplaying(&ex) )
+                if( p_plugin->playlist_isplaying() )
                 {
-                    hasVout = p_plugin->player_has_vout(NULL);
+                    hasVout = p_plugin->player_has_vout();
+#if 0
                     if( hasVout )
                     {
-#ifdef NOT_WORKING
                         libvlc_rectangle_t area;
                         area.left = 0;
                         area.top = 0;
                         area.right = npwindow.width;
                         area.bottom = npwindow.height;
-                        libvlc_video_redraw_rectangle(p_plugin->getMD(&ex), &area, NULL);
+                        libvlc_video_redraw_rectangle(p_plugin->getMD(), &area, NULL);
+                    }
 #else
 #warning disabled code
 #endif
-                    }
                 }
-                libvlc_exception_clear(&ex);
 
                 if( ! hasVout )
                 {
@@ -277,17 +267,24 @@ NPError NPP_Initialize( void )
     return NPERR_NO_ERROR;
 }
 
+#ifdef OJI
 jref NPP_GetJavaClass( void )
 {
     return NULL;
 }
+#endif
 
 void NPP_Shutdown( void )
 {
     ;
 }
 
-NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
+NPError NPP_New( NPMIMEType pluginType, NPP instance,
+#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
+                 uint16 mode, int16 argc,
+#else
+                 uint16_t mode, int16_t argc,
+#endif
                  char* argn[], char* argv[], NPSavedData* saved )
 {
     NPError status;
@@ -372,9 +369,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
     control = p_plugin->getControlWindow();
 #endif
 
-    libvlc_exception_t ex;
-    libvlc_exception_init(&ex);
-
     libvlc_instance_t *p_vlc = p_plugin->getVLC();
 
     /*
@@ -413,11 +407,10 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
         clip.bottom  = window->clipRect.bottom;
         clip.right   = window->clipRect.right;
 #ifdef NOT_WORKING
-        libvlc_video_set_viewport(p_vlc, p_plugin->getMD(&ex), &view, &clip, &ex);
-        libvlc_exception_clear(&ex);
+        libvlc_video_set_viewport(p_vlc, p_plugin->getMD(), &view, &clip);
 #else
 #warning disabled code
-#endif        
+#endif
         /* remember new window */
         p_plugin->setWindow(*window);
     }
@@ -548,12 +541,11 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
     {
         if( p_plugin->psz_target )
         {
-            if( p_plugin->playlist_add( p_plugin->psz_target, NULL ) != -1 )
+            if( p_plugin->playlist_add( p_plugin->psz_target ) != -1 )
             {
                 if( p_plugin->b_autoplay )
                 {
-                    p_plugin->playlist_play(&ex);
-                    libvlc_exception_clear(&ex);
+                    p_plugin->playlist_play();
                 }
             }
             p_plugin->b_stream = true;
@@ -563,7 +555,11 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
 }
 
 NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream *stream,
+#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
                        NPBool seekable, uint16 *stype )
+#else
+                       NPBool seekable, uint16_t *stype )
+#endif
 {
     if( NULL == instance  )
     {
@@ -592,14 +588,23 @@ NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream *stream,
     return NPERR_GENERIC_ERROR;
 }
 
+#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
 int32 NPP_WriteReady( NPP instance, NPStream *stream )
+#else
+int32_t NPP_WriteReady( NPP instance, NPStream *stream )
+#endif
 {
     /* TODO */
     return 8*1024;
 }
 
+#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
 int32 NPP_Write( NPP instance, NPStream *stream, int32 offset,
                  int32 len, void *buffer )
+#else
+int32_t NPP_Write( NPP instance, NPStream *stream, int32_t offset,
+                 int32_t len, void *buffer )
+#endif
 {
     /* TODO */
     return len;
@@ -627,11 +632,11 @@ void NPP_StreamAsFile( NPP instance, NPStream *stream, const char* fname )
         return;
     }
 
-    if( p_plugin->playlist_add( stream->url, NULL ) != -1 )
+    if( p_plugin->playlist_add( stream->url ) != -1 )
     {
         if( p_plugin->b_autoplay )
         {
-            p_plugin->playlist_play(NULL);
+            p_plugin->playlist_play();
         }
     }
 }
@@ -806,11 +811,8 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
     if( p_plugin && p_plugin->b_toolbar )
     {
         int i_playing;
-        libvlc_exception_t ex;
 
-        libvlc_exception_init( &ex );
-        libvlc_media_player_t *p_md = p_plugin->getMD(&ex);
-        libvlc_exception_clear( &ex );
+        libvlc_media_player_t *p_md = p_plugin->getMD();
 
         i_playing = p_plugin->playlist_isplaying();
 
@@ -822,11 +824,9 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
             case clicked_Pause:
             {
                 if( i_playing == 1 )
-                    p_plugin->playlist_pause( &ex );
+                    p_plugin->playlist_pause();
                 else
-                    p_plugin->playlist_play( &ex );
-
-                libvlc_exception_clear( &ex );
+                    p_plugin->playlist_play();
             }
             break;
 
@@ -838,15 +838,15 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
 
             case clicked_Fullscreen:
             {
-                p_plugin->set_fullscreen( 1, &ex );
-                libvlc_exception_clear( &ex );
+                p_plugin->set_fullscreen( 1 );
             }
             break;
 
             case clicked_Mute:
             case clicked_Unmute:
             {
-                libvlc_audio_toggle_mute( p_plugin->getVLC() );
+                if( p_md )
+                    libvlc_audio_toggle_mute( p_md );
             }
             break;
 
@@ -856,14 +856,12 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
                 if( p_md )
                 {
                     int64_t f_length;
-                    f_length = libvlc_media_player_get_length( p_md, &ex ) / 100;
-                    libvlc_exception_clear( &ex );
+                    f_length = libvlc_media_player_get_length( p_md ) / 100;
 
                     f_length = (float)f_length *
                             ( ((float)i_xPos-4.0 ) / ( ((float)i_width-8.0)/100) );
 
-                    libvlc_media_player_set_time( p_md, f_length, &ex );
-                    libvlc_exception_clear( &ex );
+                    libvlc_media_player_set_time( p_md, f_length );
                 }
             }
             break;