86 |
JavaVM* GCJPluginFactory::s_jvm; |
JavaVM* GCJPluginFactory::s_jvm; |
87 |
JNIEnv* GCJPluginFactory::s_jniEnv; |
JNIEnv* GCJPluginFactory::s_jniEnv; |
88 |
int GCJPluginFactory::s_started = 0; |
int GCJPluginFactory::s_started = 0; |
|
std::string GCJPluginFactory::s_classpath; |
|
89 |
|
|
90 |
GCJPluginFactory::GCJPluginFactory () |
GCJPluginFactory::GCJPluginFactory () |
91 |
: m_class_AppletContextImpl (NULL) |
: m_class_AppletContextImpl (NULL) |
93 |
{ |
{ |
94 |
DEBUG ("GCJPluginFactory::GCJPluginFactory\n"); |
DEBUG ("GCJPluginFactory::GCJPluginFactory\n"); |
95 |
|
|
96 |
/* |
m_casspath = strdup (getenv ("CLASSPATH")); |
|
classpath = ":.:"; |
|
|
classpath += getenv ("CLASSPATH"); |
|
|
classpath += ":"; |
|
|
*/ |
|
97 |
} |
} |
98 |
|
|
99 |
GCJPluginFactory::~GCJPluginFactory () |
GCJPluginFactory::~GCJPluginFactory () |
100 |
{ |
{ |
101 |
DEBUG ("GCJPluginFactory::~FactoryGCJPluginFactory\n"); |
DEBUG ("GCJPluginFactory::~FactoryGCJPluginFactory\n"); |
102 |
|
|
103 |
|
free (m_classpath); |
104 |
} |
} |
105 |
|
|
106 |
NS_IMPL_ISUPPORTS1 (GCJPluginFactory, nsIPlugin) |
NS_IMPL_ISUPPORTS1 (GCJPluginFactory, nsIPlugin) |
190 |
{ |
{ |
191 |
DEBUG ("GCJPluginFactory::LockFactory\n"); |
DEBUG ("GCJPluginFactory::LockFactory\n"); |
192 |
|
|
193 |
//return NS_ERROR_NOT_IMPLEMENTED; |
return NS_ERROR_NOT_IMPLEMENTED; |
|
return NS_OK; |
|
194 |
} |
} |
195 |
|
|
196 |
NS_IMETHODIMP |
NS_IMETHODIMP |
214 |
NS_IMETHODIMP |
NS_IMETHODIMP |
215 |
GCJPluginFactory::GetMIMEDescription (const char** result) |
GCJPluginFactory::GetMIMEDescription (const char** result) |
216 |
{ |
{ |
217 |
//DEBUG ("GCJPluginFactory::GetMIMEDescription\n"); |
DEBUG ("GCJPluginFactory::GetMIMEDescription\n"); |
218 |
|
|
219 |
(*result) = PLUGIN_MIME_DESC; |
(*result) = PLUGIN_MIME_DESC; |
220 |
return NS_OK; |
return NS_OK; |
223 |
NS_IMETHODIMP |
NS_IMETHODIMP |
224 |
GCJPluginFactory::GetValue (nsPluginVariable variable, void* value) |
GCJPluginFactory::GetValue (nsPluginVariable variable, void* value) |
225 |
{ |
{ |
226 |
//DEBUG ("GCJPluginFactory::GetValue\n"); |
DEBUG ("GCJPluginFactory::GetValue\n"); |
227 |
|
|
228 |
if (variable == nsPluginVariable_NameString) |
if (variable == nsPluginVariable_NameString) |
229 |
(*((char**) value)) = PLUGIN_NAME; |
(*((char**) value)) = PLUGIN_NAME; |
238 |
return NS_OK; |
return NS_OK; |
239 |
} |
} |
240 |
|
|
|
/* |
|
|
NS_IMETHODIMP |
|
|
GCJPluginFactory::Show () |
|
|
{ |
|
|
DEBUG ("GCJPluginFactory::Show\n"); |
|
|
|
|
|
return NS_OK; |
|
|
} |
|
|
|
|
|
NS_IMETHODIMP |
|
|
GCJPluginFactory::Hide () |
|
|
{ |
|
|
DEBUG ("GCJPluginFactory::Hide\n"); |
|
|
|
|
|
return NS_OK; |
|
|
} |
|
|
|
|
|
NS_IMETHODIMP |
|
|
GCJPluginFactory::IsVisible (PRBool *result) |
|
|
{ |
|
|
DEBUG ("GCJPluginFactory::IsVisible\n"); |
|
|
|
|
|
return NS_OK; |
|
|
} |
|
|
|
|
|
NS_IMETHODIMP |
|
|
GCJPluginFactory::Print (const char* msg, const char* encodingName) |
|
|
{ |
|
|
DEBUG ("GCJPluginFactory::Print\n"); |
|
|
|
|
|
return NS_OK; |
|
|
} |
|
|
*/ |
|
|
|
|
241 |
NS_IMETHODIMP |
NS_IMETHODIMP |
242 |
GCJPluginFactory::AddToClassPath (const char* dirPath) |
GCJPluginFactory::AddToClassPath (const char* dirPath) |
243 |
{ |
{ |
244 |
DEBUG ("GCJPluginFactory::AddToClassPath\n"); |
DEBUG ("GCJPluginFactory::AddToClassPath\n"); |
245 |
|
|
246 |
s_classpath += std::string (dirPath) + ":"; |
char* tmp; |
247 |
|
int len_cp, len_path; |
248 |
|
|
249 |
|
len_cp = strlen (m_classpath); |
250 |
|
len_path = strlen (dirPath); |
251 |
|
tmp = malloc (len_cp + len_path + 2); |
252 |
|
strcpy (tmp, m_classpath); |
253 |
|
strcpy (&tmp [len_cp], ":"); |
254 |
|
strcpy (&tmp [len_cp + 1], dirPath); |
255 |
|
free (m_classpath); |
256 |
|
m_classpath = tmp; |
257 |
return NS_OK; |
return NS_OK; |
258 |
} |
} |
259 |
|
|
262 |
{ |
{ |
263 |
DEBUG ("GCJPluginFactory::RemoveFromClasspath\n"); |
DEBUG ("GCJPluginFactory::RemoveFromClasspath\n"); |
264 |
|
|
|
//s_classpath.replace (":" + std::string (dirPath)+ ":", ":"); |
|
|
//return NS_OK; |
|
265 |
return NS_ERROR_NOT_IMPLEMENTED; |
return NS_ERROR_NOT_IMPLEMENTED; |
266 |
} |
} |
267 |
|
|
270 |
{ |
{ |
271 |
DEBUG ("GCJPluginFactory::GetClasspath\n"); |
DEBUG ("GCJPluginFactory::GetClasspath\n"); |
272 |
|
|
273 |
(*result) = strdup (s_classpath.c_str ()); |
(*result) = strdup (m_classpath); |
274 |
return NS_OK; |
return NS_OK; |
275 |
} |
} |
276 |
|
|
290 |
if (!s_started) |
if (!s_started) |
291 |
return NS_ERROR_FAILURE; |
return NS_ERROR_FAILURE; |
292 |
|
|
293 |
//(*result) = new GCJSecureEnv (jvm, proxyEnv, jniEnv); |
return NS_ERROR_NOT_IMPLEMENTED; |
|
//return NS_OK; |
|
|
return NS_ERROR_FAILURE; |
|
294 |
} |
} |
295 |
|
|
296 |
NS_IMETHODIMP |
NS_IMETHODIMP |
298 |
{ |
{ |
299 |
DEBUG ("GCJPluginFactory::SpendTime"); |
DEBUG ("GCJPluginFactory::SpendTime"); |
300 |
|
|
301 |
// FIXME |
return NS_ERROR_NOT_IMPLEMENTED; |
|
//return NS_ERROR_NOT_IMPLEMENTED; |
|
|
return NS_OK; |
|
302 |
} |
} |
303 |
|
|
304 |
NS_IMETHODIMP |
NS_IMETHODIMP |