1
/* Totem Complex plugin
3
* Copyright © 2004 Bastien Nocera <hadess@hadess.net>
4
* Copyright © 2002 David A. Schleef <ds@schleef.org>
5
* Copyright © 2006, 2008 Christian Persch
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Library General Public
9
* License as published by the Free Software Foundation; either
10
* version 2 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Library General Public License for more details.
17
* You should have received a copy of the GNU Library General Public
18
* License along with this library; if not, write to the
19
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20
* Boston, MA 02110-1301 USA.
31
#include "totemPlugin.h"
32
#include "totemComplexPlugin.h"
34
#define TOTEM_COMPLEX_VERSION_BUILD "10.0"
36
static const char *methodNames[] = {
50
"GetBandwidthAverage",
51
"GetBandwidthCurrent",
52
"GetBufferingTimeElapsed",
53
"GetBufferingTimeRemaining",
58
"GetConnectionBandwidth",
66
"GetEnableContextMenu",
67
"GetEnableDoubleSize",
68
"GetEnableFullScreen",
69
"GetEnableOriginalSize",
77
"GetLastErrorMoreInfoURL",
78
"GetLastErrorRMACode",
79
"GetLastErrorSeverity",
80
"GetLastErrorUserCode",
81
"GetLastErrorUserString",
97
"GetPacketsOutOfOrder",
102
"GetPreferedLanguageID",
103
"GetPreferedLanguageString",
104
"GetPreferredLanguageID",
105
"GetPreferredLanguageString",
108
"GetShowPreferences",
112
"GetSourceTransport",
119
"GetWantKeyboardEvents",
120
"GetWantMouseEvents",
126
"SetBackgroundColor",
134
"SetEnableContextMenu",
135
"SetEnableDoubleSize",
136
"SetEnableFullScreen",
137
"SetEnableOriginalSize",
149
"SetShowPreferences",
156
"SetWantKeyboardEvents",
160
TOTEM_IMPLEMENT_NPCLASS (totemComplexPlugin,
162
methodNames, G_N_ELEMENTS (methodNames),
165
totemComplexPlugin::totemComplexPlugin (NPP aNPP)
166
: totemNPObject (aNPP)
171
totemComplexPlugin::~totemComplexPlugin ()
177
totemComplexPlugin::InvokeByIndex (int aIndex,
178
const NPVariant *argv,
182
TOTEM_LOG_INVOKE (aIndex, totemComplexPlugin);
184
switch (Methods (aIndex)) {
195
case eGetAutoGoToURL:
197
case eGetBackgroundColor:
198
case eGetBandwidthAverage:
199
case eGetBandwidthCurrent:
200
case eGetBufferingTimeElapsed:
201
case eGetBufferingTimeRemaining:
206
case eGetConnectionBandwidth:
208
case eGetConsoleEvents:
211
case eGetCurrentEntry:
214
case eGetEnableContextMenu:
215
case eGetEnableDoubleSize:
216
case eGetEnableFullScreen:
217
case eGetEnableOriginalSize:
218
case eGetEntryAbstract:
219
case eGetEntryAuthor:
220
case eGetEntryCopyright:
223
case eGetImageStatus:
225
case eGetLastErrorMoreInfoURL:
226
case eGetLastErrorRMACode:
227
case eGetLastErrorSeverity:
228
case eGetLastErrorUserCode:
229
case eGetLastErrorUserString:
230
case eGetLastMessage:
235
case eGetMaintainAspect:
241
case eGetOriginalSize:
242
case eGetPacketsEarly:
243
case eGetPacketsLate:
244
case eGetPacketsMissing:
245
case eGetPacketsOutOfOrder:
246
case eGetPacketsReceived:
247
case eGetPacketsTotal:
250
case eGetPreferedLanguageID:
251
case eGetPreferedLanguageString:
252
case eGetPreferredLanguageID:
253
case eGetPreferredLanguageString:
256
case eGetShowPreferences:
257
case eGetShowStatistics:
260
case eGetSourceTransport:
261
case eGetStereoState:
263
case eGetUserCountryID:
264
TOTEM_WARN_INVOKE_UNIMPLEMENTED (aIndex, totemComplexPlugin);
265
return BoolVariant (_result, true);
267
case eGetVersionInfo:
268
return StringVariant (_result, TOTEM_COMPLEX_VERSION_BUILD);
271
case eGetWantKeyboardEvents:
272
case eGetWantMouseEvents:
276
case eSetAutoGoToURL:
278
case eSetBackgroundColor:
282
case eSetConsoleEvents:
286
case eSetEnableContextMenu:
287
case eSetEnableDoubleSize:
288
case eSetEnableFullScreen:
289
case eSetEnableOriginalSize:
291
case eSetImageStatus:
293
case eSetMaintainAspect:
297
case eSetOriginalSize:
301
case eSetShowPreferences:
302
case eSetShowStatistics:
308
case eSetWantKeyboardEvents:
309
case eSetWantMouseEvents:
310
TOTEM_WARN_INVOKE_UNIMPLEMENTED (aIndex, totemComplexPlugin);
311
return BoolVariant (_result, true);