]> git.sesse.net Git - vlc/blobdiff - mozilla/vlcplugin.h
* src/input/input.c: fixed nasty bug with preparsing where a mutex was used uninitial...
[vlc] / mozilla / vlcplugin.h
index 1c1a086c6d23fc9ca6e90ec76cf608fedb04b3a6..ca31cf75d5337a2ac5248ced6a282101b0715b0c 100644 (file)
@@ -1,10 +1,11 @@
 /*****************************************************************************
  * vlcplugin.h: a VLC plugin for Mozilla
  *****************************************************************************
- * Copyright (C) 2002-2005 VideoLAN
+ * Copyright (C) 2002-2006 the VideoLAN team
  * $Id$
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
+            Damien Fouilleul <damienf@videolan.org>
  *
  * 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
  *
  * 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.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*******************************************************************************
  * Instance state information about the plugin.
  ******************************************************************************/
+#ifndef __VLCPLUGIN_H__
+#define __VLCPLUGIN_H__
+
+#include <vlc/libvlc.h>
+#include <npapi.h>
+#include "control/nporuntime.h"
+
+#if !defined(XP_MACOSX) && !defined(XP_UNIX) && !defined(XP_WIN)
+#define XP_UNIX 1
+#elif defined(XP_MACOSX)
+#undef XP_UNIX
+#endif
+
+#ifdef XP_WIN
+    /* Windows stuff */
+#endif
+
+#ifdef XP_MACOSX
+    /* Mac OS X stuff */
+#   include <Quickdraw.h>
+#endif
+
+#ifdef XP_UNIX
+    /* X11 stuff */
+#   include <X11/Xlib.h>
+#   include <X11/Intrinsic.h>
+#   include <X11/StringDefs.h>
+#endif
 
 class VlcPlugin
 {
 public:
-             VlcPlugin( NPP ); 
+             VlcPlugin( NPP, uint16 ); 
     virtual ~VlcPlugin();
 
-    void     SetInstance( NPP );
-    NPP      GetInstance();
-    VlcIntf* GetPeer();
+    NPError             init(int argc, char* const argn[], char* const argv[]);
+    libvlc_instance_t*  getVLC() 
+                            { return libvlc_instance; };
+    NPP                 getBrowser()
+                            { return p_browser; };
+    char*               getAbsoluteURL(const char *url);
+    const NPWindow*     getWindow()
+                            { return &npwindow; };
+    void                setWindow(const NPWindow *window)
+                            { npwindow = *window; };
 
-    void     SetFileName( const char* );
+    NPClass*            getScriptClass()
+                            { return scriptClass; };
 
-    /* Window settings */
-    NPWindow* p_npwin;
-    uint16    i_npmode;
-    uint32    i_width, i_height;
-
-#ifdef XP_WIN
-    /* Windows data members */
-    HWND     p_hwnd;
-    WNDPROC  pf_wndproc;
-#endif
-
-#ifdef XP_UNIX
-    /* UNIX data members */
-    Window   window;
-    Display *p_display;
+#if XP_WIN
+    WNDPROC             getWindowProc()
+                            { return pf_wndproc; };
+    void                setWindowProc(WNDPROC wndproc)
+                            { pf_wndproc = wndproc; };
 #endif
 
-#ifdef XP_MACOSX
-    /* MACOS data members */
-    NPWindow *window;
+#if XP_UNIX
+    int                 setSize(unsigned width, unsigned height);
 #endif
 
+    uint16    i_npmode; /* either NP_EMBED or NP_FULL */
 
-    /* vlc data members */
-    int      i_vlc;
+    /* plugin properties */
     int      b_stream;
     int      b_autoplay;
     char *   psz_target;
 
 private:
-    NPP      p_instance;
-    VlcPeer* p_peer;
+    /* VLC reference */
+    libvlc_instance_t *libvlc_instance;
+    NPClass           *scriptClass;
+
+    /* browser reference */
+    NPP     p_browser;
+    char*   psz_baseURL;
+
+    /* display settings */
+    NPWindow  npwindow;
+#if XP_WIN
+    WNDPROC   pf_wndproc;
+#endif
+#if XP_UNIX
+    unsigned int     i_width, i_height;
+#endif
 };
 
 /*******************************************************************************
@@ -100,6 +140,7 @@ private:
     "video/quicktime:mov,qt:QuickTime video;" \
     /* Ogg */ \
     "application/x-ogg:ogg:Ogg stream;" \
+    "application/ogg:ogg:Ogg stream;" \
     /* explicit plugin call */ \
     "application/x-vlc-plugin::VLC plugin;" \
     /* windows media */ \
@@ -109,4 +150,8 @@ private:
     "video/x-ms-wmv:wmv:Windows Media;" \
     /* Google VLC mime */ \
     "application/x-google-vlc-plugin::Google VLC plugin" \
+    /* Misc */ \
+    "audio/wav::WAV audio" \
+    "audio/x-wav::WAV audio" \
 
+#endif