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.
29
#include "totemPlugin.h"
30
#include "totemConeVideo.h"
32
static const char *propertyNames[] = {
41
static const char *methodNames[] = {
46
TOTEM_IMPLEMENT_NPCLASS (totemConeVideo,
47
propertyNames, G_N_ELEMENTS (propertyNames),
48
methodNames, G_N_ELEMENTS (methodNames),
51
totemConeVideo::totemConeVideo (NPP aNPP)
52
: totemNPObject (aNPP)
57
totemConeVideo::~totemConeVideo ()
63
totemConeVideo::InvokeByIndex (int aIndex,
64
const NPVariant *argv,
68
TOTEM_LOG_INVOKE (aIndex, totemConeVideo);
70
switch (Methods (aIndex)) {
71
case eToggleFullscreen: {
72
/* FIXMEchpe this sucks */
74
BOOLEAN_TO_NPVARIANT (!Plugin()->IsFullscreen(), fullscreen);
75
return SetPropertyByIndex (eFullscreen, &fullscreen);
79
TOTEM_WARN_INVOKE_UNIMPLEMENTED (aIndex, totemConeVideo);
80
return VoidVariant (_result);
87
totemConeVideo::GetPropertyByIndex (int aIndex,
90
TOTEM_LOG_GETTER (aIndex, totemConeVideo);
92
switch (Properties (aIndex)) {
94
return BoolVariant (_result, Plugin()->IsFullscreen());
101
TOTEM_WARN_GETTER_UNIMPLEMENTED (aIndex, _result);
102
return VoidVariant (_result);
109
totemConeVideo::SetPropertyByIndex (int aIndex,
110
const NPVariant *aValue)
112
TOTEM_LOG_SETTER (aIndex, totemConeVideo);
114
switch (Properties (aIndex)) {
117
if (!GetBoolFromArguments (aValue, 1, 0, fullscreen))
120
Plugin()->SetFullscreen (fullscreen);
127
TOTEM_WARN_SETTER_UNIMPLEMENTED (aIndex, _result);
132
return ThrowPropertyNotWritable ();