]> git.sesse.net Git - vlc/commitdiff
vlcplugin.cpp: removed hardcoded path
authorDamien Fouilleul <damienf@videolan.org>
Sun, 27 Aug 2006 19:26:50 +0000 (19:26 +0000)
committerDamien Fouilleul <damienf@videolan.org>
Sun, 27 Aug 2006 19:26:50 +0000 (19:26 +0000)
npmac.cpp: OSX Intel patch by Charles Duffy
vlcshell.cpp: fixed X11

mozilla/support/npmac.cpp
mozilla/vlcplugin.cpp
mozilla/vlcplugin.h
mozilla/vlcshell.cpp

index fee124f2f1fa85e28d3007bd74d6295ccb0090c1..26fc618b2c7f559dd9a98b7e07385677392c4ded 100644 (file)
@@ -94,7 +94,7 @@
 #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
 struct TFPtoTVGlue{
index b86828448872d810774d6523254475fb61cef405..9e68adb923e146bf936738e44e75a4b66a85059e 100644 (file)
@@ -99,9 +99,6 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
          RegCloseKey( h_key );
     }
     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 */
 
index 4e8416da9f5eb771dabb0403cb5d317dff61f46c..ca31cf75d5337a2ac5248ced6a282101b0715b0c 100644 (file)
@@ -38,7 +38,6 @@
 #undef XP_UNIX
 #endif
 
-#if 0
 #ifdef XP_WIN
     /* Windows stuff */
 #endif
@@ -54,7 +53,6 @@
 #   include <X11/Intrinsic.h>
 #   include <X11/StringDefs.h>
 #endif
-#endif
 
 class VlcPlugin
 {
index 0629351f5886116d3e9ce5cf71ef633f98dcdc59..5fb274361331693f58b738a7fb1174523c5c8ed0 100644 (file)
@@ -51,8 +51,6 @@
  * Unix-only declarations
 ******************************************************************************/
 #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 Resize( Widget w, XtPointer closure, XEvent *event );
@@ -63,16 +61,12 @@ static void Resize( Widget w, XtPointer closure, XEvent *event );
  * MacOS-only declarations
 ******************************************************************************/
 #ifdef XP_MACOSX
-#   define VOUT_PLUGINS "opengl,macosx,dummy"
-#   define AOUT_PLUGINS "auhal,macosx,dummy"
 #endif
 
 /*****************************************************************************
  * Windows-only declarations
  *****************************************************************************/
 #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 );
 
@@ -311,18 +305,17 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
      *  size changes, etc.
      */
 
-    libvlc_drawable_t drawable;
     const NPWindow *curwin = p_plugin->getWindow();
 
 #ifdef XP_MACOSX
     if( window && window->window )
     {
         /* check if plugin has a new parent window */
-        drawable = (libvlc_drawable_t)(((NP_Port*) (window->window))->port);
-        if( !curwin->window || drawable != (libvlc_drawable_t)(((NP_Port*) (curwin->window))->port) )
+        CGrafPtr drawable = (((NP_Port*) (window->window))->port);
+        if( !curwin->window || drawable != (((NP_Port*) (curwin->window))->port) )
         {
             /* 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 */
@@ -354,9 +347,8 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
     if( window && window->window )
     {
         /* check if plugin has a new parent window */
-        /* FIXME: this cast sucks */
-        drawable = (libvlc_drawable_t) (HWND) (window->window);
-        if( !curwin->window || drawable != (libvlc_drawable_t)(HWND) (curwin->window) )
+        HWND drawable = (HWND) (window->window);
+        if( !curwin->window || drawable != curwin->window )
         {
             /* reset previous window settings */
             HWND oldwin = (HWND)p_plugin->getWindow()->window;
@@ -367,7 +359,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
                 SetWindowLong( oldwin, GWL_WNDPROC, (LONG)oldproc );
             }
             /* install our WNDPROC */
-            p_plugin->setWindowProc( (WNDPROC)SetWindowLong( (HWND)drawable,
+            p_plugin->setWindowProc( (WNDPROC)SetWindowLong( drawable,
                                                            GWL_WNDPROC, (LONG)Manage ) );
 
             /* attach our plugin object */
@@ -379,7 +371,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
             SetWindowLong((HWND)drawable, GWL_STYLE, style);
 
             /* 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 */
@@ -403,19 +395,22 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
 #ifdef XP_UNIX
     if( window && window->window )
     {
-        Window  win   = (Window) window->window;
-        Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display;
+        Window  drawable   = (Window) window->window;
+       if( !curwin->window || drawable != (Window)curwin->window )
+       {
+           Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display;
 
-        XResizeWindow( p_display, win, window->width, window->height );
-        Widget w = XtWindowToWidget( p_display, window );
+           XResizeWindow( p_display, drawable, window->width, window->height );
+           Widget w = XtWindowToWidget( p_display, drawable );
 
-        XtAddEventHandler( w, ExposureMask, FALSE, (XtEventHandler)Redraw, p_plugin );
-        XtAddEventHandler( w, StructureNotifyMask, FALSE, (XtEventHandler)Resize, p_plugin );
+           XtAddEventHandler( w, ExposureMask, FALSE, (XtEventHandler)Redraw, p_plugin );
+           XtAddEventHandler( w, StructureNotifyMask, FALSE, (XtEventHandler)Resize, p_plugin );
 
-        /* remember window */
-        p_plugin->setWindow(window);
+           /* remember window */
+           p_plugin->setWindow(window);
 
-        Redraw( w, (XtPointer)p_plugin, NULL );
+           Redraw( w, (XtPointer)p_plugin, NULL );
+       }
     }
 #endif /* XP_UNIX */
 
@@ -662,19 +657,19 @@ static void Redraw( Widget w, XtPointer closure, XEvent *event )
     GC gc;
     XGCValues gcv;
 
-    Window  w   = (Window) window->window;
+    Window  drawable   = (Window) window->window;
     Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display;
 
     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 );
 
     gcv.foreground = WhitePixel( p_display, 0 );
     XChangeGC( p_display, gc, GCForeground, &gcv );
 
-    XDrawString( p_display, w, gc,
+    XDrawString( p_display, drawable, gc,
                  window->width / 2 - 40, window->height / 2,
                  WINDOW_TEXT, strlen(WINDOW_TEXT) );
 
@@ -685,7 +680,7 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
 {
     VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure);
     const NPWindow *window = p_plugin->getWindow();
-    Window  w   = (Window) window->window;
+    Window  drawable   = (Window) window->window;
     Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display;
 
     int i_ret;
@@ -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
     fprintf( stderr,
              "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
        necessarily the requested size as the Resize request may not
@@ -727,7 +722,7 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
              attr.width, attr.height );
 #endif /* X11_RESIZE_DEBUG */
 
-    XQueryTree( p_display, w,
+    XQueryTree( p_display, drawable,
                 &root_return, &parent_return, &children_return,
                 &i_nchildren );
 
@@ -751,7 +746,7 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
                  "vlcshell::Resize() XResizeWindow(base) returned %d\n",
                  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",
                  attr.width, attr.height );