~swem/totem/assignment

« back to all changes in this revision

Viewing changes to browser-plugin/totemComplexPlugin.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2010-01-27 09:40:18 UTC
  • mfrom: (1.4.2 upstream) (5.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20100127094018-q6rzt7va0y8ketwt
Tags: 2.29.4-1
* New upstream development release:
  + debian/patches/90_autotools.patch:
    - Refreshed for the new version.
  + debian/control.in:
    - Update build dependencies and dependencies.
    - Drop tracker plugin, it needs tracker 0.7.
  + debian/totem-mozilla.links:
    - Drop the complex plugin, it doesn't exist anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Totem Complex plugin
2
 
 *
3
 
 * Copyright © 2004 Bastien Nocera <hadess@hadess.net>
4
 
 * Copyright © 2002 David A. Schleef <ds@schleef.org>
5
 
 * Copyright © 2006, 2008 Christian Persch
6
 
 *
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.
11
 
 *
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.
16
 
 *
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.
21
 
 */
22
 
 
23
 
#include <config.h>
24
 
 
25
 
#include <string.h>
26
 
 
27
 
#include <glib.h>
28
 
 
29
 
#include "npupp.h"
30
 
 
31
 
#include "totemPlugin.h"
32
 
#include "totemComplexPlugin.h"
33
 
 
34
 
#define TOTEM_COMPLEX_VERSION_BUILD "10.0"
35
 
 
36
 
static const char *methodNames[] = {
37
 
  "CanPause",
38
 
  "CanPlay",
39
 
  "CanStop",
40
 
  "DoGotoURL",
41
 
  "DoNextEntry",
42
 
  "DoPause",
43
 
  "DoPlay",
44
 
  "DoPrevEntry",
45
 
  "DoStop",
46
 
  "GetAuthor",
47
 
  "GetAutoGoToURL",
48
 
  "GetAutoStart",
49
 
  "GetBackgroundColor",
50
 
  "GetBandwidthAverage",
51
 
  "GetBandwidthCurrent",
52
 
  "GetBufferingTimeElapsed",
53
 
  "GetBufferingTimeRemaining",
54
 
  "GetCanSeek",
55
 
  "GetCenter",
56
 
  "GetClipHeight",
57
 
  "GetClipWidth",
58
 
  "GetConnectionBandwidth",
59
 
  "GetConsole",
60
 
  "GetConsoleEvents",
61
 
  "GetControls",
62
 
  "GetCopyright",
63
 
  "GetCurrentEntry",
64
 
  "GetDoubleSize",
65
 
  "GetDRMInfo",
66
 
  "GetEnableContextMenu",
67
 
  "GetEnableDoubleSize",
68
 
  "GetEnableFullScreen",
69
 
  "GetEnableOriginalSize",
70
 
  "GetEntryAbstract",
71
 
  "GetEntryAuthor",
72
 
  "GetEntryCopyright",
73
 
  "GetEntryTitle",
74
 
  "GetFullScreen",
75
 
  "GetImageStatus",
76
 
  "GetIsPlus",
77
 
  "GetLastErrorMoreInfoURL",
78
 
  "GetLastErrorRMACode",
79
 
  "GetLastErrorSeverity",
80
 
  "GetLastErrorUserCode",
81
 
  "GetLastErrorUserString",
82
 
  "GetLastMessage",
83
 
  "GetLastStatus",
84
 
  "GetLength",
85
 
  "GetLiveState",
86
 
  "GetLoop",
87
 
  "GetMaintainAspect",
88
 
  "GetMute",
89
 
  "GetNoLogo",
90
 
  "GetNumEntries",
91
 
  "GetNumLoop",
92
 
  "GetNumSources",
93
 
  "GetOriginalSize",
94
 
  "GetPacketsEarly",
95
 
  "GetPacketsLate",
96
 
  "GetPacketsMissing",
97
 
  "GetPacketsOutOfOrder",
98
 
  "GetPacketsReceived",
99
 
  "GetPacketsTotal",
100
 
  "GetPlayState",
101
 
  "GetPosition",
102
 
  "GetPreferedLanguageID",
103
 
  "GetPreferedLanguageString",
104
 
  "GetPreferredLanguageID",
105
 
  "GetPreferredLanguageString",
106
 
  "GetPreFetch",
107
 
  "GetShowAbout",
108
 
  "GetShowPreferences",
109
 
  "GetShowStatistics",
110
 
  "GetShuffle",
111
 
  "GetSource",
112
 
  "GetSourceTransport",
113
 
  "GetStereoState",
114
 
  "GetTitle",
115
 
  "GetUserCountryID",
116
 
  "GetVersionInfo",
117
 
  "GetVolume",
118
 
  "GetWantErrors",
119
 
  "GetWantKeyboardEvents",
120
 
  "GetWantMouseEvents",
121
 
  "HasNextEntry",
122
 
  "HasPrevEntry",
123
 
  "SetAuthor",
124
 
  "SetAutoGoToURL",
125
 
  "SetAutoStart",
126
 
  "SetBackgroundColor",
127
 
  "SetCanSeek",
128
 
  "SetCenter",
129
 
  "SetConsole",
130
 
  "SetConsoleEvents",
131
 
  "SetControls",
132
 
  "SetCopyright",
133
 
  "SetDoubleSize",
134
 
  "SetEnableContextMenu",
135
 
  "SetEnableDoubleSize",
136
 
  "SetEnableFullScreen",
137
 
  "SetEnableOriginalSize",
138
 
  "SetFullScreen",
139
 
  "SetImageStatus",
140
 
  "SetLoop",
141
 
  "SetMaintainAspect",
142
 
  "SetMute",
143
 
  "SetNoLogo",
144
 
  "SetNumLoop",
145
 
  "SetOriginalSize",
146
 
  "SetPosition",
147
 
  "SetPreFetch",
148
 
  "SetShowAbout",
149
 
  "SetShowPreferences",
150
 
  "SetShowStatistics",
151
 
  "SetShuffle",
152
 
  "SetSource",
153
 
  "SetTitle",
154
 
  "SetVolume",
155
 
  "SetWantErrors",
156
 
  "SetWantKeyboardEvents",
157
 
  "SetWantMouseEvents"
158
 
};
159
 
 
160
 
TOTEM_IMPLEMENT_NPCLASS (totemComplexPlugin,
161
 
                         NULL, 0,
162
 
                         methodNames, G_N_ELEMENTS (methodNames),
163
 
                         NULL);
164
 
 
165
 
totemComplexPlugin::totemComplexPlugin (NPP aNPP)
166
 
  : totemNPObject (aNPP)
167
 
{
168
 
  TOTEM_LOG_CTOR ();
169
 
}
170
 
 
171
 
totemComplexPlugin::~totemComplexPlugin ()
172
 
{
173
 
  TOTEM_LOG_DTOR ();
174
 
}
175
 
 
176
 
bool
177
 
totemComplexPlugin::InvokeByIndex (int aIndex,
178
 
                               const NPVariant *argv,
179
 
                               uint32_t argc,
180
 
                               NPVariant *_result)
181
 
{
182
 
  TOTEM_LOG_INVOKE (aIndex, totemComplexPlugin);
183
 
 
184
 
  switch (Methods (aIndex)) {
185
 
    case eCanPause:
186
 
    case eCanPlay:
187
 
    case eCanStop:
188
 
    case eDoGotoURL:
189
 
    case eDoNextEntry:
190
 
    case eDoPause:
191
 
    case eDoPlay:
192
 
    case eDoPrevEntry:
193
 
    case eDoStop:
194
 
    case eGetAuthor:
195
 
    case eGetAutoGoToURL:
196
 
    case eGetAutoStart:
197
 
    case eGetBackgroundColor:
198
 
    case eGetBandwidthAverage:
199
 
    case eGetBandwidthCurrent:
200
 
    case eGetBufferingTimeElapsed:
201
 
    case eGetBufferingTimeRemaining:
202
 
    case eGetCanSeek:
203
 
    case eGetCenter:
204
 
    case eGetClipHeight:
205
 
    case eGetClipWidth:
206
 
    case eGetConnectionBandwidth:
207
 
    case eGetConsole:
208
 
    case eGetConsoleEvents:
209
 
    case eGetControls:
210
 
    case eGetCopyright:
211
 
    case eGetCurrentEntry:
212
 
    case eGetDoubleSize:
213
 
    case eGetDRMInfo:
214
 
    case eGetEnableContextMenu:
215
 
    case eGetEnableDoubleSize:
216
 
    case eGetEnableFullScreen:
217
 
    case eGetEnableOriginalSize:
218
 
    case eGetEntryAbstract:
219
 
    case eGetEntryAuthor:
220
 
    case eGetEntryCopyright:
221
 
    case eGetEntryTitle:
222
 
    case eGetFullScreen:
223
 
    case eGetImageStatus:
224
 
    case eGetIsPlus:
225
 
    case eGetLastErrorMoreInfoURL:
226
 
    case eGetLastErrorRMACode:
227
 
    case eGetLastErrorSeverity:
228
 
    case eGetLastErrorUserCode:
229
 
    case eGetLastErrorUserString:
230
 
    case eGetLastMessage:
231
 
    case eGetLastStatus:
232
 
    case eGetLength:
233
 
    case eGetLiveState:
234
 
    case eGetLoop:
235
 
    case eGetMaintainAspect:
236
 
    case eGetMute:
237
 
    case eGetNoLogo:
238
 
    case eGetNumEntries:
239
 
    case eGetNumLoop:
240
 
    case eGetNumSources:
241
 
    case eGetOriginalSize:
242
 
    case eGetPacketsEarly:
243
 
    case eGetPacketsLate:
244
 
    case eGetPacketsMissing:
245
 
    case eGetPacketsOutOfOrder:
246
 
    case eGetPacketsReceived:
247
 
    case eGetPacketsTotal:
248
 
    case eGetPlayState:
249
 
    case eGetPosition:
250
 
    case eGetPreferedLanguageID:
251
 
    case eGetPreferedLanguageString:
252
 
    case eGetPreferredLanguageID:
253
 
    case eGetPreferredLanguageString:
254
 
    case eGetPreFetch:
255
 
    case eGetShowAbout:
256
 
    case eGetShowPreferences:
257
 
    case eGetShowStatistics:
258
 
    case eGetShuffle:
259
 
    case eGetSource:
260
 
    case eGetSourceTransport:
261
 
    case eGetStereoState:
262
 
    case eGetTitle:
263
 
    case eGetUserCountryID:
264
 
      TOTEM_WARN_INVOKE_UNIMPLEMENTED (aIndex, totemComplexPlugin);
265
 
      return BoolVariant (_result, true);
266
 
      break;
267
 
    case eGetVersionInfo:
268
 
      return StringVariant (_result, TOTEM_COMPLEX_VERSION_BUILD);
269
 
    case eGetVolume:
270
 
    case eGetWantErrors:
271
 
    case eGetWantKeyboardEvents:
272
 
    case eGetWantMouseEvents:
273
 
    case eHasNextEntry:
274
 
    case eHasPrevEntry:
275
 
    case eSetAuthor:
276
 
    case eSetAutoGoToURL:
277
 
    case eSetAutoStart:
278
 
    case eSetBackgroundColor:
279
 
    case eSetCanSeek:
280
 
    case eSetCenter:
281
 
    case eSetConsole:
282
 
    case eSetConsoleEvents:
283
 
    case eSetControls:
284
 
    case eSetCopyright:
285
 
    case eSetDoubleSize:
286
 
    case eSetEnableContextMenu:
287
 
    case eSetEnableDoubleSize:
288
 
    case eSetEnableFullScreen:
289
 
    case eSetEnableOriginalSize:
290
 
    case eSetFullScreen:
291
 
    case eSetImageStatus:
292
 
    case eSetLoop:
293
 
    case eSetMaintainAspect:
294
 
    case eSetMute:
295
 
    case eSetNoLogo:
296
 
    case eSetNumLoop:
297
 
    case eSetOriginalSize:
298
 
    case eSetPosition:
299
 
    case eSetPreFetch:
300
 
    case eSetShowAbout:
301
 
    case eSetShowPreferences:
302
 
    case eSetShowStatistics:
303
 
    case eSetShuffle:
304
 
    case eSetSource:
305
 
    case eSetTitle:
306
 
    case eSetVolume:
307
 
    case eSetWantErrors:
308
 
    case eSetWantKeyboardEvents:
309
 
    case eSetWantMouseEvents:
310
 
      TOTEM_WARN_INVOKE_UNIMPLEMENTED (aIndex, totemComplexPlugin);
311
 
      return BoolVariant (_result, true);
312
 
  }
313
 
 
314
 
  return false;
315
 
}