FreeWRL/FreeX3D  3.0.0
ScriptablePluginObjectBase.cpp
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3  * Version: NPL 1.1/GPL 2.0/LGPL 2.1
4  *
5  * The contents of this file are subject to the Netscape Public License
6  * Version 1.1 (the "License"); you may not use this file except in
7  * compliance with the License. You may obtain a copy of the License at
8  * http://www.mozilla.org/NPL/
9  *
10  * Software distributed under the License is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12  * for the specific language governing rights and limitations under the
13  * License.
14  *
15  * The Original Code is mozilla.org code.
16  *
17  * The Initial Developer of the Original Code is
18  * Netscape Communications Corporation.
19  * Portions created by the Initial Developer are Copyright (C) 1998
20  * the Initial Developer. All Rights Reserved.
21  *
22  * Contributor(s):
23  *
24  * Alternatively, the contents of this file may be used under the terms of
25  * either the GNU General Public License Version 2 or later (the "GPL"), or
26  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27  * in which case the provisions of the GPL or the LGPL are applicable instead
28  * of those above. If you wish to allow use of your version of this file only
29  * under the terms of either the GPL or the LGPL, and not to allow others to
30  * use your version of this file under the terms of the NPL, indicate your
31  * decision by deleting the provisions above and replace them with the notice
32  * and other provisions required by the GPL or the LGPL. If you do not delete
33  * the provisions above, a recipient may use your version of this file under
34  * the terms of any one of the NPL, the GPL or the LGPL.
35  *
36  * ***** END LICENSE BLOCK ***** */
37 
38 #include "ScriptablePluginObjectBase.h"
39 
40 void
41 ScriptablePluginObjectBase::Invalidate()
42 {
43 }
44 
45 bool
46 ScriptablePluginObjectBase::HasMethod(NPIdentifier name)
47 {
48  return false;
49 }
50 
51 bool
52 ScriptablePluginObjectBase::Invoke(NPIdentifier name, const NPVariant *args,
53  uint32_t argCount, NPVariant *result)
54 {
55  return false;
56 }
57 
58 bool
59 ScriptablePluginObjectBase::InvokeDefault(const NPVariant *args,
60  uint32_t argCount, NPVariant *result)
61 {
62  return false;
63 }
64 
65 bool
66 ScriptablePluginObjectBase::HasProperty(NPIdentifier name)
67 {
68  return false;
69 }
70 
71 bool
72 ScriptablePluginObjectBase::GetProperty(NPIdentifier name, NPVariant *result)
73 {
74  return false;
75 }
76 
77 bool
78 ScriptablePluginObjectBase::SetProperty(NPIdentifier name,
79  const NPVariant *value)
80 {
81  /*if (name == sBar_id) {
82  printf ("bar set\n");
83 
84  return true;
85  }*/
86 
87  return false;
88 }
89 
90 bool
91 ScriptablePluginObjectBase::RemoveProperty(NPIdentifier name)
92 {
93  return false;
94 }
95 
96 bool
97 ScriptablePluginObjectBase::Enumerate(NPIdentifier **identifier,
98  uint32_t *count)
99 {
100  return false;
101 }
102 
103 bool
104 ScriptablePluginObjectBase::Construct(const NPVariant *args, uint32_t argCount,
105  NPVariant *result)
106 {
107  return false;
108 }
109 
110 // static
111 void
112 ScriptablePluginObjectBase::_Deallocate(NPObject *npobj)
113 {
114  // Call the virtual destructor.
115  delete (ScriptablePluginObjectBase *)npobj;
116 }
117 
118 // static
119 void
120 ScriptablePluginObjectBase::_Invalidate(NPObject *npobj)
121 {
122  ((ScriptablePluginObjectBase *)npobj)->Invalidate();
123 }
124 
125 // static
126 bool
127 ScriptablePluginObjectBase::_HasMethod(NPObject *npobj, NPIdentifier name)
128 {
129  return ((ScriptablePluginObjectBase *)npobj)->HasMethod(name);
130 }
131 
132 // static
133 bool
134 ScriptablePluginObjectBase::_Invoke(NPObject *npobj, NPIdentifier name,
135  const NPVariant *args, uint32_t argCount,
136  NPVariant *result)
137 {
138  return ((ScriptablePluginObjectBase *)npobj)->Invoke(name, args, argCount,
139  result);
140 }
141 
142 // static
143 bool
144 ScriptablePluginObjectBase::_InvokeDefault(NPObject *npobj,
145  const NPVariant *args,
146  uint32_t argCount,
147  NPVariant *result)
148 {
149  return ((ScriptablePluginObjectBase *)npobj)->InvokeDefault(args, argCount,
150  result);
151 }
152 
153 // static
154 bool
155 ScriptablePluginObjectBase::_HasProperty(NPObject * npobj, NPIdentifier name)
156 {
157  return ((ScriptablePluginObjectBase *)npobj)->HasProperty(name);
158 }
159 
160 // static
161 bool
162 ScriptablePluginObjectBase::_GetProperty(NPObject *npobj, NPIdentifier name,
163  NPVariant *result)
164 {
165  return ((ScriptablePluginObjectBase *)npobj)->GetProperty(name, result);
166 }
167 
168 // static
169 bool
170 ScriptablePluginObjectBase::_SetProperty(NPObject *npobj, NPIdentifier name,
171  const NPVariant *value)
172 {
173  return ((ScriptablePluginObjectBase *)npobj)->SetProperty(name, value);
174 }
175 
176 // static
177 bool
178 ScriptablePluginObjectBase::_RemoveProperty(NPObject *npobj, NPIdentifier name)
179 {
180  return ((ScriptablePluginObjectBase *)npobj)->RemoveProperty(name);
181 }
182 
183 // static
184 bool
185 ScriptablePluginObjectBase::_Enumerate(NPObject *npobj,
186  NPIdentifier **identifier,
187  uint32_t *count)
188 {
189  return ((ScriptablePluginObjectBase *)npobj)->Enumerate(identifier, count);
190 }
191 
192 // static
193 bool
194 ScriptablePluginObjectBase::_Construct(NPObject *npobj, const NPVariant *args,
195  uint32_t argCount, NPVariant *result)
196 {
197  return ((ScriptablePluginObjectBase *)npobj)->Construct(args, argCount,
198  result);
199 }