summaryrefslogtreecommitdiff
path: root/browser-plugin/totemComplexPlugin.cpp
blob: de9f6443742f5f693f90529a263a73641f5c761d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
/* Totem Complex plugin
 *
 * Copyright © 2004 Bastien Nocera <hadess@hadess.net>
 * Copyright © 2002 David A. Schleef <ds@schleef.org>
 * Copyright © 2006, 2008 Christian Persch
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301  USA.
 */

#include <config.h>

#include <string.h>

#include <glib.h>

#include "npupp.h"

#include "totemPlugin.h"
#include "totemComplexPlugin.h"

#define TOTEM_COMPLEX_VERSION_BUILD "10.0"

static const char *methodNames[] = {
  "CanPause",
  "CanPlay",
  "CanStop",
  "DoGotoURL",
  "DoNextEntry",
  "DoPause",
  "DoPlay",
  "DoPrevEntry",
  "DoStop",
  "GetAuthor",
  "GetAutoGoToURL",
  "GetAutoStart",
  "GetBackgroundColor",
  "GetBandwidthAverage",
  "GetBandwidthCurrent",
  "GetBufferingTimeElapsed",
  "GetBufferingTimeRemaining",
  "GetCanSeek",
  "GetCenter",
  "GetClipHeight",
  "GetClipWidth",
  "GetConnectionBandwidth",
  "GetConsole",
  "GetConsoleEvents",
  "GetControls",
  "GetCopyright",
  "GetCurrentEntry",
  "GetDoubleSize",
  "GetDRMInfo",
  "GetEnableContextMenu",
  "GetEnableDoubleSize",
  "GetEnableFullScreen",
  "GetEnableOriginalSize",
  "GetEntryAbstract",
  "GetEntryAuthor",
  "GetEntryCopyright",
  "GetEntryTitle",
  "GetFullScreen",
  "GetImageStatus",
  "GetIsPlus",
  "GetLastErrorMoreInfoURL",
  "GetLastErrorRMACode",
  "GetLastErrorSeverity",
  "GetLastErrorUserCode",
  "GetLastErrorUserString",
  "GetLastMessage",
  "GetLastStatus",
  "GetLength",
  "GetLiveState",
  "GetLoop",
  "GetMaintainAspect",
  "GetMute",
  "GetNoLogo",
  "GetNumEntries",
  "GetNumLoop",
  "GetNumSources",
  "GetOriginalSize",
  "GetPacketsEarly",
  "GetPacketsLate",
  "GetPacketsMissing",
  "GetPacketsOutOfOrder",
  "GetPacketsReceived",
  "GetPacketsTotal",
  "GetPlayState",
  "GetPosition",
  "GetPreferedLanguageID",
  "GetPreferedLanguageString",
  "GetPreferredLanguageID",
  "GetPreferredLanguageString",
  "GetPreFetch",
  "GetShowAbout",
  "GetShowPreferences",
  "GetShowStatistics",
  "GetShuffle",
  "GetSource",
  "GetSourceTransport",
  "GetStereoState",
  "GetTitle",
  "GetUserCountryID",
  "GetVersionInfo",
  "GetVolume",
  "GetWantErrors",
  "GetWantKeyboardEvents",
  "GetWantMouseEvents",
  "HasNextEntry",
  "HasPrevEntry",
  "SetAuthor",
  "SetAutoGoToURL",
  "SetAutoStart",
  "SetBackgroundColor",
  "SetCanSeek",
  "SetCenter",
  "SetConsole",
  "SetConsoleEvents",
  "SetControls",
  "SetCopyright",
  "SetDoubleSize",
  "SetEnableContextMenu",
  "SetEnableDoubleSize",
  "SetEnableFullScreen",
  "SetEnableOriginalSize",
  "SetFullScreen",
  "SetImageStatus",
  "SetLoop",
  "SetMaintainAspect",
  "SetMute",
  "SetNoLogo",
  "SetNumLoop",
  "SetOriginalSize",
  "SetPosition",
  "SetPreFetch",
  "SetShowAbout",
  "SetShowPreferences",
  "SetShowStatistics",
  "SetShuffle",
  "SetSource",
  "SetTitle",
  "SetVolume",
  "SetWantErrors",
  "SetWantKeyboardEvents",
  "SetWantMouseEvents"
};

TOTEM_IMPLEMENT_NPCLASS (totemComplexPlugin,
			 NULL, 0,
                         methodNames, G_N_ELEMENTS (methodNames),
                         NULL);

totemComplexPlugin::totemComplexPlugin (NPP aNPP)
  : totemNPObject (aNPP)
{
  TOTEM_LOG_CTOR ();
}

totemComplexPlugin::~totemComplexPlugin ()
{
  TOTEM_LOG_DTOR ();
}

bool
totemComplexPlugin::InvokeByIndex (int aIndex,
                               const NPVariant *argv,
                               uint32_t argc,
                               NPVariant *_result)
{
  TOTEM_LOG_INVOKE (aIndex, totemComplexPlugin);

  switch (Methods (aIndex)) {
    case eCanPause:
    case eCanPlay:
    case eCanStop:
    case eDoGotoURL:
    case eDoNextEntry:
    case eDoPause:
    case eDoPlay:
    case eDoPrevEntry:
    case eDoStop:
    case eGetAuthor:
    case eGetAutoGoToURL:
    case eGetAutoStart:
    case eGetBackgroundColor:
    case eGetBandwidthAverage:
    case eGetBandwidthCurrent:
    case eGetBufferingTimeElapsed:
    case eGetBufferingTimeRemaining:
    case eGetCanSeek:
    case eGetCenter:
    case eGetClipHeight:
    case eGetClipWidth:
    case eGetConnectionBandwidth:
    case eGetConsole:
    case eGetConsoleEvents:
    case eGetControls:
    case eGetCopyright:
    case eGetCurrentEntry:
    case eGetDoubleSize:
    case eGetDRMInfo:
    case eGetEnableContextMenu:
    case eGetEnableDoubleSize:
    case eGetEnableFullScreen:
    case eGetEnableOriginalSize:
    case eGetEntryAbstract:
    case eGetEntryAuthor:
    case eGetEntryCopyright:
    case eGetEntryTitle:
    case eGetFullScreen:
    case eGetImageStatus:
    case eGetIsPlus:
    case eGetLastErrorMoreInfoURL:
    case eGetLastErrorRMACode:
    case eGetLastErrorSeverity:
    case eGetLastErrorUserCode:
    case eGetLastErrorUserString:
    case eGetLastMessage:
    case eGetLastStatus:
    case eGetLength:
    case eGetLiveState:
    case eGetLoop:
    case eGetMaintainAspect:
    case eGetMute:
    case eGetNoLogo:
    case eGetNumEntries:
    case eGetNumLoop:
    case eGetNumSources:
    case eGetOriginalSize:
    case eGetPacketsEarly:
    case eGetPacketsLate:
    case eGetPacketsMissing:
    case eGetPacketsOutOfOrder:
    case eGetPacketsReceived:
    case eGetPacketsTotal:
    case eGetPlayState:
    case eGetPosition:
    case eGetPreferedLanguageID:
    case eGetPreferedLanguageString:
    case eGetPreferredLanguageID:
    case eGetPreferredLanguageString:
    case eGetPreFetch:
    case eGetShowAbout:
    case eGetShowPreferences:
    case eGetShowStatistics:
    case eGetShuffle:
    case eGetSource:
    case eGetSourceTransport:
    case eGetStereoState:
    case eGetTitle:
    case eGetUserCountryID:
      TOTEM_WARN_INVOKE_UNIMPLEMENTED (aIndex, totemComplexPlugin);
      return BoolVariant (_result, true);
      break;
    case eGetVersionInfo:
      return StringVariant (_result, TOTEM_COMPLEX_VERSION_BUILD);
    case eGetVolume:
    case eGetWantErrors:
    case eGetWantKeyboardEvents:
    case eGetWantMouseEvents:
    case eHasNextEntry:
    case eHasPrevEntry:
    case eSetAuthor:
    case eSetAutoGoToURL:
    case eSetAutoStart:
    case eSetBackgroundColor:
    case eSetCanSeek:
    case eSetCenter:
    case eSetConsole:
    case eSetConsoleEvents:
    case eSetControls:
    case eSetCopyright:
    case eSetDoubleSize:
    case eSetEnableContextMenu:
    case eSetEnableDoubleSize:
    case eSetEnableFullScreen:
    case eSetEnableOriginalSize:
    case eSetFullScreen:
    case eSetImageStatus:
    case eSetLoop:
    case eSetMaintainAspect:
    case eSetMute:
    case eSetNoLogo:
    case eSetNumLoop:
    case eSetOriginalSize:
    case eSetPosition:
    case eSetPreFetch:
    case eSetShowAbout:
    case eSetShowPreferences:
    case eSetShowStatistics:
    case eSetShuffle:
    case eSetSource:
    case eSetTitle:
    case eSetVolume:
    case eSetWantErrors:
    case eSetWantKeyboardEvents:
    case eSetWantMouseEvents:
      TOTEM_WARN_INVOKE_UNIMPLEMENTED (aIndex, totemComplexPlugin);
      return BoolVariant (_result, true);
  }

  return false;
}