]> git.sesse.net Git - vlc/blob - mozilla/vlcplugin.h
- the resurected mozilla plugin for Safari/Firefox on MacOS X
[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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 /*******************************************************************************
25  * Instance state information about the plugin.
26  ******************************************************************************/
27 #ifndef __VLCPLUGIN_H__
28 #define __VLCPLUGIN_H__
29
30 #include "vlcpeer.h"
31
32 #if !defined(XP_MACOSX) && !defined(XP_UNIX) && !defined(XP_WIN)
33 #define XP_UNIX 1
34 #elif defined(XP_MACOSX)
35 #undef XP_UNIX
36 #endif
37
38 #ifdef XP_WIN
39     /* Windows stuff */
40 #endif
41
42 #ifdef XP_MACOSX
43     /* Mac OS X stuff */
44 #   include <Quickdraw.h>
45 #endif
46
47 #ifdef XP_UNIX
48     /* X11 stuff */
49 #   include <X11/Xlib.h>
50 #   include <X11/Intrinsic.h>
51 #   include <X11/StringDefs.h>
52 #endif
53
54 class VlcPlugin
55 {
56 public:
57              VlcPlugin( NPP ); 
58     virtual ~VlcPlugin();
59
60     void     SetInstance( NPP );
61     NPP      GetInstance();
62     VlcIntf* GetPeer();
63
64     /* Window settings */
65     NPWindow* p_npwin;
66     uint16    i_npmode;
67     uint32    i_width, i_height;
68
69 #ifdef XP_WIN
70     /* Windows data members */
71     HWND     p_hwnd;
72     WNDPROC  pf_wndproc;
73 #endif
74
75 #ifdef XP_UNIX
76     /* UNIX data members */
77     Window   window;
78     Display *p_display;
79 #endif
80
81 #ifdef XP_MACOSX
82     /* MACOS data members */
83     NPWindow *window;
84 #endif
85
86
87     /* vlc data members */
88     int      i_vlc;
89     int      b_stream;
90     int      b_autoplay;
91     char *   psz_target;
92
93 private:
94     NPP      p_instance;
95     VlcPeer* p_peer;
96 };
97
98 /*******************************************************************************
99  * Plugin properties.
100  ******************************************************************************/
101 #define PLUGIN_NAME         "VLC multimedia plugin"
102 #define PLUGIN_DESCRIPTION \
103     "VLC multimedia plugin <br>" \
104     " <br>" \
105     "version %s <br>" \
106     "VideoLAN WWW: <a href=\"http://www.videolan.org/\">http://www.videolan.org/</a>"
107
108 #define PLUGIN_MIMETYPES \
109     /* MPEG-1 and MPEG-2 */ \
110     "audio/mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
111     "audio/x-mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
112     "video/mpeg:mpg,mpeg,mpe:MPEG video;" \
113     "video/x-mpeg:mpg,mpeg,mpe:MPEG video;" \
114     "video/mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
115     "video/x-mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
116     /* MPEG-4 */ \
117     "video/mpeg4:mp4,mpg4:MPEG-4 video;" \
118     "audio/mpeg4:mp4,mpg4:MPEG-4 audio;" \
119     "application/mpeg4-iod:mp4,mpg4:MPEG-4 video;" \
120     "application/mpeg4-muxcodetable:mp4,mpg4:MPEG-4 video;" \
121     /* AVI */ \
122     "video/x-msvideo:avi:AVI video;" \
123     /* QuickTime */ \
124     "video/quicktime:mov,qt:QuickTime video;" \
125     /* Ogg */ \
126     "application/x-ogg:ogg:Ogg stream;" \
127     "application/ogg:ogg:Ogg stream;" \
128     /* explicit plugin call */ \
129     "application/x-vlc-plugin::VLC plugin;" \
130     /* windows media */ \
131     "video/x-ms-asf-plugin:asf,asx:Windows Media Video;" \
132     "video/x-ms-asf:asf,asx:Windows Media Video;" \
133     "application/x-mplayer2::Windows Media;" \
134     "video/x-ms-wmv:wmv:Windows Media;" \
135     /* Google VLC mime */ \
136     "application/x-google-vlc-plugin::Google VLC plugin" \
137     /* Misc */ \
138     "audio/wav::WAV audio" \
139     "audio/x-wav::WAV audio" \
140
141 #endif