Index: mozilla/Makefile.am
===================================================================
--- mozilla/Makefile.am	(revision 24408)
+++ mozilla/Makefile.am	(working copy)
@@ -173,7 +173,7 @@
 libvlcplugin_la_CFLAGS = `$(VLC_CONFIG) --cflags mozilla`
 libvlcplugin_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags mozilla`
 libvlcplugin_la_LDFLAGS = `$(VLC_CONFIG) --ldflags mozilla` -module -avoid-version -shrext $(LIBEXT)
-libvlcplugin_la_LIBADD = $(LIBRARIES_libvlc) `$(VLC_CONFIG) -libs mozilla`
+libvlcplugin_la_LIBADD = $(LIBRARIES_libvlc) `$(VLC_CONFIG) -libs mozilla` -lXpm
 # automake gets confused by the ../..
 libvlcplugin_la_DEPENDENCIES = $(AM_LIBADD) 
 endif
Index: mozilla/vlcplugin.h
===================================================================
--- mozilla/vlcplugin.h	(revision 24408)
+++ mozilla/vlcplugin.h	(working copy)
@@ -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 @@
 
 #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 @@
 #endif
 #if XP_UNIX
     unsigned int     i_width, i_height;
+    Window           npvideo, npcontrol;
 #endif
 };
 
@@ -151,6 +161,7 @@
     "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: mozilla/vlcshell.cpp
===================================================================
--- mozilla/vlcshell.cpp	(revision 24408)
+++ mozilla/vlcshell.cpp	(working copy)
@@ -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
@@ -475,22 +478,48 @@
 #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 );
 
+            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_exception_t ex;
+            libvlc_exception_init(&ex);
+            libvlc_media_instance_t *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->setVideoWindow(video);//ADD BY FRANS @24-dec-07
+            p_plugin->setControlWindow(controls);//ADD BY FRANS @24-dec-07
 
             Redraw( w, (XtPointer)p_plugin, NULL );
         }
@@ -725,30 +754,175 @@
     GC gc;
     XGCValues gcv;
 
-    Window  drawable   = (Window) window.window;
+    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);
+    libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);
+    libvlc_exception_clear(&ex);
+
+    /* get isplaying */
+    libvlc_exception_init(&ex);    
+    int i_playing = libvlc_playlist_isplaying(p_plugin->getVLC(), &ex);
+    libvlc_exception_clear(&ex);
+
+    /* get mute info */
+    libvlc_exception_init(&ex);    
+    bool b_mute = libvlc_audio_get_mute(p_plugin->getVLC(), &ex);
+    libvlc_exception_clear(&ex);
+
+    /* get movie position */
+    float f_position = 0;
+    if(i_playing == 1){
+        libvlc_exception_init(&ex);
+        f_position = libvlc_media_instance_get_position(p_md, &ex)*100;//postion in %
+        libvlc_exception_clear(&ex);
+    }
+    libvlc_media_instance_release(p_md);
+ 
+    /* load icons */
+    XImage *p_playIcon, *p_pauseIcon, *p_stopIcon, *p_timeline, *p_timeKnop, *p_fscreen, *p_muteIcon, *p_unmuteIcon;   
+    if(XpmReadFileToImage( p_display, "/usr/src/redhat/BUILD/vlc-trunk/mozilla/image/play.xpm", &p_playIcon, NULL,
+                            NULL)){printf("Error: playImage not found\n");}
+    if(XpmReadFileToImage( p_display, "/usr/src/redhat/BUILD/vlc-trunk/mozilla/image/pause.xpm", &p_pauseIcon, NULL,
+                            NULL)){printf("Error: pauseImage not found\n");}
+    if(XpmReadFileToImage( p_display, "/usr/src/redhat/BUILD/vlc-trunk/mozilla/image/stop.xpm", &p_stopIcon, NULL,      
+                            NULL)){printf("Error: stopImage not found\n");}
+    if(XpmReadFileToImage( p_display, "/usr/src/redhat/BUILD/vlc-trunk/mozilla/image/time_line.xpm",           
+                            &p_timeline, NULL, NULL)){printf("Error: TimeLineImage not found\n");}
+    if(XpmReadFileToImage( p_display, "/usr/src/redhat/BUILD/vlc-trunk/mozilla/image/time_icon.xpm", &p_timeKnop, 
+                            NULL, NULL)){printf("Error: TimeIcon not found\n");}
+    if(XpmReadFileToImage( p_display, "/usr/src/redhat/BUILD/vlc-trunk/mozilla/image/fullscreen.xpm", &p_fscreen, 
+                            NULL, NULL)){printf("Error: FullscreenImage not found\n");}    
+    if(XpmReadFileToImage( p_display, "/usr/src/redhat/BUILD/vlc-trunk/mozilla/image/volume_max.xpm", &p_muteIcon, NULL,
+                            NULL)){printf("Error: MuteImage not found\n");}
+    if(XpmReadFileToImage( p_display, "/usr/src/redhat/BUILD/vlc-trunk/mozilla/image/volume_mute.xpm", &p_unmuteIcon, 
+                            NULL, NULL)){printf("Error: UnMuteImage not found\n");}
+
+    /* position icons */
+    if(i_playing == 1) {
+        XPutImage( p_display, control, gc, p_pauseIcon, 0, 0, 4, 14, p_pauseIcon->width, p_pauseIcon->height);
+    }else{
+        XPutImage( p_display, control, gc, p_playIcon, 0, 0, 4, 14, p_playIcon->width, p_playIcon->height);
+    }
+    XPutImage( p_display, control, gc, p_stopIcon, 0, 0, 39, 14, p_stopIcon->width, p_stopIcon->height);
+    XPutImage( p_display, control, gc, p_fscreen, 0, 0, 67, 21, p_fscreen->width, p_fscreen->height);
+    if(b_mute) {
+        XPutImage( p_display, control, gc, p_unmuteIcon, 0, 0, 94, 30, p_unmuteIcon->width, p_unmuteIcon->height);
+    }else{
+        XPutImage( p_display, control, gc, p_muteIcon, 0, 0, 94, 30, p_muteIcon->width, p_muteIcon->height);
+    }
+    XPutImage( p_display, control, gc, p_timeline, 0, 0, 4, 4, (window.width-8), p_timeline->height);
+    if(f_position > 0){
+        f_position = (((float)window.width-8)/100)*f_position;
+        XPutImage( p_display, control, gc, p_timeKnop, 0, 0, (4+f_position), 2, p_timeKnop->width, p_timeKnop->height);
+    }
+
     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)){
+        libvlc_exception_init(&ex);
+        vlc_int64_t 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){
+        libvlc_exception_init(&ex);
+        int 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 +942,14 @@
     }
 #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 +981,7 @@
 #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,
