Commit 940b79b4 authored by Jon Lech Johansen's avatar Jon Lech Johansen

* ALL: Under Jaguar, vout no longer depends on any specific MacOS X

         intf. wxWindows should work (not tested). Closes #33.
parent 270e1cb5
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf.m: MacOS X interface plugin * intf.m: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: intf.m,v 1.7 2002/12/07 23:50:30 massiot Exp $ * $Id: intf.m,v 1.8 2002/12/08 05:30:47 jlj Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -986,111 +986,19 @@ static void Run( intf_thread_t *p_intf ) ...@@ -986,111 +986,19 @@ static void Run( intf_thread_t *p_intf )
- (void)handlePortMessage:(NSPortMessage *)o_msg - (void)handlePortMessage:(NSPortMessage *)o_msg
{ {
NSData * o_req; NSData * o_data;
vout_req_t * p_req; NSValue * o_value;
NSInvocation * o_inv;
o_req = [[o_msg components] lastObject]; vout_thread_t * p_vout;
p_req = *((vout_req_t **)[o_req bytes]);
[p_req->o_lock lock];
if( p_req->i_type == VOUT_REQ_CREATE_WINDOW )
{
VLCView * o_view;
NSScreen * p_screen;
NSMenu * o_menu = [o_mi_screen submenu];
int i, i_nb_items = [o_menu numberOfItems];
for( i = 0; i < i_nb_items; i++ )
{
if ( [[o_menu itemAtIndex:i] state] ) break;
}
NSArray * p_screens = [NSScreen screens];
if ( i == i_nb_items || [p_screens count] < i )
{
/* This shouldn't happen. */
p_screen = [NSScreen mainScreen];
}
else
{
p_screen = [p_screens objectAtIndex: i];
}
p_req->p_vout->p_sys->o_window = [VLCWindow alloc];
[p_req->p_vout->p_sys->o_window setVout: p_req->p_vout];
[p_req->p_vout->p_sys->o_window setReleasedWhenClosed: YES];
if( p_req->p_vout->b_fullscreen )
{
[p_req->p_vout->p_sys->o_window
initWithContentRect: [p_screen frame]
styleMask: NSBorderlessWindowMask
backing: NSBackingStoreBuffered
defer: NO screen: p_screen];
[p_req->p_vout->p_sys->o_window
setLevel: NSModalPanelWindowLevel];
}
else
{
unsigned int i_stylemask = NSTitledWindowMask |
NSMiniaturizableWindowMask |
NSResizableWindowMask;
[p_req->p_vout->p_sys->o_window
initWithContentRect: p_req->p_vout->p_sys->s_rect
styleMask: i_stylemask
backing: NSBackingStoreBuffered
defer: NO screen: p_screen];
if( !p_req->p_vout->p_sys->b_pos_saved )
{
[p_req->p_vout->p_sys->o_window center];
}
}
o_view = [[VLCView alloc] init];
[o_view setVout: p_req->p_vout];
[o_view setMenu: o_mu_controls];
[p_req->p_vout->p_sys->o_window setContentView: o_view];
[o_view autorelease];
[o_view lockFocus];
p_req->p_vout->p_sys->p_qdport = [o_view qdPort];
[o_view unlockFocus];
[p_req->p_vout->p_sys->o_window setTitle: [NSString
stringWithCString: VOUT_TITLE " (QuickTime)"]];
[p_req->p_vout->p_sys->o_window makeKeyAndOrderFront: nil];
p_req->i_result = 1;
}
else if( p_req->i_type == VOUT_REQ_DESTROY_WINDOW )
{
if( !p_req->p_vout->b_fullscreen )
{
NSRect s_rect;
s_rect = [[p_req->p_vout->p_sys->o_window contentView] frame];
p_req->p_vout->p_sys->s_rect.size = s_rect.size;
s_rect = [p_req->p_vout->p_sys->o_window frame];
p_req->p_vout->p_sys->s_rect.origin = s_rect.origin;
p_req->p_vout->p_sys->b_pos_saved = 1;
}
p_req->p_vout->p_sys->p_qdport = nil; o_data = [[o_msg components] lastObject];
[p_req->p_vout->p_sys->o_window close]; o_inv = *((NSInvocation **)[o_data bytes]);
p_req->p_vout->p_sys->o_window = nil; [o_inv getArgument: &o_value atIndex: 2];
p_vout = (vout_thread_t *)[o_value pointerValue];
p_req->i_result = 1; [p_vout->p_sys->o_lock lock];
} [o_inv invoke];
[p_vout->p_sys->o_lock unlockWithCondition: 1];
[p_req->o_lock unlockWithCondition: 1];
} }
@end @end
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout.h: MacOS X interface plugin * vout.h: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: vout.h,v 1.1 2002/08/04 17:23:43 sam Exp $ * $Id: vout.h,v 1.2 2002/12/08 05:30:47 jlj Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org> * Florian G. Pflug <fgp@phlo.org>
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
} }
- (void)setVout:(vout_thread_t *)_p_vout; - (void)setVout:(vout_thread_t *)_p_vout;
- (vout_thread_t *)getVout;
- (void)toggleFullscreen; - (void)toggleFullscreen;
- (BOOL)isFullscreen; - (BOOL)isFullscreen;
...@@ -43,10 +44,19 @@ ...@@ -43,10 +44,19 @@
*****************************************************************************/ *****************************************************************************/
@interface VLCView : NSQuickDrawView @interface VLCView : NSQuickDrawView
{ {
vout_thread_t * p_vout;
} }
- (void)setVout:(vout_thread_t *)_p_vout; @end
/*****************************************************************************
* VLCVout interface
*****************************************************************************/
@interface VLCVout : NSObject
{
}
- (void)createWindow:(NSValue *)o_value;
- (void)destroyWindow:(NSValue *)o_value;
@end @end
...@@ -55,11 +65,11 @@ ...@@ -55,11 +65,11 @@
*****************************************************************************/ *****************************************************************************/
struct vout_sys_t struct vout_sys_t
{ {
intf_thread_t * p_intf; NSConditionLock * o_lock;
VLCWindow * o_window;
NSRect s_rect; NSRect s_rect;
int b_pos_saved; int b_pos_saved;
VLCWindow * o_window;
vlc_bool_t b_mouse_moved; vlc_bool_t b_mouse_moved;
vlc_bool_t b_mouse_pointer_visible; vlc_bool_t b_mouse_pointer_visible;
...@@ -74,19 +84,3 @@ struct vout_sys_t ...@@ -74,19 +84,3 @@ struct vout_sys_t
ImageDescriptionHandle h_img_descr; ImageDescriptionHandle h_img_descr;
#endif #endif
}; };
/*****************************************************************************
* vout_req_t: MacOS X video output request
*****************************************************************************/
#define VOUT_REQ_CREATE_WINDOW 0x00000001
#define VOUT_REQ_DESTROY_WINDOW 0x00000002
typedef struct vout_req_t
{
int i_type;
int i_result;
NSConditionLock * o_lock;
vout_thread_t * p_vout;
} vout_req_t;
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment