Commit 89be0ac8 authored by Jon Lech Johansen's avatar Jon Lech Johansen

* MacOS X vout improvements

  * MacOS X intf now returns, allowing vlc to terminate properly
  * Added a new make target: package-macosx
parent de32203b
......@@ -458,6 +458,25 @@ package-beos:
# Clean up
rm -Rf tmp
package-macosx:
# Check that tmp isn't in the way
@if test -e tmp; then \
echo "Error: please remove ./tmp, it is in the way"; false; \
else \
echo "OK."; mkdir tmp; \
fi
# Copy relevant files
cp -R vlc.app tmp/
cp AUTHORS COPYING ChangeLog ChangeLog.libdvdcss \
README README.libdvdcss FAQ TODO tmp/
# Create disk image
./macosx-dmg 0 "vlc-${VLC_QUICKVERSION}" tmp/*
# Clean up
rm -Rf tmp
libdvdcss-snapshot: snapshot-common
# Remove vlc sources and icons, doc, debian directory...
rm -Rf tmp/vlc/src tmp/vlc/share tmp/vlc/plugins tmp/vlc/doc
......
......@@ -7,7 +7,9 @@
openFile = id;
pause = id;
play = id;
quit = id;
speedslider_update = id;
stop = id;
timeslider_update = id;
};
CLASS = Intf_Controller;
......@@ -22,6 +24,7 @@
o_stepr = id;
o_stop = id;
o_timeslider = id;
o_window = id;
};
SUPERCLASS = NSObject;
},
......@@ -31,7 +34,6 @@
OUTLETS = {o_table = id; };
SUPERCLASS = NSObject;
},
{CLASS = VlcQuickDrawView; LANGUAGE = ObjC; SUPERCLASS = NSQuickDrawView; }
);
IBVersion = 1;
}
......@@ -3,14 +3,21 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>87 157 428 240 0 0 1280 938 </string>
<string>120 494 428 240 0 0 1600 1178 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>110 456 257 44 0 0 1600 1178 </string>
<key>460</key>
<string>120 456 104 66 0 0 1600 1178 </string>
</dict>
<key>IBFramework Version</key>
<string>219.0</string>
<key>IBMainMenuLocation</key>
<string>288 493 104 66 0 0 1280 938 </string>
<string>248.0</string>
<key>IBOpenObjects</key>
<array>
<integer>21</integer>
</array>
<key>IBSystem Version</key>
<string>5L14</string>
<key>IBUserGuides</key>
<dict/>
<string>5P48</string>
</dict>
</plist>
......@@ -67,14 +67,16 @@
F512122B0170635601A80A1F,
F512122C0170635601A80A1F,
F512122D0170635601A80A1F,
F512122F0170635601A80A1F,
F51212300170635601A80A1F,
F51212310170635601A80A1F,
F51212320170635601A80A1F,
F510A6CC01738ED001A80A1F,
F510A6CD01738ED001A80A1F,
F53A3B49018DECF201A80A1F,
F53A3B4A018DECF201A80A1F,
F6799746020DCC2A01A80112,
F6799747020DCC2A01A80112,
F6799748020DCC2A01A80112,
F6799749020DCC2A01A80112,
F679974A020DCC2A01A80112,
);
isa = PBXGroup;
name = Files;
......@@ -113,12 +115,6 @@
path = plugins/macosx/intf_controller.h;
refType = 4;
};
F512122F0170635601A80A1F = {
isa = PBXFileReference;
name = intf_main.c;
path = plugins/macosx/intf_main.c;
refType = 4;
};
F51212300170635601A80A1F = {
isa = PBXFileReference;
name = macosx.c;
......@@ -330,16 +326,44 @@
settings = {
};
};
F53A3B49018DECF201A80A1F = {
//F50
//F51
//F52
//F53
//F54
//F60
//F61
//F62
//F63
//F64
F6799746020DCC2A01A80112 = {
isa = PBXFileReference;
name = intf_macosx.c;
path = plugins/macosx/intf_macosx.c;
refType = 4;
};
F6799747020DCC2A01A80112 = {
isa = PBXFileReference;
name = vout_qdview.c;
path = plugins/macosx/vout_qdview.c;
refType = 4;
};
F6799748020DCC2A01A80112 = {
isa = PBXFileReference;
name = vout_qdview.h;
path = plugins/macosx/vout_qdview.h;
refType = 4;
};
F6799749020DCC2A01A80112 = {
isa = PBXFileReference;
name = intf_qdview.h;
path = plugins/macosx/intf_qdview.h;
name = vout_window.c;
path = plugins/macosx/vout_window.c;
refType = 4;
};
F53A3B4A018DECF201A80A1F = {
F679974A020DCC2A01A80112 = {
isa = PBXFileReference;
name = intf_qdview.c;
path = plugins/macosx/intf_qdview.c;
name = vout_window.h;
path = plugins/macosx/vout_window.h;
refType = 4;
};
};
......
#!/bin/sh
#
# Posted to the projectbuilder-users list by Mike Ferris
# Modified for vlc by Jon Lech Johansen
#
set -e
# Requires at least three args
if [ $# -lt 3 ] ; then
echo "usage: $0 size name file ..." 1>&2
exit 1
fi
# Grab size and name
imgSize=$1
shift
imgName=$1
shift
if [ $((${imgSize} < 5)) != 0 ] ; then
imgSize=5;
fi
# Create the image and format it
rm -f "${imgName}.dmg"
echo; echo "Creating ${imgSize} MB disk image named ${imgName}"
hdiutil create "${imgName}.dmg" -megabytes "${imgSize}" -layout NONE -quiet
dev=`hdid -nomount "${imgName}.dmg" | grep '/dev/disk[0-9]*' | cut -d " " -f 1`
/sbin/newfs_hfs -w -v "${imgName}" -b 4096 "${dev}" > /dev/null
hdiutil eject "${dev}" -quiet
# Mount the image and copy stuff
dev=`hdid "${imgName}.dmg" | grep '/dev/disk[0-9]*' | cut -d " " -f 1`
echo "Copying contents to ${imgName}:"
while [ $# -gt 0 ] ; do
echo " ${1}"
/Developer/Tools/CpMac -r "${1}" "/Volumes/${imgName}"
shift
done
hdiutil eject "${dev}" -quiet
# Compress the image
echo "Compressing ${imgName} disk image"
mv "${imgName}.dmg" "${imgName}.orig.dmg"
hdiutil convert "${imgName}.orig.dmg" -format UDZO -o "${imgName}" -quiet
rm "${imgName}.orig.dmg"
# Done
echo; echo "Disk image creation completed:"
ls -la "${imgName}.dmg"; echo
macosx_SOURCES = macosx.c intf_main.c intf_controller.c aout_macosx.c vout_macosx.c intf_vlc_wrapper.c intf_qdview.c
macosx_SOURCES = macosx.c aout_macosx.c vout_macosx.c vout_window.c vout_qdview.c intf_macosx.c intf_controller.c intf_vlc_wrapper.c
This diff is collapsed.
/*****************************************************************************
* intf_controller.h : MacOS X plugin for vlc
* intf_controller.h: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $$
* $Id: intf_controller.h,v 1.3 2002/02/18 01:34:44 jlj Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
*
......@@ -21,54 +21,56 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
#import "intf_vlc_wrapper.h"
#import "intf_qdview.h"
#include "intf_vlc_wrapper.h"
@interface Intf_PlaylistDS : NSObject {
Intf_VlcWrapper* o_vlc ;
NSMutableArray* o_playlist ;
@interface Intf_PlaylistDS : NSObject
{
Intf_VlcWrapper *o_vlc;
NSMutableArray *o_playlist;
IBOutlet NSTableView *o_table ;
IBOutlet NSTableView *o_table;
}
- (void ) awakeFromNib ;
- (void) readPlaylist ;
- (void)awakeFromNib;
- (void)readPlaylist;
- (int) numberOfRowsInTableView:(NSTableView*)o_table ;
- (id) tableView:(NSTableView*)o_table objectValueForTableColumn:(NSTableColumn*)o_column row:(int)i_row ;
- (void)tableView:(NSTableView *)aTableView setObjectValue:anObject forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex ;
@end
- (int)numberOfRowsInTableView:(NSTableView *)o_table;
- (id)tableView:(NSTableView *)o_table objectValueForTableColumn:(NSTableColumn *)o_column row:(int)i_row;
- (void)tableView:(NSTableView *)o_table setObjectValue:o_value forTableColumn:(NSTableColumn *)o_column row:(int)i_index;
@interface Intf_Controller : NSObject <VlcWrapper_Delegate> {
Intf_VlcWrapper* o_vlc ;
@end
NSWindow *o_window ;
bool b_window_is_fullscreen ;
@interface Intf_Controller : NSObject
{
Intf_VlcWrapper *o_vlc;
IBOutlet NSButton *o_play ;
IBOutlet NSButton *o_pause ;
IBOutlet NSButton *o_stop ;
IBOutlet NSButton *o_stepr ;
IBOutlet NSButton *o_stepf ;
IBOutlet NSSlider *o_timeslider ;
IBOutlet NSTextField *o_currenttime ;
IBOutlet NSMenuItem *o_menu_fullscreen ;
IBOutlet NSWindow *o_window;
IBOutlet NSButton *o_play;
IBOutlet NSButton *o_pause;
IBOutlet NSButton *o_stop;
IBOutlet NSButton *o_stepr;
IBOutlet NSButton *o_stepf;
IBOutlet NSSlider *o_timeslider;
IBOutlet NSTextField *o_currenttime;
IBOutlet NSMenuItem *o_menu_fs;
IBOutlet Intf_PlaylistDS *o_playlistds ;
IBOutlet Intf_PlaylistDS *o_playlistds;
}
//Initialization & Event-Management
- (void) awakeFromNib ;
- (void) manage:(NSTimer *)timer ;
- (void)applicationDidBecomeActive:(NSNotification*)aNotification ;
- (void)applicationDidResignActive:(NSNotification*)aNotification ;
/* Initialization & Event-Management */
- (void)awakeFromNib;
- (void)applicationDidFinishLaunching:(NSNotification *)o_notification;
- (void)manage;
- (void)terminate;
/* Functions atteched to user interface */
- (IBAction)openFile:(id)sender;
- (IBAction)pause:(id)sender;
- (IBAction)play:(id)sender;
- (IBAction)stop:(id)sender;
- (IBAction)timeslider_update:(id)slider;
- (IBAction)speedslider_update:(id)slider;
- (IBAction)fullscreen_toggle:(id)sender;
- (IBAction)quit:(id)sender;
//Functions atteched to user interface
- (IBAction) openFile:(id)sender ;
- (IBAction) pause:(id)sender ;
- (IBAction) play:(id)sender ;
- (IBAction) timeslider_update:(id)slider ;
- (IBAction) speedslider_update:(id)slider ;
- (IBAction) fullscreen_toggle:(id)sender ;
@end
/*****************************************************************************
* intf_main.c: MacOS X interface plugin
* intf_macosx.c: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_macosx.c,v 1.11 2002/02/18 01:34:44 jlj Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -30,10 +32,9 @@
#include <videolan/vlc.h>
#include "macosx.h"
#include "interface.h"
#include "intf_main.h"
#include "macosx.h"
/*****************************************************************************
* Local prototypes.
......@@ -62,12 +63,13 @@ static int intf_Open( intf_thread_t *p_intf )
if( p_intf->p_sys == NULL )
{
return( 1 );
};
}
p_intf->p_sys->o_pool =[[NSAutoreleasePool alloc] init];
p_intf->p_sys->o_pool = [[NSAutoreleasePool alloc] init];
p_intf->p_sys->o_port = [[NSPort port] retain];
[NSApplication sharedApplication];
[NSBundle loadNibNamed:@"MainMenu" owner:NSApp];
[[NSApplication sharedApplication] autorelease];
[NSBundle loadNibNamed: @"MainMenu" owner: NSApp];
return( 0 );
}
......@@ -77,9 +79,12 @@ static int intf_Open( intf_thread_t *p_intf )
*****************************************************************************/
static void intf_Close( intf_thread_t *p_intf )
{
/* Destroy structure */
[NSApp terminate:NSApp] ;
[p_intf->p_sys->o_pool release] ;
/* write cached user defaults to disk */
[[NSUserDefaults standardUserDefaults] synchronize];
[p_intf->p_sys->o_port release];
[p_intf->p_sys->o_pool release];
free( p_intf->p_sys );
}
......@@ -88,5 +93,5 @@ static void intf_Close( intf_thread_t *p_intf )
*****************************************************************************/
static void intf_Run( intf_thread_t *p_intf )
{
[NSApp run] ;
[NSApp run];
}
//
// intf_qdview.c
// vlc
//
// Created by fgp on Mon Oct 29 2001.
// Copyright (c) 2001 __MyCompanyName__. All rights reserved.
//
#import "intf_qdview.h"
NSString *VlcQuickDrawViewDidResize = @"VlcQuickDrawViewDidDraw" ;
@implementation VlcQuickDrawView
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
return self;
}
- (void)drawRect:(NSRect)rect {
[super drawRect:rect] ;
[[NSNotificationCenter defaultCenter] postNotificationName:VlcQuickDrawViewDidResize object:self] ;
}
@end
//
// intf_qdview.h
// vlc
//
// Created by fgp on Mon Oct 29 2001.
// Copyright (c) 2001 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
extern NSString *VlcQuickDrawViewDidResize ;
@interface VlcQuickDrawView : NSQuickDrawView {
}
@end
This diff is collapsed.
/*****************************************************************************
* intf_vlc_wrapper.h : MacOS X plugin for vlc
* intf_vlc_wrapper.h: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $$
* $Id: intf_vlc_wrapper.h,v 1.3 2002/02/18 01:34:44 jlj Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -21,52 +22,51 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
typedef enum intf_speed_e
{
SPEED_SLOW = 0,
SPEED_NORMAL,
SPEED_FAST
} intf_speed_t;
typedef enum intf_speed_e {SPEED_SLOW=0, SPEED_NORMAL, SPEED_FAST} intf_speed_t ;
@protocol VlcWrapper_Delegate
- (void) requestQDPortFullscreen:(bool)b_fullscreen ;
- (void) releaseQDPort ;
- (void) resizeQDPortFullscreen:(bool)b_fullscreen ;
@end
// Intf_VlcWrapper is a singleton class (there is only one instance at any time)
@interface Intf_VlcWrapper : NSObject {
id<VlcWrapper_Delegate> o_delegate ;
intf_speed_t e_speed ;
/* Intf_VlcWrapper is a singleton class
(only one instance at any time) */
unsigned int i_width, i_height ;
@interface Intf_VlcWrapper : NSObject
{
id o_delegate;
intf_speed_t e_speed;
}
// Initialization,....
+ (Intf_VlcWrapper*) instance ;
- (Intf_VlcWrapper*) initWithDelegate:(id)o_delegate ;
/* Initialization */
+ (Intf_VlcWrapper *)instance;
- (Intf_VlcWrapper *)initWithDelegate:(id)o_delegate;
- (bool) manage ;
- (bool)manage;
- (void)quit;
//Function for the GUI.
- (void) setQDPort:(CGrafPtr)p_qdport ;
- (void) sizeChangeQDPort ;
- (NSSize) videoSize ;
/* Vout requests */
- (void)handlePortMessage:(NSPortMessage *)o_msg;
- (NSPort *)sendPort;
// Playback control
- (void) setSpeed:(intf_speed_t)e_speed ;
- (NSString*) getTimeAsString ;
- (float) getTimeAsFloat ;
- (void) setTimeAsFloat:(float)i_offset ;
/* Playback control */
- (void)setSpeed:(intf_speed_t)e_speed;
- (NSString *)getTimeAsString;
- (float)getTimeAsFloat;
- (void)setTimeAsFloat:(float)i_offset;
// Playlist control
- (NSArray*) playlistAsArray ;
- (int) playlistLength ;
- (NSString*) playlistItem:(int) i_pos ;
- (bool) playlistPlayCurrent ;
- (void) playlistPause ;
- (void) playlistStop ;
- (void) playlistPlayNext ;
- (void) playlistPlayPrev ;
- (void) playlistPlayItem:(int)i_item ;
- (void) playlistAdd:(NSString*)o_filename ;
- (void) clearPlaylist ;
@end
/* Playlist control */
- (NSArray *)playlistAsArray;
- (int)playlistLength;
- (NSString *)playlistItem:(int)i_pos;
- (bool)playlistPlayCurrent;
- (void)playlistPause;
- (void)playlistStop;
- (void)playlistPlayNext;
- (void)playlistPlayPrev;
- (void)playlistPlayItem:(int)i_item;
- (void)playlistAdd:(NSString *)o_filename;
- (void)clearPlaylist;
- (bool)playlistPlaying;
@end
/*****************************************************************************
* macosx.c : MacOS X plugin for vlc
* macosx.c: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: macosx.c,v 1.12 2002/01/21 00:52:07 sam Exp $
* $Id: macosx.c,v 1.13 2002/02/18 01:34:44 jlj Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
* Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
/*****************************************************************************
* macosx.h : MacOS X plugin for vlc
* macosx.h: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: macosx.h,v 1.4 2002/02/15 13:32:53 sam Exp $
* $Id: macosx.h,v 1.5 2002/02/18 01:34:44 jlj Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
* Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -21,27 +24,55 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
#import <QuickTime/QuickTime.h>
#include "vout_window.h"
#include "vout_qdview.h"
/*****************************************************************************
* The vout struct as access from both, the output and the interface module
* intf_sys_t: description and status of the interface
*****************************************************************************/
#include <QuickTime/QuickTime.h>
#define OSX_INTF_VOUT_QDPORT_CHANGE 0x0001
#define OSX_INTF_VOUT_SIZE_CHANGE 0x0002
#define OSX_VOUT_INTF_REQUEST_QDPORT 0x0004
#define OSX_VOUT_INTF_RELEASE_QDPORT 0x0008
/* This struct is included as the _FIRST_ member in intf_sys_t */
/* That way the video output can cast the intf_sys_t to osx_com_t */
/* and doesn't need the definition of intf_sys_t */
#ifndef OSX_COM_TYPE
#define OSX_COM_TYPE osx_com_t
#define OSX_COM_STRUCT osx_com_s
#endif
typedef struct OSX_COM_STRUCT {
unsigned int i_changes ;
CGrafPtr p_qdport ;
typedef struct intf_sys_s
{
NSPort *o_port;
NSAutoreleasePool *o_pool;
} intf_sys_t;
struct vout_thread_s *p_vout;
} OSX_COM_TYPE ;
/*****************************************************************************
* vout_sys_t: MacOS X video output method descriptor
*****************************************************************************/
typedef struct vout_sys_s
{
VLCWindow *o_window;
NSRect s_rect;
int b_pos_saved;
boolean_t b_mouse_moved;
boolean_t b_mouse_pointer_visible;
mtime_t i_time_mouse_last_moved;
CodecType i_codec;
CGrafPtr p_qdport;
ImageSequence i_seq;
MatrixRecordPtr p_matrix;
DecompressorComponent img_dc;
ImageDescriptionHandle h_img_descr;
} vout_sys_t;
/*****************************************************************************
* vout_req_t: MacOS X video output request
*****************************************************************************/
#define VOUT_REQ_CREATE_WINDOW 0x00000001
#define VOUT_REQ_DESTROY_WINDOW 0x00000002
typedef struct vout_req_s
{
int i_type;
int i_result;
NSConditionLock *o_lock;
struct vout_thread_s *p_vout;
} vout_req_t;
This diff is collapsed.
/*****************************************************************************
* vout_qdview.c: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: vout_qdview.c,v 1.1 2002/02/18 01:34:44 jlj Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* free() */
#include <string.h> /* strerror() */
#include <videolan/vlc.h>
#include "video.h"
#include "video_output.h"
#include "macosx.h"
/*****************************************************************************
* VLCView implementation
*****************************************************************************/
@implementation VLCView
- (id)initWithVout:(struct vout_thread_s *)_p_vout
{
if( [super init] == nil )
return nil;
p_vout = _p_vout;
return self;
}
- (void)drawRect:(NSRect)rect
{
[super drawRect: rect];
p_vout->i_changes |= VOUT_SIZE_CHANGE;
}
@end
/*****************************************************************************
* intf_main.h: MacOS X interface plugin
* vout_qdview.h: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: vout_qdview.h,v 1.1 2002/02/18 01:34:44 jlj Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -21,16 +22,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/* OS specific */
#import <Cocoa/Cocoa.h>
/*****************************************************************************
* intf_sys_t: description and status of the interface
*****************************************************************************/
typedef struct intf_sys_s
@interface VLCView : NSQuickDrawView
{
osx_com_t osx_communication ;
struct vout_thread_s *p_vout;
}
NSAutoreleasePool *o_pool ;
} intf_sys_t;
- (id)initWithVout:(struct vout_thread_s *)_p_vout;
@end
/*****************************************************************************
* vout_window.c: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: vout_window.c,v 1.1 2002/02/18 01:34:44 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* free() */
#include <string.h> /* strerror() */
#include <videolan/vlc.h>
#include "video.h"
#include "video_output.h"
#include "interface.h"
#include "macosx.h"
/*****************************************************************************
* VLCWindow implementation
*****************************************************************************/
@implementation VLCWindow
- (void)setVout:(struct vout_thread_s *)_p_vout
{
p_vout = _p_vout;
}
- (BOOL)canBecomeKeyWindow
{
return( YES );
}
- (void)becomeKeyWindow
{
[super becomeKeyWindow];
p_vout->p_sys->b_mouse_moved = 0;
p_vout->p_sys->i_time_mouse_last_moved = mdate();
}
- (void)resignKeyWindow
{
[super resignKeyWindow];
p_vout->p_sys->b_mouse_moved = 1;
p_vout->p_sys->i_time_mouse_last_moved = 0;
}
- (void)keyDown:(NSEvent *)theEvent
{
unichar key = 0;
if( [[theEvent characters] length] )
{
key = [[theEvent characters] characterAtIndex: 0];
}
switch( key )
{
case 'f': case 'F':
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
break;
case 'q': case 'Q':
p_main->p_intf->b_die = 1;
break;
default:
[super keyDown: theEvent];
break;
}
}
- (void)mouseMoved:(NSEvent *)theEvent
{
p_vout->p_sys->i_time_mouse_last_moved = mdate();
}
@end
/*****************************************************************************
* vout_window.h: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: vout_window.h,v 1.1 2002/02/18 01:34:44 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
@interface VLCWindow : NSWindow
{
struct vout_thread_s *p_vout;
}
- (void)setVout:(struct vout_thread_s *)_p_vout;
@end
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