/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* free() */
#include <string.h>
/* SystemUIMode */
#import <Carbon/Carbon.h>
-#include <vlc_keys.h>
#include "intf.h"
#include "fspanel.h"
#import "controls.h"
#import "embeddedwindow.h"
+#include <vlc_common.h>
+#include <vlc_keys.h>
+
/*****************************************************************************
* DeviceCallback: Callback triggered when the video-device variable is changed
*****************************************************************************/
vlc_value_t val;
vout_thread_t *p_vout = (vout_thread_t *)p_this;
- msg_Dbg( p_vout, "set %d", new_val.i_int );
+ msg_Dbg( p_vout, "set %"PRId64, new_val.i_int );
var_Create( p_vout->p_libvlc, "video-device", VLC_VAR_INTEGER );
var_Set( p_vout->p_libvlc, "video-device", new_val );
- (BOOL)windowContainsEmbedded: (id)o_window
{
-/* if( ![[o_window className] isEqualToString: @"VLCVoutWindow"] )
- {
- NSLog( @"We were not given a VLCVoutWindow" );
- }*/
return ([self viewForWindow: o_window] == nil ? NO : YES );
}
- (void)updateTitle
{
- NSString * o_title = nil;
+ NSString * o_title = nil;
NSMutableString * o_mrl = nil;
input_thread_t * p_input;
char * psz_title;
if( !p_vout ) return;
- p_input = vlc_object_find( p_vout, VLC_OBJECT_INPUT, FIND_PARENT );
+ p_input = getInput();
if( !p_input ) return;
{
vlc_value_t val;
if( !p_real_vout ) return;
- 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" );
}
- (BOOL)isFullscreen
val.i_int |= (int)CocoaKeyToVLC( key );
var_Set( p_vout->p_libvlc, "key-pressed", val );
}
- else NSLog( @"Could not send keyevent to VLC core" );
+ else msg_Warn( p_vout, "could not send keyevent to VLC core" );
}
else
[super keyDown: o_event];
if( p_vout && [o_event type] == NSLeftMouseUp )
{
- var_SetBool( p_vout, "mouse-clicked", true );
+ int x, y;
+
+ var_GetCoords( p_vout, "mouse-moved", &x, &y );
+ var_SetCoords( p_vout, "mouse-clicked", x, y );
var_Get( p_vout, "mouse-button-down", &val );
val.i_int &= ~1;
if( b_inside )
{
- vlc_value_t val;
+ int x, y;
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;
if( [[o_view className] isEqualToString: @"VLCGLView"] )
{
- val.i_int = ( ((int)(s_rect.size.height - ml.y)) - i_y ) *
+ y = (((int)(s_rect.size.height - ml.y)) - i_y) *
p_vout->render.i_height / i_height;
}
else
{
- val.i_int = ( ((int)ml.y) - i_y ) *
- p_vout->render.i_height / i_height;
+ y = (((int)ml.y) - i_y) * p_vout->render.i_height / i_height;
}
- 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 );
}
if( [self isFullscreen] )
[[[[VLCMain sharedInstance] controls] fspanel] fadeIn];
- (void)enterFullscreen
{
/* Save the settings for next playing item */
- playlist_t * p_playlist = pl_Hold( p_real_vout );
+ playlist_t * p_playlist = pl_Get( p_real_vout );
var_SetBool( p_playlist, "fullscreen", true );
- pl_Release( p_real_vout );
}
- (void)leaveFullscreen
{
/* Save the settings for next playing item */
- playlist_t * p_playlist = pl_Hold( p_real_vout );
+ playlist_t * p_playlist = pl_Get( p_real_vout );
var_SetBool( p_playlist, "fullscreen", false );
- pl_Release( p_real_vout );
}
@end
i_time_mouse_last_moved = mdate();
o_window = [[VLCVoutWindow alloc] initWithVout: p_arg_vout view: self
frame: s_arg_frame];
-
+
[self updateTitle];
if([self isFullscreen])
[o_window performSelectorOnMainThread: @selector(enterFullscreen) withObject: NULL waitUntilDone: YES];
/* 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;
-
+
if( b_return )
{
[o_window lockFullscreenAnimation];