1 /*****************************************************************************
2 * npolibvlc.h: official Javascript APIs
3 *****************************************************************************
4 * Copyright (C) 2002-2006 the VideoLAN team
6 * Authors: Damien Fouilleul <damien.fouilleul@laposte.net>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
24 ** defined runtime script objects
28 #include "nporuntime.h"
30 class LibvlcRootNPObject
: public RuntimeNPObject
33 friend class RuntimeNPClass
<LibvlcRootNPObject
>;
35 LibvlcRootNPObject(NPP instance
, const NPClass
*aClass
) :
36 RuntimeNPObject(instance
, aClass
),
43 virtual ~LibvlcRootNPObject();
45 static const int propertyCount
;
46 static const NPUTF8
* const propertyNames
[];
48 InvokeResult
getProperty(int index
, NPVariant
&result
);
50 static const int methodCount
;
51 static const NPUTF8
* const methodNames
[];
53 InvokeResult
invoke(int index
, const NPVariant
*args
, uint32_t argCount
, NPVariant
&result
);
58 NPObject
*playlistObj
;
59 NPObject
*subtitleObj
;
63 class LibvlcAudioNPObject
: public RuntimeNPObject
66 LibvlcAudioNPObject(NPP instance
, const NPClass
*aClass
) :
67 RuntimeNPObject(instance
, aClass
) {};
68 virtual ~LibvlcAudioNPObject() {};
70 friend class RuntimeNPClass
<LibvlcAudioNPObject
>;
72 static const int propertyCount
;
73 static const NPUTF8
* const propertyNames
[];
75 InvokeResult
getProperty(int index
, NPVariant
&result
);
76 InvokeResult
setProperty(int index
, const NPVariant
&value
);
78 static const int methodCount
;
79 static const NPUTF8
* const methodNames
[];
81 InvokeResult
invoke(int index
, const NPVariant
*args
, uint32_t argCount
, NPVariant
&result
);
84 class LibvlcInputNPObject
: public RuntimeNPObject
87 friend class RuntimeNPClass
<LibvlcInputNPObject
>;
89 LibvlcInputNPObject(NPP instance
, const NPClass
*aClass
) :
90 RuntimeNPObject(instance
, aClass
) {};
92 virtual ~LibvlcInputNPObject() {};
94 static const int propertyCount
;
95 static const NPUTF8
* const propertyNames
[];
97 InvokeResult
getProperty(int index
, NPVariant
&result
);
98 InvokeResult
setProperty(int index
, const NPVariant
&value
);
100 static const int methodCount
;
101 static const NPUTF8
* const methodNames
[];
103 InvokeResult
invoke(int index
, const NPVariant
*args
, uint32_t argCount
, NPVariant
&result
);
106 class LibvlcPlaylistItemsNPObject
: public RuntimeNPObject
109 friend class RuntimeNPClass
<LibvlcPlaylistItemsNPObject
>;
111 LibvlcPlaylistItemsNPObject(NPP instance
, const NPClass
*aClass
) :
112 RuntimeNPObject(instance
, aClass
) {};
113 virtual ~LibvlcPlaylistItemsNPObject() {};
115 static const int propertyCount
;
116 static const NPUTF8
* const propertyNames
[];
118 InvokeResult
getProperty(int index
, NPVariant
&result
);
120 static const int methodCount
;
121 static const NPUTF8
* const methodNames
[];
123 InvokeResult
invoke(int index
, const NPVariant
*args
, uint32_t argCount
, NPVariant
&result
);
126 class LibvlcPlaylistNPObject
: public RuntimeNPObject
129 friend class RuntimeNPClass
<LibvlcPlaylistNPObject
>;
131 LibvlcPlaylistNPObject(NPP instance
, const NPClass
*aClass
) :
132 RuntimeNPObject(instance
, aClass
),
133 playlistItemsObj(NULL
) {};
135 virtual ~LibvlcPlaylistNPObject();
137 static const int propertyCount
;
138 static const NPUTF8
* const propertyNames
[];
140 InvokeResult
getProperty(int index
, NPVariant
&result
);
142 static const int methodCount
;
143 static const NPUTF8
* const methodNames
[];
145 InvokeResult
invoke(int index
, const NPVariant
*args
, uint32_t argCount
, NPVariant
&result
);
147 void parseOptions(const NPString
&s
, int *i_options
, char*** ppsz_options
);
148 void parseOptions(NPObject
*obj
, int *i_options
, char*** ppsz_options
);
151 NPObject
* playlistItemsObj
;
154 class LibvlcSubtitleNPObject
: public RuntimeNPObject
157 friend class RuntimeNPClass
<LibvlcSubtitleNPObject
>;
159 LibvlcSubtitleNPObject(NPP instance
, const NPClass
*aClass
) :
160 RuntimeNPObject(instance
, aClass
) {};
161 virtual ~LibvlcSubtitleNPObject() {};
163 static const int propertyCount
;
164 static const NPUTF8
* const propertyNames
[];
166 InvokeResult
getProperty(int index
, NPVariant
&result
);
167 InvokeResult
setProperty(int index
, const NPVariant
&value
);
169 static const int methodCount
;
170 static const NPUTF8
* const methodNames
[];
172 InvokeResult
invoke(int index
, const NPVariant
*args
, uint32_t argCount
, NPVariant
&result
);
176 class LibvlcVideoNPObject
: public RuntimeNPObject
179 friend class RuntimeNPClass
<LibvlcVideoNPObject
>;
181 LibvlcVideoNPObject(NPP instance
, const NPClass
*aClass
) :
182 RuntimeNPObject(instance
, aClass
),
183 marqueeObj(NULL
), logoObj(NULL
), deintObj(NULL
) { }
184 virtual ~LibvlcVideoNPObject();
186 static const int propertyCount
;
187 static const NPUTF8
* const propertyNames
[];
189 InvokeResult
getProperty(int index
, NPVariant
&result
);
190 InvokeResult
setProperty(int index
, const NPVariant
&value
);
192 static const int methodCount
;
193 static const NPUTF8
* const methodNames
[];
195 InvokeResult
invoke(int index
, const NPVariant
*args
, uint32_t argCount
, NPVariant
&result
);
198 NPObject
*marqueeObj
;
203 class LibvlcMarqueeNPObject
: public RuntimeNPObject
206 friend class RuntimeNPClass
<LibvlcMarqueeNPObject
>;
208 LibvlcMarqueeNPObject(NPP instance
, const NPClass
*aClass
) :
209 RuntimeNPObject(instance
, aClass
) {};
210 virtual ~LibvlcMarqueeNPObject() {};
212 static const int propertyCount
;
213 static const NPUTF8
* const propertyNames
[];
215 InvokeResult
getProperty(int index
, NPVariant
&result
);
216 InvokeResult
setProperty(int index
, const NPVariant
&value
);
218 static const int methodCount
;
219 static const NPUTF8
* const methodNames
[];
221 InvokeResult
invoke(int index
, const NPVariant
*args
, uint32_t argCount
, NPVariant
&result
);
224 class LibvlcLogoNPObject
: public RuntimeNPObject
227 friend class RuntimeNPClass
<LibvlcLogoNPObject
>;
229 LibvlcLogoNPObject(NPP instance
, const NPClass
*aClass
) :
230 RuntimeNPObject(instance
, aClass
) { }
231 virtual ~LibvlcLogoNPObject() { }
233 static const int propertyCount
;
234 static const NPUTF8
* const propertyNames
[];
236 InvokeResult
getProperty(int index
, NPVariant
&result
);
237 InvokeResult
setProperty(int index
, const NPVariant
&value
);
239 static const int methodCount
;
240 static const NPUTF8
* const methodNames
[];
242 InvokeResult
invoke(int index
, const NPVariant
*args
, uint32_t argCount
, NPVariant
&result
);
245 class LibvlcDeinterlaceNPObject
: public RuntimeNPObject
248 friend class RuntimeNPClass
<LibvlcDeinterlaceNPObject
>;
250 LibvlcDeinterlaceNPObject(NPP instance
, const NPClass
*aClass
) :
251 RuntimeNPObject(instance
, aClass
) { }
252 virtual ~LibvlcDeinterlaceNPObject() { }
254 static const int propertyCount
;
255 static const NPUTF8
* const propertyNames
[];
257 InvokeResult
getProperty(int index
, NPVariant
&result
);
258 InvokeResult
setProperty(int index
, const NPVariant
&value
);
260 static const int methodCount
;
261 static const NPUTF8
* const methodNames
[];
263 InvokeResult
invoke(int index
, const NPVariant
*args
, uint32_t argCount
, NPVariant
&result
);