]> git.sesse.net Git - vlc/blobdiff - modules/gui/beos/VideoOutput.cpp
modules/gui/beos/*: fixed a few things I broke recently (dvd menus,
[vlc] / modules / gui / beos / VideoOutput.cpp
index a7fbc889bf28d5e2f21383fe3951846b3f1587ff..8b76614907584cec040066a604a54fc4826264ef 100644 (file)
@@ -2,7 +2,7 @@
  * vout_beos.cpp: beos video output display method
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: VideoOutput.cpp,v 1.5 2002/10/30 00:59:22 titer Exp $
+ * $Id: VideoOutput.cpp,v 1.18 2003/05/07 14:49:19 titer Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
 #include <Application.h>
 #include <BitmapStream.h>
 #include <Bitmap.h>
+#include <Directory.h>
 #include <DirectWindow.h>
 #include <File.h>
 #include <InterfaceKit.h>
 #include <NodeInfo.h>
 #include <String.h>
 #include <TranslatorRoster.h>
+#include <WindowScreen.h>
 
 /* VLC headers */
 #include <vlc/vlc.h>
 #include <vlc/intf.h>
 #include <vlc/vout.h>
 
-#include "VideoWindow.h"
+#include "InterfaceWindow.h"   // for load/save_settings()
 #include "DrawingTidbits.h"
 #include "MsgVals.h"
 
+#include "VideoWindow.h"
+
 /*****************************************************************************
  * vout_sys_t: BeOS video output method descriptor
  *****************************************************************************
@@ -109,7 +113,7 @@ beos_GetAppWindow(char *name)
 BWindow*
 get_interface_window()
 {
-       return beos_GetAppWindow(VOUT_TITLE);
+       return beos_GetAppWindow( "VLC " PACKAGE_VERSION );
 }
 
 class BackgroundView : public BView
@@ -147,6 +151,99 @@ class BackgroundView : public BView
        VLCView*                                fVideoView;
 };
 
+
+/*****************************************************************************
+ * VideoSettings constructor and destructor
+ *****************************************************************************/
+VideoSettings::VideoSettings()
+       : fVideoSize( SIZE_100 ),
+         fFlags( FLAG_CORRECT_RATIO ),
+         fSettings( new BMessage( 'sett' ) )
+{
+       // read settings from disk
+       status_t ret = load_settings( fSettings, "video_settings", "VideoLAN Client" );
+       if ( ret == B_OK )
+       {
+               uint32 flags;
+               if ( fSettings->FindInt32( "flags", (int32*)&flags ) == B_OK )
+                       SetFlags( flags );
+               uint32 size;
+               if ( fSettings->FindInt32( "video size", (int32*)&size ) == B_OK )
+                       SetVideoSize( size );
+       }
+       else
+       {
+               fprintf( stderr, "error loading video settings: %s\n", strerror( ret ) );
+               
+               // figure out if we should use vertical sync by default
+               BScreen screen(B_MAIN_SCREEN_ID);
+               if (screen.IsValid())
+               {
+                       display_mode mode; 
+                       screen.GetMode(&mode); 
+                       float refresh = (mode.timing.pixel_clock * 1000)
+                                                       / ((mode.timing.h_total)* (mode.timing.v_total)); 
+                       if (refresh < MIN_AUTO_VSYNC_REFRESH)
+                               AddFlags(FLAG_SYNC_RETRACE);
+               }
+       }
+}
+
+VideoSettings::VideoSettings( const VideoSettings& clone )
+       : fVideoSize( clone.VideoSize() ),
+         fFlags( clone.Flags() ),
+         fSettings( NULL )
+{
+}
+
+
+VideoSettings::~VideoSettings()
+{
+       if ( fSettings )
+       {
+               // we are the default settings
+               // and write our settings to disk
+               if (fSettings->ReplaceInt32( "video size", VideoSize() ) != B_OK)
+                       fSettings->AddInt32( "video size", VideoSize() );
+               if (fSettings->ReplaceInt32( "flags", Flags() ) != B_OK)
+                       fSettings->AddInt32( "flags", Flags() );
+
+               status_t ret = save_settings( fSettings, "video_settings", "VideoLAN Client" );
+               if ( ret != B_OK )
+                       fprintf( stderr, "error saving video settings: %s\n", strerror( ret ) );
+               delete fSettings;
+       }
+       else
+       {
+               // we are just a clone of the default settings
+               fDefaultSettings.SetVideoSize( VideoSize() );
+               fDefaultSettings.SetFlags( Flags() );
+       }
+}
+
+/*****************************************************************************
+ * VideoSettings::DefaultSettings
+ *****************************************************************************/
+VideoSettings*
+VideoSettings::DefaultSettings()
+{
+       return &fDefaultSettings;
+}
+
+/*****************************************************************************
+ * VideoSettings::SetVideoSize
+ *****************************************************************************/
+void
+VideoSettings::SetVideoSize( uint32 mode )
+{
+       fVideoSize = mode;
+}
+
+// static variable initialization
+VideoSettings
+VideoSettings::fDefaultSettings;
+
+
 /*****************************************************************************
  * VideoWindow constructor and destructor
  *****************************************************************************/
@@ -155,38 +252,26 @@ VideoWindow::VideoWindow(int v_width, int v_height, BRect frame,
        : BWindow(frame, NULL, B_TITLED_WINDOW, B_NOT_CLOSABLE | B_NOT_MINIMIZABLE),
          i_width(frame.IntegerWidth()),
          i_height(frame.IntegerHeight()),
-         is_zoomed(false),
-         vsync(false),
+         winSize(frame),
          i_buffer(0),
          teardownwindow(false),
          fTrueWidth(v_width),
          fTrueHeight(v_height),
-         fCorrectAspect(true),
          fCachedFeel(B_NORMAL_WINDOW_FEEL),
          fInterfaceShowing(false),
-         fInitStatus(B_ERROR)
+         fInitStatus(B_ERROR),
+         fSettings(new VideoSettings(*VideoSettings::DefaultSettings()))
 {
     p_vout = p_videoout;
     
     // create the view to do the display
-    view = new VLCView( Bounds() );
+    view = new VLCView( Bounds(), p_vout );
 
        // create background view
     BView *mainView =  new BackgroundView( Bounds(), view );
     AddChild(mainView);
     mainView->AddChild(view);
 
-       // figure out if we should use vertical sync by default
-       BScreen screen(this);
-       if (screen.IsValid())
-       {
-               display_mode mode; 
-               screen.GetMode(&mode); 
-               float refresh = (mode.timing.pixel_clock * 1000)
-                                               / ((mode.timing.h_total)* (mode.timing.v_total)); 
-               vsync = (refresh < MIN_AUTO_VSYNC_REFRESH);
-       }
-
        // allocate bitmap buffers
        for (int32 i = 0; i < 3; i++)
                bitmap[i] = NULL;
@@ -203,6 +288,25 @@ VideoWindow::VideoWindow(int v_width, int v_height, BRect frame,
        SetSizeLimits((i_width * r.min_width_scale), i_width * r.max_width_scale,
                      (i_height * r.min_height_scale), i_height * r.max_height_scale);
     }
+    
+       // vlc settings override settings from disk
+       if (config_GetInt(p_vout, "fullscreen"))
+               fSettings->AddFlags(VideoSettings::FLAG_FULL_SCREEN);
+
+    // add a few useful shortcuts
+    AddShortcut( 'f', 0, new BMessage( TOGGLE_FULL_SCREEN ) );
+    AddShortcut( '1', 0, new BMessage( RESIZE_50 ) );
+    AddShortcut( '2', 0, new BMessage( RESIZE_100 ) );
+    AddShortcut( '3', 0, new BMessage( RESIZE_200 ) );
+    
+    // workaround for french keyboards
+    fprintf( stderr, "%x\n", '&' );
+    AddShortcut( '&', 0, new BMessage( RESIZE_50 ) );
+    AddShortcut( 'é', 0, new BMessage( RESIZE_100 ) );
+        // FIXME - this one doesn't work because 'é' is a multi-byte character
+    AddShortcut( '"', 0, new BMessage( RESIZE_200 ) );
+    
+    _SetToSettings();
 }
 
 VideoWindow::~VideoWindow()
@@ -212,6 +316,7 @@ VideoWindow::~VideoWindow()
     teardownwindow = true;
     wait_for_thread(fDrawThreadID, &result);
     _FreeBuffers();
+       delete fSettings;
 }
 
 /*****************************************************************************
@@ -228,12 +333,12 @@ VideoWindow::MessageReceived( BMessage *p_message )
                case RESIZE_50:
                case RESIZE_100:
                case RESIZE_200:
-                       if (is_zoomed)
+                       if (IsFullScreen())
                                BWindow::Zoom();
                        _SetVideoSize(p_message->what);
                        break;
                case VERT_SYNC:
-                       vsync = !vsync;
+                       SetSyncToRetrace(!IsSyncedToRetrace());
                        break;
                case WINDOW_FEEL:
                        {
@@ -242,11 +347,15 @@ VideoWindow::MessageReceived( BMessage *p_message )
                                {
                                        SetFeel(winFeel);
                                        fCachedFeel = winFeel;
+                                       if (winFeel == B_FLOATING_ALL_WINDOW_FEEL)
+                                               fSettings->AddFlags(VideoSettings::FLAG_ON_TOP_ALL);
+                                       else
+                                               fSettings->ClearFlags(VideoSettings::FLAG_ON_TOP_ALL);
                                }
                        }
                        break;
                case ASPECT_CORRECT:
-                       SetCorrectAspectRatio(!fCorrectAspect);
+                       SetCorrectAspectRatio(!CorrectAspectRatio());
                        break;
                case SCREEN_SHOT:
                        // save a screen shot
@@ -272,14 +381,16 @@ VideoWindow::MessageReceived( BMessage *p_message )
                                                dst += dstBpr;
                                                src += srcBpr;
                                        }
-                                       _SaveScreenShot( temp,
-                                                                        strdup( DEFAULT_SCREEN_SHOT_PATH ),
-                                                                        DEFAULT_SCREEN_SHOT_FORMAT );
+                                       char* path = config_GetPsz( p_vout, "beos-screenshotpath" );
+                                       if ( !path )
+                                               path = strdup( DEFAULT_SCREEN_SHOT_PATH );
+                                       /* config_GetPsz( p_vout, "beos-screenshotformat" ); */
+                                       int32 format = DEFAULT_SCREEN_SHOT_FORMAT;
+                                       _SaveScreenShot( temp, path, format );
                                }
                                else
                                {
                                        delete temp;
-                                       fprintf( stderr, "error copying bitmaps\n" );
                                }
                        }
                        break;
@@ -295,24 +406,7 @@ VideoWindow::MessageReceived( BMessage *p_message )
 void
 VideoWindow::Zoom(BPoint origin, float width, float height )
 {
-       if(is_zoomed)
-       {
-               MoveTo(winSize.left, winSize.top);
-               ResizeTo(winSize.IntegerWidth(), winSize.IntegerHeight());
-               be_app->ShowCursor();
-               fInterfaceShowing = true;
-       }
-       else
-       {
-               BScreen screen(this);
-               BRect rect = screen.Frame();
-               Activate();
-               MoveTo(0.0, 0.0);
-               ResizeTo(rect.IntegerWidth(), rect.IntegerHeight());
-               be_app->ObscureCursor();
-               fInterfaceShowing = false;
-       }
-       is_zoomed = !is_zoomed;
+       ToggleFullScreen();
 }
 
 /*****************************************************************************
@@ -321,8 +415,9 @@ VideoWindow::Zoom(BPoint origin, float width, float height )
 void
 VideoWindow::FrameMoved(BPoint origin) 
 {
-       if (is_zoomed) return ;
-    winSize = Frame();
+       if (IsFullScreen())
+               return ;
+       winSize = Frame();
 }
 
 /*****************************************************************************
@@ -331,8 +426,8 @@ VideoWindow::FrameMoved(BPoint origin)
 void
 VideoWindow::FrameResized( float width, float height )
 {
-       int32 useWidth = fCorrectAspect ? i_width : fTrueWidth;
-       int32 useHeight = fCorrectAspect ? i_height : fTrueHeight;
+       int32 useWidth = CorrectAspectRatio() ? i_width : fTrueWidth;
+       int32 useHeight = CorrectAspectRatio() ? i_height : fTrueHeight;
     float out_width, out_height;
     float out_left, out_top;
     float width_scale = width / useWidth;
@@ -355,7 +450,7 @@ VideoWindow::FrameResized( float width, float height )
     view->MoveTo(out_left,out_top);
     view->ResizeTo(out_width, out_height);
 
-       if (!is_zoomed)
+       if (!IsFullScreen())
         winSize = Frame();
 }
 
@@ -370,8 +465,7 @@ VideoWindow::ScreenChanged(BRect frame, color_space format)
        screen.GetMode(&mode); 
        float refresh = (mode.timing.pixel_clock * 1000)
                                        / ((mode.timing.h_total) * (mode.timing.v_total)); 
-    if (refresh < MIN_AUTO_VSYNC_REFRESH) 
-        vsync = true; 
+       SetSyncToRetrace(refresh < MIN_AUTO_VSYNC_REFRESH);
 }
 
 /*****************************************************************************
@@ -391,7 +485,7 @@ VideoWindow::drawBuffer(int bufferIndex)
     i_buffer = bufferIndex;
 
     // sync to the screen if required
-    if (vsync)
+    if (IsSyncedToRetrace())
     {
         BScreen screen(this);
         screen.WaitForRetrace(22000);
@@ -460,13 +554,92 @@ VideoWindow::SetInterfaceShowing(bool showIt)
 void
 VideoWindow::SetCorrectAspectRatio(bool doIt)
 {
-       if (fCorrectAspect != doIt)
+       if (CorrectAspectRatio() != doIt)
        {
-               fCorrectAspect = doIt;
+               if (doIt)
+                       fSettings->AddFlags(VideoSettings::FLAG_CORRECT_RATIO);
+               else
+                       fSettings->ClearFlags(VideoSettings::FLAG_CORRECT_RATIO);
                FrameResized(Bounds().Width(), Bounds().Height());
        }
 }
 
+/*****************************************************************************
+ * VideoWindow::CorrectAspectRatio
+ *****************************************************************************/
+bool
+VideoWindow::CorrectAspectRatio() const
+{
+       return fSettings->HasFlags(VideoSettings::FLAG_CORRECT_RATIO);
+}
+
+/*****************************************************************************
+ * VideoWindow::ToggleFullScreen
+ *****************************************************************************/
+void
+VideoWindow::ToggleFullScreen()
+{
+       SetFullScreen(!IsFullScreen());
+}
+
+/*****************************************************************************
+ * VideoWindow::SetFullScreen
+ *****************************************************************************/
+void
+VideoWindow::SetFullScreen(bool doIt)
+{
+       if (doIt)
+       {
+               BScreen screen(this);
+               BRect rect = screen.Frame();
+               Activate();
+               MoveTo(0.0, 0.0);
+               ResizeTo(rect.IntegerWidth(), rect.IntegerHeight());
+               be_app->ObscureCursor();
+               fInterfaceShowing = false;
+               fSettings->AddFlags(VideoSettings::FLAG_FULL_SCREEN);
+       }
+       else
+       {
+               MoveTo(winSize.left, winSize.top);
+               ResizeTo(winSize.IntegerWidth(), winSize.IntegerHeight());
+               be_app->ShowCursor();
+               fInterfaceShowing = true;
+               fSettings->ClearFlags(VideoSettings::FLAG_FULL_SCREEN);
+       }
+}
+
+/*****************************************************************************
+ * VideoWindow::IsFullScreen
+ *****************************************************************************/
+bool
+VideoWindow::IsFullScreen() const
+{
+       return fSettings->HasFlags(VideoSettings::FLAG_FULL_SCREEN);
+}
+
+/*****************************************************************************
+ * VideoWindow::SetSyncToRetrace
+ *****************************************************************************/
+void
+VideoWindow::SetSyncToRetrace(bool doIt)
+{
+       if (doIt)
+               fSettings->AddFlags(VideoSettings::FLAG_SYNC_RETRACE);
+       else
+               fSettings->ClearFlags(VideoSettings::FLAG_SYNC_RETRACE);
+}
+
+/*****************************************************************************
+ * VideoWindow::IsSyncedToRetrace
+ *****************************************************************************/
+bool
+VideoWindow::IsSyncedToRetrace() const
+{
+       return fSettings->HasFlags(VideoSettings::FLAG_SYNC_RETRACE);
+}
+
+
 /*****************************************************************************
  * VideoWindow::_AllocateBuffers
  *****************************************************************************/
@@ -508,7 +681,7 @@ VideoWindow::_AllocateBuffers(int width, int height, int* mode)
                                     &key, B_FOLLOW_ALL,
                                            B_OVERLAY_FILTER_HORIZONTAL|B_OVERLAY_FILTER_VERTICAL);
                       view->SetViewColor(key);
-               SetTitle(VOUT_TITLE " (Overlay)");
+               SetTitle("VLC " PACKAGE_VERSION " (Overlay)");
                break;
             }
             else
@@ -524,12 +697,8 @@ VideoWindow::_AllocateBuffers(int width, int height, int* mode)
     if (*mode == BITMAP)
        {
         // fallback to RGB
-        colspace_index = DEFAULT_COL;  // B_RGB16
-// FIXME: an error in the YUV->RGB32 module prevents this from being used!
-/*        BScreen screen( B_MAIN_SCREEN_ID );
-        if ( screen.ColorSpace() == B_RGB32 )
-               colspace_index = 3;                     // B_RGB32 (faster on 32 bit screen)*/
-        SetTitle( VOUT_TITLE " (Bitmap)" );
+        colspace_index = DEFAULT_COL;  // B_RGB32
+        SetTitle( "VLC " PACKAGE_VERSION " (Bitmap)" );
         bitmap[0] = new BBitmap( bitmapFrame, colspace[colspace_index].colspace );
         bitmap[1] = new BBitmap( bitmapFrame, colspace[colspace_index].colspace );
         bitmap[2] = new BBitmap( bitmapFrame, colspace[colspace_index].colspace );
@@ -651,8 +820,8 @@ void
 VideoWindow::_SetVideoSize(uint32 mode)
 {
        // let size depend on aspect correction
-       int32 width = fCorrectAspect ? i_width : fTrueWidth;
-       int32 height = fCorrectAspect ? i_height : fTrueHeight;
+       int32 width = CorrectAspectRatio() ? i_width : fTrueWidth;
+       int32 height = CorrectAspectRatio() ? i_height : fTrueHeight;
        switch (mode)
        {
                case RESIZE_50:
@@ -667,8 +836,42 @@ VideoWindow::_SetVideoSize(uint32 mode)
                default:
                break;
        }
+       fSettings->ClearFlags(VideoSettings::FLAG_FULL_SCREEN);
        ResizeTo(width, height);
-       is_zoomed = false;
+}
+
+/*****************************************************************************
+ * VideoWindow::_SetToSettings
+ *****************************************************************************/
+void
+VideoWindow::_SetToSettings()
+{
+       // adjust dimensions
+       uint32 mode = RESIZE_100;
+       switch (fSettings->VideoSize())
+       {
+               case VideoSettings::SIZE_50:
+                       mode = RESIZE_50;
+                       break;
+               case VideoSettings::SIZE_200:
+                       mode = RESIZE_200;
+                       break;
+               case VideoSettings::SIZE_100:
+               case VideoSettings::SIZE_OTHER:
+               default:
+                       break;
+       }
+       bool fullscreen = IsFullScreen();       // remember settings
+       _SetVideoSize(mode);                            // because this will reset settings
+       // the fullscreen status is reflected in the settings,
+       // but not yet in the windows state
+       if (fullscreen)
+               SetFullScreen(true);
+       if (fSettings->HasFlags(VideoSettings::FLAG_ON_TOP_ALL))
+               fCachedFeel = B_FLOATING_ALL_WINDOW_FEEL;
+       else
+               fCachedFeel = B_NORMAL_WINDOW_FEEL;
+       SetFeel(fCachedFeel);
 }
 
 /*****************************************************************************
@@ -683,8 +886,8 @@ VideoWindow::_SaveScreenShot( BBitmap* bitmap, char* path,
        info->bitmap = bitmap;
        info->path = path;
        info->translatorID = translatorID;
-       info->width = fCorrectAspect ? i_width : fTrueWidth;
-       info->height = fCorrectAspect ? i_height : fTrueHeight;
+       info->width = CorrectAspectRatio() ? i_width : fTrueWidth;
+       info->height = CorrectAspectRatio() ? i_height : fTrueHeight;
        // spawn a new thread to take care of the actual saving to disk
        thread_id thread = spawn_thread( _save_screen_shot,
                                                                         "screen shot saver",
@@ -707,6 +910,10 @@ VideoWindow::_save_screen_shot( void* cookie )
                // taken the next screen shot already!)
                // make sure we have a unique name for the screen shot
                BString path( info->path );
+               // create the folder if it doesn't exist
+               BString folder( info->path );
+               create_directory( folder.String(), 0777 );
+               path << "/vlc screenshot";
                BEntry entry( path.String() );
                int32 appendedNumber = 0;
                if ( entry.Exists() && !entry.IsSymLink() )
@@ -715,7 +922,7 @@ VideoWindow::_save_screen_shot( void* cookie )
                        bool foundUniqueName = false;
                        appendedNumber = 1;
                        while ( !foundUniqueName ) {
-                               BString newName( info->path );
+                               BString newName( path.String() );
                                newName << " " << appendedNumber;
                                BEntry possiblyClobberedEntry( newName.String() );
                                if ( possiblyClobberedEntry.Exists()
@@ -735,8 +942,6 @@ VideoWindow::_save_screen_shot( void* cookie )
                // make colorspace converted copy of bitmap
                BBitmap* converted = new BBitmap( BRect( 0.0, 0.0, info->width, info->height ),
                                                                                  B_RGB32 );
-//             if ( converted->IsValid() )
-//                     memset( converted->Bits(), 0, converted->BitsLength() );
                status_t status = convert_bitmap( info->bitmap, converted );
                if ( status == B_OK )
                {
@@ -825,29 +1030,18 @@ VideoWindow::_save_screen_shot( void* cookie )
                                                                        nodeInfo.SetType( mime );
                                                        }
                                                }
-                                       } else {
-                                               fprintf( stderr, "  failed to write bitmap: %s\n",
-                                                                strerror( status ) );
                                        }
-                               } else {
-                                       fprintf( stderr, "  failed to create output file: %s\n",
-                                                        strerror( status ) );
                                }
                                outStream.DetachBitmap( &converted );
                                outFile.Unset();
                        }
-                       else
-                               fprintf( stderr, "  failed to find translator\n");
                }
-               else
-                               fprintf( stderr, "  failed to convert colorspace: %s\n",
-                                                strerror( status ) );
                delete converted;
        }
        if ( info )
        {
                delete info->bitmap;
-               delete[] info->path;
+               free( info->path );
        }
        delete info;
        return B_OK;
@@ -857,13 +1051,14 @@ VideoWindow::_save_screen_shot( void* cookie )
 /*****************************************************************************
  * VLCView::VLCView
  *****************************************************************************/
-VLCView::VLCView(BRect bounds)
+VLCView::VLCView(BRect bounds, vout_thread_t *p_vout_instance )
        : BView(bounds, "video view", B_FOLLOW_NONE, B_WILL_DRAW | B_PULSE_NEEDED),
          fLastMouseMovedTime(system_time()),
          fCursorHidden(false),
          fCursorInside(false),
          fIgnoreDoubleClick(false)
 {
+    p_vout = p_vout_instance;
     SetViewColor(B_TRANSPARENT_32_BIT);
 }
 
@@ -905,8 +1100,8 @@ VLCView::MouseDown(BPoint where)
                {
                        if (clicks == 2 && !fIgnoreDoubleClick)
                                Window()->Zoom();
-                       else
-                               videoWindow->ToggleInterfaceShowing();
+                       /* else
+                               videoWindow->ToggleInterfaceShowing(); */
                        fIgnoreDoubleClick = false;
                }
            else
@@ -921,27 +1116,27 @@ VLCView::MouseDown(BPoint where)
                                BPopUpMenu *menu = new BPopUpMenu("context menu");
                                menu->SetRadioMode(false);
                                // Resize to 50%
-                               BMenuItem *halfItem = new BMenuItem("50%", new BMessage(RESIZE_50));
+                               BMenuItem *halfItem = new BMenuItem(_("50%"), new BMessage(RESIZE_50));
                                menu->AddItem(halfItem);
                                // Resize to 100%
-                               BMenuItem *origItem = new BMenuItem("100%", new BMessage(RESIZE_100));
+                               BMenuItem *origItem = new BMenuItem(_("100%"), new BMessage(RESIZE_100));
                                menu->AddItem(origItem);
                                // Resize to 200%
-                               BMenuItem *doubleItem = new BMenuItem("200%", new BMessage(RESIZE_200));
+                               BMenuItem *doubleItem = new BMenuItem(_("200%"), new BMessage(RESIZE_200));
                                menu->AddItem(doubleItem);
                                // Toggle FullScreen
-                               BMenuItem *zoomItem = new BMenuItem("Fullscreen", new BMessage(TOGGLE_FULL_SCREEN));
-                               zoomItem->SetMarked(videoWindow->is_zoomed);
+                               BMenuItem *zoomItem = new BMenuItem(_("Fullscreen"), new BMessage(TOGGLE_FULL_SCREEN));
+                               zoomItem->SetMarked(videoWindow->IsFullScreen());
                                menu->AddItem(zoomItem);
        
                                menu->AddSeparatorItem();
        
                                // Toggle vSync
-                               BMenuItem *vsyncItem = new BMenuItem("Vertical Sync", new BMessage(VERT_SYNC));
-                               vsyncItem->SetMarked(videoWindow->vsync);
+                               BMenuItem *vsyncItem = new BMenuItem(_("Vertical Sync"), new BMessage(VERT_SYNC));
+                               vsyncItem->SetMarked(videoWindow->IsSyncedToRetrace());
                                menu->AddItem(vsyncItem);
                                // Correct Aspect Ratio
-                               BMenuItem *aspectItem = new BMenuItem("Correct Aspect Ratio", new BMessage(ASPECT_CORRECT));
+                               BMenuItem *aspectItem = new BMenuItem(_("Correct Aspect Ratio"), new BMessage(ASPECT_CORRECT));
                                aspectItem->SetMarked(videoWindow->CorrectAspectRatio());
                                menu->AddItem(aspectItem);
        
@@ -970,13 +1165,13 @@ VLCView::MouseDown(BPoint where)
                                bool onTop = videoWindow->Feel() == B_FLOATING_ALL_WINDOW_FEEL;
                                window_feel feel = onTop ? B_NORMAL_WINDOW_FEEL : B_FLOATING_ALL_WINDOW_FEEL;
                                windowFeelMsg->AddInt32( "WinFeel", (int32)feel );
-                               BMenuItem *windowFeelItem = new BMenuItem( "Stay On Top", windowFeelMsg );
+                               BMenuItem *windowFeelItem = new BMenuItem( _("Stay On Top"), windowFeelMsg );
                                windowFeelItem->SetMarked( onTop );
                                menu->AddItem( windowFeelItem );
 
                                menu->AddSeparatorItem();
 
-                               BMenuItem* screenShotItem = new BMenuItem( "Take Screen Shot",
+                               BMenuItem* screenShotItem = new BMenuItem( _("Take Screen Shot"),
                                                                                                                   new BMessage( SCREEN_SHOT ) );
                                menu->AddItem( screenShotItem );
 
@@ -990,6 +1185,17 @@ VLCView::MouseDown(BPoint where)
        fCursorHidden = false;
 }
 
+/*****************************************************************************
+ * VLCVIew::MouseUp
+ *****************************************************************************/
+void
+VLCView::MouseUp( BPoint where )
+{
+    vlc_value_t val;
+    val.b_bool = VLC_TRUE;
+    var_Set( p_vout, "mouse-clicked", val );
+}
+
 /*****************************************************************************
  * VLCVIew::MouseMoved
  *****************************************************************************/
@@ -999,6 +1205,18 @@ VLCView::MouseMoved(BPoint point, uint32 transit, const BMessage* dragMessage)
        fLastMouseMovedTime = system_time();
        fCursorHidden = false;
        fCursorInside = (transit == B_INSIDE_VIEW || transit == B_ENTERED_VIEW);
+       /* DVD navigation */
+       unsigned int i_width, i_height, i_x, i_y;
+    vout_PlacePicture( p_vout, (unsigned int)Bounds().Width(),
+                       (unsigned int)Bounds().Height(),
+                       &i_x, &i_y, &i_width, &i_height );
+       vlc_value_t val;
+       val.i_int = ( (int)point.x - i_x ) * p_vout->render.i_width / i_width;
+       var_Set( p_vout, "mouse-x", val );
+       val.i_int = ( (int)point.y - i_y ) * p_vout->render.i_height / i_height;
+       var_Set( p_vout, "mouse-y", val );
+       val.b_bool = VLC_TRUE;
+    var_Set( p_vout, "mouse-moved", val );
 }
 
 /*****************************************************************************
@@ -1010,6 +1228,7 @@ VLCView::Pulse()
        // We are getting the pulse messages no matter if the mouse is over
        // this view. If we are in full screen mode, we want to hide the cursor
        // even if it is not.
+       VideoWindow *videoWindow = dynamic_cast<VideoWindow*>(Window());
        if (!fCursorHidden)
        {
                if (fCursorInside
@@ -1017,12 +1236,24 @@ VLCView::Pulse()
                {
                        be_app->ObscureCursor();
                        fCursorHidden = true;
-                       VideoWindow *videoWindow = dynamic_cast<VideoWindow*>(Window());
+                       
                        // hide the interface window as well if full screen
-                       if (videoWindow && videoWindow->is_zoomed)
+                       if (videoWindow && videoWindow->IsFullScreen())
                                videoWindow->SetInterfaceShowing(false);
                }
        }
+
+    // Workaround to disable the screensaver in full screen:
+    // we simulate an activity every 29 seconds        
+       if( videoWindow && videoWindow->IsFullScreen() &&
+           system_time() - fLastMouseMovedTime > 29000000 )
+       {
+           BPoint where;
+               uint32 buttons;
+               GetMouse(&where, &buttons, false);
+               ConvertToScreen(&where);
+               set_mouse_position((int32) where.x, (int32) where.y);
+       }
 }
 
 /*****************************************************************************
@@ -1037,6 +1268,8 @@ VLCView::KeyDown(const char *bytes, int32 numBytes)
                uint32 mods = modifiers();
                switch (*bytes) {
                        case B_TAB:
+                       case 'f':
+                       case 'F':
                                // toggle window and full screen mode
                                // not passing on the tab key to the default KeyDown()
                                // implementation also avoids loosing the keyboard focus
@@ -1044,7 +1277,7 @@ VLCView::KeyDown(const char *bytes, int32 numBytes)
                                break;
                        case B_ESCAPE:
                                // go back to window mode
-                               if (videoWindow->is_zoomed)
+                               if (videoWindow->IsFullScreen())
                                        videoWindow->PostMessage(TOGGLE_FULL_SCREEN);
                                break;
                        case B_SPACE: