1 /*****************************************************************************
2 * vlcplugin.h: a VLC plugin for Mozilla
3 *****************************************************************************
4 * Copyright (C) 2002-2006 the VideoLAN team
7 * Authors: Samuel Hocevar <sam@zoy.org>
8 Damien Fouilleul <damienf@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 /*******************************************************************************
26 * Instance state information about the plugin.
27 ******************************************************************************/
28 #ifndef __VLCPLUGIN_H__
29 #define __VLCPLUGIN_H__
33 #include "control/nporuntime.h"
35 #if !defined(XP_MACOSX) && !defined(XP_UNIX) && !defined(XP_WIN)
37 #elif defined(XP_MACOSX)
47 # include <Quickdraw.h>
52 # include <X11/Xlib.h>
53 # include <X11/Intrinsic.h>
54 # include <X11/StringDefs.h>
63 # define __MAX(a, b) ( ((a) > (b)) ? (a) : (b) )
66 # define __MIN(a, b) ( ((a) < (b)) ? (a) : (b) )
69 typedef enum vlc_toolbar_clicked_e {
79 } vlc_toolbar_clicked_t;
84 VlcPlugin( NPP, uint16 );
87 NPError init(int argc, char* const argn[], char* const argv[]);
88 libvlc_instance_t* getVLC()
89 { return libvlc_instance; };
91 { return p_browser; };
92 char* getAbsoluteURL(const char *url);
95 void setWindow(const NPWindow &window)
96 { npwindow = window; };
98 NPClass* getScriptClass()
99 { return p_scriptClass; };
101 void setLog(libvlc_log_t *log)
102 { libvlc_log = log; };
103 libvlc_log_t* getLog()
104 { return libvlc_log; };
106 WNDPROC getWindowProc()
107 { return pf_wndproc; };
108 void setWindowProc(WNDPROC wndproc)
109 { pf_wndproc = wndproc; };
113 int setSize(unsigned width, unsigned height);
114 Window getVideoWindow()
116 void setVideoWindow(Window window)
117 { npvideo = window; };
118 Window getControlWindow()
119 { return npcontrol; };
120 void setControlWindow(Window window)
121 { npcontrol = window; };
125 void redrawToolbar();
126 void getToolbarSize(unsigned int *width, unsigned int *height)
127 { *width = i_tb_width; *height = i_tb_height; };
128 int setToolbarSize(unsigned int width, unsigned int height)
129 { i_tb_width = width; i_tb_height = height; return 1; };
130 vlc_toolbar_clicked_t getToolbarButtonClicked( int i_xpos, int i_ypos );
133 uint16 i_npmode; /* either NP_EMBED or NP_FULL */
135 /* plugin properties */
143 libvlc_instance_t *libvlc_instance;
144 libvlc_log_t *libvlc_log;
145 NPClass *p_scriptClass;
147 /* browser reference */
151 /* display settings */
157 unsigned int i_width, i_height;
158 unsigned int i_tb_width, i_tb_height;
159 Window npvideo, npcontrol;
166 XImage *p_btnFullscreen;
174 /*******************************************************************************
176 ******************************************************************************/
177 #define PLUGIN_NAME "VLC Multimedia Plug-in"
178 #define PLUGIN_DESCRIPTION \
179 "Version %s, copyright 1996-2007 The VideoLAN Team" \
180 "<br><a href=\"http://www.videolan.org/\">http://www.videolan.org/</a>"
182 #define PLUGIN_MIMETYPES \
183 /* MPEG-1 and MPEG-2 */ \
184 "audio/mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
185 "audio/x-mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
186 "video/mpeg:mpg,mpeg,mpe:MPEG video;" \
187 "video/x-mpeg:mpg,mpeg,mpe:MPEG video;" \
188 "video/mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
189 "video/x-mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
191 "video/mpeg4:mp4,mpg4:MPEG-4 video;" \
192 "audio/mpeg4:mp4,mpg4:MPEG-4 audio;" \
193 "application/mpeg4-iod:mp4,mpg4:MPEG-4 video;" \
194 "application/mpeg4-muxcodetable:mp4,mpg4:MPEG-4 video;" \
196 "video/x-msvideo:avi:AVI video;" \
198 "video/quicktime:mov,qt:QuickTime video;" \
200 "application/x-ogg:ogg:Ogg stream;" \
201 "application/ogg:ogg:Ogg stream;" \
203 "application/x-vlc-plugin:vlc:VLC plug-in;" \
204 /* Windows Media */ \
205 "video/x-ms-asf-plugin:asf,asx:Windows Media Video;" \
206 "video/x-ms-asf:asf,asx:Windows Media Video;" \
207 "application/x-mplayer2::Windows Media;" \
208 "video/x-ms-wmv:wmv:Windows Media;" \
209 "video/x-ms-wvx:wvx:Windows Media Video;" \
211 "application/x-google-vlc-plugin::Google VLC plug-in;" \
213 "audio/wav:wav:WAV audio;" \
214 "audio/x-wav:wav:WAV audio;" \
216 "audio/3gpp:3gp,3gpp:3GPP audio;" \
217 "video/3gpp:3gp,3gpp:3GPP video;" \
219 "audio/3gpp2:3g2,3gpp2:3GPP2 audio;" \
220 "video/3gpp2:3g2,3gpp2:3GPP2 video;" \
222 "video/divx:divx:DivX video;" \
224 "video/flv:flv:FLV video;" \
225 "video/x-flv:flv:FLV video;"