* Preamble
*****************************************************************************/
#include <errno.h> /* ENOMEM */
-#include <stdio.h>
#include <Application.h>
#include <BitmapStream.h>
#include <WindowScreen.h>
/* VLC headers */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <vlc/vlc.h>
#include <vlc_interface.h>
#include <vlc_vout.h>
};
-#define MOUSE_IDLE_TIMEOUT 2000000 // two seconds
#define MIN_AUTO_VSYNC_REFRESH 61 // Hz
/*****************************************************************************
{
msg_Dbg( p_vout, "using single-buffered overlay" );
bitmap_count = 2;
- if( bitmap[2] ) { delete bitmap[2]; bitmap[2] = NULL; }
+ delete bitmap[2]; bitmap[2] = NULL;
}
}
else
{
msg_Dbg( p_vout, "using simple overlay" );
bitmap_count = 1;
- if( bitmap[1] ) { delete bitmap[1]; bitmap[1] = NULL; }
+ delete bitmap[1]; bitmap[1] = NULL;
}
break;
}
else
{
- if( bitmap[0] ) { delete bitmap[0]; bitmap[0] = NULL; }
+ delete bitmap[0]; bitmap[0] = NULL;
}
}
void
VideoWindow::_FreeBuffers()
{
- if( bitmap[0] ) { delete bitmap[0]; bitmap[0] = NULL; }
- if( bitmap[1] ) { delete bitmap[1]; bitmap[1] = NULL; }
- if( bitmap[2] ) { delete bitmap[2]; bitmap[2] = NULL; }
+ delete bitmap[0]; bitmap[0] = NULL;
+ delete bitmap[1]; bitmap[1] = NULL;
+ delete bitmap[2]; bitmap[2] = NULL;
fInitStatus = B_ERROR;
}
fIgnoreDoubleClick(false)
{
p_vout = p_vout_instance;
+ fMouseHideTimeout = var_GetInteger(p_vout, "mouse-hide-timeout") * 1000;
SetViewColor(B_TRANSPARENT_32_BIT);
}
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->IsSyncedToRetrace());
BMenuItem *aspectItem = new BMenuItem(_("Correct Aspect Ratio"), new BMessage(ASPECT_CORRECT));
aspectItem->SetMarked(videoWindow->CorrectAspectRatio());
menu->AddItem(aspectItem);
-
+
menu->AddSeparatorItem();
-
+
// Window Feel Items
/* BMessage *winNormFeel = new BMessage(WINDOW_FEEL);
winNormFeel->AddInt32("WinFeel", (int32_t)B_NORMAL_WINDOW_FEEL);
BMenuItem *normWindItem = new BMenuItem("Normal Window", winNormFeel);
normWindItem->SetMarked(videoWindow->Feel() == B_NORMAL_WINDOW_FEEL);
menu->AddItem(normWindItem);
-
+
BMessage *winFloatFeel = new BMessage(WINDOW_FEEL);
winFloatFeel->AddInt32("WinFeel", (int32_t)B_FLOATING_APP_WINDOW_FEEL);
BMenuItem *onTopWindItem = new BMenuItem("App Top", winFloatFeel);
onTopWindItem->SetMarked(videoWindow->Feel() == B_FLOATING_APP_WINDOW_FEEL);
menu->AddItem(onTopWindItem);
-
+
BMessage *winAllFeel = new BMessage(WINDOW_FEEL);
winAllFeel->AddInt32("WinFeel", (int32_t)B_FLOATING_ALL_WINDOW_FEEL);
BMenuItem *allSpacesWindItem = new BMenuItem("On Top All Workspaces", winAllFeel);
VLCView::MouseUp( BPoint where )
{
vlc_value_t val;
- val.b_bool = VLC_TRUE;
+ val.b_bool = true;
var_Set( p_vout, "mouse-clicked", val );
}
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;
+ val.b_bool = true;
var_Set( p_vout, "mouse-moved", val );
}
if (!fCursorHidden)
{
if (fCursorInside
- && mdate() - fLastMouseMovedTime > MOUSE_IDLE_TIMEOUT)
+ && mdate() - fLastMouseMovedTime > fMouseHideTimeout)
{
be_app->ObscureCursor();
fCursorHidden = true;
-
+
// hide the interface window as well if full screen
if (videoWindow && videoWindow->IsFullScreen())
videoWindow->SetInterfaceShowing(false);
}
// Workaround to disable the screensaver in full screen:
- // we simulate an activity every 29 seconds
+ // we simulate an activity every 29 seconds
if( videoWindow && videoWindow->IsFullScreen() &&
mdate() - fLastMouseMovedTime > 29000000 )
{