Commit d86fd156 authored by Simon Latapie's avatar Simon Latapie

* mozilla plugin on MacOSX. Not fully implemented yet.

 * compiled with mozilla 1.4 (won't probably work with <1.4)
 * TODO:
 *     - make XPCOM work (play,pause,stop buttons)
 *     - fullscreen implementation (quite difficult on MacOSX because only
 *       the main thread can create windows)
parent 10afbf83
B/* Localized versions of Info.plist keys */ B/* Localized versions of Info.plist keys */
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Vlc Plugin</string>
<key>CFBundleIdentifier</key>
<string>com.netscape.vlc</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>NSPL</string>
<key>CFBundleSignature</key>
<string>MOSS</string>
<key>CFBundleVersion</key>
<string>0.12</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PBXProjectSourcePath</key>
<string>/Users/garf/cavapasmerder/VlcPlugin.pbproj</string>
</dict>
</plist>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout.h: MacOS X interface plugin * vout.h: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: vout.h,v 1.11 2003/05/01 01:11:17 hartman Exp $ * $Id: vout.h,v 1.12 2003/08/14 12:38:03 garf 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>
...@@ -81,10 +81,15 @@ struct vout_sys_t ...@@ -81,10 +81,15 @@ struct vout_sys_t
#ifdef __QUICKTIME__ #ifdef __QUICKTIME__
CodecType i_codec; CodecType i_codec;
CGrafPtr p_qdport; CGrafPtr p_qdport;
CGrafPtr p_qdportold;
ImageSequence i_seq; ImageSequence i_seq;
MatrixRecordPtr p_matrix; MatrixRecordPtr p_matrix;
DecompressorComponent img_dc; DecompressorComponent img_dc;
ImageDescriptionHandle h_img_descr; ImageDescriptionHandle h_img_descr;
Ptr p_fullscreen_state; Ptr p_fullscreen_state;
RgnHandle mask;
int portx;
int porty;
int isplugin;
#endif #endif
}; };
/*****************************************************************************
* vout.m: MacOS X video output plugin /* vout.m: MacOS X video output plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: vout.m,v 1.50 2003/06/03 23:17:43 massiot Exp $ * $Id: vout.m,v 1.51 2003/08/14 12:38:03 garf 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>
...@@ -51,6 +51,7 @@ struct picture_sys_t ...@@ -51,6 +51,7 @@ struct picture_sys_t
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
static int vout_Init ( vout_thread_t * ); static int vout_Init ( vout_thread_t * );
static void vout_End ( vout_thread_t * ); static void vout_End ( vout_thread_t * );
static int vout_Manage ( vout_thread_t * ); static int vout_Manage ( vout_thread_t * );
...@@ -79,6 +80,9 @@ int E_(OpenVideo) ( vlc_object_t *p_this ) ...@@ -79,6 +80,9 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
vout_thread_t * p_vout = (vout_thread_t *)p_this; vout_thread_t * p_vout = (vout_thread_t *)p_this;
OSErr err; OSErr err;
int i_timeout; int i_timeout;
vlc_value_t value_drawable;
var_Get( p_vout->p_vlc, "drawable", &value_drawable );
p_vout->p_sys = malloc( sizeof( vout_sys_t ) ); p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL ) if( p_vout->p_sys == NULL )
...@@ -89,6 +93,9 @@ int E_(OpenVideo) ( vlc_object_t *p_this ) ...@@ -89,6 +93,9 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) ); memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
/* We don't need an intf in mozilla plugin */
if( value_drawable.i_int == 0 )
{
/* Wait for a MacOS X interface to appear. Timeout is 2 seconds. */ /* Wait for a MacOS X interface to appear. Timeout is 2 seconds. */
for( i_timeout = 20 ; i_timeout-- ; ) for( i_timeout = 20 ; i_timeout-- ; )
{ {
...@@ -106,6 +113,7 @@ int E_(OpenVideo) ( vlc_object_t *p_this ) ...@@ -106,6 +113,7 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
return( 1 ); return( 1 );
} }
if( [NSApp respondsToSelector: @selector(getIntf)] ) if( [NSApp respondsToSelector: @selector(getIntf)] )
{ {
intf_thread_t * p_intf; intf_thread_t * p_intf;
...@@ -125,6 +133,7 @@ int E_(OpenVideo) ( vlc_object_t *p_this ) ...@@ -125,6 +133,7 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
return( 1 ); return( 1 );
} }
} }
}
p_vout->p_sys->h_img_descr = p_vout->p_sys->h_img_descr =
(ImageDescriptionHandle)NewHandleClear( sizeof(ImageDescription) ); (ImageDescriptionHandle)NewHandleClear( sizeof(ImageDescription) );
...@@ -135,6 +144,17 @@ int E_(OpenVideo) ( vlc_object_t *p_this ) ...@@ -135,6 +144,17 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
p_vout->p_sys->b_mouse_moved = YES; p_vout->p_sys->b_mouse_moved = YES;
p_vout->p_sys->i_time_mouse_last_moved = mdate(); p_vout->p_sys->i_time_mouse_last_moved = mdate();
if( value_drawable.i_int != 0 )
{
p_vout->p_sys->mask = NewRgn();
p_vout->p_sys->isplugin = 1 ;
} else
{
p_vout->p_sys->mask = NULL;
p_vout->p_sys->isplugin = 0 ;
}
/* set window size */ /* set window size */
p_vout->p_sys->s_rect.size.width = p_vout->i_window_width; p_vout->p_sys->s_rect.size.width = p_vout->i_window_width;
p_vout->p_sys->s_rect.size.height = p_vout->i_window_height; p_vout->p_sys->s_rect.size.height = p_vout->i_window_height;
...@@ -219,6 +239,9 @@ int E_(OpenVideo) ( vlc_object_t *p_this ) ...@@ -219,6 +239,9 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
} }
[o_pool release]; [o_pool release];
/* We don't need a window either in the mozilla plugin */
if( p_vout->p_sys->isplugin == 0 )
{
if( CoCreateWindow( p_vout ) ) if( CoCreateWindow( p_vout ) )
{ {
msg_Err( p_vout, "unable to create window" ); msg_Err( p_vout, "unable to create window" );
...@@ -227,6 +250,7 @@ int E_(OpenVideo) ( vlc_object_t *p_this ) ...@@ -227,6 +250,7 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
free( p_vout->p_sys ); free( p_vout->p_sys );
return( 1 ); return( 1 );
} }
}
p_vout->pf_init = vout_Init; p_vout->pf_init = vout_Init;
p_vout->pf_end = vout_End; p_vout->pf_end = vout_End;
...@@ -244,6 +268,7 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -244,6 +268,7 @@ static int vout_Init( vout_thread_t *p_vout )
{ {
int i_index; int i_index;
picture_t *p_pic; picture_t *p_pic;
vlc_value_t val;
I_OUTPUTPICTURES = 0; I_OUTPUTPICTURES = 0;
...@@ -254,6 +279,13 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -254,6 +279,13 @@ static int vout_Init( vout_thread_t *p_vout )
p_vout->output.i_height = p_vout->render.i_height; p_vout->output.i_height = p_vout->render.i_height;
p_vout->output.i_aspect = p_vout->render.i_aspect; p_vout->output.i_aspect = p_vout->render.i_aspect;
var_Get( p_vout->p_vlc, "drawable", &val );
if( p_vout->p_sys->isplugin )
{
p_vout->p_sys->p_qdport = val.i_int;
}
SetPort( p_vout->p_sys->p_qdport ); SetPort( p_vout->p_sys->p_qdport );
QTScaleMatrix( p_vout ); QTScaleMatrix( p_vout );
...@@ -319,10 +351,13 @@ void E_(CloseVideo) ( vlc_object_t *p_this ) ...@@ -319,10 +351,13 @@ void E_(CloseVideo) ( vlc_object_t *p_this )
{ {
vout_thread_t * p_vout = (vout_thread_t *)p_this; vout_thread_t * p_vout = (vout_thread_t *)p_this;
if ( p_vout->p_sys->isplugin == 0)
{
if( CoDestroyWindow( p_vout ) ) if( CoDestroyWindow( p_vout ) )
{ {
msg_Err( p_vout, "unable to destroy window" ); msg_Err( p_vout, "unable to destroy window" );
} }
}
if ( p_vout->p_sys->p_fullscreen_state != NULL ) if ( p_vout->p_sys->p_fullscreen_state != NULL )
EndFullScreen ( p_vout->p_sys->p_fullscreen_state, NULL ); EndFullScreen ( p_vout->p_sys->p_fullscreen_state, NULL );
...@@ -343,6 +378,9 @@ void E_(CloseVideo) ( vlc_object_t *p_this ) ...@@ -343,6 +378,9 @@ void E_(CloseVideo) ( vlc_object_t *p_this )
*****************************************************************************/ *****************************************************************************/
static int vout_Manage( vout_thread_t *p_vout ) static int vout_Manage( vout_thread_t *p_vout )
{ {
vlc_value_t val1;
var_Get( p_vout->p_vlc, "drawableredraw", &val1 );
if( p_vout->i_changes & VOUT_FULLSCREEN_CHANGE ) if( p_vout->i_changes & VOUT_FULLSCREEN_CHANGE )
{ {
if( CoToggleFullscreen( p_vout ) ) if( CoToggleFullscreen( p_vout ) )
...@@ -353,13 +391,21 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -353,13 +391,21 @@ static int vout_Manage( vout_thread_t *p_vout )
p_vout->i_changes &= ~VOUT_FULLSCREEN_CHANGE; p_vout->i_changes &= ~VOUT_FULLSCREEN_CHANGE;
} }
if( p_vout->i_changes & VOUT_SIZE_CHANGE ) if( (p_vout->i_changes & VOUT_SIZE_CHANGE) || (val1.i_int == 1))
{
if (val1.i_int == 1)
{ {
val1.i_int = 0;
var_Set( p_vout->p_vlc, "drawableredraw", val1 );
SetDSequenceMask( p_vout->p_sys->i_seq , p_vout->p_sys->mask );
} else if (p_vout->i_changes & VOUT_SIZE_CHANGE)
{
p_vout->i_changes &= ~VOUT_SIZE_CHANGE;
}
QTScaleMatrix( p_vout ); QTScaleMatrix( p_vout );
SetDSequenceMatrix( p_vout->p_sys->i_seq, SetDSequenceMatrix( p_vout->p_sys->i_seq,
p_vout->p_sys->p_matrix ); p_vout->p_sys->p_matrix );
p_vout->i_changes &= ~VOUT_SIZE_CHANGE;
} }
/* hide/show mouse cursor /* hide/show mouse cursor
...@@ -421,6 +467,16 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -421,6 +467,16 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
OSErr err; OSErr err;
CodecFlags flags; CodecFlags flags;
if( p_vout->p_sys->isplugin )
{
/* In mozilla plugin, mozilla browser also draws things in
* the windows. So we have to update the port/Origin for each
* picture. FIXME : the vout should lock something ! */
GetPort( &p_vout->p_sys->p_qdportold );
SetPort( p_vout->p_sys->p_qdport );
SetOrigin( p_vout->p_sys->portx , p_vout->p_sys->porty );
if( ( err = DecompressSequenceFrameS( if( ( err = DecompressSequenceFrameS(
p_vout->p_sys->i_seq, p_vout->p_sys->i_seq,
p_pic->p_sys->p_info, p_pic->p_sys->p_info,
...@@ -433,6 +489,24 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -433,6 +489,24 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
{ {
QDFlushPortBuffer( p_vout->p_sys->p_qdport, nil ); QDFlushPortBuffer( p_vout->p_sys->p_qdport, nil );
} }
SetPort( p_vout->p_sys->p_qdportold );
}
else
{
if( ( err = DecompressSequenceFrameS(
p_vout->p_sys->i_seq,
p_pic->p_sys->p_info,
p_pic->p_sys->i_size,
codecFlagUseImageBuffer, &flags, nil ) != noErr ) )
{
msg_Warn( p_vout, "DecompressSequenceFrameS failed: %d", err );
}
else
{
QDFlushPortBuffer( p_vout->p_sys->p_qdport, nil );
}
}
} }
/***************************************************************************** /*****************************************************************************
...@@ -518,9 +592,6 @@ static int CoToggleFullscreen( vout_thread_t *p_vout ) ...@@ -518,9 +592,6 @@ static int CoToggleFullscreen( vout_thread_t *p_vout )
return( 1 ); return( 1 );
} }
SetPort( p_vout->p_sys->p_qdport );
QTScaleMatrix( p_vout );
if( QTCreateSequence( p_vout ) ) if( QTCreateSequence( p_vout ) )
{ {
msg_Err( p_vout, "unable to create sequence" ); msg_Err( p_vout, "unable to create sequence" );
...@@ -572,12 +643,45 @@ static void QTScaleMatrix( vout_thread_t *p_vout ) ...@@ -572,12 +643,45 @@ static void QTScaleMatrix( vout_thread_t *p_vout )
Fixed factor_x, factor_y; Fixed factor_x, factor_y;
unsigned int i_offset_x = 0; unsigned int i_offset_x = 0;
unsigned int i_offset_y = 0; unsigned int i_offset_y = 0;
vlc_value_t val;
vlc_value_t valt;
vlc_value_t vall;
vlc_value_t valb;
vlc_value_t valr;
vlc_value_t valx;
vlc_value_t valy;
vlc_value_t valw;
vlc_value_t valh;
vlc_value_t valportx;
vlc_value_t valporty;
GetPortBounds( p_vout->p_sys->p_qdport, &s_rect ); GetPortBounds( p_vout->p_sys->p_qdport, &s_rect );
i_width = s_rect.right - s_rect.left; i_width = s_rect.right - s_rect.left;
i_height = s_rect.bottom - s_rect.top; i_height = s_rect.bottom - s_rect.top;
var_Get( p_vout->p_vlc, "drawable", &val );
var_Get( p_vout->p_vlc, "drawablet", &valt );
var_Get( p_vout->p_vlc, "drawablel", &vall );
var_Get( p_vout->p_vlc, "drawableb", &valb );
var_Get( p_vout->p_vlc, "drawabler", &valr );
var_Get( p_vout->p_vlc, "drawablex", &valx );
var_Get( p_vout->p_vlc, "drawabley", &valy );
var_Get( p_vout->p_vlc, "drawablew", &valw );
var_Get( p_vout->p_vlc, "drawableh", &valh );
var_Get( p_vout->p_vlc, "drawableportx", &valportx );
var_Get( p_vout->p_vlc, "drawableporty", &valporty );
if( p_vout->p_sys->isplugin )
{
p_vout->p_sys->portx = valportx.i_int;
p_vout->p_sys->porty = valporty.i_int;
p_vout->p_sys->p_qdport = val.i_int;
i_width = valw.i_int;
i_height = valh.i_int;
SetRectRgn( p_vout->p_sys->mask , 0 , 0 , valr.i_int - vall.i_int , valb.i_int - valt.i_int );
}
if( i_height * p_vout->output.i_aspect < i_width * VOUT_ASPECT_FACTOR ) if( i_height * p_vout->output.i_aspect < i_width * VOUT_ASPECT_FACTOR )
{ {
int i_adj_width = i_height * p_vout->output.i_aspect / int i_adj_width = i_height * p_vout->output.i_aspect /
...@@ -588,7 +692,7 @@ static void QTScaleMatrix( vout_thread_t *p_vout ) ...@@ -588,7 +692,7 @@ static void QTScaleMatrix( vout_thread_t *p_vout )
factor_y = FixDiv( Long2Fix( i_height ), factor_y = FixDiv( Long2Fix( i_height ),
Long2Fix( p_vout->output.i_height ) ); Long2Fix( p_vout->output.i_height ) );
i_offset_x = (i_width - i_adj_width) / 2; i_offset_x = (i_width - i_adj_width) / 2 + i_offset_x;
} }
else else
{ {
...@@ -600,7 +704,7 @@ static void QTScaleMatrix( vout_thread_t *p_vout ) ...@@ -600,7 +704,7 @@ static void QTScaleMatrix( vout_thread_t *p_vout )
factor_y = FixDiv( Long2Fix( i_adj_height ), factor_y = FixDiv( Long2Fix( i_adj_height ),
Long2Fix( p_vout->output.i_height ) ); Long2Fix( p_vout->output.i_height ) );
i_offset_y = (i_height - i_adj_height) / 2; i_offset_y = (i_height - i_adj_height) / 2 + i_offset_y;
} }
SetIdentityMatrix( p_vout->p_sys->p_matrix ); SetIdentityMatrix( p_vout->p_sys->p_matrix );
...@@ -612,6 +716,7 @@ static void QTScaleMatrix( vout_thread_t *p_vout ) ...@@ -612,6 +716,7 @@ static void QTScaleMatrix( vout_thread_t *p_vout )
TranslateMatrix( p_vout->p_sys->p_matrix, TranslateMatrix( p_vout->p_sys->p_matrix,
Long2Fix(i_offset_x), Long2Fix(i_offset_x),
Long2Fix(i_offset_y) ); Long2Fix(i_offset_y) );
} }
/***************************************************************************** /*****************************************************************************
...@@ -642,8 +747,10 @@ static int QTCreateSequence( vout_thread_t *p_vout ) ...@@ -642,8 +747,10 @@ static int QTCreateSequence( vout_thread_t *p_vout )
p_descr->dataSize = 0; p_descr->dataSize = 0;
p_descr->depth = 24; p_descr->depth = 24;
HUnlock( (Handle)p_vout->p_sys->h_img_descr ); HUnlock( (Handle)p_vout->p_sys->h_img_descr );
if( ( err = DecompressSequenceBeginS( if( ( err = DecompressSequenceBeginS(
&p_vout->p_sys->i_seq, &p_vout->p_sys->i_seq,
p_vout->p_sys->h_img_descr, p_vout->p_sys->h_img_descr,
...@@ -651,7 +758,7 @@ static int QTCreateSequence( vout_thread_t *p_vout ) ...@@ -651,7 +758,7 @@ static int QTCreateSequence( vout_thread_t *p_vout )
p_vout->p_sys->p_qdport, p_vout->p_sys->p_qdport,
NULL, NULL, NULL, NULL,
p_vout->p_sys->p_matrix, p_vout->p_sys->p_matrix,
0, NULL, 0, p_vout->p_sys->mask,
codecFlagUseImageBuffer, codecFlagUseImageBuffer,
codecLosslessQuality, codecLosslessQuality,
p_vout->p_sys->img_dc ) ) ) p_vout->p_sys->img_dc ) ) )
...@@ -660,6 +767,7 @@ static int QTCreateSequence( vout_thread_t *p_vout ) ...@@ -660,6 +767,7 @@ static int QTCreateSequence( vout_thread_t *p_vout )
return( 1 ); return( 1 );
} }
return( 0 ); return( 0 );
} }
...@@ -1309,12 +1417,14 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1309,12 +1417,14 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
} }
o_view = [[VLCView alloc] init]; o_view = [[VLCView alloc] init];
/* FIXME: [o_view setMenu:] */ /* FIXME: [o_view setMenu:] */
[p_vout->p_sys->o_window setContentView: o_view]; [p_vout->p_sys->o_window setContentView: o_view];
[o_view autorelease]; [o_view autorelease];
[o_view lockFocus]; [o_view lockFocus];
p_vout->p_sys->p_qdport = [o_view qdPort]; p_vout->p_sys->p_qdport = [o_view qdPort];
[o_view unlockFocus]; [o_view unlockFocus];
[p_vout->p_sys->o_window updateTitle]; [p_vout->p_sys->o_window updateTitle];
......
...@@ -29,8 +29,13 @@ SOURCES_win32 = support/npwin.cpp ...@@ -29,8 +29,13 @@ SOURCES_win32 = support/npwin.cpp
CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32 CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32
else else
if HAVE_DARWIN if HAVE_DARWIN
# We don't define LIBRARIES_mozilla because we'll be using project builder # We don't define LIBRARIES_mozilla because we'll be using project builder, or not...
SOURCES_macosx = support/npmac.cpp BUNDLE_mozilla = VLC\ Plugin.plugin
vlc_moz_FLAGS = `$(VLC_CONFIG) --libs vlc builtin pic mozilla`
moz_CFLAGS = `$(MOZILLA_CONFIG) --cflags plugin java nspr/obsolete nspr oji xpcom xpconnect`
moz_plugin_FLAGS = -c -F/System/Library/Frameworks/CoreFoundation.framework $(moz_CFLAGS) -I/Developer/Headers/FlatCarbon -arch ppc -fno-common -fpascal-strings -O0 -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -DXP_MACOSX=1 -DNO_X11=1 -DUSE_SYSTEM_CONSOLE=1 -pipe -fmessage-length=0 -g -include mozilla-config.h
else else
LIBRARIES_mozilla = libvlcplugin$(LIBEXT) LIBRARIES_mozilla = libvlcplugin$(LIBEXT)
SOURCES_unix = support/npunix.c SOURCES_unix = support/npunix.c
...@@ -52,7 +57,7 @@ libplugin_a_DEPENDENCIES = $(DATA_npvlc_rc) ...@@ -52,7 +57,7 @@ libplugin_a_DEPENDENCIES = $(DATA_npvlc_rc)
BUILT_SOURCES_mozilla = vlcintf.h BUILT_SOURCES_mozilla = vlcintf.h
$(SOURCES_mozilla): vlcintf.h $(SOURCES_mozilla): vlcintf.h
plugin_DATA = $(LIBRARIES_mozilla) plugin_DATA = $(LIBRARIES_mozilla) $(BUNDLE_mozilla)
plugindir = $(libdir)/mozilla/plugins plugindir = $(libdir)/mozilla/plugins
$(LIBRARIES_mozilla): $(libplugin_a_OBJECTS) \ $(LIBRARIES_mozilla): $(libplugin_a_OBJECTS) \
$(libplugin_a_DEPENDENCIES) stamp-pic $(libplugin_a_DEPENDENCIES) stamp-pic
...@@ -75,14 +80,29 @@ DATA_npvlc_rc = $(noinst_npvlc_rc_DATA) ...@@ -75,14 +80,29 @@ DATA_npvlc_rc = $(noinst_npvlc_rc_DATA)
noinst_npvlc_rc_DATA = npvlc_rc.$(OBJEXT) noinst_npvlc_rc_DATA = npvlc_rc.$(OBJEXT)
noinst_npvlc_rcdir = $(libdir) noinst_npvlc_rcdir = $(libdir)
npvlc_rc.$(OBJEXT): npvlc_rc.rc npvlc_rc.$(OBJEXT): npvlc_rc.rc
$(WINDRES) --include-dir $(srcdir)/mozilla -i $< -o $@ $(WINDRES) --include-dir $(srcdir) -i $< -o $@
endif
if HAVE_DARWIN
VLC\ Plugin.plugin:
rm -rf $(srcdir)/VLC\ Plugin.plugin
mkdir -p $(srcdir)/VLC\ Plugin.plugin/Contents/MacOS
mkdir -p $(srcdir)/VLC\ Plugin.plugin/Contents/Resources
/usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/vlcplugin.cpp -o $(srcdir)/libplugin_a-vlcplugin.o
/usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/vlcshell.cpp -o $(srcdir)/libplugin_a-vlcshell.o
/usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/vlcpeer.cpp -o $(srcdir)/libplugin_a-vlcpeer.o
/usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/support/npmac.cpp -o $(srcdir)/libplugin_a-npmac.o
/usr/bin/g++3 $(srcdir)/libplugin_a-vlcplugin.o $(srcdir)/libplugin_a-vlcshell.o $(srcdir)/libplugin_a-vlcpeer.o $(srcdir)/libplugin_a-npmac.o -o $(srcdir)/VLC\ Plugin.plugin/Contents/MacOS/VLC\ Plugin -L/usr/lib -F/System/Library/Frameworks/CoreFoundation.framework -framework CoreFoundation -arch ppc -bundle -read_only_relocs suppress $(top_srcdir)/lib/libvlc_pic.a -dylib $(vlc_moz_FLAGS)
cp $(top_srcdir)/extras/MacOSX/plugin/Info.plist $(srcdir)/VLC\ Plugin.plugin/Contents/Info.plist
cp $(top_srcdir)/extras/MacOSX/plugin/pbdevelopment.plist $(srcdir)/VLC\ Plugin.plugin/Contents/pbdevelopment.plist
cp -r $(top_srcdir)/extras/MacOSX/plugin/English.lproj $(srcdir)/VLC\ Plugin.plugin/Contents/Resources/
Rez /Developer/Headers/FlatCarbon/Types.r $(srcdir)/vlc.r -o $(srcdir)/VLC\ Plugin.plugin/Contents/Resources/Vlc\ Plugin.rsrc
endif endif
endif endif
############################################################################### ###############################################################################
# Stamp rules # Stamp rules
############################################################################### ###############################################################################
clean: clean-stamp clean: clean-stamp clean-bundle
clean-stamp: clean-stamp:
rm -f stamp-pic rm -f stamp-pic
...@@ -95,6 +115,9 @@ stamp-pic: FORCE ...@@ -95,6 +115,9 @@ stamp-pic: FORCE
done done
@if test ! -f $@; then printf "" > $@; fi @if test ! -f $@; then printf "" > $@; fi
clean-bundle:
rm -rf $(srcdir)/VLC\ Plugin.plugin
############################################################################### ###############################################################################
# Force rule # Force rule
############################################################################### ###############################################################################
......
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// //
// npmac.cpp // npmac.cpp
// //
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#include <string.h>
#include <Processes.h> #include <Processes.h>
#include <Gestalt.h> #include <Gestalt.h>
#include <CodeFragments.h> #include <CodeFragments.h>
...@@ -48,26 +14,23 @@ ...@@ -48,26 +14,23 @@
#include <ToolUtils.h> #include <ToolUtils.h>
#define XP_MAC 1 #define XP_MAC 1
#define NDEBUG 1
// //
// A4Stuff.h contains the definition of EnterCodeResource and // A4Stuff.h contains the definition of EnterCodeResource and
// EnterCodeResource, used for setting up the code resources // EnterCodeResource, used for setting up the code resources
// globals for 68K (analagous to the function SetCurrentA5 // globals for 68K (analagous to the function SetCurrentA5
// defined by the toolbox). // defined by the toolbox).
// //
// A4Stuff does not exist as of CW 7. Define them to nothing. // A4Stuff does not exist as of CW 7. Define them to nothing.
// //
#if defined(XP_MACOSX) || (defined(__MWERKS__) && (__MWERKS__ >= 0x2400)) #if (defined(__MWERKS__) && (__MWERKS__ >= 0x2400)) || defined(__GNUC__)
#define EnterCodeResource() #define EnterCodeResource()
#define ExitCodeResource() #define ExitCodeResource()
#else #else
#include <A4Stuff.h> #include <A4Stuff.h>
#endif #endif
#include "nscore.h"
#include "jri.h"
#include "npapi.h" #include "npapi.h"
// //
...@@ -94,7 +57,7 @@ ...@@ -94,7 +57,7 @@
#endif #endif
#endif #endif
// The following fix for static initializers (which fixes a preious // The following fix for static initializers (which fixes a previous
// incompatibility with some parts of PowerPlant, was submitted by // incompatibility with some parts of PowerPlant, was submitted by
// Jan Ulbrich. // Jan Ulbrich.
#ifdef __MWERKS__ #ifdef __MWERKS__
...@@ -117,7 +80,7 @@ ...@@ -117,7 +80,7 @@
// Define PLUGIN_TRACE to 1 to have the wrapper functions emit // Define PLUGIN_TRACE to 1 to have the wrapper functions emit
// DebugStr messages whenever they are called. // DebugStr messages whenever they are called.
// //
#define PLUGIN_TRACE 0 //#define PLUGIN_TRACE 1
#if PLUGIN_TRACE #if PLUGIN_TRACE
#define PLUGINDEBUGSTR(msg) ::DebugStr(msg) #define PLUGINDEBUGSTR(msg) ::DebugStr(msg)
...@@ -126,8 +89,91 @@ ...@@ -126,8 +89,91 @@
#endif #endif
#ifdef XP_MACOSX
// glue for mapping outgoing Macho function pointers to TVectors
struct TFPtoTVGlue{
void* glue[2];
};
struct {
TFPtoTVGlue newp;
TFPtoTVGlue destroy;
TFPtoTVGlue setwindow;
TFPtoTVGlue newstream;
TFPtoTVGlue destroystream;
TFPtoTVGlue asfile;
TFPtoTVGlue writeready;
TFPtoTVGlue write;
TFPtoTVGlue print;
TFPtoTVGlue event;
TFPtoTVGlue urlnotify;
TFPtoTVGlue getvalue;
TFPtoTVGlue setvalue;
TFPtoTVGlue shutdown;
} gPluginFuncsGlueTable;
static inline void* SetupFPtoTVGlue(TFPtoTVGlue* functionGlue, void* fp)
{
functionGlue->glue[0] = fp;
functionGlue->glue[1] = 0;
return functionGlue;
}
#define PLUGIN_TO_HOST_GLUE(name, fp) (SetupFPtoTVGlue(&gPluginFuncsGlueTable.name, (void*)fp))
// glue for mapping netscape TVectors to Macho function pointers
struct TTVtoFPGlue {
uint32 glue[6];
};
struct {
TTVtoFPGlue geturl;
TTVtoFPGlue posturl;
TTVtoFPGlue requestread;
TTVtoFPGlue newstream;
TTVtoFPGlue write;
TTVtoFPGlue destroystream;
TTVtoFPGlue status;
TTVtoFPGlue uagent;
TTVtoFPGlue memalloc;
TTVtoFPGlue memfree;
TTVtoFPGlue memflush;
TTVtoFPGlue reloadplugins;
TTVtoFPGlue getJavaEnv;
TTVtoFPGlue getJavaPeer;
TTVtoFPGlue geturlnotify;
TTVtoFPGlue posturlnotify;
TTVtoFPGlue getvalue;
TTVtoFPGlue setvalue;
TTVtoFPGlue invalidaterect;
TTVtoFPGlue invalidateregion;
TTVtoFPGlue forceredraw;
} gNetscapeFuncsGlueTable;
static void* SetupTVtoFPGlue(TTVtoFPGlue* functionGlue, void* tvp)
{
static const TTVtoFPGlue glueTemplate = { 0x3D800000, 0x618C0000, 0x800C0000, 0x804C0004, 0x7C0903A6, 0x4E800420 };
memcpy(functionGlue, &glueTemplate, sizeof(TTVtoFPGlue));
functionGlue->glue[0] |= ((UInt32)tvp >> 16);
functionGlue->glue[1] |= ((UInt32)tvp & 0xFFFF);
::MakeDataExecutable(functionGlue, sizeof(TTVtoFPGlue));
return functionGlue;
}
#define HOST_TO_PLUGIN_GLUE(name, fp) (SetupTVtoFPGlue(&gNetscapeFuncsGlueTable.name, (void*)fp))
#else
#define PLUGIN_TO_HOST_GLUE(name, fp) (fp)
#define HOST_TO_PLUGIN_GLUE(name, fp) (fp)
#endif /* XP_MACOSX */
#pragma mark -
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
...@@ -136,13 +182,12 @@ ...@@ -136,13 +182,12 @@
// //
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#if !OPAQUE_TOOLBOX_STRUCTS || !TARGET_API_MAC_CARBON #if !TARGET_API_MAC_CARBON
QDGlobals* gQDPtr; // Pointer to Netscapes QuickDraw globals QDGlobals* gQDPtr; // Pointer to Netscapes QuickDraw globals
#endif #endif
short gResFile; // Refnum of the plugins resource file short gResFile; // Refnum of the plugins resource file
NPNetscapeFuncs gNetscapeFuncs; // Function table for procs in Netscape called by plugin NPNetscapeFuncs gNetscapeFuncs; // Function table for procs in Netscape called by plugin
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// //
// Wrapper functions for all calls from the plugin to Netscape. // Wrapper functions for all calls from the plugin to Netscape.
...@@ -267,24 +312,14 @@ const char* NPN_UserAgent(NPP instance) ...@@ -267,24 +312,14 @@ const char* NPN_UserAgent(NPP instance)
return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance); return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance);
} }
#define DEBUG_MEMORY 0
void* NPN_MemAlloc(uint32 size) void* NPN_MemAlloc(uint32 size)
{ {
#if DEBUG_MEMORY
return (void*) NewPtrClear(size);
#else
return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size); return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size);
#endif
} }
void NPN_MemFree(void* ptr) void NPN_MemFree(void* ptr)
{ {
#if DEBUG_MEMORY
DisposePtr(Ptr(ptr));
#else
CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr); CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr);
#endif
} }
uint32 NPN_MemFlush(uint32 size) uint32 NPN_MemFlush(uint32 size)
...@@ -297,16 +332,17 @@ void NPN_ReloadPlugins(NPBool reloadPages) ...@@ -297,16 +332,17 @@ void NPN_ReloadPlugins(NPBool reloadPages)
CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages); CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages);
} }
#ifdef OJI
JRIEnv* NPN_GetJavaEnv(void) JRIEnv* NPN_GetJavaEnv(void)
{ {
return CallNPN_GetJavaEnvProc( gNetscapeFuncs.getJavaEnv ); return CallNPN_GetJavaEnvProc( gNetscapeFuncs.getJavaEnv );
} }
jref NPN_GetJavaPeer(NPP instance) jobject NPN_GetJavaPeer(NPP instance)
{ {
return CallNPN_GetJavaPeerProc( gNetscapeFuncs.getJavaPeer, instance ); return CallNPN_GetJavaPeerProc( gNetscapeFuncs.getJavaPeer, instance );
} }
#endif
NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value) NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
{ {
...@@ -333,6 +369,8 @@ void NPN_ForceRedraw(NPP instance) ...@@ -333,6 +369,8 @@ void NPN_ForceRedraw(NPP instance)
CallNPN_ForceRedrawProc( gNetscapeFuncs.forceredraw, instance); CallNPN_ForceRedrawProc( gNetscapeFuncs.forceredraw, instance);
} }
#pragma mark -
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// //
// Wrapper functions for all calls from Netscape to the plugin. // Wrapper functions for all calls from Netscape to the plugin.
...@@ -356,7 +394,7 @@ void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname); ...@@ -356,7 +394,7 @@ void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
void Private_Print(NPP instance, NPPrint* platformPrint); void Private_Print(NPP instance, NPPrint* platformPrint);
int16 Private_HandleEvent(NPP instance, void* event); int16 Private_HandleEvent(NPP instance, void* event);
void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData); void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData);
jref Private_GetJavaClass(void); jobject Private_GetJavaClass(void);
NPError Private_Initialize(void) NPError Private_Initialize(void)
...@@ -375,7 +413,7 @@ void Private_Shutdown(void) ...@@ -375,7 +413,7 @@ void Private_Shutdown(void)
PLUGINDEBUGSTR("\pShutdown;g;"); PLUGINDEBUGSTR("\pShutdown;g;");
NPP_Shutdown(); NPP_Shutdown();
#ifndef XP_MACOSX #ifdef __MWERKS__
__destroy_global_chain(); __destroy_global_chain();
#endif #endif
...@@ -487,28 +525,27 @@ void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* not ...@@ -487,28 +525,27 @@ void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* not
ExitCodeResource(); ExitCodeResource();
} }
#ifdef OJI
jref Private_GetJavaClass(void) jobject Private_GetJavaClass(void)
{ {
EnterCodeResource(); EnterCodeResource();
PLUGINDEBUGSTR("\pGetJavaClass;g;"); PLUGINDEBUGSTR("\pGetJavaClass;g;");
jref clazz = NPP_GetJavaClass(); jobject clazz = NPP_GetJavaClass();
ExitCodeResource(); ExitCodeResource();
if (clazz) if (clazz)
{ {
JRIEnv* env = NPN_GetJavaEnv(); JRIEnv* env = NPN_GetJavaEnv();
return (jref)JRI_NewGlobalRef(env, clazz); return (jobject)JRI_NewGlobalRef(env, clazz);
} }
return NULL; return NULL;
} }
#endif
void SetUpQD(void); void SetUpQD(void);
void SetUpQD(void) void SetUpQD(void)
{ {
#if !OPAQUE_TOOLBOX_STRUCTS || !TARGET_API_MAC_CARBON #if !TARGET_API_MAC_CARBON
ProcessSerialNumber PSN; ProcessSerialNumber PSN;
FSSpec myFSSpec; FSSpec myFSSpec;
Str63 name; Str63 name;
...@@ -516,13 +553,15 @@ void SetUpQD(void) ...@@ -516,13 +553,15 @@ void SetUpQD(void)
OSErr result = noErr; OSErr result = noErr;
CFragConnectionID connID; CFragConnectionID connID;
Str255 errName; Str255 errName;
#endif
// //
// Memorize the plugins resource file // Memorize the plugins resource file
// refnum for later use. // refnum for later use.
// //
gResFile = CurResFile(); gResFile = CurResFile();
#if !TARGET_API_MAC_CARBON
// //
// Ask the system if CFM is available. // Ask the system if CFM is available.
// //
...@@ -530,6 +569,7 @@ void SetUpQD(void) ...@@ -530,6 +569,7 @@ void SetUpQD(void)
OSErr err = Gestalt(gestaltCFMAttr, &response); OSErr err = Gestalt(gestaltCFMAttr, &response);
Boolean hasCFM = BitTst(&response, 31-gestaltCFMPresent); Boolean hasCFM = BitTst(&response, 31-gestaltCFMPresent);
ProcessInfoRec infoRec;
if (hasCFM) if (hasCFM)
{ {
// //
...@@ -537,10 +577,13 @@ void SetUpQD(void) ...@@ -537,10 +577,13 @@ void SetUpQD(void)
// will give us back the name and FSSpec of the application. // will give us back the name and FSSpec of the application.
// See the Process Manager in IM. // See the Process Manager in IM.
// //
Str63 name;
FSSpec myFSSpec;
infoRec.processInfoLength = sizeof(ProcessInfoRec); infoRec.processInfoLength = sizeof(ProcessInfoRec);
infoRec.processName = name; infoRec.processName = name;
infoRec.processAppSpec = &myFSSpec; infoRec.processAppSpec = &myFSSpec;
ProcessSerialNumber PSN;
PSN.highLongOfPSN = 0; PSN.highLongOfPSN = 0;
PSN.lowLongOfPSN = kCurrentProcess; PSN.lowLongOfPSN = kCurrentProcess;
...@@ -554,30 +597,33 @@ void SetUpQD(void) ...@@ -554,30 +597,33 @@ void SetUpQD(void)
// //
result = -1; result = -1;
CFragConnectionID connID;
if (result == noErr) if (result == noErr)
{ {
// //
// Now that we know the app name and FSSpec, we can call GetDiskFragment // Now that we know the app name and FSSpec, we can call GetDiskFragment
// to get a connID to use in a subsequent call to FindSymbol (it will also // to get a connID to use in a subsequent call to FindSymbol (it will also
// return the address of main in app, which we ignore). If GetDiskFragment // return the address of main in app, which we ignore). If GetDiskFragment
// returns an error, we assume the app must be 68K. // returns an error, we assume the app must be 68K.
// //
Ptr mainAddr; Ptr mainAddr;
Str255 errName;
result = GetDiskFragment(infoRec.processAppSpec, 0L, 0L, infoRec.processName, result = GetDiskFragment(infoRec.processAppSpec, 0L, 0L, infoRec.processName,
kReferenceCFrag, &connID, (Ptr*)&mainAddr, errName); kLoadCFrag, &connID, (Ptr*)&mainAddr, errName);
} }
if (result == noErr) if (result == noErr)
{ {
// //
// The app is a PPC code fragment, so call FindSymbol // The app is a PPC code fragment, so call FindSymbol
// to get the exported qd symbol so we can access its // to get the exported qd symbol so we can access its
// QuickDraw globals. // QuickDraw globals.
// //
CFragSymbolClass symClass; CFragSymbolClass symClass;
result = FindSymbol(connID, "\pqd", (Ptr*)&gQDPtr, &symClass); result = FindSymbol(connID, "\pqd", (Ptr*)&gQDPtr, &symClass);
if (result != noErr) if (result != noErr) { // this fails if we are in NS 6
PLUGINDEBUGSTR("\pFailed in FindSymbol qd"); gQDPtr = &qd; // so we default to the standard QD globals
}
} }
else else
{ {
...@@ -591,33 +637,34 @@ void SetUpQD(void) ...@@ -591,33 +637,34 @@ void SetUpQD(void)
} }
#ifdef __GNUC__
#if TARGET_RT_MAC_CFM && !TARGET_API_MAC_CARBON // gcc requires that main have an 'int' return type
NPError int main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp);
#else #else
int NPError main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp);
#endif #endif
main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp);
#if !TARGET_API_MAC_CARBON
#pragma export on #pragma export on
#if GENERATINGCFM
#if TARGET_RT_MAC_CFM && !TARGET_API_MAC_CARBON
RoutineDescriptor mainRD = BUILD_ROUTINE_DESCRIPTOR(uppNPP_MainEntryProcInfo, main); RoutineDescriptor mainRD = BUILD_ROUTINE_DESCRIPTOR(uppNPP_MainEntryProcInfo, main);
#endif #endif
#pragma export off #pragma export off
#endif /* !TARGET_API_MAC_CARBON */
#ifdef __GNUC__
#if TARGET_RT_MAC_CFM && !TARGET_API_MAC_CARBON DEFINE_API_C(int) main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp)
NPError
#else #else
int DEFINE_API_C(NPError) main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp)
#endif #endif
main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp)
{ {
EnterCodeResource(); EnterCodeResource();
PLUGINDEBUGSTR("\pmain"); PLUGINDEBUGSTR("\pmain");
#ifdef __MWERKS__
__InitCode__();
#endif
NPError err = NPERR_NO_ERROR; NPError err = NPERR_NO_ERROR;
// //
...@@ -627,27 +674,23 @@ main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unlo ...@@ -627,27 +674,23 @@ main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unlo
err = NPERR_INVALID_FUNCTABLE_ERROR; err = NPERR_INVALID_FUNCTABLE_ERROR;
// //
// Check the major version passed in Netscapes function table. // Check the major version passed in Netscapes function table.
// We wont load if the major version is newer than what we expect. // We wont load if the major version is newer than what we expect.
// Also check that the function tables passed in are big enough for // Also check that the function tables passed in are big enough for
// all the functions we need (they could be bigger, if Netscape added // all the functions we need (they could be bigger, if Netscape added
// new APIs, but thats OK with us -- well just ignore them). // new APIs, but thats OK with us -- well just ignore them).
// //
if (err == NPERR_NO_ERROR) if (err == NPERR_NO_ERROR)
{ {
if ((nsTable->version >> 8) > NP_VERSION_MAJOR) // Major version is in high byte if ((nsTable->version >> 8) > NP_VERSION_MAJOR) // Major version is in high byte
err = NPERR_INCOMPATIBLE_VERSION_ERROR; err = NPERR_INCOMPATIBLE_VERSION_ERROR;
// if (nsTable->size < sizeof(NPNetscapeFuncs))
// err = NPERR_INVALID_FUNCTABLE_ERROR;
// if (pluginFuncs->size < sizeof(NPPluginFuncs))
// err = NPERR_INVALID_FUNCTABLE_ERROR;
} }
if (err == NPERR_NO_ERROR) if (err == NPERR_NO_ERROR)
{ {
// //
// Copy all the fields of Netscapes function table into our // Copy all the fields of Netscapes function table into our
// copy so we can call back into Netscape later. Note that // copy so we can call back into Netscape later. Note that
// we need to copy the fields one by one, rather than assigning // we need to copy the fields one by one, rather than assigning
// the whole structure, because the Netscape function table // the whole structure, because the Netscape function table
...@@ -658,38 +701,33 @@ main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unlo ...@@ -658,38 +701,33 @@ main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unlo
gNetscapeFuncs.version = nsTable->version; gNetscapeFuncs.version = nsTable->version;
gNetscapeFuncs.size = nsTable->size; gNetscapeFuncs.size = nsTable->size;
gNetscapeFuncs.posturl = nsTable->posturl; gNetscapeFuncs.posturl = (NPN_PostURLUPP)HOST_TO_PLUGIN_GLUE(posturl, nsTable->posturl);
gNetscapeFuncs.geturl = nsTable->geturl; gNetscapeFuncs.geturl = (NPN_GetURLUPP)HOST_TO_PLUGIN_GLUE(geturl, nsTable->geturl);
gNetscapeFuncs.requestread = nsTable->requestread; gNetscapeFuncs.requestread = (NPN_RequestReadUPP)HOST_TO_PLUGIN_GLUE(requestread, nsTable->requestread);
gNetscapeFuncs.newstream = nsTable->newstream; gNetscapeFuncs.newstream = (NPN_NewStreamUPP)HOST_TO_PLUGIN_GLUE(newstream, nsTable->newstream);
gNetscapeFuncs.write = nsTable->write; gNetscapeFuncs.write = (NPN_WriteUPP)HOST_TO_PLUGIN_GLUE(write, nsTable->write);
gNetscapeFuncs.destroystream = nsTable->destroystream; gNetscapeFuncs.destroystream = (NPN_DestroyStreamUPP)HOST_TO_PLUGIN_GLUE(destroystream, nsTable->destroystream);
gNetscapeFuncs.status = nsTable->status; gNetscapeFuncs.status = (NPN_StatusUPP)HOST_TO_PLUGIN_GLUE(status, nsTable->status);
gNetscapeFuncs.uagent = nsTable->uagent; gNetscapeFuncs.uagent = (NPN_UserAgentUPP)HOST_TO_PLUGIN_GLUE(uagent, nsTable->uagent);
gNetscapeFuncs.memalloc = nsTable->memalloc; gNetscapeFuncs.memalloc = (NPN_MemAllocUPP)HOST_TO_PLUGIN_GLUE(memalloc, nsTable->memalloc);
gNetscapeFuncs.memfree = nsTable->memfree; gNetscapeFuncs.memfree = (NPN_MemFreeUPP)HOST_TO_PLUGIN_GLUE(memfree, nsTable->memfree);
gNetscapeFuncs.memflush = nsTable->memflush; gNetscapeFuncs.memflush = (NPN_MemFlushUPP)HOST_TO_PLUGIN_GLUE(memflush, nsTable->memflush);
gNetscapeFuncs.reloadplugins = nsTable->reloadplugins; gNetscapeFuncs.reloadplugins = (NPN_ReloadPluginsUPP)HOST_TO_PLUGIN_GLUE(reloadplugins, nsTable->reloadplugins);
if( navMinorVers >= NPVERS_HAS_LIVECONNECT ) if( navMinorVers >= NPVERS_HAS_LIVECONNECT )
{ {
gNetscapeFuncs.getJavaEnv = nsTable->getJavaEnv; gNetscapeFuncs.getJavaEnv = (NPN_GetJavaEnvUPP)HOST_TO_PLUGIN_GLUE(getJavaEnv, nsTable->getJavaEnv);
gNetscapeFuncs.getJavaPeer = nsTable->getJavaPeer; gNetscapeFuncs.getJavaPeer = (NPN_GetJavaPeerUPP)HOST_TO_PLUGIN_GLUE(getJavaPeer, nsTable->getJavaPeer);
} }
if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
{ {
gNetscapeFuncs.geturlnotify = nsTable->geturlnotify; gNetscapeFuncs.geturlnotify = (NPN_GetURLNotifyUPP)HOST_TO_PLUGIN_GLUE(geturlnotify, nsTable->geturlnotify);
gNetscapeFuncs.posturlnotify = nsTable->posturlnotify; gNetscapeFuncs.posturlnotify = (NPN_PostURLNotifyUPP)HOST_TO_PLUGIN_GLUE(posturlnotify, nsTable->posturlnotify);
} }
gNetscapeFuncs.getvalue = nsTable->getvalue; gNetscapeFuncs.getvalue = (NPN_GetValueUPP)HOST_TO_PLUGIN_GLUE(getvalue, nsTable->getvalue);
gNetscapeFuncs.setvalue = nsTable->setvalue; gNetscapeFuncs.setvalue = (NPN_SetValueUPP)HOST_TO_PLUGIN_GLUE(setvalue, nsTable->setvalue);
gNetscapeFuncs.invalidaterect = nsTable->invalidaterect; gNetscapeFuncs.invalidaterect = (NPN_InvalidateRectUPP)HOST_TO_PLUGIN_GLUE(invalidaterect, nsTable->invalidaterect);
gNetscapeFuncs.invalidateregion = nsTable->invalidateregion; gNetscapeFuncs.invalidateregion = (NPN_InvalidateRegionUPP)HOST_TO_PLUGIN_GLUE(invalidateregion, nsTable->invalidateregion);
gNetscapeFuncs.forceredraw = nsTable->forceredraw; gNetscapeFuncs.forceredraw = (NPN_ForceRedrawUPP)HOST_TO_PLUGIN_GLUE(forceredraw, nsTable->forceredraw);
// defer static constructors until the global functions are initialized.
#ifndef XP_MACOSX
__InitCode__();
#endif
// //
// Set up the plugin function table that Netscape will use to // Set up the plugin function table that Netscape will use to
...@@ -698,25 +736,30 @@ main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unlo ...@@ -698,25 +736,30 @@ main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unlo
// //
pluginFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR; pluginFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
pluginFuncs->size = sizeof(NPPluginFuncs); pluginFuncs->size = sizeof(NPPluginFuncs);
pluginFuncs->newp = NewNPP_NewProc(Private_New); pluginFuncs->newp = NewNPP_NewProc(PLUGIN_TO_HOST_GLUE(newp, Private_New));
pluginFuncs->destroy = NewNPP_DestroyProc(Private_Destroy); pluginFuncs->destroy = NewNPP_DestroyProc(PLUGIN_TO_HOST_GLUE(destroy, Private_Destroy));
pluginFuncs->setwindow = NewNPP_SetWindowProc(Private_SetWindow); pluginFuncs->setwindow = NewNPP_SetWindowProc(PLUGIN_TO_HOST_GLUE(setwindow, Private_SetWindow));
pluginFuncs->newstream = NewNPP_NewStreamProc(Private_NewStream); pluginFuncs->newstream = NewNPP_NewStreamProc(PLUGIN_TO_HOST_GLUE(newstream, Private_NewStream));
pluginFuncs->destroystream = NewNPP_DestroyStreamProc(Private_DestroyStream); pluginFuncs->destroystream = NewNPP_DestroyStreamProc(PLUGIN_TO_HOST_GLUE(destroystream, Private_DestroyStream));
pluginFuncs->asfile = NewNPP_StreamAsFileProc(Private_StreamAsFile); pluginFuncs->asfile = NewNPP_StreamAsFileProc(PLUGIN_TO_HOST_GLUE(asfile, Private_StreamAsFile));
pluginFuncs->writeready = NewNPP_WriteReadyProc(Private_WriteReady); pluginFuncs->writeready = NewNPP_WriteReadyProc(PLUGIN_TO_HOST_GLUE(writeready, Private_WriteReady));
pluginFuncs->write = NewNPP_WriteProc(Private_Write); pluginFuncs->write = NewNPP_WriteProc(PLUGIN_TO_HOST_GLUE(write, Private_Write));
pluginFuncs->print = NewNPP_PrintProc(Private_Print); pluginFuncs->print = NewNPP_PrintProc(PLUGIN_TO_HOST_GLUE(print, Private_Print));
pluginFuncs->event = NewNPP_HandleEventProc(Private_HandleEvent); pluginFuncs->event = NewNPP_HandleEventProc(PLUGIN_TO_HOST_GLUE(event, Private_HandleEvent));
if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
{ {
pluginFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify); pluginFuncs->urlnotify = NewNPP_URLNotifyProc(PLUGIN_TO_HOST_GLUE(urlnotify, Private_URLNotify));
} }
#ifdef OJI
if( navMinorVers >= NPVERS_HAS_LIVECONNECT ) if( navMinorVers >= NPVERS_HAS_LIVECONNECT )
{ {
pluginFuncs->javaClass = (JRIGlobalRef) Private_GetJavaClass(); pluginFuncs->javaClass = (JRIGlobalRef) Private_GetJavaClass();
} }
*unloadUpp = NewNPP_ShutdownProc(Private_Shutdown); #else
pluginFuncs->javaClass = NULL;
#endif
*unloadUpp = NewNPP_ShutdownProc(PLUGIN_TO_HOST_GLUE(shutdown, Private_Shutdown));
SetUpQD(); SetUpQD();
err = Private_Initialize(); err = Private_Initialize();
} }
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
*****************************************************************************/ *****************************************************************************/
/* Definitions of system resource types */ /* Definitions of system resource types */
#include <Types.r>
/* The first string in the array is a plugin description, /* The first string in the array is a plugin description,
* the second is the plugin name */ * the second is the plugin name */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vlcplugin.h: a VLC plugin for Mozilla * vlcplugin.h: a VLC plugin for Mozilla
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: vlcplugin.h,v 1.11 2003/07/17 09:25:58 sigmunau Exp $ * $Id: vlcplugin.h,v 1.12 2003/08/14 12:38:03 garf Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -24,6 +24,12 @@ ...@@ -24,6 +24,12 @@
/******************************************************************************* /*******************************************************************************
* Instance state information about the plugin. * Instance state information about the plugin.
******************************************************************************/ ******************************************************************************/
/* No, I really don't want to use XP_UNIX stuff on MacOSX */
#ifdef XP_MACOSX
#undef XP_UNIX
#endif
class VlcPlugin class VlcPlugin
{ {
public: public:
...@@ -53,6 +59,12 @@ public: ...@@ -53,6 +59,12 @@ public:
Display *p_display; Display *p_display;
#endif #endif
#ifdef XP_MACOSX
/* MACOS data members */
NPWindow *window;
#endif
/* vlc data members */ /* vlc data members */
int i_vlc; int i_vlc;
int b_stream; int b_stream;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vlcshell.cpp: a VLC plugin for Mozilla * vlcshell.cpp: a VLC plugin for Mozilla
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: vlcshell.cpp,v 1.15 2003/07/23 01:13:48 gbazin Exp $ * $Id: vlcshell.cpp,v 1.16 2003/08/14 12:38:03 garf Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -45,14 +45,7 @@ ...@@ -45,14 +45,7 @@
/* Windows stuff */ /* Windows stuff */
#endif #endif
#ifdef XP_UNIX #ifdef XP_MACOSX
/* X11 stuff */
# include <X11/Xlib.h>
# include <X11/Intrinsic.h>
# include <X11/StringDefs.h>
#endif
#ifdef XP_MAC
/* Mac OS X stuff */ /* Mac OS X stuff */
# include <QuickDraw.h> # include <QuickDraw.h>
#endif #endif
...@@ -66,6 +59,18 @@ ...@@ -66,6 +59,18 @@
# define WINDOW_TEXT "(no libvlc)" # define WINDOW_TEXT "(no libvlc)"
#endif #endif
/* No, I really don't want to use XP_UNIX stuff on MacOSX */
#ifdef XP_MACOSX
#undef XP_UNIX
#endif
#ifdef XP_UNIX
/* X11 stuff */
# include <X11/Xlib.h>
# include <X11/Intrinsic.h>
# include <X11/StringDefs.h>
#endif
/***************************************************************************** /*****************************************************************************
* Unix-only declarations * Unix-only declarations
******************************************************************************/ ******************************************************************************/
...@@ -76,6 +81,15 @@ ...@@ -76,6 +81,15 @@
static void Redraw( Widget w, XtPointer closure, XEvent *event ); static void Redraw( Widget w, XtPointer closure, XEvent *event );
#endif #endif
/*****************************************************************************
* MacOS-only declarations
******************************************************************************/
#ifdef XP_MACOSX
# define VOUT_PLUGINS "macosx"
# define AOUT_PLUGINS "macosx"
#endif
/***************************************************************************** /*****************************************************************************
* Windows-only declarations * Windows-only declarations
*****************************************************************************/ *****************************************************************************/
...@@ -176,23 +190,28 @@ NPError NPP_GetValue( NPP instance, NPPVariable variable, void *value ) ...@@ -176,23 +190,28 @@ NPError NPP_GetValue( NPP instance, NPPVariable variable, void *value )
/****************************************************************************** /******************************************************************************
* Mac-only API calls * Mac-only API calls
*****************************************************************************/ *****************************************************************************/
#ifdef XP_MAC #ifdef XP_MACOSX
int16 NPP_HandleEvent( NPP instance, void * event ) int16 NPP_HandleEvent( NPP instance, void * event )
{ {
VlcPlugin *p_plugin = (VlcPlugin*)instance->pdata;
vlc_value_t value;
if( instance == NULL ) if( instance == NULL )
{ {
return false; return false;
} }
Boolean eventHandled = false; EventRecord *pouetEvent = (EventRecord*)event;
#if 0 if (pouetEvent->what == 6)
TPlugin *pPlugin = (TPlugin*)instance->pdata;
if( pPlugin != NULL && event != NULL )
{ {
eventHandled = pPlugin->HandleEvent( *(EventRecord*)event ); value.i_int = 1;
VLC_Set( p_plugin->i_vlc, "drawableredraw", value );
return true;
} }
#endif
Boolean eventHandled = false;
return eventHandled; return eventHandled;
} }
...@@ -381,6 +400,20 @@ NPError NPP_Destroy( NPP instance, NPSavedData** save ) ...@@ -381,6 +400,20 @@ NPError NPP_Destroy( NPP instance, NPSavedData** save )
NPError NPP_SetWindow( NPP instance, NPWindow* window ) NPError NPP_SetWindow( NPP instance, NPWindow* window )
{ {
#ifdef XP_MACOSX
vlc_value_t value;
vlc_value_t valuex;
vlc_value_t valuey;
vlc_value_t valuew;
vlc_value_t valueh;
vlc_value_t valuet;
vlc_value_t valuel;
vlc_value_t valueb;
vlc_value_t valuer;
vlc_value_t valueportx;
vlc_value_t valueporty;
#endif
if( instance == NULL ) if( instance == NULL )
{ {
return NPERR_INVALID_INSTANCE_ERROR; return NPERR_INVALID_INSTANCE_ERROR;
...@@ -390,11 +423,42 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -390,11 +423,42 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
/* Write the window ID for vlc */ /* Write the window ID for vlc */
#if USE_LIBVLC #if USE_LIBVLC
vlc_value_t value;
#ifdef XP_MACOSX
value.i_int = ((NP_Port*) (window->window))->port;
VLC_Set( p_plugin->i_vlc, "drawable", value );
valueportx.i_int = ((NP_Port*) (window->window))->portx;
valueporty.i_int = ((NP_Port*) (window->window))->porty;
VLC_Set( p_plugin->i_vlc, "drawableportx", valueportx );
VLC_Set( p_plugin->i_vlc, "drawableporty", valueporty );
valuex.i_int = window->x;
valuey.i_int = window->y;
valuew.i_int = window->width;
valueh.i_int = window->height;
valuet.i_int = window->clipRect.top;
valuel.i_int = window->clipRect.left;
valueb.i_int = window->clipRect.bottom;
valuer.i_int = window->clipRect.right;
VLC_Set( p_plugin->i_vlc, "drawablet", valuet );
VLC_Set( p_plugin->i_vlc, "drawablel", valuel );
VLC_Set( p_plugin->i_vlc, "drawableb", valueb );
VLC_Set( p_plugin->i_vlc, "drawabler", valuer );
VLC_Set( p_plugin->i_vlc, "drawablex", valuex );
VLC_Set( p_plugin->i_vlc, "drawabley", valuey );
VLC_Set( p_plugin->i_vlc, "drawablew", valuew );
VLC_Set( p_plugin->i_vlc, "drawableh", valueh );
p_plugin->window = window;
#else
/* FIXME: this cast sucks */ /* FIXME: this cast sucks */
value.i_int = (int) (ptrdiff_t) (void *) window->window; value.i_int = (int) (ptrdiff_t) (void *) window->window;
VLC_Set( p_plugin->i_vlc, "drawable", value ); VLC_Set( p_plugin->i_vlc, "drawable", value );
#endif
#endif #endif
/* /*
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vlc\n" "Project-Id-Version: vlc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2003-08-11 21:05+0200\n" "POT-Creation-Date: 2003-08-11 21:05+0200\n"
"PO-Revision-Date: 2002-04-22 09:56+0200\n" "PO-Revision-Date: 2002-04-22 09:56+0200\n"
"Last-Translator: Samuel Hocevar <sam@zoy.org>\n" "Last-Translator: Samuel Hocevar <sam@zoy.org>\n"
...@@ -25,6 +24,7 @@ msgstr "" ...@@ -25,6 +24,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n" "Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Report-Msgid-Bugs-To: \n"
#: include/vlc_interface.h:105 #: include/vlc_interface.h:105
msgid "" msgid ""
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vlc\n" "Project-Id-Version: vlc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2003-08-11 21:05+0200\n" "POT-Creation-Date: 2003-08-11 21:05+0200\n"
"PO-Revision-Date: 2001-12-10 13:32+0100\n" "PO-Revision-Date: 2001-12-10 13:32+0100\n"
"Last-Translator: Jean-Pierre Kuypers <Kuypers@sri.ucl.ac.be> 2003-07-27\n" "Last-Translator: Jean-Pierre Kuypers <Kuypers@sri.ucl.ac.be> 2003-07-27\n"
...@@ -14,6 +13,7 @@ msgstr "" ...@@ -14,6 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n" "Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8-bit\n" "Content-Transfer-Encoding: 8-bit\n"
"Report-Msgid-Bugs-To: \n"
#: include/vlc_interface.h:105 #: include/vlc_interface.h:105
msgid "" msgid ""
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vlc\n" "Project-Id-Version: vlc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2003-08-11 21:05+0200\n" "POT-Creation-Date: 2003-08-11 21:05+0200\n"
"PO-Revision-Date: 2003-07-24 15:00+0100\n" "PO-Revision-Date: 2003-07-24 15:00+0100\n"
"Last-Translator: Vella Bruno\n" "Last-Translator: Vella Bruno\n"
...@@ -14,6 +13,7 @@ msgstr "" ...@@ -14,6 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n" "Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Report-Msgid-Bugs-To: \n"
#: include/vlc_interface.h:105 #: include/vlc_interface.h:105
msgid "" msgid ""
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vlc\n" "Project-Id-Version: vlc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2003-08-11 21:05+0200\n" "POT-Creation-Date: 2003-08-11 21:05+0200\n"
"PO-Revision-Date: 2003-01-09 02:37+0900\n" "PO-Revision-Date: 2003-01-09 02:37+0900\n"
"Last-Translator: Fumio Nakayama <endymion@ca2.so-net.ne.jp>\n" "Last-Translator: Fumio Nakayama <endymion@ca2.so-net.ne.jp>\n"
...@@ -12,6 +11,7 @@ msgstr "" ...@@ -12,6 +11,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=euc-jp\n" "Content-Type: text/plain; charset=euc-jp\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Report-Msgid-Bugs-To: \n"
#: include/vlc_interface.h:105 #: include/vlc_interface.h:105
#, fuzzy #, fuzzy
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libvlc.c: main libvlc source * libvlc.c: main libvlc source
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2002 VideoLAN * Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.c,v 1.94 2003/07/23 01:13:48 gbazin Exp $ * $Id: libvlc.c,v 1.95 2003/08/14 12:38:04 garf Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -564,6 +564,17 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -564,6 +564,17 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
* FIXME: kludge to use a p_vlc-local variable for the Mozilla plugin * FIXME: kludge to use a p_vlc-local variable for the Mozilla plugin
*/ */
var_Create( p_vlc, "drawable", VLC_VAR_INTEGER ); var_Create( p_vlc, "drawable", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawableredraw", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawablet", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawablel", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawableb", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawabler", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawablex", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawabley", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawablew", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawableh", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawableportx", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawableporty", VLC_VAR_INTEGER );
/* /*
* Get input filenames given as commandline arguments * Get input filenames given as commandline arguments
...@@ -893,6 +904,7 @@ int VLC_Stop( int i_object ) ...@@ -893,6 +904,7 @@ int VLC_Stop( int i_object )
* Ask the interfaces to stop and destroy them * Ask the interfaces to stop and destroy them
*/ */
msg_Dbg( p_vlc, "removing all interfaces" ); msg_Dbg( p_vlc, "removing all interfaces" );
while( (p_intf = vlc_object_find( p_vlc, VLC_OBJECT_INTF, FIND_CHILD )) ) while( (p_intf = vlc_object_find( p_vlc, VLC_OBJECT_INTF, FIND_CHILD )) )
{ {
intf_StopThread( p_intf ); intf_StopThread( p_intf );
...@@ -904,6 +916,7 @@ int VLC_Stop( int i_object ) ...@@ -904,6 +916,7 @@ int VLC_Stop( int i_object )
/* /*
* Free playlists * Free playlists
*/ */
msg_Dbg( p_vlc, "removing all playlists" ); msg_Dbg( p_vlc, "removing all playlists" );
while( (p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST, while( (p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST,
FIND_CHILD )) ) FIND_CHILD )) )
......
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