1 --- sj2/source/java/jnihelp.cxx.orig 2003-08-08 20:54:39.000000000 -0700
2 +++ sj2/source/java/jnihelp.cxx 2003-08-08 20:55:41.000000000 -0700
5 ************************************************************************/
9 #include <tools/debug.hxx>
10 #include <jni.h> /* where everything is defined */
12 _xJavaThreadRegister_11->revokeThread();
17 --- sj2/source/jscpp/sjapplet.cxx.orig 2003-08-08 20:58:19.000000000 -0700
18 +++ sj2/source/jscpp/sjapplet.cxx 2003-08-08 21:01:41.000000000 -0700
20 ************************************************************************/
24 #include <jnihelp.hxx>
27 #include <sjapplet.hxx>
31 using namespace ::rtl;
32 using namespace ::utl;
34 using namespace ::sj2;
37 using namespace ::com::sun::star::lang;
38 using namespace ::com::sun::star::uno;
40 using namespace ::com::sun::star::java;
43 SjApplet2::SjApplet2()
44 : _pImpl(new SjApplet2_Impl())
47 * Java init function to invoke Java runtime using JNI invocation API.
51 void JRE_PropertyChanged( JNIEnv * env, const SvCommandList & rCmdList )
53 jclass pClass = env->FindClass("java/util/Properties");
55 env->DeleteLocalRef( pProps );
56 env->DeleteLocalRef( pClass );
60 // Settings are detected by the JavaVM service
61 // This function is not necessary anymore
62 --- sj2/source/jscpp/sjapplet_impl.cxx.orig 2003-08-08 21:06:04.000000000 -0700
63 +++ sj2/source/jscpp/sjapplet_impl.cxx 2003-08-08 21:24:29.000000000 -0700
65 #include <vcl/syschild.hxx>
66 #include <vcl/sysdata.hxx>
69 #include <jnihelp.hxx>
72 using namespace ::rtl;
73 using namespace ::osl;
75 using namespace ::sj2;
77 using namespace ::utl;
80 using namespace ::com::sun::star::java;
82 using namespace ::com::sun::star::lang;
83 using namespace ::com::sun::star::uno;
87 static void testJavaException(JNIEnv * pEnv) throw(com::sun::star::uno::RuntimeException)
89 jthrowable jtThrowable = pEnv->ExceptionOccurred();
91 throw RuntimeException(ouMessage, Reference<XInterface>());
95 +static void throwException() throw(com::sun::star::uno::RuntimeException)
97 + throw RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM("Java applets not supported.")), Reference<XInterface>());
103 struct EmbeddedWindow {
105 @@ -210,17 +223,22 @@
109 +#endif // SOLAR_JAVA
114 SjApplet2_Impl::SjApplet2_Impl() throw(com::sun::star::uno::RuntimeException)
116 _joAppletExecutionContext(0),
117 _jcAppletExecutionContext(0)
120 +#else // !SOLAR_JAVA
121 +SjApplet2_Impl::SjApplet2_Impl() throw(com::sun::star::uno::RuntimeException)
125 SjApplet2_Impl::~SjApplet2_Impl() throw() {
127 if (_joAppletExecutionContext) {
128 TKTThreadAttach jenv(_pJVM, _xJavaThreadRegister_11.get());
131 jenv.pEnv->DeleteGlobalRef(_joAppletExecutionContext);
132 jenv.pEnv->DeleteGlobalRef(_jcAppletExecutionContext);
137 void SjApplet2_Impl::init(Window * pParentWin,
139 const SvCommandList & rCmdList)
140 throw(com::sun::star::uno::RuntimeException)
143 _pParentWin = pParentWin;
146 @@ -338,11 +358,14 @@
147 joDocBase, joParameters, _pEmbeddedWindow->_joWindow, (jlong)0); testJavaException(jenv.pEnv);
148 jenv.pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_init); testJavaException(jenv.pEnv);
149 jenv.pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_startUp); testJavaException(jenv.pEnv);
151 +#else // !SOLAR_JAVA
156 void SjApplet2_Impl::setSize(const Size & rSize) throw(com::sun::star::uno::RuntimeException)
159 TKTThreadAttach jenv(_pJVM, _xJavaThreadRegister_11.get());
161 _pParentWin->SetSizePixel(rSize);
162 @@ -350,42 +373,62 @@
163 jmethodID jmAppletExecutionContext_resize = jenv.pEnv->GetMethodID(_jcAppletExecutionContext, "appletResize", "(II)V"); testJavaException(jenv.pEnv);
164 jenv.pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_resize, (jint)rSize.Width(),
165 (jint)rSize.Height()); testJavaException(jenv.pEnv);
166 +#else // !SOLAR_JAVA
171 void SjApplet2_Impl::restart() throw(com::sun::star::uno::RuntimeException)
174 TKTThreadAttach jenv(_pJVM, _xJavaThreadRegister_11.get());
176 jmethodID jmAppletExecutionContext_restart = jenv.pEnv->GetMethodID(_jcAppletExecutionContext, "restart", "()V"); testJavaException(jenv.pEnv);
177 jenv.pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_restart); testJavaException(jenv.pEnv);
178 +#else // !SOLAR_JAVA
183 void SjApplet2_Impl::reload() throw(com::sun::star::uno::RuntimeException)
186 TKTThreadAttach jenv(_pJVM, _xJavaThreadRegister_11.get());
188 jmethodID jmAppletExecutionContext_reload = jenv.pEnv->GetMethodID(_jcAppletExecutionContext, "reload", "()V"); testJavaException(jenv.pEnv);
189 jenv.pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_reload); testJavaException(jenv.pEnv);
190 +#else // !SOLAR_JAVA
195 void SjApplet2_Impl::start() throw(com::sun::star::uno::RuntimeException)
198 TKTThreadAttach jenv(_pJVM, _xJavaThreadRegister_11.get());
200 jmethodID jmAppletExecutionContext_sendStart = jenv.pEnv->GetMethodID(_jcAppletExecutionContext, "sendStart", "()V"); testJavaException(jenv.pEnv);
201 jenv.pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_sendStart); testJavaException(jenv.pEnv);
202 +#else // !SOLAR_JAVA
207 void SjApplet2_Impl::stop() throw(com::sun::star::uno::RuntimeException)
210 TKTThreadAttach jenv(_pJVM, _xJavaThreadRegister_11.get());
212 jmethodID jmAppletExecutionContext_sendStop = jenv.pEnv->GetMethodID(_jcAppletExecutionContext, "sendStop", "()V"); testJavaException(jenv.pEnv);
213 jenv.pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_sendStop); testJavaException(jenv.pEnv);
214 +#else // !SOLAR_JAVA
219 void SjApplet2_Impl::close() throw(com::sun::star::uno::RuntimeException)
222 TKTThreadAttach jenv(_pJVM, _xJavaThreadRegister_11.get());
224 jmethodID jmAppletExecutionContext_shutdown = jenv.pEnv->GetMethodID(_jcAppletExecutionContext, "shutdown", "()V"); testJavaException(jenv.pEnv);
229 +#else // !SOLAR_JAVA
234 --- sj2/source/jscpp/sjapplet_impl.hxx.orig 2003-08-08 21:24:48.000000000 -0700
235 +++ sj2/source/jscpp/sjapplet_impl.hxx 2003-08-08 21:35:45.000000000 -0700
243 +#endif // SOLAR_JAVA
245 #include <unotools/processfactory.hxx>
248 #include <com/sun/star/java/XJavaVM.hpp>
249 #include <com/sun/star/java/XJavaThreadRegister_11.hpp>
250 +#endif // SOLAR_JAVA
252 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
259 struct EmbeddedWindow;
260 +#endif // SOLAR_JAVA
262 struct SjApplet2_Impl {
264 Window * _pParentWin;
269 com::sun::star::uno::Reference<com::sun::star::java::XJavaVM> _xJavaVM;
270 com::sun::star::uno::Reference<com::sun::star::java::XJavaThreadRegister_11> _xJavaThreadRegister_11;
271 +#endif // SOLAR_JAVA
273 SjApplet2_Impl() throw(com::sun::star::uno::RuntimeException);
274 ~SjApplet2_Impl() throw();