Patch by Frans van Veen and Jasper Alias with modifications by me.
authorJean-Paul Saman <jpsaman@videolan.org>
Sat, 19 Jan 2008 14:54:38 +0000 (14:54 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Sat, 19 Jan 2008 14:54:38 +0000 (14:54 +0000)
New;
- Mozilla/firefox toolbar for Linux
- Play, Pause, Stop, Fullscreen and Mute buttons
- Timeline, you can click on any place in the timeline and the movie will jump to it

Fixed:
- Coding style, readibility
- Maximum 80 characters per line
- Major memory leak, due to not releasing image data

Known bugs:
- updating timeline not working well because callback function not working "libvlc_event_attach......"
- white line below the toolbar
- play/pause toggle not working well because ticket #1065

16 files changed:
THANKS
configure.ac
mozilla/vlcplugin.h
mozilla/vlcshell.cpp
share/mozilla/fullscreen.xpm [new file with mode: 0644]
share/mozilla/pause.xpm [new file with mode: 0644]
share/mozilla/play.xpm [new file with mode: 0644]
share/mozilla/skip_next.xpm [new file with mode: 0644]
share/mozilla/skip_previous.xpm [new file with mode: 0644]
share/mozilla/stop.xpm [new file with mode: 0644]
share/mozilla/time_icon.xpm [new file with mode: 0644]
share/mozilla/time_line.xpm [new file with mode: 0644]
share/mozilla/volume_knob.xpm [new file with mode: 0644]
share/mozilla/volume_max.xpm [new file with mode: 0644]
share/mozilla/volume_mute.xpm [new file with mode: 0644]
share/mozilla/volume_slider_bar.xpm [new file with mode: 0644]

diff --git a/THANKS b/THANKS
index ee3efe8..1616409 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -84,6 +84,7 @@ Farzaneh Sarafraz <farzaneh at farsiweb dot info> - Persian localisation
 Fouzia Bourai <fbourai at cerist dot dz> - Arabic localisation
 Fran├žois Seingier <francois.seingier at club-internet.fr> - TTL setting in the wx stream output dialog
 Frank Chao <frank0624 at gmail.com> - Chinese Traditional translation
+Frans van Veen <f.m.j.c.vanveen at student.hhs.nl> - Mozilla plugin toolbar
 Fumio Nakayama <endymion at ca2.so-net.ne.jp> - Japanese translation
 Gabor Kelemen <kelemeng at gnome dot hu> - Hungarian translation
 Geoffrey Roussel <meka321 at hotmail dot com> - Christmas easter egg Artwork
@@ -103,8 +104,8 @@ Ilkka Ollakka - SDP bitrate patch, various VLM fixes, transcode afilter/vfilter
 Jan David Mol <jjdmol at gmail.com> - Suggested some flags for ffmpeg building
 Jan Gerber <j at v2v dot org> - patch theora decoding aspect ratio
 Jan Van Boghout <vlc at macrabbit.com> - iTunes like slider for OSX intf
-Javier Varela <tonxabar at hotmail.com> - Spanish translation
-Jean-Alexis Montignies <ja at sente.ch> - coreaudio multiple streams fix
+Jasper Alias <j.alias at student.hhs.nl>- Mozilla plugin toolbar
+Javier Varela <tonxabar at hotmail.com> - Spanish translation Jean-Alexis Montignies <ja at sente.ch> - coreaudio multiple streams fix
 Jean-Baptiste Le Stang <jp.lestand at lestang.org> - Equalizer-GUI-fixes (OSX), Universal Binary Script
 Jean-Philippe Grimaldi <jeanphi at via.ecp.fr> - bug fixes
 Dugal Harris <dugalh at protoclea dot. co dot za > - ActiveX bug fixes
index 50bb045..7a539ea 100644 (file)
@@ -5805,7 +5805,7 @@ then
             MOZILLA_CONFIG_H="${firefox_include}/mozilla-config.h"
         fi
         if grep '^#define MOZ_X11 1' ${MOZILLA_CONFIG_H} 2>&1 > /dev/null ; then
-            VLC_ADD_LIBS([mozilla], [${X_LIBS} ${X_PRE_LIBS} -lX11 -lXt])
+            VLC_ADD_LIBS([mozilla], [${X_LIBS} ${X_PRE_LIBS} -lX11 -lXt -lXpm])
         fi
         VLC_ADD_CPPFLAGS([mozilla],[${CPPFLAGS}])
         VLC_ADD_LDFLAGS([mozilla],[${MOZILLA_LDFLAGS}])
@@ -5842,10 +5842,10 @@ then
         AC_CHECK_LIB(Xt,XtStrings,
          [
            VLC_ADD_CPPFLAGS([mozilla],[${X_CFLAGS}])
-           VLC_ADD_LIBS([mozilla],[${X_LIBS} ${X_PRE_LIBS} -lXt -lX11 -lSM -lICE])
+           VLC_ADD_LIBS([mozilla],[${X_LIBS} ${X_PRE_LIBS} -lXt -lX11 -lSM -lICE -lXpm])
          ],
          [],
-         [[${X_LIBS} ${X_PRE_LIBS} -lX11 -lSM -lICE]
+         [[${X_LIBS} ${X_PRE_LIBS} -lX11 -lSM -lICE -lXpm]
         ])
         LDFLAGS="${LDFLAGS_save}"
       fi
index d9605f7..6d48bf3 100644 (file)
@@ -52,6 +52,7 @@
 #   include <X11/Xlib.h>
 #   include <X11/Intrinsic.h>
 #   include <X11/StringDefs.h>
+#   include <X11/X.h>
 #endif
 
 class VlcPlugin
@@ -87,6 +88,14 @@ public:
 
 #if XP_UNIX
     int                 setSize(unsigned width, unsigned height);
+    Window              getVideoWindow()
+                            { return npvideo; };
+    void                setVideoWindow(Window window)
+                            { npvideo = window; };
+    Window              getControlWindow()
+                            { return npcontrol; };
+    void                setControlWindow(Window window)
+                            { npcontrol = window; };
 #endif
 
     uint16    i_npmode; /* either NP_EMBED or NP_FULL */
@@ -113,6 +122,7 @@ private:
 #endif
 #if XP_UNIX
     unsigned int     i_width, i_height;
+    Window           npvideo, npcontrol;
 #endif
 };
 
@@ -151,6 +161,7 @@ private:
     "video/x-ms-asf:asf,asx:Windows Media Video;" \
     "application/x-mplayer2::Windows Media;" \
     "video/x-ms-wmv:wmv:Windows Media;" \
+    "video/x-ms-wvx:wvx:Windows Media Video;" \
     /* Google VLC */ \
     "application/x-google-vlc-plugin::Google VLC plugin;" \
     /* WAV audio */ \
index 94df4df..eae85ae 100644 (file)
@@ -29,6 +29,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include <X11/xpm.h>
 
 /* Mozilla stuff */
 #ifdef HAVE_MOZILLA_CONFIG_H
@@ -45,7 +46,8 @@
 /* Enable/disable debugging printf's for X11 resizing */
 #undef X11_RESIZE_DEBUG
 
-#define WINDOW_TEXT "(no video)"
+#define WINDOW_TEXT "Video is loading..."
+#define CONTROL_HEIGHT 45
 
 /*****************************************************************************
  * Unix-only declarations
@@ -53,6 +55,7 @@
 #ifdef XP_UNIX
 
 static void Redraw( Widget w, XtPointer closure, XEvent *event );
+static void ControlHandler( Widget w, XtPointer closure, XEvent *event );
 static void Resize( Widget w, XtPointer closure, XEvent *event );
 
 #endif
@@ -184,7 +187,8 @@ int16 NPP_HandleEvent( NPP instance, void * event )
                 {
                     if( libvlc_playlist_isplaying(p_vlc, NULL) )
                     {
-                        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_vlc, NULL);
+                        libvlc_media_instance_t *p_md =
+                            libvlc_playlist_get_media_instance(p_vlc, NULL);
                         if( p_md )
                         {
                             libvlc_toggle_fullscreen(p_md, NULL);
@@ -214,7 +218,8 @@ int16 NPP_HandleEvent( NPP instance, void * event )
                 {
                     if( libvlc_playlist_isplaying(p_vlc, NULL) )
                     {
-                        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_vlc, NULL);
+                        libvlc_media_instance_t *p_md =
+                            libvlc_playlist_get_media_instance(p_vlc, NULL);
                         if( p_md )
                         {
                             hasVout = libvlc_media_instance_has_vout(p_md, NULL);
@@ -240,7 +245,8 @@ int16 NPP_HandleEvent( NPP instance, void * event )
                     PenMode( patCopy );
 
                     /* seems that firefox forgets to set the following on occasion (reload) */
-                    SetOrigin(((NP_Port *)npwindow.window)->portx, ((NP_Port *)npwindow.window)->porty);
+                    SetOrigin(((NP_Port *)npwindow.window)->portx,
+                              ((NP_Port *)npwindow.window)->porty);
 
                     Rect rect;
                     rect.left = 0;
@@ -438,11 +444,12 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
                 SetWindowLong( oldwin, GWL_WNDPROC, (LONG)oldproc );
             }
             /* attach our plugin object */
-            SetWindowLongPtr((HWND)drawable, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(p_plugin));
+            SetWindowLongPtr((HWND)drawable, GWLP_USERDATA,
+                             reinterpret_cast<LONG_PTR>(p_plugin));
 
             /* install our WNDPROC */
             p_plugin->setWindowProc( (WNDPROC)SetWindowLong( drawable,
-                                                           GWL_WNDPROC, (LONG)Manage ) );
+                                             GWL_WNDPROC, (LONG)Manage ) );
 
             /* change window style to our liking */
             LONG style = GetWindowLong((HWND)drawable, GWL_STYLE);
@@ -475,22 +482,56 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
 #ifdef XP_UNIX
     if( window && window->window )
     {
-        Window  drawable   = (Window) window->window;
-        if( !curwin.window || drawable != (Window)curwin.window )
+        Window  parent   = (Window) window->window;
+        if( !curwin.window || (parent != (Window)curwin.window) )
         {
             Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display;
 
-            XResizeWindow( p_display, drawable, window->width, window->height );
-            Widget w = XtWindowToWidget( p_display, drawable );
+            XResizeWindow( p_display, parent, window->width, window->height );
 
-            XtAddEventHandler( w, ExposureMask, FALSE, (XtEventHandler)Redraw, p_plugin );
-            XtAddEventHandler( w, StructureNotifyMask, FALSE, (XtEventHandler)Resize, p_plugin );
+            int i_blackColor = BlackPixel(p_display, DefaultScreen(p_display));
+
+            Window video = XCreateSimpleWindow( p_display, parent, 0, 0,
+                           window->width, window->height - CONTROL_HEIGHT, 0,
+                           i_blackColor, i_blackColor );
+            Window controls = XCreateSimpleWindow( p_display, parent, 0,
+                            window->height - CONTROL_HEIGHT-1, window->width,
+                            CONTROL_HEIGHT-1, 0, i_blackColor, i_blackColor );
+
+            XMapWindow( p_display, parent );
+            XMapWindow( p_display, video );
+            XMapWindow( p_display, controls );
+
+            XFlush(p_display);
+
+            Widget w = XtWindowToWidget( p_display, parent );
+
+            XtAddEventHandler( w, ExposureMask, FALSE,
+                               (XtEventHandler)Redraw, p_plugin );
+            XtAddEventHandler( w, StructureNotifyMask, FALSE,
+                               (XtEventHandler)Resize, p_plugin );
+            XtAddEventHandler( w, ButtonReleaseMask, FALSE,
+                               (XtEventHandler)ControlHandler, p_plugin );
+
+            /* callback */
+/*
+            libvlc_media_instance_t *p_md;
+
+            libvlc_exception_t ex;
+            libvlc_exception_init(& ex );
+            p_md = libvlc_playlist_get_media_instance( p_plugin->getVLC(), &ex );
+            libvlc_exception_init( &ex );
+            libvlc_event_attach( libvlc_media_instance_event_manager( p_md, &ex ),
+                                 libvlc_MediaInstancePositionChanged, Redraw, NULL, &ex );
+*/
 
             /* set/change parent window */
-            libvlc_video_set_parent(p_vlc, (libvlc_drawable_t)drawable, NULL);
+            libvlc_video_set_parent( p_vlc, (libvlc_drawable_t) video, NULL );
 
             /* remember window */
-            p_plugin->setWindow(*window);
+            p_plugin->setWindow( *window );
+            p_plugin->setVideoWindow( video );
+            p_plugin->setControlWindow( controls );
 
             Redraw( w, (XtPointer)p_plugin, NULL );
         }
@@ -507,7 +548,8 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
     {
         if( p_plugin->psz_target )
         {
-            if( libvlc_playlist_add( p_vlc, p_plugin->psz_target, NULL, NULL ) != -1 )
+            if( libvlc_playlist_add( p_vlc, p_plugin->psz_target,
+                                     NULL, NULL ) != -1 )
             {
                 if( p_plugin->b_autoplay )
                 {
@@ -702,7 +744,8 @@ static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpa
             FillRect( hdc, &rect, (HBRUSH)GetStockObject(BLACK_BRUSH) );
             SetTextColor(hdc, RGB(255, 255, 255));
             SetBkColor(hdc, RGB(0, 0, 0));
-            DrawText( hdc, WINDOW_TEXT, strlen(WINDOW_TEXT), &rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE);
+            DrawText( hdc, WINDOW_TEXT, strlen(WINDOW_TEXT), &rect,
+                      DT_CENTER|DT_VCENTER|DT_SINGLELINE);
 
             EndPaint( p_hwnd, &paintstruct );
             return 0L;
@@ -725,30 +768,261 @@ static void Redraw( Widget w, XtPointer closure, XEvent *event )
     GC gc;
     XGCValues gcv;
 
-    Window  drawable   = (Window) window.window;
+    /* Toolbar */
+    XImage *p_playIcon = NULL;
+    XImage *p_pauseIcon = NULL;
+    XImage *p_stopIcon = NULL;
+    XImage *p_timeline = NULL;
+    XImage *p_timeKnob = NULL;
+    XImage *p_fscreen = NULL;
+    XImage *p_muteIcon = NULL;
+    XImage *p_unmuteIcon = NULL;
+
+    libvlc_media_instance_t *p_md = NULL;
+    float f_position = 0;
+    int i_playing = 0;
+    bool b_mute = false;
+
+    Window video = p_plugin->getVideoWindow();
+    Window control = p_plugin->getControlWindow();
     Display *p_display = ((NPSetWindowCallbackStruct *)window.ws_info)->display;
 
     gcv.foreground = BlackPixel( p_display, 0 );
-    gc = XCreateGC( p_display, drawable, GCForeground, &gcv );
+    gc = XCreateGC( p_display, video, GCForeground, &gcv );
 
-    XFillRectangle( p_display, drawable, gc,
-                    0, 0, window.width, window.height );
+    XFillRectangle( p_display, video, gc,
+                    0, 0, window.width, window.height - CONTROL_HEIGHT );
 
     gcv.foreground = WhitePixel( p_display, 0 );
     XChangeGC( p_display, gc, GCForeground, &gcv );
 
-    XDrawString( p_display, drawable, gc,
-                 window.width / 2 - 40, window.height / 2,
+    XDrawString( p_display, video, gc,
+                 window.width / 2 - 40, (window.height - CONTROL_HEIGHT) / 2,
                  WINDOW_TEXT, strlen(WINDOW_TEXT) );
 
+    /* RedrawToolbar */
+    gcv.foreground = BlackPixel( p_display, 0 );
+    gc = XCreateGC( p_display, control, GCForeground, &gcv );
+
+    XFillRectangle( p_display, control, gc,
+                    0, 0, window.width, CONTROL_HEIGHT );
+
+
+    gcv.foreground = WhitePixel( p_display, 0 );
+    XChangeGC( p_display, gc, GCForeground, &gcv );
+
+    /* get media instance */
+    libvlc_exception_t ex;
+    libvlc_exception_init( &ex );
+    p_md = libvlc_playlist_get_media_instance( p_plugin->getVLC(), &ex );
+    libvlc_exception_clear( &ex );
+
+    /* get isplaying */
+    libvlc_exception_init( &ex );
+    i_playing = libvlc_playlist_isplaying( p_plugin->getVLC(), &ex );
+    libvlc_exception_clear( &ex );
+
+    /* get mute info */
+    libvlc_exception_init(&ex);
+    b_mute = libvlc_audio_get_mute( p_plugin->getVLC(), &ex );
+    libvlc_exception_clear( &ex );
+
+    /* get movie position in % */
+    if( i_playing == 1 )
+    {
+        libvlc_exception_init( &ex );
+        f_position = libvlc_media_instance_get_position(p_md, &ex)*100;
+        libvlc_exception_clear( &ex );
+    }
+    libvlc_media_instance_release(p_md);
+
+    /* load icons */
+    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/play.xpm",
+                        &p_playIcon, NULL, NULL);
+    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/pause.xpm",
+                        &p_pauseIcon, NULL, NULL);
+    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/stop.xpm",
+                        &p_stopIcon, NULL, NULL );
+    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/time_line.xpm",
+                        &p_timeline, NULL, NULL);
+    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/time_icon.xpm",
+                        &p_timeKnob, NULL, NULL);
+    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/fullscreen.xpm",
+                        &p_fscreen, NULL, NULL);
+    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/volume_max.xpm",
+                        &p_muteIcon, NULL, NULL);
+    XpmReadFileToImage( p_display, "/usr/share/vlc/mozilla/volume_mute.xpm",
+                        &p_unmuteIcon, NULL, NULL);
+
+#if 1 /* DEBUG */
+    if( !p_playIcon )
+    {
+        fprintf(stderr, "Error: playImage not found\n");
+    }
+    if( !p_pauseIcon )
+    {
+        fprintf(stderr, "Error: pauseImage not found\n");
+    }
+    if( !p_stopIcon )
+    {
+        fprintf(stderr, "Error: stopImage not found\n");
+    }
+    if( !p_timeline )
+    {
+        fprintf(stderr, "Error: TimeLineImage not found\n");
+    }
+    if( !p_timeKnob )
+    {
+        fprintf(stderr, "Error: TimeIcon not found\n");
+    }
+    if( !p_fscreen )
+    {
+        fprintf(stderr, "Error: FullscreenImage not found\n");
+    }
+    if( !p_muteIcon )
+    {
+        fprintf(stderr, "Error: MuteImage not found\n");
+    }
+    if( !p_unmuteIcon )
+    {
+        fprintf(stderr, "Error: UnMuteImage not found\n");
+    }
+#endif
+
+    /* position icons */
+    if( p_pauseIcon && (i_playing == 1) )
+    {
+        XPutImage( p_display, control, gc, p_pauseIcon, 0, 0, 4, 14,
+                   p_pauseIcon->width, p_pauseIcon->height );
+    }
+    else if( p_playIcon )
+    {
+        XPutImage( p_display, control, gc, p_playIcon, 0, 0, 4, 14,
+                   p_playIcon->width, p_playIcon->height );
+    }
+
+    if( p_stopIcon )
+        XPutImage( p_display, control, gc, p_stopIcon, 0, 0, 39, 14,
+                   p_stopIcon->width, p_stopIcon->height );
+    if( p_fscreen )
+        XPutImage( p_display, control, gc, p_fscreen, 0, 0, 67, 21,
+                   p_fscreen->width, p_fscreen->height );
+
+    if( p_unmuteIcon && b_mute )
+    {
+        XPutImage( p_display, control, gc, p_unmuteIcon, 0, 0, 94, 30,
+                 p_unmuteIcon->width, p_unmuteIcon->height );
+    }
+    else if( p_muteIcon )
+    {
+        XPutImage( p_display, control, gc, p_muteIcon, 0, 0, 94, 30,
+                   p_muteIcon->width, p_muteIcon->height );
+    }
+
+    if( p_timeline )
+        XPutImage( p_display, control, gc, p_timeline, 0, 0, 4, 4,
+                   (window.width-8), p_timeline->height );
+    if( p_timeKnob && (f_position > 0) )
+    {
+        f_position = (((float)window.width-8)/100)*f_position;
+        XPutImage( p_display, control, gc, p_timeKnob, 0, 0, (4+f_position), 2,
+                   p_timeKnob->width, p_timeKnob->height );
+    }
+
+    /* Cleanup */
+    if( p_playIcon )   XDestroyImage( p_playIcon );
+    if( p_pauseIcon )  XDestroyImage( p_pauseIcon );
+    if( p_stopIcon )   XDestroyImage( p_stopIcon );
+    if( p_timeline )   XDestroyImage( p_timeline );
+    if( p_timeKnob )   XDestroyImage( p_timeKnob );
+    if( p_fscreen )    XDestroyImage( p_fscreen );
+    if( p_muteIcon )   XDestroyImage( p_muteIcon );
+    if( p_unmuteIcon ) XDestroyImage( p_unmuteIcon );
+
     XFreeGC( p_display, gc );
 }
 
+static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
+{
+    VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure);
+    const NPWindow& window = p_plugin->getWindow();
+
+    int i_height = window.height;
+    int i_width = window.width;
+    int i_xPos = event->xbutton.x;
+    int i_yPos = event->xbutton.y;
+
+    libvlc_exception_t ex;
+    libvlc_exception_init( &ex );
+    libvlc_media_instance_t *p_md =
+            libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);
+    libvlc_exception_clear( &ex );
+
+    /* jump in the movie */
+    if( i_yPos <= (i_height-30) )
+    {
+        vlc_int64_t f_length;
+        libvlc_exception_init( &ex );
+        f_length = libvlc_media_instance_get_length( p_md, &ex ) / 100;
+        libvlc_exception_clear( &ex );
+
+        f_length = (float)f_length *
+                   ( ((float)i_xPos-4 ) / ( ((float)i_width-8)/100) );
+
+        libvlc_exception_init( &ex );
+        libvlc_media_instance_set_time( p_md, f_length, &ex );
+        libvlc_exception_clear( &ex );
+    }
+
+    /* play/pause toggle */
+    if( (i_yPos > (i_height-30)) && (i_xPos > 4) && (i_xPos <= 39) )
+    {
+        int i_playing;
+        libvlc_exception_init( &ex );
+        i_playing = libvlc_playlist_isplaying( p_plugin->getVLC(), &ex );
+        libvlc_exception_clear( &ex );
+
+        libvlc_exception_init( &ex );
+        if( i_playing == 1 )
+            libvlc_playlist_pause( p_plugin->getVLC(), &ex );
+        else
+            libvlc_playlist_play( p_plugin->getVLC(), -1, 0, NULL, &ex );
+        libvlc_exception_clear( &ex );
+    }
+
+    /* stop */
+    if( (i_yPos > (i_height-30)) && (i_xPos > 39) && (i_xPos < 67) )
+    {
+        libvlc_exception_init( &ex );
+        libvlc_playlist_stop( p_plugin->getVLC(), &ex );
+        libvlc_exception_clear( &ex );
+    }
+
+    /* fullscreen */
+    if( (i_yPos > (i_height-30)) && (i_xPos >= 67) && (i_xPos < 94) )
+    {
+        libvlc_exception_init( &ex );
+        libvlc_set_fullscreen( p_md, 1, &ex );
+        libvlc_exception_clear( &ex );
+    }
+
+    /* mute toggle */
+    if( (i_yPos > (i_height-30)) && (i_xPos >= 94) && (i_xPos < 109))
+    {
+        libvlc_exception_init( &ex );
+        libvlc_audio_toggle_mute( p_plugin->getVLC(), &ex );
+        libvlc_exception_clear( &ex );
+    }
+    libvlc_media_instance_release( p_md );
+
+    Redraw( w, closure, event );
+}
+
 static void Resize ( Widget w, XtPointer closure, XEvent *event )
 {
     VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure);
     const NPWindow& window = p_plugin->getWindow();
-    Window  drawable   = (Window) window.window;
+    Window  drawable   = p_plugin->getVideoWindow();
     Display *p_display = ((NPSetWindowCallbackStruct *)window.ws_info)->display;
 
     int i_ret;
@@ -768,14 +1042,14 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
     }
 #endif /* X11_RESIZE_DEBUG */
 
-    if( ! p_plugin->setSize(window.width, window.height) )
+    if( ! p_plugin->setSize(window.width, (window.height - CONTROL_HEIGHT)) )
     {
         /* size already set */
         return;
     }
 
 
-    i_ret = XResizeWindow( p_display, drawable, window.width, window.height );
+    i_ret = XResizeWindow( p_display, drawable, window.width, (window.height - CONTROL_HEIGHT) );
 
 #ifdef X11_RESIZE_DEBUG
     fprintf( stderr,
@@ -807,7 +1081,7 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
 #endif /* X11_RESIZE_DEBUG */
 
         i_ret = XResizeWindow( p_display, base_window,
-                window.width, window.height );
+                window.width, ( window.height - CONTROL_HEIGHT ) );
 
 #ifdef X11_RESIZE_DEBUG
         fprintf( stderr,
diff --git a/share/mozilla/fullscreen.xpm b/share/mozilla/fullscreen.xpm
new file mode 100644 (file)
index 0000000..a751e03
--- /dev/null
@@ -0,0 +1,28 @@
+/* XPM */
+static char * fullscreen_xpm[] = {
+"26 20 5 1",
+"      c None",
+".     c #999999",
+"+     c #989898",
+"@     c #9A9A9A",
+"#     c #9B9B9B",
+" .                      . ",
+"... .                . ...",
+" ....                .... ",
+"  ...                ...  ",
+" ....   +.+@+.@@..#  .... ",
+"     ................     ",
+"     ...............@     ",
+"     ................     ",
+"     ................     ",
+"     ................     ",
+"     ................     ",
+"     ................     ",
+"     ................     ",
+"     ................     ",
+"     ................     ",
+" ....   .@+....@.@   .... ",
+"  ...                ...  ",
+" ....                .... ",
+"... .                . ...",
+" .                      . "};
diff --git a/share/mozilla/pause.xpm b/share/mozilla/pause.xpm
new file mode 100644 (file)
index 0000000..2c530af
--- /dev/null
@@ -0,0 +1,33 @@
+/* XPM */
+static char * pause_xpm[] = {
+"33 27 3 1",
+"+     c None",
+".     c #999999",
+"*     c #FFFFFF",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++.............",
+".............+++++++............."};
diff --git a/share/mozilla/play.xpm b/share/mozilla/play.xpm
new file mode 100644 (file)
index 0000000..8fb2680
--- /dev/null
@@ -0,0 +1,33 @@
+/* XPM */
+static char * play_xpm[] = {
+"34 27 3 1",
+"+     c None",
+".     c #999999",
+"*     c #FFFFFF",
+".+++++++++++++++++++++++++++++++++",
+"....++++++++++++++++++++++++++++++",
+"......++++++++++++++++++++++++++++",
+".........+++++++++++++++++++++++++",
+"...........+++++++++++++++++++++++",
+"..............++++++++++++++++++++",
+"................++++++++++++++++++",
+"...................+++++++++++++++",
+".....................+++++++++++++",
+"........................++++++++++",
+"..........................++++++++",
+".............................+++++",
+"...............................+++",
+".................................+",
+"...............................+++",
+".............................+++++",
+"..........................++++++++",
+"........................++++++++++",
+".....................+++++++++++++",
+"...................+++++++++++++++",
+"................++++++++++++++++++",
+"..............++++++++++++++++++++",
+"...........+++++++++++++++++++++++",
+".........+++++++++++++++++++++++++",
+"......++++++++++++++++++++++++++++",
+"....++++++++++++++++++++++++++++++",
+".+++++++++++++++++++++++++++++++++"};
diff --git a/share/mozilla/skip_next.xpm b/share/mozilla/skip_next.xpm
new file mode 100644 (file)
index 0000000..452e483
--- /dev/null
@@ -0,0 +1,23 @@
+/* XPM */
+static char * skip_next_xpm[] = {
+"30 18 2 1",
+"      c None",
+".     c #999999",
+".             .             ..",
+"..            ..            ..",
+"....          ....          ..",
+".....         ......        ..",
+".......       .......       ..",
+".........     .........     ..",
+"..........    ..........    ..",
+"............  ............  ..",
+"............. ................",
+"............. ............. ..",
+"............  ............  ..",
+"..........    ..........    ..",
+".........     .........     ..",
+".......       .......       ..",
+"......        .....         ..",
+"....          ....          ..",
+"..            ..            ..",
+".             .             .."};
diff --git a/share/mozilla/skip_previous.xpm b/share/mozilla/skip_previous.xpm
new file mode 100644 (file)
index 0000000..710aeea
--- /dev/null
@@ -0,0 +1,23 @@
+/* XPM */
+static char * skip_previous_xpm[] = {
+"30 18 2 1",
+"      c None",
+".     c #999999",
+"..             .             .",
+"..            ..            ..",
+"..          ....          ....",
+"..        ......        ......",
+"..       .......       .......",
+"..     .........     .........",
+"..    ..........    ..........",
+"..  ............  ............",
+".. ............. .............",
+".. ............. .............",
+"..  ............  ............",
+"..    ..........    ..........",
+"..     .........     .........",
+"..       .......       .......",
+"..        ......        ......",
+"..          ....          ....",
+"..            ..            ..",
+"..             .             ."};
diff --git a/share/mozilla/stop.xpm b/share/mozilla/stop.xpm
new file mode 100644 (file)
index 0000000..2ecfaa7
--- /dev/null
@@ -0,0 +1,32 @@
+/* XPM */
+static char * fs_stop_xpm[] = {
+"27 27 2 1",
+"      c None",
+".     c #999999",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"...........................",
+"..........................."};
diff --git a/share/mozilla/time_icon.xpm b/share/mozilla/time_icon.xpm
new file mode 100644 (file)
index 0000000..eb5c4d5
--- /dev/null
@@ -0,0 +1,12 @@
+/* XPM */
+static char * time_slider_knob_xpm[] = {
+"8 6 3 1",
+"      c None",
+".     c #999999",
+"*     c #999999",
+"  *..*  ",
+" *....* ",
+"*......*",
+"*......*",
+" *....* ",
+"  *..*  "};
diff --git a/share/mozilla/time_line.xpm b/share/mozilla/time_line.xpm
new file mode 100644 (file)
index 0000000..cfd9864
--- /dev/null
@@ -0,0 +1,7 @@
+/* XPM */
+static char * time_line2_xpm[] = {
+"518 2 2 1",
+"      c None",
+".     c #999999",
+"......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
+"......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................"};
diff --git a/share/mozilla/volume_knob.xpm b/share/mozilla/volume_knob.xpm
new file mode 100644 (file)
index 0000000..824f6f9
--- /dev/null
@@ -0,0 +1,22 @@
+/* XPM */
+static char * volume_knob_xpm[] = {
+"9 9 10 1",
+"      c None",
+".     c #989898",
+"+     c #999999",
+"@     c #8D8D8D",
+"#     c #7A7A7A",
+"$     c #686868",
+"%     c #272727",
+"&     c #262626",
+"*     c #2F2F2F",
+"=     c #585858",
+"   ...   ",
+" .+@#@+. ",
+" +$%&%$+ ",
+".@%*=*%@.",
+".#&=+=&#.",
+".@%*=*%@.",
+" +$%&%$+ ",
+" .+@#@+. ",
+"   ...   "};
diff --git a/share/mozilla/volume_max.xpm b/share/mozilla/volume_max.xpm
new file mode 100644 (file)
index 0000000..41a4574
--- /dev/null
@@ -0,0 +1,19 @@
+/* XPM */
+static char * volume_max_xpm[] = {
+"15 13 3 1",
+"      c None",
+".     c #999999",
+"+     c #9A9A9A",
+"               ",
+"      .     .  ",
+"     ..      . ",
+"    ...   .  . ",
+"  .....    .  .",
+".......  + .  .",
+".......  +    .",
+".......  + +  .",
+"   ....    .  .",
+"    ...   +  . ",
+"     ..      . ",
+"            .  ",
+"               "};
diff --git a/share/mozilla/volume_mute.xpm b/share/mozilla/volume_mute.xpm
new file mode 100644 (file)
index 0000000..65eb2d3
--- /dev/null
@@ -0,0 +1,16 @@
+/* XPM */
+static char * volume_mute_xpm[] = {
+"7 11 2 1",
+"      c None",
+".     c #999999",
+"      .",
+"     ..",
+"    ...",
+"   ....",
+".......",
+".......",
+".......",
+"  .....",
+"    ...",
+"     ..",
+"      ."};
diff --git a/share/mozilla/volume_slider_bar.xpm b/share/mozilla/volume_slider_bar.xpm
new file mode 100644 (file)
index 0000000..3077bb8
--- /dev/null
@@ -0,0 +1,7 @@
+/* XPM */
+static char * volume_slider_bar_xpm[] = {
+"95 2 2 1",
+"      c None",
+".     c #999999",
+" ............................................................................................. ",
+" ............................................................................................. "};