1 /*****************************************************************************
2 * vlcplugin.h: a VLC plugin for Mozilla
3 *****************************************************************************
4 * Copyright (C) 2002-2008 the VideoLAN team
7 * Authors: Samuel Hocevar <sam@zoy.org>
8 * Damien Fouilleul <damienf@videolan.org>
9 * Jean-Paul Saman <jpsaman@videolan.org>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
26 /*******************************************************************************
27 * Instance state information about the plugin.
28 ******************************************************************************/
29 #ifndef __VLCPLUGIN_H__
30 #define __VLCPLUGIN_H__
34 #include "control/nporuntime.h"
36 #if !defined(XP_MACOSX) && !defined(XP_UNIX) && !defined(XP_WIN)
38 #elif defined(XP_MACOSX)
48 # include <Quickdraw.h>
53 # include <X11/Xlib.h>
54 # include <X11/Intrinsic.h>
55 # include <X11/StringDefs.h>
64 # define __MAX(a, b) ( ((a) > (b)) ? (a) : (b) )
67 # define __MIN(a, b) ( ((a) < (b)) ? (a) : (b) )
70 typedef enum vlc_toolbar_clicked_e {
80 } vlc_toolbar_clicked_t;
85 VlcPlugin( NPP, uint16 );
88 NPError init(int argc, char* const argn[], char* const argv[]);
89 libvlc_instance_t* getVLC()
90 { return libvlc_instance; };
92 { return p_browser; };
93 char* getAbsoluteURL(const char *url);
96 void setWindow(const NPWindow &window)
97 { npwindow = window; };
99 NPClass* getScriptClass()
100 { return p_scriptClass; };
102 void setLog(libvlc_log_t *log)
103 { libvlc_log = log; };
104 libvlc_log_t* getLog()
105 { return libvlc_log; };
107 WNDPROC getWindowProc()
108 { return pf_wndproc; };
109 void setWindowProc(WNDPROC wndproc)
110 { pf_wndproc = wndproc; };
114 int setSize(unsigned width, unsigned height);
115 Window getVideoWindow()
117 void setVideoWindow(Window window)
118 { npvideo = window; };
119 Window getControlWindow()
120 { return npcontrol; };
121 void setControlWindow(Window window)
122 { npcontrol = window; };
126 void redrawToolbar();
127 void getToolbarSize(unsigned int *width, unsigned int *height)
128 { *width = i_tb_width; *height = i_tb_height; };
129 int setToolbarSize(unsigned int width, unsigned int height)
130 { i_tb_width = width; i_tb_height = height; return 1; };
131 vlc_toolbar_clicked_t getToolbarButtonClicked( int i_xpos, int i_ypos );
134 uint16 i_npmode; /* either NP_EMBED or NP_FULL */
136 /* plugin properties */
144 libvlc_instance_t *libvlc_instance;
145 libvlc_log_t *libvlc_log;
146 NPClass *p_scriptClass;
148 /* browser reference */
152 /* display settings */
158 unsigned int i_width, i_height;
159 unsigned int i_tb_width, i_tb_height;
160 Window npvideo, npcontrol;
167 XImage *p_btnFullscreen;
175 /*******************************************************************************
177 ******************************************************************************/
178 #define PLUGIN_NAME "VLC Multimedia Plug-in"
179 #define PLUGIN_DESCRIPTION \
180 "Version %s, copyright 1996-2007 The VideoLAN Team" \
181 "<br><a href=\"http://www.videolan.org/\">http://www.videolan.org/</a>"
183 #define PLUGIN_MIMETYPES \
184 /* MPEG-1 and MPEG-2 */ \
185 "audio/mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
186 "audio/x-mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
187 "video/mpeg:mpg,mpeg,mpe:MPEG video;" \
188 "video/x-mpeg:mpg,mpeg,mpe:MPEG video;" \
189 "video/mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
190 "video/x-mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
192 "video/mpeg4:mp4,mpg4:MPEG-4 video;" \
193 "audio/mpeg4:mp4,mpg4:MPEG-4 audio;" \
194 "application/mpeg4-iod:mp4,mpg4:MPEG-4 video;" \
195 "application/mpeg4-muxcodetable:mp4,mpg4:MPEG-4 video;" \
197 "video/x-msvideo:avi:AVI video;" \
199 "video/quicktime:mov,qt:QuickTime video;" \
201 "application/x-ogg:ogg:Ogg stream;" \
202 "application/ogg:ogg:Ogg stream;" \
204 "application/x-vlc-plugin:vlc:VLC plug-in;" \
205 /* Windows Media */ \
206 "video/x-ms-asf-plugin:asf,asx:Windows Media Video;" \
207 "video/x-ms-asf:asf,asx:Windows Media Video;" \
208 "application/x-mplayer2::Windows Media;" \
209 "video/x-ms-wmv:wmv:Windows Media;" \
210 "video/x-ms-wvx:wvx:Windows Media Video;" \
212 "application/x-google-vlc-plugin::Google VLC plug-in;" \
214 "audio/wav:wav:WAV audio;" \
215 "audio/x-wav:wav:WAV audio;" \
217 "audio/3gpp:3gp,3gpp:3GPP audio;" \
218 "video/3gpp:3gp,3gpp:3GPP video;" \
220 "audio/3gpp2:3g2,3gpp2:3GPP2 audio;" \
221 "video/3gpp2:3g2,3gpp2:3GPP2 video;" \
223 "video/divx:divx:DivX video;" \
225 "video/flv:flv:FLV video;" \
226 "video/x-flv:flv:FLV video;" \
228 "video/x-matroska:mkv:Matroska video;" \
229 "audio/x-matroska:mka:Matroska audio;"