Commit 7419fda4 authored by Damien Fouilleul's avatar Damien Fouilleul

vlcplugin.cpp: removed hardcoded path

npmac.cpp: OSX Intel patch by Charles Duffy
vlcshell.cpp: fixed X11
parent 8f8bdcb5
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
#endif #endif
#ifdef XP_MACOSX && !TARGET_RT_MAC_CFM #if defined(XP_MACOSX) && defined(__POWERPC__) && (!defined(TARGET_RT_MAC_CFM))
// glue for mapping outgoing Macho function pointers to TVectors // glue for mapping outgoing Macho function pointers to TVectors
struct TFPtoTVGlue{ struct TFPtoTVGlue{
......
...@@ -99,9 +99,6 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[]) ...@@ -99,9 +99,6 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
RegCloseKey( h_key ); RegCloseKey( h_key );
} }
ppsz_argv[ppsz_argc++] = "--no-one-instance"; ppsz_argv[ppsz_argc++] = "--no-one-instance";
#if 1
ppsz_argv[0] = "F:\\Cygwin\\home\\Damien\\dev\\videolan\\vlc-trunk\\vlc";
#endif
#endif /* XP_MACOSX */ #endif /* XP_MACOSX */
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#undef XP_UNIX #undef XP_UNIX
#endif #endif
#if 0
#ifdef XP_WIN #ifdef XP_WIN
/* Windows stuff */ /* Windows stuff */
#endif #endif
...@@ -54,7 +53,6 @@ ...@@ -54,7 +53,6 @@
# include <X11/Intrinsic.h> # include <X11/Intrinsic.h>
# include <X11/StringDefs.h> # include <X11/StringDefs.h>
#endif #endif
#endif
class VlcPlugin class VlcPlugin
{ {
......
...@@ -51,8 +51,6 @@ ...@@ -51,8 +51,6 @@
* Unix-only declarations * Unix-only declarations
******************************************************************************/ ******************************************************************************/
#ifdef XP_UNIX #ifdef XP_UNIX
# define VOUT_PLUGINS "xvideo,x11,dummy"
# define AOUT_PLUGINS "esd,arts,alsa,oss,dummy"
static void Redraw( Widget w, XtPointer closure, XEvent *event ); static void Redraw( Widget w, XtPointer closure, XEvent *event );
static void Resize( Widget w, XtPointer closure, XEvent *event ); static void Resize( Widget w, XtPointer closure, XEvent *event );
...@@ -63,16 +61,12 @@ static void Resize( Widget w, XtPointer closure, XEvent *event ); ...@@ -63,16 +61,12 @@ static void Resize( Widget w, XtPointer closure, XEvent *event );
* MacOS-only declarations * MacOS-only declarations
******************************************************************************/ ******************************************************************************/
#ifdef XP_MACOSX #ifdef XP_MACOSX
# define VOUT_PLUGINS "opengl,macosx,dummy"
# define AOUT_PLUGINS "auhal,macosx,dummy"
#endif #endif
/***************************************************************************** /*****************************************************************************
* Windows-only declarations * Windows-only declarations
*****************************************************************************/ *****************************************************************************/
#ifdef XP_WIN #ifdef XP_WIN
# define VOUT_PLUGINS "directx,wingdi,dummy"
# define AOUT_PLUGINS "directx,waveout,dummy"
static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpar ); static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpar );
...@@ -311,18 +305,17 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -311,18 +305,17 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
* size changes, etc. * size changes, etc.
*/ */
libvlc_drawable_t drawable;
const NPWindow *curwin = p_plugin->getWindow(); const NPWindow *curwin = p_plugin->getWindow();
#ifdef XP_MACOSX #ifdef XP_MACOSX
if( window && window->window ) if( window && window->window )
{ {
/* check if plugin has a new parent window */ /* check if plugin has a new parent window */
drawable = (libvlc_drawable_t)(((NP_Port*) (window->window))->port); CGrafPtr drawable = (((NP_Port*) (window->window))->port);
if( !curwin->window || drawable != (libvlc_drawable_t)(((NP_Port*) (curwin->window))->port) ) if( !curwin->window || drawable != (((NP_Port*) (curwin->window))->port) )
{ {
/* set/change parent window */ /* set/change parent window */
libvlc_video_set_parent(p_vlc, drawable, NULL); libvlc_video_set_parent(p_vlc, (libvlc_drawable_t)drawable, NULL);
} }
/* as MacOS X video output is windowless, set viewport */ /* as MacOS X video output is windowless, set viewport */
...@@ -354,9 +347,8 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -354,9 +347,8 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
if( window && window->window ) if( window && window->window )
{ {
/* check if plugin has a new parent window */ /* check if plugin has a new parent window */
/* FIXME: this cast sucks */ HWND drawable = (HWND) (window->window);
drawable = (libvlc_drawable_t) (HWND) (window->window); if( !curwin->window || drawable != curwin->window )
if( !curwin->window || drawable != (libvlc_drawable_t)(HWND) (curwin->window) )
{ {
/* reset previous window settings */ /* reset previous window settings */
HWND oldwin = (HWND)p_plugin->getWindow()->window; HWND oldwin = (HWND)p_plugin->getWindow()->window;
...@@ -367,7 +359,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -367,7 +359,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
SetWindowLong( oldwin, GWL_WNDPROC, (LONG)oldproc ); SetWindowLong( oldwin, GWL_WNDPROC, (LONG)oldproc );
} }
/* install our WNDPROC */ /* install our WNDPROC */
p_plugin->setWindowProc( (WNDPROC)SetWindowLong( (HWND)drawable, p_plugin->setWindowProc( (WNDPROC)SetWindowLong( drawable,
GWL_WNDPROC, (LONG)Manage ) ); GWL_WNDPROC, (LONG)Manage ) );
/* attach our plugin object */ /* attach our plugin object */
...@@ -379,7 +371,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -379,7 +371,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
SetWindowLong((HWND)drawable, GWL_STYLE, style); SetWindowLong((HWND)drawable, GWL_STYLE, style);
/* change/set parent */ /* change/set parent */
libvlc_video_set_parent(p_vlc, drawable, NULL); libvlc_video_set_parent(p_vlc, (libvlc_drawable_t)drawable, NULL);
} }
/* remember window details */ /* remember window details */
...@@ -403,11 +395,13 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -403,11 +395,13 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
#ifdef XP_UNIX #ifdef XP_UNIX
if( window && window->window ) if( window && window->window )
{ {
Window win = (Window) window->window; Window drawable = (Window) window->window;
if( !curwin->window || drawable != (Window)curwin->window )
{
Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display; Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display;
XResizeWindow( p_display, win, window->width, window->height ); XResizeWindow( p_display, drawable, window->width, window->height );
Widget w = XtWindowToWidget( p_display, window ); Widget w = XtWindowToWidget( p_display, drawable );
XtAddEventHandler( w, ExposureMask, FALSE, (XtEventHandler)Redraw, p_plugin ); XtAddEventHandler( w, ExposureMask, FALSE, (XtEventHandler)Redraw, p_plugin );
XtAddEventHandler( w, StructureNotifyMask, FALSE, (XtEventHandler)Resize, p_plugin ); XtAddEventHandler( w, StructureNotifyMask, FALSE, (XtEventHandler)Resize, p_plugin );
...@@ -417,6 +411,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -417,6 +411,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
Redraw( w, (XtPointer)p_plugin, NULL ); Redraw( w, (XtPointer)p_plugin, NULL );
} }
}
#endif /* XP_UNIX */ #endif /* XP_UNIX */
if( !p_plugin->b_stream ) if( !p_plugin->b_stream )
...@@ -662,19 +657,19 @@ static void Redraw( Widget w, XtPointer closure, XEvent *event ) ...@@ -662,19 +657,19 @@ static void Redraw( Widget w, XtPointer closure, XEvent *event )
GC gc; GC gc;
XGCValues gcv; XGCValues gcv;
Window w = (Window) window->window; Window drawable = (Window) window->window;
Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display; Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display;
gcv.foreground = BlackPixel( p_display, 0 ); gcv.foreground = BlackPixel( p_display, 0 );
gc = XCreateGC( p_display, w, GCForeground, &gcv ); gc = XCreateGC( p_display, drawable, GCForeground, &gcv );
XFillRectangle( p_display, w, gc, XFillRectangle( p_display, drawable, gc,
0, 0, window->width, window->height ); 0, 0, window->width, window->height );
gcv.foreground = WhitePixel( p_display, 0 ); gcv.foreground = WhitePixel( p_display, 0 );
XChangeGC( p_display, gc, GCForeground, &gcv ); XChangeGC( p_display, gc, GCForeground, &gcv );
XDrawString( p_display, w, gc, XDrawString( p_display, drawable, gc,
window->width / 2 - 40, window->height / 2, window->width / 2 - 40, window->height / 2,
WINDOW_TEXT, strlen(WINDOW_TEXT) ); WINDOW_TEXT, strlen(WINDOW_TEXT) );
...@@ -685,7 +680,7 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event ) ...@@ -685,7 +680,7 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
{ {
VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure); VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure);
const NPWindow *window = p_plugin->getWindow(); const NPWindow *window = p_plugin->getWindow();
Window w = (Window) window->window; Window drawable = (Window) window->window;
Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display; Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display;
int i_ret; int i_ret;
...@@ -712,13 +707,13 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event ) ...@@ -712,13 +707,13 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
} }
i_ret = XResizeWindow( p_display, w, window->i_width, window->i_height ); i_ret = XResizeWindow( p_display, drawable, window->width, window->height );
#ifdef X11_RESIZE_DEBUG #ifdef X11_RESIZE_DEBUG
fprintf( stderr, fprintf( stderr,
"vlcshell::Resize() XResizeWindow(owner) returned %d\n", i_ret ); "vlcshell::Resize() XResizeWindow(owner) returned %d\n", i_ret );
XGetWindowAttributes ( p_display, w, &attr ); XGetWindowAttributes ( p_display, drawable, &attr );
/* X is asynchronous, so the current size reported here is not /* X is asynchronous, so the current size reported here is not
necessarily the requested size as the Resize request may not necessarily the requested size as the Resize request may not
...@@ -727,7 +722,7 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event ) ...@@ -727,7 +722,7 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
attr.width, attr.height ); attr.width, attr.height );
#endif /* X11_RESIZE_DEBUG */ #endif /* X11_RESIZE_DEBUG */
XQueryTree( p_display, w, XQueryTree( p_display, drawable,
&root_return, &parent_return, &children_return, &root_return, &parent_return, &children_return,
&i_nchildren ); &i_nchildren );
...@@ -751,7 +746,7 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event ) ...@@ -751,7 +746,7 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
"vlcshell::Resize() XResizeWindow(base) returned %d\n", "vlcshell::Resize() XResizeWindow(base) returned %d\n",
i_ret ); i_ret );
XGetWindowAttributes( p_plugin->p_display, base_window, &attr ); XGetWindowAttributes( p_display, base_window, &attr );
fprintf( stderr, "vlcshell::Resize() new size %d x %d\n", fprintf( stderr, "vlcshell::Resize() new size %d x %d\n",
attr.width, attr.height ); attr.width, attr.height );
......
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