]> git.sesse.net Git - vlc/blob - mozilla/vlcplugin.h
backport of r13238
[vlc] / mozilla / vlcplugin.h
1 /*****************************************************************************
2  * vlcplugin.h: a VLC plugin for Mozilla
3  *****************************************************************************
4  * Copyright (C) 2002-2005 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Samuel Hocevar <sam@zoy.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 /*******************************************************************************
25  * Instance state information about the plugin.
26  ******************************************************************************/
27
28 class VlcPlugin
29 {
30 public:
31              VlcPlugin( NPP ); 
32     virtual ~VlcPlugin();
33
34     void     SetInstance( NPP );
35     NPP      GetInstance();
36     VlcIntf* GetPeer();
37
38     void     SetFileName( const char* );
39
40     /* Window settings */
41     NPWindow* p_npwin;
42     uint16    i_npmode;
43     uint32    i_width, i_height;
44
45 #ifdef XP_WIN
46     /* Windows data members */
47     HWND     p_hwnd;
48     WNDPROC  pf_wndproc;
49 #endif
50
51 #ifdef XP_UNIX
52     /* UNIX data members */
53     Window   window;
54     Display *p_display;
55 #endif
56
57 #ifdef XP_MACOSX
58     /* MACOS data members */
59     NPWindow *window;
60 #endif
61
62
63     /* vlc data members */
64     int      i_vlc;
65     int      b_stream;
66     int      b_autoplay;
67     char *   psz_target;
68
69 private:
70     NPP      p_instance;
71     VlcPeer* p_peer;
72 };
73
74 /*******************************************************************************
75  * Plugin properties.
76  ******************************************************************************/
77 #define PLUGIN_NAME         "VLC multimedia plugin"
78 #define PLUGIN_DESCRIPTION \
79     "VLC multimedia plugin <br>" \
80     " <br>" \
81     "version %s <br>" \
82     "VideoLAN WWW: <a href=\"http://www.videolan.org/\">http://www.videolan.org/</a>"
83
84 #define PLUGIN_MIMETYPES \
85     /* MPEG-1 and MPEG-2 */ \
86     "audio/mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
87     "audio/x-mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
88     "video/mpeg:mpg,mpeg,mpe:MPEG video;" \
89     "video/x-mpeg:mpg,mpeg,mpe:MPEG video;" \
90     "video/mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
91     "video/x-mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
92     /* MPEG-4 */ \
93     "video/mpeg4:mp4,mpg4:MPEG-4 video;" \
94     "audio/mpeg4:mp4,mpg4:MPEG-4 audio;" \
95     "application/mpeg4-iod:mp4,mpg4:MPEG-4 video;" \
96     "application/mpeg4-muxcodetable:mp4,mpg4:MPEG-4 video;" \
97     /* AVI */ \
98     "video/x-msvideo:avi:AVI video;" \
99     /* QuickTime */ \
100     "video/quicktime:mov,qt:QuickTime video;" \
101     /* Ogg */ \
102     "application/x-ogg:ogg:Ogg stream;" \
103     /* explicit plugin call */ \
104     "application/x-vlc-plugin::VLC plugin;" \
105     /* windows media */ \
106     "video/x-ms-asf-plugin:asf,asx:Windows Media Video;" \
107     "video/x-ms-asf:asf,asx:Windows Media Video;" \
108     "application/x-mplayer2::Windows Media;" \
109     "video/x-ms-wmv:wmv:Windows Media;" \
110     /* Google VLC mime */ \
111     "application/x-google-vlc-plugin::Google VLC plugin" \
112