author | cg |
Mon, 23 Nov 1998 20:15:44 +0000 | |
changeset 460 | 6a2e97955261 |
parent 459 | a73a8726694c |
child 461 | a9813035ef09 |
permissions | -rw-r--r-- |
454 | 1 |
" |
2 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
||
14 |
||
253 | 15 |
Object subclass:#JavaVM |
16 |
instanceVariableNames:'' |
|
17 |
classVariableNames:'UnhandledJavaExceptionSignal JavaExceptionSignal |
|
18 |
UnimplementedInstructionSignal UnimplementedNativeMethodSignal |
|
19 |
BadMessageSignal InternalErrorSignal CallHandlerSignal |
|
20 |
FullExceptionTrace StackTrace TraceHistory LockTable |
|
277 | 21 |
LockTableAccess LibPath SimulatedLibs LoadedLibs |
22 |
SimulatedNativeLibs LoadedNativeLibs WaitTable WaitTableAccess |
|
23 |
JavaWindowGroup KnownWindows DrawOPTrace WindowOPTrace |
|
24 |
WindowCreationTrace EventTrace ThreadTrace MonitorTrace |
|
25 |
ExceptionTrace InsnCount InsnCounts FileOpenTrace |
|
390 | 26 |
FileOpenConfirmation SocketConnectConfirmation FileIOTrace |
27 |
OpenFileTable CachedNativeMethodTable ExceptionDebug |
|
28 |
JavaConsoleStream StandardThreadGroup EnteredMonitorsPerProcess |
|
29 |
JavaClasses JavaMethods DUMMY_LONG_HIGHWORD DUMMY_DOUBLE_HIGHWORD |
|
442 | 30 |
NoAudio FirstWindowCreationSemaphore ScreenUpdaterProcess |
459 | 31 |
PermittedDirectories O_WGgraphics_originX O_WGgraphics_originY |
32 |
O_WGgraphics_pData O_FramePeer_pNativeWidget O_FramePeer_pData' |
|
253 | 33 |
poolDictionaries:'' |
34 |
category:'Java-Support' |
|
35 |
! |
|
36 |
||
261 | 37 |
!JavaVM class methodsFor:'documentation'! |
38 |
||
454 | 39 |
copyright |
40 |
" |
|
41 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
42 |
All Rights Reserved |
|
43 |
||
44 |
This software is furnished under a license and may be used |
|
45 |
only in accordance with the terms of that license and with the |
|
46 |
inclusion of the above copyright notice. This software may not |
|
47 |
be provided or otherwise made available to, or used by, any |
|
48 |
other person. No title to or ownership of the software is |
|
49 |
hereby transferred. |
|
50 |
" |
|
51 |
||
52 |
||
53 |
! |
|
54 |
||
261 | 55 |
nativeMethods |
56 |
" |
|
440 | 57 |
all native methods: |
58 |
||
59 |
JavaMethod allSubInstances select:[:m | |
|
60 |
m isNative |
|
61 |
] |
|
62 |
||
63 |
implemented methods: |
|
64 |
||
65 |
JavaMethod allSubInstances select:[:m | |
|
66 |
|sel| |
|
67 |
||
68 |
m isNative ifTrue:[ |
|
69 |
sel := ('_' , m javaClass lastName , '_' , m name , ':') asSymbol. |
|
70 |
JavaVM class implements:sel. |
|
71 |
] ifFalse:[ |
|
72 |
false |
|
73 |
] |
|
74 |
] |
|
75 |
||
76 |
unimplemented methods: |
|
77 |
||
78 |
JavaMethod allSubInstances select:[:m | |
|
79 |
|sel| |
|
80 |
||
81 |
m isNative ifTrue:[ |
|
82 |
sel := ('_' , m javaClass lastName , '_' , m name , ':') asSymbol. |
|
83 |
(JavaVM class implements:sel) not |
|
84 |
] ifFalse:[ |
|
85 |
false |
|
86 |
] |
|
87 |
] |
|
88 |
||
89 |
||
261 | 90 |
list of all native methods as in jdk1.1.3: |
91 |
||
92 |
X - implemented |
|
93 |
x - implemented with limited functionality |
|
94 |
o - implemented as dummy (no functionality) |
|
95 |
||
96 |
X (Math::double sin (double)) |
|
97 |
X (Math::double cos (double)) |
|
342 | 98 |
X (Math::double tan (double)) |
99 |
X (Math::double asin (double)) |
|
100 |
X (Math::double acos (double)) |
|
101 |
X (Math::double atan (double)) |
|
102 |
X (Math::double exp (double)) |
|
261 | 103 |
X (Math::double log (double)) |
104 |
X (Math::double sqrt (double)) |
|
105 |
(Math::double IEEEremainder (double double)) |
|
106 |
X (Math::double ceil (double)) |
|
107 |
X (Math::double floor (double)) |
|
108 |
(Math::double rint (double)) |
|
109 |
(Math::double atan2 (double double)) |
|
110 |
X (Math::double pow (double double)) |
|
111 |
||
112 |
X (Class::java.lang.Class forName (java.lang.String)) |
|
113 |
X (Class::java.lang.Object newInstance ()) |
|
114 |
(Class::boolean isInstance (java.lang.Object)) |
|
115 |
(Class::boolean isAssignableFrom (java.lang.Class)) |
|
116 |
X (Class::boolean isInterface ()) |
|
117 |
(Class::boolean isArray ()) |
|
342 | 118 |
X (Class::boolean isPrimitive ()) |
261 | 119 |
X (Class::java.lang.String getName ()) |
120 |
X (Class::java.lang.ClassLoader getClassLoader ()) |
|
121 |
X (Class::java.lang.Class getSuperclass ()) |
|
122 |
(Class::java.lang.Class[] getInterfaces ()) |
|
123 |
(Class::java.lang.Class getComponentType ()) |
|
124 |
(Class::int getModifiers ()) |
|
125 |
(Class::java.lang.Object[] getSigners ()) |
|
126 |
(Class::void setSigners (java.lang.Object[])) |
|
127 |
X (Class::java.lang.Class getPrimitiveClass (java.lang.String)) |
|
128 |
(Class::java.lang.reflect.Field[] getFields0 (int)) |
|
342 | 129 |
X (Class::java.lang.reflect.Method[] getMethods0 (int)) |
261 | 130 |
(Class::java.lang.reflect.Constructor[] getConstructors0 (int)) |
131 |
(Class::java.lang.reflect.Field getField0 (java.lang.String int)) |
|
342 | 132 |
X (Class::java.lang.reflect.Method getMethod0 (java.lang.String java.lang.Class[] int)) |
261 | 133 |
(Class::java.lang.reflect.Constructor getConstructor0 (java.lang.Class[] int)) |
134 |
||
135 |
X (InetAddressImpl::java.lang.String getLocalHostName ()) |
|
136 |
X (InetAddressImpl::void makeAnyLocalAddress (java.net.InetAddress)) |
|
137 |
X (InetAddressImpl::byte[][] lookupAllHostAddr (java.lang.String)) |
|
138 |
(InetAddressImpl::java.lang.String getHostByAddr (int)) |
|
139 |
X (InetAddressImpl::int getInetFamily ()) |
|
140 |
||
141 |
X (ResourceBundle::java.lang.Class[] getClassContext ()) |
|
142 |
||
143 |
X (System::void setIn0 (java.io.InputStream)) |
|
144 |
X (System::void setOut0 (java.io.PrintStream)) |
|
145 |
X (System::void setErr0 (java.io.PrintStream)) |
|
146 |
X (System::long currentTimeMillis ()) |
|
147 |
X (System::void arraycopy (java.lang.Object int java.lang.Object int int)) |
|
148 |
(System::int identityHashCode (java.lang.Object)) |
|
149 |
X (System::java.util.Properties initProperties (java.util.Properties)) |
|
150 |
||
151 |
X (Thread::java.lang.Thread currentThread ()) |
|
152 |
X (Thread::void yield ()) |
|
153 |
X (Thread::void sleep (long)) |
|
154 |
X (Thread::void start ()) |
|
155 |
X (Thread::boolean isInterrupted (boolean)) |
|
156 |
X (Thread::boolean isAlive ()) |
|
157 |
(Thread::int countStackFrames ()) |
|
158 |
X (Thread::void setPriority0 (int)) |
|
159 |
X (Thread::void stop0 (java.lang.Object)) |
|
160 |
X (Thread::void suspend0 ()) |
|
161 |
X (Thread::void resume0 ()) |
|
162 |
(Thread::void interrupt0 ()) |
|
163 |
||
342 | 164 |
(String::java.lang.String intern ()) |
261 | 165 |
|
166 |
X (Float::int floatToIntBits (float)) |
|
167 |
X (Float::float intBitsToFloat (int)) |
|
168 |
||
169 |
(ObjectStreamClass::int getClassAccess (java.lang.Class)) |
|
170 |
(ObjectStreamClass::java.lang.String[] getMethodSignatures (java.lang.Class)) |
|
171 |
(ObjectStreamClass::int getMethodAccess (java.lang.Class java.lang.String)) |
|
172 |
(ObjectStreamClass::java.lang.String[] getFieldSignatures (java.lang.Class)) |
|
173 |
(ObjectStreamClass::int getFieldAccess (java.lang.Class java.lang.String)) |
|
174 |
(ObjectStreamClass::java.io.ObjectStreamField[] getFields0 (java.lang.Class)) |
|
175 |
(ObjectStreamClass::long getSerialVersionUID (java.lang.Class)) |
|
176 |
(ObjectStreamClass::boolean hasWriteObject (java.lang.Class)) |
|
177 |
(ObjectInputStream::java.lang.Class loadClass0 (java.lang.Class java.lang.String)) |
|
178 |
(ObjectInputStream::void inputClassFields (java.lang.Object java.lang.Class int[])) |
|
179 |
(ObjectInputStream::java.lang.Object allocateNewObject (java.lang.Class java.lang.Class)) |
|
180 |
(ObjectInputStream::java.lang.Object allocateNewArray (java.lang.Class int)) |
|
181 |
(ObjectInputStream::boolean invokeObjectReader (java.lang.Object java.lang.Class)) |
|
182 |
||
183 |
(SecurityManager::java.lang.Class[] getClassContext ()) |
|
184 |
X (SecurityManager::java.lang.ClassLoader currentClassLoader ()) |
|
185 |
(SecurityManager::int classDepth (java.lang.String)) |
|
186 |
X (SecurityManager::int classLoaderDepth ()) |
|
187 |
(SecurityManager::java.lang.Class currentLoadedClass0 ()) |
|
188 |
||
189 |
X (ClassLoader::void init ()) |
|
190 |
X (ClassLoader::java.lang.Class defineClass0 (java.lang.String byte[] int int)) |
|
191 |
X (ClassLoader::void resolveClass0 (java.lang.Class)) |
|
192 |
X (ClassLoader::java.lang.Class findSystemClass0 (java.lang.String)) |
|
193 |
X (ClassLoader::java.io.InputStream getSystemResourceAsStream0 (java.lang.String)) |
|
194 |
(ClassLoader::java.lang.String getSystemResourceAsName0 (java.lang.String)) |
|
195 |
||
196 |
(FileDescriptor::boolean valid ()) |
|
197 |
(FileDescriptor::void sync ()) |
|
198 |
X (FileDescriptor::java.io.FileDescriptor initSystemFD (java.io.FileDescriptor int)) |
|
199 |
||
200 |
X (Object::java.lang.Class getClass ()) |
|
201 |
X (Object::int hashCode ()) |
|
202 |
X (Object::java.lang.Object clone ()) |
|
203 |
X (Object::void notify ()) |
|
204 |
X (Object::void notifyAll ()) |
|
205 |
X (Object::void wait (long)) |
|
206 |
||
207 |
X (FileOutputStream::void open (java.lang.String)) |
|
342 | 208 |
X (FileOutputStream::void openAppend (java.lang.String)) |
261 | 209 |
X (FileOutputStream::void write (int)) |
210 |
X (FileOutputStream::void writeBytes (byte[] int int)) |
|
211 |
X (FileOutputStream::void close ()) |
|
212 |
X (FileInputStream::void open (java.lang.String)) |
|
213 |
X (FileInputStream::int read ()) |
|
214 |
X (FileInputStream::int readBytes (byte[] int int)) |
|
215 |
(FileInputStream::long skip (long)) |
|
216 |
X (FileInputStream::int available ()) |
|
217 |
X (FileInputStream::void close ()) |
|
218 |
||
219 |
(VM::int getState ()) |
|
220 |
(VM::boolean threadsSuspended ()) |
|
221 |
(VM::void unsuspendThreads ()) |
|
222 |
(VM::void unsuspendSomeThreads ()) |
|
223 |
||
224 |
X (File::boolean exists0 ()) |
|
342 | 225 |
X (File::boolean canWrite0 ()) |
261 | 226 |
X (File::boolean canRead0 ()) |
227 |
X (File::boolean isFile0 ()) |
|
228 |
X (File::boolean isDirectory0 ()) |
|
342 | 229 |
X (File::long lastModified0 ()) |
261 | 230 |
X (File::long length0 ()) |
342 | 231 |
X (File::boolean mkdir0 ()) |
261 | 232 |
(File::boolean renameTo0 (java.io.File)) |
233 |
(File::boolean delete0 ()) |
|
234 |
(File::boolean rmdir0 ()) |
|
235 |
X (File::java.lang.String[] list0 ()) |
|
236 |
(File::java.lang.String canonPath (java.lang.String)) |
|
237 |
X (File::boolean isAbsolute ()) |
|
238 |
||
239 |
(ObjectOutputStream::void outputClassFields (java.lang.Object java.lang.Class int[])) |
|
240 |
(ObjectOutputStream::boolean invokeObjectWriter (java.lang.Object java.lang.Class)) |
|
241 |
||
242 |
X (Throwable::void printStackTrace0 (java.lang.Object)) |
|
243 |
X (Throwable::java.lang.Throwable fillInStackTrace ()) |
|
244 |
||
245 |
X (Double::long doubleToLongBits (double)) |
|
246 |
X (Double::double longBitsToDouble (long)) |
|
247 |
X (Double::double valueOf0 (java.lang.String)) |
|
248 |
||
249 |
X (Runtime::void exitInternal (int)) |
|
250 |
(Runtime::void runFinalizersOnExit0 (boolean)) |
|
251 |
o (Runtime::java.lang.Process execInternal (java.lang.String[] java.lang.String[])) |
|
252 |
X (Runtime::long freeMemory ()) |
|
253 |
X (Runtime::long totalMemory ()) |
|
254 |
X (Runtime::void gc ()) |
|
255 |
(Runtime::void runFinalization ()) |
|
256 |
(Runtime::void traceInstructions (boolean)) |
|
257 |
(Runtime::void traceMethodCalls (boolean)) |
|
258 |
X (Runtime::java.lang.String initializeLinkerInternal ()) |
|
259 |
X (Runtime::java.lang.String buildLibName (java.lang.String java.lang.String)) |
|
260 |
X (Runtime::int loadFileInternal (java.lang.String)) |
|
261 |
||
262 |
(WDrawingSurfaceInfo::int lock ()) |
|
263 |
(WDrawingSurfaceInfo::void unlock ()) |
|
264 |
(WDrawingSurfaceInfo::int getHWnd ()) |
|
265 |
(WDrawingSurfaceInfo::int getHBitmap ()) |
|
266 |
(WDrawingSurfaceInfo::int getPBits ()) |
|
267 |
(WDrawingSurfaceInfo::int getHDC ()) |
|
268 |
(WDrawingSurfaceInfo::int getDepth ()) |
|
269 |
(WDrawingSurfaceInfo::int getHPalette ()) |
|
270 |
||
271 |
X (WDefaultFontCharset::boolean canConvert (char)) |
|
272 |
||
273 |
(ColorModel::void deletepData ()) |
|
274 |
X (WToolkit::void init (java.lang.Thread)) |
|
275 |
X (WToolkit::void eventLoop ()) |
|
276 |
(WToolkit::java.awt.image.ColorModel makeColorModel ()) |
|
342 | 277 |
X (WToolkit::int getScreenResolution ()) |
261 | 278 |
X (WToolkit::int getScreenWidth ()) |
279 |
X (WToolkit::int getScreenHeight ()) |
|
280 |
(WToolkit::void sync ()) |
|
281 |
(WToolkit::void beep ()) |
|
282 |
X (WToolkit::void loadSystemColors (int[])) |
|
283 |
||
284 |
(WPrintJob::void end ()) |
|
285 |
||
286 |
X (WDialogPeer::void create (sun.awt.windows.WComponentPeer)) |
|
287 |
X (WDialogPeer::void _show ()) |
|
288 |
X (WDialogPeer::void _hide ()) |
|
289 |
||
342 | 290 |
X (WWindowPeer::void toFront ()) |
291 |
X (WWindowPeer::void toBack ()) |
|
292 |
X (WWindowPeer::void _setTitle (java.lang.String)) |
|
293 |
X (WWindowPeer::void _setResizable (boolean)) |
|
261 | 294 |
(WWindowPeer::void create (sun.awt.windows.WComponentPeer)) |
342 | 295 |
o (WWindowPeer::void updateInsets (java.awt.Insets)) |
261 | 296 |
(WWindowPeer::java.awt.Component getContainerElement (java.awt.Container int)) |
297 |
||
298 |
X (WCanvasPeer::void create (sun.awt.windows.WComponentPeer)) |
|
299 |
||
300 |
X (WTextAreaPeer::void create (sun.awt.windows.WComponentPeer)) |
|
301 |
X (WTextAreaPeer::void insertText (java.lang.String int)) |
|
302 |
(WTextAreaPeer::void replaceText (java.lang.String int int)) |
|
303 |
||
304 |
X (WTextComponentPeer::java.lang.String getText ()) |
|
305 |
X (WTextComponentPeer::void setText (java.lang.String)) |
|
306 |
X (WTextComponentPeer::int getSelectionStart ()) |
|
307 |
X (WTextComponentPeer::int getSelectionEnd ()) |
|
308 |
X (WTextComponentPeer::void select (int int)) |
|
309 |
X (WTextComponentPeer::void enableEditing (boolean)) |
|
310 |
||
311 |
X (WComponentPeer::void show ()) |
|
312 |
X (WComponentPeer::void hide ()) |
|
313 |
X (WComponentPeer::void enable ()) |
|
314 |
X (WComponentPeer::void disable ()) |
|
315 |
(WComponentPeer::java.awt.Point getLocationOnScreen ()) |
|
316 |
X (WComponentPeer::void reshape (int int int int)) |
|
317 |
o (WComponentPeer::void handleEvent (java.awt.AWTEvent)) |
|
318 |
o (WComponentPeer::void _dispose ()) |
|
319 |
X (WComponentPeer::void _setForeground (int)) |
|
320 |
X (WComponentPeer::void _setBackground (int)) |
|
321 |
o (WComponentPeer::void setFont (java.awt.Font)) |
|
322 |
o (WComponentPeer::void requestFocus ()) |
|
323 |
o (WComponentPeer::void setCursor (java.awt.Cursor)) |
|
324 |
o (WComponentPeer::void start ()) |
|
325 |
(WComponentPeer::void _beginValidate ()) |
|
326 |
(WComponentPeer::void endValidate ()) |
|
327 |
o (WComponentPeer::void setZOrderPosition (sun.awt.windows.WComponentPeer)) |
|
328 |
||
329 |
X (WFramePeer::void setMenuBar0 (sun.awt.windows.WMenuBarPeer)) |
|
330 |
X (WFramePeer::void create (sun.awt.windows.WComponentPeer)) |
|
342 | 331 |
X (WFramePeer::void _setIconImage (sun.awt.image.ImageRepresentation)) |
261 | 332 |
|
333 |
o (WFontMetrics::boolean needsConversion (java.awt.Font sun.awt.FontDescriptor)) |
|
334 |
o (WFontMetrics::int getMFCharSegmentWidth (java.awt.Font sun.awt.FontDescriptor boolean char[] int int byte[] int)) |
|
335 |
(WFontMetrics::int bytesWidth (byte[] int int)) |
|
336 |
(WFontMetrics::void init ()) |
|
337 |
||
338 |
o (WChoicePeer::void select (int)) |
|
339 |
o (WChoicePeer::void remove (int)) |
|
340 |
o (WChoicePeer::void addItem (java.lang.String int)) |
|
341 |
X (WChoicePeer::void reshape (int int int int)) |
|
342 |
X (WChoicePeer::void create (sun.awt.windows.WComponentPeer)) |
|
343 |
||
344 |
X (WLabelPeer::void setText (java.lang.String)) |
|
345 |
o (WLabelPeer::void setAlignment (int)) |
|
346 |
X (WLabelPeer::void create (sun.awt.windows.WComponentPeer)) |
|
347 |
||
348 |
X (WMenuItemPeer::void _setLabel (java.lang.String)) |
|
349 |
X (WMenuItemPeer::void create (sun.awt.windows.WMenuPeer)) |
|
350 |
X (WMenuItemPeer::void enable (boolean)) |
|
342 | 351 |
o (WMenuItemPeer::void _dispose ()) |
261 | 352 |
(WMenuPeer::void addSeparator ()) |
353 |
(WMenuPeer::void delItem (int)) |
|
354 |
X (WMenuPeer::void createMenu (sun.awt.windows.WMenuBarPeer)) |
|
355 |
(WMenuPeer::void createSubMenu (sun.awt.windows.WMenuPeer)) |
|
356 |
||
357 |
(WPopupMenuPeer::void createMenu (sun.awt.windows.WComponentPeer)) |
|
358 |
(WPopupMenuPeer::void _show (java.awt.Event)) |
|
359 |
(WMenuBarPeer::void addMenu (java.awt.Menu)) |
|
360 |
(WMenuBarPeer::void delMenu (int)) |
|
361 |
X (WMenuBarPeer::void create (sun.awt.windows.WFramePeer)) |
|
362 |
||
363 |
(WCheckboxMenuItemPeer::void setState (boolean)) |
|
364 |
||
365 |
X (WFileDialogPeer::void show ()) |
|
366 |
||
367 |
X (WCheckboxPeer::void setState (boolean)) |
|
368 |
X (WCheckboxPeer::void setCheckboxGroup (java.awt.CheckboxGroup)) |
|
369 |
(WCheckboxPeer::void setLabel (java.lang.String)) |
|
370 |
X (WCheckboxPeer::void create (sun.awt.windows.WComponentPeer)) |
|
371 |
||
372 |
X (WClipboard::void init ()) |
|
373 |
(WClipboard::void setClipboardText (java.awt.datatransfer.StringSelection)) |
|
374 |
(WClipboard::java.lang.String getClipboardText ()) |
|
375 |
||
342 | 376 |
X (WListPeer::void addItem (java.lang.String int)) |
377 |
X (WListPeer::void delItems (int int)) |
|
378 |
X (WListPeer::void select (int)) |
|
261 | 379 |
(WListPeer::void deselect (int)) |
380 |
(WListPeer::void makeVisible (int)) |
|
342 | 381 |
X (WListPeer::void setMultipleSelections (boolean)) |
382 |
X (WListPeer::void create (sun.awt.windows.WComponentPeer)) |
|
383 |
X (WListPeer::boolean isSelected (int)) |
|
384 |
||
385 |
x (WScrollbarPeer::void _setValues (int int int int)) |
|
386 |
x (WScrollbarPeer::void setLineIncrement (int)) |
|
387 |
x (WScrollbarPeer::void setPageIncrement (int)) |
|
388 |
x (WScrollbarPeer::void create (sun.awt.windows.WComponentPeer)) |
|
389 |
||
390 |
x (ImageRepresentation::void offscreenInit (java.awt.Color)) |
|
261 | 391 |
x (ImageRepresentation::boolean setBytePixels (int int int int java.awt.image.ColorModel byte[] int int)) |
342 | 392 |
x (ImageRepresentation::boolean setIntPixels (int int int int java.awt.image.ColorModel int[] int int)) |
261 | 393 |
x (ImageRepresentation::boolean finish (boolean)) |
394 |
X (ImageRepresentation::void imageDraw (java.awt.Graphics int int java.awt.Color)) |
|
395 |
x (ImageRepresentation::void imageStretch (java.awt.Graphics int int int int int int int int java.awt.Color)) |
|
396 |
x (ImageRepresentation::void disposeImage ()) |
|
397 |
||
398 |
X (WTextFieldPeer::void create (sun.awt.windows.WComponentPeer)) |
|
342 | 399 |
X (WTextFieldPeer::void setEchoCharacter (char)) |
400 |
||
401 |
X (WScrollPanePeer::void create (sun.awt.windows.WComponentPeer)) |
|
402 |
o (WScrollPanePeer::int getOffset (int)) |
|
261 | 403 |
(WScrollPanePeer::void setInsets ()) |
404 |
(WScrollPanePeer::void setScrollPosition (int int)) |
|
342 | 405 |
x (WScrollPanePeer::int _getHScrollbarHeight ()) |
406 |
x (WScrollPanePeer::int _getVScrollbarWidth ()) |
|
407 |
o (WScrollPanePeer::void setSpans (int int int int)) |
|
261 | 408 |
(WScrollPanePeer::java.awt.Component getScrollChild ()) |
409 |
||
410 |
(WEmbeddedFramePeer::void create (sun.awt.windows.WComponentPeer)) |
|
342 | 411 |
X (WButtonPeer::void setLabel (java.lang.String)) |
261 | 412 |
X (WButtonPeer::void create (sun.awt.windows.WComponentPeer)) |
413 |
||
414 |
x (WColor::java.awt.Color getDefaultColor (int)) |
|
415 |
||
416 |
x (GifImageDecoder::boolean parseImage (int int int int boolean int byte[] byte[] java.awt.image.IndexColorModel)) |
|
417 |
||
418 |
x (WGraphics::void createFromComponent (sun.awt.windows.WComponentPeer)) |
|
419 |
x (WGraphics::void createFromGraphics (sun.awt.windows.WGraphics)) |
|
420 |
(WGraphics::void createFromPrintJob (sun.awt.windows.WPrintJob)) |
|
421 |
(WGraphics::void createFromHDC (int)) |
|
422 |
x (WGraphics::void imageCreate (sun.awt.image.ImageRepresentation)) |
|
423 |
x (WGraphics::void pSetFont (java.awt.Font)) |
|
424 |
X (WGraphics::void pSetForeground (int)) |
|
425 |
(WGraphics::void _dispose ()) |
|
426 |
x (WGraphics::void dispose ()) |
|
427 |
x (WGraphics::void setPaintMode ()) |
|
342 | 428 |
x (WGraphics::void setXORMode (java.awt.Color)) |
261 | 429 |
o (WGraphics::java.awt.Rectangle getClipBounds ()) |
430 |
o (WGraphics::void changeClip (int int int int boolean)) |
|
431 |
(WGraphics::void removeClip ()) |
|
432 |
X (WGraphics::void clearRect (int int int int)) |
|
433 |
X (WGraphics::void fillRect (int int int int)) |
|
434 |
X (WGraphics::void drawRect (int int int int)) |
|
435 |
(WGraphics::void drawSFChars (char[] int int int int)) |
|
436 |
x (WGraphics::int drawMFCharsSegment (java.awt.Font sun.awt.FontDescriptor char[] int int int int)) |
|
437 |
(WGraphics::int drawMFCharsConvertedSegment (java.awt.Font sun.awt.FontDescriptor byte[] int int int)) |
|
438 |
(WGraphics::void drawBytes (byte[] int int int int)) |
|
439 |
X (WGraphics::void drawLine (int int int int)) |
|
342 | 440 |
X (WGraphics::void copyArea (int int int int int int)) |
261 | 441 |
o (WGraphics::void drawRoundRect (int int int int int int)) |
442 |
o (WGraphics::void fillRoundRect (int int int int int int)) |
|
443 |
X (WGraphics::void drawPolygon (int[] int[] int)) |
|
444 |
(WGraphics::void drawPolyline (int[] int[] int)) |
|
445 |
X (WGraphics::void fillPolygon (int[] int[] int)) |
|
446 |
x (WGraphics::void drawOval (int int int int)) |
|
447 |
x (WGraphics::void fillOval (int int int int)) |
|
448 |
x (WGraphics::void drawArc (int int int int int int)) |
|
449 |
x (WGraphics::void fillArc (int int int int int int)) |
|
450 |
(WGraphics::void print (sun.awt.windows.WComponentPeer)) |
|
451 |
(WGraphics::void close (sun.awt.windows.WPrintJob)) |
|
452 |
(JPEGImageDecoder::void readImage (java.io.InputStream byte[])) |
|
342 | 453 |
o (OffScreenImageSource::void sendPixels ()) |
457 | 454 |
|
455 |
||
456 |
additional native methods added by microsoft (sigh): |
|
457 |
||
458 |
X (java.lang.String::boolean equals (java.lang.String)) |
|
459 |
X (java.lang.String::int length (java.lang.String)) |
|
460 |
o (java.lang.Runtime::void setInputStreamLocalised (java.io.DataInputStream)) |
|
461 |
o (java.lang.Runtime::void setOutputStreamLocalised (java.io.DataOutputStream)) |
|
462 |
||
463 |
(java.lang.String::int compareTo (java.lang.String)) |
|
464 |
(java.lang.String::boolean equalsIgnoreCase (java.lang.String)) |
|
465 |
(java.lang.String::int indexOf (java.lang.String int)) |
|
466 |
(java.lang.String::boolean startsWith (java.lang.String int)) |
|
467 |
(java.lang.String::boolean regionMatches (int java.lang.String int int)) |
|
468 |
(java.lang.String::boolean regionMatches (boolean int java.lang.String int int)) |
|
469 |
(java.lang.String::int lastIndexOf (java.lang.String int)) |
|
470 |
(java.lang.ClassLoader::void resolveClass (java.lang.Class)) |
|
471 |
(java.lang.ClassLoader::java.lang.Class createArrayClass (java.lang.String java.lang.Class)) |
|
472 |
(java.io.PrintStream::boolean isOutputStreamLocalised (java.io.DataOutputStream)) |
|
473 |
(java.lang.Runtime::boolean isOutputStreamLocalised (java.io.DataOutputStream)) |
|
474 |
(java.lang.Runtime::boolean isInputStreamLocalised (java.io.DataInputStream)) |
|
475 |
(java.lang.ThreadGroup::void initMainThreadGroup0 (java.lang.ThreadGroup)) |
|
476 |
(java.lang.System::void validateSecurityManager (java.lang.SecurityManager)) |
|
477 |
(java.lang.Class::java.lang.reflect.Method getMethod2 (int java.lang.String java.lang.String)) |
|
478 |
(java.io.ObjectOutputStream::void invokeDefaultWriteObject (java.lang.Object java.lang.Class)) |
|
479 |
(java.io.ObjectOutputStream::void invokeWriteObject (java.lang.Object java.lang.Class)) |
|
480 |
(java.io.ObjectInputStream::void invokeDefaultReadObject (java.lang.Object java.lang.Class)) |
|
481 |
(java.io.ObjectInputStream::void invokeReadObject (java.lang.Object java.lang.Class)) |
|
482 |
(java.util.TimeZone::java.util.TimeZone getWin32TimeZone ()) |
|
483 |
(java.net.InetAddress::java.lang.Object[] lookupHostByName (java.lang.String)) |
|
484 |
(java.net.InetAddress::java.lang.Object[] lookupHostByAddr (int)) |
|
485 |
(java.io.ObjectStreamClass::void doMismatchedRead (java.io.ObjectInputStream java.lang.Object)) |
|
486 |
(java.io.ObjectStreamClass::long getClassDefinedUID (java.lang.Class)) |
|
487 |
(java.io.ObjectStreamClass::boolean findObjectMethod0 (java.lang.Class int)) |
|
488 |
(java.lang.reflect.Method::java.lang.String getDescriptor ()) |
|
489 |
(java.lang.reflect.Array::void setShort (java.lang.Object int unsigned short)) |
|
490 |
(java.lang.reflect.Array::char getChar (java.lang.Object int)) |
|
491 |
(java.lang.reflect.Array::void setChar (java.lang.Object int char)) |
|
492 |
(java.lang.reflect.Array::void setDouble (java.lang.Object int double)) |
|
493 |
(java.lang.reflect.Array::java.lang.Object get (java.lang.Object int)) |
|
494 |
(java.lang.reflect.Array::void set (java.lang.Object int java.lang.Object)) |
|
495 |
(java.lang.reflect.Array::int getInt (java.lang.Object int)) |
|
496 |
(java.lang.reflect.Array::void setInt (java.lang.Object int int)) |
|
497 |
(java.lang.reflect.Array::java.lang.Object multiNewArray (java.lang.Class int[])) |
|
498 |
(java.lang.reflect.Array::boolean getBoolean (java.lang.Object int)) |
|
499 |
(java.lang.reflect.Array::byte getByte (java.lang.Object int)) |
|
500 |
(java.lang.reflect.Array::float getFloat (java.lang.Object int)) |
|
501 |
(java.lang.reflect.Array::void setBoolean (java.lang.Object int boolean)) |
|
502 |
(java.lang.reflect.Array::long getLong (java.lang.Object int)) |
|
503 |
(java.lang.reflect.Array::void setByte (java.lang.Object int byte)) |
|
504 |
(java.lang.reflect.Array::void setLong (java.lang.Object int long)) |
|
505 |
(java.lang.reflect.Array::void setFloat (java.lang.Object int float)) |
|
506 |
(java.lang.reflect.Array::java.lang.Object newArray (java.lang.Class int)) |
|
507 |
(java.lang.reflect.Array::int getLength (java.lang.Object)) |
|
508 |
(java.lang.reflect.Array::unsigned short getShort (java.lang.Object int)) |
|
509 |
(java.lang.reflect.Array::double getDouble (java.lang.Object int)) |
|
510 |
(java.lang.reflect.Field::void setShort (java.lang.Object unsigned short)) |
|
511 |
(java.lang.reflect.Field::char getChar (java.lang.Object)) |
|
512 |
(java.lang.reflect.Field::void setChar (java.lang.Object char)) |
|
513 |
(java.lang.reflect.Field::void setDouble (java.lang.Object double)) |
|
514 |
(java.lang.reflect.Field::java.lang.Object get (java.lang.Object)) |
|
515 |
(java.lang.reflect.Field::void set (java.lang.Object java.lang.Object)) |
|
516 |
(java.lang.reflect.Field::int getInt (java.lang.Object)) |
|
517 |
(java.lang.reflect.Field::void setInt (java.lang.Object int)) |
|
518 |
(java.lang.reflect.Field::boolean getBoolean (java.lang.Object)) |
|
519 |
(java.lang.reflect.Field::byte getByte (java.lang.Object)) |
|
520 |
(java.lang.reflect.Field::float getFloat (java.lang.Object)) |
|
521 |
(java.lang.reflect.Field::long getLong (java.lang.Object)) |
|
522 |
(java.lang.reflect.Field::void setBoolean (java.lang.Object boolean)) |
|
523 |
(java.lang.reflect.Field::void setByte (java.lang.Object byte)) |
|
524 |
(java.lang.reflect.Field::void setLong (java.lang.Object long)) |
|
525 |
(java.lang.reflect.Field::void setFloat (java.lang.Object float)) |
|
526 |
(java.lang.reflect.Field::int getModifiers ()) |
|
527 |
(java.lang.reflect.Field::unsigned short getShort (java.lang.Object)) |
|
528 |
(java.lang.reflect.Field::double getDouble (java.lang.Object)) |
|
529 |
(java.lang.reflect.Constructor::java.lang.Object newInstance (java.lang.Object[])) |
|
530 |
(java.lang.reflect.Constructor::int getModifiers ()) |
|
531 |
(java.util.zip.Inflater::void setDictionary0 (byte[] int int)) |
|
532 |
(java.util.zip.Inflater::int getTotalIn0 ()) |
|
533 |
(java.util.zip.Inflater::void reset0 ()) |
|
534 |
(java.util.zip.Inflater::void end0 ()) |
|
535 |
(java.util.zip.Inflater::int inflate0 (byte[] int int)) |
|
536 |
(java.util.zip.Inflater::int getTotalOut0 ()) |
|
537 |
(java.util.zip.Inflater::int getAdler0 ()) |
|
538 |
(java.util.zip.CRC32::void update1 (int)) |
|
539 |
(java.util.zip.CRC32::void update (byte[] int int)) |
|
540 |
||
541 |
(com.ms.security.PolicyEngine::boolean isSystemClass (java.lang.String)) |
|
542 |
(com.ms.security.PolicyEngine::void denyPermission (com.ms.security.PermissionID)) |
|
543 |
(com.ms.security.PolicyEngine::void revertPermission (com.ms.security.PermissionID)) |
|
544 |
(com.ms.security.PolicyEngine::void initPolicyEngine ()) |
|
545 |
(com.ms.security.PolicyEngine::java.lang.Class _getClassOfCaller (java.lang.Class[])) |
|
546 |
(com.ms.security.PolicyEngine::void internalCheckClass (java.lang.Class com.ms.security.PermissionID java.lang.Object)) |
|
547 |
(com.ms.security.PolicyEngine::com.ms.security.PermissionDataSet getPermissionsOfClass (java.lang.Class)) |
|
548 |
(com.ms.security.PolicyEngine::void assertPermission (com.ms.security.PermissionID)) |
|
549 |
(com.ms.security.PolicyEngine::void deepCheck (com.ms.security.PermissionID java.lang.Object)) |
|
550 |
(com.ms.security.PolicyEngine::void shallowCheck (com.ms.security.PermissionID java.lang.Object java.lang.Class[] int)) |
|
551 |
(com.ms.security.PolicyEngine::java.security.Principal getPrincipalOfClass (java.lang.Class)) |
|
552 |
(com.ms.security.permissions.ThreadPermission::boolean pDecodeAsn (byte[])) |
|
553 |
(com.ms.security.permissions.ThreadPermission::byte[] pEncodeAsn ()) |
|
554 |
(com.ms.security.permissions.RegistryPermission::boolean pDecodeAsn (byte[])) |
|
555 |
(com.ms.security.permissions.RegistryPermission::byte[] pEncodeAsn ()) |
|
556 |
(com.ms.security.management.ZonePermissions::byte[] pEncodeAsn ()) |
|
557 |
(com.ms.security.management.ZonePermissions::boolean pDecodeAsn (byte[])) |
|
558 |
(com.ms.security.permissions.UIPermission::byte[] pEncodeAsn ()) |
|
559 |
(com.ms.security.permissions.UIPermission::boolean pDecodeAsn (byte[])) |
|
560 |
(com.ms.security.permissions.NetIOPermission::byte[] pEncodeAsn ()) |
|
561 |
(com.ms.security.permissions.NetIOPermission::boolean pDecodeAsn (byte[])) |
|
562 |
(com.ms.security.permissions.ReflectionPermission::byte[] pEncodeAsn ()) |
|
563 |
(com.ms.security.permissions.ReflectionPermission::boolean pDecodeAsn (byte[])) |
|
564 |
(com.ms.vm.WeakReference::void storeRef (int java.lang.Object)) |
|
565 |
(com.ms.vm.WeakReference::int allocRef (java.lang.Object)) |
|
566 |
(com.ms.vm.WeakReference::void freeRef (int)) |
|
567 |
(com.ms.vm.WeakReference::java.lang.Object fetchRef (int)) |
|
568 |
(com.ms.dll.DllLib::void CoTaskMemFree (int)) |
|
569 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int float[] int int)) |
|
570 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int double[] int int)) |
|
571 |
(com.ms.dll.DllLib::int numParamBytes0 (java.lang.reflect.Method)) |
|
572 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int java.lang.Object int int)) |
|
573 |
(com.ms.dll.DllLib::void write2 (java.lang.Object int unsigned short)) |
|
574 |
(com.ms.dll.DllLib::void write2 (int int unsigned short)) |
|
575 |
(com.ms.dll.DllLib::void write2 (java.lang.Object int char)) |
|
576 |
(com.ms.dll.DllLib::void write2 (int int char)) |
|
577 |
(com.ms.dll.DllLib::int GlobalAlloc (int int)) |
|
578 |
(com.ms.dll.DllLib::void resize (java.lang.Object int)) |
|
579 |
(com.ms.dll.DllLib::long read8 (java.lang.Object int)) |
|
580 |
(com.ms.dll.DllLib::long read8 (int int)) |
|
581 |
(com.ms.dll.DllLib::int lstrcpy (java.lang.StringBuffer int)) |
|
582 |
(com.ms.dll.DllLib::int lstrlenA (int)) |
|
583 |
(com.ms.dll.DllLib::int read4 (java.lang.Object int)) |
|
584 |
(com.ms.dll.DllLib::int CoTaskMemAlloc (int)) |
|
585 |
(com.ms.dll.DllLib::void write8 (java.lang.Object int long)) |
|
586 |
(com.ms.dll.DllLib::int sizeOf0 (java.lang.Class)) |
|
587 |
(com.ms.dll.DllLib::int getSystemDefaultCharSize ()) |
|
588 |
(com.ms.dll.DllLib::void write8 (int int long)) |
|
589 |
(com.ms.dll.DllLib::int read4 (int int)) |
|
590 |
(com.ms.dll.DllLib::byte read1 (java.lang.Object int)) |
|
591 |
(com.ms.dll.DllLib::byte read1 (int int)) |
|
592 |
(com.ms.dll.DllLib::int lstrlen (int)) |
|
593 |
(com.ms.dll.DllLib::void CopyMemoryAnsi (int java.lang.String int)) |
|
594 |
(com.ms.dll.DllLib::void CopyMemoryAnsi (java.lang.StringBuffer int int)) |
|
595 |
(com.ms.dll.DllLib::boolean isStruct (java.lang.reflect.Field)) |
|
596 |
(com.ms.dll.DllLib::boolean GlobalFree (int)) |
|
597 |
(com.ms.dll.DllLib::void internalAttemptCopyPtrToStruct (int java.lang.Object int int)) |
|
598 |
(com.ms.dll.DllLib::int getLastError ()) |
|
599 |
(com.ms.dll.DllLib::void write4 (java.lang.Object int int)) |
|
600 |
(com.ms.dll.DllLib::void write4 (int int int)) |
|
601 |
(com.ms.dll.DllLib::unsigned short read2 (java.lang.Object int)) |
|
602 |
(com.ms.dll.DllLib::unsigned short read2 (int int)) |
|
603 |
(com.ms.dll.DllLib::void release (java.lang.Object)) |
|
604 |
(com.ms.dll.DllLib::void write1 (java.lang.Object int byte)) |
|
605 |
(com.ms.dll.DllLib::void write1 (int int byte)) |
|
606 |
(com.ms.dll.DllLib::boolean isStructCls (java.lang.Class)) |
|
607 |
(com.ms.dll.DllLib::void prelink (java.lang.reflect.Method)) |
|
608 |
(com.ms.dll.DllLib::void CopyMemoryUni (int java.lang.String int)) |
|
609 |
(com.ms.dll.DllLib::void CopyMemoryUni (java.lang.StringBuffer int int)) |
|
610 |
(com.ms.dll.DllLib::void internalAttemptCopyStructToPtr (java.lang.Object int int int)) |
|
611 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (int int int int)) |
|
612 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (byte[] int int int)) |
|
613 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (char[] int int int)) |
|
614 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (unsigned short[] int int int)) |
|
615 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (int[] int int int)) |
|
616 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (long[] int int int)) |
|
617 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (float[] int int int)) |
|
618 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (double[] int int int)) |
|
619 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (java.lang.Object int int int)) |
|
620 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int int int int)) |
|
621 |
(com.ms.dll.DllLib::int lstrlenW (int)) |
|
622 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int byte[] int int)) |
|
623 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int char[] int int)) |
|
624 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int unsigned short[] int int)) |
|
625 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int int[] int int)) |
|
626 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int long[] int int)) |
|
627 |
(com.ms.dll.DllLib::int internalGetStructAddr (java.lang.Object)) |
|
628 |
(com.ms.dll.DllLib::int offsetOf (java.lang.reflect.Field)) |
|
629 |
(com.ms.dll.DllLib::int lstrcpy (int java.lang.String)) |
|
630 |
(com.ms.dll.DllLib::int sizeOf (java.lang.Object)) |
|
631 |
(com.ms.lang.RegKey::com.ms.lang.RegKeyEnumValue pRegEnumValue (int)) |
|
632 |
(com.ms.lang.RegKey::java.lang.String pRegQueryStringValue (java.lang.String)) |
|
633 |
(com.ms.lang.RegKey::byte[] pRegQueryBinaryValue (java.lang.String)) |
|
634 |
(com.ms.lang.RegKey::int pRegQueryIntValue (java.lang.String)) |
|
635 |
(com.ms.lang.RegKey::void pRegSetStringValue (java.lang.String java.lang.String)) |
|
636 |
(com.ms.lang.RegKey::void pRegSetIntValue (java.lang.String int)) |
|
637 |
(com.ms.lang.RegKey::void pRegSetBinaryValue (java.lang.String byte[])) |
|
638 |
(com.ms.lang.RegKey::void pRegDeleteValue (java.lang.String)) |
|
639 |
(com.ms.lang.RegKey::void pRegFlushKey ()) |
|
640 |
(com.ms.lang.RegKey::void pRegDeleteKey (java.lang.String)) |
|
641 |
(com.ms.lang.RegKey::void pRegOpenBaseKey (int)) |
|
642 |
(com.ms.lang.RegKey::void pRegOpenKey (com.ms.lang.RegKey java.lang.String int)) |
|
643 |
(com.ms.lang.RegKey::int pRegQueryInfoKey (com.ms.lang.RegQueryInfo)) |
|
644 |
(com.ms.lang.RegKey::void pRegUnLoadKey (java.lang.String)) |
|
645 |
(com.ms.lang.RegKey::void pRegCreateKey (com.ms.lang.RegKey java.lang.String)) |
|
646 |
(com.ms.lang.RegKey::void pRegRestoreKey (java.lang.String boolean)) |
|
647 |
(com.ms.lang.RegKey::void pRegLoadKey (java.lang.String java.lang.String)) |
|
648 |
(com.ms.lang.RegKey::void pRegCloseKey ()) |
|
649 |
(com.ms.lang.RegKey::java.lang.String pRegEnumKey (int)) |
|
650 |
(com.ms.lang.RegKey::void pRegReplaceKey (java.lang.String java.lang.String java.lang.String)) |
|
651 |
(com.ms.awt.peer.NativeServices::int pGetKeyboardLayouts (int[] int)) |
|
652 |
(com.ms.awt.peer.NativeServices::void jpegReadByte (com.ms.awt.peer.IjpegDecoderCallback byte[] int com.ms.awt.peer.jpegInfoHeader byte[] int)) |
|
653 |
(com.ms.awt.peer.NativeServices::int getColourDataDepth ()) |
|
654 |
(com.ms.awt.peer.NativeServices::java.lang.String pGetFontEnumeratedFamily (int)) |
|
655 |
(com.ms.awt.peer.NativeServices::int pNewFontEnumeration ()) |
|
656 |
(com.ms.awt.peer.NativeServices::int getScreenClipRgn (int)) |
|
657 |
(com.ms.awt.peer.NativeServices::int pSetKeyboardLayout (int int)) |
|
658 |
(com.ms.awt.peer.NativeServices::void ClipboardInit (com.ms.awt.peer.IToolkit)) |
|
659 |
(com.ms.awt.peer.NativeServices::void getDeviceCaps (int int[] int)) |
|
660 |
(com.ms.awt.peer.NativeServices::void getAfcMetrics (int[])) |
|
661 |
(com.ms.awt.peer.NativeServices::void setUserLocale (int int)) |
|
662 |
(com.ms.awt.peer.NativeServices::void getDCDI (com.ms.awt.peer.DirectColourDataInfo)) |
|
663 |
(com.ms.awt.peer.NativeServices::int pGetNumKeyboardLayouts ()) |
|
664 |
(com.ms.awt.peer.NativeServices::void getIndexedColours (byte[] byte[] byte[])) |
|
665 |
(com.ms.awt.peer.NativeServices::int getNativeFont (java.lang.String int int int)) |
|
666 |
(com.ms.awt.peer.NativeServices::int pGetKeyboardLayout ()) |
|
667 |
(com.ms.awt.peer.NativeServices::int getSystemLCID ()) |
|
668 |
(com.ms.awt.peer.NativeServices::void caretSetPos (int int int)) |
|
669 |
(com.ms.awt.peer.NativeServices::java.lang.String getLogFontFromIUnknown (com.ms.com.IUnknown com.ms.awt.peer.LogFontX)) |
|
670 |
(com.ms.awt.peer.NativeServices::java.lang.String ClipboardGetText ()) |
|
671 |
(com.ms.awt.peer.NativeServices::int systemMetric (int)) |
|
672 |
(com.ms.awt.peer.NativeServices::void jpegInit (com.ms.awt.peer.IjpegDecoderCallback byte[] int com.ms.awt.peer.jpegInfoHeader)) |
|
673 |
(com.ms.awt.peer.NativeServices::void caretHide (int)) |
|
674 |
(com.ms.awt.peer.NativeServices::int chooseColor (int int)) |
|
675 |
(com.ms.awt.peer.NativeServices::java.lang.String pGetKeyboardLayoutName (int)) |
|
676 |
(com.ms.awt.peer.NativeServices::int matchFontAndLanguage (int int)) |
|
677 |
(com.ms.awt.peer.NativeServices::java.lang.String chooseFont (com.ms.awt.peer.LogFontX java.lang.String int)) |
|
678 |
(com.ms.awt.peer.NativeServices::java.lang.String getSystemFont (int com.ms.awt.peer.LogFontX)) |
|
679 |
(com.ms.awt.peer.NativeServices::com.ms.com.IUnknown getIUnknownFromLogFont (java.lang.String com.ms.awt.peer.LogFontX)) |
|
680 |
(com.ms.awt.peer.NativeServices::void caretDispose (int)) |
|
681 |
(com.ms.awt.peer.NativeServices::void caretShow (int)) |
|
682 |
(com.ms.awt.peer.NativeServices::void deleteObject (int)) |
|
683 |
(com.ms.awt.peer.NativeServices::void setDebugOutput (com.ms.awt.peer.COMPrintCallback)) |
|
684 |
(com.ms.awt.peer.NativeServices::void jpegReadInt (com.ms.awt.peer.IjpegDecoderCallback byte[] int com.ms.awt.peer.jpegInfoHeader int[] int)) |
|
685 |
(com.ms.awt.peer.NativeServices::int getSystemColourValue (int)) |
|
686 |
(com.ms.awt.peer.NativeServices::void caretCreate (int int int)) |
|
687 |
(com.ms.awt.peer.NativeServices::void ClipboardSetText (java.lang.String)) |
|
688 |
(com.ms.awt.peer.NativeServices::void println (java.lang.String)) |
|
689 |
(com.ms.security.SecurityClassLoader::boolean getSecureState ()) |
|
690 |
(com.ms.security.SecurityClassLoader::void setSecureState (java.lang.String java.lang.String)) |
|
691 |
(com.ms.security.SecurityClassLoader::java.lang.Class internalDefineClass (java.lang.String byte[] int int)) |
|
692 |
(com.ms.security.SecurityClassLoader::void markClass (java.lang.Class com.ms.security.PermissionSet java.security.Principal)) |
|
693 |
(com.ms.security.SecurityClassLoader::java.util.Hashtable getHashTable ()) |
|
694 |
(com.ms.security.auditing.SecurityAuditor::boolean isThreadAuditingEnabled ()) |
|
695 |
(com.ms.security.auditing.SecurityAuditor::void disableThreadAuditing ()) |
|
696 |
(com.ms.security.auditing.SecurityAuditor::void enableThreadAuditing ()) |
|
697 |
(com.ms.security.auditing.SecurityAuditor::void initSecurityAuditor ()) |
|
698 |
(com.ms.security.PermissionDataSet::byte[] pEncodeAsn ()) |
|
699 |
(com.ms.security.PermissionDataSet::boolean pDecodeAsn (byte[])) |
|
700 |
(com.ms.lang.SystemX::int pAnsiToUnicode (byte[] char[] int int int)) |
|
701 |
(com.ms.lang.SystemX::int pQueryUnicodeToAnsi (char[] int int int)) |
|
702 |
(com.ms.lang.SystemX::void gc ()) |
|
703 |
(com.ms.lang.SystemX::boolean arrayCompare (java.lang.Object[] int java.lang.Object[] int int)) |
|
704 |
(com.ms.lang.SystemX::int pUnicodeToAnsi (char[] byte[] int int int)) |
|
705 |
(com.ms.lang.SystemX::boolean isLocalCharDBCSLeadByte (byte)) |
|
706 |
(com.ms.lang.SystemX::int pQueryAnsiToUnicode (byte[] int int int)) |
|
707 |
(com.ms.lang.SystemX::boolean isBaseDBCS ()) |
|
708 |
(com.ms.packagemanager.JavaPackage::byte[] nativeGetSigner (java.lang.Object)) |
|
709 |
(com.ms.packagemanager.JavaPackage::byte[] nativeGetCapabilities (java.lang.Object)) |
|
710 |
(com.ms.com._Guid::void IIDFromString (java.lang.String com.ms.com._Guid)) |
|
711 |
(com.ms.com._Guid::java.lang.String StringFromIID (com.ms.com._Guid)) |
|
712 |
(com.ms.security.auditing.PrintStreamAuditor::int GetModuleHandle (java.lang.String)) |
|
713 |
(com.ms.security.auditing.PrintStreamAuditor::int FormatMessage (int int int int java.lang.StringBuffer int int[])) |
|
714 |
(com.ms.security.permissions.CustomPermission::byte[] pEncodeAsn ()) |
|
715 |
(com.ms.security.permissions.CustomPermission::boolean pDecodeAsn (byte[])) |
|
716 |
(com.ms.security.permissions.X509Signer::boolean pLoad (byte[])) |
|
717 |
(com.ms.packagemanager.PackageManager::java.lang.Class nativeFindClassInNamespace (java.lang.String java.lang.String java.lang.ClassLoader)) |
|
718 |
(com.ms.packagemanager.PackageManager::java.lang.Object nativeGetPackage (java.lang.String java.lang.String)) |
|
719 |
(com.ms.packagemanager.PackageManager::java.lang.String[] nativeGetBeansList ()) |
|
720 |
(com.ms.packagemanager.PackageManager::com.ms.com.IStream nativeGetFileIStream (java.lang.String java.lang.String)) |
|
721 |
(com.ms.packagemanager.PackageManager::java.lang.Class nativeFindClass (java.lang.String java.lang.String java.lang.ClassLoader)) |
|
722 |
(com.ms.security.permissions.UserFileIOPermission::byte[] pEncodeAsn ()) |
|
723 |
(com.ms.security.permissions.UserFileIOPermission::boolean pDecodeAsn (byte[])) |
|
724 |
(com.ms.security.permissions.PropertyPermission::byte[] pEncodeAsn ()) |
|
725 |
(com.ms.security.permissions.PropertyPermission::boolean pDecodeAsn (byte[])) |
|
726 |
(com.ms.security.permissions.ClientStoragePermission::byte[] pEncodeAsn ()) |
|
727 |
(com.ms.security.permissions.ClientStoragePermission::boolean pDecodeAsn (byte[])) |
|
728 |
(com.ms.security.permissions.ExecutionPermission::byte[] pEncodeAsn ()) |
|
729 |
(com.ms.security.permissions.ExecutionPermission::boolean pDecodeAsn (byte[])) |
|
730 |
(com.ms.util.EventLog::boolean DeregisterEventSource (int)) |
|
731 |
(com.ms.util.EventLog::void reportEvent0 (unsigned short unsigned short int java.lang.String[] byte[])) |
|
732 |
(com.ms.util.EventLog::int RegisterEventSource (java.lang.String java.lang.String)) |
|
733 |
(com.ms.applet.BrowserAppletFrame::void signalViewChange (int)) |
|
734 |
(com.ms.applet.BrowserAppletFrame::java.lang.Object newInstance (int java.lang.Class boolean com.ms.security.PermissionSet)) |
|
735 |
(com.ms.applet.BrowserAppletFrame::void showSystemStatus (int int boolean java.lang.String)) |
|
736 |
(com.ms.applet.BrowserAppletFrame::com.ms.security.management.SecurityPolicy getSecurityPolicy0 (int java.lang.String)) |
|
737 |
(com.ms.applet.BrowserAppletFrame::void setDownloadState (int boolean)) |
|
738 |
(com.ms.applet.BrowserAppletFrame::int GetSystemDefaultLCID ()) |
|
739 |
(com.ms.applet.BrowserAppletFrame::void requestResize (int int int)) |
|
740 |
(com.ms.applet.BrowserAppletFrame::void signalObjectLoadDone (int boolean)) |
|
741 |
(com.ms.applet.BrowserAppletFrame::com.ms.applet.BrowserAppletFrame findOfflineContext ()) |
|
742 |
(com.ms.applet.BrowserAppletFrame::void showStatus0 (int java.lang.String)) |
|
743 |
(com.ms.applet.BrowserAppletFrame::boolean checkGlobalOfflineMode0 ()) |
|
744 |
(com.ms.applet.BrowserAppletFrame::void showDocument0 (int java.lang.String java.lang.String)) |
|
745 |
(com.ms.security.permissions.SystemStreamsPermission::byte[] pEncodeAsn ()) |
|
746 |
(com.ms.security.permissions.SystemStreamsPermission::boolean pDecodeAsn (byte[])) |
|
747 |
(com.ms.security.permissions.FileIOPermission::byte[] pEncodeAsn ()) |
|
748 |
(com.ms.security.permissions.FileIOPermission::boolean pDecodeAsn (byte[])) |
|
749 |
(com.ms.com.ComLib::int newGCHandle (java.lang.Object)) |
|
750 |
(com.ms.com.ComLib::java.lang.Object derefGCHandle (int)) |
|
751 |
(com.ms.com.ComLib::void dprinthelper (char[])) |
|
752 |
(com.ms.com.ComLib::void release (java.lang.Object)) |
|
753 |
(com.ms.com.ComLib::int jcdwClassSizeOf (java.lang.Class)) |
|
754 |
(com.ms.com.ComLib::int jcdwOffsetOf (java.lang.Object java.lang.String)) |
|
755 |
(com.ms.com.ComLib::int jcdwClassOffsetOf (java.lang.Class java.lang.String)) |
|
756 |
(com.ms.com.ComLib::boolean isJavaOwned (java.lang.Object)) |
|
757 |
(com.ms.com.ComLib::void brk (java.lang.Object)) |
|
758 |
(com.ms.com.ComLib::void setDataWrapperSize (java.lang.Object int)) |
|
759 |
(com.ms.com.ComLib::void brk (int)) |
|
760 |
(com.ms.com.ComLib::void setJCDWHomeThread (java.lang.Object java.lang.Object)) |
|
761 |
(com.ms.com.ComLib::void propagateOwnership (java.lang.Object int)) |
|
762 |
(com.ms.com.ComLib::void threadStartMTA (java.lang.Thread)) |
|
763 |
(com.ms.com.ComLib::void IENVNextMarshalerJ2C (int)) |
|
764 |
(com.ms.com.ComLib::boolean supportsInterface (java.lang.Object com.ms.com._Guid)) |
|
765 |
(com.ms.com.ComLib::java.lang.Object ptrToStruct (java.lang.Class int)) |
|
766 |
(com.ms.com.ComLib::int jcdwSizeOf (java.lang.Object)) |
|
767 |
(com.ms.com.ComLib::void declareMessagePumpThread ()) |
|
768 |
(com.ms.com.ComLib::void IENVNextMarshalerC2J (int)) |
|
769 |
(com.ms.com.ComLib::void freeGCHandle (int)) |
|
770 |
(com.ms.com.ComLib::boolean isEqualUnknown (java.lang.Object java.lang.Object)) |
|
771 |
(com.ms.com.Dispatch::boolean NIsArray (java.lang.Object)) |
|
772 |
(com.ms.com.Dispatch::java.lang.String NInvokeReal (java.lang.Object com.ms.com._Guid java.lang.String int int int int com.ms.com.Variant[] com.ms.com.Variant[] int[])) |
|
773 |
(com.ms.com.Dispatch::void NGetIDsOfNamesReal (java.lang.Object com.ms.com._Guid int java.lang.String[] int[])) |
|
774 |
(com.ms.com.ComException::int FormatMessage (int int int int java.lang.StringBuffer int int[])) |
|
775 |
(com.ms.com.Variant::int toInt ()) |
|
776 |
(com.ms.com.Variant::double toDate ()) |
|
777 |
(com.ms.com.Variant::boolean toBoolean ()) |
|
778 |
(com.ms.com.Variant::double toDouble ()) |
|
779 |
(com.ms.com.Variant::long toCurrency ()) |
|
780 |
(com.ms.com.Variant::void putVariantArray (com.ms.com.Variant[])) |
|
781 |
(com.ms.com.Variant::com.ms.com.Variant[] getVariantArray ()) |
|
782 |
(com.ms.com.Variant::void putByteArray (java.lang.Object)) |
|
783 |
(com.ms.com.Variant::void putShortRef (unsigned short)) |
|
784 |
(com.ms.com.Variant::void putIntRef (int)) |
|
785 |
(com.ms.com.Variant::void putDoubleRef (double)) |
|
786 |
(com.ms.com.Variant::void putDateRef (double)) |
|
787 |
(com.ms.com.Variant::void putStringRef (java.lang.String)) |
|
788 |
(com.ms.com.Variant::unsigned short getShortRef ()) |
|
789 |
(com.ms.com.Variant::int getIntRef ()) |
|
790 |
(com.ms.com.Variant::double getDoubleRef ()) |
|
791 |
(com.ms.com.Variant::double getDateRef ()) |
|
792 |
(com.ms.com.Variant::java.lang.String getStringRef ()) |
|
793 |
(com.ms.com.Variant::java.lang.String internalToString ()) |
|
794 |
(com.ms.com.Variant::void initSafeArrayByRef (com.ms.com.SafeArray int)) |
|
795 |
(com.ms.com.Variant::java.lang.Object toCharArray ()) |
|
796 |
(com.ms.com.Variant::java.lang.Object toDispatch ()) |
|
797 |
(com.ms.com.Variant::byte toByte ()) |
|
798 |
(com.ms.com.Variant::java.lang.Object getDispatch ()) |
|
799 |
(com.ms.com.Variant::void putDispatch (java.lang.Object)) |
|
800 |
(com.ms.com.Variant::boolean getBoolean ()) |
|
801 |
(com.ms.com.Variant::int toError ()) |
|
802 |
(com.ms.com.Variant::java.lang.Object toObject ()) |
|
803 |
(com.ms.com.Variant::void initSafeArrayByVal (com.ms.com.SafeArray int)) |
|
804 |
(com.ms.com.Variant::java.lang.Object getObject ()) |
|
805 |
(com.ms.com.Variant::void putObject (java.lang.Object)) |
|
806 |
(com.ms.com.Variant::com.ms.com.SafeArray toSafeArrayHelper (java.lang.Class)) |
|
807 |
(com.ms.com.Variant::void putFloatRef (float)) |
|
808 |
(com.ms.com.Variant::void putCurrencyRef (long)) |
|
809 |
(com.ms.com.Variant::void putErrorRef (int)) |
|
810 |
(com.ms.com.Variant::void putBooleanRef (boolean)) |
|
811 |
(com.ms.com.Variant::void putObjectRef (java.lang.Object)) |
|
812 |
(com.ms.com.Variant::void putByteRef (byte)) |
|
813 |
(com.ms.com.Variant::java.lang.String getString ()) |
|
814 |
(com.ms.com.Variant::void putString (java.lang.String)) |
|
815 |
(com.ms.com.Variant::float getFloatRef ()) |
|
816 |
(com.ms.com.Variant::long getCurrencyRef ()) |
|
817 |
(com.ms.com.Variant::int getErrorRef ()) |
|
818 |
(com.ms.com.Variant::boolean getBooleanRef ()) |
|
819 |
(com.ms.com.Variant::java.lang.Object getObjectRef ()) |
|
820 |
(com.ms.com.Variant::byte getByteRef ()) |
|
821 |
(com.ms.com.Variant::float toFloat ()) |
|
822 |
(com.ms.com.Variant::void putCharArray (java.lang.Object)) |
|
823 |
(com.ms.com.Variant::void putDispatchRef (java.lang.Object)) |
|
824 |
(com.ms.com.Variant::java.lang.Object getDispatchRef ()) |
|
825 |
(com.ms.com.Variant::void putVariantArrayRef (com.ms.com.Variant[])) |
|
826 |
(com.ms.com.Variant::com.ms.com.Variant[] getVariantArrayRef ()) |
|
827 |
(com.ms.com.Variant::void changeType (unsigned short)) |
|
828 |
(com.ms.com.Variant::void ncloneIndirect (com.ms.com.Variant)) |
|
829 |
(com.ms.com.Variant::void nFinalize (boolean)) |
|
830 |
(com.ms.com.Variant::void nclone (com.ms.com.Variant)) |
|
831 |
(com.ms.com.Variant::unsigned short toShort ()) |
|
832 |
(com.ms.com.Variant::void putSafeArrayRefHelper (int)) |
|
833 |
(com.ms.com.Variant::com.ms.com.Variant[] toVariantArray ()) |
|
834 |
(com.ms.com.Variant::java.lang.Object toByteArray ()) |
|
835 |
(com.ms.com.Variant::void TrueVariantClear ()) |
|
836 |
(com.ms.awt.WToolkit::boolean MessageBeep (int)) |
|
837 |
(com.ms.applet.AppletPanel::boolean StartCodeDownload (int java.lang.String java.lang.String java.lang.String)) |
|
838 |
(com.ms.applet.AppletPanel::void securedCall0 (int java.lang.Object)) |
|
839 |
(com.ms.applet.AppletPanel::com.ms.security.PermissionSet getDefaultPermissionsFromLoader (com.ms.vm.loader.URLClassLoader)) |
|
840 |
(com.ms.dll.Win32Exception::int FormatMessage (int int int int java.lang.StringBuffer int int[])) |
|
841 |
(com.ms.awt.WGuiCallback::boolean SetEvent (int)) |
|
842 |
(com.ms.awt.WGuiCallback::int CreateSemaphore (int int int int)) |
|
843 |
(com.ms.awt.WGuiCallback::int ReleaseSemaphore (int int int)) |
|
844 |
(com.ms.awt.WGuiCallback::void userYield (boolean)) |
|
845 |
(com.ms.awt.WGuiCallback::int MsgWaitForMultipleObjects (int int[] boolean int int)) |
|
846 |
(com.ms.awt.WGuiCallback::int CreateEvent (int boolean boolean int)) |
|
847 |
(com.ms.activeX.ActiveXToolkit::int GetSysColor (int)) |
|
848 |
(com.ms.awt.peer.NativeGraphics::void setPageDimension (int int)) |
|
849 |
(com.ms.awt.peer.NativeGraphics::void setBkColour (int int)) |
|
850 |
(com.ms.awt.peer.NativeGraphics::void getClipBounds (com.ms.awt.peer.NativeRect int int)) |
|
851 |
(com.ms.awt.peer.NativeGraphics::void pGetCharOutline (int byte[])) |
|
852 |
(com.ms.awt.peer.NativeGraphics::void drawLine (int int int int)) |
|
853 |
(com.ms.awt.peer.NativeGraphics::void setXORMode (int int int int)) |
|
854 |
(com.ms.awt.peer.NativeGraphics::int drawString (java.lang.String int int int int int int int int[] int[])) |
|
855 |
(com.ms.awt.peer.NativeGraphics::int getCoClass ()) |
|
856 |
(com.ms.awt.peer.NativeGraphics::void drawArc (int int int int int int int)) |
|
857 |
(com.ms.awt.peer.NativeGraphics::void getInitialPageDimension (com.ms.awt.peer.NativeRect)) |
|
858 |
(com.ms.awt.peer.NativeGraphics::void setVisRgn (int)) |
|
859 |
(com.ms.awt.peer.NativeGraphics::void pSetForeground (int int)) |
|
860 |
(com.ms.awt.peer.NativeGraphics::int pGetDC ()) |
|
861 |
(com.ms.awt.peer.NativeGraphics::void drawPixels (int[] int int int)) |
|
862 |
(com.ms.awt.peer.NativeGraphics::void drawPolygon (int[] int[] int int int int)) |
|
863 |
(com.ms.awt.peer.NativeGraphics::void createFromImage (com.ms.awt.peer.INativeImage)) |
|
864 |
(com.ms.awt.peer.NativeGraphics::void endPage ()) |
|
865 |
(com.ms.awt.peer.NativeGraphics::int pGetCharOutlineSize (int)) |
|
866 |
(com.ms.awt.peer.NativeGraphics::void pDrawBezier (int int int[] int)) |
|
867 |
(com.ms.awt.peer.NativeGraphics::int drawBytes (byte[] int int int int int)) |
|
868 |
(com.ms.awt.peer.NativeGraphics::void changeClip (int int int int boolean)) |
|
869 |
(com.ms.awt.peer.NativeGraphics::int drawChars (char[] int int int int int int int int int int[] int[])) |
|
870 |
(com.ms.awt.peer.NativeGraphics::void drawT2Curve (float float float float float float int int)) |
|
871 |
(com.ms.awt.peer.NativeGraphics::void createFromPrintJob (java.lang.String com.ms.awt.peer.SPJData)) |
|
872 |
(com.ms.awt.peer.NativeGraphics::void endPrintJob ()) |
|
873 |
(com.ms.awt.peer.NativeGraphics::void pSetOrigin (int int)) |
|
874 |
(com.ms.awt.peer.NativeGraphics::void createFromHDC (int)) |
|
875 |
(com.ms.awt.peer.NativeGraphics::void drawOval (int int int int int)) |
|
876 |
(com.ms.awt.peer.NativeGraphics::int pSetFont (java.lang.String int int int)) |
|
877 |
(com.ms.awt.peer.NativeGraphics::void setPaintMode (int int)) |
|
878 |
(com.ms.awt.peer.NativeGraphics::void startPage ()) |
|
879 |
(com.ms.awt.peer.NativeGraphics::void clearClip ()) |
|
880 |
(com.ms.awt.peer.NativeGraphics::void createFromCopy (com.ms.awt.peer.INativeGraphics)) |
|
881 |
(com.ms.awt.peer.NativeGraphics::void scanLines (int int[] int int int int)) |
|
882 |
(com.ms.awt.peer.NativeGraphics::void drawRoundRect (int int int int int int int)) |
|
883 |
(com.ms.awt.peer.NativeGraphics::void dispose ()) |
|
884 |
(com.ms.awt.peer.NativeGraphics::void clearRect (int int int int int)) |
|
885 |
(com.ms.awt.peer.NativeGraphics::void copyArea (int int int int int int)) |
|
886 |
(com.ms.awt.peer.NativeGraphics::void createFromWindow (int)) |
|
887 |
(com.ms.awt.peer.NativeGraphics::void drawPolyline (int[] int[] int int int)) |
|
888 |
(com.ms.awt.peer.NativeGraphics::void drawRect (int int int int int)) |
|
889 |
(com.ms.awt.peer.CToolkit::void callbackEventLoop (com.ms.awt.peer.IToolkitCallback)) |
|
890 |
(com.ms.awt.peer.CToolkit::int getToolkitHwnd ()) |
|
891 |
(com.ms.awt.peer.CToolkit::int createCompHwnd (int int)) |
|
892 |
(com.ms.awt.peer.CNativeSystemIME::void setCompositionFont (int int)) |
|
893 |
(com.ms.awt.peer.CNativeSystemIME::void setCompositionPos (int int int)) |
|
894 |
(com.ms.awt.peer.CNativeSystemIME::void setOpenStatus (int int)) |
|
895 |
(com.ms.awt.peer.CNativeSystemIME::int getOpenStatus (int)) |
|
896 |
(com.ms.awt.peer.CNativeSystemIME::java.lang.String getCompositionString (int)) |
|
897 |
(com.ms.awt.peer.CNativeSystemIME::java.lang.String getCompositionResultString (int)) |
|
898 |
(com.ms.net.wininet.WininetStreamHandlerFactory::int initNative (java.lang.String)) |
|
899 |
(com.ms.com.SafeArray::void rawGetVariantAs (int com.ms.com.Variant)) |
|
900 |
(com.ms.com.SafeArray::void NSafeArrayInit (int)) |
|
901 |
(com.ms.com.SafeArray::float rawGetDouble (int)) |
|
902 |
(com.ms.com.SafeArray::void NRawBoolCopyToJavaArray (int int boolean[] int)) |
|
903 |
(com.ms.com.SafeArray::void validateArray (int)) |
|
904 |
(com.ms.com.SafeArray::void NSafeArrayCreateFromString (java.lang.String)) |
|
905 |
(com.ms.com.SafeArray::void rawSetString (int java.lang.String)) |
|
906 |
(com.ms.com.SafeArray::int getInt (int)) |
|
907 |
(com.ms.com.SafeArray::void setInt (int int)) |
|
908 |
(com.ms.com.SafeArray::boolean getBoolean (int)) |
|
909 |
(com.ms.com.SafeArray::void setBoolean (int boolean)) |
|
910 |
(com.ms.com.SafeArray::int computeOffset (int)) |
|
911 |
(com.ms.com.SafeArray::void NSafeArrayNullInit ()) |
|
912 |
(com.ms.com.SafeArray::void rawSetVariant (int com.ms.com.Variant)) |
|
913 |
(com.ms.com.SafeArray::float rawGetFloat (int)) |
|
914 |
(com.ms.com.SafeArray::float getFloat (int)) |
|
915 |
(com.ms.com.SafeArray::void setFloat (int float)) |
|
916 |
(com.ms.com.SafeArray::int computeOffset2 (int int)) |
|
917 |
(com.ms.com.SafeArray::void rawSetDouble (int double)) |
|
918 |
(com.ms.com.SafeArray::java.lang.String asString ()) |
|
919 |
(com.ms.com.SafeArray::void NRawCopyToJavaArray (int int java.lang.Object int)) |
|
920 |
(com.ms.com.SafeArray::void NSafeArrayCreate (int int int[] int[])) |
|
921 |
(com.ms.com.SafeArray::void NRawBoolCopyFromJavaArray (boolean[] int int int)) |
|
922 |
(com.ms.com.SafeArray::void NSafeArrayDestroy (boolean boolean)) |
|
923 |
(com.ms.com.SafeArray::int NSafeArrayCopy ()) |
|
924 |
(com.ms.com.SafeArray::int rawGetInt (int)) |
|
925 |
(com.ms.com.SafeArray::boolean rawGetBoolean (int)) |
|
926 |
(com.ms.com.SafeArray::void rawSetFloat (int float)) |
|
927 |
(com.ms.com.SafeArray::java.lang.String rawGetString (int)) |
|
928 |
(com.ms.com.SafeArray::int NTotalNumElems ()) |
|
929 |
(com.ms.com.SafeArray::double getDouble (int)) |
|
930 |
(com.ms.com.SafeArray::void setDouble (int double)) |
|
931 |
(com.ms.com.SafeArray::void Nreinit (com.ms.com.SafeArray)) |
|
932 |
(com.ms.com.SafeArray::int getPhysicalSafeArray ()) |
|
933 |
(com.ms.com.SafeArray::int NgetdwordAt (int)) |
|
934 |
(com.ms.com.SafeArray::void NRawCopyFromJavaArray (java.lang.Object int int int)) |
|
935 |
(com.ms.com.SafeArray::void rawSetBoolean (int boolean)) |
|
936 |
(com.ms.com.SafeArray::void rawSetInt (int int)) |
|
937 |
(com.ms.awt.peer.CNativeComponent::void invalidate (int int int int)) |
|
938 |
(com.ms.awt.peer.CNativeComponent::void hideModal ()) |
|
939 |
(com.ms.awt.peer.CNativeComponent::void hide ()) |
|
940 |
(com.ms.awt.peer.CNativeComponent::void setOnTop (int)) |
|
941 |
(com.ms.awt.peer.CNativeComponent::void registerDragDrop ()) |
|
942 |
(com.ms.awt.peer.CNativeComponent::void endValidate ()) |
|
943 |
(com.ms.awt.peer.CNativeComponent::void enable ()) |
|
944 |
(com.ms.awt.peer.CNativeComponent::void disable ()) |
|
945 |
(com.ms.awt.peer.CNativeComponent::void setTitle (java.lang.String)) |
|
946 |
(com.ms.awt.peer.CNativeComponent::void getBounds (com.ms.awt.peer.NativeRect)) |
|
947 |
(com.ms.awt.peer.CNativeComponent::int gethwnd ()) |
|
948 |
(com.ms.awt.peer.CNativeComponent::void showModal ()) |
|
949 |
(com.ms.awt.peer.CNativeComponent::void setCursor (int)) |
|
950 |
(com.ms.awt.peer.CNativeComponent::void reshape (int int int int)) |
|
951 |
(com.ms.awt.peer.CNativeComponent::void requestFocus ()) |
|
952 |
(com.ms.awt.peer.CNativeComponent::void callDefWindowProc (int int int int)) |
|
953 |
(com.ms.awt.peer.CNativeComponent::void registerCustomDropTarget (com.ms.com.IUnknown)) |
|
954 |
(com.ms.awt.peer.CNativeComponent::void setNoActivate (boolean)) |
|
955 |
(com.ms.awt.peer.CNativeComponent::void getPlaceOnScreen (com.ms.awt.peer.NativeRect)) |
|
956 |
(com.ms.awt.peer.CNativeComponent::void beginValidate ()) |
|
957 |
(com.ms.awt.peer.CNativeComponent::void clippedReshape (int int int int int)) |
|
958 |
(com.ms.awt.peer.CNativeComponent::void setResizable (boolean)) |
|
959 |
(com.ms.awt.peer.CNativeComponent::void setIcon (int)) |
|
960 |
(com.ms.awt.peer.CNativeComponent::void toBack ()) |
|
961 |
(com.ms.awt.peer.CNativeComponent::void setFrameHost (com.ms.awt.peer.IBrowserAppletFrameCallback)) |
|
962 |
(com.ms.awt.peer.CNativeComponent::void toFront ()) |
|
963 |
(com.ms.awt.peer.CNativeComponent::void show ()) |
|
964 |
(com.ms.awt.peer.CNativeComponent::void updateInsets (com.ms.awt.peer.NativeInsets)) |
|
965 |
(com.ms.awt.peer.CNativeComponent::void dispose ()) |
|
966 |
(com.ms.awt.peer.CNativeComponent::void initFromJavaWindow (int com.ms.awt.peer.IComponentCallback com.ms.awt.peer.INativeComponent com.ms.awt.peer.IToolkit int)) |
|
967 |
(com.ms.awt.peer.CNativeComponent::void init (int com.ms.awt.peer.IComponentCallback com.ms.awt.peer.INativeComponent com.ms.awt.peer.IToolkit)) |
|
968 |
(com.ms.awt.peer.CNativeComponent::void beginDrag (com.ms.awt.peer.INativeDragCallback)) |
|
969 |
(com.ms.fx.RegionConverter::int computeNativeRegion (int[])) |
|
970 |
(com.ms.fx.RegionConverter::int[] computeJavaRegion (int)) |
|
971 |
(com.ms.net.wininet.URLUtils::java.lang.String canonicalizeURL (java.lang.String int)) |
|
972 |
(com.ms.net.wininet.URLUtils::java.lang.String combineURL (java.lang.String java.lang.String int)) |
|
973 |
(com.ms.awt.peer.NativeFontMetrics::int bytesWidth (byte[] int int)) |
|
974 |
(com.ms.awt.peer.NativeFontMetrics::int stringWidth (java.lang.String int int[])) |
|
975 |
(com.ms.awt.peer.NativeFontMetrics::int charsWidth (char[] int int int int[])) |
|
976 |
(com.ms.awt.peer.NativeFontMetrics::java.lang.String init (com.ms.awt.peer.INativeGraphics int[] java.lang.String int int int)) |
|
977 |
(com.ms.io.console.Console::int MessageBox (int java.lang.String java.lang.String int)) |
|
978 |
(com.ms.awt.peer.NativeFileDialog::void show (com.ms.awt.peer.IFileDialogCallback java.lang.String java.lang.String java.lang.String int com.ms.awt.peer.INativeComponent int int)) |
|
979 |
(com.ms.security.management.SecurityZone::byte[] pLoadCustomPermissions (int int java.lang.String)) |
|
980 |
(com.ms.awt.peer.NativeImage::int setBytePixelsDirected (int int int int com.ms.awt.peer.DirectColourModelData byte[] int int com.ms.awt.peer.INativeImageBufferDone)) |
|
981 |
(com.ms.awt.peer.NativeImage::void create (int int int int)) |
|
982 |
(com.ms.awt.peer.NativeImage::int setIntPixelsIndexed (int int int int int[] int int[] int int com.ms.awt.peer.INativeImageBufferDone)) |
|
983 |
(com.ms.awt.peer.NativeImage::int getCoClass ()) |
|
984 |
(com.ms.awt.peer.NativeImage::int getIcon (int int int)) |
|
985 |
(com.ms.awt.peer.NativeImage::int setBytePixelsIndexed (int int int int int[] int byte[] int int com.ms.awt.peer.INativeImageBufferDone)) |
|
986 |
(com.ms.awt.peer.NativeImage::void sendPixels (com.ms.awt.peer.SPData)) |
|
987 |
(com.ms.awt.peer.NativeImage::void fillPixels (com.ms.awt.peer.SPData byte[])) |
|
988 |
(com.ms.awt.peer.NativeImage::void dispose ()) |
|
989 |
(com.ms.awt.peer.NativeImage::void init (int int int int int)) |
|
990 |
(com.ms.awt.peer.NativeImage::int setIntPixelsDirected (int int int int com.ms.awt.peer.DirectColourModelData int[] int int com.ms.awt.peer.INativeImageBufferDone)) |
|
991 |
(com.ms.awt.peer.NativeImage::void imageDrawStretched (com.ms.awt.peer.INativeGraphics int int int int int int int int int int)) |
|
992 |
(com.ms.awt.peer.NativeImage::int finish (int)) |
|
993 |
(com.ms.awt.peer.NativeImage::void imageDraw (int int int int int)) |
|
994 |
(com.ms.awt.peer.NativeResource::java.lang.String loadString (int)) |
|
995 |
(com.ms.awt.peer.NativeResource::int openDialogFromID (int)) |
|
996 |
(com.ms.awt.peer.NativeResource::boolean attach (java.lang.String)) |
|
997 |
(com.ms.awt.peer.NativeResource::void loadBytes (int int java.lang.String byte[] int)) |
|
998 |
(com.ms.awt.peer.NativeResource::int getSize (int int java.lang.String)) |
|
999 |
(com.ms.awt.peer.NativeResource::void detach ()) |
|
1000 |
(com.ms.awt.peer.NativeResource::int openDialogFromName (java.lang.String)) |
|
1001 |
(com.ms.net.wininet.WininetURLConnection::com.ms.applet.BrowserAppletFrame findOfflineContext ()) |
|
1002 |
(com.ms.com.DispatchProxy::void finalize ()) |
|
1003 |
(com.ms.com.DispatchProxy::void init (com.ms.com._Guid java.lang.reflect.Method[] int[])) |
|
1004 |
(com.ms.net.wininet.WininetInputStream::void close ()) |
|
1005 |
(com.ms.net.wininet.WininetInputStream::int read (byte[] int int)) |
|
1006 |
(com.ms.net.wininet.WininetInputStream::int available ()) |
|
1007 |
(com.ms.net.wininet.WininetInputStream::long skip (long)) |
|
1008 |
(com.ms.net.wininet.WininetInputStream::void connect (java.lang.String boolean boolean java.lang.SecurityManager)) |
|
1009 |
(com.ms.vm.loader.CabSignatureInfo::com.ms.vm.loader.CabSignatureInfo extractFromFile0 (java.lang.String com.ms.security.management.SecurityPolicy)) |
|
1010 |
(com.ms.net.wininet.http.HttpInputStream::byte[] getResponseHeaders ()) |
|
1011 |
(com.ms.net.wininet.http.HttpInputStream::void close0 ()) |
|
1012 |
(com.ms.net.wininet.http.HttpInputStream::void connect (java.lang.String int java.lang.String boolean boolean boolean boolean byte[] byte[] java.lang.SecurityManager)) |
|
1013 |
(com.ms.vm.loader.CabCracker::int GetTempFileName (java.lang.StringBuffer java.lang.String int java.lang.StringBuffer)) |
|
1014 |
(com.ms.vm.loader.CabCracker::void getBytes0 (int int byte[])) |
|
1015 |
(com.ms.vm.loader.CabCracker::void cleanup ()) |
|
1016 |
(com.ms.vm.loader.CabCracker::int GetTempPath (int java.lang.StringBuffer)) |
|
1017 |
(com.ms.vm.loader.CabCracker::void load0 ()) |
|
1018 |
||
1019 |
||
261 | 1020 |
" |
1021 |
||
432 | 1022 |
! |
1023 |
||
1024 |
performance |
|
1025 |
" |
|
447 | 1026 |
JAVA::BenchMark new loopmark |
432 | 1027 |
JAVA::BenchMark new logicmark |
447 | 1028 |
JAVA::BenchMark new sievemark |
1029 |
JAVA::BenchMark new methodmark |
|
432 | 1030 |
JAVA::BenchMark new stringmark |
1031 |
JAVA::BenchMark new newstringmark |
|
1032 |
JAVA::BenchMark new neweststringmark |
|
1033 |
||
1034 |
||
1035 |
" |
|
1036 |
" |
|
457 | 1037 |
caffmark loopmark logicmark sievemark methodmark stringmark float image graphic newstringmark neweststringmark |
1038 |
linux: |
|
1039 |
P6/233 No JIT 84 87 90 40 22 17 10 |
|
1040 |
P6/233 JIT 479 2459 393 649 28 21 12 |
|
1041 |
P6/233 JIT 473 1805 3046 439 986 28 21 12 |
|
460 | 1042 |
533 1808 3382 613 1003 25 105 143 1 |
457 | 1043 |
|
1044 |
w95 |
|
1045 |
P5/200 JIT 90 95 90 95 686 18 60 54 7 |
|
459 | 1046 |
428 1657 2385 684 957 21 61 62 9 |
432 | 1047 |
" |
1048 |
||
441 | 1049 |
! |
1050 |
||
1051 |
performance2 |
|
1052 |
" |
|
1053 |
symantec benchmarks |
|
1054 |
||
1055 |
||
1056 |
" |
|
1057 |
" |
|
1058 |
BubbleSort BidirBubbleSort QuickSort Sieve Hanoi Dhry Fib Array Tree Total |
|
1059 |
||
1060 |
ST/X+J |
|
455 | 1061 |
233Mhz P6 |
441 | 1062 |
No JIT 352767 354597 69585 43048 101638 28961 108839 48815 |
1063 |
||
1064 |
ST/X+J |
|
455 | 1065 |
233Mhz P6 |
441 | 1066 |
JIT 128724 116810 20259 39733 83160 27613 52093 33166 43996 545554 |
447 | 1067 |
124744 101428 17239 10052 8264 14004 38821 23252 33709 374660 |
455 | 1068 |
+IINC 120324 7265 |
1069 |
+IADD op2 100173 90737 18128 6996 7423 17093 48559 44209 57056 390374 |
|
1070 |
+ISUB op2 90460 17547 5921 57056 390461 |
|
1071 |
+ICMPEQ/NE 99785 90147 5792 43482 56486 388255 |
|
460 | 1072 |
+ICMP 87398 78214 15784 7574 5628 12812 38481 24654 32252 302797 |
441 | 1073 |
------------------------------------------------------------------------------------------------------------ |
1074 |
||
1075 |
Sun JDK 274625 244461 52676 50653 65183 26668 78133 28572 61608 882583 |
|
455 | 1076 |
(90Mhz P5) |
441 | 1077 |
|
1078 |
Microsoft J++ 9684 8452 2874 1733 3535 3665 3836 4746 25717 64242 |
|
455 | 1079 |
(90Mhz P5) |
441 | 1080 |
|
1081 |
Symantec Cafe 14541 12198 3686 1922 4527 3325 3425 12969 26829 83422 |
|
1082 |
JIT 1.02 |
|
1083 |
(90Mhz P5) |
|
1084 |
||
1085 |
Symantec Cafe 8292 6970 2714 1613 3345 3235 2013 4516 13180 45878 |
|
1086 |
JIT 1.2 |
|
1087 |
(90Mhz P5) |
|
1088 |
" |
|
1089 |
||
261 | 1090 |
! ! |
253 | 1091 |
|
1092 |
!JavaVM class methodsFor:'initialization'! |
|
1093 |
||
423 | 1094 |
compile:source selector:smalltalkSelector asJavaMethod:javaSelector fakedSource:fakedSource in:aClass |
1095 |
"install additional java protocol in smalltalk classes, req'd for java programs" |
|
1096 |
||
1097 |
|cloneCode| |
|
1098 |
||
1099 |
(aClass implements:javaSelector) ifFalse:[ |
|
1100 |
aClass |
|
1101 |
compile:source |
|
1102 |
classified:'java support' |
|
1103 |
logged:false. |
|
1104 |
||
1105 |
cloneCode := aClass compiledMethodAt:smalltalkSelector. |
|
1106 |
cloneCode source:fakedSource. |
|
1107 |
||
1108 |
Class withoutUpdatingChangesDo:[ |
|
1109 |
aClass removeSelector:smalltalkSelector. |
|
1110 |
aClass addSelector:javaSelector withMethod:cloneCode. |
|
1111 |
] |
|
1112 |
]. |
|
1113 |
||
1114 |
"Created: / 5.11.1998 / 19:30:22 / cg" |
|
1115 |
"Modified: / 5.11.1998 / 19:37:57 / cg" |
|
1116 |
! |
|
1117 |
||
253 | 1118 |
deinitialize |
1119 |
|table| |
|
1120 |
||
1121 |
StandardThreadGroup := nil. |
|
1122 |
self releaseAllMonitors. |
|
1123 |
||
1124 |
JavaWindowGroup := nil. |
|
1125 |
KnownWindows := nil. |
|
1126 |
OpenFileTable := nil. |
|
1127 |
JavaClasses := nil. |
|
380 | 1128 |
JavaMethods := nil. |
253 | 1129 |
|
1130 |
" |
|
1131 |
JavaVM deinitialize |
|
1132 |
" |
|
1133 |
||
1134 |
"Created: / 3.1.1998 / 21:28:14 / cg" |
|
380 | 1135 |
"Modified: / 16.10.1998 / 00:55:57 / cg" |
253 | 1136 |
! |
1137 |
||
307 | 1138 |
deinitializeAdditionalJavaProtocol |
1139 |
"install additional java protocol in smalltalk classes, req'd for java programs" |
|
1140 |
||
459 | 1141 |
#( |
1142 |
#'clone()Ljava/lang/Object;' |
|
1143 |
#'equals(Ljava/lang/Object;)Z' |
|
1144 |
#'toString()Ljava/lang/String;' |
|
1145 |
) do:[:sel | |
|
1146 |
(Object implements:sel) ifTrue:[ |
|
1147 |
Class withoutUpdatingChangesDo:[ |
|
1148 |
Object removeSelector:sel. |
|
1149 |
] |
|
1150 |
]. |
|
307 | 1151 |
]. |
1152 |
||
1153 |
" |
|
1154 |
self deinitializeAdditionalJavaProtocol |
|
1155 |
" |
|
1156 |
||
1157 |
"Created: / 4.2.1998 / 21:37:10 / cg" |
|
459 | 1158 |
"Modified: / 19.11.1998 / 01:18:36 / cg" |
307 | 1159 |
! |
1160 |
||
253 | 1161 |
initialize |
1162 |
|table| |
|
1163 |
||
1164 |
DUMMY_LONG_HIGHWORD := 1. |
|
1165 |
DUMMY_DOUBLE_HIGHWORD := 2. |
|
1166 |
||
1167 |
StandardThreadGroup := nil. |
|
261 | 1168 |
NoAudio := true. |
262 | 1169 |
"/ NoAudio := false. |
253 | 1170 |
|
1171 |
JavaConsoleStream := Transcript. |
|
1172 |
||
1173 |
FullExceptionTrace := StackTrace := false. |
|
1174 |
WindowOPTrace := DrawOPTrace := EventTrace := ThreadTrace := false. |
|
1175 |
MonitorTrace := ExceptionTrace := FileOpenTrace := FileIOTrace := false. |
|
1176 |
ExceptionDebug := false. |
|
1177 |
WindowCreationTrace := false. |
|
1178 |
||
1179 |
FileOpenConfirmation := true. |
|
390 | 1180 |
SocketConnectConfirmation := true. |
253 | 1181 |
|
255 | 1182 |
"/ WindowOPTrace := true. |
1183 |
"/ MonitorTrace := true. |
|
1184 |
"/ ThreadTrace := true. |
|
253 | 1185 |
|
1186 |
UnhandledJavaExceptionSignal := (Signal new) mayProceed:false. |
|
1187 |
UnhandledJavaExceptionSignal nameClass:self message:#unhandledJavaExceptionSignal. |
|
1188 |
UnhandledJavaExceptionSignal notifierString:'unhandled java exception'. |
|
1189 |
||
1190 |
JavaExceptionSignal := (Signal new) mayProceed:false. |
|
1191 |
JavaExceptionSignal nameClass:self message:#javaExceptionSignal. |
|
1192 |
JavaExceptionSignal notifierString:'java exception'. |
|
1193 |
||
1194 |
UnimplementedInstructionSignal := (Signal new) mayProceed:false. |
|
1195 |
UnimplementedInstructionSignal nameClass:self message:#unimplementedInstructionSignal. |
|
1196 |
UnimplementedInstructionSignal notifierString:'unimplemented instruction'. |
|
1197 |
||
1198 |
UnimplementedNativeMethodSignal := (Signal new) mayProceed:false. |
|
1199 |
UnimplementedNativeMethodSignal nameClass:self message:#unimplementedNativeMethodSignal. |
|
1200 |
UnimplementedNativeMethodSignal notifierString:'unimplemented native method'. |
|
1201 |
||
1202 |
BadMessageSignal := (Signal new) mayProceed:false. |
|
1203 |
BadMessageSignal nameClass:self message:#badMessageSignal. |
|
1204 |
BadMessageSignal notifierString:'invalid message to JAVA object'. |
|
1205 |
||
1206 |
InternalErrorSignal := (Signal new) mayProceed:false. |
|
1207 |
InternalErrorSignal nameClass:self message:#internalErrorSignal. |
|
1208 |
InternalErrorSignal notifierString:'internal error'. |
|
1209 |
||
1210 |
CallHandlerSignal := (Signal new) mayProceed:false. |
|
1211 |
CallHandlerSignal nameClass:self message:#callHandlerSignal. |
|
1212 |
CallHandlerSignal notifierString:'internal signal'. |
|
1213 |
||
1214 |
" |
|
1215 |
JavaVM initialize |
|
1216 |
" |
|
1217 |
||
1218 |
"Created: / 2.1.1998 / 18:02:34 / cg" |
|
390 | 1219 |
"Modified: / 19.10.1998 / 16:01:25 / cg" |
253 | 1220 |
! |
1221 |
||
307 | 1222 |
initializeAdditionalJavaProtocol |
1223 |
"install additional java protocol in smalltalk classes, req'd for java programs" |
|
1224 |
||
1225 |
"/ since we use smalltalk Arrays for JavaArray, some |
|
1226 |
"/ additional (java-) protocol is required. |
|
423 | 1227 |
"/ This is also useful, when Smalltalk objects are passed to |
1228 |
"/ java ... |
|
1229 |
"/ We should implement all of the java.lang.Object protocol in |
|
1230 |
"/ Object, to be on the bright side of life; more of this later ... |
|
1231 |
||
1232 |
self |
|
1233 |
compile:'__clone |
|
307 | 1234 |
"this is smalltalk code with a java selector ... |
430 | 1235 |
(This source cannot be accepted in the browser, |
1236 |
since it has a funny selector.) |
|
307 | 1237 |
Has been added by JavaVM>>initializeAdditionalJavaProtocol" |
1238 |
||
1239 |
^ self shallowCopy' |
|
423 | 1240 |
selector:#'__clone' |
1241 |
asJavaMethod:#'clone()Ljava/lang/Object;' |
|
1242 |
fakedSource:'#''clone()Ljava/lang/Object;'' |
|
307 | 1243 |
"this is smalltalk code with a java selector ... |
430 | 1244 |
(This source cannot be accepted in the browser, |
1245 |
since it has a funny selector.) |
|
307 | 1246 |
Has been added by JavaVM>>initializeAdditionalJavaProtocol" |
1247 |
||
423 | 1248 |
^ self shallowCopy' |
1249 |
in:Object. |
|
1250 |
||
1251 |
self |
|
430 | 1252 |
compile:'__equals:arg |
1253 |
"this is smalltalk code with a java selector ... |
|
1254 |
(This source cannot be accepted in the browser, |
|
1255 |
since it has a funny selector.) |
|
1256 |
Has been added by JavaVM>>initializeAdditionalJavaProtocol" |
|
1257 |
||
1258 |
^ (arg = self) ifTrue:[1] ifFalse:[0]' |
|
1259 |
selector:#'__equals:' |
|
1260 |
asJavaMethod:#'equals(Ljava/lang/Object;)Z' |
|
1261 |
fakedSource:'#''equals(Ljava/lang/Object;)Z'' |
|
1262 |
"this is smalltalk code with a java selector ... |
|
1263 |
(This source cannot be accepted in the browser, |
|
1264 |
since it has a funny selector.) |
|
1265 |
Has been added by JavaVM>>initializeAdditionalJavaProtocol" |
|
1266 |
||
1267 |
^ (arg = self) ifTrue:[1] ifFalse:[0]' |
|
1268 |
in:Object. |
|
1269 |
||
1270 |
self |
|
423 | 1271 |
compile:'__toString |
1272 |
"this is smalltalk code with a java selector ... |
|
430 | 1273 |
(This source cannot be accepted in the browser, |
1274 |
since it has a funny selector.) |
|
423 | 1275 |
Has been added by JavaVM>>initializeAdditionalJavaProtocol" |
1276 |
||
1277 |
^ Java as_String:(self displayString)' |
|
1278 |
selector:#'__toString' |
|
1279 |
asJavaMethod:#'toString()Ljava/lang/String;' |
|
1280 |
fakedSource:'#''toString()Ljava/lang/String;'' |
|
1281 |
"this is smalltalk code with a java selector ... |
|
430 | 1282 |
(This source cannot be accepted in the browser, |
1283 |
since it has a funny selector.) |
|
423 | 1284 |
Has been added by JavaVM>>initializeAdditionalJavaProtocol" |
1285 |
||
1286 |
^ Java as_String:(self displayString)' |
|
1287 |
in:Object |
|
307 | 1288 |
|
1289 |
" |
|
1290 |
self initializeAdditionalJavaProtocol |
|
1291 |
" |
|
1292 |
||
1293 |
"Modified: / 28.1.1997 / 19:38:58 / stefan" |
|
1294 |
"Modified: / 22.1.1998 / 21:23:40 / av" |
|
1295 |
"Created: / 4.2.1998 / 21:35:46 / cg" |
|
430 | 1296 |
"Modified: / 10.11.1998 / 16:54:51 / cg" |
307 | 1297 |
! |
1298 |
||
253 | 1299 |
initializeBaseClasses |
1300 |
"load req'd base classes" |
|
1301 |
||
326 | 1302 |
#( |
1303 |
'java.lang.Object' |
|
1304 |
'java.lang.Class' |
|
1305 |
'java.lang.String' |
|
1306 |
'java.lang.System' |
|
1307 |
) do:[:cName | |
|
1308 |
(Java classForName:cName) isNil ifTrue:[ |
|
1309 |
self halt:('could not find required class:' , cName) |
|
1310 |
] |
|
1311 |
]. |
|
253 | 1312 |
|
1313 |
" |
|
1314 |
self initializeBaseClasses |
|
1315 |
" |
|
1316 |
||
1317 |
"Created: / 3.1.1998 / 21:13:28 / cg" |
|
326 | 1318 |
"Modified: / 30.3.1998 / 17:47:02 / cg" |
253 | 1319 |
! |
1320 |
||
1321 |
initializeOpenFileTable |
|
1322 |
OpenFileTable := OrderedCollection |
|
261 | 1323 |
with:Stdin |
1324 |
with:(JavaConsoleStream ? Stdout) |
|
1325 |
with:(JavaConsoleStream ? Stderr). |
|
253 | 1326 |
|
1327 |
" |
|
1328 |
JavaVM initializeOpenFileTable |
|
1329 |
" |
|
1330 |
||
1331 |
"Modified: / 6.8.1997 / 00:40:19 / cg" |
|
1332 |
"Created: / 2.1.1998 / 18:04:32 / cg" |
|
1333 |
! |
|
1334 |
||
1335 |
initializePrimitiveClasses |
|
1336 |
JavaClasses isNil ifTrue:[ |
|
405 | 1337 |
JavaClasses := Dictionary new. |
253 | 1338 |
]. |
1339 |
||
1340 |
#( |
|
405 | 1341 |
(#byte 'B' 1) |
1342 |
(#short 'S' 2) |
|
1343 |
(#int 'I' 4) |
|
1344 |
(#long 'J' 8) |
|
1345 |
(#boolean 'Z' 1) |
|
1346 |
(#char 'C' 2) |
|
1347 |
(#float 'F' 4) |
|
1348 |
(#double 'D' 8) |
|
1349 |
(#void 'V' 0) |
|
253 | 1350 |
) triplesDo:[:nm :sig :len | |
405 | 1351 |
|stClass jClass| |
1352 |
||
1353 |
"/ |
|
1354 |
"/ create a javaClass for it. |
|
1355 |
"/ |
|
1356 |
jClass := (Java at:'java.lang.Class') new. |
|
253 | 1357 |
"/ stClass := Class new. |
1358 |
"/ stClass setName:('JavaBase_' , nm) asSymbol. |
|
1359 |
"/ JavaClasses at:stClass put:jClass. |
|
1360 |
"/ JavaClasses at:jClass put:stClass. |
|
1361 |
||
405 | 1362 |
JavaClasses at:nm put:jClass |
253 | 1363 |
]. |
1364 |
||
1365 |
" |
|
1366 |
self initializePrimitiveClasses |
|
1367 |
" |
|
1368 |
||
405 | 1369 |
"Modified: / 22.10.1998 / 01:56:02 / cg" |
253 | 1370 |
! |
1371 |
||
1372 |
initializeSimulatedLibs |
|
277 | 1373 |
"return a collection of native libs which are considered |
1374 |
being already loaded. (used with jdk < 1.2)" |
|
1375 |
||
432 | 1376 |
LibPath := #( |
1377 |
'__builtIn__' |
|
1378 |
'/usr/local/lib' |
|
1379 |
'/usr/local/lib/java' |
|
1380 |
). |
|
1381 |
||
1382 |
SimulatedLibs := #( |
|
1383 |
'__builtIn__/net' |
|
1384 |
'__builtIn__/awt' |
|
1385 |
'__builtIn__/tawt' |
|
1386 |
'__builtIn__/winawt' |
|
1387 |
'__builtIn__/jpeg' |
|
1388 |
'__builtIn__/mmedia' |
|
1389 |
'__builtIn__/zip' |
|
1390 |
'__builtIn__/math' |
|
1391 |
||
1392 |
"/ KAVA ... |
|
1393 |
'__builtIn__/agent' |
|
457 | 1394 |
|
1395 |
"/ MS-java ... |
|
1396 |
'__builtIn__/msawt' |
|
1397 |
'__builtIn__/javart' |
|
277 | 1398 |
). |
253 | 1399 |
|
457 | 1400 |
" |
1401 |
self initializeSimulatedLibs |
|
1402 |
" |
|
1403 |
||
253 | 1404 |
"Created: / 4.1.1998 / 19:05:03 / cg" |
457 | 1405 |
"Modified: / 17.11.1998 / 23:53:02 / cg" |
277 | 1406 |
! |
1407 |
||
1408 |
initializeSimulatedNativeLibs |
|
1409 |
"return a collection of native libs which are considered |
|
1410 |
being already loaded (used with jdk >= 1.2)" |
|
1411 |
||
1412 |
SimulatedNativeLibs := #( |
|
1413 |
'/libawt.so' |
|
1414 |
). |
|
1415 |
||
1416 |
" |
|
1417 |
self initializeSimulatedNativeLibs |
|
1418 |
" |
|
1419 |
||
1420 |
"Modified: / 27.1.1998 / 18:43:10 / cg" |
|
253 | 1421 |
! |
1422 |
||
1423 |
initializeSystemPropertiesInto:props |
|
1424 |
|cpu os| |
|
1425 |
||
1426 |
"/ use JAVA compatible cpu-name |
|
1427 |
cpu := OperatingSystem getCPUType. |
|
1428 |
cpu = 'i386' ifTrue:[ |
|
280 | 1429 |
cpu := 'ix86' |
253 | 1430 |
]. |
1431 |
os := OperatingSystem getOSType. |
|
1432 |
os := os asUppercaseFirst. |
|
1433 |
||
1434 |
props at:'java.version' put:'1'. |
|
1435 |
props at:'java.vendor' put:'eXept Software AG'. |
|
342 | 1436 |
props at:'java.vendor.url' put:'http://www.exept.de'. |
253 | 1437 |
props at:'java.home' put:(self defaultJAVAHome). |
1438 |
props at:'java.class.version' put:'1'. |
|
1439 |
props at:'java.class.path' put:(self defaultCLASSPATH). |
|
1440 |
props at:'os.name' put:os. |
|
1441 |
props at:'os.arch' put:cpu. |
|
1442 |
props at:'os.version' put:'1'. |
|
1443 |
props at:'file.separator' put:(Filename separator asString). |
|
1444 |
props at:'path.separator' put:':'. |
|
1445 |
props at:'line.separator' put:(Character cr asString). |
|
1446 |
props at:'user.name' put:(OperatingSystem getLoginName). |
|
388 | 1447 |
props at:'user.home' put:(OperatingSystem getHomeDirectory ? Filename currentDirectory name). |
253 | 1448 |
props at:'user.dir' put:(Filename currentDirectory pathName). |
1449 |
||
1450 |
props at:'awt.toolkit' put:(self defaultWindowingToolKit). |
|
1451 |
||
1452 |
props at:'jws.home' put:(self defaultJWSHome). |
|
1453 |
props at:'hotjava.home' put:(self defaultHotJavaHome). |
|
1454 |
||
1455 |
"/ undocumented ? |
|
255 | 1456 |
props at:'file.encoding.pkg' put:'sun.io'. |
253 | 1457 |
|
1458 |
"/ suppress copyright view in appletViewer ... |
|
1459 |
props at:'appletviewer.version' put:'1.1'. |
|
1460 |
||
280 | 1461 |
"/ new with jdk 1.2 |
1462 |
||
1463 |
props at:'java.awt.graphicsenv' put:'sun.awt.X11GraphicsEnvironment'. |
|
284 | 1464 |
props at:'java.awt.fonts' put:'/usr/lib/X11/fonts'. |
280 | 1465 |
|
253 | 1466 |
^ props |
1467 |
||
388 | 1468 |
" |
1469 |
self initializeSystemPropertiesInto:(Dictionary new) |
|
1470 |
" |
|
1471 |
||
253 | 1472 |
"Created: / 3.1.1998 / 14:26:39 / cg" |
388 | 1473 |
"Modified: / 17.10.1998 / 21:52:54 / cg" |
253 | 1474 |
! |
1475 |
||
1476 |
initializeVM |
|
307 | 1477 |
|
1478 |
self initializeAdditionalJavaProtocol. |
|
1479 |
||
285 | 1480 |
self releaseAllJavaResources. |
255 | 1481 |
|
261 | 1482 |
JavaConsoleStream := Transcript. |
1483 |
||
255 | 1484 |
Java initAllStaticFields. |
1485 |
Java markAllClassesUninitialized. |
|
1486 |
||
429 | 1487 |
"/ force re-resolving; |
1488 |
"/ otherwise, class-inits would not be called |
|
1489 |
"/ by resolver ... (sigh) |
|
1490 |
||
1491 |
JavaMethod allSubInstancesDo:[:m | |
|
1492 |
m checked:false. |
|
1493 |
m code:nil. |
|
1494 |
]. |
|
1495 |
ObjectMemory flushCaches. "/ sigh - must flush inline caches. |
|
1496 |
||
434 | 1497 |
JavaClass startRememberingOrderOfClassInits. |
1498 |
||
277 | 1499 |
self initializeSimulatedLibs. "/ < jdk 1.2 |
1500 |
self initializeSimulatedNativeLibs. "/ >= jdk 1.2 |
|
253 | 1501 |
self initializeOpenFileTable. |
1502 |
||
1503 |
self initializeBaseClasses. |
|
1504 |
self initializePrimitiveClasses. |
|
1505 |
||
1506 |
Java initSystemClass. |
|
1507 |
||
255 | 1508 |
ObjectMemory addDependent:self. |
1509 |
||
253 | 1510 |
" |
285 | 1511 |
JavaVM initialize. |
1512 |
JavaVM initializeVM. |
|
253 | 1513 |
" |
1514 |
||
1515 |
"Created: / 3.1.1998 / 21:29:09 / cg" |
|
434 | 1516 |
"Modified: / 12.11.1998 / 15:31:17 / cg" |
261 | 1517 |
! |
1518 |
||
1519 |
initializeVMIfNoEventThreadRunning |
|
1520 |
(JavaEventThread isNil or:[JavaEventThread isDead]) ifTrue:[ |
|
270 | 1521 |
self initializeVM |
261 | 1522 |
]. |
1523 |
||
1524 |
" |
|
1525 |
JavaVM initializeVMIfNoEventThreadRunning |
|
1526 |
" |
|
1527 |
||
1528 |
"Modified: / 15.1.1998 / 17:29:34 / cg" |
|
1529 |
"Created: / 15.1.1998 / 17:32:27 / cg" |
|
255 | 1530 |
! |
1531 |
||
434 | 1532 |
reinitializeVM |
1533 |
|classesToInit| |
|
1534 |
||
1535 |
self releaseAllJavaResources. |
|
1536 |
||
1537 |
JavaConsoleStream := Transcript. |
|
1538 |
||
1539 |
Java initAllStaticFields. |
|
1540 |
Java markAllClassesUninitialized. |
|
1541 |
||
1542 |
self initializeOpenFileTable. |
|
1543 |
||
1544 |
classesToInit := JavaClass orderOfClassInits. |
|
1545 |
JavaClass startRememberingOrderOfClassInits. |
|
1546 |
||
451 | 1547 |
self initializePrimitiveClasses. |
455 | 1548 |
"/ Java initSystemClass. |
434 | 1549 |
|
1550 |
classesToInit do:[:jClass | |
|
455 | 1551 |
Transcript showCR:'classInit: ' , jClass name. |
434 | 1552 |
jClass classInit |
1553 |
]. |
|
455 | 1554 |
Java initSystemClass. |
434 | 1555 |
|
1556 |
"Created: / 12.11.1998 / 15:37:52 / cg" |
|
455 | 1557 |
"Modified: / 17.11.1998 / 16:10:11 / cg" |
434 | 1558 |
! |
1559 |
||
255 | 1560 |
releaseAllJavaResources |
380 | 1561 |
self deinitialize. |
1562 |
||
285 | 1563 |
FirstWindowCreationSemaphore := Semaphore new. |
423 | 1564 |
ScreenUpdaterProcess := nil. |
285 | 1565 |
|
1566 |
LoadedLibs := nil. "/ gc will reclaim them ... |
|
1567 |
LoadedNativeLibs := nil. "/ gc will reclaim them ... |
|
1568 |
||
1569 |
ImageStretchCache := nil. |
|
1570 |
||
1571 |
self terminateAllThreads. |
|
1572 |
||
255 | 1573 |
self releaseAllWindows. |
1574 |
self releaseAllStreams. |
|
1575 |
||
1576 |
" |
|
1577 |
JavaVM releaseAllJavaResources |
|
1578 |
" |
|
1579 |
||
1580 |
"Created: / 7.1.1998 / 22:49:42 / cg" |
|
423 | 1581 |
"Modified: / 5.11.1998 / 20:07:02 / cg" |
253 | 1582 |
! |
1583 |
||
1584 |
releaseAllMonitors |
|
1585 |
LockTable := WeakIdentityDictionary new. |
|
1586 |
LockTableAccess := Semaphore forMutualExclusion. |
|
1587 |
WaitTable := IdentityDictionary new. |
|
1588 |
WaitTableAccess := Semaphore forMutualExclusion. |
|
1589 |
||
1590 |
EnteredMonitorsPerProcess := IdentityDictionary new. |
|
1591 |
||
1592 |
" |
|
1593 |
JavaVM releaseAllMonitors |
|
1594 |
" |
|
1595 |
||
1596 |
"Created: / 2.1.1998 / 18:04:05 / cg" |
|
255 | 1597 |
"Modified: / 7.1.1998 / 22:58:10 / cg" |
1598 |
! |
|
1599 |
||
1600 |
releaseAllStreams |
|
307 | 1601 |
OpenFileTable notNil ifTrue:[ |
1602 |
OpenFileTable do:[:aStream | |
|
1603 |
aStream notNil ifTrue:[ |
|
1604 |
aStream ~~ Stdin ifTrue:[ |
|
1605 |
aStream ~~ Stdout ifTrue:[ |
|
1606 |
aStream ~~ Stderr ifTrue:[ |
|
1607 |
aStream ~~ JavaConsoleStream ifTrue:[ |
|
1608 |
aStream isExternalStream ifTrue:[ |
|
1609 |
aStream shutDown |
|
1610 |
] |
|
1611 |
] |
|
1612 |
] |
|
1613 |
] |
|
1614 |
] |
|
1615 |
] |
|
1616 |
] |
|
1617 |
]. |
|
255 | 1618 |
self initializeOpenFileTable. |
1619 |
||
1620 |
" |
|
261 | 1621 |
JavaVM releaseAllStreams |
255 | 1622 |
" |
1623 |
||
1624 |
"Created: / 7.1.1998 / 22:57:04 / cg" |
|
307 | 1625 |
"Modified: / 4.2.1998 / 19:53:11 / cg" |
255 | 1626 |
! |
1627 |
||
1628 |
releaseAllWindows |
|
1629 |
KnownWindows notNil ifTrue:[ |
|
261 | 1630 |
KnownWindows do:[:aView | |
1631 |
aView destroy |
|
1632 |
]. |
|
1633 |
KnownWindows := nil. |
|
255 | 1634 |
] |
1635 |
||
1636 |
" |
|
1637 |
self releaseAllWindows |
|
1638 |
" |
|
1639 |
||
1640 |
"Created: / 7.1.1998 / 22:58:32 / cg" |
|
1641 |
! |
|
1642 |
||
1643 |
releaseLeftOverMonitors |
|
1644 |
"release monitors held by dead processes" |
|
1645 |
||
1646 |
|deadProcesses| |
|
1647 |
||
1648 |
deadProcesses := IdentitySet new. |
|
1649 |
||
1650 |
EnteredMonitorsPerProcess keysAndValuesDo:[:p :monitors | |
|
261 | 1651 |
p isDead ifTrue:[ |
1652 |
monitors do:[:mon | |
|
1653 |
Transcript showCR:'release leftover monitor ...'. |
|
1654 |
mon release |
|
1655 |
]. |
|
1656 |
deadProcesses add:p. |
|
1657 |
] |
|
255 | 1658 |
]. |
1659 |
deadProcesses do:[:p | |
|
261 | 1660 |
EnteredMonitorsPerProcess removeKey:p |
255 | 1661 |
]. |
1662 |
||
1663 |
" |
|
1664 |
JavaVM releaseLeftOverMonitors |
|
1665 |
" |
|
1666 |
||
1667 |
"Created: / 8.1.1998 / 17:29:26 / cg" |
|
1668 |
"Modified: / 8.1.1998 / 17:38:33 / cg" |
|
253 | 1669 |
! |
1670 |
||
1671 |
systemProperties |
|
1672 |
|props| |
|
1673 |
||
1674 |
props := Dictionary new. |
|
1675 |
self initializeSystemPropertiesInto:props. |
|
1676 |
^ props |
|
1677 |
||
1678 |
"Created: / 3.1.1998 / 14:25:58 / cg" |
|
1679 |
"Modified: / 3.1.1998 / 14:32:38 / cg" |
|
255 | 1680 |
! |
1681 |
||
1682 |
terminateAllThreads |
|
261 | 1683 |
Java terminateAllThreads. |
1684 |
JavaEventThread := nil. |
|
255 | 1685 |
|
1686 |
"Created: / 8.1.1998 / 17:43:54 / cg" |
|
261 | 1687 |
"Modified: / 15.1.1998 / 17:29:00 / cg" |
255 | 1688 |
! |
1689 |
||
1690 |
update:something with:aParameter from:changedObject |
|
1691 |
something == #returnFromSnapshot ifTrue:[ |
|
426 | 1692 |
"/ self initializeVM |
255 | 1693 |
]. |
1694 |
||
1695 |
" |
|
1696 |
JavaVM initializeVM |
|
1697 |
" |
|
1698 |
||
1699 |
"Created: / 9.1.1998 / 10:30:13 / cg" |
|
426 | 1700 |
"Modified: / 6.11.1998 / 00:40:53 / cg" |
253 | 1701 |
! ! |
1702 |
||
1703 |
!JavaVM class methodsFor:'Signal constants'! |
|
1704 |
||
1705 |
badMessageSignal |
|
1706 |
^ BadMessageSignal |
|
1707 |
||
1708 |
"Created: / 2.1.1998 / 18:06:52 / cg" |
|
1709 |
! |
|
1710 |
||
1711 |
callHandlerSignal |
|
1712 |
^ CallHandlerSignal |
|
1713 |
||
1714 |
"Created: / 2.1.1998 / 18:07:16 / cg" |
|
1715 |
! |
|
1716 |
||
1717 |
internalErrorSignal |
|
1718 |
^ InternalErrorSignal |
|
1719 |
||
1720 |
"Created: / 2.1.1998 / 18:07:05 / cg" |
|
1721 |
! |
|
1722 |
||
1723 |
javaExceptionSignal |
|
1724 |
^ JavaExceptionSignal |
|
1725 |
||
1726 |
"Created: / 2.1.1998 / 18:05:58 / cg" |
|
1727 |
! |
|
1728 |
||
1729 |
unhandledJavaExceptionSignal |
|
1730 |
^ UnhandledJavaExceptionSignal |
|
1731 |
||
1732 |
"Created: / 2.1.1998 / 18:05:19 / cg" |
|
1733 |
! |
|
1734 |
||
1735 |
unimplementedInstructionSignal |
|
1736 |
^ UnimplementedInstructionSignal |
|
1737 |
||
1738 |
"Created: / 2.1.1998 / 18:06:15 / cg" |
|
1739 |
! |
|
1740 |
||
1741 |
unimplementedNativeMethodSignal |
|
1742 |
^ UnimplementedNativeMethodSignal |
|
1743 |
||
1744 |
"Created: / 2.1.1998 / 18:06:40 / cg" |
|
1745 |
! ! |
|
1746 |
||
1747 |
!JavaVM class methodsFor:'defaults'! |
|
1748 |
||
359 | 1749 |
audioEnabled |
1750 |
^ NoAudio not |
|
1751 |
||
1752 |
"Created: / 18.7.1998 / 22:31:36 / cg" |
|
1753 |
! |
|
1754 |
||
1755 |
audioEnabled:aBoolean |
|
1756 |
NoAudio := aBoolean not |
|
1757 |
||
1758 |
"Created: / 18.7.1998 / 22:31:20 / cg" |
|
1759 |
! |
|
1760 |
||
253 | 1761 |
defaultCLASSPATH |
1762 |
|s| |
|
1763 |
||
1764 |
s := '' writeStream. |
|
1765 |
Java classPath do:[:p | |
|
261 | 1766 |
s size == 0 ifFalse:[ |
1767 |
s nextPut:$: |
|
1768 |
]. |
|
1769 |
s nextPutAll:p. |
|
253 | 1770 |
]. |
1771 |
||
1772 |
^ s contents |
|
1773 |
||
1774 |
" |
|
1775 |
self defaultCLASSPATH |
|
1776 |
" |
|
1777 |
||
1778 |
"Modified: / 6.8.1997 / 00:51:17 / cg" |
|
1779 |
"Created: / 3.1.1998 / 14:27:21 / cg" |
|
1780 |
! |
|
1781 |
||
1782 |
defaultHotJavaHome |
|
1783 |
^ '/usr/local/java/hotjava'. |
|
1784 |
||
1785 |
"Modified: / 5.8.1997 / 04:13:36 / cg" |
|
1786 |
"Created: / 3.1.1998 / 14:27:34 / cg" |
|
1787 |
! |
|
1788 |
||
1789 |
defaultJAVAHome |
|
1790 |
^ Java javaHome |
|
1791 |
||
1792 |
"Modified: / 6.8.1997 / 00:54:44 / cg" |
|
1793 |
"Created: / 3.1.1998 / 14:27:01 / cg" |
|
1794 |
! |
|
1795 |
||
1796 |
defaultJWSHome |
|
1797 |
^ '/usr/local/java/JWS'. |
|
1798 |
||
1799 |
"Modified: / 5.8.1997 / 04:14:34 / cg" |
|
1800 |
"Created: / 3.1.1998 / 14:27:42 / cg" |
|
1801 |
! |
|
1802 |
||
1803 |
defaultWindowingToolKit |
|
1804 |
"/ prefer the windows toolkit ... |
|
1805 |
||
1806 |
(Java classForName:'sun.awt.windows.WToolkit') notNil ifTrue:[ |
|
277 | 1807 |
^ 'sun.awt.windows.WToolkit'. |
1808 |
]. |
|
1809 |
(Java classForName:'sun.awt.motif.MToolkit') notNil ifTrue:[ |
|
1810 |
^ 'sun.awt.motif.MToolkit'. |
|
1811 |
]. |
|
253 | 1812 |
|
1813 |
^ 'sun.awt.tiny.TinyToolkit'. |
|
1814 |
||
1815 |
||
1816 |
"/ ^ 'sun.awt.win32.MToolkit'. |
|
1817 |
"/ ^ 'sun.awt.motif.MToolkit'. |
|
1818 |
||
277 | 1819 |
" |
1820 |
self defaultWindowingToolKit |
|
1821 |
" |
|
1822 |
||
253 | 1823 |
"Created: / 3.1.1998 / 14:27:49 / cg" |
277 | 1824 |
"Modified: / 27.1.1998 / 21:52:52 / cg" |
253 | 1825 |
! |
1826 |
||
390 | 1827 |
fileOpenConfirmation |
1828 |
^ FileOpenConfirmation |
|
1829 |
||
1830 |
"Created: / 19.10.1998 / 16:01:44 / cg" |
|
1831 |
! |
|
1832 |
||
1833 |
fileOpenConfirmation:aBoolean |
|
1834 |
FileOpenConfirmation := aBoolean |
|
1835 |
||
1836 |
"Created: / 19.10.1998 / 16:01:56 / cg" |
|
1837 |
! |
|
1838 |
||
253 | 1839 |
javaConsole:aStream |
1840 |
JavaConsoleStream := aStream |
|
1841 |
||
1842 |
" |
|
261 | 1843 |
JavaVM javaConsole:Transcript |
253 | 1844 |
" |
1845 |
||
1846 |
"Modified: / 6.8.1997 / 00:34:13 / cg" |
|
1847 |
"Created: / 3.1.1998 / 14:27:58 / cg" |
|
1848 |
! |
|
1849 |
||
1850 |
javaConsoleStream |
|
1851 |
^ JavaConsoleStream |
|
1852 |
||
1853 |
"Created: / 3.1.1998 / 14:32:16 / cg" |
|
390 | 1854 |
! |
1855 |
||
1856 |
socketConnectConfirmation |
|
1857 |
^ SocketConnectConfirmation |
|
1858 |
||
1859 |
"Created: / 19.10.1998 / 16:02:15 / cg" |
|
1860 |
! |
|
1861 |
||
1862 |
socketConnectConfirmation:aBoolean |
|
1863 |
SocketConnectConfirmation := aBoolean |
|
1864 |
||
1865 |
"Created: / 19.10.1998 / 16:02:06 / cg" |
|
253 | 1866 |
! ! |
1867 |
||
1868 |
!JavaVM class methodsFor:'fileIO'! |
|
1869 |
||
1870 |
addOpenFile:aStream |
|
1871 |
OpenFileTable add:aStream. |
|
1872 |
^ OpenFileTable size - 1. |
|
1873 |
||
1874 |
"Created: / 2.1.1998 / 18:32:59 / cg" |
|
1875 |
! |
|
1876 |
||
1877 |
getOpenFileAt:idx |
|
1878 |
^ OpenFileTable at:idx+1 ifAbsent:nil. |
|
1879 |
||
1880 |
"Created: / 2.1.1998 / 18:28:01 / cg" |
|
1881 |
"Modified: / 2.1.1998 / 18:33:06 / cg" |
|
1882 |
! |
|
1883 |
||
1884 |
setOpenFile:aStream at:idx |
|
1885 |
OpenFileTable size < (idx+1) ifTrue:[ |
|
261 | 1886 |
OpenFileTable grow:idx+1. |
253 | 1887 |
]. |
1888 |
OpenFileTable at:idx+1 put:aStream. |
|
1889 |
||
1890 |
"Modified: / 2.1.1998 / 18:33:21 / cg" |
|
1891 |
! ! |
|
1892 |
||
1893 |
!JavaVM class methodsFor:'helpers'! |
|
1894 |
||
268
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1895 |
classForJavaClassObject:aJavaClassObject |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1896 |
"given java.lang.class instance, return the real class for it." |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1897 |
|
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1898 |
^ JavaClasses at:aJavaClassObject ifAbsent:nil. |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1899 |
|
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1900 |
"Created: / 23.1.1998 / 17:44:09 / cg" |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1901 |
! |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1902 |
|
253 | 1903 |
enteredMonitors |
1904 |
|p monitors| |
|
1905 |
||
1906 |
p := Processor activeProcess. |
|
1907 |
monitors := EnteredMonitorsPerProcess at:p ifAbsent:nil. |
|
1908 |
monitors isNil ifTrue:[ |
|
261 | 1909 |
monitors := OrderedCollection new. |
1910 |
EnteredMonitorsPerProcess at:p put:monitors. |
|
253 | 1911 |
]. |
1912 |
^ monitors |
|
1913 |
||
1914 |
"Created: / 2.1.1998 / 21:26:19 / cg" |
|
1915 |
! |
|
1916 |
||
268
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1917 |
javaClassObjectForClass:aClass |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1918 |
"given a real class, return the corresponding java.lang.class |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1919 |
instance for it." |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1920 |
|
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1921 |
|jClass| |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1922 |
|
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1923 |
jClass := JavaClasses at:aClass ifAbsent:nil. |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1924 |
jClass isNil ifTrue:[ |
405 | 1925 |
"/ class must be initialized (with all of its superclasses ?). |
1926 |
aClass isJavaClass ifTrue:[ |
|
1927 |
aClass classInit. |
|
1928 |
]. |
|
1929 |
JavaClasses at:aClass put:(jClass := (Java at:'java.lang.Class') new). |
|
1930 |
JavaClasses at:jClass put:aClass. |
|
268
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1931 |
]. |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1932 |
^ jClass |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1933 |
|
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1934 |
"Created: / 23.1.1998 / 17:43:38 / cg" |
405 | 1935 |
"Modified: / 21.10.1998 / 02:50:15 / cg" |
268
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1936 |
! |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1937 |
|
321 | 1938 |
javaMethodObjectForMethod:aMethod |
1939 |
"given a real method, return the corresponding java.lang.reflect.Method |
|
1940 |
instance for it." |
|
1941 |
||
1942 |
|jMethod| |
|
1943 |
||
1944 |
jMethod := JavaMethods at:aMethod ifAbsent:nil. |
|
1945 |
jMethod isNil ifTrue:[ |
|
1946 |
"/ class must be initialized (with all of its superclasses ?). |
|
1947 |
||
1948 |
JavaMethods at:aMethod put:(jMethod := (Java at:'java.lang.reflect.Method') new). |
|
1949 |
JavaMethods at:jMethod put:aMethod. |
|
1950 |
]. |
|
1951 |
^ jMethod |
|
1952 |
||
1953 |
"Modified: / 23.1.1998 / 17:46:51 / cg" |
|
1954 |
"Created: / 9.2.1998 / 15:59:16 / cg" |
|
1955 |
! |
|
1956 |
||
253 | 1957 |
javaThreadForSTProcess:stProcess |
1958 |
|t| |
|
1959 |
||
1960 |
t := Java threads keyAtValue:stProcess ifAbsent:nil. |
|
1961 |
t == 0 ifTrue:[ |
|
261 | 1962 |
^ nil |
253 | 1963 |
]. |
1964 |
^ t |
|
1965 |
||
1966 |
"Modified: / 26.8.1997 / 19:56:31 / cg" |
|
1967 |
"Created: / 3.1.1998 / 01:53:41 / cg" |
|
1968 |
! |
|
1969 |
||
321 | 1970 |
methodForJavaMethodObject:aJavaMethodObject |
1971 |
"given java.lang.reflect.Method instance, return the real method for it." |
|
1972 |
||
1973 |
^ JavaMethods at:aJavaMethodObject ifAbsent:nil. |
|
1974 |
||
1975 |
"Created: / 9.2.1998 / 16:01:48 / cg" |
|
1976 |
! |
|
1977 |
||
253 | 1978 |
newThread:name |
274 | 1979 |
|thread threadClass i| |
253 | 1980 |
|
1981 |
threadClass := Java at:'java.lang.Thread'. |
|
1982 |
||
1983 |
thread := (Java at:'java.lang.Thread') basicNew. |
|
1984 |
thread instVarNamed:'name' put:(Java as_String:name). |
|
1985 |
thread instVarNamed:'priority' put:(threadClass instVarNamed:'NORM_PRIORITY'). |
|
1986 |
thread instVarNamed:'single_step' put:0. |
|
1987 |
thread instVarNamed:'daemon' put:0. |
|
1988 |
thread instVarNamed:'stillborn' put:0. |
|
1989 |
thread instVarNamed:'target' put:nil. |
|
274 | 1990 |
"/ |
1991 |
"/ that on was only temporarily present in JDK1.1.3 (sigh) |
|
1992 |
"/ |
|
1993 |
(i := thread class instVarOffsetOf:'initial_stack_memory') notNil ifTrue:[ |
|
1994 |
thread instVarAt:i put:0. |
|
1995 |
]. |
|
253 | 1996 |
thread instVarNamed:'group' put:(self standardThreadGroup). |
1997 |
^ thread |
|
1998 |
||
1999 |
"Created: / 3.1.1998 / 01:47:30 / cg" |
|
274 | 2000 |
"Modified: / 27.1.1998 / 00:54:33 / cg" |
253 | 2001 |
! |
2002 |
||
2003 |
stProcessForJavaThread:jThread |
|
2004 |
|p| |
|
2005 |
||
2006 |
p := Java threads at:jThread ifAbsent:nil. |
|
2007 |
p == 0 ifTrue:[ |
|
261 | 2008 |
^ nil |
253 | 2009 |
]. |
2010 |
^ p |
|
2011 |
||
2012 |
"Created: / 2.1.1998 / 21:48:27 / cg" |
|
2013 |
"Modified: / 3.1.1998 / 01:53:55 / cg" |
|
2014 |
! |
|
2015 |
||
2016 |
standardThreadGroup |
|
2017 |
|standardGroup threadClass| |
|
2018 |
||
2019 |
StandardThreadGroup isNil ifTrue:[ |
|
457 | 2020 |
threadClass := Java at:'java.lang.Thread'. |
2021 |
||
2022 |
standardGroup := (Java at:'java.lang.ThreadGroup') new. |
|
2023 |
standardGroup instVarNamed:'parent' put:nil. |
|
2024 |
standardGroup instVarNamed:'name' put:(Java as_String:'main'). |
|
2025 |
standardGroup instVarNamed:'maxPriority' put:(threadClass instVarNamed:'MAX_PRIORITY'). |
|
2026 |
standardGroup instVarNamed:'destroyed' put:0. |
|
2027 |
standardGroup instVarNamed:'daemon' put:nil. |
|
2028 |
(standardGroup class instVarOffsetOf:'vmAllowSuspension') notNil ifTrue:[ |
|
2029 |
standardGroup instVarNamed:'vmAllowSuspension' put:0. |
|
2030 |
]. |
|
2031 |
standardGroup instVarNamed:'nthreads' put:0. |
|
2032 |
standardGroup instVarNamed:'ngroups' put:0. |
|
2033 |
standardGroup instVarNamed:'groups' put:nil. |
|
2034 |
StandardThreadGroup := standardGroup. |
|
253 | 2035 |
]. |
2036 |
^ StandardThreadGroup |
|
2037 |
||
2038 |
"Created: / 3.1.1998 / 01:41:54 / cg" |
|
457 | 2039 |
"Modified: / 17.11.1998 / 22:55:30 / cg" |
253 | 2040 |
! |
2041 |
||
2042 |
wakeup:anObject |
|
2043 |
JavaVM releaseAndSignalSemaphoreFor:anObject. |
|
2044 |
||
2045 |
"Created: / 3.1.1998 / 02:29:27 / cg" |
|
2046 |
"Modified: / 3.1.1998 / 03:08:05 / cg" |
|
2047 |
! |
|
2048 |
||
2049 |
wakeupAll:anObject |
|
2050 |
JavaVM releaseAndSignalForAllSemaphoreFor:anObject. |
|
2051 |
||
2052 |
"Created: / 3.1.1998 / 03:07:48 / cg" |
|
2053 |
"Modified: / 3.1.1998 / 03:08:15 / cg" |
|
2054 |
! ! |
|
2055 |
||
2056 |
!JavaVM class methodsFor:'helpers - awt'! |
|
2057 |
||
2058 |
commonReshapeComponent:nativeContext |
|
277 | 2059 |
|view x y width height ext menu| |
2060 |
||
2061 |
view := self viewForWPeer:nativeContext. |
|
253 | 2062 |
|
2063 |
x := nativeContext argAt:1. |
|
2064 |
y := nativeContext argAt:2. |
|
2065 |
width := nativeContext argAt:3. |
|
2066 |
height := nativeContext argAt:4. |
|
261 | 2067 |
ext := width@height. |
253 | 2068 |
|
2069 |
"/ 'pReshape ' print. view print. |
|
2070 |
"/ ' ' print. x print. '/' print. y print. |
|
261 | 2071 |
"/ ' extent: ' print. ext printNL. |
253 | 2072 |
|
2073 |
(view isTopView |
|
2074 |
or:[view isMemberOf:JavaEmbeddedFrameView]) ifTrue:[ |
|
2075 |
"/ |
|
2076 |
"/ dont allow setting the origin |
|
2077 |
"/ |
|
2078 |
menu := self topViewsMenu:view. |
|
2079 |
menu notNil ifTrue:[ |
|
2080 |
"/ must add the menus height |
|
261 | 2081 |
height := height + menu height. |
2082 |
ext := width@height. |
|
253 | 2083 |
]. |
261 | 2084 |
|
2085 |
"/ to prevent a view from not being visible/closable |
|
2086 |
"/ in case Java goes mad .. |
|
2087 |
||
2088 |
(width < 30 |
|
2089 |
or:[height < 10]) ifTrue:[ |
|
2090 |
"/ self halt. |
|
2091 |
width := 30. |
|
2092 |
height := 20. |
|
2093 |
ext := width@height. |
|
2094 |
]. |
|
2095 |
||
2096 |
view extent:ext. |
|
270 | 2097 |
(view isKindOf:ModalBox) ifTrue:[ |
2098 |
view preferredExtent:ext |
|
2099 |
]. |
|
261 | 2100 |
|
2101 |
"/ adjust non-resizable views min/max |
|
2102 |
||
2103 |
view isTopView ifTrue:[ |
|
2104 |
view minExtent notNil ifTrue:[ |
|
2105 |
view minExtent:ext. |
|
2106 |
view maxExtent:ext |
|
2107 |
]. |
|
2108 |
] |
|
253 | 2109 |
] ifFalse:[ |
2110 |
(view superView notNil |
|
2111 |
and:[view superView isTopView]) ifTrue:[ |
|
2112 |
menu := self topViewsMenu:view superView. |
|
2113 |
menu notNil ifTrue:[ |
|
2114 |
"/ must add menus height to yPos |
|
2115 |
y := y + menu height. |
|
2116 |
] |
|
261 | 2117 |
] ifFalse:[ |
2118 |
"/ post a configuration event |
|
318 | 2119 |
EventTrace == true ifTrue:[ |
2120 |
'JAVA: configure: need event' printCR. |
|
2121 |
] |
|
253 | 2122 |
]. |
261 | 2123 |
view origin:x@y extent:ext. |
253 | 2124 |
]. |
2125 |
||
2126 |
^ nil |
|
2127 |
||
2128 |
"Created: / 4.1.1998 / 18:00:52 / cg" |
|
318 | 2129 |
"Modified: / 6.2.1998 / 01:45:46 / cg" |
253 | 2130 |
! |
2131 |
||
2132 |
createdWindowsView:aView for:aJavaPeer |
|
2133 |
"this is only sent with the sun.awt.windows toolkit" |
|
2134 |
||
2135 |
aJavaPeer instVarNamed:'pData' put:aView. |
|
2136 |
||
2137 |
JavaWindowGroup isNil ifTrue:[ |
|
284 | 2138 |
JavaWindowGroup := WindowGroup new. |
2139 |
JavaWindowGroup isForModalSubview:true. |
|
253 | 2140 |
]. |
2141 |
aView windowGroup:JavaWindowGroup. |
|
2142 |
JavaWindowGroup addView:aView. |
|
2143 |
||
2144 |
KnownWindows isNil ifTrue:[ |
|
284 | 2145 |
KnownWindows := IdentityDictionary new. |
253 | 2146 |
]. |
2147 |
KnownWindows at:aJavaPeer put:aView. |
|
2148 |
||
284 | 2149 |
FirstWindowCreationSemaphore signalIf. |
2150 |
||
261 | 2151 |
"/'*** ' print. aJavaPeer print. ' -> ' print. aView printCR. |
2152 |
"/(aView isKindOf:ModalBox) ifTrue:[ |
|
2153 |
"/ self halt. |
|
2154 |
"/]. |
|
2155 |
||
253 | 2156 |
"Created: / 4.1.1998 / 17:57:16 / cg" |
284 | 2157 |
"Modified: / 28.1.1998 / 22:40:19 / cg" |
253 | 2158 |
! |
2159 |
||
255 | 2160 |
gcForWGraphics:nativeContext |
270 | 2161 |
|jGraphics gc orgX orgY trans| |
255 | 2162 |
|
2163 |
jGraphics := nativeContext receiver. |
|
459 | 2164 |
O_WGgraphics_pData isNil ifTrue:[ |
2165 |
O_WGgraphics_pData := (jGraphics class instVarOffsetOf:'pData'). |
|
2166 |
]. |
|
2167 |
O_WGgraphics_originX isNil ifTrue:[ |
|
2168 |
O_WGgraphics_originX := (jGraphics class instVarOffsetOf:'originX'). |
|
2169 |
]. |
|
2170 |
O_WGgraphics_originY isNil ifTrue:[ |
|
2171 |
O_WGgraphics_originY := (jGraphics class instVarOffsetOf:'originY'). |
|
2172 |
]. |
|
2173 |
gc := jGraphics instVarAt:O_WGgraphics_pData. |
|
270 | 2174 |
|
2175 |
trans := gc translation. |
|
459 | 2176 |
orgX := jGraphics instVarAt:O_WGgraphics_originX. |
2177 |
orgY := jGraphics instVarAt:O_WGgraphics_originY. |
|
270 | 2178 |
((orgX ~~ trans x) or:[orgY ~~ trans y]) ifTrue:[ |
2179 |
gc translation:orgX@orgY |
|
2180 |
]. |
|
255 | 2181 |
^ gc |
2182 |
||
2183 |
"Created: / 8.1.1998 / 00:16:38 / cg" |
|
459 | 2184 |
"Modified: / 19.11.1998 / 01:44:12 / cg" |
255 | 2185 |
! |
2186 |
||
261 | 2187 |
jPeerForView:aView |
2188 |
^ KnownWindows keyAtValue:aView ifAbsent:nil |
|
2189 |
||
2190 |
"Created: / 15.1.1998 / 13:48:01 / cg" |
|
2191 |
"Modified: / 15.1.1998 / 13:48:43 / cg" |
|
2192 |
! |
|
2193 |
||
255 | 2194 |
pReshape:nativeContext |
2195 |
|jFramePeer view x y width height menu| |
|
2196 |
||
2197 |
jFramePeer := nativeContext receiver. |
|
2198 |
view := jFramePeer instVarNamed:'pData'. |
|
2199 |
||
2200 |
x := nativeContext argAt:1. |
|
2201 |
y := nativeContext argAt:2. |
|
2202 |
width := nativeContext argAt:3. |
|
2203 |
height := nativeContext argAt:4. |
|
2204 |
||
2205 |
"/ 'pReshape ' print. view print. |
|
2206 |
"/ ' ' print. x print. '/' print. y print. |
|
2207 |
"/ ' extent: ' print. width print. '/' print. height printNL. |
|
2208 |
||
2209 |
(view isTopView |
|
2210 |
or:[view isMemberOf:JavaEmbeddedFrameView]) ifTrue:[ |
|
261 | 2211 |
"/ |
2212 |
"/ dont allow setting the origin |
|
2213 |
"/ |
|
2214 |
menu := self topViewsMenu:view. |
|
2215 |
menu notNil ifTrue:[ |
|
2216 |
"/ must add the menus height |
|
2217 |
height := height + menu height |
|
2218 |
]. |
|
2219 |
view extent:width@height. |
|
255 | 2220 |
] ifFalse:[ |
261 | 2221 |
(view superView notNil |
2222 |
and:[view superView isTopView]) ifTrue:[ |
|
2223 |
menu := self topViewsMenu:view superView. |
|
2224 |
menu notNil ifTrue:[ |
|
2225 |
"/ must add menus height to yPos |
|
2226 |
y := y + menu height. |
|
2227 |
] |
|
2228 |
]. |
|
2229 |
view origin:x@y extent:width@height. |
|
255 | 2230 |
]. |
2231 |
||
2232 |
^ nil |
|
2233 |
||
2234 |
"Modified: / 21.8.1997 / 19:34:16 / cg" |
|
2235 |
"Created: / 7.1.1998 / 21:47:11 / cg" |
|
2236 |
! |
|
2237 |
||
253 | 2238 |
topViewsMenu:view |
2239 |
|idx| |
|
2240 |
||
2241 |
view isTopView ifTrue:[ |
|
261 | 2242 |
view subViews size > 0 ifTrue:[ |
2243 |
(idx := view subViews findFirst:[:v | v isMemberOf:MenuPanel]) ~~ 0 ifTrue:[ |
|
2244 |
"/ must add the menus height |
|
2245 |
^ view subViews at:idx |
|
2246 |
] |
|
2247 |
]. |
|
253 | 2248 |
]. |
2249 |
^ nil |
|
2250 |
||
2251 |
"Modified: / 4.8.1997 / 01:23:06 / cg" |
|
2252 |
"Created: / 4.1.1998 / 18:01:42 / cg" |
|
255 | 2253 |
! |
2254 |
||
2255 |
viewForWPeer:nativeContext |
|
459 | 2256 |
|jPeer| |
255 | 2257 |
|
2258 |
jPeer := nativeContext receiver. |
|
277 | 2259 |
|
2260 |
"/ sigh; pData was renamed to pNativeWidget in jdk1.2 ... |
|
459 | 2261 |
O_FramePeer_pNativeWidget isNil ifTrue:[ |
2262 |
O_FramePeer_pNativeWidget := (jPeer class instVarOffsetOf:'pNativeWidget'). |
|
2263 |
O_FramePeer_pNativeWidget isNil ifTrue:[ |
|
2264 |
O_FramePeer_pNativeWidget := 0. |
|
2265 |
O_FramePeer_pData isNil ifTrue:[ |
|
2266 |
O_FramePeer_pData := (jPeer class instVarOffsetOf:'pData'). |
|
2267 |
]. |
|
2268 |
] |
|
2269 |
]. |
|
2270 |
O_FramePeer_pNativeWidget > 0 ifTrue:[ |
|
277 | 2271 |
"/ ok, we are < 1.2 |
459 | 2272 |
^ jPeer instVarAt:O_FramePeer_pNativeWidget. |
2273 |
]. |
|
2274 |
^ jPeer instVarAt:O_FramePeer_pData. |
|
2275 |
||
2276 |
"Modified: / 19.11.1998 / 01:43:20 / cg" |
|
253 | 2277 |
! ! |
2278 |
||
2279 |
!JavaVM class methodsFor:'helpers - exceptions'! |
|
2280 |
||
261 | 2281 |
throwArrayIndexOutOfBoundsException:badIndex |
2282 |
|exClass ex| |
|
2283 |
||
2284 |
"/ self |
|
2285 |
"/ throwExceptionClassName:'java.lang.ArrayIndexOutOfBoundsException' |
|
2286 |
"/ withMessage:'bad array index: ' , badIndex printString |
|
2287 |
||
2288 |
exClass := Java classForName:'java.lang.ArrayIndexOutOfBoundsException'. |
|
459 | 2289 |
ex := exClass newWith_int:badIndex. |
261 | 2290 |
|
2291 |
self throwException:ex |
|
2292 |
||
2293 |
"Created: / 14.1.1998 / 21:36:05 / cg" |
|
459 | 2294 |
"Modified: / 20.11.1998 / 13:27:14 / cg" |
261 | 2295 |
! |
2296 |
||
253 | 2297 |
throwClassNotFoundException |
255 | 2298 |
self |
261 | 2299 |
throwExceptionClassName:'java.lang.ClassNotFoundException' |
2300 |
withMessage:'no such class' |
|
255 | 2301 |
|
253 | 2302 |
"Created: / 4.1.1998 / 22:25:26 / cg" |
255 | 2303 |
"Modified: / 7.1.1998 / 15:25:35 / cg" |
253 | 2304 |
! |
2305 |
||
2306 |
throwClassNotFoundException:className |
|
255 | 2307 |
self |
429 | 2308 |
throwExceptionClassName:'java.lang.ClassNotFoundException' |
2309 |
withMessage:'no such class: ' , className |
|
255 | 2310 |
|
253 | 2311 |
"Created: / 4.1.1998 / 22:26:09 / cg" |
429 | 2312 |
"Modified: / 10.11.1998 / 13:20:31 / cg" |
255 | 2313 |
! |
2314 |
||
2315 |
throwException:aJavaException |
|
459 | 2316 |
|con jMsg msg exClass srchCon handlerContext handlerPC method pc hPC| |
255 | 2317 |
|
2318 |
ExceptionTrace ifTrue:[ |
|
347 | 2319 |
'JAVA: exception: ' print. aJavaException class fullName printCR. |
255 | 2320 |
]. |
2321 |
ExceptionDebug ifTrue:[ |
|
347 | 2322 |
self halt:('JAVA: exception: ' , aJavaException class fullName). |
448 | 2323 |
"/ self internalError:('JAVA: exception: ' , aJavaException class fullName). |
255 | 2324 |
]. |
2325 |
||
459 | 2326 |
"/ |
2327 |
"/ search stack for a javaContext which handles that exception |
|
2328 |
"/ |
|
2329 |
srchCon := thisContext sender. |
|
2330 |
[handlerContext isNil and:[srchCon notNil]] whileTrue:[ |
|
2331 |
(srchCon isJavaContext) ifTrue:[ |
|
2332 |
method := srchCon method. |
|
2333 |
pc := srchCon pc. |
|
2334 |
(hPC := method handlerFor:aJavaException at:pc) notNil ifTrue:[ |
|
2335 |
handlerPC := hPC. |
|
2336 |
handlerContext := srchCon |
|
2337 |
]. |
|
2338 |
]. |
|
2339 |
srchCon := srchCon sender. |
|
2340 |
]. |
|
2341 |
||
2342 |
handlerContext isNil ifTrue:[ |
|
2343 |
"/ |
|
2344 |
"/ no JavaHandler ... let smalltalk handle it |
|
2345 |
"/ |
|
347 | 2346 |
exClass := aJavaException class. |
459 | 2347 |
msg := 'Java ' , exClass name. |
347 | 2348 |
jMsg := aJavaException instVarNamed:'detailMessage'. |
2349 |
jMsg notNil ifTrue:[ |
|
459 | 2350 |
msg := msg , ': ' , (Java as_ST_String:jMsg). |
347 | 2351 |
]. |
2352 |
||
459 | 2353 |
"/ for our convenience: skip ST contexts |
2354 |
"/ (i.e. the handler or debugger will see the javaContext first ) |
|
2355 |
||
347 | 2356 |
con := thisContext sender. |
2357 |
[con isNil or:[con isJavaContext]] whileFalse:[ |
|
2358 |
con := con sender |
|
2359 |
]. |
|
2360 |
con isNil ifTrue:[con := thisContext sender]. |
|
2361 |
||
2362 |
JavaVM javaExceptionSignal |
|
2363 |
raiseWith:aJavaException |
|
2364 |
errorString:msg |
|
2365 |
in:con. |
|
2366 |
Processor activeProcess terminate. |
|
459 | 2367 |
] ifFalse:[ |
2368 |
"/ |
|
2369 |
"/ found a java exceptionHandler |
|
2370 |
"/ |
|
2371 |
handlerContext setPC:handlerPC. |
|
2372 |
handlerContext exceptionArg:aJavaException. |
|
2373 |
handlerContext markForException. |
|
2374 |
handlerContext unwindAndRestart. |
|
2375 |
self halt:'should not be reached'. |
|
2376 |
Processor activeProcess terminate. |
|
2377 |
]. |
|
255 | 2378 |
|
2379 |
"Created: / 7.1.1998 / 15:28:22 / cg" |
|
459 | 2380 |
"Modified: / 20.11.1998 / 13:25:22 / cg" |
255 | 2381 |
! |
2382 |
||
2383 |
throwExceptionClassName:aJavaExceptionClassName withMessage:someMessage |
|
261 | 2384 |
|exClass ex| |
2385 |
||
2386 |
exClass := Java classForName:aJavaExceptionClassName. |
|
2387 |
ex := exClass newCleared. |
|
2388 |
ex perform:#'<init>(Ljava/lang/String;)V' with:(Java as_String:someMessage). |
|
2389 |
||
2390 |
"/ ex := exClass new. |
|
2391 |
"/ ex instVarNamed:'detailMessage' put:(Java as_String:someMessage). |
|
255 | 2392 |
|
2393 |
self throwException:ex |
|
2394 |
||
2395 |
"Created: / 7.1.1998 / 15:25:09 / cg" |
|
261 | 2396 |
"Modified: / 14.1.1998 / 23:38:30 / cg" |
255 | 2397 |
! |
2398 |
||
2399 |
throwIOExceptionWithMessage:message |
|
2400 |
self |
|
261 | 2401 |
throwExceptionClassName:'java.io.IOException' |
2402 |
withMessage:message |
|
255 | 2403 |
|
2404 |
"Created: / 7.1.1998 / 10:34:24 / cg" |
|
2405 |
"Modified: / 7.1.1998 / 15:26:25 / cg" |
|
2406 |
! |
|
2407 |
||
261 | 2408 |
throwIllegalAccessException |
2409 |
self |
|
270 | 2410 |
throwExceptionClassName:'java.lang.IllegalAccessException' |
2411 |
withMessage:'illegal access' |
|
261 | 2412 |
|
2413 |
"Modified: / 7.1.1998 / 15:25:35 / cg" |
|
2414 |
"Created: / 14.1.1998 / 23:13:44 / cg" |
|
2415 |
! |
|
2416 |
||
2417 |
throwInstantiationException |
|
2418 |
self |
|
270 | 2419 |
throwExceptionClassName:'java.lang.InstantiationException' |
2420 |
withMessage:'cannot instantiate' |
|
261 | 2421 |
|
2422 |
"Modified: / 7.1.1998 / 15:25:35 / cg" |
|
2423 |
"Created: / 14.1.1998 / 23:15:01 / cg" |
|
2424 |
! |
|
2425 |
||
2426 |
throwInstantiationExceptionFor:aJavaClass |
|
2427 |
self |
|
270 | 2428 |
throwExceptionClassName:'java.lang.InstantiationException' |
2429 |
withMessage:('cannot instantiate ' , aJavaClass fullName) |
|
261 | 2430 |
|
2431 |
"Modified: / 7.1.1998 / 15:25:35 / cg" |
|
2432 |
"Created: / 14.1.1998 / 23:17:02 / cg" |
|
2433 |
! |
|
2434 |
||
255 | 2435 |
throwNullPointerException |
280 | 2436 |
self halt:'null pointer exception'. |
255 | 2437 |
self |
280 | 2438 |
throwExceptionClassName:'java.lang.NullPointerException' |
2439 |
withMessage:'null pointer' |
|
2440 |
||
255 | 2441 |
"Created: / 9.1.1998 / 02:26:08 / cg" |
280 | 2442 |
"Modified: / 28.1.1998 / 02:30:09 / cg" |
255 | 2443 |
! |
2444 |
||
2445 |
throwNumberFormatException |
|
2446 |
self |
|
261 | 2447 |
throwExceptionClassName:'java.lang.NumberFormatException' |
2448 |
withMessage:'bad number format' |
|
255 | 2449 |
|
2450 |
"Modified: / 7.1.1998 / 15:25:35 / cg" |
|
2451 |
"Created: / 11.1.1998 / 16:08:22 / cg" |
|
253 | 2452 |
! ! |
2453 |
||
2454 |
!JavaVM class methodsFor:'helpers - io'! |
|
2455 |
||
307 | 2456 |
anyStream_close:nativeContext |
2457 |
|jStream fileNo file| |
|
2458 |
||
2459 |
jStream := nativeContext receiver. |
|
2460 |
||
2461 |
fileNo := self validateFileNo:jStream. |
|
261 | 2462 |
fileNo == 0 ifTrue:[ |
280 | 2463 |
'JAVA: file is already closed' errorPrintCR. |
2464 |
^ self "/ already closed |
|
261 | 2465 |
]. |
253 | 2466 |
file := self getOpenFileAt:fileNo. |
2467 |
file isNil ifTrue:[ |
|
280 | 2468 |
self halt:'invalid fileNo in close'. |
2469 |
self internalError:'invalid fileNo in close'. |
|
2470 |
^ self |
|
253 | 2471 |
]. |
2472 |
||
2473 |
"/ should always be bytes |
|
2474 |
||
2475 |
(file ~~ Stdin |
|
2476 |
and:[file ~~ Stdout |
|
280 | 2477 |
and:[file ~~ Stderr |
2478 |
and:[file ~~ Transcript]]]) ifTrue:[ |
|
2479 |
file close. |
|
253 | 2480 |
]. |
2481 |
self setOpenFile:nil at:fileNo. |
|
2482 |
||
307 | 2483 |
fileNo := jStream instVarNamed:'fd'. |
261 | 2484 |
fileNo isInteger ifFalse:[ |
280 | 2485 |
"/ JDK 1.1.3 |
2486 |
fileNo instVarNamed:'fd' put:0. |
|
261 | 2487 |
] ifTrue:[ |
280 | 2488 |
"/ JDK 1.0 |
307 | 2489 |
jStream instVarNamed:'fd' put:0 |
2490 |
]. |
|
2491 |
||
2492 |
"Created: / 4.2.1998 / 15:22:03 / cg" |
|
374 | 2493 |
"Modified: / 14.10.1998 / 15:10:07 / cg" |
307 | 2494 |
! |
2495 |
||
2496 |
anyStream_readBytes:nativeContext |
|
2497 |
|bytes offset count stream nRead| |
|
2498 |
||
2499 |
bytes := nativeContext argAt:1. |
|
2500 |
offset := nativeContext argAt:2. |
|
2501 |
count := nativeContext argAt:3. |
|
2502 |
||
2503 |
stream := self validateFile:(nativeContext receiver). |
|
2504 |
||
2505 |
"/ should always be bytes |
|
2506 |
bytes class isBytes ifFalse:[ |
|
2507 |
self halt. |
|
2508 |
]. |
|
2509 |
stream == Stdin ifTrue:[ |
|
2510 |
self halt:'reading from standardInput ...'. |
|
432 | 2511 |
^ -1 "/ 0 |
307 | 2512 |
]. |
2513 |
||
2514 |
FileIOTrace ifTrue:[ |
|
2515 |
('JAVA: read ' , count printString , ' bytes from ' , stream pathName) infoPrintCR. |
|
2516 |
]. |
|
2517 |
||
2518 |
stream isPositionable ifFalse:[ |
|
2519 |
"/ mhmh - some kind of socket or pipe |
|
2520 |
||
2521 |
stream readWait. |
|
2522 |
]. |
|
2523 |
||
2524 |
Stream readErrorSignal handle:[:ex | |
|
2525 |
nRead := -1 |
|
2526 |
] do:[ |
|
2527 |
nRead := stream nextAvailableBytes:count into:bytes startingAt:offset+1. |
|
2528 |
]. |
|
2529 |
nRead == 0 ifTrue:[ |
|
2530 |
stream atEnd ifTrue:[ |
|
2531 |
FileIOTrace ifTrue:[ |
|
2532 |
('JAVA: at EOF ' , nRead printString) infoPrintCR. |
|
2533 |
]. |
|
2534 |
^ -1 |
|
2535 |
]. |
|
2536 |
]. |
|
2537 |
count ~~ nRead ifTrue:[ |
|
2538 |
FileIOTrace ifTrue:[ |
|
2539 |
('JAVA: only got ' , nRead printString) infoPrintCR. |
|
2540 |
] |
|
2541 |
]. |
|
2542 |
^ nRead |
|
2543 |
||
2544 |
"Created: / 4.2.1998 / 15:20:00 / cg" |
|
432 | 2545 |
"Modified: / 10.11.1998 / 19:56:47 / cg" |
307 | 2546 |
! |
2547 |
||
2548 |
anyStream_writeBytes:nativeContext |
|
2549 |
|bytes offset count stream| |
|
2550 |
||
2551 |
bytes := nativeContext argAt:1. |
|
2552 |
offset := nativeContext argAt:2. |
|
2553 |
count := nativeContext argAt:3. |
|
2554 |
||
2555 |
stream := self validateFile:(nativeContext receiver). |
|
2556 |
||
2557 |
FileIOTrace ifTrue:[ |
|
2558 |
stream isFileStream ifTrue:[ |
|
2559 |
('JAVA: write ' , count printString , ' bytes to ' , stream pathName) infoPrintCR. |
|
2560 |
] ifFalse:[ |
|
2561 |
stream ~~ Stdout ifTrue:[ |
|
2562 |
stream ~~ Stderr ifTrue:[ |
|
2563 |
('JAVA: write ' , count printString , ' bytes to ' , stream displayString) infoPrintCR. |
|
2564 |
] |
|
2565 |
] |
|
2566 |
] |
|
2567 |
]. |
|
2568 |
||
2569 |
"/ should always be bytes |
|
2570 |
Stream writeErrorSignal handle:[:ex | |
|
2571 |
ex return |
|
2572 |
] do:[ |
|
2573 |
Socket brokenConnectionSignal handle:[:ex | |
|
2574 |
ex return |
|
2575 |
] do:[ |
|
2576 |
stream nextPutBytes:count from:bytes startingAt:offset+1 |
|
2577 |
] |
|
2578 |
]. |
|
2579 |
||
2580 |
"Created: / 4.2.1998 / 15:23:58 / cg" |
|
2581 |
"Modified: / 4.2.1998 / 19:38:26 / cg" |
|
261 | 2582 |
! |
2583 |
||
331 | 2584 |
commonOpen:nativeContext forAppend:forAppend |
442 | 2585 |
|fs fd fn name dir stream fileNo answer readonly| |
331 | 2586 |
|
2587 |
fs := nativeContext receiver. |
|
2588 |
fd := fs instVarNamed:'fd'. |
|
2589 |
(fd instVarNamed:'fd') ~~ 0 ifTrue:[ |
|
2590 |
self halt:'file already open'. |
|
2591 |
self internalError:'file already open'. |
|
2592 |
^ self. |
|
2593 |
]. |
|
2594 |
||
2595 |
name := nativeContext argAt:1. |
|
2596 |
name := Java as_ST_String:name. |
|
2597 |
||
2598 |
FileOpenTrace ifTrue:[ |
|
2599 |
('JAVA: opening ' , name) infoPrintCR. |
|
2600 |
]. |
|
2601 |
||
2602 |
fn := name asFilename. |
|
2603 |
dir := fn directory pathName. |
|
442 | 2604 |
|
331 | 2605 |
(PermittedDirectories notNil |
2606 |
and:[PermittedDirectories includes:dir]) ifFalse:[ |
|
2607 |
FileOpenConfirmation ifTrue:[ |
|
442 | 2608 |
answer := Dialog |
2609 |
confirmWithCancel:('JAVA Security check\\Opening ''' , name , ''' for read/write.\Grant permission ?') withCRs |
|
2610 |
labels:#('no' 'grant' 'readonly') |
|
2611 |
values:#(false true #readonly) |
|
2612 |
default:3. |
|
2613 |
answer == false ifTrue:[ |
|
331 | 2614 |
self throwIOExceptionWithMessage:('no permission to open ' , name , ' for writing'). |
2615 |
^ self |
|
2616 |
]. |
|
442 | 2617 |
readonly := (answer == #readonly). |
2618 |
||
2619 |
readonly ifFalse:[ |
|
2620 |
(self confirm:('JAVA Security check\\Always permit writes in this directory (''' , dir , ''') ?') withCRs) |
|
2621 |
ifTrue:[ |
|
2622 |
PermittedDirectories isNil ifTrue:[ |
|
2623 |
PermittedDirectories := Set new |
|
2624 |
]. |
|
2625 |
PermittedDirectories add:dir. |
|
2626 |
] |
|
331 | 2627 |
] |
2628 |
] |
|
2629 |
]. |
|
2630 |
||
442 | 2631 |
readonly ifTrue:[ |
2632 |
stream := fn readStream. |
|
331 | 2633 |
] ifFalse:[ |
442 | 2634 |
forAppend ifTrue:[ |
2635 |
stream := fn appendingWriteStream. |
|
2636 |
] ifFalse:[ |
|
2637 |
stream := fn writeStream. |
|
2638 |
] |
|
331 | 2639 |
]. |
2640 |
stream isNil ifTrue:[ |
|
2641 |
self throwIOExceptionWithMessage:('cannot open ' , name , ' for writing'). |
|
2642 |
]. |
|
2643 |
||
2644 |
fileNo := self addOpenFile:stream. |
|
2645 |
||
2646 |
FileOpenTrace ifTrue:[ |
|
2647 |
('JAVA: opened ' , name , ' as FD ' , fileNo printString , ' for writing') infoPrintCR. |
|
2648 |
]. |
|
2649 |
||
2650 |
fd instVarNamed:'fd' put:fileNo. |
|
2651 |
||
2652 |
"Created: / 7.4.1998 / 19:14:09 / cg" |
|
442 | 2653 |
"Modified: / 12.11.1998 / 21:31:24 / cg" |
331 | 2654 |
! |
2655 |
||
261 | 2656 |
fileStreamForReading:name |
2657 |
|fn stream tryAlongClassPath| |
|
2658 |
||
2659 |
fn := name asFilename. |
|
2660 |
stream := fn readStream. |
|
2661 |
stream notNil ifTrue:[^ stream]. |
|
2662 |
||
2663 |
fn isAbsolute ifFalse:[ |
|
405 | 2664 |
"/ if not absolute, try along classPath |
2665 |
"/ This allows classes to open local files (JEdit) |
|
2666 |
"/ even if they have NOT been loaded by a Java classLoader. |
|
2667 |
"/ Only do this for image files |
|
2668 |
"/ (and maybe some other config files in the future), |
|
2669 |
"/ to avoid security holes. |
|
2670 |
tryAlongClassPath := true. |
|
2671 |
"/ tryAlongClassPath := false. |
|
2672 |
"/ (fn hasSuffix:'gif') ifTrue:[ |
|
2673 |
"/ tryAlongClassPath := true. |
|
2674 |
"/ ]. |
|
2675 |
"/ (fn hasSuffix:'jpg') ifTrue:[ |
|
2676 |
"/ tryAlongClassPath := true. |
|
2677 |
"/ ]. |
|
2678 |
||
2679 |
tryAlongClassPath ifTrue:[ |
|
2680 |
Java classPath do:[:dirName | |
|
2681 |
|fn| |
|
2682 |
||
2683 |
(fn := dirName asFilename construct:name) exists ifTrue:[ |
|
2684 |
stream := fn readStream. |
|
2685 |
stream notNil ifTrue:[^ stream]. |
|
2686 |
] |
|
2687 |
] |
|
2688 |
] |
|
261 | 2689 |
]. |
2690 |
^ nil. |
|
2691 |
||
405 | 2692 |
"Modified: / 21.10.1998 / 01:38:50 / cg" |
2693 |
! |
|
2694 |
||
2695 |
fixFilename:path |
|
2696 |
OperatingSystem isMSDOSlike ifTrue:[ |
|
2697 |
(#($/ $\) includes:(path at:1)) ifTrue:[ |
|
2698 |
(path at:3) == $: ifTrue:[ |
|
2699 |
^ path copyFrom:2 |
|
2700 |
] |
|
2701 |
] |
|
2702 |
]. |
|
2703 |
^ path |
|
2704 |
||
2705 |
"Created: / 20.10.1998 / 20:58:45 / cg" |
|
2706 |
"Modified: / 20.10.1998 / 21:06:49 / cg" |
|
253 | 2707 |
! |
2708 |
||
2709 |
validateFile:javaStream |
|
2710 |
|fileNo file descriptor| |
|
2711 |
||
2712 |
fileNo := self validateFileNo:javaStream. |
|
2713 |
fileNo isNil ifTrue:[ |
|
2714 |
"/ self halt:'invalid fileNo in read'. |
|
2715 |
"/ self internalError:'invalid fileNo in read'. |
|
261 | 2716 |
self throwIOExceptionWithMessage:'invalid fileNo in read'. |
2717 |
^ nil |
|
253 | 2718 |
]. |
2719 |
||
2720 |
file := self getOpenFileAt:fileNo. |
|
2721 |
||
2722 |
file isNil ifTrue:[ |
|
2723 |
"/ self halt:'invalid fileNo in read'. |
|
2724 |
"/ self internalError:'invalid fileNo in read'. |
|
261 | 2725 |
self throwIOExceptionWithMessage:'invalid fileNo in read'. |
2726 |
^ nil |
|
253 | 2727 |
]. |
2728 |
||
2729 |
^ file |
|
2730 |
||
2731 |
"Created: / 4.1.1998 / 16:50:38 / cg" |
|
2732 |
"Modified: / 4.1.1998 / 17:50:00 / cg" |
|
2733 |
! |
|
2734 |
||
2735 |
validateFileNo:javaStream |
|
2736 |
|fileNo file descriptor| |
|
2737 |
||
261 | 2738 |
"/ JDK 1.1.3 has fileDescriptor wrapped |
2739 |
"/ JDK 1.0 has it directly as integer |
|
2740 |
||
253 | 2741 |
fileNo := javaStream instVarNamed:'fd'. |
2742 |
fileNo isInteger ifFalse:[ |
|
261 | 2743 |
descriptor := fileNo. |
2744 |
fileNo := descriptor instVarNamed:'fd'. |
|
253 | 2745 |
]. |
2746 |
||
2747 |
fileNo isInteger ifFalse:[ |
|
2748 |
"/ self halt:'invalid fileNo in read'. |
|
2749 |
"/ self internalError:'invalid fileNo in read'. |
|
261 | 2750 |
self throwIOExceptionWithMessage:'invalid fileNo in read'. |
2751 |
^ nil |
|
253 | 2752 |
]. |
2753 |
||
2754 |
^ fileNo. |
|
2755 |
||
2756 |
"Created: / 4.1.1998 / 17:49:08 / cg" |
|
261 | 2757 |
"Modified: / 13.1.1998 / 14:07:47 / cg" |
253 | 2758 |
! ! |
2759 |
||
440 | 2760 |
!JavaVM class methodsFor:'native - java.awt.image'! |
2761 |
||
2762 |
_ColorModel_deletepData:nativeContext |
|
2763 |
"/ void deletepData () |
|
2764 |
UnimplementedNativeMethodSignal raise |
|
2765 |
||
2766 |
"Created: / 12.11.1998 / 19:22:05 / cg" |
|
2767 |
! ! |
|
2768 |
||
253 | 2769 |
!JavaVM class methodsFor:'native - java.io'! |
2770 |
||
2771 |
_FileDescriptor_initSystemFD:nativeContext |
|
2772 |
|descriptor fileNo idx myStream| |
|
2773 |
||
2774 |
descriptor := nativeContext argAt:1. |
|
2775 |
fileNo := nativeContext argAt:2. |
|
2776 |
||
2777 |
fileNo == 0 ifTrue:[ |
|
277 | 2778 |
myStream := Stdin |
253 | 2779 |
] ifFalse:[ |
277 | 2780 |
fileNo == 1 ifTrue:[ |
2781 |
myStream := JavaConsoleStream ? Stdout |
|
2782 |
] ifFalse:[ |
|
2783 |
fileNo == 2 ifTrue:[ |
|
2784 |
myStream := JavaConsoleStream ? Stderr |
|
2785 |
] ifFalse:[ |
|
2786 |
self halt:'invalid fileNo given'. |
|
2787 |
self internalError:'invalid fileNo given'. |
|
2788 |
] |
|
2789 |
] |
|
253 | 2790 |
]. |
2791 |
||
2792 |
self setOpenFile:myStream at:fileNo. |
|
2793 |
||
2794 |
descriptor instVarNamed:'fd' put:fileNo. |
|
2795 |
^ descriptor |
|
2796 |
||
277 | 2797 |
"Modified: / 27.1.1998 / 18:15:28 / cg" |
253 | 2798 |
! |
2799 |
||
440 | 2800 |
_FileDescriptor_sync:nativeContext |
2801 |
"/ void sync () |
|
2802 |
UnimplementedNativeMethodSignal raise |
|
2803 |
||
2804 |
"Modified: / 12.11.1998 / 18:57:39 / cg" |
|
2805 |
"Created: / 12.11.1998 / 19:26:25 / cg" |
|
2806 |
! |
|
2807 |
||
2808 |
_FileDescriptor_valid:nativeContext |
|
2809 |
"/ boolean valid () |
|
2810 |
UnimplementedNativeMethodSignal raise |
|
2811 |
||
2812 |
"Modified: / 12.11.1998 / 18:57:39 / cg" |
|
2813 |
! |
|
2814 |
||
261 | 2815 |
_FileInputStream_available:nativeContext |
2816 |
|file| |
|
2817 |
||
2818 |
file := self validateFile:(nativeContext receiver). |
|
2819 |
file isNil ifTrue:[ |
|
2820 |
self throwIOExceptionWithMessage:'invalid fileNo in available'. |
|
2821 |
^ self |
|
2822 |
]. |
|
2823 |
file isFileStream ifTrue:[ |
|
2824 |
^ file size - file position + 1 |
|
2825 |
]. |
|
2826 |
file atEnd ifTrue:[ |
|
2827 |
^ 0. |
|
2828 |
]. |
|
2829 |
self halt. |
|
2830 |
^ 1 |
|
2831 |
||
2832 |
"Modified: / 14.1.1998 / 15:12:52 / cg" |
|
2833 |
! |
|
2834 |
||
253 | 2835 |
_FileInputStream_close:nativeContext |
307 | 2836 |
^ self anyStream_close:nativeContext |
2837 |
||
253 | 2838 |
"Created: / 4.1.1998 / 17:45:23 / cg" |
307 | 2839 |
"Modified: / 4.2.1998 / 15:20:46 / cg" |
253 | 2840 |
! |
2841 |
||
2842 |
_FileInputStream_open:nativeContext |
|
261 | 2843 |
|fs fd fn name stream fileNo| |
253 | 2844 |
|
2845 |
fs := nativeContext receiver. |
|
2846 |
fd := fs instVarNamed:'fd'. |
|
277 | 2847 |
(fileNo := fd instVarNamed:'fd') ~~ 0 ifTrue:[ |
2848 |
fileNo ~~ -1 ifTrue:[ |
|
2849 |
self halt:'file already open'. |
|
2850 |
self internalError:'file already open'. |
|
2851 |
^ self. |
|
2852 |
] |
|
253 | 2853 |
]. |
2854 |
||
2855 |
name := nativeContext argAt:1. |
|
2856 |
name := Java as_ST_String:name. |
|
2857 |
||
405 | 2858 |
name := self fixFilename:name. |
2859 |
||
253 | 2860 |
FileOpenTrace ifTrue:[ |
277 | 2861 |
('JAVA: opening ' , name) infoPrintCR. |
253 | 2862 |
]. |
2863 |
||
261 | 2864 |
stream := self fileStreamForReading:name. |
253 | 2865 |
stream isNil ifTrue:[ |
277 | 2866 |
FileOpenTrace ifTrue:[ |
2867 |
('JAVA: failed to open ' , name , ' for reading.') infoPrintCR. |
|
2868 |
]. |
|
2869 |
||
2870 |
self throwIOExceptionWithMessage:('cannot open ' , name , ' for reading'). |
|
2871 |
||
2872 |
^ self. |
|
253 | 2873 |
]. |
304 | 2874 |
stream buffered:false. |
253 | 2875 |
|
261 | 2876 |
"/ FileOpenConfirmation ifTrue:[ |
2877 |
"/ (self confirm:('JAVA Security check\\Opening ''' , name , ''' for reading.\Grant permission ?') withCRs) |
|
2878 |
"/ ifFalse:[ |
|
2879 |
"/ self throwIOExceptionWithMessage:('no permission to open ' , name , ' for reading'). |
|
2880 |
"/ ^ self |
|
2881 |
"/ ] |
|
2882 |
"/ ]. |
|
2883 |
||
253 | 2884 |
fileNo := self addOpenFile:stream. |
2885 |
||
2886 |
FileOpenTrace ifTrue:[ |
|
277 | 2887 |
('JAVA: opened ' , name , ' as FD ' , fileNo printString) infoPrintCR. |
253 | 2888 |
]. |
2889 |
||
2890 |
fd instVarNamed:'fd' put:fileNo. |
|
2891 |
||
2892 |
"Created: / 4.1.1998 / 16:47:12 / cg" |
|
405 | 2893 |
"Modified: / 21.10.1998 / 01:40:00 / cg" |
253 | 2894 |
! |
2895 |
||
2896 |
_FileInputStream_read:nativeContext |
|
2897 |
|file byte| |
|
2898 |
||
2899 |
file := self validateFile:(nativeContext receiver). |
|
2900 |
||
2901 |
FileIOTrace ifTrue:[ |
|
261 | 2902 |
('JAVA: read 1 byte from ' , file pathName) infoPrintCR. |
253 | 2903 |
]. |
2904 |
||
2905 |
byte := file nextByte. |
|
2906 |
byte isNil ifTrue:[ |
|
261 | 2907 |
^ -1 |
253 | 2908 |
]. |
2909 |
^ byte |
|
2910 |
||
2911 |
"Created: / 5.1.1998 / 02:17:08 / cg" |
|
2912 |
"Modified: / 5.1.1998 / 02:17:25 / cg" |
|
2913 |
! |
|
2914 |
||
2915 |
_FileInputStream_readBytes:nativeContext |
|
307 | 2916 |
^ self anyStream_readBytes:nativeContext |
2917 |
||
2918 |
"Modified: / 4.2.1998 / 15:23:08 / cg" |
|
261 | 2919 |
! |
2920 |
||
440 | 2921 |
_FileInputStream_skip:nativeContext |
2922 |
"/ long skip (long) |
|
2923 |
UnimplementedNativeMethodSignal raise |
|
2924 |
||
2925 |
"Created: / 12.11.1998 / 18:57:12 / cg" |
|
2926 |
"Modified: / 12.11.1998 / 18:57:48 / cg" |
|
2927 |
! |
|
2928 |
||
261 | 2929 |
_FileOutputStream_close:nativeContext |
307 | 2930 |
^ self anyStream_close:nativeContext |
2931 |
||
261 | 2932 |
"Created: / 13.1.1998 / 09:33:16 / cg" |
307 | 2933 |
"Modified: / 4.2.1998 / 15:20:53 / cg" |
261 | 2934 |
! |
2935 |
||
2936 |
_FileOutputStream_open:nativeContext |
|
331 | 2937 |
^ self commonOpen:nativeContext forAppend:false |
2938 |
||
2939 |
"Modified: / 7.4.1998 / 19:14:31 / cg" |
|
2940 |
! |
|
2941 |
||
2942 |
_FileOutputStream_openAppend:nativeContext |
|
2943 |
^ self commonOpen:nativeContext forAppend:true |
|
2944 |
||
2945 |
"Modified: / 7.4.1998 / 19:13:42 / cg" |
|
261 | 2946 |
! |
2947 |
||
2948 |
_FileOutputStream_write:nativeContext |
|
2949 |
|byte file| |
|
2950 |
||
2951 |
byte := nativeContext argAt:1. |
|
2952 |
||
2953 |
file := self validateFile:(nativeContext receiver). |
|
2954 |
||
2955 |
FileIOTrace ifTrue:[ |
|
2956 |
file isFileStream ifTrue:[ |
|
2957 |
('JAVA: write 1 byte to ' , file pathName) infoPrintCR. |
|
2958 |
] ifFalse:[ |
|
2959 |
file ~~ Stdout ifTrue:[ |
|
2960 |
file ~~ Stderr ifTrue:[ |
|
2961 |
('JAVA: write 1 byte to ' , file displayString) infoPrintCR. |
|
2962 |
] |
|
2963 |
] |
|
2964 |
] |
|
2965 |
]. |
|
2966 |
||
2967 |
"/ should always be bytes |
|
2968 |
||
2969 |
file nextPutByte:byte |
|
2970 |
||
2971 |
"Created: / 13.1.1998 / 09:32:13 / cg" |
|
2972 |
"Modified: / 13.1.1998 / 09:32:31 / cg" |
|
253 | 2973 |
! |
2974 |
||
255 | 2975 |
_FileOutputStream_writeBytes:nativeContext |
307 | 2976 |
^ self anyStream_writeBytes:nativeContext |
2977 |
||
2978 |
"Modified: / 4.2.1998 / 15:24:20 / cg" |
|
255 | 2979 |
! |
2980 |
||
253 | 2981 |
_File_canRead0:nativeContext |
2982 |
|file path f| |
|
2983 |
||
2984 |
file := nativeContext receiver. |
|
2985 |
path := file instVarNamed:'path'. |
|
2986 |
path notNil ifTrue:[ |
|
405 | 2987 |
path := Java as_ST_String:path. |
2988 |
path := self fixFilename:path. |
|
2989 |
(f := path asFilename) isReadable ifTrue:[ |
|
2990 |
^ 1 "/ TRUE |
|
2991 |
] |
|
253 | 2992 |
]. |
255 | 2993 |
^ 0 "/ FALSE |
2994 |
||
253 | 2995 |
"Created: / 4.1.1998 / 18:09:55 / cg" |
405 | 2996 |
"Modified: / 20.10.1998 / 20:59:39 / cg" |
253 | 2997 |
! |
2998 |
||
307 | 2999 |
_File_canWrite0:nativeContext |
3000 |
|file path f| |
|
3001 |
||
3002 |
file := nativeContext receiver. |
|
3003 |
path := file instVarNamed:'path'. |
|
3004 |
path notNil ifTrue:[ |
|
3005 |
path := Java as_ST_String:path. |
|
405 | 3006 |
path := self fixFilename:path. |
307 | 3007 |
(f := path asFilename) isWritable ifTrue:[ |
3008 |
^ 1 "/ TRUE |
|
3009 |
] |
|
3010 |
]. |
|
3011 |
^ 0 "/ FALSE |
|
3012 |
||
3013 |
"Created: / 4.2.1998 / 00:19:55 / cg" |
|
405 | 3014 |
"Modified: / 20.10.1998 / 20:59:45 / cg" |
307 | 3015 |
! |
3016 |
||
440 | 3017 |
_File_delete0:nativeContext |
3018 |
"/ boolean delete0 () |
|
3019 |
UnimplementedNativeMethodSignal raise |
|
3020 |
||
3021 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3022 |
"Created: / 12.11.1998 / 19:03:42 / cg" |
|
3023 |
! |
|
3024 |
||
253 | 3025 |
_File_exists0:nativeContext |
3026 |
|file path f| |
|
3027 |
||
3028 |
file := nativeContext receiver. |
|
3029 |
path := file instVarNamed:'path'. |
|
3030 |
path notNil ifTrue:[ |
|
405 | 3031 |
path := Java as_ST_String:path. |
3032 |
path := self fixFilename:path. |
|
3033 |
(f := path asFilename) exists ifTrue:[ |
|
3034 |
^ 1 "TRUE" |
|
3035 |
] |
|
255 | 3036 |
]. |
3037 |
^ 0 "FALSE" |
|
3038 |
||
3039 |
"Created: / 5.1.1998 / 02:07:48 / cg" |
|
405 | 3040 |
"Modified: / 20.10.1998 / 20:59:49 / cg" |
255 | 3041 |
! |
3042 |
||
3043 |
_File_isAbsolute:nativeContext |
|
3044 |
|file path f| |
|
3045 |
||
3046 |
file := nativeContext receiver. |
|
3047 |
path := file instVarNamed:'path'. |
|
3048 |
path notNil ifTrue:[ |
|
405 | 3049 |
path := Java as_ST_String:path. |
3050 |
path := self fixFilename:path. |
|
3051 |
(f := path asFilename) isAbsolute ifTrue:[ |
|
3052 |
^ 1 "/ TRUE |
|
3053 |
] |
|
255 | 3054 |
]. |
3055 |
^ 0 "/ FALSE |
|
3056 |
||
3057 |
"Created: / 11.1.1998 / 09:54:38 / cg" |
|
405 | 3058 |
"Modified: / 20.10.1998 / 20:59:53 / cg" |
255 | 3059 |
! |
3060 |
||
3061 |
_File_isDirectory0:nativeContext |
|
3062 |
|file path f| |
|
3063 |
||
3064 |
file := nativeContext receiver. |
|
3065 |
path := file instVarNamed:'path'. |
|
3066 |
path notNil ifTrue:[ |
|
405 | 3067 |
path := Java as_ST_String:path. |
3068 |
path := self fixFilename:path. |
|
3069 |
(f := path asFilename) exists ifTrue:[ |
|
3070 |
f isDirectory ifTrue:[^ 1 "TRUE"] |
|
3071 |
] |
|
255 | 3072 |
]. |
3073 |
^ 0 "FALSE" |
|
3074 |
||
3075 |
"Created: / 7.1.1998 / 10:31:37 / cg" |
|
405 | 3076 |
"Modified: / 20.10.1998 / 20:59:56 / cg" |
255 | 3077 |
! |
3078 |
||
3079 |
_File_isFile0:nativeContext |
|
3080 |
|file path f| |
|
3081 |
||
3082 |
file := nativeContext receiver. |
|
3083 |
path := file instVarNamed:'path'. |
|
3084 |
path notNil ifTrue:[ |
|
405 | 3085 |
path := Java as_ST_String:path. |
3086 |
path := self fixFilename:path. |
|
3087 |
(f := path asFilename) exists ifTrue:[ |
|
3088 |
f isDirectory ifFalse:[^ 1 "TRUE"] |
|
3089 |
] |
|
255 | 3090 |
]. |
3091 |
^ 0 "/ FALSE |
|
3092 |
||
3093 |
"Created: / 11.1.1998 / 11:40:22 / cg" |
|
405 | 3094 |
"Modified: / 20.10.1998 / 21:00:00 / cg" |
255 | 3095 |
! |
3096 |
||
307 | 3097 |
_File_lastModified0:nativeContext |
3098 |
|file path f| |
|
3099 |
||
3100 |
file := nativeContext receiver. |
|
3101 |
path := file instVarNamed:'path'. |
|
3102 |
path notNil ifTrue:[ |
|
3103 |
path := Java as_ST_String:path. |
|
405 | 3104 |
path := self fixFilename:path. |
307 | 3105 |
(f := path asFilename) exists ifTrue:[ |
3106 |
^ f modificationTime getMilliseconds. |
|
3107 |
] |
|
3108 |
]. |
|
3109 |
^ 0 |
|
3110 |
||
3111 |
"Created: / 4.2.1998 / 16:50:30 / cg" |
|
405 | 3112 |
"Modified: / 20.10.1998 / 21:00:05 / cg" |
307 | 3113 |
! |
3114 |
||
255 | 3115 |
_File_length0:nativeContext |
3116 |
|file path f| |
|
3117 |
||
3118 |
file := nativeContext receiver. |
|
3119 |
path := file instVarNamed:'path'. |
|
3120 |
path notNil ifTrue:[ |
|
405 | 3121 |
path := Java as_ST_String:path. |
3122 |
path := self fixFilename:path. |
|
3123 |
(f := path asFilename) exists ifTrue:[ |
|
3124 |
^ f fileSize |
|
3125 |
] |
|
253 | 3126 |
]. |
261 | 3127 |
^ -1 |
3128 |
||
255 | 3129 |
"Created: / 7.1.1998 / 12:18:57 / cg" |
405 | 3130 |
"Modified: / 20.10.1998 / 21:00:18 / cg" |
261 | 3131 |
! |
3132 |
||
3133 |
_File_list0:nativeContext |
|
3134 |
|file path f files| |
|
3135 |
||
3136 |
file := nativeContext receiver. |
|
3137 |
path := file instVarNamed:'path'. |
|
3138 |
path notNil ifTrue:[ |
|
405 | 3139 |
path := Java as_ST_String:path. |
3140 |
path := self fixFilename:path. |
|
3141 |
(f := path asFilename) exists ifTrue:[ |
|
3142 |
f isDirectory ifTrue:[ |
|
3143 |
files := f directoryContents asArray. |
|
3144 |
files := files collect:[:nm | Java as_String:nm]. |
|
3145 |
^ files |
|
3146 |
] |
|
3147 |
] |
|
261 | 3148 |
]. |
3149 |
^ nil |
|
3150 |
||
3151 |
"Created: / 14.1.1998 / 21:30:22 / cg" |
|
405 | 3152 |
"Modified: / 20.10.1998 / 21:00:21 / cg" |
307 | 3153 |
! |
3154 |
||
3155 |
_File_mkdir0:nativeContext |
|
3156 |
|file path f| |
|
3157 |
||
3158 |
file := nativeContext receiver. |
|
3159 |
path := file instVarNamed:'path'. |
|
3160 |
path notNil ifTrue:[ |
|
3161 |
path := Java as_ST_String:path. |
|
405 | 3162 |
path := self fixFilename:path. |
307 | 3163 |
FileOpenConfirmation ifTrue:[ |
3164 |
(self confirm:('JAVA Security check\\Create directory ''' , path , '''.\Grant permission ?') withCRs) |
|
3165 |
ifFalse:[ |
|
3166 |
^ 0 "/ FALSE |
|
3167 |
] |
|
3168 |
]. |
|
3169 |
f := path asFilename. |
|
3170 |
OperatingSystem accessDeniedErrorSignal handle:[:ex | |
|
3171 |
^ 0 "/ FALSE |
|
3172 |
] do:[ |
|
3173 |
f makeDirectory. |
|
3174 |
]. |
|
3175 |
f exists ifTrue:[ |
|
3176 |
f isDirectory ifTrue:[^ 1 "TRUE"] |
|
3177 |
] |
|
3178 |
]. |
|
3179 |
^ 0 "FALSE" |
|
3180 |
||
3181 |
"Created: / 4.2.1998 / 00:19:05 / cg" |
|
405 | 3182 |
"Modified: / 20.10.1998 / 21:00:25 / cg" |
307 | 3183 |
! |
3184 |
||
440 | 3185 |
_File_renameTo0:nativeContext |
3186 |
"/ boolean renameTo0 (java.io.File) |
|
3187 |
UnimplementedNativeMethodSignal raise |
|
3188 |
||
3189 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3190 |
"Created: / 12.11.1998 / 19:03:28 / cg" |
|
3191 |
! |
|
3192 |
||
3193 |
_File_rmdir0:nativeContext |
|
3194 |
"/ boolean rmdir0 () |
|
3195 |
UnimplementedNativeMethodSignal raise |
|
3196 |
||
3197 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3198 |
"Created: / 12.11.1998 / 19:03:52 / cg" |
|
3199 |
! |
|
3200 |
||
3201 |
_ObjectInputStream_allocateNewArray:nativeContext |
|
3202 |
"/ java.lang.Object allocateNewArray (java.lang.Class int) |
|
3203 |
UnimplementedNativeMethodSignal raise |
|
3204 |
||
3205 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3206 |
"Created: / 12.11.1998 / 19:02:52 / cg" |
|
3207 |
! |
|
3208 |
||
3209 |
_ObjectInputStream_allocateNewObject:nativeContext |
|
3210 |
"/ java.lang.Object allocateNewObject (java.lang.Class java.lang.Class) |
|
3211 |
UnimplementedNativeMethodSignal raise |
|
3212 |
||
3213 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3214 |
"Created: / 12.11.1998 / 19:02:40 / cg" |
|
3215 |
! |
|
3216 |
||
3217 |
_ObjectInputStream_inputClassFields:nativeContext |
|
3218 |
"/ void inputClassFields (java.lang.Object java.lang.Class int[]) |
|
3219 |
UnimplementedNativeMethodSignal raise |
|
3220 |
||
3221 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3222 |
"Created: / 12.11.1998 / 19:02:22 / cg" |
|
3223 |
! |
|
3224 |
||
3225 |
_ObjectInputStream_invokeObjectReader:nativeContext |
|
3226 |
"/ boolean invokeObjectReader (java.lang.Object java.lang.Class) |
|
3227 |
UnimplementedNativeMethodSignal raise |
|
3228 |
||
3229 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3230 |
"Created: / 12.11.1998 / 19:03:06 / cg" |
|
3231 |
! |
|
3232 |
||
3233 |
_ObjectInputStream_loadClass0:nativeContext |
|
3234 |
"/ java.lang.Class loadClass0 (java.lang.Class java.lang.String) |
|
3235 |
UnimplementedNativeMethodSignal raise |
|
3236 |
||
3237 |
"Created: / 12.11.1998 / 19:01:15 / cg" |
|
3238 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3239 |
! |
|
3240 |
||
3241 |
_ObjectOutputStream_invokeObjectWriter:nativeContext |
|
3242 |
"/ boolean invokeObjectWriter (java.lang.Object java.lang.Class) |
|
3243 |
UnimplementedNativeMethodSignal raise |
|
3244 |
||
3245 |
"Created: / 12.11.1998 / 19:00:36 / cg" |
|
3246 |
"Modified: / 12.11.1998 / 19:01:45 / cg" |
|
3247 |
! |
|
3248 |
||
3249 |
_ObjectOutputStream_outputClassFields:nativeContext |
|
3250 |
"/ void outputClassFields (java.lang.Object java.lang.Class int[]) |
|
3251 |
UnimplementedNativeMethodSignal raise |
|
3252 |
||
3253 |
"Created: / 12.11.1998 / 19:00:09 / cg" |
|
3254 |
"Modified: / 12.11.1998 / 19:01:42 / cg" |
|
3255 |
! |
|
3256 |
||
3257 |
_ObjectStreamClass_getClassAccess:nativeContext |
|
3258 |
"/ int getClassAccess (java.lang.Class) |
|
3259 |
UnimplementedNativeMethodSignal raise |
|
3260 |
||
3261 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3262 |
"Created: / 12.11.1998 / 19:04:19 / cg" |
|
3263 |
! |
|
3264 |
||
3265 |
_ObjectStreamClass_getFieldAccess:nativeContext |
|
3266 |
"/ int getFieldAccess (java.lang.Class java.lang.String) |
|
3267 |
UnimplementedNativeMethodSignal raise |
|
3268 |
||
3269 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3270 |
"Created: / 12.11.1998 / 19:05:19 / cg" |
|
3271 |
! |
|
3272 |
||
3273 |
_ObjectStreamClass_getFieldSignatures:nativeContext |
|
3274 |
"/ java.lang.String[] getFieldSignatures (java.lang.Class) |
|
3275 |
UnimplementedNativeMethodSignal raise |
|
3276 |
||
3277 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3278 |
"Created: / 12.11.1998 / 19:05:04 / cg" |
|
3279 |
! |
|
3280 |
||
3281 |
_ObjectStreamClass_getFields0:nativeContext |
|
3282 |
"/ java.io.ObjectStreamField[] getFields0 (java.lang.Class) |
|
3283 |
UnimplementedNativeMethodSignal raise |
|
3284 |
||
3285 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3286 |
"Created: / 12.11.1998 / 19:05:32 / cg" |
|
3287 |
! |
|
3288 |
||
3289 |
_ObjectStreamClass_getMethodAccess:nativeContext |
|
3290 |
"/ int getMethodAccess (java.lang.Class java.lang.String) |
|
3291 |
UnimplementedNativeMethodSignal raise |
|
3292 |
||
3293 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3294 |
"Created: / 12.11.1998 / 19:04:51 / cg" |
|
3295 |
! |
|
3296 |
||
3297 |
_ObjectStreamClass_getMethodSignatures:nativeContext |
|
3298 |
"/ java.lang.String[] getMethodSignatures (java.lang.Class) |
|
3299 |
UnimplementedNativeMethodSignal raise |
|
3300 |
||
3301 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3302 |
"Created: / 12.11.1998 / 19:04:34 / cg" |
|
3303 |
! |
|
3304 |
||
3305 |
_ObjectStreamClass_getSerialVersionUID:nativeContext |
|
3306 |
"/ long getSerialVersionUID (java.lang.Class) |
|
3307 |
UnimplementedNativeMethodSignal raise |
|
3308 |
||
3309 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3310 |
"Created: / 12.11.1998 / 19:05:43 / cg" |
|
3311 |
! |
|
3312 |
||
3313 |
_ObjectStreamClass_hasWriteObject:nativeContext |
|
3314 |
"/ boolean hasWriteObject (java.lang.Class) |
|
3315 |
UnimplementedNativeMethodSignal raise |
|
3316 |
||
3317 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3318 |
"Created: / 12.11.1998 / 19:05:53 / cg" |
|
3319 |
! |
|
3320 |
||
307 | 3321 |
_RandomAccessFile_close:nativeContext |
3322 |
^ self anyStream_close:nativeContext |
|
3323 |
||
3324 |
"Created: / 4.2.1998 / 13:26:53 / cg" |
|
3325 |
"Modified: / 4.2.1998 / 15:21:08 / cg" |
|
3326 |
! |
|
3327 |
||
3328 |
_RandomAccessFile_length:nativeContext |
|
3329 |
|file sz| |
|
3330 |
||
3331 |
file := self validateFile:(nativeContext receiver). |
|
3332 |
||
3333 |
FileIOTrace ifTrue:[ |
|
3334 |
('JAVA: length of ' , file pathName) infoPrintCR. |
|
3335 |
]. |
|
3336 |
||
3337 |
sz := file size. |
|
3338 |
^ sz. |
|
3339 |
||
3340 |
"Created: / 4.2.1998 / 13:27:58 / cg" |
|
3341 |
! |
|
3342 |
||
3343 |
_RandomAccessFile_open:nativeContext |
|
442 | 3344 |
|fs fd name dir stream fileNo answer readonly| |
3345 |
||
3346 |
readonly := false. |
|
307 | 3347 |
|
3348 |
fs := nativeContext receiver. |
|
3349 |
fd := fs instVarNamed:'fd'. |
|
3350 |
(fd instVarNamed:'fd') ~~ 0 ifTrue:[ |
|
3351 |
self halt:'file already open'. |
|
3352 |
self internalError:'file already open'. |
|
3353 |
^ self. |
|
3354 |
]. |
|
3355 |
||
3356 |
name := nativeContext argAt:1. |
|
3357 |
name := Java as_ST_String:name. |
|
405 | 3358 |
name := self fixFilename:name. |
307 | 3359 |
|
3360 |
FileOpenTrace ifTrue:[ |
|
3361 |
('JAVA: opening ' , name) infoPrintCR. |
|
3362 |
]. |
|
3363 |
||
3364 |
dir := name asFilename directory pathName. |
|
442 | 3365 |
|
307 | 3366 |
(PermittedDirectories notNil |
3367 |
and:[PermittedDirectories includes:dir]) ifFalse:[ |
|
3368 |
FileOpenConfirmation ifTrue:[ |
|
442 | 3369 |
answer := Dialog |
3370 |
confirmWithCancel:('JAVA Security check\\Opening ''' , name , ''' for read/write.\Grant permission ?') withCRs |
|
3371 |
labels:#('no' 'grant' 'readonly') |
|
3372 |
values:#(false true #readonly) |
|
3373 |
default:3. |
|
3374 |
answer == false ifTrue:[ |
|
307 | 3375 |
self throwIOExceptionWithMessage:('no permission to open ' , name , ' for writing'). |
3376 |
^ self |
|
3377 |
]. |
|
442 | 3378 |
readonly := (answer == #readonly). |
3379 |
||
3380 |
readonly ifFalse:[ |
|
3381 |
(self confirm:('JAVA Security check\\Always permit writes in this directory (''' , dir , ''') ?') withCRs) |
|
3382 |
ifTrue:[ |
|
3383 |
PermittedDirectories isNil ifTrue:[ |
|
3384 |
PermittedDirectories := Set new |
|
3385 |
]. |
|
3386 |
PermittedDirectories add:dir. |
|
3387 |
] |
|
307 | 3388 |
] |
3389 |
] |
|
3390 |
]. |
|
3391 |
||
442 | 3392 |
readonly ifTrue:[ |
3393 |
stream := name asFilename readStream. |
|
3394 |
] ifFalse:[ |
|
3395 |
stream := name asFilename readWriteStream. |
|
3396 |
]. |
|
307 | 3397 |
stream isNil ifTrue:[ |
3398 |
self throwIOExceptionWithMessage:('cannot open ' , name , ' for writing'). |
|
3399 |
]. |
|
3400 |
||
3401 |
fileNo := self addOpenFile:stream. |
|
3402 |
||
3403 |
FileOpenTrace ifTrue:[ |
|
3404 |
('JAVA: opened ' , name , ' as FD ' , fileNo printString , ' for writing') infoPrintCR. |
|
3405 |
]. |
|
3406 |
||
3407 |
fd instVarNamed:'fd' put:fileNo. |
|
3408 |
||
3409 |
"Created: / 4.2.1998 / 00:14:48 / cg" |
|
442 | 3410 |
"Modified: / 12.11.1998 / 21:29:46 / cg" |
307 | 3411 |
! |
3412 |
||
3413 |
_RandomAccessFile_readBytes:nativeContext |
|
3414 |
^ self anyStream_readBytes:nativeContext |
|
3415 |
||
3416 |
"Modified: / 4.2.1998 / 15:23:27 / cg" |
|
3417 |
! |
|
3418 |
||
3419 |
_RandomAccessFile_seek:nativeContext |
|
3420 |
|file pos| |
|
3421 |
||
3422 |
file := self validateFile:(nativeContext receiver). |
|
3423 |
||
3424 |
FileIOTrace ifTrue:[ |
|
3425 |
('JAVA: seek on ' , file pathName) infoPrintCR. |
|
3426 |
]. |
|
3427 |
||
3428 |
pos := nativeContext argAt:1. |
|
3429 |
file position:pos+1 "/ ST/X position starts at 1 |
|
3430 |
||
3431 |
"Created: / 4.2.1998 / 13:25:38 / cg" |
|
3432 |
"Modified: / 4.2.1998 / 13:28:12 / cg" |
|
3433 |
! |
|
3434 |
||
3435 |
_RandomAccessFile_writeBytes:nativeContext |
|
3436 |
^ self anyStream_writeBytes:nativeContext |
|
3437 |
||
3438 |
"Modified: / 4.2.1998 / 15:24:20 / cg" |
|
3439 |
"Created: / 4.2.1998 / 15:24:35 / cg" |
|
253 | 3440 |
! ! |
3441 |
||
277 | 3442 |
!JavaVM class methodsFor:'native - java.io - jdk1.2'! |
3443 |
||
3444 |
_FileDescriptor_initIDs:nativeContext |
|
3445 |
"/ introduced with jdk1.2 ... (sigh) |
|
3446 |
||
3447 |
"Created: / 27.1.1998 / 18:16:29 / cg" |
|
3448 |
! |
|
3449 |
||
3450 |
_FileInputStream_initIDs:nativeContext |
|
3451 |
"/ introduced with jdk1.2 ... (sigh) |
|
3452 |
||
3453 |
"Created: / 27.1.1998 / 18:15:51 / cg" |
|
3454 |
! |
|
3455 |
||
3456 |
_FileOutputStream_initIDs:nativeContext |
|
3457 |
"/ introduced with jdk1.2 ... (sigh) |
|
3458 |
||
3459 |
"Created: / 27.1.1998 / 18:16:40 / cg" |
|
3460 |
! |
|
3461 |
||
3462 |
_File_canonPath:nativeContext |
|
3463 |
"/ introduced with jdk1.2 ... (sigh) |
|
3464 |
||
3465 |
|jPath path realPath| |
|
3466 |
||
3467 |
jPath := nativeContext argAt:1. |
|
3468 |
jPath isNil ifTrue:[^ jPath]. |
|
3469 |
||
3470 |
path := Java as_ST_String:jPath. |
|
3471 |
realPath := path asFilename pathName. |
|
3472 |
||
3473 |
^ Java as_String:realPath |
|
3474 |
||
3475 |
"Created: / 27.1.1998 / 18:35:58 / cg" |
|
3476 |
"Modified: / 27.1.1998 / 21:36:03 / cg" |
|
3477 |
! |
|
3478 |
||
3479 |
_File_initIDs:nativeContext |
|
3480 |
"/ introduced with jdk1.2 ... (sigh) |
|
3481 |
||
3482 |
"Created: / 27.1.1998 / 18:25:19 / cg" |
|
3483 |
! ! |
|
3484 |
||
253 | 3485 |
!JavaVM class methodsFor:'native - java.lang'! |
3486 |
||
255 | 3487 |
_ClassLoader_defineClass0:nativeContext |
3488 |
"create a new class from a given byteArray. |
|
3489 |
Here, construct a stream on it and pass the work to the |
|
3490 |
JavaClassReader." |
|
3491 |
||
3492 |
|jClassLoader jName name data offset length inStream newClass |
|
3493 |
loaderStub jClass| |
|
3494 |
||
3495 |
jClassLoader := nativeContext receiver. |
|
3496 |
jName := nativeContext argAt:1. |
|
3497 |
||
3498 |
"/ className is now optional ... |
|
3499 |
"/ jName isNil ifTrue:[ |
|
3500 |
"/ self internalError:'nil name in defineClass'. |
|
3501 |
"/ ^ nil |
|
3502 |
"/ ] ifFalse:[ |
|
3503 |
"/ name := Java as_ST_String:jName. |
|
3504 |
"/ ]. |
|
3505 |
||
3506 |
data := nativeContext argAt:2. |
|
3507 |
offset := nativeContext argAt:3. |
|
3508 |
length := nativeContext argAt:4. |
|
3509 |
||
3510 |
inStream := data readStream. |
|
3511 |
inStream position:offset + 1. |
|
3512 |
inStream readLimit:(offset + length). |
|
3513 |
||
270 | 3514 |
"/ loaderStub := Plug new. |
3515 |
"/ loaderStub respondTo:#loadClass: with:[:clsName | |
|
3516 |
"/ |jName| |
|
3517 |
"/ |
|
3518 |
"/self halt. |
|
3519 |
"/ jName := Java as_String:clsName. |
|
3520 |
"/ "/ jClassLoader loadClass:jName |
|
3521 |
"/ jClassLoader |
|
3522 |
"/ perform:#'loadClass(Ljava/lang/String;)Ljava/lang/Class;' |
|
3523 |
"/ with:jName. |
|
3524 |
"/ ]. |
|
255 | 3525 |
|
3526 |
('JAVA: defining class ...') infoPrintCR. |
|
3527 |
||
3528 |
"/ self internalError:'break'. |
|
3529 |
||
3530 |
newClass := JavaClassReader |
|
270 | 3531 |
readStream:inStream |
3532 |
loader:jClassLoader "loaderStub" |
|
3533 |
loadUnresolved:false. |
|
255 | 3534 |
|
3535 |
newClass isNil ifTrue:[ |
|
3536 |
('JAVA: defineClass failed') infoPrintCR. |
|
3537 |
^ nil. |
|
3538 |
]. |
|
3539 |
Transcript showCR:('defined class ' , newClass fullName , '.'). |
|
3540 |
newClass classLoader:jClassLoader. |
|
3541 |
||
3542 |
('Java: defined new class: ' , newClass fullName) infoPrintCR. |
|
3543 |
||
268
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
3544 |
jClass := self javaClassObjectForClass:newClass. |
255 | 3545 |
^ jClass |
3546 |
||
3547 |
"Created: / 7.1.1998 / 12:35:10 / cg" |
|
270 | 3548 |
"Modified: / 24.1.1998 / 15:26:21 / cg" |
255 | 3549 |
! |
3550 |
||
253 | 3551 |
_ClassLoader_findSystemClass0:nativeContext |
3552 |
|loader name class jClass| |
|
3553 |
||
3554 |
loader := nativeContext receiver. |
|
3555 |
name := nativeContext argAt:1. |
|
3556 |
name := Java as_ST_String:name. |
|
3557 |
||
399 | 3558 |
class := Java at:name. |
3559 |
class isNil ifTrue:[ |
|
318 | 3560 |
"/ ('JAVA: findSystemClass0 for ' , name , ' loader is ' , loader displayString) infoPrintCR. |
399 | 3561 |
loader class == (Java classForName:'java.util.SystemClassLoader') ifTrue:[ |
3562 |
"/ Java classForName:name. |
|
3563 |
"/ class := Java at:name. |
|
3564 |
class := JavaClassReader loadSystemClass:name. |
|
3565 |
] ifFalse:[ |
|
3566 |
"/ load using default (ST/X) loader |
|
3567 |
class := JavaClassReader loadSystemClass:name. |
|
3568 |
"/ JavaClassReader classLoaderQuerySignal answer:nil do:[ |
|
3569 |
"/ Java classForName:name. |
|
3570 |
"/ ] |
|
3571 |
]. |
|
253 | 3572 |
]. |
3573 |
||
255 | 3574 |
"/ JavaClassReader classLoaderQuerySignal answer:nil "loader" |
3575 |
"/ do:[ |
|
3576 |
"/ class := Java classForName:name. |
|
3577 |
"/ JavaClassReader postLoadActions:true. |
|
3578 |
"/ ]. |
|
399 | 3579 |
|
255 | 3580 |
(class isNil |
3581 |
"or:[class classLoader notNil]") ifTrue:[ |
|
253 | 3582 |
"/ self halt:'class: ' , name , ' not found.'. |
3583 |
"/ self internalError:'class: ' , name , ' not found.'. |
|
3584 |
||
318 | 3585 |
self |
3586 |
throwExceptionClassName:'java.lang.ClassNotFoundException' |
|
399 | 3587 |
withMessage:('class: ' , name , ' not found.'). |
318 | 3588 |
^ nil |
3589 |
]. |
|
3590 |
||
3591 |
"/ 'JAVA: findSystemClass0 - loaded: ' infoPrint. class fullName infoPrintCR. |
|
268
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
3592 |
jClass := self javaClassObjectForClass:class. |
253 | 3593 |
^ jClass |
3594 |
||
3595 |
"Created: / 5.1.1998 / 02:53:04 / cg" |
|
399 | 3596 |
"Modified: / 20.10.1998 / 17:28:34 / cg" |
255 | 3597 |
! |
3598 |
||
440 | 3599 |
_ClassLoader_getSystemResourceAsName0:nativeContext |
3600 |
"/ java.lang.String getSystemResourceAsName0 (java.lang.String) |
|
3601 |
UnimplementedNativeMethodSignal raise |
|
3602 |
||
3603 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3604 |
"Created: / 12.11.1998 / 18:58:34 / cg" |
|
3605 |
! |
|
3606 |
||
255 | 3607 |
_ClassLoader_getSystemResourceAsStream0:nativeContext |
444 | 3608 |
|jString rString dir file text inStream| |
255 | 3609 |
|
3610 |
jString := nativeContext argAt:1. |
|
3611 |
rString := Java as_ST_String:jString. |
|
3612 |
Java classPath do:[:aPath | |
|
444 | 3613 |
|f zipFile zar data| |
3614 |
||
3615 |
f := aPath asFilename. |
|
3616 |
((zipFile := f withSuffix:'jar') exists |
|
3617 |
or:[(zipFile := f withSuffix:'zip') exists]) ifTrue:[ |
|
3618 |
zar := ZipArchive oldFileNamed:zipFile. |
|
3619 |
(Array |
|
3620 |
with:rString |
|
3621 |
with:rString asLowercase |
|
3622 |
with:rString asUppercase) |
|
3623 |
do:[:tryName | |
|
3624 |
data := zar extract:tryName. |
|
3625 |
||
3626 |
inStream := (Java classForName:'java.io.ByteArrayInputStream') newCleared. |
|
3627 |
inStream perform:#'<init>([B)V' with:data. |
|
3628 |
^ inStream. |
|
3629 |
] |
|
3630 |
] ifFalse:[ |
|
3631 |
f exists ifTrue:[ |
|
3632 |
(file := f construct:rString) exists ifTrue:[ |
|
3633 |
(Java isExcludedFromClassPath:file) ifFalse:[ |
|
3634 |
text := file contents asString. |
|
3635 |
||
3636 |
"/ Copy data from returned buffer into Java byte array. |
|
3637 |
||
3638 |
data := text asByteArray. |
|
3639 |
||
3640 |
"/ Create input stream using byte array |
|
3641 |
||
3642 |
inStream := (Java classForName:'java.io.ByteArrayInputStream') newCleared. |
|
3643 |
inStream perform:#'<init>([B)V' with:data. |
|
3644 |
^ inStream. |
|
3645 |
] |
|
277 | 3646 |
] |
3647 |
] |
|
3648 |
] |
|
255 | 3649 |
]. |
3650 |
^ nil |
|
3651 |
||
3652 |
"Created: / 8.1.1998 / 16:06:56 / cg" |
|
444 | 3653 |
"Modified: / 12.11.1998 / 21:51:35 / cg" |
253 | 3654 |
! |
3655 |
||
3656 |
_ClassLoader_init:nativeContext |
|
3657 |
^ nil |
|
3658 |
||
3659 |
"Created: / 5.1.1998 / 02:04:43 / cg" |
|
3660 |
! |
|
3661 |
||
255 | 3662 |
_ClassLoader_resolveClass0:nativeContext |
3663 |
"resolve a new class as previously created by defineClass0" |
|
3664 |
||
399 | 3665 |
|jClassLoader jCls cls loaderStub anyUnresolved| |
255 | 3666 |
|
3667 |
jClassLoader := nativeContext receiver. |
|
3668 |
jCls := nativeContext argAt:1. |
|
3669 |
jCls isNil ifTrue:[ |
|
361
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3670 |
self halt. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3671 |
^ nil |
255 | 3672 |
]. |
3673 |
cls := JavaClasses at:jCls ifAbsent:nil. |
|
3674 |
cls isNil ifTrue:[ |
|
361
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3675 |
self halt. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3676 |
^ nil |
255 | 3677 |
]. |
399 | 3678 |
('JavaVM [info]: resolving class ' , cls fullName , ' ...') infoPrintCR. |
255 | 3679 |
|
3680 |
JavaClassReader classLoaderQuerySignal answer:jClassLoader |
|
3681 |
do:[ |
|
399 | 3682 |
JavaClassReader resolveClass:cls. |
3683 |
"/ JavaClassReader postLoadActions:true. |
|
3684 |
anyUnresolved := false. |
|
361
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3685 |
cls constantPool do:[:entry | |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3686 |
(entry isMemberOf:JavaUnresolvedClassConstant) ifTrue:[ |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3687 |
self halt:'debugHalt'. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3688 |
entry preResolve. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3689 |
self halt:'debugHalt'. |
399 | 3690 |
anyUnresolved := true. |
361
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3691 |
] |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3692 |
] |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3693 |
]. |
399 | 3694 |
anyUnresolved ifTrue:[ |
361
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3695 |
jClassLoader notNil ifTrue:[ |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3696 |
"/ any unresolved left -> try resolving with standard loader |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3697 |
JavaClassReader classLoaderQuerySignal answer:nil |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3698 |
do:[ |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3699 |
JavaClassReader postLoadActions:true. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3700 |
cls constantPool do:[:entry | |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3701 |
(entry isMemberOf:JavaUnresolvedClassConstant) ifTrue:[ |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3702 |
self halt:'debugHalt'. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3703 |
entry preResolve. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3704 |
self halt:'debugHalt'. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3705 |
] |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3706 |
] |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3707 |
] |
255 | 3708 |
]. |
399 | 3709 |
]. |
255 | 3710 |
|
3711 |
"Created: / 7.1.1998 / 13:12:27 / cg" |
|
400 | 3712 |
"Modified: / 20.10.1998 / 19:01:57 / cg" |
255 | 3713 |
! |
3714 |
||
253 | 3715 |
_Class_forName:nativeContext |
3716 |
"get a java.lang.Class by name" |
|
3717 |
||
255 | 3718 |
|jClassName className cls jClass s m c loader| |
253 | 3719 |
|
3720 |
jClassName := nativeContext argAt:1. |
|
3721 |
className := Java as_ST_String:jClassName. |
|
3722 |
||
255 | 3723 |
(s := nativeContext sender) notNil ifTrue:[ |
347 | 3724 |
(s isJavaContext) ifTrue:[ |
307 | 3725 |
c := s method javaClass. |
3726 |
loader := c classLoader. |
|
3727 |
loader isNil ifTrue:[ |
|
255 | 3728 |
"/ self halt. |
307 | 3729 |
] |
3730 |
] |
|
255 | 3731 |
]. |
3732 |
||
3733 |
JavaClassReader classLoaderQuerySignal answer:loader |
|
3734 |
do:[ |
|
307 | 3735 |
cls := Java classForName:className. |
255 | 3736 |
]. |
3737 |
||
3738 |
"/(className startsWith:'sun.awt') ifTrue:[self halt]. |
|
3739 |
"/('classForName: ' , className , ' -> ') print. |
|
3740 |
"/cls notNil ifTrue:[cls fullName printCR] ifFalse:['nil' printCR]. |
|
3741 |
||
253 | 3742 |
cls isNil ifTrue:[ |
307 | 3743 |
ExceptionTrace ifTrue:[ |
3744 |
self halt:'no such class:' , className. |
|
3745 |
]. |
|
3746 |
self throwClassNotFoundException:className. |
|
3747 |
"/ not proceedable |
|
3748 |
AbortSignal raise. |
|
3749 |
"/ not reached |
|
3750 |
^ self |
|
3751 |
]. |
|
3752 |
||
3753 |
^ self javaClassObjectForClass:cls. |
|
3754 |
||
347 | 3755 |
"Modified: / 8.5.1998 / 21:30:03 / cg" |
253 | 3756 |
! |
3757 |
||
3758 |
_Class_getClassLoader:nativeContext |
|
3759 |
"get a classes loader" |
|
3760 |
||
3761 |
|loader| |
|
3762 |
||
3763 |
loader := JavaClassReader classLoaderQuerySignal raise. |
|
3764 |
('JAVA: getClassLoader - ' , loader printString) infoPrintCR. |
|
3765 |
||
3766 |
"/ self unimplementedNativeMethod. |
|
3767 |
^ loader |
|
3768 |
||
3769 |
"Modified: / 21.8.1997 / 16:32:02 / cg" |
|
3770 |
"Created: / 5.1.1998 / 02:51:59 / cg" |
|
3771 |
! |
|
3772 |
||
440 | 3773 |
_Class_getComponentType:nativeContext |
3774 |
UnimplementedNativeMethodSignal raise |
|
3775 |
||
3776 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3777 |
"Created: / 12.11.1998 / 18:54:46 / cg" |
|
3778 |
! |
|
3779 |
||
3780 |
_Class_getConstructor0:nativeContext |
|
3781 |
UnimplementedNativeMethodSignal raise |
|
3782 |
||
3783 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3784 |
"Created: / 12.11.1998 / 18:55:42 / cg" |
|
3785 |
! |
|
3786 |
||
3787 |
_Class_getConstructors0:nativeContext |
|
3788 |
UnimplementedNativeMethodSignal raise |
|
3789 |
||
3790 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3791 |
"Created: / 12.11.1998 / 18:55:26 / cg" |
|
3792 |
! |
|
3793 |
||
3794 |
_Class_getField0:nativeContext |
|
3795 |
UnimplementedNativeMethodSignal raise |
|
3796 |
||
3797 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3798 |
"Created: / 12.11.1998 / 18:55:37 / cg" |
|
3799 |
! |
|
3800 |
||
3801 |
_Class_getFields0:nativeContext |
|
3802 |
UnimplementedNativeMethodSignal raise |
|
3803 |
||
3804 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3805 |
"Created: / 12.11.1998 / 18:55:18 / cg" |
|
3806 |
! |
|
3807 |
||
3808 |
_Class_getInterfaces:nativeContext |
|
3809 |
UnimplementedNativeMethodSignal raise |
|
3810 |
||
3811 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3812 |
"Created: / 12.11.1998 / 18:54:34 / cg" |
|
3813 |
! |
|
3814 |
||
321 | 3815 |
_Class_getMethod0:nativeContext |
3816 |
"get a method, given a name and type spec" |
|
3817 |
||
322 | 3818 |
|jClass cls jmName mName mTypes whichAccess argSig sel| |
321 | 3819 |
|
3820 |
jClass := nativeContext receiver. |
|
3821 |
cls := JavaClasses at:jClass. |
|
3822 |
||
322 | 3823 |
jmName := nativeContext argAt:1. |
3824 |
mName := Java as_ST_String:jmName. |
|
321 | 3825 |
mTypes := nativeContext argAt:2. |
3826 |
whichAccess := nativeContext argAt:3. |
|
405 | 3827 |
self halt. |
322 | 3828 |
argSig := JavaMethod argSignatureFromArgTypeArray:mTypes. |
3829 |
cls methodDictionary keysAndValuesDo:[:sel :mthd | |
|
405 | 3830 |
|i1 i2 jMethod retTypeClass argTypes| |
322 | 3831 |
|
3832 |
JavaMethods notNil ifTrue:[ |
|
3833 |
(jMethod := JavaMethods at:mthd ifAbsent:nil) notNil ifTrue:[ |
|
3834 |
^ jMethod |
|
3835 |
] |
|
3836 |
]. |
|
3837 |
||
3838 |
mthd name printCR. |
|
3839 |
mName printCR. |
|
3840 |
||
3841 |
mthd name = mName ifTrue:[ |
|
3842 |
i1 := mthd signature indexOf:$(. |
|
3843 |
i2 := mthd signature indexOf:$) startingAt:(i1+1). |
|
3844 |
||
3845 |
(mthd signature copyFrom:i1+1 to:i2-1) = argSig ifTrue:[ |
|
3846 |
"/ found it - create a java.lang.reflect.Method for it. |
|
3847 |
jMethod := (Java at:'java.lang.reflect.Method') new. |
|
3848 |
jMethod instVarNamed:'clazz' put:jClass. |
|
3849 |
jMethod instVarNamed:'slot' put:sel. |
|
3850 |
jMethod instVarNamed:'name' put:jmName. |
|
405 | 3851 |
retTypeClass := mthd returnTypeClass. |
3852 |
retTypeClass isNil ifTrue:[ |
|
3853 |
retTypeClass := #void |
|
3854 |
]. |
|
3855 |
argTypes := mthd argSignature. |
|
3856 |
argTypes := argTypes collect:[:s | |
|
3857 |
|c| |
|
3858 |
||
3859 |
c := Java at:s. |
|
3860 |
self javaClassObjectForClass:(c ? s asSymbol) |
|
3861 |
]. |
|
3862 |
jMethod instVarNamed:'returnType' put:(self javaClassObjectForClass:retTypeClass). |
|
3863 |
jMethod instVarNamed:'parameterTypes' put:argTypes. |
|
322 | 3864 |
|
3865 |
JavaMethods isNil ifTrue:[ |
|
3866 |
JavaMethods := IdentityDictionary new |
|
3867 |
]. |
|
3868 |
JavaMethods at:jMethod put:mthd. |
|
3869 |
JavaMethods at:mthd put:jMethod. |
|
3870 |
||
3871 |
^ jMethod. |
|
3872 |
]. |
|
3873 |
]. |
|
3874 |
]. |
|
321 | 3875 |
|
3876 |
self halt. |
|
3877 |
self |
|
3878 |
throwExceptionClassName:'java.lang.NoSuchMethodException' |
|
3879 |
withMessage:'not yet implemented'. |
|
3880 |
||
3881 |
^ nil. |
|
3882 |
||
405 | 3883 |
"Modified: / 22.10.1998 / 01:54:38 / cg" |
321 | 3884 |
! |
3885 |
||
334 | 3886 |
_Class_getMethods0:nativeContext |
3887 |
"get a method, given a name and type spec" |
|
3888 |
||
3889 |
|jClass cls jmName mName mTypes whichAccess argSig sel |
|
3890 |
methods| |
|
3891 |
||
3892 |
jClass := nativeContext receiver. |
|
3893 |
cls := JavaClasses at:jClass. |
|
3894 |
||
405 | 3895 |
"/ 0 = PUBLIC (i.e. includes inherited) / 1 = DECLARED here |
334 | 3896 |
whichAccess := nativeContext argAt:1. |
3897 |
||
3898 |
methods := OrderedCollection new. |
|
3899 |
||
405 | 3900 |
[cls isJavaClass] whileTrue:[ |
3901 |
cls methodDictionary keysAndValuesDo:[:sel :mthd | |
|
3902 |
|i1 i2 jMethod argTypes retTypeClass| |
|
3903 |
||
3904 |
mthd name printCR. |
|
3905 |
||
3906 |
i1 := mthd signature indexOf:$(. |
|
3907 |
i2 := mthd signature indexOf:$) startingAt:(i1+1). |
|
3908 |
||
3909 |
"/ create a java.lang.reflect.Method for it. |
|
3910 |
jMethod := (Java at:'java.lang.reflect.Method') new. |
|
3911 |
jMethod instVarNamed:'clazz' put:jClass. |
|
3912 |
jMethod instVarNamed:'slot' put:sel. |
|
3913 |
jMethod instVarNamed:'name' put:(Java as_String:mthd name). |
|
3914 |
retTypeClass := mthd returnTypeClass. |
|
3915 |
retTypeClass isNil ifTrue:[ |
|
3916 |
retTypeClass := #void |
|
3917 |
]. |
|
3918 |
(name endsWith:')I') ifTrue:[self halt]. |
|
3919 |
argTypes := mthd argSignature. |
|
3920 |
argTypes := argTypes collect:[:s | |
|
3921 |
|c| |
|
3922 |
||
3923 |
c := Java at:s. |
|
3924 |
self javaClassObjectForClass:(c ? s asSymbol) |
|
3925 |
]. |
|
3926 |
||
3927 |
jMethod instVarNamed:'returnType' put:(self javaClassObjectForClass:retTypeClass). |
|
3928 |
jMethod instVarNamed:'parameterTypes' put:argTypes. |
|
334 | 3929 |
|
405 | 3930 |
(mthd name includesString:'setName') ifTrue:[self halt]. |
3931 |
JavaMethods isNil ifTrue:[ |
|
3932 |
JavaMethods := IdentityDictionary new |
|
3933 |
]. |
|
3934 |
JavaMethods at:jMethod put:mthd. |
|
3935 |
JavaMethods at:mthd put:jMethod. |
|
3936 |
||
3937 |
methods add:jMethod. |
|
334 | 3938 |
]. |
405 | 3939 |
whichAccess == 1 ifTrue:[ |
3940 |
"/ local methods only |
|
3941 |
cls := nil |
|
3942 |
] ifFalse:[ |
|
3943 |
cls := cls superclass. |
|
3944 |
] |
|
334 | 3945 |
]. |
3946 |
methods := methods asArray. |
|
3947 |
^ methods. |
|
3948 |
||
405 | 3949 |
"Modified: / 22.10.1998 / 01:53:58 / cg" |
334 | 3950 |
! |
3951 |
||
440 | 3952 |
_Class_getModifiers:nativeContext |
3953 |
UnimplementedNativeMethodSignal raise |
|
3954 |
||
3955 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3956 |
"Created: / 12.11.1998 / 18:54:53 / cg" |
|
3957 |
! |
|
3958 |
||
255 | 3959 |
_Class_getName:nativeContext |
3960 |
"get a classes name" |
|
3961 |
||
3962 |
|jClass cls| |
|
3963 |
||
3964 |
jClass := nativeContext receiver. |
|
3965 |
cls := JavaClasses at:jClass. |
|
359 | 3966 |
^ Java as_String:(cls fullName copyReplaceAll:$/ with:$.). |
3967 |
||
3968 |
"Modified: / 18.7.1998 / 22:59:05 / cg" |
|
255 | 3969 |
! |
3970 |
||
253 | 3971 |
_Class_getPrimitiveClass:nativeContext |
3972 |
"get a primitive class by name" |
|
3973 |
||
3974 |
|jClassName className cls| |
|
3975 |
||
3976 |
jClassName := nativeContext argAt:1. |
|
3977 |
className := Java as_ST_String:jClassName. |
|
3978 |
||
3979 |
JavaClasses isNil ifTrue:[ |
|
261 | 3980 |
self initializePrimitiveClasses |
253 | 3981 |
]. |
3982 |
cls := JavaClasses at:className. |
|
3983 |
||
3984 |
"/ cls := Java classForName:className. |
|
3985 |
"/ cls isNil ifTrue:[ |
|
3986 |
"/ cls := JavaClasses at:('JavaBase_' , className) asSymbol ifAbsent:nil. |
|
3987 |
"/ #( |
|
3988 |
"/ 'boolean' #Boolean |
|
3989 |
"/ 'float' #ShortFloat |
|
3990 |
"/ 'double' #Float |
|
3991 |
"/ 'int' #Integer |
|
3992 |
"/ 'long' #Integer |
|
3993 |
"/ 'char' #Character |
|
3994 |
"/ 'short' #Integer |
|
3995 |
"/ 'byte' #Integer |
|
3996 |
"/ 'void' #UndefinedObject |
|
3997 |
"/ ) pairWiseDo:[:nm :sym | |
|
3998 |
"/ className = nm ifTrue:[ |
|
3999 |
"/ cls := Smalltalk at:sym. |
|
4000 |
"/ ] |
|
4001 |
"/ ]. |
|
4002 |
"/ |
|
4003 |
"/ cls isNil ifTrue:[ |
|
4004 |
"/ self internalError:'class: ' , className , ' not found.'. |
|
4005 |
"/ ]. |
|
4006 |
"/ ]. |
|
4007 |
^ cls |
|
4008 |
||
4009 |
"Created: / 4.1.1998 / 00:46:03 / cg" |
|
4010 |
"Modified: / 4.1.1998 / 01:12:27 / cg" |
|
4011 |
! |
|
4012 |
||
440 | 4013 |
_Class_getSigners:nativeContext |
4014 |
UnimplementedNativeMethodSignal raise |
|
4015 |
||
4016 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4017 |
"Created: / 12.11.1998 / 18:55:01 / cg" |
|
4018 |
! |
|
4019 |
||
255 | 4020 |
_Class_getSuperclass:nativeContext |
4021 |
"return a classes superclass" |
|
4022 |
||
4023 |
|jClass cls superCls| |
|
4024 |
||
4025 |
jClass := nativeContext receiver. |
|
4026 |
cls := JavaClasses at:jClass. |
|
4027 |
superCls := cls superclass. |
|
4028 |
superCls == JavaObject ifTrue:[ |
|
307 | 4029 |
^ nil. |
4030 |
]. |
|
4031 |
^ self javaClassObjectForClass:superCls |
|
255 | 4032 |
|
4033 |
"Created: / 12.1.1998 / 12:38:36 / cg" |
|
307 | 4034 |
"Modified: / 4.2.1998 / 14:51:22 / cg" |
255 | 4035 |
! |
4036 |
||
440 | 4037 |
_Class_isArray:nativeContext |
4038 |
UnimplementedNativeMethodSignal raise |
|
4039 |
||
4040 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4041 |
"Created: / 12.11.1998 / 18:54:24 / cg" |
|
4042 |
! |
|
4043 |
||
4044 |
_Class_isAssignableFrom:nativeContext |
|
4045 |
UnimplementedNativeMethodSignal raise |
|
4046 |
||
4047 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4048 |
"Created: / 12.11.1998 / 18:54:16 / cg" |
|
4049 |
! |
|
4050 |
||
321 | 4051 |
_Class_isInstance:nativeContext |
4052 |
"return true, if something is an instance of a class. |
|
4053 |
(i.e. same as instanceOf - builtin bytecode)" |
|
4054 |
||
4055 |
|jClass cls obj| |
|
4056 |
||
4057 |
obj := nativeContext argAt:1. |
|
4058 |
obj isNil ifTrue:[^ 0 "FALSE"]. |
|
4059 |
||
4060 |
jClass := nativeContext receiver. |
|
4061 |
cls := JavaClasses at:jClass. |
|
4062 |
||
4063 |
(obj isMemberOf:cls) ifTrue:[^ 1 "TRUE"]. |
|
4064 |
(obj isKindOf:cls) ifTrue:[^ 1 "TRUE"]. |
|
4065 |
||
4066 |
cls isBehavior ifTrue:[ |
|
4067 |
cls isInterface ifTrue:[ |
|
4068 |
(obj class hasInterface:cls) ifTrue:[ |
|
4069 |
^ 1 "TRUE" |
|
4070 |
] |
|
4071 |
]. |
|
4072 |
^ (obj isKindOf:cls) ifTrue:[1 "TRUE"] ifFalse:[0 "FALSE"] |
|
4073 |
]. |
|
4074 |
(cls isMemberOf:JavaClassPointerRef) ifTrue:[ |
|
4075 |
"/ must be a pointer to an array of that class |
|
4076 |
||
4077 |
^ (obj isArray) ifTrue:[1 "TRUE"] ifFalse:[0 "FALSE"] |
|
4078 |
]. |
|
4079 |
(cls isMemberOf:JavaBuiltInClassPointerRef) ifTrue:[ |
|
4080 |
cls arrayClass == obj class ifTrue:[ |
|
4081 |
^ 1 "TRUE" |
|
4082 |
]. |
|
4083 |
]. |
|
4084 |
||
4085 |
(obj isMemberOf:Array) ifTrue:[ |
|
4086 |
obj size == 0 ifTrue:[ |
|
4087 |
^ 1 "TRUE" |
|
4088 |
]. |
|
4089 |
^ (self _checkCast:(obj at:1) class:(cls deref)) |
|
4090 |
ifTrue:[1 "TRUE"] ifFalse:[0 "FALSE"] |
|
4091 |
]. |
|
4092 |
self halt. |
|
4093 |
^ 0 "FALSE". |
|
4094 |
||
4095 |
"Modified: / 9.2.1998 / 14:56:23 / cg" |
|
4096 |
! |
|
4097 |
||
255 | 4098 |
_Class_isInterface:nativeContext |
4099 |
"return true, if this class is an interface" |
|
4100 |
||
4101 |
|jClass cls| |
|
4102 |
||
4103 |
jClass := nativeContext receiver. |
|
4104 |
cls := JavaClasses at:jClass. |
|
4105 |
cls isInterface ifTrue:[^ 1 "TRUE"]. |
|
4106 |
^ 0 "FALSE" |
|
4107 |
||
4108 |
"Created: / 12.1.1998 / 12:37:02 / cg" |
|
4109 |
! |
|
4110 |
||
321 | 4111 |
_Class_isPrimitive:nativeContext |
4112 |
"return true, if this class is builtin primitive class |
|
4113 |
(i.e. byteArray, array, string etc." |
|
4114 |
||
4115 |
|jClass cls| |
|
4116 |
||
4117 |
jClass := nativeContext receiver. |
|
4118 |
cls := JavaClasses at:jClass. |
|
4119 |
^ 0 "FALSE" |
|
4120 |
||
4121 |
"Created: / 9.2.1998 / 14:46:07 / cg" |
|
4122 |
! |
|
4123 |
||
253 | 4124 |
_Class_newInstance:nativeContext |
4125 |
"get an instance for a java.lang.Class" |
|
4126 |
||
4127 |
|jClass cls newInst| |
|
4128 |
||
4129 |
jClass := nativeContext receiver. |
|
4130 |
cls := JavaClasses at:jClass. |
|
261 | 4131 |
cls classInit. |
253 | 4132 |
newInst := cls newCleared. |
255 | 4133 |
newInst perform:#'<init>()V'. |
253 | 4134 |
|
4135 |
^ newInst |
|
4136 |
||
4137 |
"Created: / 2.1.1998 / 22:41:38 / cg" |
|
261 | 4138 |
"Modified: / 15.1.1998 / 00:57:37 / cg" |
253 | 4139 |
! |
4140 |
||
440 | 4141 |
_Class_setSigners:nativeContext |
4142 |
UnimplementedNativeMethodSignal raise |
|
4143 |
||
4144 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4145 |
"Created: / 12.11.1998 / 18:55:08 / cg" |
|
4146 |
! |
|
4147 |
||
253 | 4148 |
_Double_doubleToLongBits:nativeContext |
4149 |
|f i| |
|
4150 |
||
4151 |
f := nativeContext argAt:1. |
|
4152 |
||
4153 |
UninterpretedBytes isBigEndian ifTrue:[ |
|
261 | 4154 |
i := f basicAt:8. |
4155 |
i := i bitOr:((f basicAt:7) bitShift:8). |
|
4156 |
i := i bitOr:((f basicAt:6) bitShift:16). |
|
4157 |
i := i bitOr:((f basicAt:5) bitShift:24). |
|
4158 |
i := i bitOr:((f basicAt:4) bitShift:32). |
|
4159 |
i := i bitOr:((f basicAt:3) bitShift:40). |
|
4160 |
i := i bitOr:((f basicAt:2) bitShift:48). |
|
4161 |
i := i bitOr:((f basicAt:1) bitShift:56). |
|
253 | 4162 |
] ifFalse:[ |
261 | 4163 |
i := f basicAt:1. |
4164 |
i := i bitOr:((f basicAt:2) bitShift:8). |
|
4165 |
i := i bitOr:((f basicAt:3) bitShift:16). |
|
4166 |
i := i bitOr:((f basicAt:4) bitShift:24). |
|
4167 |
i := i bitOr:((f basicAt:5) bitShift:32). |
|
4168 |
i := i bitOr:((f basicAt:6) bitShift:40). |
|
4169 |
i := i bitOr:((f basicAt:7) bitShift:48). |
|
4170 |
i := i bitOr:((f basicAt:8) bitShift:56). |
|
253 | 4171 |
]. |
4172 |
||
4173 |
^ i. |
|
4174 |
||
4175 |
"Created: / 4.1.1998 / 01:39:12 / cg" |
|
4176 |
! |
|
4177 |
||
4178 |
_Double_longBitsToDouble:nativeContext |
|
4179 |
|i aFloat| |
|
4180 |
||
4181 |
i := nativeContext argAt:1. |
|
4182 |
||
4183 |
aFloat := Float new. |
|
4184 |
UninterpretedBytes isBigEndian ifTrue:[ |
|
261 | 4185 |
aFloat basicAt:1 put:((i bitShift:-56) bitAnd:16rFF). |
4186 |
aFloat basicAt:2 put:((i bitShift:-48) bitAnd:16rFF). |
|
4187 |
aFloat basicAt:3 put:((i bitShift:-40) bitAnd:16rFF). |
|
4188 |
aFloat basicAt:4 put:((i bitShift:-32) bitAnd:16rFF). |
|
4189 |
aFloat basicAt:5 put:((i bitShift:-24) bitAnd:16rFF). |
|
4190 |
aFloat basicAt:6 put:((i bitShift:-16) bitAnd:16rFF). |
|
4191 |
aFloat basicAt:7 put:((i bitShift:-8) bitAnd:16rFF). |
|
4192 |
aFloat basicAt:8 put:(i bitAnd:16rFF). |
|
253 | 4193 |
] ifFalse:[ |
261 | 4194 |
aFloat basicAt:1 put:(i bitAnd:16rFF). |
4195 |
aFloat basicAt:2 put:((i bitShift:-8) bitAnd:16rFF). |
|
4196 |
aFloat basicAt:3 put:((i bitShift:-16) bitAnd:16rFF). |
|
4197 |
aFloat basicAt:4 put:((i bitShift:-24) bitAnd:16rFF). |
|
4198 |
aFloat basicAt:5 put:((i bitShift:-32) bitAnd:16rFF). |
|
4199 |
aFloat basicAt:6 put:((i bitShift:-40) bitAnd:16rFF). |
|
4200 |
aFloat basicAt:7 put:((i bitShift:-48) bitAnd:16rFF). |
|
4201 |
aFloat basicAt:8 put:((i bitShift:-56) bitAnd:16rFF). |
|
253 | 4202 |
]. |
4203 |
||
4204 |
^ aFloat. |
|
4205 |
||
4206 |
"Created: / 4.1.1998 / 01:45:00 / cg" |
|
4207 |
! |
|
4208 |
||
255 | 4209 |
_Double_valueOf0:nativeContext |
4210 |
|s d| |
|
4211 |
||
4212 |
s := nativeContext argAt:1. |
|
4213 |
s notNil ifTrue:[ |
|
261 | 4214 |
s := Java as_ST_String:s. |
4215 |
d := Float readFrom:s onError:nil. |
|
255 | 4216 |
]. |
4217 |
d isNil ifTrue:[ |
|
261 | 4218 |
self throwNumberFormatException. |
4219 |
"/ not reached |
|
255 | 4220 |
]. |
4221 |
||
4222 |
^ d |
|
4223 |
||
4224 |
"Modified: / 8.8.1997 / 12:03:55 / cg" |
|
4225 |
"Created: / 7.1.1998 / 11:09:43 / cg" |
|
4226 |
! |
|
4227 |
||
253 | 4228 |
_Float_floatToIntBits:nativeContext |
4229 |
|f i| |
|
4230 |
||
4231 |
f := nativeContext argAt:1. |
|
4232 |
||
4233 |
UninterpretedBytes isBigEndian ifTrue:[ |
|
261 | 4234 |
i := f basicAt:4. |
4235 |
i := i bitOr:((f basicAt:3) bitShift:8). |
|
4236 |
i := i bitOr:((f basicAt:2) bitShift:16). |
|
4237 |
i := i bitOr:((f basicAt:1) bitShift:24). |
|
253 | 4238 |
] ifFalse:[ |
261 | 4239 |
i := f basicAt:1. |
4240 |
i := i bitOr:((f basicAt:2) bitShift:8). |
|
4241 |
i := i bitOr:((f basicAt:3) bitShift:16). |
|
4242 |
i := i bitOr:((f basicAt:4) bitShift:24). |
|
253 | 4243 |
]. |
4244 |
||
4245 |
^ i. |
|
4246 |
||
4247 |
"Created: / 4.1.1998 / 01:25:50 / cg" |
|
4248 |
! |
|
4249 |
||
261 | 4250 |
_Float_intBitsToFloat:nativeContet |
4251 |
|i aFloat| |
|
4252 |
||
4253 |
i := nativeContet argAt:1. |
|
4254 |
||
4255 |
aFloat := ShortFloat basicNew. |
|
4256 |
UninterpretedBytes isBigEndian ifTrue:[ |
|
4257 |
aFloat basicAt:1 put:((i bitShift:-24) bitAnd:16rFF). |
|
4258 |
aFloat basicAt:2 put:((i bitShift:-16) bitAnd:16rFF). |
|
4259 |
aFloat basicAt:3 put:((i bitShift:-8) bitAnd:16rFF). |
|
4260 |
aFloat basicAt:4 put:(i bitAnd:16rFF). |
|
4261 |
] ifFalse:[ |
|
4262 |
aFloat basicAt:1 put:(i bitAnd:16rFF). |
|
4263 |
aFloat basicAt:2 put:((i bitShift:-8) bitAnd:16rFF). |
|
4264 |
aFloat basicAt:3 put:((i bitShift:-16) bitAnd:16rFF). |
|
4265 |
aFloat basicAt:4 put:((i bitShift:-24) bitAnd:16rFF). |
|
4266 |
]. |
|
4267 |
||
4268 |
^ aFloat. |
|
4269 |
||
4270 |
"Created: / 13.1.1998 / 23:03:36 / cg" |
|
4271 |
"Modified: / 13.1.1998 / 23:05:01 / cg" |
|
4272 |
! |
|
4273 |
||
440 | 4274 |
_Math_IEEEremainder:nativeContext |
4275 |
UnimplementedNativeMethodSignal raise |
|
4276 |
||
4277 |
"Created: / 12.11.1998 / 18:52:36 / cg" |
|
4278 |
! |
|
4279 |
||
342 | 4280 |
_Math_acos:nativeContext |
4281 |
"arc cosine" |
|
4282 |
||
4283 |
|dVal| |
|
4284 |
||
4285 |
dVal := nativeContext argAt:1. |
|
432 | 4286 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4287 |
"/ dVal isReal ifTrue:[ |
|
4288 |
"/ 'JAVAVM [info]: missing double flag in Math>>acos' infoPrintCR. |
|
4289 |
"/ ] ifFalse:[ |
|
4290 |
"/ self halt:'expected double arg' |
|
4291 |
"/ ] |
|
4292 |
"/ ]. |
|
342 | 4293 |
^ dVal arcCos |
4294 |
||
4295 |
"Created: / 7.5.1998 / 00:34:50 / cg" |
|
432 | 4296 |
"Modified: / 11.11.1998 / 15:08:20 / cg" |
342 | 4297 |
! |
4298 |
||
4299 |
_Math_asin:nativeContext |
|
4300 |
"arc sine" |
|
4301 |
||
4302 |
|dVal| |
|
4303 |
||
4304 |
dVal := nativeContext argAt:1. |
|
432 | 4305 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4306 |
"/ dVal isReal ifTrue:[ |
|
4307 |
"/ 'JAVAVM [info]: missing double flag in Math>>asin' infoPrintCR. |
|
4308 |
"/ ] ifFalse:[ |
|
4309 |
"/ self halt:'expected double arg' |
|
4310 |
"/ ] |
|
4311 |
"/ ]. |
|
342 | 4312 |
^ dVal arcSin |
4313 |
||
4314 |
"Created: / 7.5.1998 / 00:34:26 / cg" |
|
432 | 4315 |
"Modified: / 11.11.1998 / 15:08:15 / cg" |
342 | 4316 |
! |
4317 |
||
440 | 4318 |
_Math_atan2:nativeContext |
4319 |
UnimplementedNativeMethodSignal raise |
|
4320 |
||
4321 |
"Created: / 12.11.1998 / 18:52:52 / cg" |
|
4322 |
! |
|
4323 |
||
317 | 4324 |
_Math_atan:nativeContext |
4325 |
"arc tangens" |
|
4326 |
||
4327 |
|dVal| |
|
4328 |
||
4329 |
dVal := nativeContext argAt:1. |
|
432 | 4330 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4331 |
"/ dVal isReal ifTrue:[ |
|
4332 |
"/ 'JAVAVM [info]: missing double flag in Math>>atan' infoPrintCR. |
|
4333 |
"/ ] ifFalse:[ |
|
4334 |
"/ self halt:'expected double arg' |
|
4335 |
"/ ] |
|
4336 |
"/ ]. |
|
317 | 4337 |
^ dVal arcTan |
4338 |
||
4339 |
"Created: / 6.2.1998 / 01:24:12 / cg" |
|
432 | 4340 |
"Modified: / 11.11.1998 / 15:08:11 / cg" |
317 | 4341 |
! |
4342 |
||
255 | 4343 |
_Math_ceil:nativeContext |
4344 |
"ceiling" |
|
4345 |
||
4346 |
|dVal| |
|
4347 |
||
4348 |
dVal := nativeContext argAt:1. |
|
432 | 4349 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4350 |
"/ dVal isReal ifTrue:[ |
|
4351 |
"/ 'JAVAVM [info]: missing double flag in Math>>ceil' infoPrintCR. |
|
4352 |
"/ ] ifFalse:[ |
|
4353 |
"/ self halt:'expected double arg' |
|
4354 |
"/ ] |
|
4355 |
"/ ]. |
|
255 | 4356 |
^ dVal ceilingAsFloat |
4357 |
||
4358 |
"Created: / 7.1.1998 / 15:43:00 / cg" |
|
432 | 4359 |
"Modified: / 11.11.1998 / 15:08:04 / cg" |
255 | 4360 |
! |
4361 |
||
4362 |
_Math_cos:nativeContext |
|
4363 |
"cosine" |
|
4364 |
||
4365 |
|dVal| |
|
4366 |
||
4367 |
dVal := nativeContext argAt:1. |
|
432 | 4368 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4369 |
"/ dVal isReal ifTrue:[ |
|
4370 |
"/ 'JAVAVM [info]: missing double flag in Math>>cos' infoPrintCR. |
|
4371 |
"/ ] ifFalse:[ |
|
4372 |
"/ self halt:'expected double arg' |
|
4373 |
"/ ] |
|
4374 |
"/ ]. |
|
255 | 4375 |
^ dVal cos |
4376 |
||
4377 |
"Created: / 7.1.1998 / 15:41:30 / cg" |
|
432 | 4378 |
"Modified: / 11.11.1998 / 15:07:59 / cg" |
255 | 4379 |
! |
4380 |
||
342 | 4381 |
_Math_exp:nativeContext |
4382 |
"exponential" |
|
4383 |
||
4384 |
|dVal| |
|
4385 |
||
4386 |
dVal := nativeContext argAt:1. |
|
432 | 4387 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4388 |
"/ dVal isReal ifTrue:[ |
|
4389 |
"/ 'JAVAVM [info]: missing double flag in Math>>exp' infoPrintCR. |
|
4390 |
"/ ] ifFalse:[ |
|
4391 |
"/ self halt:'expected double arg' |
|
4392 |
"/ ] |
|
4393 |
"/ ]. |
|
342 | 4394 |
^ dVal exp |
4395 |
||
4396 |
"Created: / 7.5.1998 / 00:36:19 / cg" |
|
432 | 4397 |
"Modified: / 11.11.1998 / 15:07:50 / cg" |
342 | 4398 |
! |
4399 |
||
255 | 4400 |
_Math_floor:nativeContext |
4401 |
"floor" |
|
4402 |
||
4403 |
|dVal| |
|
4404 |
||
4405 |
dVal := nativeContext argAt:1. |
|
432 | 4406 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4407 |
"/ dVal isReal ifTrue:[ |
|
4408 |
"/ 'JAVAVM [info]: missing double flag in Math>>floor' infoPrintCR. |
|
4409 |
"/ ] ifFalse:[ |
|
4410 |
"/ self halt:'expected double arg' |
|
4411 |
"/ ] |
|
4412 |
"/ ]. |
|
255 | 4413 |
^ dVal floorAsFloat |
4414 |
||
4415 |
"Created: / 7.1.1998 / 19:09:21 / cg" |
|
432 | 4416 |
"Modified: / 11.11.1998 / 15:07:45 / cg" |
255 | 4417 |
! |
4418 |
||
4419 |
_Math_log:nativeContext |
|
4420 |
"logarithm" |
|
4421 |
||
4422 |
|dVal| |
|
4423 |
||
4424 |
dVal := nativeContext argAt:1. |
|
432 | 4425 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4426 |
"/ dVal isReal ifTrue:[ |
|
4427 |
"/ 'JAVAVM [info]: missing double flag in Math>>log' infoPrintCR. |
|
4428 |
"/ ] ifFalse:[ |
|
4429 |
"/ self halt:'expected double arg' |
|
4430 |
"/ ] |
|
4431 |
"/ ]. |
|
255 | 4432 |
^ dVal log |
4433 |
||
4434 |
"Created: / 7.1.1998 / 15:42:19 / cg" |
|
432 | 4435 |
"Modified: / 11.11.1998 / 15:07:38 / cg" |
255 | 4436 |
! |
4437 |
||
4438 |
_Math_pow:nativeContext |
|
4439 |
"power" |
|
4440 |
||
4441 |
|dVal1 dVal2| |
|
4442 |
||
4443 |
dVal1 := nativeContext argAt:1. |
|
432 | 4444 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4445 |
"/ dVal1 isReal ifTrue:[ |
|
4446 |
"/ 'JAVAVM [info]: missing double flag in Math>>pow' infoPrintCR. |
|
4447 |
"/ ] ifFalse:[ |
|
4448 |
"/ self halt:'expected double arg' |
|
4449 |
"/ ] |
|
4450 |
"/ ]. |
|
255 | 4451 |
dVal2 := nativeContext argAt:3. |
432 | 4452 |
"/ (nativeContext argAt:4) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4453 |
"/ dVal2 isReal ifTrue:[ |
|
4454 |
"/ 'JAVAVM [info]: missing double flag in Math>>pow' infoPrintCR. |
|
4455 |
"/ ] ifFalse:[ |
|
4456 |
"/ self halt:'expected double arg' |
|
4457 |
"/ ] |
|
4458 |
"/ ]. |
|
255 | 4459 |
^ dVal1 raisedTo:dVal2 |
4460 |
||
4461 |
"Created: / 7.1.1998 / 15:44:13 / cg" |
|
432 | 4462 |
"Modified: / 11.11.1998 / 15:07:33 / cg" |
255 | 4463 |
! |
4464 |
||
440 | 4465 |
_Math_rint:nativeContext |
4466 |
UnimplementedNativeMethodSignal raise |
|
4467 |
||
4468 |
"Created: / 12.11.1998 / 18:52:47 / cg" |
|
4469 |
! |
|
4470 |
||
255 | 4471 |
_Math_sin:nativeContext |
4472 |
"sine" |
|
4473 |
||
4474 |
|dVal| |
|
4475 |
||
4476 |
dVal := nativeContext argAt:1. |
|
432 | 4477 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4478 |
"/ dVal isReal ifTrue:[ |
|
4479 |
"/ 'JAVAVM [info]: missing double flag in Math>>sin' infoPrintCR. |
|
4480 |
"/ ] ifFalse:[ |
|
4481 |
"/ self halt:'expected double arg' |
|
4482 |
"/ ] |
|
4483 |
"/ ]. |
|
255 | 4484 |
^ dVal sin |
4485 |
||
4486 |
"Created: / 7.1.1998 / 15:41:40 / cg" |
|
432 | 4487 |
"Modified: / 11.11.1998 / 15:07:09 / cg" |
255 | 4488 |
! |
4489 |
||
4490 |
_Math_sqrt:nativeContext |
|
4491 |
"square root" |
|
4492 |
||
4493 |
|dVal| |
|
4494 |
||
4495 |
dVal := nativeContext argAt:1. |
|
432 | 4496 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4497 |
"/ dVal isReal ifTrue:[ |
|
4498 |
"/ 'JAVAVM [info]: missing double flag in Math>>sqrt' infoPrintCR. |
|
4499 |
"/ ] ifFalse:[ |
|
4500 |
"/ self halt:'expected double arg' |
|
4501 |
"/ ] |
|
4502 |
"/ ]. |
|
4503 |
||
4504 |
"/ how about domain errors ? |
|
4505 |
dVal < 0 ifTrue:[ |
|
4506 |
"/ ^ 0.0 |
|
255 | 4507 |
]. |
4508 |
^ dVal sqrt |
|
4509 |
||
4510 |
"Created: / 7.1.1998 / 15:42:40 / cg" |
|
432 | 4511 |
"Modified: / 11.11.1998 / 15:06:55 / cg" |
255 | 4512 |
! |
4513 |
||
342 | 4514 |
_Math_tan:nativeContext |
4515 |
"tangent" |
|
4516 |
||
4517 |
|dVal| |
|
4518 |
||
4519 |
dVal := nativeContext argAt:1. |
|
432 | 4520 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4521 |
"/ dVal isReal ifTrue:[ |
|
4522 |
"/ 'JAVAVM [info]: missing double flag in Math>>tan' infoPrintCR. |
|
4523 |
"/ ] ifFalse:[ |
|
4524 |
"/ self halt:'expected double arg' |
|
4525 |
"/ ] |
|
4526 |
"/ ]. |
|
342 | 4527 |
^ dVal tan |
4528 |
||
4529 |
"Created: / 7.5.1998 / 00:34:03 / cg" |
|
432 | 4530 |
"Modified: / 11.11.1998 / 15:07:14 / cg" |
342 | 4531 |
! |
4532 |
||
334 | 4533 |
_Method_getModifiers:nativeContext |
4534 |
|jMethod mthd retVal| |
|
4535 |
||
4536 |
jMethod := nativeContext receiver. |
|
4537 |
||
4538 |
mthd := JavaMethods at:jMethod ifAbsent:nil. |
|
4539 |
mthd isNil ifTrue:[ |
|
4540 |
self halt. |
|
4541 |
^ 0 |
|
4542 |
]. |
|
4543 |
^ mthd accessFlags |
|
4544 |
||
4545 |
"Modified: / 9.4.1998 / 17:50:01 / cg" |
|
4546 |
! |
|
4547 |
||
322 | 4548 |
_Method_invoke:nativeContext |
4549 |
"invoke a javaMethod" |
|
4550 |
||
4551 |
|jMethod mthd rec args retVal| |
|
4552 |
||
4553 |
jMethod := nativeContext receiver. |
|
4554 |
rec := nativeContext argAt:1. |
|
4555 |
args := nativeContext argAt:2. |
|
4556 |
||
4557 |
mthd := JavaMethods at:jMethod ifAbsent:nil. |
|
4558 |
mthd isNil ifTrue:[ |
|
4559 |
self halt. |
|
4560 |
]. |
|
4561 |
||
4562 |
"/ check for arguments to match the expected types ... |
|
4563 |
||
4564 |
mthd argSignature keysAndValuesDo:[:index :argSig | |
|
4565 |
|cls arg| |
|
4566 |
||
4567 |
cls := Java at:argSig. |
|
4568 |
arg := args at:index. |
|
4569 |
(arg isKindOf:cls) ifFalse:[ |
|
4570 |
self halt. |
|
4571 |
] |
|
4572 |
]. |
|
4573 |
||
4574 |
mthd isStatic ifTrue:[ |
|
4575 |
retVal := mthd valueWithReceiver:(mthd javaClass) arguments:args selector:mthd selector. |
|
4576 |
^ retVal |
|
4577 |
] ifFalse:[ |
|
4578 |
self halt. |
|
4579 |
]. |
|
4580 |
||
4581 |
self halt. |
|
4582 |
||
4583 |
"Created: / 13.2.1998 / 15:15:28 / cg" |
|
4584 |
"Modified: / 13.2.1998 / 15:35:54 / cg" |
|
4585 |
! |
|
4586 |
||
253 | 4587 |
_Object_clone:nativeContext |
4588 |
"clone an object" |
|
4589 |
||
4590 |
|o rslt| |
|
4591 |
||
4592 |
o := nativeContext receiver. |
|
4593 |
rslt := o shallowCopy. |
|
4594 |
^ rslt |
|
4595 |
||
4596 |
"Created: / 4.1.1998 / 19:39:26 / cg" |
|
4597 |
! |
|
4598 |
||
255 | 4599 |
_Object_getClass:nativeContext |
4600 |
"return an objects class" |
|
4601 |
||
4602 |
|o cls jClass| |
|
4603 |
||
4604 |
o := nativeContext receiver. |
|
4605 |
cls := o class. |
|
4606 |
||
268
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
4607 |
jClass := self javaClassObjectForClass:cls. |
255 | 4608 |
^ jClass |
4609 |
||
4610 |
"Created: / 6.1.1998 / 18:28:27 / cg" |
|
268
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
4611 |
"Modified: / 23.1.1998 / 17:48:22 / cg" |
255 | 4612 |
! |
4613 |
||
253 | 4614 |
_Object_hashCode:nativeContext |
4615 |
"identityHash" |
|
4616 |
||
4617 |
|o rslt| |
|
4618 |
||
4619 |
o := nativeContext receiver. |
|
4620 |
rslt := o identityHash. |
|
4621 |
^ rslt |
|
4622 |
||
4623 |
"Created: / 4.1.1998 / 19:40:26 / cg" |
|
4624 |
! |
|
4625 |
||
255 | 4626 |
_Object_notify:nativeContext |
4627 |
"wakeup" |
|
4628 |
||
4629 |
self wakeup:(nativeContext receiver). |
|
4630 |
||
4631 |
"Created: / 6.1.1998 / 21:09:26 / cg" |
|
4632 |
! |
|
4633 |
||
253 | 4634 |
_Object_notifyAll:nativeContext |
4635 |
self wakeupAll:(nativeContext receiver). |
|
4636 |
||
4637 |
"Created: / 3.1.1998 / 03:06:56 / cg" |
|
4638 |
! |
|
4639 |
||
4640 |
_Object_wait:nativeMethodContext |
|
4641 |
"wait" |
|
4642 |
||
4643 |
|tmo handle sema enteredMonitors| |
|
4644 |
||
4645 |
handle := nativeMethodContext receiver. |
|
4646 |
tmo := nativeMethodContext argAt:1. |
|
4647 |
||
4648 |
sema := JavaVM semaphoreFor:handle. |
|
4649 |
||
4650 |
"/ temporarily leave all entered monitors. |
|
4651 |
||
4652 |
enteredMonitors := self enteredMonitors. |
|
4653 |
||
4654 |
enteredMonitors size > 0 ifTrue:[ |
|
306 | 4655 |
MonitorTrace ifTrue:[ |
4656 |
('====> wait - exit ' , enteredMonitors size printString , ' monitors in ' , Processor activeProcess name , ' ...') infoPrintCR. |
|
4657 |
]. |
|
4658 |
enteredMonitors do:[:handle | |
|
4659 |
|mon| |
|
4660 |
||
4661 |
mon := LockTable at:handle ifAbsent:nil. |
|
4662 |
mon isNil ifTrue:[ |
|
4663 |
self halt:'no monitor in wait'. |
|
4664 |
] ifFalse:[ |
|
4665 |
MonitorTrace ifTrue:[ |
|
4666 |
('====> wait - exit monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. |
|
4667 |
]. |
|
4668 |
mon exit. |
|
4669 |
]. |
|
4670 |
]. |
|
253 | 4671 |
]. |
4672 |
||
4673 |
[ |
|
306 | 4674 |
ThreadTrace ifTrue:[ |
4675 |
('====> thread ' , Processor activeProcess name , ' waiting ...') infoPrintCR. |
|
4676 |
]. |
|
307 | 4677 |
Processor activeProcess state:#javaWait. |
306 | 4678 |
tmo = 0 ifTrue:[ |
4679 |
sema wait. |
|
4680 |
] ifFalse:[ |
|
4681 |
sema waitWithTimeout:tmo / 1000. |
|
4682 |
]. |
|
4683 |
] valueOnUnwindDo: "valueNowOrOnUnwindDo:" [ |
|
4684 |
JavaVM releaseSemaphoreFor:handle. |
|
253 | 4685 |
]. |
4686 |
||
4687 |
"/ re-enter monitors. |
|
4688 |
||
4689 |
enteredMonitors size > 0 ifTrue:[ |
|
306 | 4690 |
MonitorTrace ifTrue:[ |
4691 |
('====> wait - reenter ' , enteredMonitors size printString , ' monitors in ' , Processor activeProcess name , ' ...') infoPrintCR. |
|
4692 |
]. |
|
4693 |
enteredMonitors do:[:handle | |
|
4694 |
|mon| |
|
4695 |
||
4696 |
LockTableAccess critical:[ |
|
4697 |
mon := LockTable at:handle ifAbsent:nil. |
|
4698 |
mon isNil ifTrue:[ |
|
4699 |
LockTable at:handle put:(mon := Monitor new) |
|
4700 |
] |
|
4701 |
]. |
|
4702 |
MonitorTrace ifTrue:[ |
|
4703 |
('====> wait - reenter monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. |
|
4704 |
]. |
|
4705 |
mon enter. |
|
4706 |
] |
|
253 | 4707 |
]. |
4708 |
||
4709 |
ThreadTrace ifTrue:[ |
|
306 | 4710 |
'====> thread continues ...' printCR. |
253 | 4711 |
] |
4712 |
||
426 | 4713 |
"Modified: / 5.11.1998 / 20:42:46 / cg" |
253 | 4714 |
! |
4715 |
||
4716 |
_Runtime_buildLibName:nativeContext |
|
4717 |
|jPath jFileName path fileName libName| |
|
4718 |
||
4719 |
jPath := nativeContext argAt:1. |
|
4720 |
jFileName := nativeContext argAt:2. |
|
4721 |
||
4722 |
path := Java as_ST_String:jPath. |
|
4723 |
fileName := Java as_ST_String:jFileName. |
|
4724 |
||
4725 |
path = '__builtIn__' ifTrue:[ |
|
261 | 4726 |
libName := path , '/' , fileName |
253 | 4727 |
] ifFalse:[ |
261 | 4728 |
libName := path , '/lib' , fileName , '.so'. |
253 | 4729 |
]. |
4730 |
^ Java as_String:libName. |
|
4731 |
||
4732 |
"Modified: / 8.8.1997 / 12:05:05 / cg" |
|
4733 |
"Created: / 4.1.1998 / 19:07:14 / cg" |
|
4734 |
! |
|
4735 |
||
261 | 4736 |
_Runtime_execInternal:nativeContext |
4737 |
"Run a unix-command; return a process object." |
|
4738 |
||
4739 |
|cmdAndArgArray envArray cmd jProcessClass jProcess| |
|
4740 |
||
432 | 4741 |
cmdAndArgArray := nativeContext argAt:1. |
4742 |
envArray := nativeContext argAt:2. |
|
4743 |
||
4744 |
cmd := cmdAndArgArray at:1. |
|
4745 |
||
4746 |
OperatingSystem isUNIXlike ifTrue:[ |
|
4747 |
jProcessClass := Java classForName:'java.lang.UNIXProcess'. |
|
4748 |
] ifFalse:[ |
|
4749 |
jProcessClass := Java classForName:'java.lang.Win32Process'. |
|
4750 |
]. |
|
261 | 4751 |
"/ |
432 | 4752 |
jProcessClass notNil ifTrue:[ |
4753 |
jProcess := jProcessClass newCleared. |
|
4754 |
jProcess |
|
4755 |
perform:#'<init>([Ljava/lang/String;[Ljava/lang/String;)V' |
|
4756 |
with:cmdAndArgArray |
|
4757 |
with:envArray. |
|
4758 |
^ jProcess |
|
4759 |
]. |
|
4760 |
self halt. |
|
261 | 4761 |
self throwIOExceptionWithMessage:'Process execution disabled/unimplemented'. |
4762 |
^ nil |
|
4763 |
||
4764 |
"Created: / 15.1.1998 / 01:50:31 / cg" |
|
432 | 4765 |
"Modified: / 10.11.1998 / 19:54:29 / cg" |
261 | 4766 |
! |
4767 |
||
255 | 4768 |
_Runtime_exitInternal:nativeContext |
4769 |
"exit - here, we only shut down java threads" |
|
4770 |
||
4771 |
|enteredMonitors| |
|
4772 |
||
4773 |
(enteredMonitors := self enteredMonitors) size > 0 ifTrue:[ |
|
306 | 4774 |
enteredMonitors do:[:handle | |
4775 |
| mon | |
|
4776 |
||
4777 |
mon := LockTable at:handle ifAbsent:nil. |
|
4778 |
mon isNil ifTrue:[ |
|
4779 |
self halt:'no monitor in exitInternal'. |
|
4780 |
] ifFalse:[ |
|
4781 |
mon exit. |
|
255 | 4782 |
('====> terminateThread - exit monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. |
4783 |
"/ LockTableAccess critical:[ |
|
4784 |
"/ mon isFree ifTrue:[ |
|
4785 |
"/ LockTable removeKey:handle |
|
4786 |
"/ ] |
|
4787 |
"/ ] |
|
306 | 4788 |
]. |
4789 |
]. |
|
4790 |
]. |
|
4791 |
||
4792 |
"/ JavaVM releaseAllJavaResources. |
|
255 | 4793 |
AbortSignal raise. |
4794 |
self halt. |
|
4795 |
||
4796 |
"Created: / 7.1.1998 / 22:48:51 / cg" |
|
306 | 4797 |
"Modified: / 3.2.1998 / 16:13:39 / cg" |
255 | 4798 |
! |
4799 |
||
4800 |
_Runtime_freeMemory:nativeContext |
|
4801 |
"free memory - Returns the number of free bytes" |
|
4802 |
||
4803 |
^ ObjectMemory freeListSpace + ObjectMemory freeSpace |
|
4804 |
||
4805 |
"Created: / 12.1.1998 / 12:59:53 / cg" |
|
4806 |
! |
|
4807 |
||
4808 |
_Runtime_gc:nativeContext |
|
4809 |
"Runs the garbage collector. |
|
4810 |
Ignored, since the ST-gc runs all the time." |
|
4811 |
||
4812 |
^ self |
|
4813 |
||
4814 |
"Modified: / 12.1.1998 / 12:58:32 / cg" |
|
4815 |
! |
|
4816 |
||
253 | 4817 |
_Runtime_initializeLinkerInternal:nativeContext |
4818 |
"init sharedLib linker, return searchPath as javaString" |
|
4819 |
||
4820 |
|path| |
|
4821 |
||
4822 |
"/ mhmh - what is done here ? |
|
4823 |
||
4824 |
path := ''. |
|
4825 |
LibPath do:[:comp | path size == 0 ifTrue:[ |
|
261 | 4826 |
path := path , comp |
4827 |
] ifFalse:[ |
|
4828 |
path := path , ':' , comp |
|
4829 |
] |
|
4830 |
]. |
|
253 | 4831 |
|
4832 |
^ Java as_String:path |
|
4833 |
||
4834 |
"Modified: / 7.8.1997 / 21:17:03 / cg" |
|
4835 |
"Created: / 4.1.1998 / 17:53:15 / cg" |
|
4836 |
! |
|
4837 |
||
4838 |
_Runtime_loadFileInternal:nativeContext |
|
4839 |
"load a sharedLib, return boolean 0 (false) if fail; 1 (true) if ok" |
|
4840 |
||
4841 |
|ret| |
|
4842 |
||
4843 |
ret := self _Runtime_loadFileInternalI:nativeContext. |
|
4844 |
ret < 0 ifTrue:[ ret := 0 ]. |
|
4845 |
^ ret |
|
4846 |
||
4847 |
"Created: / 4.1.1998 / 19:10:20 / cg" |
|
4848 |
"Modified: / 4.1.1998 / 19:11:04 / cg" |
|
4849 |
! |
|
4850 |
||
4851 |
_Runtime_loadFileInternalI:nativeContext |
|
4852 |
"1.1b3 change; load a sharedLib like 'loadFileInternal', |
|
4853 |
but return integer: |
|
319 | 4854 |
-1 outOfMemory error |
4855 |
0 failed to load |
|
4856 |
1 loaded or already loaded (i.e. ok)" |
|
253 | 4857 |
|
4858 |
|jLibName libName libHandle| |
|
4859 |
||
4860 |
jLibName := nativeContext argAt:1. |
|
4861 |
libName := Java as_ST_String:jLibName. |
|
4862 |
||
4863 |
(SimulatedLibs includes:libName) ifTrue:[ |
|
319 | 4864 |
"/ ('JAVA: builtIn libLoad simulated: ' , libName) printNL. |
4865 |
^ 1 |
|
253 | 4866 |
]. |
4867 |
(LoadedLibs notNil and:[LoadedLibs includesKey:libName]) ifTrue:[ |
|
319 | 4868 |
"/ ('JAVA: already loaded: ' , libName) printNL. |
4869 |
^ 1 |
|
253 | 4870 |
]. |
4871 |
||
4872 |
libName asFilename exists ifFalse:[ |
|
319 | 4873 |
('JAVA: no file to load: ' , libName) printNL. |
4874 |
^ 0 |
|
4875 |
]. |
|
4876 |
||
4877 |
(self confirm:'permission to load native library: ' , libName , ' ?') ifFalse:[ |
|
4878 |
^ 0 |
|
253 | 4879 |
]. |
4880 |
||
4881 |
libHandle := ObjectFileLoader loadLibrary:libName. |
|
4882 |
libHandle isNil ifTrue:[ |
|
319 | 4883 |
('JAVA: failed to load: ' , libName) printNL. |
4884 |
^ 0 |
|
253 | 4885 |
]. |
4886 |
||
4887 |
LoadedLibs isNil ifTrue:[ |
|
319 | 4888 |
LoadedLibs := Dictionary new. |
253 | 4889 |
]. |
4890 |
||
4891 |
LoadedLibs at:libName put:libHandle. |
|
4892 |
^ 1 |
|
4893 |
||
4894 |
"Created: / 4.1.1998 / 19:10:54 / cg" |
|
319 | 4895 |
"Modified: / 6.2.1998 / 03:11:59 / cg" |
253 | 4896 |
! |
4897 |
||
440 | 4898 |
_Runtime_runFinalization:nativeContext |
4899 |
"/ void runFinalization () |
|
4900 |
UnimplementedNativeMethodSignal raise |
|
4901 |
||
4902 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4903 |
"Created: / 12.11.1998 / 18:59:01 / cg" |
|
4904 |
! |
|
4905 |
||
380 | 4906 |
_Runtime_runFinalizersOnExit0:nativeContext |
4907 |
"" |
|
4908 |
||
4909 |
|onOff| |
|
4910 |
||
4911 |
onOff := nativeContext argAt:1. |
|
4912 |
^ 1 |
|
4913 |
||
4914 |
"Modified: / 6.2.1998 / 03:11:59 / cg" |
|
4915 |
"Created: / 15.10.1998 / 23:34:55 / cg" |
|
4916 |
! |
|
4917 |
||
255 | 4918 |
_Runtime_totalMemory:nativeContext |
4919 |
"free memory - Returns the total number of bytes" |
|
4920 |
||
4921 |
^ ObjectMemory oldSpaceSize + ObjectMemory newSpaceSize |
|
4922 |
||
4923 |
"Created: / 12.1.1998 / 12:59:23 / cg" |
|
4924 |
! |
|
4925 |
||
440 | 4926 |
_Runtime_traceInstructions:nativeContext |
4927 |
"/ void traceInstructions (boolean) |
|
4928 |
UnimplementedNativeMethodSignal raise |
|
4929 |
||
4930 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4931 |
"Created: / 12.11.1998 / 18:59:18 / cg" |
|
4932 |
! |
|
4933 |
||
4934 |
_Runtime_traceMethodCalls:nativeContext |
|
4935 |
"/ void traceMethodCalls (boolean) |
|
4936 |
UnimplementedNativeMethodSignal raise |
|
4937 |
||
4938 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4939 |
"Created: / 12.11.1998 / 18:59:37 / cg" |
|
4940 |
! |
|
4941 |
||
4942 |
_SecurityManager_classDepth:nativeContext |
|
4943 |
UnimplementedNativeMethodSignal raise |
|
4944 |
||
4945 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4946 |
"Created: / 12.11.1998 / 18:56:27 / cg" |
|
4947 |
! |
|
4948 |
||
261 | 4949 |
_SecurityManager_classLoaderDepth:nativeContext |
4950 |
|con depth| |
|
4951 |
||
4952 |
con := thisContext sender. |
|
4953 |
depth := 1. |
|
4954 |
[con notNil] whileTrue:[ |
|
4955 |
con receiver == JavaClassReader classLoaderQuerySignal ifTrue:[ |
|
4956 |
con selector == #handle:do: ifTrue:[ |
|
4957 |
depth := depth + 1 |
|
4958 |
] |
|
4959 |
]. |
|
4960 |
con := con sender. |
|
4961 |
]. |
|
4962 |
'JAVA: classLoaderDepth -> ' infoPrint. depth infoPrintCR. |
|
4963 |
^ depth. |
|
4964 |
||
4965 |
"Created: / 13.1.1998 / 09:21:46 / cg" |
|
4966 |
"Modified: / 13.1.1998 / 09:33:43 / cg" |
|
4967 |
! |
|
4968 |
||
4969 |
_SecurityManager_currentClassLoader:nativeContext |
|
4970 |
|loader| |
|
4971 |
||
4972 |
loader := JavaClassReader classLoaderQuerySignal raise. |
|
4973 |
'JAVA: currentClassLoader -> ' infoPrint. loader displayString infoPrintCR. |
|
4974 |
^ loader. |
|
4975 |
||
4976 |
"Created: / 13.1.1998 / 09:23:28 / cg" |
|
4977 |
! |
|
4978 |
||
440 | 4979 |
_SecurityManager_currentLoadedClass0:nativeContext |
4980 |
UnimplementedNativeMethodSignal raise |
|
4981 |
||
4982 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4983 |
"Created: / 12.11.1998 / 18:56:41 / cg" |
|
4984 |
! |
|
4985 |
||
4986 |
_SecurityManager_getClassContext:nativeContext |
|
4987 |
UnimplementedNativeMethodSignal raise |
|
4988 |
||
4989 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4990 |
"Created: / 12.11.1998 / 18:56:06 / cg" |
|
4991 |
! |
|
4992 |
||
4993 |
_String_intern:nativeContext |
|
4994 |
UnimplementedNativeMethodSignal raise |
|
4995 |
||
4996 |
"Created: / 12.11.1998 / 18:50:56 / cg" |
|
4997 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4998 |
! |
|
4999 |
||
253 | 5000 |
_System_arraycopy:nativeContext |
398 | 5001 |
|srcArray srcIdx dstArray dstIdx count dstEndIdx| |
253 | 5002 |
|
5003 |
srcArray := nativeContext argAt:1. |
|
5004 |
srcIdx := nativeContext argAt:2. |
|
5005 |
dstArray := nativeContext argAt:3. |
|
5006 |
dstIdx := nativeContext argAt:4. |
|
5007 |
count := nativeContext argAt:5. |
|
5008 |
||
398 | 5009 |
dstEndIdx := dstIdx + count. |
5010 |
dstIdx := dstIdx + 1. "/ ST uses 1-based indexing |
|
5011 |
srcIdx := srcIdx + 1. "/ ST uses 1-based indexing |
|
5012 |
||
253 | 5013 |
srcArray class isBytes ifTrue:[ |
398 | 5014 |
dstArray class isBytes ifFalse:[ |
5015 |
self halt:'incompatible arraycopy collections'. |
|
5016 |
]. |
|
5017 |
dstArray replaceBytesFrom:dstIdx to:dstEndIdx with:srcArray startingAt:srcIdx. |
|
253 | 5018 |
] ifFalse:[ |
398 | 5019 |
dstArray replaceFrom:dstIdx to:dstEndIdx with:srcArray startingAt:srcIdx. |
253 | 5020 |
]. |
5021 |
^ nil. |
|
5022 |
||
5023 |
"Created: / 3.1.1998 / 01:56:44 / cg" |
|
398 | 5024 |
"Modified: / 20.10.1998 / 16:22:46 / cg" |
253 | 5025 |
! |
5026 |
||
5027 |
_System_currentTimeMillis:nativeContext |
|
5028 |
"return the milliseconds since 1.jan.1970" |
|
5029 |
||
368 | 5030 |
|seconds delta| |
5031 |
||
5032 |
"/ workaround win32 bug (use 01:01:01 as base) |
|
5033 |
delta := AbsoluteTime now millisecondDeltaFrom:(AbsoluteTime day:1 month:1 year:1970 hour:1 minutes:1 seconds:1). |
|
5034 |
delta := delta - 3600 - 60 - 1. |
|
409 | 5035 |
"/ make certain, it fits 64 signed bits |
5036 |
delta := delta bitAnd:16r7FFFFFFFFFFFFFFF. |
|
368 | 5037 |
^ delta max:0 |
253 | 5038 |
|
5039 |
"Created: / 3.1.1998 / 03:25:50 / cg" |
|
409 | 5040 |
"Modified: / 2.11.1998 / 16:42:00 / cg" |
253 | 5041 |
! |
5042 |
||
440 | 5043 |
_System_identityHashCode:nativeContext |
5044 |
UnimplementedNativeMethodSignal raise |
|
5045 |
||
5046 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5047 |
"Created: / 12.11.1998 / 18:54:00 / cg" |
|
5048 |
! |
|
5049 |
||
253 | 5050 |
_System_initProperties:nativeContext |
5051 |
|props stProps| |
|
5052 |
||
5053 |
props := nativeContext argAt:1. |
|
5054 |
stProps := self systemProperties. |
|
5055 |
||
5056 |
"/ recursively invoke myself on the Java HashTable. |
|
5057 |
"/ calling 'put' to stuff in the values ... |
|
5058 |
||
5059 |
stProps keysAndValuesDo:[:key :value | |
|
270 | 5060 |
|keyObj valueObj| |
5061 |
||
5062 |
keyObj := Java as_String:key. |
|
5063 |
valueObj := Java as_String:value. |
|
5064 |
||
5065 |
props |
|
5066 |
perform:#'put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' |
|
5067 |
with:keyObj |
|
5068 |
with:valueObj. |
|
253 | 5069 |
]. |
5070 |
^ props |
|
5071 |
||
5072 |
"Created: / 3.1.1998 / 14:25:22 / cg" |
|
5073 |
"Modified: / 4.1.1998 / 14:23:18 / cg" |
|
5074 |
! |
|
5075 |
||
5076 |
_System_setErr0:nativeContext |
|
5077 |
|stream| |
|
5078 |
||
5079 |
stream := nativeContext argAt:1. |
|
5080 |
||
5081 |
self setOpenFile:(self javaConsoleStream ? Stderr) at:2. |
|
5082 |
||
5083 |
nativeContext receiver instVarNamed:'err' put:stream. |
|
5084 |
||
5085 |
"Created: / 18.3.1997 / 15:02:05 / cg" |
|
5086 |
"Modified: / 4.1.1998 / 16:21:15 / cg" |
|
5087 |
! |
|
5088 |
||
5089 |
_System_setIn0:nativeContext |
|
5090 |
|stream| |
|
5091 |
||
5092 |
stream := nativeContext argAt:1. |
|
5093 |
||
5094 |
self setOpenFile:Stdin at:0. |
|
5095 |
||
5096 |
nativeContext receiver instVarNamed:'in' put:stream. |
|
5097 |
||
5098 |
"Created: / 4.1.1998 / 16:16:38 / cg" |
|
5099 |
"Modified: / 4.1.1998 / 16:20:44 / cg" |
|
5100 |
! |
|
5101 |
||
5102 |
_System_setOut0:nativeContext |
|
5103 |
|stream| |
|
5104 |
||
5105 |
stream := nativeContext argAt:1. |
|
5106 |
||
5107 |
self setOpenFile:(self javaConsoleStream ? Stdout) at:1. |
|
5108 |
||
5109 |
nativeContext receiver instVarNamed:'out' put:stream. |
|
5110 |
||
5111 |
"Created: / 4.1.1998 / 16:18:26 / cg" |
|
5112 |
"Modified: / 4.1.1998 / 16:20:23 / cg" |
|
5113 |
! |
|
5114 |
||
440 | 5115 |
_Thread_countStackFrames:nativeContext |
5116 |
"/ int countStackFrames () |
|
5117 |
UnimplementedNativeMethodSignal raise |
|
5118 |
||
5119 |
"Created: / 12.11.1998 / 19:06:21 / cg" |
|
5120 |
! |
|
5121 |
||
253 | 5122 |
_Thread_currentThread:nativeMethodContext |
5123 |
|t p prio| |
|
5124 |
||
5125 |
p := Processor activeProcess. |
|
5126 |
t := self javaThreadForSTProcess:p. |
|
5127 |
t notNil ifTrue:[ |
|
261 | 5128 |
^ t |
253 | 5129 |
]. |
5130 |
t := self newThread:'main'. |
|
5131 |
Java threads at:t put:p. |
|
5132 |
^ t |
|
5133 |
||
5134 |
"Created: / 3.1.1998 / 01:42:28 / cg" |
|
5135 |
"Modified: / 4.1.1998 / 14:59:13 / cg" |
|
5136 |
! |
|
5137 |
||
339 | 5138 |
_Thread_interrupt0:nativeContext |
5139 |
"ask if a thread is interrupted (clear interruptState if arg is true)" |
|
5140 |
||
5141 |
|jThread stProcess| |
|
5142 |
||
5143 |
jThread := nativeContext receiver. |
|
5144 |
stProcess := self stProcessForJavaThread:jThread. |
|
5145 |
stProcess isNil ifTrue:[ |
|
5146 |
self halt. |
|
5147 |
^ 0 |
|
5148 |
]. |
|
5149 |
||
5150 |
stProcess markInterrupted |
|
5151 |
||
5152 |
"Modified: / 2.1.1998 / 21:49:06 / cg" |
|
5153 |
"Created: / 10.4.1998 / 15:21:43 / cg" |
|
5154 |
! |
|
5155 |
||
253 | 5156 |
_Thread_isAlive:nativeContext |
5157 |
"is it alive ?" |
|
5158 |
||
5159 |
|jThread stProcess| |
|
5160 |
||
5161 |
jThread := nativeContext receiver. |
|
5162 |
stProcess := JavaVM stProcessForJavaThread:jThread. |
|
5163 |
stProcess isNil ifTrue:[ |
|
318 | 5164 |
ThreadTrace == true ifTrue:[ |
5165 |
('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL. |
|
5166 |
]. |
|
5167 |
^ 0 "FALSE" |
|
255 | 5168 |
]. |
5169 |
stProcess isDead ifTrue:[^ 0 "FALSE"]. |
|
5170 |
^ 1 "TRUE" |
|
5171 |
||
5172 |
"Created: / 5.1.1998 / 02:03:51 / cg" |
|
318 | 5173 |
"Modified: / 6.2.1998 / 02:15:01 / cg" |
255 | 5174 |
! |
5175 |
||
5176 |
_Thread_isInterrupted:nativeContext |
|
5177 |
"ask if a thread is interrupted (clear interruptState if arg is true)" |
|
5178 |
||
5179 |
|jThread stProcess clearInterrupt rslt| |
|
5180 |
||
5181 |
jThread := nativeContext receiver. |
|
5182 |
stProcess := self stProcessForJavaThread:jThread. |
|
5183 |
stProcess isNil ifTrue:[ |
|
261 | 5184 |
self halt. |
5185 |
^ 0 |
|
253 | 5186 |
]. |
255 | 5187 |
|
5188 |
clearInterrupt := nativeContext argAt:1. |
|
5189 |
rslt := stProcess isInterrupted ifTrue:[1] ifFalse:[0]. |
|
5190 |
clearInterrupt ~~ 0 ifTrue:[stProcess clearInterruptActions]. |
|
5191 |
^ rslt |
|
5192 |
||
5193 |
"Modified: / 2.1.1998 / 21:49:06 / cg" |
|
5194 |
"Created: / 7.1.1998 / 18:50:26 / cg" |
|
5195 |
! |
|
5196 |
||
5197 |
_Thread_resume0:nativeContext |
|
5198 |
"yield" |
|
5199 |
||
5200 |
|jThread stProcess| |
|
5201 |
||
5202 |
jThread := nativeContext receiver. |
|
5203 |
stProcess := JavaVM stProcessForJavaThread:jThread. |
|
5204 |
stProcess isNil ifTrue:[ |
|
318 | 5205 |
ThreadTrace == true ifTrue:[ |
5206 |
('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL. |
|
5207 |
]. |
|
5208 |
^ nil "void" |
|
255 | 5209 |
]. |
5210 |
stProcess resume |
|
5211 |
||
5212 |
"Created: / 8.1.1998 / 01:06:27 / cg" |
|
318 | 5213 |
"Modified: / 6.2.1998 / 02:15:08 / cg" |
253 | 5214 |
! |
5215 |
||
5216 |
_Thread_setPriority0:nativeMethodContext |
|
5217 |
|t p prio| |
|
5218 |
||
5219 |
t := nativeMethodContext receiver. |
|
5220 |
p := JavaVM stProcessForJavaThread:t. |
|
5221 |
prio := nativeMethodContext argAt:1. |
|
5222 |
||
5223 |
p isNil ifTrue:[ |
|
318 | 5224 |
ThreadTrace == true ifTrue:[ |
5225 |
'JAVA [info]: no process yet (in setPriority)' infoPrintCR. |
|
5226 |
]. |
|
5227 |
^ nil |
|
253 | 5228 |
]. |
5229 |
||
5230 |
ThreadTrace ifTrue:[ |
|
318 | 5231 |
'JAVA [info]: setPrio: ' print. t print. ' pri= ' print. prio print. ' p= ' print. p printNL. |
253 | 5232 |
]. |
5233 |
^ nil |
|
5234 |
||
5235 |
"Created: / 2.1.1998 / 19:05:55 / cg" |
|
318 | 5236 |
"Modified: / 6.2.1998 / 02:28:18 / cg" |
253 | 5237 |
! |
5238 |
||
255 | 5239 |
_Thread_sleep:nativeContext |
5240 |
"sleep for some milliseconds " |
|
5241 |
||
5242 |
|millis| |
|
5243 |
||
432 | 5244 |
millis := nativeContext argAt:1. |
5245 |
Delay waitForMilliseconds:(millis max:50) |
|
255 | 5246 |
|
5247 |
"Created: / 7.1.1998 / 15:34:23 / cg" |
|
432 | 5248 |
"Modified: / 10.11.1998 / 22:28:04 / cg" |
255 | 5249 |
! |
5250 |
||
253 | 5251 |
_Thread_start:nativeContext |
5252 |
"start the thread" |
|
5253 |
||
5254 |
|jThread jName name stProcess| |
|
5255 |
||
5256 |
jThread := nativeContext receiver. |
|
5257 |
(jThread instVarNamed:'priority') < 1 ifTrue:[ |
|
297 | 5258 |
self halt. |
5259 |
jThread instVarNamed:'priority' put:1. |
|
253 | 5260 |
]. |
5261 |
||
5262 |
stProcess := JavaProcess |
|
297 | 5263 |
for:[ |
405 | 5264 |
|procName| |
5265 |
||
5266 |
Object abortSignal handle:[:ex | |
|
5267 |
procName := stProcess name. |
|
5268 |
('JAVA: thread ' , procName , ' aborted - restarting process.') infoPrintCR. |
|
457 | 5269 |
"/ ex restart. |
405 | 5270 |
] do:[ |
297 | 5271 |
[ |
5272 |
JavaVM javaExceptionSignal handle:[:ex | |
|
405 | 5273 |
|exClass| |
297 | 5274 |
|
5275 |
procName := stProcess name. |
|
5276 |
exClass := ex parameter class. |
|
5277 |
||
5278 |
exClass == (Java at:'java.lang.ThreadDeath') ifTrue:[ |
|
5279 |
('JAVA: thread ' , procName , ' terminated') infoPrintCR. |
|
5280 |
] ifFalse:[ |
|
5281 |
Transcript |
|
5282 |
showCR:('JAVA: thread ''' |
|
5283 |
, procName |
|
5284 |
, ''' terminated with exception: ' |
|
5285 |
, exClass name). |
|
5286 |
]. |
|
5287 |
ex return. |
|
5288 |
] do:[ |
|
5289 |
jThread perform:#'run()V'. |
|
316 | 5290 |
ThreadTrace == true ifTrue:[ |
5291 |
('JAVA: thread ' , stProcess name , ' terminated') infoPrintCR. |
|
5292 |
]. |
|
297 | 5293 |
jThread perform:#'exit()V'. |
316 | 5294 |
ThreadTrace == true ifTrue:[ |
5295 |
('JAVA: after exit of thread ' , stProcess name) infoPrintCR. |
|
5296 |
] |
|
297 | 5297 |
] |
5298 |
] valueNowOrOnUnwindDo:[ |
|
5299 |
Java threads removeKey:jThread ifAbsent:[]. |
|
5300 |
] |
|
405 | 5301 |
] |
297 | 5302 |
] |
5303 |
priority:(Processor activePriority). |
|
253 | 5304 |
|
5305 |
jName := jThread instVarNamed:'name'. |
|
5306 |
jName isString ifFalse:[ |
|
297 | 5307 |
name := Java as_ST_String:jName. |
253 | 5308 |
] ifTrue:[ |
297 | 5309 |
name := jName |
5310 |
]. |
|
5311 |
||
5312 |
"/ kludge - remember the ScreenUpdater ... |
|
5313 |
name = 'Screen Updater' ifTrue:[ |
|
5314 |
ScreenUpdaterProcess := stProcess. |
|
253 | 5315 |
]. |
5316 |
||
5317 |
"/ when that process terminates, wakup any waiters |
|
5318 |
stProcess addExitAction:[self wakeup:jThread]. |
|
5319 |
||
5320 |
stProcess name:'JAVA-' , name. |
|
5321 |
stProcess resume. |
|
5322 |
||
5323 |
Java threads at:jThread put:stProcess. |
|
5324 |
||
5325 |
^ nil |
|
5326 |
||
5327 |
"Created: / 3.1.1998 / 02:05:52 / cg" |
|
457 | 5328 |
"Modified: / 17.11.1998 / 23:01:17 / cg" |
255 | 5329 |
! |
5330 |
||
5331 |
_Thread_stop0:nativeContext |
|
5332 |
"terminate a thread" |
|
5333 |
||
5334 |
|jThread stProcess death| |
|
5335 |
||
5336 |
jThread := nativeContext receiver. |
|
5337 |
||
5338 |
stProcess := JavaVM stProcessForJavaThread:jThread. |
|
5339 |
stProcess isNil ifTrue:[ |
|
318 | 5340 |
ThreadTrace == true ifTrue:[ |
5341 |
('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL. |
|
5342 |
]. |
|
5343 |
^ nil "void" |
|
255 | 5344 |
]. |
5345 |
death := nativeContext argAt:1. |
|
5346 |
stProcess |
|
318 | 5347 |
interruptWith:[ |
5348 |
JavaVM javaExceptionSignal handle:[:ex | |
|
5349 |
Processor activeProcess terminate |
|
5350 |
] do:[ |
|
5351 |
ThreadTrace == true ifTrue:[ |
|
5352 |
('JAVA: thread exit: ' , jThread displayString) infoPrintNL. |
|
5353 |
]. |
|
5354 |
jThread perform:#'exit()V'. |
|
5355 |
self throwException:death. |
|
5356 |
] |
|
5357 |
]. |
|
255 | 5358 |
stProcess resume. |
5359 |
||
5360 |
[stProcess isDead] whileFalse:[ |
|
318 | 5361 |
stProcess resume. |
5362 |
Delay waitForSeconds:0.1 |
|
255 | 5363 |
]. |
5364 |
stProcess terminate |
|
5365 |
||
5366 |
"Created: / 8.1.1998 / 13:11:17 / cg" |
|
318 | 5367 |
"Modified: / 6.2.1998 / 02:18:15 / cg" |
255 | 5368 |
! |
5369 |
||
5370 |
_Thread_suspend0:nativeContext |
|
5371 |
"yield" |
|
5372 |
||
5373 |
|jThread stProcess| |
|
5374 |
||
5375 |
jThread := nativeContext receiver. |
|
5376 |
stProcess := JavaVM stProcessForJavaThread:jThread. |
|
5377 |
stProcess isNil ifTrue:[ |
|
318 | 5378 |
ThreadTrace == true ifTrue:[ |
5379 |
('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL. |
|
5380 |
]. |
|
5381 |
^ nil "void" |
|
255 | 5382 |
]. |
5383 |
stProcess suspend |
|
5384 |
||
5385 |
"Created: / 8.1.1998 / 01:05:49 / cg" |
|
318 | 5386 |
"Modified: / 6.2.1998 / 02:15:23 / cg" |
255 | 5387 |
! |
5388 |
||
5389 |
_Thread_yield:nativeContext |
|
5390 |
"yield" |
|
5391 |
||
5392 |
|jThread stProcess| |
|
5393 |
||
5394 |
jThread := nativeContext receiver. |
|
5395 |
stProcess := JavaVM stProcessForJavaThread:jThread. |
|
5396 |
stProcess isNil ifTrue:[ |
|
318 | 5397 |
ThreadTrace == true ifTrue:[ |
5398 |
('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL. |
|
5399 |
]. |
|
5400 |
^ nil "void" |
|
255 | 5401 |
]. |
5402 |
stProcess == Processor activeProcess ifTrue:[ |
|
318 | 5403 |
Processor yield. |
255 | 5404 |
] ifFalse:[ |
318 | 5405 |
self halt. |
255 | 5406 |
]. |
5407 |
||
5408 |
"Created: / 5.1.1998 / 02:03:51 / cg" |
|
318 | 5409 |
"Modified: / 6.2.1998 / 02:15:29 / cg" |
253 | 5410 |
! |
5411 |
||
5412 |
_Throwable_fillInStackTrace:nativeContext |
|
255 | 5413 |
|exClass exceptionObject list con| |
253 | 5414 |
|
5415 |
exClass := Java classNamed:'java.lang.Throwable'. |
|
5416 |
||
5417 |
exceptionObject := nativeContext receiver. |
|
5418 |
||
5419 |
"/ |
|
5420 |
"/ debugging only |
|
5421 |
"/ |
|
5422 |
(exceptionObject isKindOf:(Java classNamed:'java.lang.Throwable')) ifFalse:[ |
|
347 | 5423 |
self halt |
253 | 5424 |
]. |
5425 |
||
5426 |
con := thisContext sender. |
|
5427 |
||
5428 |
"/ |
|
5429 |
"/ we are not interrested in all intermediate Exception frames ... |
|
5430 |
"/ |
|
5431 |
FullExceptionTrace ifFalse:[ |
|
347 | 5432 |
"/ first, skip any JavaVM contexts |
5433 |
[con receiver == exceptionObject] whileFalse:[ |
|
5434 |
con := con sender |
|
5435 |
]. |
|
5436 |
"/ then, all exception-init contexts |
|
5437 |
[con receiver == exceptionObject] whileTrue:[ |
|
5438 |
con := con sender |
|
5439 |
]. |
|
253 | 5440 |
]. |
5441 |
||
255 | 5442 |
list := OrderedCollection new. |
5443 |
[con notNil] whileTrue:[ |
|
347 | 5444 |
(con isJavaContext) ifTrue:[ |
5445 |
"/ add a copy, in case the context continues with some |
|
5446 |
"/ cleanup ... |
|
5447 |
list add:con shallowCopy |
|
5448 |
]. |
|
5449 |
con := con sender |
|
255 | 5450 |
]. |
5451 |
||
5452 |
exceptionObject instVarNamed:'backtrace' put:(list asArray). |
|
253 | 5453 |
|
5454 |
^ nil. |
|
5455 |
||
5456 |
"Created: / 4.1.1998 / 14:27:40 / cg" |
|
347 | 5457 |
"Modified: / 8.5.1998 / 21:29:53 / cg" |
255 | 5458 |
! |
5459 |
||
5460 |
_Throwable_printStackTrace0:nativeContext |
|
261 | 5461 |
|out outStream exceptionObject contextList| |
255 | 5462 |
|
5463 |
outStream := nativeContext argAt:1. |
|
5464 |
exceptionObject := nativeContext receiver. |
|
5465 |
||
5466 |
contextList := exceptionObject instVarNamed:'backtrace'. |
|
5467 |
||
261 | 5468 |
out := self javaConsoleStream. |
5469 |
out cr. |
|
5470 |
out nextPutLine:'JAVA: stackTrace:'. |
|
255 | 5471 |
|
5472 |
contextList do:[:con | |
|
429 | 5473 |
out |
5474 |
nextPutAll:' '; |
|
5475 |
nextPutAll:(con method javaClass fullName); |
|
5476 |
nextPutAll:'.'; |
|
5477 |
nextPutAll:(con method selector); |
|
5478 |
nextPutAll:' ['; |
|
5479 |
nextPutAll:(con method javaClass sourceFile); |
|
5480 |
nextPutAll:' '; |
|
5481 |
nextPutAll:(con quickLineNumber displayString); |
|
5482 |
nextPutAll:']'. |
|
5483 |
out cr |
|
261 | 5484 |
]. |
5485 |
out nextPutLine:'----------------------------------------------------' |
|
255 | 5486 |
|
5487 |
"Created: / 4.1.1998 / 14:27:40 / cg" |
|
429 | 5488 |
"Modified: / 10.11.1998 / 14:19:32 / cg" |
432 | 5489 |
! |
5490 |
||
5491 |
_Win32Process_create:nativeContext |
|
5492 |
"really create a win32 process" |
|
5493 |
||
5494 |
|env cmd jProcess p inPipe outPipe errorPipe| |
|
5495 |
||
5496 |
jProcess := nativeContext receiver. |
|
5497 |
cmd := nativeContext argAt:1. |
|
5498 |
cmd := Java as_ST_String:cmd. |
|
5499 |
||
5500 |
env := nativeContext argAt:2. |
|
5501 |
env notNil ifTrue:[ |
|
5502 |
self halt |
|
5503 |
]. |
|
5504 |
self halt. |
|
5505 |
||
5506 |
p := Win32Process new. |
|
5507 |
p command:cmd. |
|
5508 |
p environment:env. |
|
5509 |
p inStream:inPipe. |
|
5510 |
p outStream:outPipe. |
|
5511 |
p errorStream:errorPipe. |
|
5512 |
p directory:nil. |
|
5513 |
p startProcess. |
|
5514 |
self halt. |
|
5515 |
||
5516 |
jProcess instVarNamed:'handle' put:p. |
|
5517 |
||
5518 |
"Created: / 10.11.1998 / 19:50:31 / cg" |
|
5519 |
"Modified: / 10.11.1998 / 21:34:18 / cg" |
|
255 | 5520 |
! ! |
5521 |
||
277 | 5522 |
!JavaVM class methodsFor:'native - java.lang - jdk1.2'! |
5523 |
||
5524 |
_AccessController_beginPrivileged:nativeContext |
|
5525 |
"/ introduced with jdk1.2 |
|
5526 |
||
5527 |
"Created: / 27.1.1998 / 18:18:11 / cg" |
|
5528 |
! |
|
5529 |
||
5530 |
_AccessController_endPrivileged:nativeContext |
|
5531 |
"/ introduced with jdk1.2 |
|
5532 |
||
5533 |
"Created: / 27.1.1998 / 18:18:32 / cg" |
|
5534 |
! |
|
5535 |
||
5536 |
_AccessController_getStackAccessControlContext:nativeContext |
|
5537 |
"/ introduced with jdk1.2 |
|
5538 |
||
5539 |
"/ supposed to do more here ... |
|
5540 |
||
5541 |
^ nil |
|
5542 |
||
5543 |
"Created: / 27.1.1998 / 18:22:15 / cg" |
|
5544 |
! |
|
5545 |
||
5546 |
_ClassLoader$NativeLibrary_load:nativeContext |
|
5547 |
"/ introduced with jdk1.2 ... (sigh) |
|
5548 |
||
5549 |
|nativeLoader jLibName libName libHandle index| |
|
5550 |
||
5551 |
nativeLoader := nativeContext receiver. |
|
5552 |
jLibName := nativeContext argAt:1. |
|
5553 |
libName := Java as_ST_String:jLibName. |
|
5554 |
||
5555 |
(index := SimulatedNativeLibs indexOf:libName) ~~ 0 ifTrue:[ |
|
319 | 5556 |
"/ ('JAVA: builtIn nativeLibLoad simulated: ' , libName) printNL. |
277 | 5557 |
nativeLoader instVarNamed:'handle' put:index. |
5558 |
^ self "/ void |
|
5559 |
]. |
|
5560 |
(LoadedNativeLibs notNil |
|
5561 |
and:[LoadedNativeLibs includesKey:libName]) ifTrue:[ |
|
319 | 5562 |
"/ ('JAVA: native library already loaded: ' , libName) printNL. |
277 | 5563 |
nativeLoader instVarNamed:'handle' put:(LoadedNativeLibs at:libName). |
5564 |
^ self "/ void |
|
5565 |
]. |
|
319 | 5566 |
|
5567 |
(self confirm:'permission to load native library: ' , libName , ' ?') ifFalse:[ |
|
5568 |
^ self |
|
5569 |
]. |
|
284 | 5570 |
self halt. |
277 | 5571 |
|
5572 |
libName asFilename exists ifFalse:[ |
|
5573 |
('JAVA: no file to load nativeLib: ' , libName) printNL. |
|
5574 |
^ self "/ void |
|
5575 |
]. |
|
5576 |
||
5577 |
libHandle := ObjectFileLoader loadLibrary:libName. |
|
5578 |
libHandle isNil ifTrue:[ |
|
5579 |
('JAVA: failed to load nativeLib: ' , libName) printNL. |
|
5580 |
^ self "/ void |
|
5581 |
]. |
|
5582 |
||
5583 |
LoadedNativeLibs isNil ifTrue:[ |
|
5584 |
LoadedNativeLibs := Dictionary new. |
|
5585 |
]. |
|
5586 |
||
5587 |
LoadedNativeLibs at:libName put:libHandle. |
|
5588 |
nativeLoader instVarNamed:'handle' put:(LoadedNativeLibs at:libName). |
|
5589 |
^ self "/ void |
|
5590 |
||
5591 |
"Created: / 27.1.1998 / 18:38:37 / cg" |
|
319 | 5592 |
"Modified: / 6.2.1998 / 03:12:17 / cg" |
277 | 5593 |
! |
5594 |
||
5595 |
_ClassLoader_initIDs:nativeContext |
|
5596 |
"/ introduced with jdk1.2 ... (sigh) |
|
5597 |
||
5598 |
"Created: / 27.1.1998 / 18:37:08 / cg" |
|
5599 |
! |
|
5600 |
||
5601 |
_Component_initIDs:nativeContext |
|
5602 |
"/ introduced with jdk1.2 ... (sigh) |
|
5603 |
||
5604 |
"Created: / 27.1.1998 / 19:53:29 / cg" |
|
5605 |
! |
|
5606 |
||
5607 |
_System_getCallerClass:nativeContext |
|
5608 |
"/ introduced with jdk1.2 |
|
5609 |
||
5610 |
|senderContext cls| |
|
5611 |
||
5612 |
senderContext := nativeContext sender. |
|
5613 |
[senderContext receiver == (Java at:'java.lang.System')] whileTrue:[ |
|
5614 |
senderContext := senderContext sender. |
|
5615 |
]. |
|
5616 |
||
5617 |
senderContext method isStatic ifTrue:[ |
|
5618 |
cls := senderContext receiver |
|
5619 |
] ifFalse:[ |
|
5620 |
cls := senderContext receiver class |
|
5621 |
]. |
|
5622 |
cls isJavaClass ifTrue:[ |
|
5623 |
^ self javaClassObjectForClass:cls |
|
5624 |
]. |
|
5625 |
(cls isMemberOf:(Java at:'java.lang.Class')) ifTrue:[ |
|
5626 |
^ Java at:'java.lang.Class' |
|
5627 |
]. |
|
5628 |
self halt. |
|
5629 |
^ nil |
|
5630 |
||
5631 |
"Modified: / 27.1.1998 / 18:33:13 / cg" |
|
5632 |
! |
|
5633 |
||
5634 |
_Toolkit_initIDs:nativeContext |
|
5635 |
"/ introduced with jdk1.2 ... (sigh) |
|
5636 |
||
5637 |
"Created: / 27.1.1998 / 19:53:50 / cg" |
|
5638 |
! ! |
|
5639 |
||
457 | 5640 |
!JavaVM class methodsFor:'native - java.lang - ms'! |
5641 |
||
5642 |
_Runtime_setInputStreamLocalised:nativeContext |
|
5643 |
||
5644 |
"Created: / 18.11.1998 / 00:48:24 / cg" |
|
5645 |
"Modified: / 18.11.1998 / 00:55:01 / cg" |
|
5646 |
! |
|
5647 |
||
5648 |
_Runtime_setOutputStreamLocalised:nativeContext |
|
5649 |
||
5650 |
"Created: / 18.11.1998 / 00:50:15 / cg" |
|
5651 |
"Modified: / 18.11.1998 / 00:55:06 / cg" |
|
5652 |
! |
|
5653 |
||
5654 |
_String_equals:nativeContext |
|
5655 |
|jString1 jString2| |
|
5656 |
||
5657 |
jString1 := nativeContext receiver. |
|
5658 |
jString2 := nativeContext argAt:1. |
|
5659 |
^ (jString1 instVarAt:1) = (jString2 instVarAt:1) |
|
5660 |
||
5661 |
"Created: / 18.11.1998 / 00:52:03 / cg" |
|
5662 |
"Modified: / 18.11.1998 / 00:53:01 / cg" |
|
5663 |
! |
|
5664 |
||
5665 |
_String_length:nativeContext |
|
5666 |
|jString| |
|
5667 |
||
5668 |
jString := nativeContext receiver. |
|
5669 |
^ (jString instVarAt:3) |
|
5670 |
||
5671 |
"Created: / 18.11.1998 / 00:53:50 / cg" |
|
5672 |
"Modified: / 18.11.1998 / 00:54:18 / cg" |
|
5673 |
! ! |
|
5674 |
||
255 | 5675 |
!JavaVM class methodsFor:'native - java.math'! |
5676 |
||
5677 |
_BigInteger_plumbInit:nativeContext |
|
440 | 5678 |
UnimplementedNativeMethodSignal raise |
5679 |
||
5680 |
"Modified: / 12.11.1998 / 19:23:00 / cg" |
|
253 | 5681 |
! ! |
5682 |
||
5683 |
!JavaVM class methodsFor:'native - java.net'! |
|
5684 |
||
440 | 5685 |
_InetAddressImpl_getHostByAddr:nativeContext |
5686 |
"/ java.lang.String getHostByAddr (int) |
|
5687 |
UnimplementedNativeMethodSignal raise |
|
5688 |
||
5689 |
"Created: / 12.11.1998 / 19:08:04 / cg" |
|
5690 |
! |
|
5691 |
||
253 | 5692 |
_InetAddressImpl_getInetFamily:nativeContext |
5693 |
"/ self unimplementedNativeMethod. |
|
5694 |
^ 0 |
|
5695 |
||
5696 |
"Modified: / 15.8.1997 / 17:04:43 / cg" |
|
5697 |
"Created: / 5.1.1998 / 02:05:48 / cg" |
|
5698 |
! |
|
5699 |
||
5700 |
_InetAddressImpl_getLocalHostName:nativeContext |
|
5701 |
"" |
|
5702 |
||
5703 |
|hostName| |
|
5704 |
||
5705 |
hostName := OperatingSystem getHostName. |
|
5706 |
||
5707 |
^ (Java as_String:hostName). |
|
5708 |
||
5709 |
"Modified: / 7.8.1997 / 21:16:55 / cg" |
|
5710 |
"Created: / 5.1.1998 / 02:07:03 / cg" |
|
5711 |
! |
|
5712 |
||
255 | 5713 |
_InetAddressImpl_lookupAllHostAddr:nativeContext |
5714 |
"" |
|
5715 |
||
5716 |
|jAddrImpl jHostName hostName addrBytes| |
|
5717 |
||
5718 |
jAddrImpl := nativeContext receiver. |
|
5719 |
jHostName := nativeContext argAt:1. |
|
5720 |
||
5721 |
hostName := Java as_ST_String:jHostName. |
|
5722 |
addrBytes := Socket ipAddressOfHost:hostName. |
|
5723 |
addrBytes isNil ifTrue:[ |
|
261 | 5724 |
addrBytes := #[0 0 0 0] copy |
255 | 5725 |
]. |
5726 |
^ Array with:addrBytes |
|
5727 |
||
5728 |
"Modified: / 8.8.1997 / 12:04:25 / cg" |
|
5729 |
"Created: / 7.1.1998 / 18:51:31 / cg" |
|
5730 |
! |
|
5731 |
||
253 | 5732 |
_InetAddressImpl_makeAnyLocalAddress:nativeContext |
5733 |
"" |
|
5734 |
||
5735 |
|jAddrImpl jAddr hostName addrBytes address| |
|
5736 |
||
5737 |
jAddrImpl := nativeContext receiver. |
|
5738 |
jAddr := nativeContext argAt:1. |
|
5739 |
||
5740 |
hostName := OperatingSystem getHostName. |
|
5741 |
addrBytes := Socket ipAddressOfHost:hostName. |
|
405 | 5742 |
addrBytes isNil ifTrue:[ |
5743 |
addrBytes := #[127 0 0 0]. |
|
5744 |
]. |
|
253 | 5745 |
"/ MSB first into an integer. |
5746 |
address := (addrBytes at:1). |
|
5747 |
address := (address bitShift:8) bitOr:(addrBytes at:2). |
|
5748 |
address := (address bitShift:8) bitOr:(addrBytes at:3). |
|
5749 |
address := (address bitShift:8) bitOr:(addrBytes at:4). |
|
5750 |
||
5751 |
jAddr instVarNamed:'hostName' put:(Java as_String:hostName). |
|
5752 |
jAddr instVarNamed:'address' put:address. |
|
5753 |
jAddr instVarNamed:'family' put:0. |
|
5754 |
||
5755 |
^ nil |
|
5756 |
||
5757 |
"Created: / 5.1.1998 / 02:06:27 / cg" |
|
405 | 5758 |
"Modified: / 21.10.1998 / 03:30:29 / cg" |
255 | 5759 |
! |
5760 |
||
5761 |
_PlainSocketImpl_initProto:nativeContext |
|
5762 |
||
5763 |
"Created: / 12.1.1998 / 12:56:52 / cg" |
|
271 | 5764 |
! |
5765 |
||
307 | 5766 |
_PlainSocketImpl_socketAccept:nativeContext |
5767 |
|jsock fd newJSock sock newSock fileNo| |
|
5768 |
||
5769 |
jsock := nativeContext receiver. |
|
5770 |
||
5771 |
sock := self validateFile:jsock. |
|
5772 |
sock isNil ifTrue:[ |
|
5773 |
self |
|
5774 |
throwExceptionClassName:'java.io.IOException' |
|
5775 |
withMessage:'nil socket in accept'. |
|
5776 |
^ self. |
|
5777 |
]. |
|
5778 |
||
5779 |
newJSock := nativeContext argAt:1. |
|
5780 |
fd := newJSock instVarNamed:'fd'. |
|
5781 |
(fd instVarNamed:'fd') ~~ 0 ifTrue:[ |
|
5782 |
self halt:'file already open'. |
|
5783 |
self internalError:'file already open'. |
|
5784 |
self |
|
5785 |
throwExceptionClassName:'java.io.IOException' |
|
5786 |
withMessage:'socket already open in socketAccept'. |
|
5787 |
^ self. |
|
5788 |
]. |
|
5789 |
FileIOTrace ifTrue:[ |
|
5790 |
'JAVA: socket accept' infoPrintCR |
|
5791 |
]. |
|
5792 |
newSock := sock accept. |
|
5793 |
newSock isNil ifTrue:[ |
|
5794 |
self |
|
5795 |
throwExceptionClassName:'java.io.IOException' |
|
5796 |
withMessage:'accept failed'. |
|
5797 |
]. |
|
5798 |
fileNo := self addOpenFile:newSock. |
|
5799 |
fd instVarNamed:'fd' put:fileNo. |
|
5800 |
||
5801 |
"Created: / 4.2.1998 / 15:26:49 / cg" |
|
5802 |
"Modified: / 4.2.1998 / 15:45:20 / cg" |
|
5803 |
! |
|
5804 |
||
5805 |
_PlainSocketImpl_socketAvailable:nativeContext |
|
5806 |
|jSock sock n| |
|
5807 |
||
5808 |
jSock := nativeContext receiver. |
|
5809 |
||
5810 |
sock := self validateFile:jSock. |
|
5811 |
sock isNil ifTrue:[ |
|
5812 |
self |
|
5813 |
throwExceptionClassName:'java.io.IOException' |
|
5814 |
withMessage:'socketAvailable on closed socket'. |
|
5815 |
^ self. |
|
5816 |
]. |
|
5817 |
||
5818 |
n := sock numAvailable. |
|
5819 |
^ n |
|
5820 |
||
5821 |
"Created: / 4.2.1998 / 16:58:49 / cg" |
|
5822 |
! |
|
5823 |
||
5824 |
_PlainSocketImpl_socketBind:nativeContext |
|
5825 |
|jsock jaddr port sock hostName ok err| |
|
5826 |
||
5827 |
jsock := nativeContext receiver. |
|
5828 |
jaddr := nativeContext argAt:1. |
|
5829 |
port := nativeContext argAt:2. |
|
5830 |
||
5831 |
hostName := jaddr instVarNamed:'hostName'. |
|
5832 |
hostName isNil ifTrue:[ |
|
5833 |
self halt. |
|
5834 |
] ifFalse:[ |
|
5835 |
hostName := Java as_ST_String:hostName |
|
5836 |
]. |
|
5837 |
||
5838 |
sock := self validateFile:jsock. |
|
5839 |
sock notNil ifTrue:[ |
|
5840 |
FileIOTrace ifTrue:[ |
|
5841 |
('JAVA: socket bind to ' , hostName printString, ' port ' , port printString) infoPrintCR |
|
5842 |
]. |
|
5843 |
||
5844 |
ok := sock bindTo:port address:nil "hostName". |
|
5845 |
ok ifFalse:[ |
|
5846 |
err := OperatingSystem lastErrorString. |
|
5847 |
Transcript showCR:'sock err: ' , err printString. |
|
5848 |
self |
|
5849 |
throwExceptionClassName:'java.io.IOException' |
|
5850 |
withMessage:'bind failed'. |
|
5851 |
] |
|
5852 |
]. |
|
5853 |
||
5854 |
"Created: / 4.2.1998 / 15:06:20 / cg" |
|
5855 |
"Modified: / 4.2.1998 / 15:34:08 / cg" |
|
5856 |
! |
|
5857 |
||
271 | 5858 |
_PlainSocketImpl_socketClose:nativeContext |
5859 |
|jsock sock| |
|
5860 |
||
5861 |
jsock := nativeContext receiver. |
|
5862 |
||
5863 |
sock := self validateFile:jsock. |
|
5864 |
sock notNil ifTrue:[ |
|
5865 |
FileIOTrace ifTrue:[ |
|
5866 |
'JAVA: close socket' infoPrintCR |
|
5867 |
]. |
|
5868 |
sock close. |
|
5869 |
]. |
|
5870 |
||
5871 |
"Modified: / 21.8.1997 / 17:09:40 / cg" |
|
5872 |
"Created: / 25.1.1998 / 20:04:24 / cg" |
|
5873 |
! |
|
5874 |
||
5875 |
_PlainSocketImpl_socketConnect:nativeContext |
|
272 | 5876 |
|jsock jaddr port sock addr hostName ok| |
271 | 5877 |
|
5878 |
jsock := nativeContext receiver. |
|
5879 |
jaddr := nativeContext argAt:1. |
|
5880 |
port := nativeContext argAt:2. |
|
5881 |
||
5882 |
hostName := jaddr instVarNamed:'hostName'. |
|
5883 |
hostName notNil ifTrue:[ |
|
5884 |
hostName := Java as_ST_String:hostName |
|
5885 |
] ifFalse:[ |
|
272 | 5886 |
addr := jaddr instVarNamed:'address'. |
5887 |
addr notNil ifTrue:[ |
|
5888 |
hostName := ByteArray new:4. |
|
5889 |
hostName at:4 put:(addr bitAnd:16rFF). |
|
5890 |
addr := addr bitShift:-8. |
|
5891 |
hostName at:3 put:(addr bitAnd:16rFF). |
|
5892 |
addr := addr bitShift:-8. |
|
5893 |
hostName at:2 put:(addr bitAnd:16rFF). |
|
5894 |
addr := addr bitShift:-8. |
|
5895 |
hostName at:1 put:(addr bitAnd:16rFF). |
|
5896 |
]. |
|
271 | 5897 |
]. |
5898 |
hostName isNil ifTrue:[ |
|
5899 |
self halt. |
|
5900 |
]. |
|
5901 |
||
5902 |
sock := self validateFile:jsock. |
|
5903 |
sock notNil ifTrue:[ |
|
5904 |
FileIOTrace ifTrue:[ |
|
5905 |
('JAVA: socket connect to ' , hostName printString , ' port ' , port printString) infoPrintCR |
|
5906 |
]. |
|
390 | 5907 |
SocketConnectConfirmation ifTrue:[ |
5908 |
(self confirm:'connect to host: ' , hostName printString , ' - ok ?') |
|
5909 |
ifFalse:[ |
|
5910 |
self |
|
5911 |
throwExceptionClassName:'java.io.IOException' |
|
5912 |
withMessage:'connect permission denied'. |
|
5913 |
]. |
|
271 | 5914 |
]. |
5915 |
||
5916 |
ok := sock connectTo:hostName port:port. |
|
5917 |
ok ifFalse:[ |
|
5918 |
self |
|
5919 |
throwExceptionClassName:'java.io.IOException' |
|
5920 |
withMessage:'connect failed'. |
|
5921 |
] |
|
5922 |
]. |
|
5923 |
||
5924 |
"Created: / 25.1.1998 / 20:02:27 / cg" |
|
390 | 5925 |
"Modified: / 19.10.1998 / 16:24:48 / cg" |
271 | 5926 |
! |
5927 |
||
5928 |
_PlainSocketImpl_socketCreate:nativeContext |
|
5929 |
|jsock isStream fd sock fileNo| |
|
5930 |
||
5931 |
jsock := nativeContext receiver. |
|
5932 |
isStream := (nativeContext argAt:1) == 1. |
|
5933 |
||
5934 |
fd := jsock instVarNamed:'fd'. |
|
5935 |
(fd instVarNamed:'fd') ~~ 0 ifTrue:[ |
|
5936 |
self halt:'file already open'. |
|
5937 |
self internalError:'file already open'. |
|
5938 |
self |
|
5939 |
throwExceptionClassName:'java.io.IOException' |
|
5940 |
withMessage:'file already open in socketCreate'. |
|
5941 |
^ self. |
|
5942 |
]. |
|
5943 |
||
5944 |
FileOpenTrace ifTrue:[ |
|
5945 |
('JAVA: create socket') infoPrintCR. |
|
5946 |
]. |
|
5947 |
||
5948 |
isStream ifTrue:[ |
|
5949 |
sock := Socket newTCP |
|
5950 |
] ifFalse:[ |
|
5951 |
sock := Socket newUDP |
|
5952 |
]. |
|
5953 |
sock isNil ifTrue:[ |
|
5954 |
self |
|
5955 |
throwExceptionClassName:'java.io.IOException' |
|
5956 |
withMessage:'socketCreate failed'. |
|
5957 |
]. |
|
5958 |
||
5959 |
fileNo := self addOpenFile:sock. |
|
5960 |
fd instVarNamed:'fd' put:fileNo. |
|
5961 |
||
5962 |
"Created: / 25.1.1998 / 19:59:25 / cg" |
|
5963 |
"Modified: / 25.1.1998 / 19:59:45 / cg" |
|
272 | 5964 |
! |
5965 |
||
307 | 5966 |
_PlainSocketImpl_socketListen:nativeContext |
5967 |
|jSock time sock ok| |
|
5968 |
||
5969 |
jSock := nativeContext receiver. |
|
5970 |
time := nativeContext argAt:1. |
|
5971 |
||
5972 |
sock := self validateFile:jSock. |
|
5973 |
sock notNil ifTrue:[ |
|
5974 |
FileIOTrace ifTrue:[ |
|
5975 |
('JAVA: socket listen with timeout ' , time printString) infoPrintCR. |
|
5976 |
]. |
|
5977 |
ok := sock listenWithBacklog:5. |
|
5978 |
ok ifFalse:[ |
|
5979 |
self |
|
5980 |
throwExceptionClassName:'java.io.IOException' |
|
5981 |
withMessage:'listen failed'. |
|
5982 |
^ self. |
|
5983 |
]. |
|
5984 |
time ~~ 0 ifTrue:[ |
|
5985 |
sock readWaitWithTimeoutMs:time |
|
5986 |
] |
|
5987 |
]. |
|
5988 |
||
5989 |
"Created: / 4.2.1998 / 15:17:48 / cg" |
|
5990 |
"Modified: / 4.2.1998 / 15:18:26 / cg" |
|
5991 |
! |
|
5992 |
||
272 | 5993 |
_SocketInputStream_socketRead:nativeContext |
307 | 5994 |
^ self anyStream_readBytes:nativeContext |
272 | 5995 |
|
5996 |
"Created: / 25.1.1998 / 20:56:53 / cg" |
|
307 | 5997 |
"Modified: / 4.2.1998 / 15:52:31 / cg" |
272 | 5998 |
! |
5999 |
||
6000 |
_SocketOutputStream_socketWrite:nativeContext |
|
307 | 6001 |
^ self anyStream_writeBytes:nativeContext |
272 | 6002 |
|
6003 |
"Created: / 25.1.1998 / 21:06:55 / cg" |
|
307 | 6004 |
"Modified: / 4.2.1998 / 15:52:40 / cg" |
253 | 6005 |
! ! |
6006 |
||
457 | 6007 |
!JavaVM class methodsFor:'native - java.net - ms'! |
6008 |
||
6009 |
_ClassLoader_findSystemClass:nativeContext |
|
6010 |
^ self _ClassLoader_findSystemClass0:nativeContext |
|
6011 |
||
6012 |
"Created: / 18.11.1998 / 00:00:14 / cg" |
|
6013 |
! |
|
6014 |
||
6015 |
_InetAddress_getInetFamily:nativeContext |
|
6016 |
"/ self unimplementedNativeMethod. |
|
6017 |
^ 0 |
|
6018 |
||
6019 |
"Modified: / 15.8.1997 / 17:04:43 / cg" |
|
6020 |
"Created: / 17.11.1998 / 23:54:38 / cg" |
|
6021 |
! |
|
6022 |
||
6023 |
_InetAddress_getLocalHostName:nativeContext |
|
6024 |
"" |
|
6025 |
||
6026 |
|hostName| |
|
6027 |
||
6028 |
hostName := OperatingSystem getHostName. |
|
6029 |
||
6030 |
^ (Java as_String:hostName). |
|
6031 |
||
6032 |
"Modified: / 7.8.1997 / 21:16:55 / cg" |
|
6033 |
"Created: / 17.11.1998 / 23:54:54 / cg" |
|
6034 |
! |
|
6035 |
||
6036 |
_InetAddress_lookupAllHostAddr:nativeContext |
|
6037 |
"" |
|
6038 |
||
6039 |
|jAddrImpl jHostName hostName addrBytes| |
|
6040 |
||
6041 |
jAddrImpl := nativeContext receiver. |
|
6042 |
jHostName := nativeContext argAt:1. |
|
6043 |
||
6044 |
hostName := Java as_ST_String:jHostName. |
|
6045 |
addrBytes := Socket ipAddressOfHost:hostName. |
|
6046 |
addrBytes isNil ifTrue:[ |
|
6047 |
addrBytes := #[0 0 0 0] copy |
|
6048 |
]. |
|
6049 |
^ Array with:addrBytes |
|
6050 |
||
6051 |
"Modified: / 8.8.1997 / 12:04:25 / cg" |
|
6052 |
"Created: / 17.11.1998 / 23:56:10 / cg" |
|
6053 |
! |
|
6054 |
||
6055 |
_InetAddress_makeAnyLocalAddress:nativeContext |
|
6056 |
"" |
|
6057 |
||
6058 |
|jAddrImpl jAddr hostName addrBytes address| |
|
6059 |
||
6060 |
jAddrImpl := nativeContext receiver. |
|
6061 |
jAddr := nativeContext argAt:1. |
|
6062 |
||
6063 |
hostName := OperatingSystem getHostName. |
|
6064 |
addrBytes := Socket ipAddressOfHost:hostName. |
|
6065 |
addrBytes isNil ifTrue:[ |
|
6066 |
addrBytes := #[127 0 0 0]. |
|
6067 |
]. |
|
6068 |
"/ MSB first into an integer. |
|
6069 |
address := (addrBytes at:1). |
|
6070 |
address := (address bitShift:8) bitOr:(addrBytes at:2). |
|
6071 |
address := (address bitShift:8) bitOr:(addrBytes at:3). |
|
6072 |
address := (address bitShift:8) bitOr:(addrBytes at:4). |
|
6073 |
||
6074 |
jAddr instVarNamed:'hostName' put:(Java as_String:hostName). |
|
6075 |
jAddr instVarNamed:'address' put:address. |
|
6076 |
jAddr instVarNamed:'family' put:0. |
|
6077 |
||
6078 |
^ nil |
|
6079 |
||
6080 |
"Modified: / 21.10.1998 / 03:30:29 / cg" |
|
6081 |
"Created: / 17.11.1998 / 23:54:00 / cg" |
|
6082 |
! ! |
|
6083 |
||
253 | 6084 |
!JavaVM class methodsFor:'native - java.utils'! |
6085 |
||
6086 |
_ResourceBundle_getClassContext:nativeContext |
|
6087 |
"returns an array filled with the contextChain receivers classes. |
|
6088 |
What an ugly, messy interface." |
|
6089 |
||
6090 |
|chain con cls jClass| |
|
6091 |
||
6092 |
chain := OrderedCollection new. |
|
6093 |
con := thisContext sender. |
|
6094 |
[con notNil] whileTrue:[ |
|
347 | 6095 |
(con isJavaContext) ifTrue:[ |
6096 |
cls := con receiver class. |
|
6097 |
cls isMeta ifTrue:[ |
|
6098 |
"/ t'was a static method |
|
6099 |
cls := cls soleInstance |
|
6100 |
]. |
|
6101 |
jClass := JavaClasses at:cls ifAbsent:nil. |
|
6102 |
jClass isNil ifTrue:[ |
|
6103 |
JavaClasses at:cls put:(jClass := (Java at:'java.lang.Class') new). |
|
6104 |
JavaClasses at:jClass put:cls. |
|
6105 |
]. |
|
6106 |
chain add:jClass. |
|
6107 |
]. |
|
6108 |
con := con sender. |
|
253 | 6109 |
]. |
6110 |
^ chain asArray |
|
6111 |
||
6112 |
"Created: / 5.1.1998 / 02:47:00 / cg" |
|
347 | 6113 |
"Modified: / 8.5.1998 / 21:29:57 / cg" |
253 | 6114 |
! ! |
6115 |
||
304 | 6116 |
!JavaVM class methodsFor:'native - java.utils.zip'! |
6117 |
||
6118 |
_Inflater_init:nativeContext |
|
6119 |
||
6120 |
"Created: / 1.2.1998 / 20:14:01 / cg" |
|
6121 |
! |
|
6122 |
||
6123 |
_Inflater_reset:nativeContext |
|
6124 |
||
6125 |
"Created: / 1.2.1998 / 20:14:13 / cg" |
|
6126 |
! ! |
|
6127 |
||
255 | 6128 |
!JavaVM class methodsFor:'native - netscape'! |
6129 |
||
6130 |
_MozillaAppletContext_pMochaOnLoad:nativeContext |
|
6131 |
|id| |
|
6132 |
||
6133 |
id := nativeContext argAt:1. |
|
318 | 6134 |
"/ 'JAVA: MozillaAppletContext_pMochaOnLoad: ' print. id printNL. |
255 | 6135 |
^ nil |
6136 |
||
6137 |
"Created: / 6.1.1998 / 20:37:13 / cg" |
|
318 | 6138 |
"Modified: / 6.2.1998 / 02:13:09 / cg" |
255 | 6139 |
! |
6140 |
||
325 | 6141 |
_MozillaAppletContext_pShowDocument:nativeContext |
6142 |
|s js| |
|
6143 |
||
6144 |
js := nativeContext argAt:1. |
|
6145 |
s := Java as_ST_String:js. |
|
6146 |
||
6147 |
"/ somehow pass it to the html browser .... |
|
6148 |
"/ Transcript showCR:s. |
|
6149 |
^ nil |
|
6150 |
||
6151 |
"Modified: / 8.1.1998 / 17:06:13 / cg" |
|
6152 |
"Created: / 29.3.1998 / 15:53:17 / cg" |
|
6153 |
! |
|
6154 |
||
255 | 6155 |
_MozillaAppletContext_pShowStatus:nativeContext |
6156 |
|s js| |
|
6157 |
||
6158 |
js := nativeContext argAt:1. |
|
405 | 6159 |
js isNil ifTrue:[ |
6160 |
s := '' |
|
6161 |
] ifFalse:[ |
|
6162 |
s := Java as_ST_String:js. |
|
6163 |
]. |
|
255 | 6164 |
|
6165 |
self activityNotification:s. |
|
6166 |
"/ Transcript showCR:s. |
|
6167 |
^ nil |
|
6168 |
||
6169 |
"Created: / 6.1.1998 / 18:31:34 / cg" |
|
405 | 6170 |
"Modified: / 22.10.1998 / 01:17:46 / cg" |
255 | 6171 |
! |
6172 |
||
440 | 6173 |
_MozillaAppletContext_setConsoleState0:nativeContext |
6174 |
"/ void setConsoleState0 (int) |
|
6175 |
UnimplementedNativeMethodSignal raise |
|
6176 |
||
6177 |
"Created: / 12.11.1998 / 19:23:22 / cg" |
|
6178 |
! |
|
6179 |
||
6180 |
_URLConnection_close:nativeContext |
|
6181 |
"/ void close () |
|
6182 |
UnimplementedNativeMethodSignal raise |
|
6183 |
||
6184 |
"Created: / 12.11.1998 / 19:26:03 / cg" |
|
6185 |
! |
|
6186 |
||
6187 |
_URLConnection_finalize:nativeContext |
|
6188 |
"/ void finalize () |
|
6189 |
UnimplementedNativeMethodSignal raise |
|
6190 |
||
6191 |
"Created: / 12.11.1998 / 19:25:22 / cg" |
|
6192 |
! |
|
6193 |
||
6194 |
_URLConnection_getContentLength0:nativeContext |
|
6195 |
"/ int getContentLength0 () |
|
6196 |
UnimplementedNativeMethodSignal raise |
|
6197 |
||
6198 |
"Created: / 12.11.1998 / 19:25:34 / cg" |
|
6199 |
! |
|
6200 |
||
6201 |
_URLConnection_getContentType0:nativeContext |
|
6202 |
"/ java.lang.String getContentType0 () |
|
6203 |
UnimplementedNativeMethodSignal raise |
|
6204 |
||
6205 |
"Created: / 12.11.1998 / 19:25:42 / cg" |
|
6206 |
! |
|
6207 |
||
6208 |
_URLConnection_getHeaderField0:nativeContext |
|
6209 |
"/ java.lang.String getHeaderField0 (java.lang.String) |
|
6210 |
UnimplementedNativeMethodSignal raise |
|
6211 |
||
6212 |
"Created: / 12.11.1998 / 19:25:53 / cg" |
|
6213 |
! |
|
6214 |
||
6215 |
_URLConnection_pCreate:nativeContext |
|
6216 |
"/ void pCreate (java.lang.String java.lang.String) |
|
6217 |
UnimplementedNativeMethodSignal raise |
|
6218 |
||
6219 |
"Created: / 12.11.1998 / 19:25:14 / cg" |
|
6220 |
! |
|
6221 |
||
6222 |
_URLInputStream_available:nativeContext |
|
6223 |
"/ int available () |
|
6224 |
UnimplementedNativeMethodSignal raise |
|
6225 |
||
6226 |
"Created: / 12.11.1998 / 19:24:26 / cg" |
|
6227 |
! |
|
6228 |
||
6229 |
_URLInputStream_open:nativeContext |
|
6230 |
"/ void open () |
|
6231 |
UnimplementedNativeMethodSignal raise |
|
6232 |
||
6233 |
"Created: / 12.11.1998 / 19:24:01 / cg" |
|
6234 |
! |
|
6235 |
||
6236 |
_URLInputStream_read:nativeContext |
|
6237 |
"/ int read (byte[] int int) |
|
6238 |
UnimplementedNativeMethodSignal raise |
|
6239 |
||
6240 |
"Created: / 12.11.1998 / 19:24:12 / cg" |
|
6241 |
! |
|
6242 |
||
6243 |
_URLOutputStream_open:nativeContext |
|
6244 |
"/ void open () |
|
6245 |
UnimplementedNativeMethodSignal raise |
|
6246 |
||
6247 |
"Created: / 12.11.1998 / 19:24:38 / cg" |
|
6248 |
! |
|
6249 |
||
6250 |
_URLOutputStream_pClose:nativeContext |
|
6251 |
"/ void pClose () |
|
6252 |
UnimplementedNativeMethodSignal raise |
|
6253 |
||
6254 |
"Created: / 12.11.1998 / 19:25:02 / cg" |
|
6255 |
! |
|
6256 |
||
6257 |
_URLOutputStream_write:nativeContext |
|
6258 |
"/ void write (int) |
|
6259 |
UnimplementedNativeMethodSignal raise |
|
6260 |
||
6261 |
"Created: / 12.11.1998 / 19:24:45 / cg" |
|
6262 |
! |
|
6263 |
||
6264 |
_URLOutputStream_writeBytes:nativeContext |
|
6265 |
"/ void writeBytes (byte[] int int) |
|
6266 |
UnimplementedNativeMethodSignal raise |
|
6267 |
||
6268 |
"Created: / 12.11.1998 / 19:24:55 / cg" |
|
6269 |
! |
|
6270 |
||
255 | 6271 |
_URLStreamHandlerFactory_pInit:nativeContext |
6272 |
"/ self unimplementedNativeMethod. |
|
6273 |
||
6274 |
"Created: / 10.1.1998 / 15:47:24 / cg" |
|
440 | 6275 |
! |
6276 |
||
6277 |
_URLStreamHandlerFactory_pSupportsProtocol:nativeContext |
|
6278 |
"/ boolean pSupportsProtocol (java.lang.String) |
|
6279 |
UnimplementedNativeMethodSignal raise |
|
6280 |
||
6281 |
"Created: / 12.11.1998 / 19:23:43 / cg" |
|
255 | 6282 |
! ! |
6283 |
||
6284 |
!JavaVM class methodsFor:'native - sun.audio'! |
|
6285 |
||
6286 |
_AudioDevice_audioClose:nativeContext |
|
261 | 6287 |
|device fd stream| |
6288 |
||
6289 |
device := nativeContext receiver. |
|
6290 |
device notNil ifTrue:[ |
|
6291 |
fd := device instVarNamed:'dev'. |
|
6292 |
(fd notNil and:[fd > 0]) ifTrue:[ |
|
6293 |
stream := self getOpenFileAt:fd. |
|
6294 |
stream notNil ifTrue:[ |
|
6295 |
stream close. |
|
6296 |
device instVarNamed:'dev' put:0. |
|
6297 |
] |
|
6298 |
] |
|
6299 |
] |
|
255 | 6300 |
|
6301 |
"Created: / 10.1.1998 / 15:45:16 / cg" |
|
261 | 6302 |
"Modified: / 13.1.1998 / 18:08:20 / cg" |
255 | 6303 |
! |
6304 |
||
6305 |
_AudioDevice_audioOpen:nativeContext |
|
261 | 6306 |
|f stream fileNo| |
6307 |
||
6308 |
NoAudio ifTrue:[ |
|
374 | 6309 |
Transcript showCR:'JAVA: audio disabled'. |
6310 |
^ -1 |
|
6311 |
]. |
|
6312 |
||
261 | 6313 |
Stream streamErrorSignal handle:[:ex | |
374 | 6314 |
Stream streamErrorSignal handle:[:ex | |
6315 |
stream := nil. |
|
6316 |
ex return. |
|
6317 |
] do:[ |
|
6318 |
stream := SoundStream writing. |
|
6319 |
]. |
|
261 | 6320 |
] do:[ |
374 | 6321 |
stream := SoundStream writing. |
6322 |
stream notNil ifTrue:[ |
|
6323 |
stream setSampleRate:8000. |
|
6324 |
] |
|
261 | 6325 |
]. |
6326 |
stream isNil ifTrue:[ |
|
374 | 6327 |
"/ ^ -1. |
6328 |
||
6329 |
f := '/dev/audio' asFilename. |
|
6330 |
f exists ifFalse:[ |
|
6331 |
Transcript showCR:'JAVA: neither SoundStream nor /dev/audio available'. |
|
6332 |
^ -1 |
|
6333 |
]. |
|
6334 |
stream := f readWriteStream. |
|
6335 |
stream isNil ifTrue:[ |
|
6336 |
Transcript showCR:'JAVA: /dev/audio exists, but cannot be opened'. |
|
6337 |
^ -1 |
|
6338 |
]. |
|
6339 |
fileNo := self addOpenFile:stream. |
|
6340 |
]. |
|
6341 |
||
261 | 6342 |
fileNo := self addOpenFile:stream. |
6343 |
||
6344 |
FileOpenTrace ifTrue:[ |
|
374 | 6345 |
('JAVA: opened audioDevice as FD ' , fileNo printString) infoPrintCR. |
261 | 6346 |
]. |
6347 |
||
6348 |
^ fileNo |
|
255 | 6349 |
|
6350 |
"Created: / 10.1.1998 / 15:45:30 / cg" |
|
374 | 6351 |
"Modified: / 14.10.1998 / 15:20:52 / cg" |
261 | 6352 |
! |
6353 |
||
6354 |
_AudioDevice_audioWrite:nativeContext |
|
6355 |
|device fd stream bytes count| |
|
6356 |
||
6357 |
device := nativeContext receiver. |
|
6358 |
device notNil ifTrue:[ |
|
6359 |
fd := device instVarNamed:'dev'. |
|
6360 |
(fd notNil and:[fd > 0]) ifTrue:[ |
|
6361 |
stream := self getOpenFileAt:fd. |
|
6362 |
stream notNil ifTrue:[ |
|
6363 |
bytes := nativeContext argAt:1. |
|
6364 |
count := nativeContext argAt:2. |
|
6365 |
stream nextPutBytes:count from:bytes startingAt:1 |
|
6366 |
] |
|
6367 |
] |
|
6368 |
] |
|
6369 |
||
6370 |
"Created: / 10.1.1998 / 15:45:16 / cg" |
|
6371 |
"Modified: / 13.1.1998 / 18:07:20 / cg" |
|
255 | 6372 |
! ! |
6373 |
||
6374 |
!JavaVM class methodsFor:'native - sun.awt'! |
|
6375 |
||
6376 |
_GifImageDecoder_parseImage:nativeContext |
|
261 | 6377 |
|decoder width height bool1 depth subHdrBytes dstBytes i1 i2 colorModel |
6378 |
stream byte compressedData compressedSize index count data |
|
304 | 6379 |
leftOffs topOffs codeLen flags pixelStore clrModel t buffSize |
6380 |
countGot countGot2| |
|
255 | 6381 |
|
6382 |
decoder := nativeContext receiver. |
|
6383 |
||
6384 |
i1 := nativeContext argAt:1. |
|
6385 |
i2 := nativeContext argAt:2. |
|
6386 |
width := nativeContext argAt:3. |
|
6387 |
height := nativeContext argAt:4. |
|
6388 |
bool1 := nativeContext argAt:5. |
|
6389 |
depth := nativeContext argAt:6. |
|
261 | 6390 |
subHdrBytes := nativeContext argAt:7. |
255 | 6391 |
dstBytes := nativeContext argAt:8. |
6392 |
colorModel := nativeContext argAt:9. |
|
6393 |
||
261 | 6394 |
leftOffs := subHdrBytes wordAt:1 MSB:false. |
6395 |
topOffs := subHdrBytes wordAt:3 MSB:false. |
|
6396 |
width := subHdrBytes wordAt:5 MSB:false. |
|
6397 |
height := subHdrBytes wordAt:7 MSB:false. |
|
6398 |
flags := subHdrBytes at:9. |
|
6399 |
codeLen := subHdrBytes at:10. |
|
6400 |
||
6401 |
stream := decoder instVarNamed:'input'. |
|
6402 |
pixelStore := decoder instVarNamed:'store'. |
|
339 | 6403 |
pixelStore isNil ifTrue:[ |
6404 |
^ 0 |
|
6405 |
]. |
|
261 | 6406 |
|
6407 |
buffSize := (width * height // 2) max:4096. |
|
6408 |
compressedData := ByteArray uninitializedNew:buffSize. |
|
6409 |
"get compressed data" |
|
6410 |
index := 1. |
|
304 | 6411 |
count := stream perform:#'read()I'. |
261 | 6412 |
|
6413 |
[count notNil and:[count > 0]] whileTrue:[ |
|
304 | 6414 |
(index + count) > buffSize ifTrue:[ |
6415 |
t := ByteArray uninitializedNew:(buffSize * 2). |
|
6416 |
t replaceFrom:1 to:buffSize with:compressedData startingAt:1. |
|
6417 |
compressedData := t. |
|
6418 |
buffSize := buffSize * 2. |
|
6419 |
]. |
|
6420 |
[count ~~ 0] whileTrue:[ |
|
6421 |
countGot := stream |
|
6422 |
perform:#'read([BII)I' |
|
6423 |
with:compressedData |
|
6424 |
with:index-1 |
|
6425 |
with:count. |
|
6426 |
||
6427 |
countGot > 0 ifTrue:[ |
|
6428 |
count := count - countGot. |
|
6429 |
index := index + countGot. |
|
6430 |
] ifFalse:[ |
|
6431 |
count := -1. |
|
6432 |
] |
|
6433 |
]. |
|
6434 |
||
6435 |
count >= 0 ifTrue:[ |
|
6436 |
count := stream perform:#read. |
|
6437 |
] |
|
261 | 6438 |
]. |
6439 |
compressedSize := index - 1. |
|
6440 |
||
6441 |
data := pixelStore perform:#'allocateLines(I)Ljava/lang/Object;' with:height. |
|
6442 |
(data isMemberOf:ByteArray) ifFalse:[ |
|
304 | 6443 |
self halt. |
6444 |
^ 0. |
|
261 | 6445 |
]. |
6446 |
"/ 'GIFReader: decompressing ...' infoPrintCR. |
|
6447 |
||
6448 |
||
6449 |
GIFReader |
|
304 | 6450 |
decompressGIFFrom:compressedData |
6451 |
count:compressedSize |
|
6452 |
into:data |
|
6453 |
startingAt:1 |
|
6454 |
codeLen:(codeLen + 1). |
|
261 | 6455 |
|
6456 |
clrModel := pixelStore instVarNamed:'colormodel'. |
|
6457 |
||
6458 |
pixelStore |
|
304 | 6459 |
perform:#'setPixels(IIII[BII)Z' |
6460 |
withArguments: |
|
6461 |
(Array |
|
6462 |
with:0 "/ x |
|
6463 |
with:0 "/ y |
|
6464 |
with:width "/ w |
|
6465 |
with:height "/ h |
|
6466 |
with:data |
|
6467 |
with:0 "/ offs |
|
6468 |
with:width). "/ scanSize |
|
261 | 6469 |
|
6470 |
pixelStore perform:#'imageComplete()V'. |
|
6471 |
"/ perform:#'imageComplete(I)V' |
|
6472 |
"/ with:((Java at:'java.awt.image.ImageConsumer') instVarNamed:'STATICIMAGEDONE'). |
|
6473 |
||
255 | 6474 |
"/ self internalError:'breakPoint'. |
6475 |
^ 1 "/ true |
|
6476 |
||
339 | 6477 |
"Modified: / 10.4.1998 / 14:31:59 / cg" |
255 | 6478 |
! |
6479 |
||
6480 |
_ImageRepresentation_disposeImage:nativeContext |
|
262 | 6481 |
|imgRep img| |
255 | 6482 |
|
6483 |
imgRep := nativeContext receiver. |
|
262 | 6484 |
|
6485 |
img := imgRep instVarNamed:'pData'. |
|
6486 |
(img notNil and:[img ~~ 0]) ifTrue:[ |
|
270 | 6487 |
ImageStretchCache notNil ifTrue:[ |
6488 |
ImageStretchCache removeKey:img ifAbsent:nil. |
|
6489 |
] |
|
262 | 6490 |
]. |
6491 |
||
261 | 6492 |
imgRep instVarNamed:'pData' put:0. |
6493 |
"/ self halt. |
|
255 | 6494 |
|
6495 |
"Created: / 7.1.1998 / 22:31:46 / cg" |
|
262 | 6496 |
"Modified: / 17.1.1998 / 13:26:55 / cg" |
255 | 6497 |
! |
6498 |
||
6499 |
_ImageRepresentation_finish:nativeContext |
|
6500 |
|imgRep bool| |
|
6501 |
||
6502 |
imgRep := nativeContext receiver. |
|
6503 |
bool := nativeContext argAt:1. |
|
261 | 6504 |
"/ self halt. |
318 | 6505 |
"/ 'JAVA: ImageRepresentation_finish ignored for now' infoPrintCR. |
255 | 6506 |
|
6507 |
^ 1 "/ true |
|
6508 |
||
6509 |
"Created: / 8.1.1998 / 00:11:40 / cg" |
|
318 | 6510 |
"Modified: / 6.2.1998 / 02:12:54 / cg" |
261 | 6511 |
! |
6512 |
||
6513 |
_ImageRepresentation_imageDraw:nativeContext |
|
6514 |
|imgRep x y img deviceImage jGraphics gc clr| |
|
6515 |
||
6516 |
imgRep := nativeContext receiver. |
|
6517 |
img := imgRep instVarNamed:'pData'. |
|
6518 |
(img isNil or:[img == 0]) ifTrue:[ |
|
270 | 6519 |
"/ self halt. |
6520 |
^ self. |
|
261 | 6521 |
]. |
6522 |
jGraphics := nativeContext argAt:1. |
|
6523 |
gc := jGraphics instVarNamed:'pData'. |
|
6524 |
gc realized ifFalse:[^ self]. |
|
6525 |
||
6526 |
x := nativeContext argAt:2. |
|
6527 |
y := nativeContext argAt:3. |
|
6528 |
clr := nativeContext argAt:4. |
|
6529 |
deviceImage := img onDevice:gc device. |
|
6530 |
deviceImage ~~ img ifTrue:[ |
|
270 | 6531 |
imgRep instVarNamed:'pData' put:deviceImage. |
261 | 6532 |
]. |
6533 |
deviceImage displayOn:gc x:x y:y. |
|
6534 |
^ 1. |
|
6535 |
||
6536 |
"Created: / 13.1.1998 / 13:32:28 / cg" |
|
6537 |
"Modified: / 15.1.1998 / 12:21:27 / cg" |
|
6538 |
! |
|
6539 |
||
6540 |
_ImageRepresentation_imageStretch:nativeContext |
|
6541 |
|imgRep x1 y1 x2 y2 srcX1 srcY1 w h |
|
6542 |
img deviceImage jGraphics gc clr stretchWidth stretchHeight| |
|
6543 |
||
6544 |
imgRep := nativeContext receiver. |
|
6545 |
img := imgRep instVarNamed:'pData'. |
|
6546 |
(img isNil or:[img == 0]) ifTrue:[ |
|
270 | 6547 |
"/ self halt. |
6548 |
^ self. |
|
261 | 6549 |
]. |
6550 |
||
6551 |
jGraphics := nativeContext argAt:1. |
|
6552 |
gc := jGraphics instVarNamed:'pData'. |
|
6553 |
gc realized ifFalse:[^ self]. |
|
6554 |
||
6555 |
x1 := nativeContext argAt:2. |
|
6556 |
y1 := nativeContext argAt:3. |
|
6557 |
x2 := nativeContext argAt:4. |
|
6558 |
y2:= nativeContext argAt:5. |
|
6559 |
srcX1 := nativeContext argAt:6. |
|
6560 |
srcY1 := nativeContext argAt:7. |
|
6561 |
w := nativeContext argAt:8. |
|
6562 |
h := nativeContext argAt:9. |
|
6563 |
clr := nativeContext argAt:10. |
|
6564 |
||
6565 |
(srcX1 ~~ 0 or:[srcY1 ~~ 0]) ifTrue:[ |
|
270 | 6566 |
self halt. |
6567 |
^ self. |
|
261 | 6568 |
]. |
6569 |
(w ~~ img width or:[h ~~ img height]) ifTrue:[ |
|
270 | 6570 |
self halt. |
6571 |
^ self |
|
261 | 6572 |
]. |
6573 |
||
6574 |
"/ TODO: remember magnified images somewhere for a while, |
|
6575 |
"/ to avoid repeated action ... |
|
6576 |
||
6577 |
stretchWidth := (x2-x1). |
|
6578 |
stretchHeight := (y2-y1). |
|
6579 |
||
6580 |
(stretchWidth == img width |
|
6581 |
and:[stretchHeight == img height]) ifTrue:[ |
|
270 | 6582 |
deviceImage := img onDevice:gc device. |
6583 |
deviceImage ~~ img ifTrue:[ |
|
6584 |
imgRep instVarNamed:'pData' put:deviceImage. |
|
6585 |
]. |
|
261 | 6586 |
] ifFalse:[ |
270 | 6587 |
ImageStretchCache notNil ifTrue:[ |
6588 |
deviceImage := ImageStretchCache at:img ifAbsent:nil. |
|
6589 |
]. |
|
6590 |
(deviceImage isNil |
|
6591 |
or:[deviceImage width ~~ stretchWidth |
|
6592 |
or:[deviceImage height ~~ stretchHeight]]) ifTrue:[ |
|
6593 |
deviceImage := (img magnifiedTo:stretchWidth@stretchHeight) onDevice:gc device. |
|
6594 |
ImageStretchCache isNil ifTrue:[ |
|
6595 |
ImageStretchCache := WeakIdentityDictionary new. |
|
6596 |
]. |
|
6597 |
ImageStretchCache at:img put:deviceImage |
|
6598 |
]. |
|
261 | 6599 |
]. |
6600 |
deviceImage displayOn:gc x:x1 y:y1 |
|
6601 |
||
6602 |
"Created: / 13.1.1998 / 13:32:28 / cg" |
|
6603 |
"Modified: / 15.1.1998 / 13:14:47 / cg" |
|
255 | 6604 |
! |
6605 |
||
6606 |
_ImageRepresentation_offscreenInit:nativeContext |
|
262 | 6607 |
|imgRep jclr w h form screenDevice| |
255 | 6608 |
|
6609 |
imgRep := nativeContext receiver. |
|
261 | 6610 |
jclr := nativeContext argAt:1. |
262 | 6611 |
|
6612 |
w := imgRep instVarNamed:'width'. |
|
6613 |
h := imgRep instVarNamed:'height'. |
|
6614 |
||
6615 |
screenDevice := Screen current. |
|
6616 |
form := Form width:w height:h depth:(screenDevice depth) on:screenDevice. |
|
6617 |
||
6618 |
imgRep instVarNamed:'pData' put:form. |
|
6619 |
"/ self halt. |
|
255 | 6620 |
|
6621 |
"Created: / 7.1.1998 / 22:31:46 / cg" |
|
262 | 6622 |
"Modified: / 17.1.1998 / 12:36:43 / cg" |
261 | 6623 |
! |
6624 |
||
6625 |
_ImageRepresentation_setBytePixels:nativeContext |
|
318 | 6626 |
|imgRep x y w h clrModel bytes offs i2 |
6627 |
img depth cmap rgbMap opaque transparentColorIndex |
|
6628 |
scanLineWidth nBytes srcIdx dstIdx| |
|
261 | 6629 |
|
6630 |
imgRep := nativeContext receiver. |
|
6631 |
x := nativeContext argAt:1. |
|
6632 |
y := nativeContext argAt:2. |
|
6633 |
w := nativeContext argAt:3. |
|
6634 |
h := nativeContext argAt:4. |
|
6635 |
clrModel := nativeContext argAt:5. |
|
6636 |
bytes := nativeContext argAt:6. |
|
318 | 6637 |
offs := nativeContext argAt:7. "/ offset ?? |
6638 |
scanLineWidth := nativeContext argAt:8. |
|
261 | 6639 |
|
6640 |
depth := clrModel instVarNamed:'pixel_bits'. |
|
6641 |
(clrModel instVarNamed:'map_size') ~~ 0 ifTrue:[ |
|
318 | 6642 |
rgbMap := clrModel instVarNamed:'rgb'. |
6643 |
cmap := Array new:rgbMap size. |
|
6644 |
rgbMap |
|
6645 |
keysAndValuesDo:[:idx :rgb | |
|
6646 |
cmap at:idx put:(Color rgbValue:(rgb bitAnd:16rFFFFFF)) |
|
6647 |
]. |
|
261 | 6648 |
]. |
6649 |
||
6650 |
opaque := (clrModel instVarNamed:'opaque') ~~ 0. |
|
6651 |
opaque ifFalse:[ |
|
318 | 6652 |
transparentColorIndex := clrModel instVarNamed:'transparent_index' |
261 | 6653 |
]. |
6654 |
||
6655 |
img := imgRep instVarNamed:'pData'. |
|
405 | 6656 |
(img isNil or:[img == 0]) ifFalse:[ |
6657 |
"/ self halt |
|
6658 |
]. |
|
6659 |
||
6660 |
(offs ~~ 0 or:[scanLineWidth ~~ w]) ifTrue:[ |
|
6661 |
nBytes := ByteArray new:w*h. |
|
6662 |
srcIdx := offs+1. |
|
6663 |
dstIdx := 1. |
|
6664 |
1 to:h do:[:y | |
|
6665 |
nBytes replaceFrom:dstIdx to:(dstIdx+w-1) with:bytes startingAt:srcIdx. |
|
6666 |
srcIdx := srcIdx + scanLineWidth. |
|
6667 |
dstIdx := dstIdx + w. |
|
318 | 6668 |
]. |
405 | 6669 |
bytes := nBytes. |
6670 |
]. |
|
6671 |
img := Image width:w height:h depth:depth fromArray:bytes. |
|
6672 |
cmap notNil ifTrue:[ |
|
6673 |
img colorMap:cmap. |
|
6674 |
img photometric:#palette |
|
6675 |
]. |
|
6676 |
opaque ifFalse:[ |
|
6677 |
img mask:(ImageReader |
|
6678 |
buildMaskFromColor:transparentColorIndex |
|
6679 |
for:bytes |
|
6680 |
width:w |
|
6681 |
height:h) |
|
6682 |
]. |
|
6683 |
||
6684 |
imgRep instVarNamed:'pData' put:img. |
|
261 | 6685 |
^ 1. |
6686 |
||
6687 |
"Created: / 7.1.1998 / 22:31:46 / cg" |
|
405 | 6688 |
"Modified: / 21.10.1998 / 00:35:45 / cg" |
262 | 6689 |
! |
6690 |
||
297 | 6691 |
_ImageRepresentation_setIntPixels:nativeContext |
318 | 6692 |
|imgRep x y w h clrModel ints offs scanLineWidth |
316 | 6693 |
img depth cmap rgbMap opaque transparentColorIndex |
373 | 6694 |
bytes srcIdx dstIdx val red green blue |
6695 |
redMask greenMask blueMask redShift greenShift blueShift| |
|
297 | 6696 |
|
6697 |
imgRep := nativeContext receiver. |
|
6698 |
x := nativeContext argAt:1. |
|
6699 |
y := nativeContext argAt:2. |
|
6700 |
w := nativeContext argAt:3. |
|
6701 |
h := nativeContext argAt:4. |
|
6702 |
clrModel := nativeContext argAt:5. |
|
6703 |
ints := nativeContext argAt:6. |
|
318 | 6704 |
offs := nativeContext argAt:7. "/ offset ?? |
6705 |
scanLineWidth := nativeContext argAt:8. "/ scanLineWidth ?? |
|
297 | 6706 |
opaque := false. |
373 | 6707 |
offs ~~ 0 ifTrue:[ |
6708 |
self halt |
|
6709 |
]. |
|
297 | 6710 |
|
6711 |
depth := clrModel instVarNamed:'pixel_bits'. |
|
6712 |
clrModel class == (Java at:'java.awt.image.DirectColorModel') ifTrue:[ |
|
6713 |
] ifFalse:[ |
|
6714 |
(clrModel instVarNamed:'map_size') ~~ 0 ifTrue:[ |
|
6715 |
rgbMap := clrModel instVarNamed:'rgb'. |
|
6716 |
cmap := Array new:rgbMap size. |
|
6717 |
rgbMap |
|
6718 |
keysAndValuesDo:[:idx :rgb | |
|
6719 |
cmap at:idx put:(Color rgbValue:(rgb bitAnd:16rFFFFFF)) |
|
6720 |
]. |
|
6721 |
]. |
|
6722 |
opaque := (clrModel instVarNamed:'opaque') ~~ 0. |
|
6723 |
opaque ifFalse:[ |
|
6724 |
transparentColorIndex := clrModel instVarNamed:'transparent_index' |
|
6725 |
]. |
|
6726 |
]. |
|
6727 |
||
6728 |
img := imgRep instVarNamed:'pData'. |
|
405 | 6729 |
(img isNil or:[img == 0]) ifFalse:[ |
6730 |
"/ self halt. |
|
6731 |
]. |
|
6732 |
||
6733 |
depth == 32 ifTrue:[ |
|
6734 |
"/ temporary kludge - ony use 24 bits/pixel |
|
6735 |
bytes := ByteArray new:w*h*3. |
|
6736 |
srcIdx := 1. |
|
6737 |
dstIdx := 1. |
|
6738 |
redMask := clrModel instVarNamed:'red_mask'. |
|
6739 |
greenMask := clrModel instVarNamed:'green_mask'. |
|
6740 |
blueMask := clrModel instVarNamed:'blue_mask'. |
|
6741 |
redShift := (clrModel instVarNamed:'red_offset') negated. |
|
6742 |
greenShift := (clrModel instVarNamed:'green_offset') negated. |
|
6743 |
blueShift := (clrModel instVarNamed:'blue_offset') negated. |
|
6744 |
1 to:h do:[:y | |
|
6745 |
1 to:w do:[:x | |
|
6746 |
val := ints at:srcIdx. |
|
6747 |
red := (val bitAnd:redMask) bitShift:redShift. |
|
6748 |
green := (val bitAnd:greenMask) bitShift:greenShift. |
|
6749 |
blue := (val bitAnd:blueMask) bitShift:blueShift. |
|
6750 |
bytes at:dstIdx put:red. |
|
6751 |
bytes at:dstIdx+1 put:green. |
|
6752 |
bytes at:dstIdx+2 put:blue. |
|
6753 |
dstIdx := dstIdx + 3. |
|
6754 |
srcIdx := srcIdx + 1. |
|
316 | 6755 |
]. |
405 | 6756 |
srcIdx := srcIdx + (scanLineWidth - w). |
316 | 6757 |
]. |
405 | 6758 |
img := Depth24Image width:w height:h depth:24 fromArray:bytes. |
6759 |
] ifFalse:[ |
|
6760 |
scanLineWidth ~~ w ifTrue:[ |
|
6761 |
self halt |
|
297 | 6762 |
]. |
405 | 6763 |
img := Image width:w height:h depth:depth fromArray:ints. |
6764 |
]. |
|
6765 |
cmap notNil ifTrue:[ |
|
6766 |
img colorMap:cmap. |
|
6767 |
img photometric:#palette |
|
297 | 6768 |
] ifFalse:[ |
405 | 6769 |
img photometric:#rgb |
6770 |
]. |
|
6771 |
opaque ifFalse:[ |
|
6772 |
img mask:(ImageReader |
|
6773 |
buildMaskFromColor:transparentColorIndex |
|
6774 |
for:ints |
|
6775 |
width:w |
|
6776 |
height:h) |
|
6777 |
]. |
|
6778 |
||
6779 |
imgRep instVarNamed:'pData' put:img. |
|
297 | 6780 |
^ 1. |
6781 |
||
6782 |
"Created: / 1.2.1998 / 17:38:47 / cg" |
|
405 | 6783 |
"Modified: / 21.10.1998 / 00:35:37 / cg" |
297 | 6784 |
! |
6785 |
||
440 | 6786 |
_JPEGImageDecoder_readImage:nativeContext |
6787 |
UnimplementedNativeMethodSignal raise |
|
6788 |
||
6789 |
"Created: / 12.11.1998 / 18:53:30 / cg" |
|
6790 |
"Modified: / 12.11.1998 / 18:53:40 / cg" |
|
6791 |
! |
|
6792 |
||
262 | 6793 |
_OffScreenImageSource_sendPixels:nativeContext |
6794 |
"/ self halt. |
|
6795 |
||
6796 |
"Modified: / 16.1.1998 / 18:22:23 / cg" |
|
6797 |
"Created: / 17.1.1998 / 12:36:25 / cg" |
|
255 | 6798 |
! ! |
6799 |
||
280 | 6800 |
!JavaVM class methodsFor:'native - sun.awt - jdk1.2'! |
6801 |
||
284 | 6802 |
_ColorModel_initIDs:nativeContext |
6803 |
"/ new with jdk1.2 ... |
|
6804 |
||
6805 |
"Created: / 28.1.1998 / 22:19:23 / cg" |
|
6806 |
! |
|
6807 |
||
6808 |
_FontDescriptor_initIDs:nativeContext |
|
6809 |
"/ new with jdk1.2 ... |
|
6810 |
||
6811 |
"Created: / 28.1.1998 / 22:30:52 / cg" |
|
6812 |
! |
|
6813 |
||
6814 |
_Font_initIDs:nativeContext |
|
6815 |
"/ new with jdk1.2 ... |
|
6816 |
||
6817 |
"Created: / 27.1.1998 / 21:43:25 / cg" |
|
6818 |
! |
|
6819 |
||
6820 |
_PackedColorModel_initIDs:nativeContext |
|
6821 |
"/ new with jdk1.2 ... |
|
6822 |
||
6823 |
"Created: / 28.1.1998 / 22:19:35 / cg" |
|
6824 |
! |
|
6825 |
||
6826 |
_PlatformFont_initIDs:nativeContext |
|
6827 |
"/ new with jdk1.2 ... |
|
6828 |
||
6829 |
"Created: / 28.1.1998 / 22:30:41 / cg" |
|
6830 |
! |
|
6831 |
||
6832 |
_X11GraphicsDevice_getConfigType:nativeContext |
|
6833 |
"/ new with jdk1.2 ... |
|
6834 |
||
6835 |
|configNr cls| |
|
6836 |
||
6837 |
"/ for now, only one config. |
|
6838 |
configNr := nativeContext argAt:1. |
|
6839 |
||
6840 |
cls := Java classNamed:'java.awt.GraphicsDevice'. |
|
6841 |
^ cls instVarNamed:'TYPE_RASTER_SCREEN'. |
|
6842 |
||
6843 |
"Created: / 28.1.1998 / 22:19:05 / cg" |
|
6844 |
! |
|
6845 |
||
6846 |
_X11GraphicsDevice_getNumConfigs:nativeContext |
|
6847 |
"/ new with jdk1.2 ... |
|
6848 |
||
6849 |
^ 1 |
|
6850 |
||
6851 |
"Created: / 28.1.1998 / 22:13:26 / cg" |
|
6852 |
"Modified: / 28.1.1998 / 22:14:33 / cg" |
|
6853 |
! |
|
6854 |
||
6855 |
_X11GraphicsEnvironment_getNumScreens:nativeContext |
|
6856 |
"/ new with jdk1.2 ... |
|
6857 |
||
6858 |
"/ could return the actual number of screens ... |
|
6859 |
||
6860 |
^ 1 |
|
6861 |
||
6862 |
"Created: / 28.1.1998 / 01:50:22 / cg" |
|
6863 |
"Modified: / 28.1.1998 / 22:12:32 / cg" |
|
6864 |
! |
|
6865 |
||
280 | 6866 |
_X11GraphicsEnvironment_initDisplay:nativeContext |
6867 |
"/ new with jdk1.2 ... |
|
6868 |
||
6869 |
"Created: / 28.1.1998 / 01:50:22 / cg" |
|
6870 |
! ! |
|
6871 |
||
284 | 6872 |
!JavaVM class methodsFor:'native - sun.awt.motif - jdk1.2'! |
6873 |
||
6874 |
_InputThread_run:nativeContext |
|
6875 |
self _WToolkit_eventLoop:nativeContext. |
|
6876 |
||
6877 |
"Created: / 28.1.1998 / 22:34:47 / cg" |
|
6878 |
"Modified: / 28.1.1998 / 22:35:16 / cg" |
|
6879 |
! |
|
6880 |
||
6881 |
_MComponentPeer_cacheInit:nativeContext |
|
6882 |
||
6883 |
"Created: / 28.1.1998 / 22:22:30 / cg" |
|
6884 |
! |
|
6885 |
||
457 | 6886 |
_MComponentPeer_pHide:nativeContext |
6887 |
^ self _WComponentPeer_hide:nativeContext |
|
6888 |
||
6889 |
"Created: / 18.11.1998 / 00:15:18 / cg" |
|
6890 |
! |
|
6891 |
||
284 | 6892 |
_MComponentPeer_pInitialize:nativeContext |
6893 |
||
6894 |
"Created: / 28.1.1998 / 22:27:25 / cg" |
|
6895 |
! |
|
6896 |
||
6897 |
_MComponentPeer_setCursor:nativeContext |
|
6898 |
||
6899 |
"Created: / 28.1.1998 / 22:27:35 / cg" |
|
6900 |
! |
|
6901 |
||
6902 |
_MFramePeer_create:nativeContext |
|
6903 |
^ self _WFramePeer_create:nativeContext |
|
6904 |
||
6905 |
"Created: / 28.1.1998 / 22:25:44 / cg" |
|
6906 |
! |
|
6907 |
||
6908 |
_MFramePeer_pHide:nativeContext |
|
6909 |
^ self _WComponentPeer_hide:nativeContext |
|
6910 |
||
6911 |
"Created: / 28.1.1998 / 22:27:04 / cg" |
|
6912 |
! |
|
6913 |
||
6914 |
_MFramePeer_pReshape:nativeContext |
|
6915 |
self commonReshapeComponent:nativeContext |
|
6916 |
||
6917 |
"Created: / 28.1.1998 / 22:28:00 / cg" |
|
6918 |
"Modified: / 28.1.1998 / 22:29:34 / cg" |
|
6919 |
! |
|
6920 |
||
6921 |
_MFramePeer_pSetTitle:nativeContext |
|
6922 |
self _WWindowPeer__setTitle:nativeContext |
|
6923 |
||
6924 |
"Created: / 28.1.1998 / 22:30:23 / cg" |
|
6925 |
! |
|
6926 |
||
6927 |
_MToolkit_init:nativeContext |
|
6928 |
||
6929 |
"Created: / 28.1.1998 / 22:21:54 / cg" |
|
6930 |
! |
|
6931 |
||
6932 |
_MToolkit_run:nativeContext |
|
6933 |
||
6934 |
"Created: / 28.1.1998 / 22:22:10 / cg" |
|
6935 |
! ! |
|
6936 |
||
6937 |
!JavaVM class methodsFor:'native - sun.awt.windows'! |
|
6938 |
||
457 | 6939 |
_MComponentPeer_handleEvent:nativeContext |
6940 |
^ self _WComponentPeer_handleEvent:nativeContext |
|
6941 |
||
6942 |
"Created: / 18.11.1998 / 00:21:17 / cg" |
|
6943 |
! |
|
6944 |
||
6945 |
_MComponentPeer_pShow:nativeContext |
|
6946 |
|view| |
|
6947 |
||
6948 |
view := self viewForWPeer:nativeContext. |
|
6949 |
||
6950 |
"/ frame views are under my browsers own control |
|
6951 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
6952 |
view beVisible. |
|
6953 |
view realize. |
|
6954 |
]. |
|
6955 |
||
6956 |
"/ view windowGroup notNil ifTrue:[ |
|
6957 |
"/ windowServer addGroup:(view windowGroup) |
|
6958 |
"/ ]. |
|
6959 |
||
6960 |
^ nil |
|
6961 |
||
6962 |
"/ self halt. |
|
6963 |
||
6964 |
"Modified: / 25.1.1998 / 09:54:07 / cg" |
|
6965 |
"Created: / 18.11.1998 / 00:21:51 / cg" |
|
6966 |
! |
|
6967 |
||
284 | 6968 |
_WButtonPeer_create:nativeContext |
6969 |
|jButtonPeer jButton jFrame frame button |
|
6970 |
lbl| |
|
6971 |
||
6972 |
jButtonPeer := nativeContext receiver. |
|
6973 |
jButton := jButtonPeer instVarNamed:'target'. |
|
6974 |
||
6975 |
jFrame := nativeContext argAt:1. |
|
6976 |
frame := jFrame instVarNamed:'pData'. |
|
6977 |
||
6978 |
button := Button in:frame. |
|
448 | 6979 |
button action:[ |
6980 |
jButtonPeer perform:#'handleAction()V'. |
|
6981 |
]. |
|
284 | 6982 |
|
6983 |
lbl := jButton instVarNamed:'label'. |
|
6984 |
lbl notNil ifTrue:[ |
|
419 | 6985 |
lbl := Java as_ST_String:lbl. |
6986 |
button label:lbl |
|
284 | 6987 |
]. |
6988 |
self createdWindowsView:button for:jButtonPeer. |
|
6989 |
||
6990 |
WindowCreationTrace == true ifTrue:[ |
|
419 | 6991 |
'WButtonPeer_create: ' print. frame print. ' -> ' print. button printNL. |
284 | 6992 |
]. |
6993 |
||
6994 |
"Created: / 5.1.1998 / 01:53:30 / cg" |
|
448 | 6995 |
"Modified: / 13.11.1998 / 22:59:46 / cg" |
284 | 6996 |
! |
6997 |
||
297 | 6998 |
_WButtonPeer_setLabel:nativeContext |
6999 |
|label jString| |
|
7000 |
||
7001 |
jString := nativeContext argAt:1. |
|
7002 |
||
7003 |
label := self viewForWPeer:nativeContext. |
|
7004 |
label label:(Java as_ST_String:jString) |
|
7005 |
||
7006 |
"Modified: / 8.1.1998 / 17:35:50 / cg" |
|
7007 |
"Created: / 1.2.1998 / 17:05:47 / cg" |
|
7008 |
! |
|
7009 |
||
284 | 7010 |
_WCanvasPeer_create:nativeContext |
7011 |
|jCanvasPeer jFrame frame subView| |
|
7012 |
||
7013 |
jCanvasPeer := nativeContext receiver. |
|
7014 |
||
7015 |
jFrame := nativeContext argAt:1. |
|
7016 |
jFrame isNil ifTrue:[ |
|
7017 |
self halt:'no frame in canvasPeer create'. |
|
7018 |
self internalError:'no frame in canvasPeer create'. |
|
7019 |
^ self. |
|
7020 |
]. |
|
7021 |
frame := jFrame instVarNamed:'pData'. |
|
7022 |
||
7023 |
subView := JavaView in:frame. |
|
7024 |
subView delegate:self. |
|
7025 |
subView javaPeer:jCanvasPeer. |
|
7026 |
||
7027 |
self createdWindowsView:subView for:jCanvasPeer. |
|
7028 |
||
7029 |
WindowCreationTrace == true ifTrue:[ |
|
7030 |
'WCanvasPeer_create: ' print. frame print. ' -> ' print. subView printNL. |
|
7031 |
]. |
|
7032 |
||
7033 |
"Created: / 5.1.1998 / 00:59:19 / cg" |
|
7034 |
"Modified: / 16.1.1998 / 13:40:00 / cg" |
|
7035 |
! |
|
7036 |
||
440 | 7037 |
_WCheckboxMenuItemPeer_setState:nativeContext |
7038 |
"/ void setState (boolean) |
|
7039 |
UnimplementedNativeMethodSignal raise |
|
7040 |
||
7041 |
"Created: / 12.11.1998 / 19:14:35 / cg" |
|
7042 |
! |
|
7043 |
||
284 | 7044 |
_WCheckboxPeer_create:nativeContext |
7045 |
|jCheckboxPeer jCheckbox jFrame frame checkBox lbl| |
|
7046 |
||
7047 |
jCheckboxPeer := nativeContext receiver. |
|
7048 |
jCheckbox := jCheckboxPeer instVarNamed:'target'. |
|
7049 |
||
7050 |
jFrame := nativeContext argAt:1. |
|
7051 |
frame := jFrame instVarNamed:'pData'. |
|
7052 |
||
7053 |
checkBox := CheckBox in:frame. |
|
7054 |
checkBox action:[ |
|
7055 |
jCheckboxPeer |
|
7056 |
perform:#'handleAction(Z)V' |
|
7057 |
with:(checkBox isOn ifTrue:[1] ifFalse:[0]) |
|
7058 |
]. |
|
7059 |
||
7060 |
lbl := jCheckbox instVarNamed:'label'. |
|
7061 |
lbl notNil ifTrue:[ |
|
7062 |
lbl := Java as_ST_String:lbl. |
|
7063 |
checkBox label:lbl |
|
7064 |
]. |
|
7065 |
||
7066 |
self createdWindowsView:checkBox for:jCheckboxPeer. |
|
7067 |
||
7068 |
WindowCreationTrace == true ifTrue:[ |
|
7069 |
'WCheckboxPeer_create: ' print. frame print. ' -> ' print. checkBox printNL. |
|
7070 |
]. |
|
7071 |
||
7072 |
"Created: / 7.1.1998 / 21:48:03 / cg" |
|
7073 |
"Modified: / 15.1.1998 / 12:27:04 / cg" |
|
7074 |
! |
|
7075 |
||
7076 |
_WCheckboxPeer_setCheckboxGroup:nativeContext |
|
7077 |
|checkBox jGroup| |
|
7078 |
||
7079 |
checkBox := self viewForWPeer:nativeContext. |
|
7080 |
||
7081 |
jGroup := nativeContext argAt:1. |
|
7082 |
||
7083 |
"Created: / 7.1.1998 / 21:48:47 / cg" |
|
7084 |
"Modified: / 25.1.1998 / 01:20:42 / cg" |
|
7085 |
! |
|
7086 |
||
440 | 7087 |
_WCheckboxPeer_setLabel:nativeContext |
7088 |
"/ void setLabel (java.lang.String) |
|
7089 |
UnimplementedNativeMethodSignal raise |
|
7090 |
||
7091 |
"Created: / 12.11.1998 / 19:14:53 / cg" |
|
7092 |
! |
|
7093 |
||
284 | 7094 |
_WCheckboxPeer_setState:nativeContext |
7095 |
|checkBox state| |
|
7096 |
||
7097 |
checkBox := self viewForWPeer:nativeContext. |
|
7098 |
||
7099 |
state := nativeContext argAt:1. |
|
7100 |
state ~~ 0 ifTrue:[ |
|
7101 |
checkBox turnOn |
|
7102 |
] ifFalse:[ |
|
7103 |
checkBox turnOff |
|
7104 |
]. |
|
7105 |
||
7106 |
"Created: / 7.1.1998 / 21:49:13 / cg" |
|
7107 |
"Modified: / 25.1.1998 / 01:26:18 / cg" |
|
7108 |
! |
|
7109 |
||
7110 |
_WChoicePeer_addItem:nativeContext |
|
7111 |
|jString index comboBox| |
|
7112 |
||
7113 |
comboBox := self viewForWPeer:nativeContext. |
|
7114 |
||
7115 |
jString := nativeContext argAt:1. |
|
7116 |
index := nativeContext argAt:2. |
|
7117 |
||
7118 |
comboBox model list addLast:(Java as_ST_String:jString). |
|
7119 |
comboBox model changed:#list. |
|
7120 |
||
7121 |
"Created: / 7.1.1998 / 21:45:12 / cg" |
|
7122 |
"Modified: / 24.1.1998 / 18:51:32 / cg" |
|
7123 |
! |
|
7124 |
||
7125 |
_WChoicePeer_create:nativeContext |
|
7126 |
|jChoicePeer jChoice jFrame frame comboBox| |
|
7127 |
||
7128 |
jChoicePeer := nativeContext receiver. |
|
7129 |
jChoice := jChoicePeer instVarNamed:'target'. |
|
7130 |
||
7131 |
jFrame := nativeContext argAt:1. |
|
7132 |
frame := jFrame instVarNamed:'pData'. |
|
7133 |
||
7134 |
comboBox := ComboListView in:frame. |
|
7135 |
comboBox model:(SelectionInList new list:(OrderedCollection new)). |
|
285 | 7136 |
comboBox action:[:index | |
7137 |
jChoicePeer |
|
7138 |
perform:#'handleAction(I)V' |
|
7139 |
with:(comboBox model selectionIndex - 1) |
|
7140 |
]. |
|
284 | 7141 |
|
7142 |
self createdWindowsView:comboBox for:jChoicePeer. |
|
7143 |
||
7144 |
WindowCreationTrace == true ifTrue:[ |
|
7145 |
'WChoicePeer_create: ' print. frame print. ' -> ' print. comboBox printNL. |
|
7146 |
]. |
|
7147 |
||
7148 |
"Created: / 7.1.1998 / 21:44:31 / cg" |
|
285 | 7149 |
"Modified: / 28.1.1998 / 23:19:17 / cg" |
284 | 7150 |
! |
7151 |
||
440 | 7152 |
_WChoicePeer_remove:nativeContext |
7153 |
"/ void remove (int) |
|
7154 |
UnimplementedNativeMethodSignal raise |
|
7155 |
||
7156 |
"Created: / 12.11.1998 / 19:12:20 / cg" |
|
7157 |
! |
|
7158 |
||
284 | 7159 |
_WChoicePeer_reshape:nativeContext |
7160 |
self pReshape:nativeContext. |
|
7161 |
^ self. |
|
7162 |
||
7163 |
"Modified: / 15.8.1997 / 15:36:29 / cg" |
|
7164 |
"Created: / 7.1.1998 / 21:46:18 / cg" |
|
7165 |
! |
|
7166 |
||
7167 |
_WChoicePeer_select:nativeContext |
|
7168 |
|comboBox index| |
|
7169 |
||
7170 |
comboBox := self viewForWPeer:nativeContext. |
|
7171 |
||
7172 |
index := nativeContext argAt:1. |
|
7173 |
comboBox model selectionIndex:(index + 1). "/ JAVA indexing starts at 0 |
|
7174 |
||
7175 |
"Created: / 7.1.1998 / 21:45:43 / cg" |
|
7176 |
"Modified: / 25.1.1998 / 09:55:05 / cg" |
|
7177 |
! |
|
7178 |
||
440 | 7179 |
_WClipboard_getClipboardText:nativeContext |
7180 |
"/ java.lang.String getClipboardText () |
|
7181 |
UnimplementedNativeMethodSignal raise |
|
7182 |
||
7183 |
"Created: / 12.11.1998 / 19:15:45 / cg" |
|
7184 |
! |
|
7185 |
||
284 | 7186 |
_WClipboard_init:nativeContext |
7187 |
"/ self halt. |
|
7188 |
||
7189 |
"Modified: / 18.3.1997 / 18:43:18 / cg" |
|
7190 |
"Created: / 4.1.1998 / 19:03:59 / cg" |
|
7191 |
! |
|
7192 |
||
440 | 7193 |
_WClipboard_setClipboardText:nativeContext |
7194 |
"/ void setClipboardText (java.awt.datatransfer.StringSelection) |
|
7195 |
UnimplementedNativeMethodSignal raise |
|
7196 |
||
7197 |
"Created: / 12.11.1998 / 19:15:31 / cg" |
|
7198 |
! |
|
7199 |
||
284 | 7200 |
_WColor_getDefaultColor:nativeContext |
7201 |
|clrIndex jClr clr | |
|
7202 |
||
7203 |
clrIndex := nativeContext argAt:1. |
|
7204 |
"/ windows defaults: |
|
7205 |
"/ 1: view background |
|
7206 |
||
7207 |
clrIndex == 1 ifTrue:[ |
|
7208 |
clr := View defaultViewBackgroundColor. |
|
7209 |
clr isColor ifFalse:[ |
|
7210 |
clr := Color gray:50. |
|
7211 |
]. |
|
7212 |
]. |
|
7213 |
clrIndex == 2 ifTrue:[ |
|
7214 |
clr := Color black. |
|
7215 |
]. |
|
7216 |
clr isNil ifTrue:[ |
|
7217 |
self halt. |
|
7218 |
self internalError:'breakpoint'. |
|
7219 |
^ nil. |
|
7220 |
]. |
|
7221 |
||
7222 |
clr := clr on:(Screen current). |
|
7223 |
||
7224 |
jClr := (Java classForName:'java.awt.Color') new. |
|
7225 |
||
7226 |
jClr instVarNamed:'pData' put:clr. |
|
7227 |
jClr instVarNamed:'value' put:(clr rgbValue). |
|
7228 |
"/ self halt. |
|
7229 |
^ jClr. |
|
7230 |
||
7231 |
"Created: / 15.8.1997 / 15:38:10 / cg" |
|
7232 |
"Modified: / 4.1.1998 / 18:06:51 / cg" |
|
7233 |
! |
|
7234 |
||
440 | 7235 |
_WComponentPeer__beginValidate:nativeContext |
7236 |
"/ void _beginValidate () |
|
7237 |
UnimplementedNativeMethodSignal raise |
|
7238 |
||
7239 |
"Created: / 12.11.1998 / 19:10:08 / cg" |
|
7240 |
! |
|
7241 |
||
284 | 7242 |
_WComponentPeer__dispose:nativeContext |
7243 |
|view jPeer| |
|
7244 |
||
7245 |
view := self viewForWPeer:nativeContext. |
|
7246 |
||
7247 |
Object errorSignal catch:[ |
|
7248 |
view destroy. |
|
7249 |
]. |
|
7250 |
JavaWindowGroup removeView:view. |
|
7251 |
||
7252 |
jPeer := nativeContext receiver. |
|
7253 |
jPeer instVarNamed:'pData' put:0. |
|
7254 |
||
7255 |
"Created: / 7.1.1998 / 22:36:25 / cg" |
|
7256 |
"Modified: / 25.1.1998 / 16:43:06 / cg" |
|
7257 |
! |
|
7258 |
||
7259 |
_WComponentPeer__setBackground:nativeContext |
|
7260 |
|rgb clr view| |
|
7261 |
||
7262 |
view := self viewForWPeer:nativeContext. |
|
7263 |
||
7264 |
rgb := nativeContext argAt:1. |
|
7265 |
clr := Color rgbValue:rgb. |
|
7266 |
||
7267 |
"/ self halt. |
|
7268 |
"/ self internalError:'breakPoint'. |
|
7269 |
||
7270 |
clr := clr on:(view device). |
|
7271 |
||
7272 |
"/ (view superView isMemberOf:JavaEmbeddedFrameView) ifTrue:[ |
|
7273 |
"/ view viewBackground:(view superView viewBackground). |
|
7274 |
"/ view backgroundPaint:(view superView viewBackground). |
|
7275 |
"/ ] ifFalse:[ |
|
7276 |
"/ (view isMemberOf:JavaView) ifTrue:[ |
|
7277 |
"/ view viewBackground:clr. |
|
7278 |
"/ view backgroundPaint:clr. |
|
7279 |
"/ ] |
|
7280 |
"/ ]. |
|
7281 |
||
7282 |
(view isKindOf:ScrollableView) ifTrue:[ |
|
7283 |
view := view scrolledView |
|
7284 |
]. |
|
7285 |
view viewBackground:clr. |
|
7286 |
view backgroundPaint:clr. |
|
7287 |
||
7288 |
"Created: / 4.1.1998 / 18:07:39 / cg" |
|
7289 |
"Modified: / 15.1.1998 / 13:06:44 / cg" |
|
7290 |
! |
|
7291 |
||
7292 |
_WComponentPeer__setForeground:nativeContext |
|
7293 |
|rgb clr view| |
|
7294 |
||
7295 |
view := self viewForWPeer:nativeContext. |
|
7296 |
||
7297 |
rgb := nativeContext argAt:1. |
|
7298 |
clr := Color rgbValue:rgb. |
|
7299 |
||
7300 |
"/ self halt. |
|
7301 |
"/ self internalError:'breakPoint'. |
|
7302 |
||
7303 |
clr := clr on:(view device). |
|
7304 |
||
7305 |
view paint:clr. |
|
7306 |
||
7307 |
"Created: / 4.1.1998 / 18:08:13 / cg" |
|
7308 |
"Modified: / 8.1.1998 / 17:32:45 / cg" |
|
7309 |
! |
|
7310 |
||
7311 |
_WComponentPeer_disable:nativeContext |
|
7312 |
|view| |
|
7313 |
||
7314 |
view := self viewForWPeer:nativeContext. |
|
7315 |
||
7316 |
Object errorSignal handle:[:ex | |
|
7317 |
] do:[ |
|
7318 |
view disable |
|
7319 |
] |
|
7320 |
||
7321 |
"Created: / 6.1.1998 / 18:26:36 / cg" |
|
7322 |
"Modified: / 8.1.1998 / 17:32:53 / cg" |
|
7323 |
! |
|
7324 |
||
7325 |
_WComponentPeer_enable:nativeContext |
|
7326 |
|view| |
|
7327 |
||
7328 |
view := self viewForWPeer:nativeContext. |
|
7329 |
||
7330 |
Object errorSignal handle:[:ex | |
|
7331 |
] do:[ |
|
7332 |
view enable |
|
7333 |
] |
|
7334 |
||
7335 |
"Modified: / 8.1.1998 / 17:32:53 / cg" |
|
7336 |
"Created: / 13.1.1998 / 23:08:05 / cg" |
|
7337 |
! |
|
7338 |
||
440 | 7339 |
_WComponentPeer_endValidate:nativeContext |
7340 |
"/ void endValidate () |
|
7341 |
UnimplementedNativeMethodSignal raise |
|
7342 |
||
7343 |
"Created: / 12.11.1998 / 19:10:20 / cg" |
|
7344 |
! |
|
7345 |
||
7346 |
_WComponentPeer_getLocationOnScreen:nativeContext |
|
7347 |
"/ java.awt.Point getLocationOnScreen () |
|
7348 |
UnimplementedNativeMethodSignal raise |
|
7349 |
||
7350 |
"Created: / 12.11.1998 / 19:09:46 / cg" |
|
7351 |
! |
|
7352 |
||
284 | 7353 |
_WComponentPeer_handleEvent:nativeContext |
7354 |
"this is invoked by java, to let a widget handle any event which |
|
7355 |
was not consumed (eaten) by java. |
|
7356 |
If the view in question is some ST-widget, forward it. |
|
7357 |
Ignore for JavaViews." |
|
7358 |
||
7359 |
|view jEv stEv| |
|
7360 |
||
7361 |
view := self viewForWPeer:nativeContext. |
|
7362 |
view notNil ifTrue:[ |
|
316 | 7363 |
(view isKindOf:JavaView) ifFalse:[ |
7364 |
jEv := nativeContext argAt:1. |
|
7365 |
stEv := jEv instVarNamed:'data'. |
|
7366 |
(stEv notNil and:[stEv ~~ 0]) ifTrue:[ |
|
7367 |
EventTrace == true ifTrue:[ |
|
7368 |
('JAVA: WComponent - handleEvent: ' , stEv type , ' for ' , view printString) infoPrintCR. |
|
7369 |
]. |
|
7370 |
stEv sendEventWithFocusOn:nil. |
|
7371 |
^ self. |
|
7372 |
] |
|
7373 |
] |
|
7374 |
]. |
|
7375 |
EventTrace == true ifTrue:[ |
|
7376 |
('JAVA: WComponent - handleEvent ignored') infoPrintCR. |
|
7377 |
] |
|
284 | 7378 |
|
7379 |
"Created: / 6.1.1998 / 21:10:17 / cg" |
|
316 | 7380 |
"Modified: / 6.2.1998 / 00:54:42 / cg" |
284 | 7381 |
! |
7382 |
||
7383 |
_WComponentPeer_hide:nativeContext |
|
7384 |
|view| |
|
7385 |
||
7386 |
view := self viewForWPeer:nativeContext. |
|
7387 |
||
7388 |
Object errorSignal handle:[:ex | |
|
7389 |
] do:[ |
|
7390 |
view beInvisible |
|
7391 |
] |
|
7392 |
||
7393 |
"Created: / 7.1.1998 / 22:35:32 / cg" |
|
7394 |
"Modified: / 8.1.1998 / 17:33:08 / cg" |
|
7395 |
! |
|
7396 |
||
391 | 7397 |
_WComponentPeer_nativeHandleEvent:nativeContext |
7398 |
"this is invoked by java, to let a widget handle any event which |
|
7399 |
was not consumed (eaten) by java. |
|
7400 |
If the view in question is some ST-widget, forward it. |
|
7401 |
Ignore for JavaViews." |
|
7402 |
||
7403 |
|view jEv stEv| |
|
7404 |
||
7405 |
^self. |
|
7406 |
view := self viewForWPeer:nativeContext. |
|
7407 |
view notNil ifTrue:[ |
|
7408 |
(view isKindOf:JavaView) ifFalse:[ |
|
7409 |
jEv := nativeContext argAt:1. |
|
7410 |
stEv := jEv instVarNamed:'data'. |
|
7411 |
(stEv notNil and:[stEv ~~ 0]) ifTrue:[ |
|
7412 |
EventTrace == true ifTrue:[ |
|
7413 |
('JAVA: WComponent - handleEvent: ' , stEv type , ' for ' , view printString) infoPrintCR. |
|
7414 |
]. |
|
7415 |
stEv sendEventWithFocusOn:nil. |
|
7416 |
^ self. |
|
7417 |
] |
|
7418 |
] |
|
7419 |
]. |
|
7420 |
EventTrace == true ifTrue:[ |
|
7421 |
('JAVA: WComponent - handleEvent ignored') infoPrintCR. |
|
7422 |
] |
|
7423 |
||
7424 |
"Created: / 19.10.1998 / 21:26:16 / cg" |
|
7425 |
"Modified: / 19.10.1998 / 23:26:37 / cg" |
|
7426 |
! |
|
7427 |
||
284 | 7428 |
_WComponentPeer_requestFocus:nativeContext |
7429 |
|view| |
|
7430 |
||
7431 |
view := self viewForWPeer:nativeContext. |
|
318 | 7432 |
"/ 'getFocus - ' print. view displayString printCR. |
284 | 7433 |
|
7434 |
view getKeyboardFocus |
|
7435 |
||
7436 |
"Created: / 7.1.1998 / 22:30:03 / cg" |
|
318 | 7437 |
"Modified: / 6.2.1998 / 02:22:17 / cg" |
284 | 7438 |
! |
7439 |
||
7440 |
_WComponentPeer_reshape:nativeContext |
|
7441 |
self commonReshapeComponent:nativeContext |
|
7442 |
||
7443 |
"Modified: / 18.3.1997 / 19:30:21 / cg" |
|
7444 |
"Created: / 4.1.1998 / 18:01:11 / cg" |
|
7445 |
! |
|
7446 |
||
7447 |
_WComponentPeer_setCursor:nativeContext |
|
7448 |
|view| |
|
7449 |
||
7450 |
view := self viewForWPeer:nativeContext. |
|
7451 |
"/ self halt. |
|
7452 |
||
7453 |
"Created: / 5.1.1998 / 01:52:30 / cg" |
|
7454 |
"Modified: / 25.1.1998 / 01:21:52 / cg" |
|
7455 |
! |
|
7456 |
||
7457 |
_WComponentPeer_setFont:nativeContext |
|
7458 |
|view| |
|
7459 |
||
7460 |
view := self viewForWPeer:nativeContext. |
|
7461 |
"/ self halt. |
|
7462 |
||
7463 |
"Created: / 5.1.1998 / 00:55:17 / cg" |
|
7464 |
"Modified: / 25.1.1998 / 01:22:19 / cg" |
|
7465 |
! |
|
7466 |
||
7467 |
_WComponentPeer_setZOrderPosition:nativeContext |
|
7468 |
|view| |
|
7469 |
||
7470 |
view := self viewForWPeer:nativeContext. |
|
7471 |
"/ self unimplementedNativeMethod. |
|
7472 |
"/ self halt. |
|
7473 |
"/ self internalError:'breakPoint' |
|
7474 |
||
7475 |
"Created: / 4.1.1998 / 17:59:26 / cg" |
|
7476 |
"Modified: / 25.1.1998 / 01:22:32 / cg" |
|
7477 |
! |
|
7478 |
||
7479 |
_WComponentPeer_show:nativeContext |
|
7480 |
|view| |
|
7481 |
||
7482 |
view := self viewForWPeer:nativeContext. |
|
7483 |
||
7484 |
"/ frame views are under my browsers own control |
|
7485 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
7486 |
view beVisible. |
|
7487 |
view realize. |
|
7488 |
]. |
|
7489 |
||
7490 |
"/ view windowGroup notNil ifTrue:[ |
|
7491 |
"/ windowServer addGroup:(view windowGroup) |
|
7492 |
"/ ]. |
|
7493 |
||
7494 |
^ nil |
|
7495 |
||
7496 |
"/ self halt. |
|
7497 |
||
7498 |
"Created: / 5.1.1998 / 01:26:22 / cg" |
|
7499 |
"Modified: / 25.1.1998 / 09:54:07 / cg" |
|
7500 |
! |
|
7501 |
||
7502 |
_WComponentPeer_start:nativeContext |
|
7503 |
"/ self halt. |
|
7504 |
||
7505 |
"Modified: / 18.3.1997 / 18:43:18 / cg" |
|
7506 |
"Created: / 5.1.1998 / 00:58:40 / cg" |
|
7507 |
! |
|
7508 |
||
7509 |
_WDefaultFontCharset_canConvert:nativeContext |
|
7510 |
^ 1 |
|
7511 |
||
7512 |
"Modified: / 21.8.1997 / 15:56:57 / cg" |
|
7513 |
"Created: / 5.1.1998 / 01:55:47 / cg" |
|
7514 |
! |
|
7515 |
||
7516 |
_WDialogPeer__hide:nativeContext |
|
7517 |
|dialog| |
|
7518 |
||
7519 |
dialog := self viewForWPeer:nativeContext. |
|
7520 |
||
7521 |
dialog hide. |
|
7522 |
||
7523 |
"Created: / 7.1.1998 / 22:34:10 / cg" |
|
7524 |
"Modified: / 8.1.1998 / 17:34:10 / cg" |
|
7525 |
! |
|
7526 |
||
7527 |
_WDialogPeer__show:nativeContext |
|
7528 |
|dialog| |
|
7529 |
||
7530 |
dialog := self viewForWPeer:nativeContext. |
|
7531 |
"/ |
|
7532 |
"/ show does not work (yet); must setup windowgroup |
|
7533 |
"/ for it to get events ... |
|
7534 |
"/ dialog show. |
|
7535 |
dialog realize. |
|
7536 |
||
7537 |
"Created: / 7.1.1998 / 21:52:15 / cg" |
|
7538 |
"Modified: / 15.1.1998 / 15:57:03 / cg" |
|
7539 |
! |
|
7540 |
||
7541 |
_WDialogPeer_create:nativeContext |
|
7542 |
|jDialogPeer dialog| |
|
7543 |
||
7544 |
jDialogPeer := nativeContext receiver. |
|
7545 |
||
7546 |
dialog := ModalBox new. |
|
7547 |
jDialogPeer instVarNamed:'pData' put:dialog. |
|
7548 |
||
7549 |
self createdWindowsView:dialog for:jDialogPeer. |
|
7550 |
dialog windowGroup:JavaWindowGroup. |
|
7551 |
JavaWindowGroup addTopView:dialog. |
|
7552 |
||
7553 |
WindowCreationTrace == true ifTrue:[ |
|
7554 |
'WDialogPeer_create: ' print. dialog printNL. |
|
7555 |
]. |
|
7556 |
||
7557 |
"Created: / 7.1.1998 / 21:51:00 / cg" |
|
7558 |
"Modified: / 15.1.1998 / 16:12:44 / cg" |
|
7559 |
! |
|
7560 |
||
440 | 7561 |
_WDrawingSurfaceInfo_getDepth:nativeContext |
7562 |
"/ int getDepth () |
|
7563 |
UnimplementedNativeMethodSignal raise |
|
7564 |
||
7565 |
"Created: / 12.11.1998 / 19:21:00 / cg" |
|
7566 |
! |
|
7567 |
||
7568 |
_WDrawingSurfaceInfo_getHBitmap:nativeContext |
|
7569 |
"/ int getHBitmap () |
|
7570 |
UnimplementedNativeMethodSignal raise |
|
7571 |
||
7572 |
"Created: / 12.11.1998 / 19:20:32 / cg" |
|
7573 |
! |
|
7574 |
||
7575 |
_WDrawingSurfaceInfo_getHDC:nativeContext |
|
7576 |
"/ int getHDC () |
|
7577 |
UnimplementedNativeMethodSignal raise |
|
7578 |
||
7579 |
"Created: / 12.11.1998 / 19:20:50 / cg" |
|
7580 |
! |
|
7581 |
||
7582 |
_WDrawingSurfaceInfo_getHPalette:nativeContext |
|
7583 |
"/ int getHPalette () |
|
7584 |
UnimplementedNativeMethodSignal raise |
|
7585 |
||
7586 |
"Created: / 12.11.1998 / 19:21:07 / cg" |
|
7587 |
! |
|
7588 |
||
7589 |
_WDrawingSurfaceInfo_getHWnd:nativeContext |
|
7590 |
"/ int getHWnd () |
|
7591 |
UnimplementedNativeMethodSignal raise |
|
7592 |
||
7593 |
"Created: / 12.11.1998 / 19:20:23 / cg" |
|
7594 |
! |
|
7595 |
||
7596 |
_WDrawingSurfaceInfo_getPBits:nativeContext |
|
7597 |
"/ int getPBits () |
|
7598 |
UnimplementedNativeMethodSignal raise |
|
7599 |
||
7600 |
"Created: / 12.11.1998 / 19:20:41 / cg" |
|
7601 |
! |
|
7602 |
||
7603 |
_WDrawingSurfaceInfo_lock:nativeContext |
|
7604 |
"/ int lock () |
|
7605 |
UnimplementedNativeMethodSignal raise |
|
7606 |
||
7607 |
"Created: / 12.11.1998 / 19:20:00 / cg" |
|
7608 |
! |
|
7609 |
||
7610 |
_WDrawingSurfaceInfo_unlock:nativeContext |
|
7611 |
"/ void unlock () |
|
7612 |
UnimplementedNativeMethodSignal raise |
|
7613 |
||
7614 |
"Created: / 12.11.1998 / 19:20:13 / cg" |
|
7615 |
! |
|
7616 |
||
7617 |
_WEmbeddedFramePeer_create:nativeContext |
|
7618 |
"/ void create (sun.awt.windows.WComponentPeer) |
|
7619 |
UnimplementedNativeMethodSignal raise |
|
7620 |
||
7621 |
"Created: / 12.11.1998 / 19:16:09 / cg" |
|
7622 |
! |
|
7623 |
||
284 | 7624 |
_WFileDialogPeer_show:nativeContext |
7625 |
|jDialogPeer jDialog dialogView stDialog |
|
7626 |
title dir pattern f| |
|
7627 |
||
7628 |
jDialogPeer := nativeContext receiver. |
|
7629 |
jDialog := jDialogPeer instVarNamed:'target'. |
|
7630 |
dialogView := jDialogPeer instVarNamed:'pData'. |
|
7631 |
||
7632 |
stDialog := FileSelectionBox new. |
|
7633 |
||
7634 |
dir := jDialog instVarNamed:'dir'. |
|
7635 |
dir notNil ifTrue:[ |
|
7636 |
stDialog directory:(Java as_ST_String:dir). |
|
7637 |
]. |
|
7638 |
pattern := jDialog instVarNamed:'file'. |
|
7639 |
pattern notNil ifTrue:[ |
|
7640 |
stDialog pattern:(Java as_ST_String:pattern). |
|
7641 |
]. |
|
7642 |
title := jDialog instVarNamed:'title'. |
|
7643 |
title notNil ifTrue:[ |
|
7644 |
stDialog title:(Java as_ST_String:title). |
|
7645 |
stDialog label:(Java as_ST_String:title). |
|
7646 |
]. |
|
7647 |
||
7648 |
stDialog show. |
|
7649 |
||
7650 |
stDialog accepted ifTrue:[ |
|
7651 |
f := stDialog pathName. |
|
7652 |
||
7653 |
"/ cannot use the one below - it has a builtIn fileSeparator if '\' (sigh) |
|
7654 |
"/ jDialogPeer perform:#'handleSelected(Ljava/lang/String;)V' with:(Java as_String:f). |
|
7655 |
||
7656 |
jDialog |
|
7657 |
perform:#'setFile(Ljava/lang/String;)V' |
|
7658 |
with:(Java as_String:(f asFilename baseName)). |
|
7659 |
jDialog |
|
7660 |
perform:#'setDirectory(Ljava/lang/String;)V' |
|
7661 |
with:(Java as_String:(f asFilename directoryName , Filename separator asString)). |
|
7662 |
jDialog |
|
7663 |
perform:#'setVisible(Z)V' |
|
7664 |
with:0. |
|
7665 |
] ifFalse:[ |
|
7666 |
jDialogPeer |
|
7667 |
perform:#'handleCancel()V' |
|
7668 |
]. |
|
7669 |
"/ self halt. |
|
7670 |
||
7671 |
"Created: / 7.1.1998 / 22:38:45 / cg" |
|
7672 |
"Modified: / 15.1.1998 / 13:04:05 / cg" |
|
7673 |
! |
|
7674 |
||
440 | 7675 |
_WFontMetrics_bytesWidth:nativeContext |
7676 |
"/ int bytesWidth (byte[] int int) |
|
7677 |
UnimplementedNativeMethodSignal raise |
|
7678 |
||
7679 |
"Created: / 12.11.1998 / 19:11:46 / cg" |
|
7680 |
! |
|
7681 |
||
284 | 7682 |
_WFontMetrics_getMFCharSegmentWidth:nativeContext |
7683 |
"get multi-font string-segment width. |
|
7684 |
Not yet supported - use standard strings width" |
|
7685 |
||
7686 |
|jMetrics jFont jFontDescr stFont w |
|
7687 |
bool1 cp offs lenght bp int1| |
|
7688 |
||
7689 |
jMetrics := nativeContext receiver. |
|
7690 |
jFont := nativeContext argAt:1. |
|
7691 |
jFontDescr := nativeContext argAt:2. |
|
7692 |
bool1 := nativeContext argAt:3. |
|
7693 |
cp := nativeContext argAt:4. |
|
7694 |
offs := nativeContext argAt:5. |
|
7695 |
lenght := nativeContext argAt:6. |
|
7696 |
bp := nativeContext argAt:7. |
|
7697 |
int1 := nativeContext argAt:8. |
|
7698 |
||
7699 |
stFont := jFont instVarNamed:'pData'. |
|
7700 |
(stFont isNil or:[stFont == 0]) ifTrue:[ |
|
7701 |
self halt |
|
7702 |
]. |
|
7703 |
||
7704 |
stFont device isNil ifTrue:[ |
|
7705 |
stFont := stFont on:Display. |
|
7706 |
jFont instVarNamed:'pData' put:stFont. |
|
7707 |
]. |
|
7708 |
w := stFont widthOf:cp from:offs+1 to:offs+lenght. |
|
7709 |
^ w. |
|
7710 |
||
7711 |
"Created: / 5.1.1998 / 01:57:45 / cg" |
|
7712 |
"Modified: / 13.1.1998 / 23:44:03 / cg" |
|
7713 |
! |
|
7714 |
||
7715 |
_WFontMetrics_init:nativeContext |
|
7716 |
|jMetrics jFont stFont widths family name style size| |
|
7717 |
||
7718 |
jMetrics := nativeContext receiver. |
|
7719 |
jFont := jMetrics instVarNamed:'font'. |
|
7720 |
||
7721 |
family := jFont instVarNamed:'family'. |
|
7722 |
family := Java as_ST_String:family. |
|
7723 |
||
7724 |
name := jFont instVarNamed:'name'. |
|
7725 |
name := Java as_ST_String:name. |
|
7726 |
||
7727 |
style := jFont instVarNamed:'style'. |
|
7728 |
size := jFont instVarNamed:'size'. |
|
7729 |
||
7730 |
stFont := Font family:family size:size. |
|
7731 |
stFont isNil ifTrue:[ |
|
7732 |
stFont := Font family:'helvetica' size:size. |
|
7733 |
]. |
|
7734 |
stFont := stFont on:Display. |
|
7735 |
||
7736 |
"/ stFont := jFont instVarNamed:'pData'. |
|
7737 |
"/ stFont isNil ifTrue:[ |
|
7738 |
"/ self halt |
|
7739 |
"/ ]. |
|
7740 |
||
7741 |
stFont := stFont on:Display. |
|
7742 |
jFont instVarNamed:'pData' put:stFont. |
|
7743 |
||
7744 |
jMetrics instVarNamed:'ascent' put:stFont ascent. |
|
7745 |
jMetrics instVarNamed:'descent' put:stFont descent. |
|
7746 |
jMetrics instVarNamed:'leading' put:0. |
|
7747 |
jMetrics instVarNamed:'height' put:stFont height. |
|
7748 |
jMetrics instVarNamed:'maxAscent' put:stFont maxAscent. |
|
7749 |
jMetrics instVarNamed:'maxDescent' put:stFont maxDescent. |
|
7750 |
jMetrics instVarNamed:'maxHeight' put:stFont maxHeight. |
|
7751 |
jMetrics instVarNamed:'maxAdvance' put:stFont maxWidth. |
|
7752 |
||
7753 |
widths := Array new:256. |
|
7754 |
0 to:255 do:[:i | |
|
7755 |
widths at:(i+1) put:(stFont widthOf:(Character value:i)) |
|
7756 |
]. |
|
7757 |
jMetrics instVarNamed:'widths' put:widths. |
|
7758 |
"/ self halt. |
|
7759 |
||
7760 |
"Modified: / 8.8.1997 / 12:06:53 / cg" |
|
7761 |
"Created: / 5.1.1998 / 01:54:29 / cg" |
|
7762 |
! |
|
7763 |
||
7764 |
_WFontMetrics_needsConversion:nativeContext |
|
7765 |
|jFont jFontDescr stFont| |
|
7766 |
||
7767 |
jFont := nativeContext argAt:1. |
|
7768 |
jFontDescr := nativeContext argAt:2. |
|
7769 |
||
7770 |
stFont := jFont instVarNamed:'pData'. |
|
7771 |
"/ stFont isNil ifTrue:[ |
|
7772 |
"/ self halt |
|
7773 |
"/ ]. |
|
7774 |
"/ stFont device isNil ifTrue:[ |
|
7775 |
"/ stFont := stFont on:Display. |
|
7776 |
"/ jFont instVarNamed:'pData' put:stFont. |
|
7777 |
"/ ]. |
|
7778 |
"/ |
|
7779 |
||
7780 |
^ 0 |
|
7781 |
||
7782 |
"Modified: / 17.8.1997 / 17:16:29 / cg" |
|
7783 |
"Created: / 5.1.1998 / 01:56:42 / cg" |
|
7784 |
! |
|
7785 |
||
341 | 7786 |
_WFramePeer__setIconImage:nativeContext |
7787 |
|frame imgRep image| |
|
7788 |
||
7789 |
frame := self viewForWPeer:nativeContext. |
|
7790 |
imgRep := nativeContext argAt:1. |
|
7791 |
imgRep notNil ifTrue:[ |
|
7792 |
image := imgRep instVarNamed:'pData'. |
|
7793 |
image notNil ifTrue:[ |
|
7794 |
frame icon:image. |
|
7795 |
] |
|
7796 |
]. |
|
7797 |
||
7798 |
"Created: / 27.4.1998 / 17:15:09 / cg" |
|
7799 |
"Modified: / 27.4.1998 / 17:18:24 / cg" |
|
7800 |
! |
|
7801 |
||
284 | 7802 |
_WFramePeer_create:nativeContext |
7803 |
|jFramePeer jFrame frame pDataIdx| |
|
7804 |
||
7805 |
jFramePeer := nativeContext receiver. |
|
7806 |
||
7807 |
"/ for now: a kludge to create an embedded frame for |
|
7808 |
"/ mozillaFrames |
|
7809 |
||
7810 |
jFrame := jFramePeer instVarNamed:'target'. |
|
7811 |
(jFrame notNil |
|
7812 |
and:[(pDataIdx := jFrame class instVarOffsetOf:'pData') notNil]) |
|
7813 |
ifTrue:[ |
|
7814 |
((frame := jFrame instVarAt:pDataIdx) notNil |
|
7815 |
and:[frame ~~ 0]) ifTrue:[ |
|
318 | 7816 |
WindowCreationTrace == true ifTrue:[ |
7817 |
'JAVA: targetFrame view already created: ' infoPrintCR. |
|
7818 |
]. |
|
284 | 7819 |
"/ sigh; pData was renamed to pNativeWidget in jdk1.2 ... |
7820 |
pDataIdx := jFramePeer class instVarOffsetOf:'pNativeWidget'. |
|
7821 |
pDataIdx isNil ifTrue:[ |
|
7822 |
"/ ok, we are < 1.2 |
|
7823 |
pDataIdx := jFramePeer class instVarOffsetOf:'pData'. |
|
7824 |
]. |
|
7825 |
jFramePeer instVarAt:pDataIdx put:frame. |
|
7826 |
] |
|
7827 |
] ifFalse:[ |
|
7828 |
frame := jFramePeer instVarNamed:'pData' |
|
7829 |
]. |
|
7830 |
||
7831 |
(frame notNil and:[frame ~~ 0]) ifTrue:[ |
|
318 | 7832 |
WindowCreationTrace == true ifTrue:[ |
7833 |
'JAVA: frame view already created: ' infoPrint. |
|
7834 |
jFramePeer class name infoPrintCR. |
|
7835 |
]. |
|
284 | 7836 |
] ifFalse:[ |
7837 |
frame := StandardSystemView new. |
|
7838 |
self createdWindowsView:frame for:jFramePeer. |
|
7839 |
JavaWindowGroup addTopView:frame. |
|
7840 |
]. |
|
7841 |
||
7842 |
WindowCreationTrace == true ifTrue:[ |
|
7843 |
'JAVA: WFramePeer_create: ' print. jFramePeer displayString print. |
|
7844 |
' frame: ' print. frame printNL. |
|
7845 |
]. |
|
7846 |
||
7847 |
"Created: / 4.1.1998 / 17:56:39 / cg" |
|
318 | 7848 |
"Modified: / 6.2.1998 / 02:29:00 / cg" |
284 | 7849 |
! |
7850 |
||
7851 |
_WFramePeer_setMenuBar0:nativeContext |
|
7852 |
|frame jMenuBarPeer menuPanel| |
|
7853 |
||
7854 |
frame := self viewForWPeer:nativeContext. |
|
7855 |
||
7856 |
jMenuBarPeer := nativeContext argAt:1. |
|
7857 |
jMenuBarPeer isNil ifTrue:[ |
|
7858 |
"/ mhmh - JAVA wants to remove the frames menuPanel. |
|
7859 |
"/ but I have no handle on it (for destroy). |
|
7860 |
"/ search it in subViews of the frame. |
|
7861 |
frame subViews copy do:[:v | |
|
7862 |
(v isKindOf:MenuPanel) ifTrue:[ |
|
7863 |
v destroy |
|
7864 |
] |
|
7865 |
] |
|
7866 |
] ifFalse:[ |
|
7867 |
menuPanel := jMenuBarPeer instVarNamed:'pData'. |
|
7868 |
||
7869 |
menuPanel origin:0.0@0.0 corner:1.0@(menuPanel preferredExtent y). |
|
7870 |
frame addSubView:menuPanel. |
|
7871 |
]. |
|
7872 |
^ nil |
|
7873 |
||
7874 |
"Created: / 7.1.1998 / 21:41:35 / cg" |
|
7875 |
"Modified: / 8.1.1998 / 17:35:04 / cg" |
|
7876 |
! |
|
7877 |
||
440 | 7878 |
_WGraphics__dispose:nativeContext |
7879 |
"/ void _dispose() |
|
7880 |
UnimplementedNativeMethodSignal raise |
|
7881 |
||
7882 |
"Created: / 12.11.1998 / 19:17:51 / cg" |
|
7883 |
! |
|
7884 |
||
284 | 7885 |
_WGraphics_changeClip:nativeContext |
391 | 7886 |
|gc x y w h r bool| |
284 | 7887 |
|
7888 |
gc := self gcForWGraphics:nativeContext. |
|
7889 |
||
7890 |
x := nativeContext argAt:1. |
|
7891 |
y := nativeContext argAt:2. |
|
7892 |
w := nativeContext argAt:3. |
|
7893 |
h := nativeContext argAt:4. |
|
7894 |
bool := (nativeContext argAt:5) ~~ 0. |
|
7895 |
||
391 | 7896 |
r := Rectangle left:x top:y width:w height:h. |
401 | 7897 |
"/ 'WGraphics_changeClip: ' infoPrint. r infoPrintCR. |
391 | 7898 |
gc clippingRectangle:r. |
284 | 7899 |
|
7900 |
"Created: / 6.1.1998 / 20:57:21 / cg" |
|
401 | 7901 |
"Modified: / 20.10.1998 / 19:40:10 / cg" |
284 | 7902 |
! |
7903 |
||
7904 |
_WGraphics_clearRect:nativeContext |
|
7905 |
|gc x y w h| |
|
7906 |
||
7907 |
gc := self gcForWGraphics:nativeContext. |
|
7908 |
"/ gc isNil ifTrue:[^ self]. |
|
7909 |
||
7910 |
gc realized ifFalse:[ |
|
7911 |
'JAVA: drawing on unrealized gc - ignored' infoPrintCR. |
|
7912 |
^ self |
|
7913 |
]. |
|
7914 |
||
7915 |
x := nativeContext argAt:1. |
|
7916 |
y := nativeContext argAt:2. |
|
7917 |
w := nativeContext argAt:3. |
|
7918 |
h := nativeContext argAt:4. |
|
7919 |
||
7920 |
"/ self halt. |
|
7921 |
"/ self internalError:'breakPoint'. |
|
7922 |
||
7923 |
gc clearRectangleX:x y:y width:w height:h. |
|
7924 |
||
7925 |
"Created: / 8.1.1998 / 00:16:00 / cg" |
|
7926 |
"Modified: / 8.1.1998 / 00:21:09 / cg" |
|
7927 |
! |
|
7928 |
||
440 | 7929 |
_WGraphics_close:nativeContext |
7930 |
"/ void close (sun.awt.windows.WPrintJob) |
|
7931 |
UnimplementedNativeMethodSignal raise |
|
7932 |
||
7933 |
"Created: / 12.11.1998 / 19:19:40 / cg" |
|
7934 |
! |
|
7935 |
||
337 | 7936 |
_WGraphics_copyArea:nativeContext |
7937 |
|gc srcX srcY w h deltaX deltaY| |
|
7938 |
||
7939 |
gc := self gcForWGraphics:nativeContext. |
|
7940 |
"/ gc isNil ifTrue:[^ self]. |
|
7941 |
||
7942 |
gc realized ifFalse:[ |
|
7943 |
'JAVA: copyArea on unrealized gc - ignored' infoPrintCR. |
|
7944 |
^ self |
|
7945 |
]. |
|
7946 |
||
7947 |
srcX := nativeContext argAt:1. |
|
7948 |
srcY := nativeContext argAt:2. |
|
7949 |
w := nativeContext argAt:3. |
|
7950 |
h := nativeContext argAt:4. |
|
7951 |
deltaX := nativeContext argAt:5. |
|
7952 |
deltaY := nativeContext argAt:6. |
|
7953 |
||
7954 |
gc |
|
7955 |
copyFrom:gc |
|
7956 |
x:srcX y:srcY |
|
7957 |
toX:srcX+deltaX y:srcY+deltaY |
|
7958 |
width:w height:h |
|
7959 |
||
7960 |
"Created: / 8.1.1998 / 00:16:00 / cg" |
|
7961 |
"Modified: / 9.4.1998 / 22:01:32 / cg" |
|
7962 |
! |
|
7963 |
||
284 | 7964 |
_WGraphics_createFromComponent:nativeContext |
7965 |
|jGraphics jWin view| |
|
7966 |
||
7967 |
jGraphics := nativeContext receiver. |
|
7968 |
jWin := nativeContext argAt:1. |
|
7969 |
||
7970 |
view := KnownWindows at:jWin ifAbsent:nil. |
|
7971 |
view isNil ifTrue:[ |
|
401 | 7972 |
self halt. |
7973 |
^ self |
|
7974 |
]. |
|
7975 |
view clippingRectangle:nil. |
|
284 | 7976 |
|
7977 |
"/ "/ just a consistency check ... |
|
7978 |
"/ (jWin instVarNamed:'xid') ~~ view ifTrue:[ |
|
7979 |
"/ self halt:'consistency check' |
|
7980 |
"/ ]. |
|
7981 |
||
7982 |
jGraphics instVarNamed:'pData' put:view. |
|
7983 |
||
7984 |
"Created: / 6.1.1998 / 20:55:18 / cg" |
|
401 | 7985 |
"Modified: / 20.10.1998 / 19:38:18 / cg" |
284 | 7986 |
! |
7987 |
||
7988 |
_WGraphics_createFromGraphics:nativeContext |
|
7989 |
|jGraphics graphics gc| |
|
7990 |
||
7991 |
jGraphics := nativeContext receiver. |
|
7992 |
graphics := nativeContext argAt:1. |
|
7993 |
gc := graphics instVarNamed:'pData'. |
|
7994 |
||
7995 |
jGraphics instVarNamed:'pData' put:gc. |
|
401 | 7996 |
gc clippingRectangle:nil. |
284 | 7997 |
|
7998 |
"Created: / 8.1.1998 / 00:47:39 / cg" |
|
401 | 7999 |
"Modified: / 20.10.1998 / 19:37:58 / cg" |
284 | 8000 |
! |
8001 |
||
440 | 8002 |
_WGraphics_createFromHDC:nativeContext |
8003 |
"/ void createFromHDC (int) |
|
8004 |
UnimplementedNativeMethodSignal raise |
|
8005 |
||
8006 |
"Created: / 12.11.1998 / 19:17:32 / cg" |
|
8007 |
! |
|
8008 |
||
8009 |
_WGraphics_createFromPrintJob:nativeContext |
|
8010 |
"/ void createFromPrintJob (sun.awt.windows.WPrintJob) |
|
8011 |
UnimplementedNativeMethodSignal raise |
|
8012 |
||
8013 |
"Created: / 12.11.1998 / 19:17:20 / cg" |
|
8014 |
! |
|
8015 |
||
284 | 8016 |
_WGraphics_dispose:nativeContext |
8017 |
|gc| |
|
8018 |
||
8019 |
gc := self gcForWGraphics:nativeContext. |
|
8020 |
gc isNil ifTrue:[^ self]. |
|
401 | 8021 |
gc clippingRectangle:nil. |
284 | 8022 |
|
8023 |
"Created: / 6.1.1998 / 20:58:38 / cg" |
|
401 | 8024 |
"Modified: / 20.10.1998 / 19:35:05 / cg" |
284 | 8025 |
! |
8026 |
||
8027 |
_WGraphics_drawArc:nativeContext |
|
8028 |
|gc x y w h startAngle endAngle| |
|
8029 |
||
8030 |
gc := self gcForWGraphics:nativeContext. |
|
8031 |
"/ gc isNil ifTrue:[^ self]. |
|
8032 |
gc realized ifFalse:[^ self]. |
|
8033 |
||
8034 |
x := nativeContext argAt:1. |
|
8035 |
y := nativeContext argAt:2. |
|
8036 |
w := nativeContext argAt:3. |
|
8037 |
h := nativeContext argAt:4. |
|
8038 |
startAngle := nativeContext argAt:5. |
|
8039 |
endAngle := nativeContext argAt:6. |
|
8040 |
||
8041 |
DrawOPTrace ifTrue:[ |
|
285 | 8042 |
'drawArc x/y= ' print. x print. '@' print. y print. |
8043 |
' w/h= ' print. w print. '@' print. h print. |
|
8044 |
' startAngle= ' print. startAngle print. ' endAngle= ' print. endAngle printCR. |
|
8045 |
]. |
|
8046 |
gc |
|
8047 |
displayArcX:x y:y |
|
8048 |
width:w height:h |
|
8049 |
from:startAngle angle:(endAngle - startAngle). |
|
284 | 8050 |
|
8051 |
"Created: / 6.1.1998 / 21:00:15 / cg" |
|
285 | 8052 |
"Modified: / 28.1.1998 / 23:23:42 / cg" |
284 | 8053 |
! |
8054 |
||
440 | 8055 |
_WGraphics_drawBytes:nativeContext |
8056 |
"/ void drawBytes (byte[] int int int int) |
|
8057 |
UnimplementedNativeMethodSignal raise |
|
8058 |
||
8059 |
"Created: / 12.11.1998 / 19:18:56 / cg" |
|
8060 |
! |
|
8061 |
||
284 | 8062 |
_WGraphics_drawLine:nativeContext |
8063 |
|gc x y x2 y2| |
|
8064 |
||
8065 |
gc := self gcForWGraphics:nativeContext. |
|
8066 |
"/ gc isNil ifTrue:[^ self]. |
|
8067 |
gc realized ifFalse:[^ self]. |
|
8068 |
||
8069 |
x := nativeContext argAt:1. |
|
8070 |
y := nativeContext argAt:2. |
|
8071 |
x2 := nativeContext argAt:3. |
|
8072 |
y2 := nativeContext argAt:4. |
|
8073 |
||
8074 |
DrawOPTrace ifTrue:[ |
|
8075 |
'drawLine x/y= ' print. x print. '@' print. y print. ' x2/y2= ' print. x2 print. '@' print. y2 printCR. |
|
8076 |
]. |
|
8077 |
gc displayLineFromX:x y:y toX:x2 y:y2 |
|
8078 |
||
8079 |
"Created: / 6.1.1998 / 20:59:27 / cg" |
|
8080 |
"Modified: / 8.1.1998 / 00:34:23 / cg" |
|
8081 |
! |
|
8082 |
||
440 | 8083 |
_WGraphics_drawMFCharsConvertedSegment:nativeContext |
8084 |
"/ int drawMFCharsConvertedSegment (java.awt.Font sun.awt.FontDescriptor byte[] int int int) |
|
8085 |
UnimplementedNativeMethodSignal raise |
|
8086 |
||
8087 |
"Created: / 12.11.1998 / 19:18:44 / cg" |
|
8088 |
! |
|
8089 |
||
284 | 8090 |
_WGraphics_drawMFCharsSegment:nativeContext |
8091 |
|jFont jFontDescr s gc x y offs len| |
|
8092 |
||
8093 |
gc := self gcForWGraphics:nativeContext. |
|
8094 |
gc realized ifFalse:[^ self]. |
|
8095 |
||
8096 |
jFont := nativeContext argAt:1. |
|
8097 |
jFontDescr := nativeContext argAt:2. |
|
8098 |
s := nativeContext argAt:3. |
|
8099 |
offs := nativeContext argAt:4. |
|
8100 |
len := nativeContext argAt:5. |
|
8101 |
x := nativeContext argAt:6. |
|
8102 |
y := nativeContext argAt:7. |
|
8103 |
||
8104 |
DrawOPTrace ifTrue:[ |
|
8105 |
'drawMFCharsSegment x/y= ' print. x print. '@' print. y print. ' s= ' print. s printCR. |
|
8106 |
]. |
|
8107 |
gc displayString:s from:offs+1 to:offs+len x:x y:y. |
|
8108 |
^ (gc font onDevice:(gc graphicsDevice)) widthOf:s. |
|
8109 |
||
8110 |
"Created: / 6.1.1998 / 21:01:07 / cg" |
|
8111 |
"Modified: / 25.1.1998 / 20:45:55 / cg" |
|
8112 |
! |
|
8113 |
||
8114 |
_WGraphics_drawOval:nativeContext |
|
8115 |
|gc x y w h| |
|
8116 |
||
8117 |
gc := self gcForWGraphics:nativeContext. |
|
8118 |
"/ gc isNil ifTrue:[^ self]. |
|
8119 |
gc realized ifFalse:[^ self]. |
|
8120 |
||
8121 |
x := nativeContext argAt:1. |
|
8122 |
y := nativeContext argAt:2. |
|
8123 |
w := nativeContext argAt:3. |
|
8124 |
h := nativeContext argAt:4. |
|
8125 |
||
337 | 8126 |
DrawOPTrace ifTrue:[ |
285 | 8127 |
'drawOval x/y= ' print. x print. '@' print. y print. |
8128 |
' w/h= ' print. w print. '@' print. h printCR. |
|
8129 |
]. |
|
8130 |
gc displayArcX:x y:y width:w height:h from:0 angle:360. |
|
284 | 8131 |
|
8132 |
"Created: / 8.1.1998 / 00:44:31 / cg" |
|
337 | 8133 |
"Modified: / 9.4.1998 / 22:10:23 / cg" |
284 | 8134 |
! |
8135 |
||
8136 |
_WGraphics_drawPolygon:nativeContext |
|
8137 |
|gc xVector yVector count points| |
|
8138 |
||
8139 |
gc := self gcForWGraphics:nativeContext. |
|
8140 |
"/ gc isNil ifTrue:[^ self]. |
|
8141 |
gc realized ifFalse:[^ self]. |
|
8142 |
||
8143 |
xVector := nativeContext argAt:1. |
|
8144 |
yVector := nativeContext argAt:2. |
|
8145 |
count := nativeContext argAt:3. |
|
8146 |
||
8147 |
DrawOPTrace ifTrue:[ |
|
8148 |
'drawPolgon' printCR. |
|
8149 |
]. |
|
8150 |
||
8151 |
points := (1 to:count) collect:[:i | (xVector at:i) @ (yVector at:i)]. |
|
8152 |
gc displayPolygon:points |
|
8153 |
||
8154 |
"Created: / 8.1.1998 / 00:57:28 / cg" |
|
8155 |
"Modified: / 8.1.1998 / 00:57:49 / cg" |
|
8156 |
! |
|
8157 |
||
440 | 8158 |
_WGraphics_drawPolyline:nativeContext |
8159 |
"/ void drawPolyline (int[] int[] int) |
|
8160 |
UnimplementedNativeMethodSignal raise |
|
8161 |
||
8162 |
"Created: / 12.11.1998 / 19:19:07 / cg" |
|
8163 |
! |
|
8164 |
||
284 | 8165 |
_WGraphics_drawRect:nativeContext |
8166 |
|gc x y w h| |
|
8167 |
||
8168 |
gc := self gcForWGraphics:nativeContext. |
|
8169 |
"/ gc isNil ifTrue:[^ self]. |
|
8170 |
gc realized ifFalse:[^ self]. |
|
8171 |
||
8172 |
x := nativeContext argAt:1. |
|
8173 |
y := nativeContext argAt:2. |
|
8174 |
w := nativeContext argAt:3. |
|
8175 |
h := nativeContext argAt:4. |
|
8176 |
||
8177 |
"/ self halt. |
|
8178 |
"/ self internalError:'breakPoint'. |
|
8179 |
||
8180 |
gc displayRectangleX:x y:y width:w height:h. |
|
8181 |
||
8182 |
"Modified: / 8.1.1998 / 00:34:33 / cg" |
|
8183 |
"Created: / 8.1.1998 / 00:59:05 / cg" |
|
8184 |
! |
|
8185 |
||
8186 |
_WGraphics_drawRoundRect:nativeContext |
|
8187 |
|gc x y w h| |
|
8188 |
||
8189 |
gc := self gcForWGraphics:nativeContext. |
|
8190 |
"/ gc isNil ifTrue:[^ self]. |
|
8191 |
gc realized ifFalse:[^ self]. |
|
8192 |
||
8193 |
x := nativeContext argAt:1. |
|
8194 |
y := nativeContext argAt:2. |
|
8195 |
w := nativeContext argAt:3. |
|
8196 |
h := nativeContext argAt:4. |
|
8197 |
||
8198 |
"/ self halt. |
|
8199 |
"/ self internalError:'breakPoint'. |
|
8200 |
||
8201 |
gc displayRectangleX:x y:y width:w height:h. |
|
8202 |
||
8203 |
"Modified: / 8.1.1998 / 00:34:33 / cg" |
|
8204 |
"Created: / 8.1.1998 / 00:59:26 / cg" |
|
8205 |
! |
|
8206 |
||
440 | 8207 |
_WGraphics_drawSFChars:nativeContext |
8208 |
"/ void drawSFChars (char[] int int int int) |
|
8209 |
UnimplementedNativeMethodSignal raise |
|
8210 |
||
8211 |
"Created: / 12.11.1998 / 19:18:20 / cg" |
|
8212 |
! |
|
8213 |
||
284 | 8214 |
_WGraphics_fillArc:nativeContext |
8215 |
|gc x y w h startAngle endAngle| |
|
8216 |
||
8217 |
gc := self gcForWGraphics:nativeContext. |
|
8218 |
"/ gc isNil ifTrue:[^ self]. |
|
8219 |
gc realized ifFalse:[^ self]. |
|
8220 |
||
8221 |
x := nativeContext argAt:1. |
|
8222 |
y := nativeContext argAt:2. |
|
8223 |
w := nativeContext argAt:3. |
|
8224 |
h := nativeContext argAt:4. |
|
8225 |
startAngle := nativeContext argAt:5. |
|
8226 |
endAngle := nativeContext argAt:6. |
|
8227 |
||
8228 |
DrawOPTrace ifTrue:[ |
|
8229 |
'fillArc x/y= ' print. x print. '@' print. y print. |
|
8230 |
' w/h= ' print. w print. '@' print. h print. |
|
8231 |
' startAngle= ' print. startAngle print. ' endAngle= ' print. endAngle printCR. |
|
8232 |
]. |
|
8233 |
gc fillArcX:x y:y width:w height:h from:startAngle angle:(endAngle - startAngle) |
|
8234 |
||
8235 |
"Created: / 6.1.1998 / 21:11:31 / cg" |
|
8236 |
"Modified: / 8.1.1998 / 00:33:59 / cg" |
|
8237 |
! |
|
8238 |
||
8239 |
_WGraphics_fillOval:nativeContext |
|
8240 |
|gc x y w h| |
|
8241 |
||
8242 |
gc := self gcForWGraphics:nativeContext. |
|
8243 |
"/ gc isNil ifTrue:[^ self]. |
|
8244 |
gc realized ifFalse:[^ self]. |
|
8245 |
||
8246 |
x := nativeContext argAt:1. |
|
8247 |
y := nativeContext argAt:2. |
|
8248 |
w := nativeContext argAt:3. |
|
8249 |
h := nativeContext argAt:4. |
|
8250 |
||
8251 |
DrawOPTrace ifTrue:[ |
|
8252 |
'drawOval x/y= ' print. x print. '@' print. y print. |
|
8253 |
' w/h= ' print. w print. '@' print. h printCR. |
|
8254 |
]. |
|
8255 |
gc fillArcX:x y:y width:w height:h from:0 angle:360 |
|
8256 |
||
8257 |
"Created: / 8.1.1998 / 00:46:00 / cg" |
|
8258 |
"Modified: / 8.1.1998 / 00:46:20 / cg" |
|
8259 |
! |
|
8260 |
||
8261 |
_WGraphics_fillPolygon:nativeContext |
|
8262 |
|gc xVector yVector count points| |
|
8263 |
||
8264 |
gc := self gcForWGraphics:nativeContext. |
|
8265 |
"/ gc isNil ifTrue:[^ self]. |
|
8266 |
gc realized ifFalse:[^ self]. |
|
8267 |
||
8268 |
xVector := nativeContext argAt:1. |
|
8269 |
yVector := nativeContext argAt:2. |
|
8270 |
count := nativeContext argAt:3. |
|
8271 |
||
8272 |
DrawOPTrace ifTrue:[ |
|
8273 |
'fillPolgon' printCR. |
|
8274 |
]. |
|
8275 |
||
8276 |
points := (1 to:count-1) collect:[:i | (xVector at:i) @ (yVector at:i)]. |
|
8277 |
gc fillPolygon:points |
|
8278 |
||
8279 |
"Created: / 8.1.1998 / 00:58:09 / cg" |
|
8280 |
"Modified: / 25.1.1998 / 11:03:19 / cg" |
|
8281 |
! |
|
8282 |
||
8283 |
_WGraphics_fillRect:nativeContext |
|
8284 |
|gc x y w h| |
|
8285 |
||
8286 |
gc := self gcForWGraphics:nativeContext. |
|
8287 |
"/ gc isNil ifTrue:[^ self]. |
|
8288 |
gc realized ifFalse:[^ self]. |
|
8289 |
||
8290 |
x := nativeContext argAt:1. |
|
8291 |
y := nativeContext argAt:2. |
|
8292 |
w := nativeContext argAt:3. |
|
8293 |
h := nativeContext argAt:4. |
|
8294 |
||
8295 |
"/ self halt. |
|
8296 |
"/ self internalError:'breakPoint'. |
|
8297 |
||
8298 |
gc fillRectangleX:x y:y width:w height:h. |
|
8299 |
||
8300 |
"Created: / 15.8.1997 / 15:43:10 / cg" |
|
8301 |
"Modified: / 8.1.1998 / 00:34:33 / cg" |
|
8302 |
! |
|
8303 |
||
8304 |
_WGraphics_fillRoundRect:nativeContext |
|
8305 |
|gc x y w h| |
|
8306 |
||
8307 |
gc := self gcForWGraphics:nativeContext. |
|
8308 |
"/ gc isNil ifTrue:[^ self]. |
|
8309 |
gc realized ifFalse:[^ self]. |
|
8310 |
||
8311 |
x := nativeContext argAt:1. |
|
8312 |
y := nativeContext argAt:2. |
|
8313 |
w := nativeContext argAt:3. |
|
8314 |
h := nativeContext argAt:4. |
|
8315 |
||
8316 |
"/ self halt. |
|
8317 |
"/ self internalError:'breakPoint'. |
|
8318 |
||
8319 |
gc displayRectangleX:x y:y width:w height:h. |
|
8320 |
||
8321 |
"Modified: / 8.1.1998 / 00:34:33 / cg" |
|
8322 |
"Created: / 8.1.1998 / 00:59:36 / cg" |
|
8323 |
! |
|
8324 |
||
8325 |
_WGraphics_getClipBounds:nativeContext |
|
8326 |
|gc rect r x y w h| |
|
8327 |
||
8328 |
gc := self gcForWGraphics:nativeContext. |
|
391 | 8329 |
"/ gc isNil ifTrue:[^ nil]. |
284 | 8330 |
|
8331 |
rect := (Java classForName:'java.awt.Rectangle') basicNew. |
|
8332 |
||
8333 |
(gc isMemberOf:JavaView) ifTrue:[ |
|
391 | 8334 |
"/ r := gc clippingRectangleOrNil. |
8335 |
r := gc getNextUpdateRectangle. |
|
401 | 8336 |
]. |
8337 |
r isNil ifTrue:[ |
|
8338 |
r := gc clippingRectangleOrNil. |
|
8339 |
]. |
|
8340 |
||
8341 |
r isNil ifTrue:[ |
|
391 | 8342 |
x := y := 0. |
8343 |
w := (gc width). |
|
8344 |
h := (gc height). |
|
401 | 8345 |
] ifFalse:[ |
8346 |
x := (r left). |
|
8347 |
y := (r top). |
|
8348 |
w := (r width). |
|
8349 |
h := (r height). |
|
284 | 8350 |
]. |
8351 |
rect instVarNamed:'x' put:x. |
|
8352 |
rect instVarNamed:'y' put:y. |
|
8353 |
rect instVarNamed:'width' put:w. |
|
8354 |
rect instVarNamed:'height' put:h. |
|
8355 |
||
401 | 8356 |
'WGraphics__getClipBounds ' infoPrint. (x@y extent:w@h) infoPrintCR. |
284 | 8357 |
"/ self halt. |
8358 |
||
8359 |
^ rect |
|
8360 |
||
8361 |
"Created: / 6.1.1998 / 20:58:07 / cg" |
|
401 | 8362 |
"Modified: / 20.10.1998 / 19:26:34 / cg" |
284 | 8363 |
! |
8364 |
||
8365 |
_WGraphics_imageCreate:nativeContext |
|
8366 |
|jGraphics imgRep| |
|
8367 |
||
8368 |
jGraphics := nativeContext receiver. |
|
8369 |
imgRep := nativeContext argAt:1. |
|
8370 |
||
8371 |
jGraphics instVarNamed:'pData' put:(imgRep instVarNamed:'pData'). |
|
8372 |
"/ self halt. |
|
8373 |
||
8374 |
"Created: / 11.1.1998 / 16:34:30 / cg" |
|
8375 |
"Modified: / 17.1.1998 / 12:37:18 / cg" |
|
8376 |
! |
|
8377 |
||
8378 |
_WGraphics_pSetFont:nativeContext |
|
8379 |
|gc jFont stFont| |
|
8380 |
||
8381 |
gc := self gcForWGraphics:nativeContext. |
|
8382 |
jFont := nativeContext argAt:1. |
|
8383 |
||
8384 |
stFont := jFont instVarNamed:'pData'. |
|
8385 |
(stFont isNil or:[stFont == 0]) ifTrue:[ |
|
8386 |
"/ self halt. |
|
8387 |
] ifFalse:[ |
|
8388 |
gc font:stFont |
|
8389 |
]. |
|
8390 |
||
8391 |
"Created: / 6.1.1998 / 20:56:47 / cg" |
|
8392 |
"Modified: / 15.1.1998 / 12:31:20 / cg" |
|
8393 |
! |
|
8394 |
||
8395 |
_WGraphics_pSetForeground:nativeContext |
|
8396 |
|gc rgb clr| |
|
8397 |
||
8398 |
gc := self gcForWGraphics:nativeContext. |
|
8399 |
||
8400 |
rgb := nativeContext argAt:1. |
|
8401 |
||
8402 |
clr := Color rgbValue:rgb. |
|
8403 |
gc paint:clr. |
|
8404 |
||
8405 |
"/ self halt. |
|
8406 |
"/ self internalError:'breakPoint'. |
|
8407 |
||
8408 |
"Created: / 6.1.1998 / 20:56:14 / cg" |
|
8409 |
"Modified: / 8.1.1998 / 00:34:51 / cg" |
|
8410 |
! |
|
8411 |
||
440 | 8412 |
_WGraphics_print:nativeContext |
8413 |
"/ void print (sun.awt.windows.WComponentPeer) |
|
8414 |
UnimplementedNativeMethodSignal raise |
|
8415 |
||
8416 |
"Created: / 12.11.1998 / 19:19:25 / cg" |
|
8417 |
! |
|
8418 |
||
8419 |
_WGraphics_removeClip:nativeContext |
|
8420 |
"/ void removeClip () |
|
8421 |
UnimplementedNativeMethodSignal raise |
|
8422 |
||
8423 |
"Created: / 12.11.1998 / 19:18:05 / cg" |
|
8424 |
! |
|
8425 |
||
284 | 8426 |
_WGraphics_setPaintMode:nativeContext |
8427 |
|gc| |
|
8428 |
||
8429 |
gc := self gcForWGraphics:nativeContext. |
|
8430 |
gc function:#copy. |
|
285 | 8431 |
|
8432 |
true "DrawOPTrace" ifTrue:[ |
|
8433 |
'copyMode' infoPrintCR. |
|
8434 |
]. |
|
284 | 8435 |
|
8436 |
"Created: / 8.1.1998 / 00:33:44 / cg" |
|
285 | 8437 |
"Modified: / 28.1.1998 / 23:25:56 / cg" |
284 | 8438 |
! |
8439 |
||
8440 |
_WGraphics_setXORMode:nativeContext |
|
8441 |
|gc jColor rgb invColor device| |
|
8442 |
||
8443 |
gc := self gcForWGraphics:nativeContext. |
|
8444 |
jColor := nativeContext argAt:1. |
|
8445 |
device := gc graphicsDevice. |
|
285 | 8446 |
|
8447 |
"/ "/ on trueColor systems, use the provided |
|
8448 |
"/ "/ rgb value for inverting. |
|
8449 |
"/ "/ on palette systems, use white ^ black |
|
8450 |
"/ |
|
8451 |
"/ device visualType == #TrueColor ifTrue:[ |
|
8452 |
"/ rgb := jColor instVarNamed:'value'. |
|
8453 |
"/ rgb := rgb bitAnd:16rFFFFFF. |
|
8454 |
"/ rgb == 0 ifTrue:[ |
|
8455 |
"/ rgb := 16rFFFFFF. |
|
8456 |
"/ ]. |
|
8457 |
"/ invColor := rgb |
|
8458 |
"/ ] ifFalse:[ |
|
8459 |
"/ invColor := device blackpixel bitXor:device whitepixel. |
|
8460 |
"/ ]. |
|
8461 |
||
8462 |
invColor := device blackpixel bitXor:device whitepixel. |
|
8463 |
||
8464 |
"/ gc foreground:(Color colorId:invColor) |
|
8465 |
"/ background:device blackColor. |
|
8466 |
device |
|
8467 |
setForeground:invColor background:0 |
|
8468 |
in:gc gcId. |
|
284 | 8469 |
gc function:#xor. |
285 | 8470 |
|
8471 |
true "DrawOPTrace" ifTrue:[ |
|
8472 |
'xorMode' infoPrintCR. |
|
8473 |
]. |
|
284 | 8474 |
|
8475 |
"Created: / 8.1.1998 / 00:36:17 / cg" |
|
285 | 8476 |
"Modified: / 28.1.1998 / 23:45:03 / cg" |
284 | 8477 |
! |
8478 |
||
8479 |
_WLabelPeer_create:nativeContext |
|
8480 |
|jLabelPeer jLabel jFrame frame label |
|
8481 |
lbl| |
|
8482 |
||
8483 |
jLabelPeer := nativeContext receiver. |
|
8484 |
jLabel := jLabelPeer instVarNamed:'target'. |
|
8485 |
||
8486 |
lbl := jLabel instVarNamed:'text'. |
|
8487 |
lbl notNil ifTrue:[ |
|
8488 |
lbl := Java as_ST_String:lbl |
|
8489 |
]. |
|
8490 |
||
8491 |
jFrame := nativeContext argAt:1. |
|
8492 |
frame := jFrame instVarNamed:'pData'. |
|
8493 |
||
8494 |
label := Label in:frame. |
|
8495 |
lbl notNil ifTrue:[ |
|
8496 |
label label:lbl |
|
8497 |
]. |
|
8498 |
self createdWindowsView:label for:jLabelPeer. |
|
8499 |
||
8500 |
WindowCreationTrace == true ifTrue:[ |
|
8501 |
'WLabelPeer_create: ' print. frame print. ' -> ' print. label printNL. |
|
8502 |
]. |
|
8503 |
||
8504 |
"Created: / 7.1.1998 / 21:42:31 / cg" |
|
8505 |
"Modified: / 13.1.1998 / 22:10:47 / cg" |
|
8506 |
! |
|
8507 |
||
8508 |
_WLabelPeer_setAlignment:nativeContext |
|
8509 |
|label alignNr| |
|
8510 |
||
8511 |
alignNr := nativeContext argAt:1. |
|
8512 |
label := self viewForWPeer:nativeContext. |
|
8513 |
label notNil ifTrue:[ |
|
8514 |
]. |
|
8515 |
||
8516 |
"Created: / 7.1.1998 / 21:43:12 / cg" |
|
8517 |
"Modified: / 8.1.1998 / 17:35:29 / cg" |
|
8518 |
! |
|
8519 |
||
8520 |
_WLabelPeer_setText:nativeContext |
|
8521 |
|label jString| |
|
8522 |
||
8523 |
jString := nativeContext argAt:1. |
|
8524 |
||
8525 |
label := self viewForWPeer:nativeContext. |
|
8526 |
label label:(Java as_ST_String:jString) |
|
8527 |
||
8528 |
"Created: / 7.1.1998 / 21:43:51 / cg" |
|
8529 |
"Modified: / 8.1.1998 / 17:35:50 / cg" |
|
8530 |
! |
|
8531 |
||
408 | 8532 |
_WListPeer__addItem:nativeContext |
448 | 8533 |
|jString index1 length selListView m| |
408 | 8534 |
|
8535 |
selListView := self viewForWPeer:nativeContext. |
|
8536 |
||
8537 |
jString := nativeContext argAt:1. |
|
8538 |
index1 := nativeContext argAt:2. |
|
8539 |
length := nativeContext argAt:3. |
|
8540 |
||
448 | 8541 |
(m := selListView model) notNil ifTrue:[ |
8542 |
m list addLast:(Java as_ST_String:jString). |
|
8543 |
m changed:#list. |
|
8544 |
]. |
|
408 | 8545 |
|
8546 |
"Created: / 26.10.1998 / 20:11:30 / cg" |
|
448 | 8547 |
"Modified: / 14.11.1998 / 01:21:03 / cg" |
408 | 8548 |
! |
8549 |
||
284 | 8550 |
_WListPeer_addItem:nativeContext |
410 | 8551 |
|jString index selListView m| |
284 | 8552 |
|
8553 |
selListView := self viewForWPeer:nativeContext. |
|
8554 |
||
8555 |
jString := nativeContext argAt:1. |
|
8556 |
index := nativeContext argAt:2. |
|
8557 |
||
410 | 8558 |
m := selListView model. |
8559 |
m isNil ifTrue:[ |
|
8560 |
Transcript showCR:'JAVA: access to listModel of closed view'. |
|
8561 |
] ifFalse:[ |
|
8562 |
m list addLast:(Java as_ST_String:jString). |
|
8563 |
m changed:#list. |
|
8564 |
] |
|
8565 |
||
284 | 8566 |
"Created: / 24.1.1998 / 21:10:05 / cg" |
410 | 8567 |
"Modified: / 2.11.1998 / 17:12:52 / cg" |
284 | 8568 |
! |
8569 |
||
8570 |
_WListPeer_create:nativeContext |
|
8571 |
|jListPeer jFrame frame selectionInListView| |
|
8572 |
||
8573 |
jListPeer := nativeContext receiver. |
|
8574 |
||
8575 |
jFrame := nativeContext argAt:1. |
|
8576 |
frame := jFrame instVarNamed:'pData'. |
|
8577 |
||
8578 |
selectionInListView := ScrollableView for:SelectionInListView in:frame. |
|
8579 |
selectionInListView action:[:index | jListPeer perform:#'handleListChanged(I)V' with:(index - 1)]. |
|
8580 |
selectionInListView doubleClickAction:[:index | jListPeer perform:#'handleAction(I)V' with:(index - 1)]. |
|
337 | 8581 |
selectionInListView model:(SelectionInList new list:(List new)). |
284 | 8582 |
selectionInListView useIndex:true. |
8583 |
||
8584 |
self createdWindowsView:selectionInListView for:jListPeer. |
|
8585 |
||
8586 |
WindowCreationTrace == true ifTrue:[ |
|
8587 |
'WTextAreaPeer_create: ' print. frame print. ' -> ' print. selectionInListView printNL. |
|
8588 |
]. |
|
8589 |
||
8590 |
"Created: / 24.1.1998 / 19:58:54 / cg" |
|
337 | 8591 |
"Modified: / 9.4.1998 / 22:19:07 / cg" |
8592 |
! |
|
8593 |
||
8594 |
_WListPeer_delItems:nativeContext |
|
8595 |
|jString index1 index2 selListView| |
|
8596 |
||
8597 |
selListView := self viewForWPeer:nativeContext. |
|
8598 |
||
8599 |
index1 := nativeContext argAt:1. |
|
8600 |
index2 := nativeContext argAt:2. |
|
8601 |
||
8602 |
selListView model list removeFromIndex:(index1+1) toIndex:(index2+1). |
|
8603 |
selListView model changed:#list. |
|
8604 |
||
8605 |
"Created: / 9.4.1998 / 22:19:25 / cg" |
|
8606 |
"Modified: / 9.4.1998 / 22:20:08 / cg" |
|
284 | 8607 |
! |
8608 |
||
440 | 8609 |
_WListPeer_deselect:nativeContext |
8610 |
"/ void deselect (int) |
|
8611 |
UnimplementedNativeMethodSignal raise |
|
8612 |
||
8613 |
"Created: / 12.11.1998 / 19:15:10 / cg" |
|
8614 |
! |
|
8615 |
||
448 | 8616 |
_WListPeer_getMaxWidth:nativeContext |
8617 |
"/ int getMaxWidth () |
|
8618 |
UnimplementedNativeMethodSignal raise |
|
8619 |
||
8620 |
"Created: / 14.11.1998 / 10:44:29 / cg" |
|
8621 |
! |
|
8622 |
||
284 | 8623 |
_WListPeer_isSelected:nativeContext |
8624 |
|selectionInListView index model| |
|
8625 |
||
8626 |
selectionInListView := self viewForWPeer:nativeContext. |
|
8627 |
||
8628 |
index := nativeContext argAt:1. |
|
8629 |
(model := selectionInListView model) notNil ifTrue:[ |
|
8630 |
(model selectionIndex == (index + 1)) "/ JAVA indexing starts at 0 |
|
8631 |
ifTrue:[ |
|
8632 |
^ 1 |
|
8633 |
] |
|
8634 |
]. |
|
8635 |
^ 0. |
|
8636 |
||
8637 |
"Created: / 24.1.1998 / 22:42:31 / cg" |
|
8638 |
"Modified: / 25.1.1998 / 01:35:32 / cg" |
|
8639 |
! |
|
8640 |
||
396 | 8641 |
_WListPeer_makeVisible:nativeContext |
8642 |
|selectionInListView lineNr| |
|
8643 |
||
8644 |
selectionInListView := self viewForWPeer:nativeContext. |
|
8645 |
||
8646 |
lineNr := nativeContext argAt:1. |
|
8647 |
||
8648 |
selectionInListView makeLineVisible:(lineNr + 1) |
|
8649 |
||
8650 |
"Modified: / 24.1.1998 / 20:01:06 / cg" |
|
8651 |
"Created: / 20.10.1998 / 14:14:50 / cg" |
|
8652 |
! |
|
8653 |
||
284 | 8654 |
_WListPeer_select:nativeContext |
8655 |
|selectionInListView index model| |
|
8656 |
||
8657 |
selectionInListView := self viewForWPeer:nativeContext. |
|
8658 |
||
8659 |
index := nativeContext argAt:1. |
|
8660 |
(model := selectionInListView model) notNil ifTrue:[ |
|
8661 |
model selectionIndex:(index + 1). "/ JAVA indexing starts at 0 |
|
8662 |
] |
|
8663 |
||
8664 |
"Created: / 24.1.1998 / 22:32:35 / cg" |
|
8665 |
"Modified: / 25.1.1998 / 01:28:46 / cg" |
|
8666 |
! |
|
8667 |
||
8668 |
_WListPeer_setMultipleSelections:nativeContext |
|
8669 |
|selectionInListView onOff| |
|
8670 |
||
8671 |
selectionInListView := self viewForWPeer:nativeContext. |
|
8672 |
||
8673 |
onOff := (nativeContext argAt:1) ~~ 0. |
|
8674 |
||
8675 |
selectionInListView multipleSelectOk:onOff. |
|
8676 |
||
8677 |
"Modified: / 24.1.1998 / 20:01:06 / cg" |
|
8678 |
! |
|
8679 |
||
408 | 8680 |
_WListPeer_updateMaxItemWidth:nativeContext |
8681 |
|selectionInListView lineNr| |
|
8682 |
||
8683 |
selectionInListView := self viewForWPeer:nativeContext. |
|
8684 |
||
8685 |
"Created: / 26.10.1998 / 20:09:46 / cg" |
|
8686 |
! |
|
8687 |
||
440 | 8688 |
_WMenuBarPeer_addMenu:nativeContext |
8689 |
"/ void addMenu (java.awt.Menu) |
|
8690 |
UnimplementedNativeMethodSignal raise |
|
8691 |
||
8692 |
"Created: / 12.11.1998 / 19:14:00 / cg" |
|
8693 |
! |
|
8694 |
||
284 | 8695 |
_WMenuBarPeer_create:nativeContext |
8696 |
|jMenuBarPeer jMenuBar jFrame frame menuBar| |
|
8697 |
||
8698 |
jMenuBarPeer := nativeContext receiver. |
|
8699 |
jMenuBar := jMenuBarPeer instVarNamed:'target'. |
|
8700 |
||
8701 |
jFrame := nativeContext argAt:1. |
|
8702 |
frame := jFrame instVarNamed:'pData'. |
|
8703 |
||
8704 |
menuBar := MenuPanel in:frame. |
|
8705 |
menuBar verticalLayout:false. |
|
8706 |
menuBar realize. |
|
8707 |
||
8708 |
self createdWindowsView:menuBar for:jMenuBarPeer. |
|
8709 |
||
8710 |
WindowCreationTrace == true ifTrue:[ |
|
8711 |
'WMenuBarPeer_create: ' print. frame print. ' -> ' print. menuBar printNL. |
|
8712 |
]. |
|
8713 |
||
8714 |
"Created: / 7.1.1998 / 21:38:31 / cg" |
|
8715 |
"Modified: / 25.1.1998 / 13:19:03 / cg" |
|
8716 |
! |
|
8717 |
||
440 | 8718 |
_WMenuBarPeer_delMenu:nativeContext |
8719 |
"/ void delMenu (int) |
|
8720 |
UnimplementedNativeMethodSignal raise |
|
8721 |
||
8722 |
"Created: / 12.11.1998 / 19:14:11 / cg" |
|
8723 |
! |
|
8724 |
||
325 | 8725 |
_WMenuItemPeer__dispose:nativeContext |
8726 |
|jMenuItemPeer item| |
|
8727 |
||
8728 |
jMenuItemPeer := nativeContext receiver. |
|
8729 |
item := jMenuItemPeer instVarNamed:'pData'. |
|
8730 |
||
8731 |
"/ what should be done here ? |
|
8732 |
||
8733 |
"Created: / 29.3.1998 / 17:16:05 / cg" |
|
8734 |
"Modified: / 29.3.1998 / 17:16:35 / cg" |
|
8735 |
! |
|
8736 |
||
440 | 8737 |
_WMenuItemPeer__setLabel:nativeContext |
8738 |
"/ void _setLabel (java.lang.String) |
|
8739 |
UnimplementedNativeMethodSignal raise |
|
8740 |
||
8741 |
"Created: / 12.11.1998 / 19:12:06 / cg" |
|
8742 |
! |
|
8743 |
||
284 | 8744 |
_WMenuItemPeer_create:nativeContext |
8745 |
|jMenuItemPeer jMenuItem jMenuPeer menu item lbl| |
|
8746 |
||
8747 |
jMenuItemPeer := nativeContext receiver. |
|
8748 |
jMenuItem := jMenuItemPeer instVarNamed:'target'. |
|
8749 |
||
8750 |
jMenuPeer := nativeContext argAt:1. |
|
8751 |
menu := jMenuPeer instVarNamed:'pData'. |
|
8752 |
||
8753 |
item := menu createAtIndex:nil. |
|
325 | 8754 |
item value:[ |
8755 |
jMenuItemPeer perform:#'handleAction(I)V' with:0 |
|
8756 |
]. |
|
284 | 8757 |
|
8758 |
lbl := jMenuItem instVarNamed:'label'. |
|
8759 |
lbl notNil ifTrue:[ |
|
325 | 8760 |
lbl := Java as_ST_String:lbl. |
8761 |
item label:lbl |
|
284 | 8762 |
]. |
8763 |
||
8764 |
jMenuItemPeer instVarNamed:'pData' put:item. |
|
8765 |
||
8766 |
WindowOPTrace == true ifTrue:[ |
|
325 | 8767 |
'WMenuItem_create: ' print. menu print. ' -> ' print. item printNL. |
284 | 8768 |
]. |
8769 |
||
8770 |
"Created: / 7.1.1998 / 21:40:44 / cg" |
|
325 | 8771 |
"Modified: / 29.3.1998 / 15:44:13 / cg" |
284 | 8772 |
! |
8773 |
||
8774 |
_WMenuItemPeer_enable:nativeContext |
|
8775 |
|jMenuItemPeer item state| |
|
8776 |
||
8777 |
jMenuItemPeer := nativeContext receiver. |
|
8778 |
item := jMenuItemPeer instVarNamed:'pData'. |
|
8779 |
||
8780 |
state := nativeContext argAt:1. |
|
8781 |
item enabled:(state == 0) not |
|
8782 |
||
8783 |
"Modified: / 4.8.1997 / 03:05:50 / cg" |
|
8784 |
"Created: / 7.1.1998 / 22:41:38 / cg" |
|
8785 |
! |
|
8786 |
||
440 | 8787 |
_WMenuPeer_addSeparator:nativeContext |
8788 |
"/ void addSeparator () |
|
8789 |
UnimplementedNativeMethodSignal raise |
|
8790 |
||
8791 |
"Created: / 12.11.1998 / 19:13:14 / cg" |
|
8792 |
! |
|
8793 |
||
284 | 8794 |
_WMenuPeer_createMenu:nativeContext |
8795 |
|jMenuPeer jMenu jMenuBarPeer menuPanel menu |
|
8796 |
lbl item| |
|
8797 |
||
8798 |
jMenuPeer := nativeContext receiver. |
|
8799 |
jMenu := jMenuPeer instVarNamed:'target'. |
|
8800 |
||
8801 |
jMenuBarPeer := nativeContext argAt:1. |
|
8802 |
menuPanel := jMenuBarPeer instVarNamed:'pData'. |
|
8803 |
||
8804 |
item := menuPanel createAtIndex:nil. |
|
8805 |
lbl := jMenu instVarNamed:'label'. |
|
8806 |
lbl notNil ifTrue:[ |
|
8807 |
lbl := Java as_ST_String:lbl. |
|
8808 |
item label:lbl |
|
8809 |
]. |
|
8810 |
||
8811 |
menu := MenuPanel new. |
|
8812 |
item submenu:menu. |
|
8813 |
||
8814 |
jMenuPeer instVarNamed:'pData' put:menu. |
|
8815 |
||
8816 |
'createMenuPeer: ' print. menuPanel print. ' -> ' print. menu printNL. |
|
8817 |
||
8818 |
"Created: / 7.1.1998 / 21:39:50 / cg" |
|
8819 |
"Modified: / 13.1.1998 / 22:11:09 / cg" |
|
8820 |
! |
|
8821 |
||
440 | 8822 |
_WMenuPeer_createSubMenu:nativeContext |
8823 |
"/ void createSubMenu (sun.awt.windows.WMenuPeer) |
|
8824 |
UnimplementedNativeMethodSignal raise |
|
8825 |
||
8826 |
"Created: / 12.11.1998 / 19:13:43 / cg" |
|
8827 |
! |
|
8828 |
||
8829 |
_WMenuPeer_delItem:nativeContext |
|
8830 |
"/ void delItem (int) |
|
8831 |
UnimplementedNativeMethodSignal raise |
|
8832 |
||
8833 |
"Created: / 12.11.1998 / 19:13:30 / cg" |
|
8834 |
! |
|
8835 |
||
8836 |
_WPopupMenuPeer__show:nativeContext |
|
8837 |
"/ void _show (java.awt.Event) |
|
8838 |
UnimplementedNativeMethodSignal raise |
|
8839 |
||
8840 |
"Created: / 12.11.1998 / 19:12:53 / cg" |
|
8841 |
! |
|
8842 |
||
8843 |
_WPopupMenuPeer_createMenu:nativeContext |
|
8844 |
"/ void createMenu (sun.awt.windows.WComponentPeer) |
|
8845 |
UnimplementedNativeMethodSignal raise |
|
8846 |
||
8847 |
"Created: / 12.11.1998 / 19:12:43 / cg" |
|
8848 |
! |
|
8849 |
||
8850 |
_WPrintJob_end:nativeContext |
|
8851 |
"/ void end () |
|
8852 |
UnimplementedNativeMethodSignal raise |
|
8853 |
||
8854 |
"Created: / 12.11.1998 / 19:11:28 / cg" |
|
8855 |
! |
|
8856 |
||
334 | 8857 |
_WScrollPanePeer__getHScrollbarHeight:nativeContext |
8858 |
|scrollPane| |
|
8859 |
||
8860 |
scrollPane := self viewForWPeer:nativeContext. |
|
339 | 8861 |
^ HorizontalScrollBar new preferredExtent y. |
8862 |
||
334 | 8863 |
"Created: / 9.4.1998 / 17:30:56 / cg" |
339 | 8864 |
"Modified: / 10.4.1998 / 14:59:28 / cg" |
341 | 8865 |
! |
334 | 8866 |
|
8867 |
_WScrollPanePeer__getVScrollbarWidth:nativeContext |
|
8868 |
|scrollPane| |
|
8869 |
||
8870 |
scrollPane := self viewForWPeer:nativeContext. |
|
339 | 8871 |
^ ScrollBar new preferredExtent x. |
334 | 8872 |
|
8873 |
"Created: / 9.4.1998 / 17:29:48 / cg" |
|
339 | 8874 |
"Modified: / 10.4.1998 / 15:00:33 / cg" |
334 | 8875 |
! |
8876 |
||
8877 |
_WScrollPanePeer_create:nativeContext |
|
8878 |
|jScrollPanePeer jScrollPane jFrame frame scrollPane |
|
8879 |
lbl| |
|
8880 |
||
8881 |
jScrollPanePeer := nativeContext receiver. |
|
8882 |
jScrollPane := jScrollPanePeer instVarNamed:'target'. |
|
8883 |
||
8884 |
jFrame := nativeContext argAt:1. |
|
8885 |
frame := jFrame instVarNamed:'pData'. |
|
8886 |
||
8887 |
"/ create with a simple view ... |
|
337 | 8888 |
scrollPane := ScrollableView for:JavaView in:frame. |
334 | 8889 |
|
8890 |
self createdWindowsView:scrollPane for:jScrollPanePeer. |
|
8891 |
||
8892 |
WindowCreationTrace == true ifTrue:[ |
|
8893 |
'WScrollPanePeer_create: ' print. frame print. ' -> ' print. scrollPane printNL. |
|
8894 |
]. |
|
8895 |
||
8896 |
"Created: / 9.4.1998 / 17:25:08 / cg" |
|
337 | 8897 |
"Modified: / 9.4.1998 / 22:06:09 / cg" |
334 | 8898 |
! |
8899 |
||
440 | 8900 |
_WScrollPanePeer_getOffset:nativeContext |
8901 |
"/ int getOffset (int) |
|
8902 |
UnimplementedNativeMethodSignal raise |
|
8903 |
||
8904 |
"Created: / 12.11.1998 / 19:16:29 / cg" |
|
8905 |
! |
|
8906 |
||
8907 |
_WScrollPanePeer_getScrollChild:nativeContext |
|
8908 |
"/ java.awt.Component getScrollChild () |
|
8909 |
UnimplementedNativeMethodSignal raise |
|
8910 |
||
8911 |
"Created: / 12.11.1998 / 19:17:00 / cg" |
|
8912 |
! |
|
8913 |
||
334 | 8914 |
_WScrollPanePeer_setInsets:nativeContext |
8915 |
||
8916 |
"Modified: / 9.4.1998 / 17:26:11 / cg" |
|
8917 |
"Created: / 9.4.1998 / 17:29:10 / cg" |
|
8918 |
! |
|
8919 |
||
440 | 8920 |
_WScrollPanePeer_setScrollPosition:nativeContext |
8921 |
"/ void setScrollPosition (int int) |
|
8922 |
UnimplementedNativeMethodSignal raise |
|
8923 |
||
8924 |
"Created: / 12.11.1998 / 19:16:44 / cg" |
|
8925 |
! |
|
8926 |
||
334 | 8927 |
_WScrollPanePeer_setSpans:nativeContext |
8928 |
||
8929 |
"Created: / 9.4.1998 / 17:31:44 / cg" |
|
8930 |
! |
|
8931 |
||
284 | 8932 |
_WScrollbarPeer__setValues:nativeContext |
8933 |
|scrollBar value visibleAmount min max| |
|
8934 |
||
8935 |
scrollBar := self viewForWPeer:nativeContext. |
|
8936 |
||
8937 |
value := nativeContext argAt:1. |
|
8938 |
visibleAmount := nativeContext argAt:2. |
|
8939 |
min := nativeContext argAt:3. |
|
8940 |
max := nativeContext argAt:4. |
|
8941 |
||
374 | 8942 |
(min ~~ 0 or:[max ~~ 100]) ifTrue:[ |
284 | 8943 |
scrollBar thumb start:min stop:max. |
8944 |
]. |
|
8945 |
||
8946 |
scrollBar thumbOrigin:value thumbHeight:visibleAmount. |
|
8947 |
||
8948 |
"Created: / 13.1.1998 / 22:13:57 / cg" |
|
374 | 8949 |
"Modified: / 14.10.1998 / 14:53:00 / cg" |
284 | 8950 |
! |
8951 |
||
8952 |
_WScrollbarPeer_create:nativeContext |
|
8953 |
|jScrollbarPeer jScrollbar jFrame frame scrollBar |
|
334 | 8954 |
min max| |
284 | 8955 |
|
8956 |
jScrollbarPeer := nativeContext receiver. |
|
8957 |
jScrollbar := jScrollbarPeer instVarNamed:'target'. |
|
8958 |
||
8959 |
jFrame := nativeContext argAt:1. |
|
8960 |
frame := jFrame instVarNamed:'pData'. |
|
8961 |
||
8962 |
(jScrollbar instVarNamed:'orientation') == 0 "HORIZONTAL" ifTrue:[ |
|
8963 |
scrollBar := HorizontalScrollBar in:frame. |
|
8964 |
] ifFalse:[ |
|
8965 |
scrollBar := ScrollBar in:frame. |
|
8966 |
]. |
|
8967 |
min := jScrollbar instVarNamed:'minimum'. |
|
8968 |
max := jScrollbar instVarNamed:'maximum'. |
|
8969 |
||
374 | 8970 |
scrollBar scrollDownAction:[ |
8971 |
scrollBar thumbOrigin:(scrollBar thumbOrigin + ((max-min)/10) min:max). |
|
8972 |
jScrollbarPeer perform:#'dragAbsolute(I)V' with:scrollBar thumbOrigin rounded. |
|
8973 |
]. |
|
8974 |
scrollBar scrollUpAction:[ |
|
8975 |
scrollBar thumbOrigin:(scrollBar thumbOrigin - ((max-min)/10) max:min). |
|
8976 |
jScrollbarPeer perform:#'dragAbsolute(I)V' with:scrollBar thumbOrigin rounded. |
|
8977 |
]. |
|
8978 |
scrollBar scrollAction:[:org | |
|
8979 |
jScrollbarPeer perform:#'dragAbsolute(I)V' with:org rounded. |
|
8980 |
]. |
|
284 | 8981 |
self createdWindowsView:scrollBar for:jScrollbarPeer. |
8982 |
||
8983 |
WindowCreationTrace == true ifTrue:[ |
|
8984 |
'WScrollbarPeer_create: ' print. frame print. ' -> ' print. scrollBar printNL. |
|
8985 |
]. |
|
8986 |
||
8987 |
"Created: / 5.1.1998 / 01:53:30 / cg" |
|
374 | 8988 |
"Modified: / 14.10.1998 / 15:36:19 / cg" |
284 | 8989 |
! |
8990 |
||
8991 |
_WScrollbarPeer_setLineIncrement:nativeContext |
|
8992 |
|scrollBar inc| |
|
8993 |
||
374 | 8994 |
Transcript showCR:'JavaVM: WScrollbarPeer_setLineIncrement unimplemented'. |
8995 |
||
284 | 8996 |
scrollBar := self viewForWPeer:nativeContext. |
8997 |
||
8998 |
inc := nativeContext argAt:1. |
|
8999 |
"/ scrollBar thumb lineIncrement:inc. |
|
9000 |
||
9001 |
"Created: / 25.1.1998 / 11:52:19 / cg" |
|
374 | 9002 |
"Modified: / 14.10.1998 / 14:53:56 / cg" |
284 | 9003 |
! |
9004 |
||
9005 |
_WScrollbarPeer_setPageIncrement:nativeContext |
|
9006 |
|scrollBar inc| |
|
9007 |
||
374 | 9008 |
Transcript showCR:'JavaVM: WScrollbarPeer_setPageIncrement unimplemented'. |
9009 |
||
284 | 9010 |
scrollBar := self viewForWPeer:nativeContext. |
9011 |
||
9012 |
inc := nativeContext argAt:1. |
|
9013 |
"/ scrollBar thumb pageIncrement:inc. |
|
9014 |
||
9015 |
"Created: / 25.1.1998 / 11:52:01 / cg" |
|
374 | 9016 |
"Modified: / 14.10.1998 / 14:54:04 / cg" |
284 | 9017 |
! |
9018 |
||
9019 |
_WTextAreaPeer_create:nativeContext |
|
9020 |
|jTextAreaPeer jFrame frame editTextView| |
|
9021 |
||
9022 |
jTextAreaPeer := nativeContext receiver. |
|
9023 |
||
9024 |
jFrame := nativeContext argAt:1. |
|
9025 |
frame := jFrame instVarNamed:'pData'. |
|
9026 |
||
9027 |
editTextView := HVScrollableView for:EditTextView in:frame. |
|
9028 |
||
9029 |
self createdWindowsView:editTextView for:jTextAreaPeer. |
|
9030 |
||
9031 |
WindowCreationTrace == true ifTrue:[ |
|
9032 |
'WTextAreaPeer_create: ' print. frame print. ' -> ' print. editTextView printNL. |
|
9033 |
]. |
|
9034 |
||
9035 |
"Created: / 7.1.1998 / 21:49:49 / cg" |
|
9036 |
"Modified: / 15.1.1998 / 12:56:18 / cg" |
|
9037 |
! |
|
9038 |
||
9039 |
_WTextAreaPeer_insertText:nativeContext |
|
9040 |
|textView pos string jstring| |
|
9041 |
||
9042 |
textView := self viewForWPeer:nativeContext. |
|
329 | 9043 |
(textView isKindOf:ScrollableView) ifTrue:[ |
9044 |
textView := textView scrolledView |
|
9045 |
]. |
|
284 | 9046 |
|
9047 |
jstring := nativeContext argAt:1. |
|
9048 |
string := Java as_ST_String:jstring. |
|
9049 |
pos := nativeContext argAt:2. |
|
9050 |
||
9051 |
textView insert:string at:pos. |
|
329 | 9052 |
textView cursorToCharacterPosition:pos + string size. |
9053 |
textView makeCursorVisible. |
|
9054 |
"/ textView invalidateRepairNow:true. |
|
284 | 9055 |
^ nil |
9056 |
||
9057 |
"Created: / 7.1.1998 / 21:50:23 / cg" |
|
329 | 9058 |
"Modified: / 5.4.1998 / 17:37:24 / cg" |
284 | 9059 |
! |
9060 |
||
440 | 9061 |
_WTextAreaPeer_replaceText:nativeContext |
9062 |
"/ void replaceText (java.lang.String int int) |
|
9063 |
UnimplementedNativeMethodSignal raise |
|
9064 |
||
9065 |
"Created: / 12.11.1998 / 19:11:14 / cg" |
|
9066 |
! |
|
9067 |
||
284 | 9068 |
_WTextComponentPeer_enableEditing:nativeContext |
9069 |
|textView enabled| |
|
9070 |
||
9071 |
textView := self viewForWPeer:nativeContext. |
|
9072 |
enabled := (nativeContext argAt:1) ~~ 0. |
|
9073 |
||
9074 |
^ textView readOnly:enabled not |
|
9075 |
||
9076 |
"Created: / 5.1.1998 / 01:29:38 / cg" |
|
9077 |
"Modified: / 25.1.1998 / 16:29:56 / cg" |
|
9078 |
! |
|
9079 |
||
9080 |
_WTextComponentPeer_getSelectionEnd:nativeContext |
|
9081 |
|textView| |
|
9082 |
||
9083 |
textView := self viewForWPeer:nativeContext. |
|
9084 |
||
9085 |
^ textView characterPositionOfSelectionEnd |
|
9086 |
||
9087 |
"Created: / 8.1.1998 / 17:41:56 / cg" |
|
9088 |
"Modified: / 15.1.1998 / 15:47:18 / cg" |
|
9089 |
! |
|
9090 |
||
9091 |
_WTextComponentPeer_getSelectionStart:nativeContext |
|
9092 |
|textView| |
|
9093 |
||
9094 |
textView := self viewForWPeer:nativeContext. |
|
9095 |
||
9096 |
^ textView characterPositionOfSelection - 1 |
|
9097 |
||
9098 |
"Created: / 15.8.1997 / 15:45:45 / cg" |
|
9099 |
"Modified: / 15.1.1998 / 15:46:51 / cg" |
|
9100 |
! |
|
9101 |
||
9102 |
_WTextComponentPeer_getText:nativeContext |
|
9103 |
|textView string jString| |
|
9104 |
||
9105 |
textView := self viewForWPeer:nativeContext. |
|
9106 |
||
9107 |
string := textView contents asString. |
|
9108 |
jString := Java as_String:string. |
|
9109 |
^ jString |
|
9110 |
||
9111 |
"Created: / 6.1.1998 / 21:05:15 / cg" |
|
9112 |
"Modified: / 8.1.1998 / 17:36:52 / cg" |
|
9113 |
! |
|
9114 |
||
9115 |
_WTextComponentPeer_select:nativeContext |
|
9116 |
|textView selStart selEnd| |
|
9117 |
||
9118 |
textView := self viewForWPeer:nativeContext. |
|
9119 |
selStart := nativeContext argAt:1. |
|
9120 |
selEnd := nativeContext argAt:2. |
|
9121 |
||
9122 |
selStart == selEnd ifTrue:[ |
|
9123 |
"/ clear selection |
|
9124 |
textView unselect. |
|
9125 |
"/ and set caret |
|
9126 |
textView cursorToCharacterPosition:selStart + 1 |
|
9127 |
] ifFalse:[ |
|
9128 |
"/ change selection |
|
9129 |
textView selectFromCharacterPosition:selStart+1 to:selEnd |
|
9130 |
]. |
|
9131 |
||
9132 |
"Created: / 15.8.1997 / 15:45:58 / cg" |
|
9133 |
"Modified: / 15.1.1998 / 21:55:57 / cg" |
|
9134 |
! |
|
9135 |
||
9136 |
_WTextComponentPeer_setText:nativeContext |
|
9137 |
|textView string jstring| |
|
9138 |
||
9139 |
textView := self viewForWPeer:nativeContext. |
|
9140 |
||
9141 |
jstring := nativeContext argAt:1. |
|
9142 |
string := Java as_ST_String:jstring. |
|
9143 |
||
9144 |
textView contents:string. |
|
9145 |
||
9146 |
"Created: / 5.1.1998 / 01:28:23 / cg" |
|
9147 |
"Modified: / 15.1.1998 / 15:59:57 / cg" |
|
9148 |
! |
|
9149 |
||
9150 |
_WTextFieldPeer_create:nativeContext |
|
9151 |
|jTextFieldPeer jFrame frame editField| |
|
9152 |
||
9153 |
jTextFieldPeer := nativeContext receiver. |
|
9154 |
||
9155 |
jFrame := nativeContext argAt:1. |
|
9156 |
frame := jFrame instVarNamed:'pData'. |
|
9157 |
||
9158 |
editField := EditField in:frame. |
|
9159 |
||
9160 |
self createdWindowsView:editField for:jTextFieldPeer. |
|
9161 |
||
9162 |
editField crAction:[ |
|
419 | 9163 |
jTextFieldPeer perform:#handleAction. |
284 | 9164 |
]. |
9165 |
WindowCreationTrace == true ifTrue:[ |
|
9166 |
'WTextFieldPeer_create: ' print. frame print. ' -> ' print. editField printNL. |
|
9167 |
]. |
|
9168 |
||
9169 |
"Created: / 5.1.1998 / 01:27:37 / cg" |
|
419 | 9170 |
"Modified: / 4.11.1998 / 21:07:30 / cg" |
284 | 9171 |
! |
9172 |
||
9173 |
_WTextFieldPeer_setEchoCharacter:nativeContext |
|
9174 |
|editField char| |
|
9175 |
||
9176 |
editField := self viewForWPeer:nativeContext. |
|
9177 |
||
9178 |
char := nativeContext argAt:1. |
|
9179 |
editField passwordCharacter:(Character value:char). |
|
9180 |
||
9181 |
"Created: / 25.1.1998 / 16:28:30 / cg" |
|
9182 |
! |
|
9183 |
||
440 | 9184 |
_WToolkit_beep:nativeContext |
9185 |
"/ void beep () |
|
9186 |
UnimplementedNativeMethodSignal raise |
|
9187 |
||
9188 |
"Created: / 12.11.1998 / 19:09:23 / cg" |
|
9189 |
! |
|
9190 |
||
284 | 9191 |
_WToolkit_eventLoop:nativeContext |
9192 |
JavaEventThread := Processor activeProcess. |
|
9193 |
[ |
|
9194 |
[true] whileTrue:[ |
|
9195 |
AbortSignal handle:[:ex | |
|
9196 |
ex return |
|
9197 |
] do:[ |
|
9198 |
self doWindowsEventThread. |
|
9199 |
] |
|
9200 |
]. |
|
9201 |
] valueNowOrOnUnwindDo:[ |
|
9202 |
JavaEventThread := nil. |
|
9203 |
]. |
|
9204 |
||
9205 |
"Created: / 6.1.1998 / 21:01:44 / cg" |
|
9206 |
"Modified: / 15.1.1998 / 19:48:55 / cg" |
|
9207 |
! |
|
9208 |
||
405 | 9209 |
_WToolkit_getComboHeightOffset:nativeContext |
9210 |
^ 0 |
|
9211 |
||
9212 |
"Modified: / 20.3.1997 / 13:50:04 / cg" |
|
9213 |
"Created: / 22.10.1998 / 00:59:14 / cg" |
|
9214 |
! |
|
9215 |
||
284 | 9216 |
_WToolkit_getScreenHeight:nativeContext |
9217 |
^ Screen current height |
|
9218 |
||
9219 |
"Modified: / 20.3.1997 / 13:50:04 / cg" |
|
9220 |
"Created: / 13.1.1998 / 09:24:45 / cg" |
|
9221 |
! |
|
9222 |
||
9223 |
_WToolkit_getScreenResolution:nativeContext |
|
9224 |
^ Screen current resolution x rounded |
|
9225 |
||
9226 |
"Modified: / 20.3.1997 / 13:50:04 / cg" |
|
9227 |
"Created: / 17.1.1998 / 21:54:48 / cg" |
|
9228 |
! |
|
9229 |
||
9230 |
_WToolkit_getScreenWidth:nativeContext |
|
9231 |
^ Screen current width |
|
9232 |
||
9233 |
"Modified: / 20.3.1997 / 13:50:04 / cg" |
|
9234 |
"Created: / 13.1.1998 / 09:24:37 / cg" |
|
9235 |
! |
|
9236 |
||
9237 |
_WToolkit_init:nativeContext |
|
9238 |
||
9239 |
"Created: / 3.1.1998 / 02:30:57 / cg" |
|
9240 |
! |
|
9241 |
||
9242 |
_WToolkit_loadSystemColors:nativeContext |
|
9243 |
"/ self halt. |
|
9244 |
||
9245 |
"Modified: / 18.3.1997 / 18:43:26 / cg" |
|
9246 |
"Created: / 5.1.1998 / 02:19:09 / cg" |
|
9247 |
! |
|
9248 |
||
440 | 9249 |
_WToolkit_makeColorModel:nativeContext |
9250 |
"/ java.awt.image.ColorModel makeColorModel () |
|
9251 |
UnimplementedNativeMethodSignal raise |
|
9252 |
||
9253 |
"Created: / 12.11.1998 / 19:08:47 / cg" |
|
9254 |
! |
|
9255 |
||
9256 |
_WToolkit_sync:nativeContext |
|
9257 |
"/ void sync () |
|
9258 |
UnimplementedNativeMethodSignal raise |
|
9259 |
||
9260 |
"Created: / 12.11.1998 / 19:09:14 / cg" |
|
9261 |
! |
|
9262 |
||
284 | 9263 |
_WWindowPeer__setResizable:nativeContext |
9264 |
|view onOff| |
|
9265 |
||
9266 |
view := self viewForWPeer:nativeContext. |
|
9267 |
||
9268 |
onOff := (nativeContext argAt:1) == 1. |
|
9269 |
view isTopView ifTrue:[ |
|
9270 |
onOff ifTrue:[ |
|
9271 |
view minExtent:10@10. |
|
9272 |
view maxExtent:(Screen current extent). |
|
9273 |
] ifFalse:[ |
|
9274 |
view minExtent:view extent. |
|
9275 |
view maxExtent:view extent. |
|
9276 |
] |
|
9277 |
] ifFalse:[ |
|
9278 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
9279 |
self halt. |
|
9280 |
] |
|
9281 |
]. |
|
9282 |
||
9283 |
"/ 'JAVA: WWindowPeer_setResizable: ' print. view print. ' yes/no: ' print. onOff printNL. |
|
9284 |
||
9285 |
^ nil |
|
9286 |
||
9287 |
"Created: / 5.1.1998 / 00:57:59 / cg" |
|
9288 |
"Modified: / 16.1.1998 / 18:08:00 / cg" |
|
9289 |
! |
|
9290 |
||
9291 |
_WWindowPeer__setTitle:nativeContext |
|
9292 |
|view jString string| |
|
9293 |
||
9294 |
view := self viewForWPeer:nativeContext. |
|
9295 |
||
9296 |
jString := nativeContext argAt:1. |
|
9297 |
string := Java as_ST_String:jString. |
|
9298 |
||
9299 |
"/ 'JAVA: WWindowPeer_pSetTitle: ' print. string print. ' ' print. view printNL. |
|
9300 |
||
9301 |
view label:string. |
|
9302 |
^ nil |
|
9303 |
||
9304 |
"Created: / 5.1.1998 / 00:57:17 / cg" |
|
9305 |
"Modified: / 8.1.1998 / 17:37:41 / cg" |
|
9306 |
! |
|
9307 |
||
440 | 9308 |
_WWindowPeer_create:nativeContext |
9309 |
"/ void create (sun.awt.windows.WComponentPeer) |
|
9310 |
UnimplementedNativeMethodSignal raise |
|
9311 |
||
9312 |
"Created: / 12.11.1998 / 19:10:38 / cg" |
|
9313 |
! |
|
9314 |
||
9315 |
_WWindowPeer_getContainerElement:nativeContext |
|
9316 |
"/ java.awt.Component getContainerElement (java.awt.Container int) |
|
9317 |
UnimplementedNativeMethodSignal raise |
|
9318 |
||
9319 |
"Created: / 12.11.1998 / 19:10:54 / cg" |
|
9320 |
! |
|
9321 |
||
342 | 9322 |
_WWindowPeer_toBack:nativeContext |
9323 |
|view| |
|
9324 |
||
9325 |
view := self viewForWPeer:nativeContext. |
|
9326 |
view lower. |
|
9327 |
||
9328 |
"Created: / 7.5.1998 / 00:23:03 / cg" |
|
9329 |
! |
|
9330 |
||
337 | 9331 |
_WWindowPeer_toFront:nativeContext |
9332 |
|view| |
|
9333 |
||
9334 |
view := self viewForWPeer:nativeContext. |
|
9335 |
view raise. |
|
9336 |
||
9337 |
"Created: / 9.4.1998 / 22:17:28 / cg" |
|
9338 |
! |
|
9339 |
||
284 | 9340 |
_WWindowPeer_updateInsets:nativeContext |
9341 |
"/ self halt. |
|
9342 |
||
9343 |
"Modified: / 18.3.1997 / 18:43:18 / cg" |
|
9344 |
"Created: / 4.1.1998 / 18:09:04 / cg" |
|
9345 |
! ! |
|
9346 |
||
9347 |
!JavaVM class methodsFor:'native - sun.awt.windows - jdk1.2'! |
|
9348 |
||
9349 |
_WFramePeer_setTitle:nativeContext |
|
9350 |
|view jString string| |
|
9351 |
||
9352 |
view := self viewForWPeer:nativeContext. |
|
9353 |
||
9354 |
jString := nativeContext argAt:1. |
|
9355 |
string := Java as_ST_String:jString. |
|
9356 |
||
9357 |
"/ 'JAVA: WFramePeer_pSetTitle: ' print. string print. ' ' print. view printNL. |
|
9358 |
||
9359 |
view label:string. |
|
9360 |
^ nil |
|
9361 |
||
9362 |
"Modified: / 8.1.1998 / 17:37:41 / cg" |
|
9363 |
"Created: / 27.1.1998 / 21:42:57 / cg" |
|
9364 |
! |
|
9365 |
||
9366 |
_WPanelPeer_calculateInsets:nativeContext |
|
9367 |
"/ new with jdk1.2 ... |
|
9368 |
||
9369 |
"Created: / 27.1.1998 / 21:40:00 / cg" |
|
9370 |
! ! |
|
9371 |
||
457 | 9372 |
!JavaVM class methodsFor:'native - sun.awt.windows - ms'! |
9373 |
||
9374 |
_MCanvasPeer_create:nativeContext |
|
9375 |
|jCanvasPeer jFrame frame subView| |
|
9376 |
||
9377 |
jCanvasPeer := nativeContext receiver. |
|
9378 |
||
9379 |
jFrame := nativeContext argAt:1. |
|
9380 |
jFrame isNil ifTrue:[ |
|
9381 |
self halt:'no frame in canvasPeer create'. |
|
9382 |
self internalError:'no frame in canvasPeer create'. |
|
9383 |
^ self. |
|
9384 |
]. |
|
9385 |
frame := jFrame instVarNamed:'pData'. |
|
9386 |
||
9387 |
subView := JavaView in:frame. |
|
9388 |
subView delegate:self. |
|
9389 |
subView javaPeer:jCanvasPeer. |
|
9390 |
||
9391 |
self createdWindowsView:subView for:jCanvasPeer. |
|
9392 |
||
9393 |
WindowCreationTrace == true ifTrue:[ |
|
9394 |
'WCanvasPeer_create: ' print. frame print. ' -> ' print. subView printNL. |
|
9395 |
]. |
|
9396 |
||
9397 |
"Modified: / 16.1.1998 / 13:40:00 / cg" |
|
9398 |
"Created: / 18.11.1998 / 00:14:44 / cg" |
|
9399 |
! |
|
9400 |
||
9401 |
_MComponentPeer_pReshape:nativeContext |
|
9402 |
self commonReshapeComponent:nativeContext |
|
9403 |
||
9404 |
"Created: / 18.11.1998 / 00:18:17 / cg" |
|
9405 |
! |
|
9406 |
||
9407 |
_MComponentPeer_setBackground:nativeContext |
|
9408 |
|jClr rgb clr view| |
|
9409 |
||
9410 |
view := self viewForWPeer:nativeContext. |
|
9411 |
||
9412 |
jClr := nativeContext argAt:1. |
|
9413 |
rgb := jClr instVarNamed:'value'. |
|
9414 |
"/ self halt. |
|
9415 |
clr := Color rgbValue:rgb. |
|
9416 |
||
9417 |
||
9418 |
clr := clr on:(view device). |
|
9419 |
||
9420 |
(view isKindOf:ScrollableView) ifTrue:[ |
|
9421 |
view := view scrolledView |
|
9422 |
]. |
|
9423 |
view viewBackground:clr. |
|
9424 |
view backgroundPaint:clr. |
|
9425 |
||
9426 |
"Created: / 17.11.1998 / 23:49:41 / cg" |
|
9427 |
! |
|
9428 |
||
9429 |
_MComponentPeer_setFont:nativeContext |
|
9430 |
|view| |
|
9431 |
||
9432 |
view := self viewForWPeer:nativeContext. |
|
9433 |
"/ self halt. |
|
9434 |
||
9435 |
"Modified: / 25.1.1998 / 01:22:19 / cg" |
|
9436 |
"Created: / 17.11.1998 / 23:43:48 / cg" |
|
9437 |
! |
|
9438 |
||
9439 |
_MComponentPeer_setForeground:nativeContext |
|
9440 |
|jClr rgb clr view| |
|
9441 |
||
9442 |
view := self viewForWPeer:nativeContext. |
|
9443 |
||
9444 |
jClr := nativeContext argAt:1. |
|
9445 |
rgb := jClr instVarNamed:'value'. |
|
9446 |
"/ self halt. |
|
9447 |
clr := Color rgbValue:rgb. |
|
9448 |
||
9449 |
clr := clr on:(view device). |
|
9450 |
||
9451 |
view paint:clr. |
|
9452 |
||
9453 |
"Created: / 17.11.1998 / 23:50:31 / cg" |
|
9454 |
"Modified: / 17.11.1998 / 23:57:29 / cg" |
|
9455 |
! |
|
9456 |
||
9457 |
_MFramePeer_getWindowBackgroundColor:nativeContext |
|
9458 |
^ View defaultViewBackgroundColor rgbValue. |
|
9459 |
||
9460 |
"Created: / 17.11.1998 / 23:55:42 / cg" |
|
9461 |
! |
|
9462 |
||
9463 |
_MFramePeer_pShow:nativeContext |
|
9464 |
|view| |
|
9465 |
||
9466 |
view := self viewForWPeer:nativeContext. |
|
9467 |
||
9468 |
"/ frame views are under my browsers own control |
|
9469 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
9470 |
view beVisible. |
|
9471 |
view realize. |
|
9472 |
]. |
|
9473 |
||
9474 |
"/ view windowGroup notNil ifTrue:[ |
|
9475 |
"/ windowServer addGroup:(view windowGroup) |
|
9476 |
"/ ]. |
|
9477 |
||
9478 |
^ nil |
|
9479 |
||
9480 |
"/ self halt. |
|
9481 |
||
9482 |
"Modified: / 25.1.1998 / 09:54:07 / cg" |
|
9483 |
"Created: / 18.11.1998 / 00:19:59 / cg" |
|
9484 |
! |
|
9485 |
||
9486 |
_MFramePeer_setInsets:nativeContext |
|
9487 |
||
9488 |
"Created: / 17.11.1998 / 23:55:32 / cg" |
|
9489 |
! |
|
9490 |
||
9491 |
_MFramePeer_setResizable:nativeContext |
|
9492 |
|view onOff| |
|
9493 |
||
9494 |
view := self viewForWPeer:nativeContext. |
|
9495 |
||
9496 |
onOff := (nativeContext argAt:1) == 1. |
|
9497 |
view isTopView ifTrue:[ |
|
9498 |
onOff ifTrue:[ |
|
9499 |
view minExtent:10@10. |
|
9500 |
view maxExtent:(Screen current extent). |
|
9501 |
] ifFalse:[ |
|
9502 |
view minExtent:view extent. |
|
9503 |
view maxExtent:view extent. |
|
9504 |
] |
|
9505 |
] ifFalse:[ |
|
9506 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
9507 |
self halt. |
|
9508 |
] |
|
9509 |
]. |
|
9510 |
||
9511 |
"/ 'JAVA: WWindowPeer_setResizable: ' print. view print. ' yes/no: ' print. onOff printNL. |
|
9512 |
||
9513 |
^ nil |
|
9514 |
||
9515 |
"Modified: / 16.1.1998 / 18:08:00 / cg" |
|
9516 |
"Created: / 17.11.1998 / 23:51:45 / cg" |
|
9517 |
! |
|
9518 |
||
9519 |
_MToolkit_callbackLoop:nativeContext |
|
9520 |
|toolKit| |
|
9521 |
||
9522 |
toolKit := nativeContext receiver. |
|
9523 |
^ self. |
|
9524 |
self halt. |
|
9525 |
self wakeup:toolKit. |
|
9526 |
self halt. |
|
9527 |
||
9528 |
JavaEventThread := Processor activeProcess. |
|
9529 |
[ |
|
9530 |
[true] whileTrue:[ |
|
9531 |
AbortSignal handle:[:ex | |
|
9532 |
ex return |
|
9533 |
] do:[ |
|
9534 |
self doWindowsEventThread. |
|
9535 |
] |
|
9536 |
]. |
|
9537 |
] valueNowOrOnUnwindDo:[ |
|
9538 |
JavaEventThread := nil. |
|
9539 |
]. |
|
9540 |
||
9541 |
"Created: / 17.11.1998 / 23:58:33 / cg" |
|
9542 |
"Modified: / 18.11.1998 / 00:13:19 / cg" |
|
9543 |
! |
|
9544 |
||
9545 |
_MToolkit_eventLoop:nativeContext |
|
9546 |
|toolKit| |
|
9547 |
||
9548 |
toolKit := nativeContext receiver. |
|
9549 |
||
9550 |
self wakeup:toolKit. |
|
9551 |
self halt. |
|
9552 |
||
9553 |
JavaEventThread := Processor activeProcess. |
|
9554 |
[ |
|
9555 |
[true] whileTrue:[ |
|
9556 |
AbortSignal handle:[:ex | |
|
9557 |
ex return |
|
9558 |
] do:[ |
|
9559 |
self doWindowsEventThread. |
|
9560 |
] |
|
9561 |
]. |
|
9562 |
] valueNowOrOnUnwindDo:[ |
|
9563 |
JavaEventThread := nil. |
|
9564 |
]. |
|
9565 |
||
9566 |
"Created: / 17.11.1998 / 23:04:29 / cg" |
|
9567 |
"Modified: / 18.11.1998 / 00:11:29 / cg" |
|
9568 |
! ! |
|
9569 |
||
380 | 9570 |
!JavaVM class methodsFor:'native - sun.awt.windows - ns4.0'! |
9571 |
||
9572 |
_WComponentPeer_setBackground:nativeContext |
|
9573 |
|jClr rgb clr view| |
|
9574 |
||
9575 |
view := self viewForWPeer:nativeContext. |
|
9576 |
||
9577 |
jClr := nativeContext argAt:1. |
|
9578 |
rgb := jClr instVarNamed:'value'. |
|
9579 |
"/ self halt. |
|
9580 |
clr := Color rgbValue:rgb. |
|
9581 |
||
9582 |
||
9583 |
clr := clr on:(view device). |
|
9584 |
||
9585 |
"/ (view superView isMemberOf:JavaEmbeddedFrameView) ifTrue:[ |
|
9586 |
"/ view viewBackground:(view superView viewBackground). |
|
9587 |
"/ view backgroundPaint:(view superView viewBackground). |
|
9588 |
"/ ] ifFalse:[ |
|
9589 |
"/ (view isMemberOf:JavaView) ifTrue:[ |
|
9590 |
"/ view viewBackground:clr. |
|
9591 |
"/ view backgroundPaint:clr. |
|
9592 |
"/ ] |
|
9593 |
"/ ]. |
|
9594 |
||
9595 |
(view isKindOf:ScrollableView) ifTrue:[ |
|
9596 |
view := view scrolledView |
|
9597 |
]. |
|
9598 |
view viewBackground:clr. |
|
9599 |
view backgroundPaint:clr. |
|
9600 |
||
9601 |
"Created: / 16.10.1998 / 02:16:31 / cg" |
|
9602 |
"Modified: / 16.10.1998 / 02:26:29 / cg" |
|
9603 |
! |
|
9604 |
||
9605 |
_WComponentPeer_setForeground:nativeContext |
|
9606 |
|jClr rgb clr view| |
|
9607 |
||
9608 |
view := self viewForWPeer:nativeContext. |
|
9609 |
||
9610 |
jClr := nativeContext argAt:1. |
|
9611 |
rgb := jClr instVarNamed:'value'. |
|
9612 |
"/ self halt. |
|
9613 |
clr := Color rgbValue:rgb. |
|
9614 |
||
9615 |
||
9616 |
clr := clr on:(view device). |
|
9617 |
||
9618 |
(view isKindOf:ScrollableView) ifTrue:[ |
|
9619 |
view := view scrolledView |
|
9620 |
]. |
|
9621 |
view paint:clr. |
|
9622 |
||
9623 |
"Created: / 16.10.1998 / 02:18:58 / cg" |
|
9624 |
"Modified: / 16.10.1998 / 02:26:37 / cg" |
|
9625 |
! |
|
9626 |
||
9627 |
_WContainerPeer_calculateInsets:nativeContext |
|
9628 |
"/ new with ns4.0 ... |
|
9629 |
||
9630 |
"Created: / 16.10.1998 / 02:12:59 / cg" |
|
9631 |
! |
|
9632 |
||
9633 |
_WFramePeer_setResizable:nativeContext |
|
9634 |
|view onOff| |
|
9635 |
||
9636 |
view := self viewForWPeer:nativeContext. |
|
9637 |
||
9638 |
onOff := (nativeContext argAt:1) == 1. |
|
9639 |
view isTopView ifTrue:[ |
|
9640 |
onOff ifTrue:[ |
|
9641 |
view minExtent:10@10. |
|
9642 |
view maxExtent:(Screen current extent). |
|
9643 |
] ifFalse:[ |
|
9644 |
view minExtent:view extent. |
|
9645 |
view maxExtent:view extent. |
|
9646 |
] |
|
9647 |
] ifFalse:[ |
|
9648 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
9649 |
self halt. |
|
9650 |
] |
|
9651 |
]. |
|
9652 |
||
9653 |
"/ 'JAVA: WWindowPeer_setResizable: ' print. view print. ' yes/no: ' print. onOff printNL. |
|
9654 |
||
9655 |
^ nil |
|
9656 |
||
9657 |
"Modified: / 16.1.1998 / 18:08:00 / cg" |
|
9658 |
"Created: / 16.10.1998 / 02:21:34 / cg" |
|
9659 |
! ! |
|
9660 |
||
440 | 9661 |
!JavaVM class methodsFor:'native - sun.misc'! |
9662 |
||
9663 |
_VM_getState:nativeContext |
|
9664 |
"/ int getState () |
|
9665 |
UnimplementedNativeMethodSignal raise |
|
9666 |
||
9667 |
"Created: / 12.11.1998 / 19:06:44 / cg" |
|
9668 |
! |
|
9669 |
||
448 | 9670 |
_VM_resetJavaMonitor:nativeContext |
9671 |
"/ void resetJavaMonitor () |
|
9672 |
UnimplementedNativeMethodSignal raise |
|
9673 |
||
9674 |
"Created: / 14.11.1998 / 10:43:23 / cg" |
|
9675 |
! |
|
9676 |
||
9677 |
_VM_resumeJavaMonitor:nativeContext |
|
9678 |
"/ void resumeJavaMonitor () |
|
9679 |
UnimplementedNativeMethodSignal raise |
|
9680 |
||
9681 |
"Created: / 14.11.1998 / 10:42:49 / cg" |
|
9682 |
! |
|
9683 |
||
9684 |
_VM_suspendJavaMonitor:nativeContext |
|
9685 |
"/ void suspendJavaMonitor () |
|
9686 |
UnimplementedNativeMethodSignal raise |
|
9687 |
||
9688 |
"Created: / 14.11.1998 / 10:43:07 / cg" |
|
9689 |
! |
|
9690 |
||
440 | 9691 |
_VM_threadsSuspended:nativeContext |
9692 |
"/ boolean threadsSuspended () |
|
9693 |
UnimplementedNativeMethodSignal raise |
|
9694 |
||
9695 |
"Created: / 12.11.1998 / 19:07:10 / cg" |
|
9696 |
! |
|
9697 |
||
9698 |
_VM_unsuspendSomeThreads:nativeContext |
|
9699 |
"/ void unsuspendSomeThreads () |
|
9700 |
UnimplementedNativeMethodSignal raise |
|
9701 |
||
9702 |
"Created: / 12.11.1998 / 19:07:29 / cg" |
|
9703 |
! |
|
9704 |
||
9705 |
_VM_unsuspendThreads:nativeContext |
|
9706 |
"/ void unsuspendThreads () |
|
9707 |
UnimplementedNativeMethodSignal raise |
|
9708 |
||
9709 |
"Created: / 12.11.1998 / 19:07:20 / cg" |
|
448 | 9710 |
! |
9711 |
||
9712 |
_VM_writeJavaMonitorReport:nativeContext |
|
9713 |
"/ void writeJavaMonitorReport () |
|
9714 |
UnimplementedNativeMethodSignal raise |
|
9715 |
||
9716 |
"Created: / 14.11.1998 / 10:43:37 / cg" |
|
440 | 9717 |
! ! |
9718 |
||
253 | 9719 |
!JavaVM class methodsFor:'semaphores & monitors'! |
9720 |
||
9721 |
monitorFor:someObject |
|
9722 |
|mon| |
|
9723 |
||
9724 |
LockTableAccess critical:[ |
|
261 | 9725 |
mon := LockTable at:someObject ifAbsent:nil. |
9726 |
mon isNil ifTrue:[ |
|
9727 |
LockTable at:someObject put:(mon := Monitor new) |
|
9728 |
] |
|
253 | 9729 |
]. |
9730 |
^ mon |
|
9731 |
||
9732 |
"Created: / 2.1.1998 / 19:01:52 / cg" |
|
9733 |
! |
|
9734 |
||
9735 |
releaseAndSignalForAllSemaphoreFor:someObject |
|
9736 |
|sema| |
|
9737 |
||
9738 |
WaitTableAccess critical:[ |
|
306 | 9739 |
sema := WaitTable at:someObject ifAbsent:nil. |
9740 |
"/ sema notNil ifTrue:[ |
|
9741 |
"/ WaitTable removeKey:someObject |
|
9742 |
"/ ] |
|
253 | 9743 |
]. |
9744 |
||
9745 |
sema notNil ifTrue:[ |
|
306 | 9746 |
sema signalForAll |
253 | 9747 |
] |
9748 |
||
9749 |
"Created: / 2.1.1998 / 18:21:51 / cg" |
|
306 | 9750 |
"Modified: / 3.2.1998 / 16:11:58 / cg" |
253 | 9751 |
! |
9752 |
||
9753 |
releaseAndSignalSemaphoreFor:someObject |
|
9754 |
|sema| |
|
9755 |
||
9756 |
WaitTableAccess critical:[ |
|
306 | 9757 |
sema := WaitTable at:someObject ifAbsent:nil. |
9758 |
"/ sema notNil ifTrue:[ |
|
9759 |
"/ WaitTable removeKey:someObject |
|
9760 |
"/ ] |
|
253 | 9761 |
]. |
9762 |
||
9763 |
sema notNil ifTrue:[ |
|
306 | 9764 |
sema signal |
253 | 9765 |
] |
9766 |
||
9767 |
"Created: / 2.1.1998 / 18:20:20 / cg" |
|
306 | 9768 |
"Modified: / 3.2.1998 / 16:11:51 / cg" |
253 | 9769 |
! |
9770 |
||
9771 |
releaseSemaphoreFor:someObject |
|
9772 |
WaitTableAccess critical:[ |
|
261 | 9773 |
WaitTable removeKey:someObject ifAbsent:nil |
253 | 9774 |
] |
9775 |
||
9776 |
"Created: / 2.1.1998 / 18:17:14 / cg" |
|
9777 |
"Modified: / 2.1.1998 / 21:52:03 / cg" |
|
9778 |
! |
|
9779 |
||
9780 |
semaphoreFor:someObject |
|
9781 |
|sema| |
|
9782 |
||
9783 |
WaitTableAccess critical:[ |
|
261 | 9784 |
sema := WaitTable at:someObject ifAbsent:nil. |
9785 |
sema isNil ifTrue:[ |
|
9786 |
WaitTable at:someObject put:(sema := Semaphore new) |
|
9787 |
] |
|
253 | 9788 |
]. |
9789 |
^ sema |
|
9790 |
||
9791 |
"Created: / 2.1.1998 / 18:15:59 / cg" |
|
9792 |
"Modified: / 2.1.1998 / 18:20:31 / cg" |
|
9793 |
! ! |
|
9794 |
||
9795 |
!JavaVM class methodsFor:'vm support'! |
|
9796 |
||
9797 |
monitorEnter:someObject |
|
9798 |
| mon thisProcess| |
|
9799 |
||
9800 |
someObject isNil ifTrue:[ |
|
261 | 9801 |
self halt |
253 | 9802 |
]. |
9803 |
||
9804 |
mon := self monitorFor:someObject. |
|
9805 |
||
9806 |
MonitorTrace ifTrue:[ |
|
261 | 9807 |
('====> entering monitor for ' , someObject displayString , ' in ' , Processor activeProcess name , ' ...') printCR. |
253 | 9808 |
]. |
9809 |
mon enter. |
|
9810 |
MonitorTrace ifTrue:[ |
|
261 | 9811 |
('====> entered it in ' , Processor activeProcess name , ' ...') printCR. |
253 | 9812 |
]. |
9813 |
||
9814 |
self enteredMonitors add:someObject. |
|
9815 |
||
9816 |
"Created: / 2.1.1998 / 23:44:49 / cg" |
|
9817 |
"Modified: / 3.1.1998 / 03:05:02 / cg" |
|
9818 |
! |
|
9819 |
||
9820 |
monitorExit:someObject |
|
9821 |
| mon thisProcess| |
|
9822 |
||
9823 |
someObject isNil ifTrue:[ |
|
261 | 9824 |
self halt |
253 | 9825 |
]. |
9826 |
||
9827 |
mon := self monitorFor:someObject. |
|
9828 |
||
9829 |
MonitorTrace ifTrue:[ |
|
261 | 9830 |
('====> leaving monitor for ' , someObject displayString , ' in ' , Processor activeProcess name , ' ...') printCR. |
253 | 9831 |
]. |
9832 |
mon exit. |
|
9833 |
MonitorTrace ifTrue:[ |
|
261 | 9834 |
('====> left it in ' , Processor activeProcess name , ' ...') printCR. |
253 | 9835 |
]. |
9836 |
||
9837 |
"/ enteredMonitorHandles isNil ifTrue:[ |
|
9838 |
"/ self halt:'oops - no monitor entered'. |
|
9839 |
"/ ]. |
|
9840 |
||
9841 |
self enteredMonitors removeLast ~~ someObject ifTrue:[ |
|
261 | 9842 |
self halt:'oops - monitor enter/exit nesting wrong' |
253 | 9843 |
]. |
9844 |
||
9845 |
"Created: / 2.1.1998 / 23:47:28 / cg" |
|
9846 |
"Modified: / 3.1.1998 / 03:05:18 / cg" |
|
9847 |
! ! |
|
9848 |
||
255 | 9849 |
!JavaVM class methodsFor:'windows - events'! |
9850 |
||
9851 |
awtEventsForEvent:anEvent javaWindow:jWin |
|
9852 |
"given an ST/X event, create corresponding AWT event(s) for it" |
|
9853 |
||
9854 |
|jEv jEv1 jEv2 |
|
261 | 9855 |
modifiers key keyChar untranslatedKey id |
9856 |
type x y w h view menu |
|
255 | 9857 |
eventArgs clickCount jRect |
9858 |
jKeyEventClass jInputEventClass jMouseEventClass |
|
9859 |
jWindowEventClass jPaintEventClass jComponentEventClass| |
|
9860 |
||
9861 |
type := anEvent type. |
|
9862 |
eventArgs := anEvent arguments. |
|
9863 |
||
9864 |
key := 0. |
|
9865 |
modifiers := 0. |
|
9866 |
x := 0. |
|
9867 |
y := 0. |
|
9868 |
||
9869 |
(anEvent isKeyEvent |
|
9870 |
or:[anEvent isButtonEvent |
|
9871 |
or:[anEvent isPointerEnterLeaveEvent]]) ifTrue:[ |
|
439 | 9872 |
jInputEventClass := Java classForName:'java.awt.event.InputEvent'. |
9873 |
||
255 | 9874 |
anEvent hasAlt ifTrue:[ |
9875 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'ALT_MASK') |
|
9876 |
]. |
|
9877 |
anEvent hasCtrl ifTrue:[ |
|
9878 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'CTRL_MASK') |
|
9879 |
]. |
|
9880 |
anEvent hasMeta ifTrue:[ |
|
9881 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'META_MASK') |
|
9882 |
]. |
|
9883 |
anEvent hasShift ifTrue:[ |
|
9884 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'SHIFT_MASK') |
|
9885 |
]. |
|
9886 |
anEvent hasButton1 ifTrue:[ |
|
9887 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'BUTTON1_MASK') |
|
9888 |
]. |
|
9889 |
anEvent hasButton2 ifTrue:[ |
|
9890 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'BUTTON2_MASK') |
|
9891 |
]. |
|
9892 |
anEvent hasButton3 ifTrue:[ |
|
9893 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'BUTTON3_MASK') |
|
9894 |
]. |
|
9895 |
||
9896 |
anEvent isPointerEnterLeaveEvent ifFalse:[ |
|
9897 |
"/ ST/X does not (yet) record this information |
|
9898 |
"/ with pointerLeave events. |
|
9899 |
||
9900 |
x := anEvent x. |
|
9901 |
y := anEvent y. |
|
9902 |
]. |
|
9903 |
]. |
|
9904 |
||
9905 |
anEvent isKeyEvent ifTrue:[ |
|
9906 |
jKeyEventClass := Java classForName:'java.awt.event.KeyEvent'. |
|
9907 |
||
9908 |
key := 0. |
|
9909 |
keyChar := 0. |
|
9910 |
||
9911 |
key := anEvent key. |
|
9912 |
key isCharacter ifTrue:[ |
|
9913 |
key := keyChar := key asciiValue |
|
9914 |
] ifFalse:[ |
|
9915 |
untranslatedKey := anEvent view device keyboardMap keyAtValue:key ifAbsent:key. |
|
9916 |
untranslatedKey == #Delete ifTrue:[ |
|
9917 |
key := jKeyEventClass instVarNamed:'VK_DELETE' "/ 127 |
|
9918 |
]. |
|
9919 |
untranslatedKey == #BackSpace ifTrue:[ |
|
9920 |
key := jKeyEventClass instVarNamed:'VK_BACK_SPACE' "/ 8 |
|
9921 |
]. |
|
9922 |
untranslatedKey == #Return ifTrue:[ |
|
9923 |
key := jKeyEventClass instVarNamed:'VK_ENTER' "/ 13 |
|
9924 |
]. |
|
9925 |
untranslatedKey == #Tab ifTrue:[ |
|
9926 |
key := jKeyEventClass instVarNamed:'VK_TAB' "/ 9 |
|
9927 |
]. |
|
9928 |
untranslatedKey == #Home ifTrue:[ |
|
9929 |
key := jKeyEventClass instVarNamed:'VK_HOME' |
|
9930 |
]. |
|
9931 |
untranslatedKey == #End ifTrue:[ |
|
9932 |
key := jKeyEventClass instVarNamed:'VK_END' |
|
9933 |
]. |
|
9934 |
untranslatedKey == #Prior ifTrue:[ |
|
9935 |
key := jKeyEventClass instVarNamed:'VK_PAGE_UP' |
|
9936 |
]. |
|
9937 |
key == #EndOfText ifTrue:[ |
|
9938 |
key := jKeyEventClass instVarNamed:'VK_PAGE_DOWN' |
|
9939 |
]. |
|
9940 |
untranslatedKey == #CursorUp ifTrue:[ |
|
9941 |
key := jKeyEventClass instVarNamed:'VK_UP' |
|
9942 |
]. |
|
9943 |
untranslatedKey == #CursorDown ifTrue:[ |
|
9944 |
key := jKeyEventClass instVarNamed:'VK_DOWN' |
|
9945 |
]. |
|
9946 |
untranslatedKey == #CursorLeft ifTrue:[ |
|
9947 |
key := jKeyEventClass instVarNamed:'VK_LEFT' |
|
9948 |
]. |
|
9949 |
untranslatedKey == #CursorRight ifTrue:[ |
|
9950 |
key := jKeyEventClass instVarNamed:'VK_RIGHT' |
|
9951 |
]. |
|
9952 |
(#( F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11) |
|
9953 |
includes:untranslatedKey) ifTrue:[ |
|
9954 |
key := jKeyEventClass instVarNamed:('VK_' , untranslatedKey) |
|
9955 |
]. |
|
9956 |
]. |
|
9957 |
(type == #'keyPress:x:y:') ifTrue:[ |
|
9958 |
id := jKeyEventClass instVarNamed:'KEY_PRESSED' |
|
9959 |
] ifFalse:[ |
|
9960 |
id := jKeyEventClass instVarNamed:'KEY_RELEASED' |
|
9961 |
]. |
|
261 | 9962 |
jEv := jKeyEventClass newCleared "basicNew". |
255 | 9963 |
jEv instVarNamed:'modifiers' put:modifiers. |
9964 |
jEv instVarNamed:'keyCode' put:key. |
|
9965 |
jEv instVarNamed:'keyChar' put:keyChar. |
|
9966 |
jEv instVarNamed:'id' put:id. |
|
9967 |
"/ jEv instVarNamed:'x' put:x. |
|
9968 |
"/ jEv instVarNamed:'y' put:y. |
|
9969 |
jEv instVarNamed:'when' put:(OperatingSystem getMillisecondTime). |
|
9970 |
^ Array with:jEv |
|
9971 |
]. |
|
9972 |
||
9973 |
(anEvent isButtonEvent |
|
9974 |
or:[anEvent isPointerEnterLeaveEvent]) ifTrue:[ |
|
9975 |
jMouseEventClass := Java classForName:'java.awt.event.MouseEvent'. |
|
9976 |
clickCount := 1. |
|
9977 |
||
9978 |
(type == #'buttonPress:x:y:') ifTrue:[ |
|
270 | 9979 |
id := jMouseEventClass instVarNamed:'MOUSE_PRESSED'. |
255 | 9980 |
] ifFalse:[ |
9981 |
(type == #'buttonRelease:x:y:') ifTrue:[ |
|
270 | 9982 |
id := jMouseEventClass instVarNamed:'MOUSE_RELEASED'. |
255 | 9983 |
] ifFalse:[ |
9984 |
(type == #'buttonMotion:x:y:') ifTrue:[ |
|
439 | 9985 |
anEvent state == 0 ifTrue:[ |
270 | 9986 |
id := jMouseEventClass instVarNamed:'MOUSE_MOVED'. |
9987 |
] ifFalse:[ |
|
9988 |
id := jMouseEventClass instVarNamed:'MOUSE_DRAGGED'. |
|
9989 |
]. |
|
255 | 9990 |
] ifFalse:[ |
9991 |
"/ (type == #'pointerMotion:x:y:') ifTrue:[ |
|
270 | 9992 |
"/ id := jMouseEventClass instVarNamed:'MOUSE_MOVED'. |
255 | 9993 |
"/ ] ifFalse:[ |
9994 |
(type == #'pointerEnter:x:y:') ifTrue:[ |
|
270 | 9995 |
id := jMouseEventClass instVarNamed:'MOUSE_ENTERED'. |
255 | 9996 |
] ifFalse:[ |
9997 |
(type == #'pointerLeave:') ifTrue:[ |
|
270 | 9998 |
id := jMouseEventClass instVarNamed:'MOUSE_EXITED'. |
255 | 9999 |
] ifFalse:[ |
10000 |
(type == #'buttonMultiPress:x:y:') ifTrue:[ |
|
10001 |
id := jMouseEventClass instVarNamed:'MOUSE_PRESSED'. |
|
10002 |
clickCount := 2. |
|
10003 |
] ifFalse:[ |
|
10004 |
self halt. |
|
10005 |
] |
|
10006 |
] |
|
10007 |
"/ ] |
|
10008 |
] |
|
10009 |
] |
|
10010 |
] |
|
10011 |
]. |
|
261 | 10012 |
jEv := jMouseEventClass newCleared "basicNew". |
255 | 10013 |
jEv instVarNamed:'modifiers' put:modifiers. |
10014 |
jEv instVarNamed:'id' put:id. |
|
10015 |
jEv instVarNamed:'x' put:x. |
|
10016 |
jEv instVarNamed:'y' put:y. |
|
10017 |
jEv instVarNamed:'when' put:(OperatingSystem getMillisecondTime). |
|
10018 |
^ Array with:jEv |
|
10019 |
]. |
|
10020 |
||
10021 |
||
10022 |
((type == #'exposeX:y:width:height:') |
|
10023 |
or:[(type == #'graphicExposeX:y:width:height:') |
|
10024 |
or:[(type == #damage)]]) ifTrue:[ |
|
439 | 10025 |
"/ jWindowEventClass := Java classForName:'java.awt.event.WindowEvent'. |
10026 |
"/ id := (jPaintEventClass instVarNamed:'PAINT'). |
|
255 | 10027 |
jPaintEventClass := Java classForName:'java.awt.event.PaintEvent'. |
261 | 10028 |
id := (jPaintEventClass instVarNamed:'UPDATE'). |
255 | 10029 |
|
10030 |
((type == #'exposeX:y:width:height:') |
|
10031 |
or:[(type == #'graphicExposeX:y:width:height:')]) ifTrue:[ |
|
10032 |
x := eventArgs at:1. |
|
10033 |
y := eventArgs at:2. |
|
10034 |
w := eventArgs at:3. |
|
10035 |
h := eventArgs at:4. |
|
10036 |
] ifFalse:[ |
|
10037 |
x := eventArgs left. |
|
10038 |
y := eventArgs top. |
|
10039 |
w := eventArgs width. |
|
10040 |
h := eventArgs height. |
|
10041 |
]. |
|
10042 |
jRect := (Java classForName:'java.awt.Rectangle') basicNew. |
|
10043 |
jRect instVarNamed:'x' put:x. |
|
10044 |
jRect instVarNamed:'y' put:y. |
|
10045 |
jRect instVarNamed:'width' put:w. |
|
10046 |
jRect instVarNamed:'height' put:h. |
|
10047 |
||
261 | 10048 |
jEv := jPaintEventClass newCleared "basicNew". |
255 | 10049 |
jEv instVarNamed:'id' put:id. |
10050 |
jEv instVarNamed:'updateRect' put:jRect. |
|
10051 |
||
10052 |
"/ jEv instVarNamed:'g' put:jWin. |
|
261 | 10053 |
|
255 | 10054 |
^ Array with:jEv. |
10055 |
]. |
|
10056 |
||
10057 |
(type == #'configureX:y:width:height:') ifTrue:[ |
|
261 | 10058 |
"/ x := eventArgs at:1. |
10059 |
"/ y := eventArgs at:2. |
|
10060 |
||
10061 |
view := anEvent view. |
|
10062 |
w := eventArgs at:3. |
|
10063 |
h := eventArgs at:4. |
|
10064 |
||
10065 |
"/ |
|
10066 |
"/ must change the components extent |
|
10067 |
"/ is there no cleaner way to do this ? |
|
10068 |
"/ |
|
10069 |
view isTopView ifTrue:[ |
|
10070 |
"/ |
|
10071 |
"/ sigh - don't include the menu. |
|
10072 |
"/ |
|
10073 |
menu := self topViewsMenu:view. |
|
10074 |
menu notNil ifTrue:[ |
|
10075 |
"/ must add the menus height |
|
10076 |
h := h - menu height |
|
10077 |
] |
|
10078 |
]. |
|
10079 |
jWin instVarNamed:'width' put:w. |
|
10080 |
jWin instVarNamed:'height' put:h. |
|
10081 |
||
255 | 10082 |
jComponentEventClass := Java classForName:'java.awt.event.ComponentEvent'. |
10083 |
id := (jComponentEventClass instVarNamed:'COMPONENT_MOVED'). |
|
261 | 10084 |
jEv1 := jComponentEventClass newCleared "basicNew". |
255 | 10085 |
jEv1 instVarNamed:'id' put:id. |
10086 |
||
10087 |
id := (jComponentEventClass instVarNamed:'COMPONENT_RESIZED'). |
|
261 | 10088 |
jEv2 := jComponentEventClass newCleared "basicNew". |
255 | 10089 |
jEv2 instVarNamed:'id' put:id. |
261 | 10090 |
|
255 | 10091 |
^ Array with:jEv1 with:jEv2. |
10092 |
]. |
|
10093 |
(type == #'focusIn') ifTrue:[ |
|
318 | 10094 |
"/ 'focusIn' printCR. |
255 | 10095 |
jComponentEventClass := Java classForName:'java.awt.event.FocusEvent'. |
10096 |
id := (jComponentEventClass instVarNamed:'FOCUS_GAINED'). |
|
261 | 10097 |
jEv := jComponentEventClass newCleared "basicNew". |
255 | 10098 |
jEv instVarNamed:'id' put:id. |
10099 |
^ Array with:jEv. |
|
10100 |
]. |
|
10101 |
(type == #'focusOut') ifTrue:[ |
|
318 | 10102 |
"/ 'focusOut' printCR. |
255 | 10103 |
jComponentEventClass := Java classForName:'java.awt.event.FocusEvent'. |
10104 |
id := (jComponentEventClass instVarNamed:'FOCUS_LOST'). |
|
261 | 10105 |
jEv := jComponentEventClass newCleared "basicNew". |
255 | 10106 |
jEv instVarNamed:'id' put:id. |
10107 |
^ Array with:jEv. |
|
10108 |
]. |
|
10109 |
(type == #'mapped') ifTrue:[ |
|
318 | 10110 |
"/ 'mapped' printCR. |
255 | 10111 |
jComponentEventClass := Java classForName:'java.awt.event.ComponentEvent'. |
10112 |
id := (jComponentEventClass instVarNamed:'COMPONENT_SHOWN'). |
|
10113 |
"/ x := eventArgs at:1. |
|
10114 |
"/ y := eventArgs at:2. |
|
261 | 10115 |
jEv := jComponentEventClass newCleared "basicNew". |
255 | 10116 |
jEv instVarNamed:'id' put:id. |
10117 |
^ Array with:jEv. |
|
10118 |
]. |
|
10119 |
(type == #'unmapped') ifTrue:[ |
|
318 | 10120 |
"/ 'unmapped' printCR. |
255 | 10121 |
jComponentEventClass := Java classForName:'java.awt.event.ComponentEvent'. |
10122 |
id := (jComponentEventClass instVarNamed:'COMPONENT_HIDDEN'). |
|
10123 |
"/ x := eventArgs at:1. |
|
10124 |
"/ y := eventArgs at:2. |
|
261 | 10125 |
jEv := jComponentEventClass newCleared "basicNew". |
255 | 10126 |
jEv instVarNamed:'id' put:id. |
10127 |
^ Array with:jEv. |
|
10128 |
]. |
|
10129 |
||
10130 |
(type == #terminate) ifTrue:[ |
|
10131 |
jWindowEventClass := Java classForName:'java.awt.event.WindowEvent'. |
|
10132 |
id := (jWindowEventClass instVarNamed:'WINDOW_CLOSED'). |
|
261 | 10133 |
jEv := jWindowEventClass newCleared "basicNew". |
255 | 10134 |
jEv instVarNamed:'id' put:id. |
10135 |
^ Array with:jEv. |
|
10136 |
]. |
|
439 | 10137 |
|
319 | 10138 |
EventTrace == true ifTrue:[ |
10139 |
('JAVA: unhandled event:' , type) infoPrintCR. |
|
10140 |
]. |
|
255 | 10141 |
^ nil. |
10142 |
||
10143 |
"Created: / 6.1.1998 / 20:38:58 / cg" |
|
439 | 10144 |
"Modified: / 12.11.1998 / 18:05:38 / cg" |
255 | 10145 |
! |
10146 |
||
10147 |
doWindowsEventThread |
|
10148 |
"invoked in an endless loop by the WToolkit-eventLoop |
|
10149 |
native method." |
|
10150 |
||
270 | 10151 |
|sensor event more| |
255 | 10152 |
|
10153 |
JavaWindowGroup isNil ifTrue:[ |
|
270 | 10154 |
"/ '*** eventThread: no windowGroup ...' printCR. |
284 | 10155 |
FirstWindowCreationSemaphore wait. |
10156 |
"/ Delay waitForSeconds:0.1. |
|
270 | 10157 |
^ self |
255 | 10158 |
]. |
10159 |
||
10160 |
KnownWindows isNil ifTrue:[ |
|
270 | 10161 |
"/ '*** eventThread: no views ...' printCR. |
284 | 10162 |
FirstWindowCreationSemaphore wait. |
10163 |
"/ Delay waitForSeconds:0.1. |
|
270 | 10164 |
^ self |
255 | 10165 |
]. |
10166 |
||
10167 |
"/ wait for an event to arrive ... |
|
10168 |
||
10169 |
sensor := JavaWindowGroup sensor. |
|
329 | 10170 |
[sensor hasEvents or:[sensor damageCount ~~ 0]] whileFalse:[ |
270 | 10171 |
EventTrace ifTrue:[ |
10172 |
'*** eventThread waiting ...' printCR. |
|
10173 |
]. |
|
10174 |
Processor activeProcess state:#eventWait. |
|
10175 |
sensor eventSemaphore wait. |
|
255 | 10176 |
]. |
10177 |
||
10178 |
EventTrace ifTrue:[ |
|
270 | 10179 |
'*** eventThread event arrived ...' printCR. |
255 | 10180 |
]. |
10181 |
||
10182 |
"/ EventTrace := true |
|
270 | 10183 |
more := true. |
10184 |
[more] whileTrue:[ |
|
10185 |
sensor hasDamage ifTrue:[ |
|
10186 |
EventTrace ifTrue:[ |
|
10187 |
'*** eventThread: damage arrived ...' printCR. |
|
10188 |
]. |
|
10189 |
event := sensor nextDamage. |
|
10190 |
] ifFalse:[ |
|
10191 |
event := sensor nextEvent. |
|
10192 |
]. |
|
10193 |
event isNil ifTrue:[ |
|
319 | 10194 |
EventTrace == true ifTrue:[ |
10195 |
'*** eventThread: nil event ignored' printCR. |
|
10196 |
]. |
|
270 | 10197 |
^ self |
10198 |
]. |
|
10199 |
||
10200 |
more := self processEvent:event |
|
10201 |
] |
|
255 | 10202 |
|
10203 |
"Created: / 6.1.1998 / 21:02:40 / cg" |
|
329 | 10204 |
"Modified: / 5.4.1998 / 16:10:53 / cg" |
255 | 10205 |
! |
10206 |
||
10207 |
processEvent:event |
|
439 | 10208 |
|evQ jEvents jWToolKitClass jWToolKit jWinPeer jWin v eventConsumed| |
255 | 10209 |
|
10210 |
KnownWindows isNil ifTrue:[ |
|
270 | 10211 |
^ false |
255 | 10212 |
]. |
10213 |
||
10214 |
v := event view. |
|
261 | 10215 |
jWinPeer := self jPeerForView:v. |
255 | 10216 |
jWinPeer isNil ifTrue:[ |
261 | 10217 |
(v isKindOf:JavaView) ifTrue:[ |
10218 |
"/ mhmh - an event for a JavaView, |
|
10219 |
"/ which has no peer (anyMore ?) |
|
10220 |
"/ should not happen. |
|
10221 |
] ifFalse:[ |
|
10222 |
"/ mhmh - an event for a subcomponent of an ST widget. |
|
10223 |
"/ let it be handled normally. |
|
255 | 10224 |
EventTrace ifTrue:[ |
261 | 10225 |
('*** eventThread: ' , event type , '-event for unknown java-view - passed to view.') printCR. |
255 | 10226 |
]. |
359 | 10227 |
event view dispatchEvent:event. |
255 | 10228 |
]. |
270 | 10229 |
^ true |
261 | 10230 |
]. |
10231 |
||
10232 |
"/ change: |
|
10233 |
"/ in the previous version, events for ST/X widgets (i.e. buttons etc) |
|
10234 |
"/ where not passed to java, but instead forwarded directly to the widget |
|
10235 |
"/ by the code below. |
|
10236 |
"/ This has changed, to pass it to Java, which eventually passes it to the |
|
10237 |
"/ peer via the handleEvent native method (unless the event got consumed). |
|
10238 |
"/ This is req'd to let java keep track of keyboard/mouse input for widgets. |
|
10239 |
||
10240 |
false ifTrue:[ |
|
10241 |
"/ "/ most views handle their events themself (being ST/X views) ... |
|
10242 |
"/ |
|
10243 |
"/ v class ~~ JavaView ifTrue:[ |
|
10244 |
"/"/ v class ~~ StandardSystemView ifTrue:[ |
|
10245 |
"/"/ EventTrace ifTrue:[ |
|
10246 |
"/"/ ('*** eventThread: event handled by view itself (' , v class name , ')') printCR. |
|
10247 |
"/"/ ]. |
|
10248 |
"/"/ event sendEventWithFocusOn:nil. |
|
10249 |
"/"/ ^ self. |
|
10250 |
"/"/ ]. |
|
10251 |
"/ (event type == #'exposeX:y:width:height' |
|
10252 |
"/ or:[event type == #'graphicsExposeX:y:width:height']) ifTrue:[ |
|
10253 |
"/ "/ send to view, but also handle in JAVA |
|
10254 |
"/ event sendEventWithFocusOn:nil. |
|
10255 |
"/ ] |
|
10256 |
"/ ]. |
|
10257 |
||
10258 |
(#( |
|
10259 |
#'mapped' |
|
10260 |
#'unmapped' |
|
10261 |
#'configureX:y:width:height:' |
|
10262 |
#'exposeX:y:width:height:' |
|
10263 |
#'graphicsExposeX:y:width:height:' |
|
10264 |
) includes:event type) ifTrue:[ |
|
255 | 10265 |
event sendEventWithFocusOn:nil. |
10266 |
]. |
|
261 | 10267 |
]. |
10268 |
||
10269 |
"/ what a kludge - some events are passed back to |
|
10270 |
"/ ST via the WComponent-handleEvent native method. |
|
10271 |
"/ However, repaints are not. |
|
10272 |
"/ In order to let ST widgets do the drawing, |
|
10273 |
"/ selectively filter exposeEvents from Java ... |
|
10274 |
||
10275 |
eventConsumed := false. |
|
10276 |
v class == JavaView ifTrue:[ |
|
10277 |
"/ all events handled by Java ... |
|
10278 |
] ifFalse:[ |
|
10279 |
eventConsumed := true. |
|
10280 |
||
10281 |
"/ let widget handle it. |
|
359 | 10282 |
event view dispatchEvent:event. |
261 | 10283 |
|
10284 |
"/ some are not passed to Java ... |
|
10285 |
event isDamage ifTrue:[ |
|
10286 |
(v isKindOf:TextView) ifTrue:[ |
|
270 | 10287 |
^ true |
10288 |
]. |
|
10289 |
(v isKindOf:Label) ifTrue:[ |
|
10290 |
^ true |
|
10291 |
]. |
|
10292 |
(v isKindOf:ComboBoxView) ifTrue:[ |
|
10293 |
^ true |
|
10294 |
]. |
|
10295 |
(v isKindOf:ScrollBar) ifTrue:[ |
|
261 | 10296 |
^ self |
10297 |
]. |
|
270 | 10298 |
(v isKindOf:Scroller) ifTrue:[ |
261 | 10299 |
^ self |
10300 |
]. |
|
270 | 10301 |
(v isKindOf:MenuPanel) ifTrue:[ |
10302 |
^ true |
|
10303 |
]. |
|
261 | 10304 |
]. |
10305 |
]. |
|
255 | 10306 |
|
10307 |
jWin := jWinPeer instVarNamed:'target'. |
|
10308 |
||
10309 |
EventTrace ifTrue:[ |
|
10310 |
('*** eventThread: event (' , event type , ') handled by JAVA: ') infoPrint. |
|
10311 |
jWinPeer class name infoPrint. ' (' infoPrint. |
|
10312 |
jWin class name infoPrint. ')' infoPrintCR. |
|
10313 |
]. |
|
10314 |
||
10315 |
"/ create an event |
|
10316 |
||
10317 |
jEvents := self awtEventsForEvent:event javaWindow:jWin. |
|
10318 |
jEvents isNil ifTrue:[ |
|
10319 |
EventTrace ifTrue:[ |
|
10320 |
('*** eventThread: event ignored: ' , event type) printCR. |
|
10321 |
]. |
|
270 | 10322 |
^ true |
255 | 10323 |
]. |
10324 |
||
10325 |
"/ v superView isNil ifTrue:[ |
|
10326 |
"/ ('*** eventThread: event ignored for topView: ' , event type) printCR. |
|
10327 |
"/ ^ self |
|
10328 |
"/ ]. |
|
10329 |
||
439 | 10330 |
jWToolKitClass := Java classForName:'java.awt.Toolkit'. |
10331 |
"/ jWToolKit := jWToolKitClass perform:#getDefaultToolkit. |
|
10332 |
jWToolKit := jWToolKitClass performStatic:#'getDefaultToolkit()Ljava/awt/Toolkit;'. |
|
255 | 10333 |
|
10334 |
jEvents do:[:jEv | |
|
10335 |
jEv instVarNamed:'source' put:jWin. |
|
10336 |
jEv instVarNamed:'consumed' put:0. |
|
261 | 10337 |
eventConsumed ifFalse:[ |
10338 |
"/ the first gets the original event as data |
|
10339 |
jEv instVarNamed:'data' put:event. |
|
10340 |
eventConsumed := true |
|
10341 |
]. |
|
255 | 10342 |
|
10343 |
"/ post it (them) to the event queue |
|
318 | 10344 |
EventTrace == true ifTrue:[ |
10345 |
'postEvent to Java ...' printCR. |
|
10346 |
]. |
|
439 | 10347 |
jWToolKit "class" perform:#'postEvent(Ljava/awt/AWTEvent;)V' with:jEv. |
255 | 10348 |
]. |
10349 |
||
270 | 10350 |
^ false |
10351 |
||
255 | 10352 |
"Created: / 6.1.1998 / 20:36:36 / cg" |
439 | 10353 |
"Modified: / 12.11.1998 / 16:30:09 / cg" |
255 | 10354 |
! ! |
10355 |
||
253 | 10356 |
!JavaVM class methodsFor:'documentation'! |
10357 |
||
10358 |
version |
|
460 | 10359 |
^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaVM.st,v 1.75 1998/11/23 20:15:44 cg Exp $' |
253 | 10360 |
! ! |
10361 |
JavaVM initialize! |