]> git.sesse.net Git - vlc/blobdiff - projects/mozilla/vlcplugin.h
Fix live detection on win32
[vlc] / projects / mozilla / vlcplugin.h
index 6d48bf3bb8f13f385427d8070312ad25e6b36c3a..cb6132a6558672fcd6e21ee3f3a1542284734d42 100644 (file)
@@ -1,11 +1,12 @@
 /*****************************************************************************
  * vlcplugin.h: a VLC plugin for Mozilla
  *****************************************************************************
- * Copyright (C) 2002-2006 the VideoLAN team
+ * Copyright (C) 2002-2008 the VideoLAN team
  * $Id$
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
-            Damien Fouilleul <damienf@videolan.org>
+ *          Damien Fouilleul <damienf@videolan.org>
+ *         Jean-Paul Saman <jpsaman@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
@@ -28,7 +29,7 @@
 #ifndef __VLCPLUGIN_H__
 #define __VLCPLUGIN_H__
 
-#include <vlc/libvlc.h>
+#include <vlc/vlc.h>
 #include <npapi.h>
 #include "control/nporuntime.h"
 
 #   include <X11/Intrinsic.h>
 #   include <X11/StringDefs.h>
 #   include <X11/X.h>
+
+#   ifndef __APPLE__
+#       include <X11/xpm.h>
+#   endif
+#endif
+
+#ifndef __MAX
+#   define __MAX(a, b)   ( ((a) > (b)) ? (a) : (b) )
 #endif
+#ifndef __MIN
+#   define __MIN(a, b)   ( ((a) < (b)) ? (a) : (b) )
+#endif
+
+typedef enum vlc_toolbar_clicked_e {
+    clicked_Unknown = 0,
+    clicked_Play,
+    clicked_Pause,
+    clicked_Stop,
+    clicked_timeline,
+    clicked_Time,
+    clicked_Fullscreen,
+    clicked_Mute,
+    clicked_Unmute
+} vlc_toolbar_clicked_t;
 
 class VlcPlugin
 {
@@ -96,6 +120,15 @@ public:
                             { return npcontrol; };
     void                setControlWindow(Window window)
                             { npcontrol = window; };
+
+    void                showToolbar();
+    void                hideToolbar();
+    void                redrawToolbar();
+    void                getToolbarSize(unsigned int *width, unsigned int *height)
+                            { *width = i_tb_width; *height = i_tb_height; };
+    int                 setToolbarSize(unsigned int width, unsigned int height)
+                            { i_tb_width = width; i_tb_height = height; return 1; };
+    vlc_toolbar_clicked_t getToolbarButtonClicked( int i_xpos, int i_ypos );
 #endif
 
     uint16    i_npmode; /* either NP_EMBED or NP_FULL */
@@ -103,6 +136,7 @@ public:
     /* plugin properties */
     int      b_stream;
     int      b_autoplay;
+    int      b_toolbar;
     char *   psz_target;
 
 private:
@@ -122,14 +156,26 @@ private:
 #endif
 #if XP_UNIX
     unsigned int     i_width, i_height;
+    unsigned int     i_tb_width, i_tb_height;
     Window           npvideo, npcontrol;
+
+    XImage *p_btnPlay;
+    XImage *p_btnPause;
+    XImage *p_btnStop;
+    XImage *p_timeline;
+    XImage *p_btnTime;
+    XImage *p_btnFullscreen;
+    XImage *p_btnMute;
+    XImage *p_btnUnmute;
+
+    int i_last_position;
 #endif
 };
 
 /*******************************************************************************
  * Plugin properties.
  ******************************************************************************/
-#define PLUGIN_NAME         "VLC Multimedia Plugin"
+#define PLUGIN_NAME         "VLC Multimedia Plug-in"
 #define PLUGIN_DESCRIPTION \
     "Version %s, copyright 1996-2007 The VideoLAN Team" \
     "<br><a href=\"http://www.videolan.org/\">http://www.videolan.org/</a>"
@@ -155,7 +201,7 @@ private:
     "application/x-ogg:ogg:Ogg stream;" \
     "application/ogg:ogg:Ogg stream;" \
     /* VLC */ \
-    "application/x-vlc-plugin:vlc:VLC plugin;" \
+    "application/x-vlc-plugin:vlc:VLC plug-in;" \
     /* Windows Media */ \
     "video/x-ms-asf-plugin:asf,asx:Windows Media Video;" \
     "video/x-ms-asf:asf,asx:Windows Media Video;" \
@@ -163,7 +209,7 @@ private:
     "video/x-ms-wmv:wmv:Windows Media;" \
     "video/x-ms-wvx:wvx:Windows Media Video;" \
     /* Google VLC */ \
-    "application/x-google-vlc-plugin::Google VLC plugin;" \
+    "application/x-google-vlc-plugin::Google VLC plug-in;" \
     /* WAV audio */ \
     "audio/wav:wav:WAV audio;" \
     "audio/x-wav:wav:WAV audio;" \
@@ -174,6 +220,14 @@ private:
     "audio/3gpp2:3g2,3gpp2:3GPP2 audio;" \
     "video/3gpp2:3g2,3gpp2:3GPP2 video;" \
     /* DIVX */ \
-    "video/divx:divx:DivX video;"
+    "video/divx:divx:DivX video;" \
+    /* FLV */ \
+    "video/flv:flv:FLV video;" \
+    "video/x-flv:flv:FLV video;" \
+    /* Matroska */ \
+    "video/x-matroska:mkv:Matroska video;" \
+    "audio/x-matroska:mka:Matroska audio;"
+
+
 
 #endif