/*****************************************************************************
* vout.m: MacOS X video output module
*****************************************************************************
/*****************************************************************************
* vout.m: MacOS X video output module
*****************************************************************************
/*****************************************************************************
* Preamble
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
-/* BeginFullScreen, EndFullScreen */
-#include <QuickTime/QuickTime.h>
+/* prevent system sleep */
+#import <CoreServices/CoreServices.h>
+/* FIXME: HACK!! */
+#ifdef __x86_64__
+#import <CoreServices/../Frameworks/OSServices.framework/Headers/Power.h>
+#endif
+
+/* SystemUIMode */
+#import <Carbon/Carbon.h>
/*****************************************************************************
* DeviceCallback: Callback triggered when the video-device variable is changed
*****************************************************************************/
/*****************************************************************************
* DeviceCallback: Callback triggered when the video-device variable is changed
*****************************************************************************/
var_Create( p_vout->p_libvlc, "video-device", VLC_VAR_INTEGER );
var_Set( p_vout->p_libvlc, "video-device", new_val );
var_Create( p_vout->p_libvlc, "video-device", VLC_VAR_INTEGER );
var_Set( p_vout->p_libvlc, "video-device", new_val );
-/* if( ![[o_window className] isEqualToString: @"VLCVoutWindow"] )
- {
- NSLog( @"We were not given a VLCVoutWindow" );
- }*/
- return ([self getViewForWindow: o_window] == nil ? NO : YES );
+ return ([self viewForWindow: o_window] == nil ? NO : YES );
/* Get the pref value when this is the first time, otherwise retrieve the device from the top level video-device var */
if( var_Type( p_real_vout->p_libvlc, "video-device" ) == 0 )
/* Get the pref value when this is the first time, otherwise retrieve the device from the top level video-device var */
if( var_Type( p_real_vout->p_libvlc, "video-device" ) == 0 )
- var_Get( p_real_vout, "fullscreen", &val );
- val.b_bool = !val.b_bool;
- var_Set( p_real_vout, "fullscreen", val );
+ var_ToggleBool( p_real_vout, "fullscreen" );
val.i_int |= (int)CocoaKeyToVLC( key );
var_Set( p_vout->p_libvlc, "key-pressed", val );
}
val.i_int |= (int)CocoaKeyToVLC( key );
var_Set( p_vout->p_libvlc, "key-pressed", val );
}
( [o_event modifierFlags] & NSControlKeyMask ) ) )
{
msg_Dbg( p_vout, "received NSRightMouseDown (generic method) or Ctrl clic" );
( [o_event modifierFlags] & NSControlKeyMask ) ) )
{
msg_Dbg( p_vout, "received NSRightMouseDown (generic method) or Ctrl clic" );
if( p_vout && [o_event type] == NSRightMouseDown )
{
msg_Dbg( p_vout, "received NSRightMouseDown (specific method)" );
if( p_vout && [o_event type] == NSRightMouseDown )
{
msg_Dbg( p_vout, "received NSRightMouseDown (specific method)" );
- vlc_value_t b_val;
- b_val.b_bool = true;
- var_Set( p_vout, "mouse-clicked", b_val );
+ int x, y;
+
+ var_GetCoords( p_vout, "mouse-moved", &x, &y );
+ var_SetCoords( p_vout, "mouse-clicked", x, y );
/* FIXME: this isn't the appropriate place, but we can't receive
* NSRightMouseDown some how */
msg_Dbg( p_vout, "received NSRightMouseUp" );
/* FIXME: this isn't the appropriate place, but we can't receive
* NSRightMouseDown some how */
msg_Dbg( p_vout, "received NSRightMouseUp" );
unsigned int i_width, i_height, i_x, i_y;
vout_PlacePicture( p_vout, (unsigned int)s_rect.size.width,
(unsigned int)s_rect.size.height,
&i_x, &i_y, &i_width, &i_height );
unsigned int i_width, i_height, i_x, i_y;
vout_PlacePicture( p_vout, (unsigned int)s_rect.size.width,
(unsigned int)s_rect.size.height,
&i_x, &i_y, &i_width, &i_height );
- val.i_int = ( ((int)ml.x) - i_x ) *
- p_vout->render.i_width / i_width;
- var_Set( p_vout, "mouse-x", val );
-
+ x = (((int)ml.x) - i_x) * p_vout->render.i_width / i_width;
- var_Set( p_vout, "mouse-y", val );
-
- val.b_bool = true;
- var_Set( p_vout, "mouse-moved", val );
+ var_SetCoords( p_vout, "mouse-moved", x, y );
{
/* p_real_vout: the vout we have to use to check for video-on-top
and a few other things. If we are the QuickTime output, it's us.
{
/* p_real_vout: the vout we have to use to check for video-on-top
and a few other things. If we are the QuickTime output, it's us.
var_Create( p_vout, "macosx-vdev", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_vout, "macosx-stretch", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_vout, "macosx-vdev", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_vout, "macosx-stretch", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
/* We only wait for NSApp to initialise if we're not embedded (as in the
* case of the Mozilla plugin). We can tell whether we're embedded or not
/* We only wait for NSApp to initialise if we're not embedded (as in the
* case of the Mozilla plugin). We can tell whether we're embedded or not
{
/* Wait for a MacOS X interface to appear. Timeout is 2 seconds. */
for( i_timeout = 20 ; i_timeout-- ; )
{
/* Wait for a MacOS X interface to appear. Timeout is 2 seconds. */
for( i_timeout = 20 ; i_timeout-- ; )
!(var_GetBool( p_vout, "macosx-background" )) &&
var_GetBool( p_vout, "embedded-video") )
{
!(var_GetBool( p_vout, "macosx-background" )) &&
var_GetBool( p_vout, "embedded-video") )
{
frame: (NSRect *) s_arg_frame
{
BOOL b_return = [super setVout: p_arg_vout subView: view frame:s_arg_frame];
i_time_mouse_last_moved = mdate();
o_window = [[VLCVoutWindow alloc] initWithVout: p_arg_vout view: self
frame: s_arg_frame];
frame: (NSRect *) s_arg_frame
{
BOOL b_return = [super setVout: p_arg_vout subView: view frame:s_arg_frame];
i_time_mouse_last_moved = mdate();
o_window = [[VLCVoutWindow alloc] initWithVout: p_arg_vout view: self
frame: s_arg_frame];
/* o_window needs to point to our o_embeddedwindow, super might have set it
* to the fullscreen window that o_embeddedwindow setups during fullscreen */
o_window = o_embeddedwindow;
/* o_window needs to point to our o_embeddedwindow, super might have set it
* to the fullscreen window that o_embeddedwindow setups during fullscreen */
o_window = o_embeddedwindow;
[self setLevel:NSNormalWindowLevel];
/* tell the fspanel to move itself to front next time it's triggered */
[self setLevel:NSNormalWindowLevel];
/* tell the fspanel to move itself to front next time it's triggered */
- [[[[VLCMain sharedInstance] getControls] getFSPanel] setVoutWasUpdated: i_device];
- [[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
+ [[[[VLCMain sharedInstance] controls] fspanel] setVoutWasUpdated: i_device];
+ [[[[VLCMain sharedInstance] controls] fspanel] setActive: nil];
[self setFrame:initialFrame display:YES animate:YES];
[self setMovableByWindowBackground: YES];
if( var_GetBool( p_vout, "video-on-top" ) )
[self setFrame:initialFrame display:YES animate:YES];
[self setMovableByWindowBackground: YES];
if( var_GetBool( p_vout, "video-on-top" ) )