34 |
exception statement from your version. */ |
exception statement from your version. */ |
35 |
|
|
36 |
|
|
37 |
|
#include <cassert> |
38 |
|
|
39 |
#include <nsplugindefs.h> |
#include <nsplugindefs.h> |
40 |
#include <nsIPluginInstancePeer.h> |
#include <nsIPluginInstancePeer.h> |
41 |
|
|
42 |
#include "GCJPluginInstance.h" |
#include "GCJPluginInstance.h" |
43 |
|
|
|
#include "CNIEmbeddedWindow.h" |
|
|
|
|
44 |
#define DEBUG(output) printf (output); |
#define DEBUG(output) printf (output); |
45 |
#define DEBUG2(output, arg) printf (output, arg); |
#define DEBUG2(output, arg) printf (output, arg); |
46 |
|
|
58 |
GCJPluginInstance::GCJPluginInstance (GCJPluginFactory* factory, JNIEnv* jniEnv) |
GCJPluginInstance::GCJPluginInstance (GCJPluginFactory* factory, JNIEnv* jniEnv) |
59 |
: m_peer (NULL) |
: m_peer (NULL) |
60 |
, m_jniEnv (jniEnv) |
, m_jniEnv (jniEnv) |
61 |
|
, m_applet (NULL) |
62 |
, m_embeddedWindow (NULL) |
, m_embeddedWindow (NULL) |
|
//, m_Applet (NULL) |
|
63 |
{ |
{ |
64 |
DEBUG ("GCJPluginInstance::GCJPluginInstance\n"); |
DEBUG ("GCJPluginInstance::GCJPluginInstance\n"); |
65 |
} |
} |
94 |
{ |
{ |
95 |
DEBUG ("GCJPluginInstance::Start\n"); |
DEBUG ("GCJPluginInstance::Start\n"); |
96 |
|
|
|
if (!m_embeddedWindow) |
|
|
return NS_OK; |
|
|
|
|
|
m_embeddedWindow->start(); |
|
97 |
return NS_OK; |
return NS_OK; |
98 |
} |
} |
99 |
|
|
102 |
{ |
{ |
103 |
DEBUG ("GCJPluginInstance::Stop\n"); |
DEBUG ("GCJPluginInstance::Stop\n"); |
104 |
|
|
|
if (!m_embeddedWindow) |
|
|
return NS_OK; |
|
|
|
|
|
m_embeddedWindow->stop(); |
|
105 |
return NS_OK; |
return NS_OK; |
106 |
} |
} |
107 |
|
|
117 |
GCJPluginInstance::SetWindow (nsPluginWindow* window) |
GCJPluginInstance::SetWindow (nsPluginWindow* window) |
118 |
{ |
{ |
119 |
DEBUG ("GCJPluginInstance::SetWindow\n"); |
DEBUG ("GCJPluginInstance::SetWindow\n"); |
120 |
|
|
121 |
if (!m_embeddedWindow) |
const char* ldpath = getenv ("LD_LIBRARY_PATH"); |
122 |
{ |
DEBUG (ldpath); |
123 |
m_embeddedWindow = new CNIEmbeddedWindow ((int) window->window, |
DEBUG ("\n"); |
124 |
(int) window->width, |
|
125 |
(int) window->height); |
jclass class_EmbeddedWindow = m_jniEnv->FindClass ("gnu/java/awt/EmbeddedWindow"); |
126 |
} |
assert (class_EmbeddedWindow); |
127 |
|
|
128 |
|
jmethodID method_class_EmbeddedWindow_init = m_jniEnv->GetMethodID (class_EmbeddedWindow, "<init>", "(III)V"); |
129 |
|
assert (method_class_EmbeddedWindow_init); |
130 |
|
|
131 |
|
m_embeddedWindow = m_jniEnv->NewObject (class_EmbeddedWindow, method_class_EmbeddedWindow_init, |
132 |
|
(jint) window->window, (jint) window->width, (jint) window->height); |
133 |
|
assert (m_embeddedWindow != NULL); |
134 |
|
CHECK_EXCEPTIONS; |
135 |
|
|
136 |
return NS_OK; |
return NS_OK; |
137 |
} |
} |
197 |
{ |
{ |
198 |
DEBUG ("GCJPluginInstance::GetJavaObject\n"); |
DEBUG ("GCJPluginInstance::GetJavaObject\n"); |
199 |
|
|
200 |
/* |
(*result) = (jobject) m_applet; |
|
(*result) = (jobject) m_Applet; |
|
201 |
return NS_OK; |
return NS_OK; |
|
*/ |
|
|
return NS_ERROR_NOT_IMPLEMENTED; |
|
202 |
} |
} |
203 |
|
|
204 |
NS_IMETHODIMP |
NS_IMETHODIMP |