author | cg |
Fri, 04 Dec 1998 14:37:29 +0000 | |
changeset 482 | 08fd07acb9b7 |
parent 480 | 9aec33a9e04d |
child 483 | bdb1ad03c3f1 |
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 |
||
480 | 15 |
Object variableSubclass:#JavaVM |
253 | 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 |
474 | 27 |
OpenFileTable CachedNativeMethodTable ExceptionDebug ExitDebug |
390 | 28 |
JavaConsoleStream StandardThreadGroup EnteredMonitorsPerProcess |
29 |
JavaClasses JavaMethods DUMMY_LONG_HIGHWORD DUMMY_DOUBLE_HIGHWORD |
|
442 | 30 |
NoAudio FirstWindowCreationSemaphore ScreenUpdaterProcess |
474 | 31 |
PermittedDirectories SimulatedOS O_WGgraphics_originX |
32 |
O_WGgraphics_originY O_WGgraphics_pData O_FramePeer_pNativeWidget |
|
33 |
O_FramePeer_pData' |
|
253 | 34 |
poolDictionaries:'' |
35 |
category:'Java-Support' |
|
36 |
! |
|
37 |
||
261 | 38 |
!JavaVM class methodsFor:'documentation'! |
39 |
||
454 | 40 |
copyright |
41 |
" |
|
42 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
43 |
All Rights Reserved |
|
44 |
||
45 |
This software is furnished under a license and may be used |
|
46 |
only in accordance with the terms of that license and with the |
|
47 |
inclusion of the above copyright notice. This software may not |
|
48 |
be provided or otherwise made available to, or used by, any |
|
49 |
other person. No title to or ownership of the software is |
|
50 |
hereby transferred. |
|
51 |
" |
|
52 |
||
53 |
||
54 |
! |
|
55 |
||
261 | 56 |
nativeMethods |
57 |
" |
|
440 | 58 |
all native methods: |
59 |
||
60 |
JavaMethod allSubInstances select:[:m | |
|
61 |
m isNative |
|
62 |
] |
|
63 |
||
64 |
implemented methods: |
|
65 |
||
66 |
JavaMethod allSubInstances select:[:m | |
|
67 |
|sel| |
|
68 |
||
69 |
m isNative ifTrue:[ |
|
70 |
sel := ('_' , m javaClass lastName , '_' , m name , ':') asSymbol. |
|
71 |
JavaVM class implements:sel. |
|
72 |
] ifFalse:[ |
|
73 |
false |
|
74 |
] |
|
75 |
] |
|
76 |
||
77 |
unimplemented methods: |
|
78 |
||
79 |
JavaMethod allSubInstances select:[:m | |
|
80 |
|sel| |
|
81 |
||
82 |
m isNative ifTrue:[ |
|
83 |
sel := ('_' , m javaClass lastName , '_' , m name , ':') asSymbol. |
|
84 |
(JavaVM class implements:sel) not |
|
85 |
] ifFalse:[ |
|
86 |
false |
|
87 |
] |
|
88 |
] |
|
89 |
||
90 |
||
261 | 91 |
list of all native methods as in jdk1.1.3: |
92 |
||
93 |
X - implemented |
|
94 |
x - implemented with limited functionality |
|
95 |
o - implemented as dummy (no functionality) |
|
96 |
||
97 |
X (Math::double sin (double)) |
|
98 |
X (Math::double cos (double)) |
|
342 | 99 |
X (Math::double tan (double)) |
100 |
X (Math::double asin (double)) |
|
101 |
X (Math::double acos (double)) |
|
102 |
X (Math::double atan (double)) |
|
103 |
X (Math::double exp (double)) |
|
261 | 104 |
X (Math::double log (double)) |
105 |
X (Math::double sqrt (double)) |
|
106 |
(Math::double IEEEremainder (double double)) |
|
107 |
X (Math::double ceil (double)) |
|
108 |
X (Math::double floor (double)) |
|
109 |
(Math::double rint (double)) |
|
110 |
(Math::double atan2 (double double)) |
|
111 |
X (Math::double pow (double double)) |
|
112 |
||
113 |
X (Class::java.lang.Class forName (java.lang.String)) |
|
114 |
X (Class::java.lang.Object newInstance ()) |
|
115 |
(Class::boolean isInstance (java.lang.Object)) |
|
116 |
(Class::boolean isAssignableFrom (java.lang.Class)) |
|
117 |
X (Class::boolean isInterface ()) |
|
118 |
(Class::boolean isArray ()) |
|
342 | 119 |
X (Class::boolean isPrimitive ()) |
261 | 120 |
X (Class::java.lang.String getName ()) |
121 |
X (Class::java.lang.ClassLoader getClassLoader ()) |
|
122 |
X (Class::java.lang.Class getSuperclass ()) |
|
123 |
(Class::java.lang.Class[] getInterfaces ()) |
|
124 |
(Class::java.lang.Class getComponentType ()) |
|
125 |
(Class::int getModifiers ()) |
|
126 |
(Class::java.lang.Object[] getSigners ()) |
|
127 |
(Class::void setSigners (java.lang.Object[])) |
|
128 |
X (Class::java.lang.Class getPrimitiveClass (java.lang.String)) |
|
129 |
(Class::java.lang.reflect.Field[] getFields0 (int)) |
|
342 | 130 |
X (Class::java.lang.reflect.Method[] getMethods0 (int)) |
261 | 131 |
(Class::java.lang.reflect.Constructor[] getConstructors0 (int)) |
132 |
(Class::java.lang.reflect.Field getField0 (java.lang.String int)) |
|
342 | 133 |
X (Class::java.lang.reflect.Method getMethod0 (java.lang.String java.lang.Class[] int)) |
261 | 134 |
(Class::java.lang.reflect.Constructor getConstructor0 (java.lang.Class[] int)) |
135 |
||
136 |
X (InetAddressImpl::java.lang.String getLocalHostName ()) |
|
137 |
X (InetAddressImpl::void makeAnyLocalAddress (java.net.InetAddress)) |
|
138 |
X (InetAddressImpl::byte[][] lookupAllHostAddr (java.lang.String)) |
|
139 |
(InetAddressImpl::java.lang.String getHostByAddr (int)) |
|
140 |
X (InetAddressImpl::int getInetFamily ()) |
|
141 |
||
142 |
X (ResourceBundle::java.lang.Class[] getClassContext ()) |
|
143 |
||
144 |
X (System::void setIn0 (java.io.InputStream)) |
|
145 |
X (System::void setOut0 (java.io.PrintStream)) |
|
146 |
X (System::void setErr0 (java.io.PrintStream)) |
|
147 |
X (System::long currentTimeMillis ()) |
|
148 |
X (System::void arraycopy (java.lang.Object int java.lang.Object int int)) |
|
149 |
(System::int identityHashCode (java.lang.Object)) |
|
150 |
X (System::java.util.Properties initProperties (java.util.Properties)) |
|
151 |
||
152 |
X (Thread::java.lang.Thread currentThread ()) |
|
153 |
X (Thread::void yield ()) |
|
154 |
X (Thread::void sleep (long)) |
|
155 |
X (Thread::void start ()) |
|
156 |
X (Thread::boolean isInterrupted (boolean)) |
|
157 |
X (Thread::boolean isAlive ()) |
|
158 |
(Thread::int countStackFrames ()) |
|
159 |
X (Thread::void setPriority0 (int)) |
|
160 |
X (Thread::void stop0 (java.lang.Object)) |
|
161 |
X (Thread::void suspend0 ()) |
|
162 |
X (Thread::void resume0 ()) |
|
163 |
(Thread::void interrupt0 ()) |
|
164 |
||
342 | 165 |
(String::java.lang.String intern ()) |
261 | 166 |
|
167 |
X (Float::int floatToIntBits (float)) |
|
168 |
X (Float::float intBitsToFloat (int)) |
|
169 |
||
170 |
(ObjectStreamClass::int getClassAccess (java.lang.Class)) |
|
171 |
(ObjectStreamClass::java.lang.String[] getMethodSignatures (java.lang.Class)) |
|
172 |
(ObjectStreamClass::int getMethodAccess (java.lang.Class java.lang.String)) |
|
173 |
(ObjectStreamClass::java.lang.String[] getFieldSignatures (java.lang.Class)) |
|
174 |
(ObjectStreamClass::int getFieldAccess (java.lang.Class java.lang.String)) |
|
175 |
(ObjectStreamClass::java.io.ObjectStreamField[] getFields0 (java.lang.Class)) |
|
176 |
(ObjectStreamClass::long getSerialVersionUID (java.lang.Class)) |
|
177 |
(ObjectStreamClass::boolean hasWriteObject (java.lang.Class)) |
|
178 |
(ObjectInputStream::java.lang.Class loadClass0 (java.lang.Class java.lang.String)) |
|
179 |
(ObjectInputStream::void inputClassFields (java.lang.Object java.lang.Class int[])) |
|
180 |
(ObjectInputStream::java.lang.Object allocateNewObject (java.lang.Class java.lang.Class)) |
|
181 |
(ObjectInputStream::java.lang.Object allocateNewArray (java.lang.Class int)) |
|
182 |
(ObjectInputStream::boolean invokeObjectReader (java.lang.Object java.lang.Class)) |
|
183 |
||
184 |
(SecurityManager::java.lang.Class[] getClassContext ()) |
|
185 |
X (SecurityManager::java.lang.ClassLoader currentClassLoader ()) |
|
186 |
(SecurityManager::int classDepth (java.lang.String)) |
|
187 |
X (SecurityManager::int classLoaderDepth ()) |
|
188 |
(SecurityManager::java.lang.Class currentLoadedClass0 ()) |
|
189 |
||
190 |
X (ClassLoader::void init ()) |
|
191 |
X (ClassLoader::java.lang.Class defineClass0 (java.lang.String byte[] int int)) |
|
192 |
X (ClassLoader::void resolveClass0 (java.lang.Class)) |
|
193 |
X (ClassLoader::java.lang.Class findSystemClass0 (java.lang.String)) |
|
194 |
X (ClassLoader::java.io.InputStream getSystemResourceAsStream0 (java.lang.String)) |
|
195 |
(ClassLoader::java.lang.String getSystemResourceAsName0 (java.lang.String)) |
|
196 |
||
197 |
(FileDescriptor::boolean valid ()) |
|
198 |
(FileDescriptor::void sync ()) |
|
199 |
X (FileDescriptor::java.io.FileDescriptor initSystemFD (java.io.FileDescriptor int)) |
|
200 |
||
201 |
X (Object::java.lang.Class getClass ()) |
|
202 |
X (Object::int hashCode ()) |
|
203 |
X (Object::java.lang.Object clone ()) |
|
204 |
X (Object::void notify ()) |
|
205 |
X (Object::void notifyAll ()) |
|
206 |
X (Object::void wait (long)) |
|
207 |
||
208 |
X (FileOutputStream::void open (java.lang.String)) |
|
342 | 209 |
X (FileOutputStream::void openAppend (java.lang.String)) |
261 | 210 |
X (FileOutputStream::void write (int)) |
211 |
X (FileOutputStream::void writeBytes (byte[] int int)) |
|
212 |
X (FileOutputStream::void close ()) |
|
213 |
X (FileInputStream::void open (java.lang.String)) |
|
214 |
X (FileInputStream::int read ()) |
|
215 |
X (FileInputStream::int readBytes (byte[] int int)) |
|
216 |
(FileInputStream::long skip (long)) |
|
217 |
X (FileInputStream::int available ()) |
|
218 |
X (FileInputStream::void close ()) |
|
219 |
||
220 |
(VM::int getState ()) |
|
221 |
(VM::boolean threadsSuspended ()) |
|
222 |
(VM::void unsuspendThreads ()) |
|
223 |
(VM::void unsuspendSomeThreads ()) |
|
224 |
||
225 |
X (File::boolean exists0 ()) |
|
342 | 226 |
X (File::boolean canWrite0 ()) |
261 | 227 |
X (File::boolean canRead0 ()) |
228 |
X (File::boolean isFile0 ()) |
|
229 |
X (File::boolean isDirectory0 ()) |
|
342 | 230 |
X (File::long lastModified0 ()) |
261 | 231 |
X (File::long length0 ()) |
342 | 232 |
X (File::boolean mkdir0 ()) |
261 | 233 |
(File::boolean renameTo0 (java.io.File)) |
234 |
(File::boolean delete0 ()) |
|
235 |
(File::boolean rmdir0 ()) |
|
236 |
X (File::java.lang.String[] list0 ()) |
|
237 |
(File::java.lang.String canonPath (java.lang.String)) |
|
238 |
X (File::boolean isAbsolute ()) |
|
239 |
||
240 |
(ObjectOutputStream::void outputClassFields (java.lang.Object java.lang.Class int[])) |
|
241 |
(ObjectOutputStream::boolean invokeObjectWriter (java.lang.Object java.lang.Class)) |
|
242 |
||
243 |
X (Throwable::void printStackTrace0 (java.lang.Object)) |
|
244 |
X (Throwable::java.lang.Throwable fillInStackTrace ()) |
|
245 |
||
246 |
X (Double::long doubleToLongBits (double)) |
|
247 |
X (Double::double longBitsToDouble (long)) |
|
248 |
X (Double::double valueOf0 (java.lang.String)) |
|
249 |
||
250 |
X (Runtime::void exitInternal (int)) |
|
251 |
(Runtime::void runFinalizersOnExit0 (boolean)) |
|
252 |
o (Runtime::java.lang.Process execInternal (java.lang.String[] java.lang.String[])) |
|
253 |
X (Runtime::long freeMemory ()) |
|
254 |
X (Runtime::long totalMemory ()) |
|
255 |
X (Runtime::void gc ()) |
|
256 |
(Runtime::void runFinalization ()) |
|
257 |
(Runtime::void traceInstructions (boolean)) |
|
258 |
(Runtime::void traceMethodCalls (boolean)) |
|
259 |
X (Runtime::java.lang.String initializeLinkerInternal ()) |
|
260 |
X (Runtime::java.lang.String buildLibName (java.lang.String java.lang.String)) |
|
261 |
X (Runtime::int loadFileInternal (java.lang.String)) |
|
262 |
||
263 |
(WDrawingSurfaceInfo::int lock ()) |
|
264 |
(WDrawingSurfaceInfo::void unlock ()) |
|
265 |
(WDrawingSurfaceInfo::int getHWnd ()) |
|
266 |
(WDrawingSurfaceInfo::int getHBitmap ()) |
|
267 |
(WDrawingSurfaceInfo::int getPBits ()) |
|
268 |
(WDrawingSurfaceInfo::int getHDC ()) |
|
269 |
(WDrawingSurfaceInfo::int getDepth ()) |
|
270 |
(WDrawingSurfaceInfo::int getHPalette ()) |
|
271 |
||
272 |
X (WDefaultFontCharset::boolean canConvert (char)) |
|
273 |
||
274 |
(ColorModel::void deletepData ()) |
|
275 |
X (WToolkit::void init (java.lang.Thread)) |
|
276 |
X (WToolkit::void eventLoop ()) |
|
277 |
(WToolkit::java.awt.image.ColorModel makeColorModel ()) |
|
342 | 278 |
X (WToolkit::int getScreenResolution ()) |
261 | 279 |
X (WToolkit::int getScreenWidth ()) |
280 |
X (WToolkit::int getScreenHeight ()) |
|
281 |
(WToolkit::void sync ()) |
|
282 |
(WToolkit::void beep ()) |
|
283 |
X (WToolkit::void loadSystemColors (int[])) |
|
284 |
||
285 |
(WPrintJob::void end ()) |
|
286 |
||
287 |
X (WDialogPeer::void create (sun.awt.windows.WComponentPeer)) |
|
288 |
X (WDialogPeer::void _show ()) |
|
289 |
X (WDialogPeer::void _hide ()) |
|
290 |
||
342 | 291 |
X (WWindowPeer::void toFront ()) |
292 |
X (WWindowPeer::void toBack ()) |
|
293 |
X (WWindowPeer::void _setTitle (java.lang.String)) |
|
294 |
X (WWindowPeer::void _setResizable (boolean)) |
|
261 | 295 |
(WWindowPeer::void create (sun.awt.windows.WComponentPeer)) |
342 | 296 |
o (WWindowPeer::void updateInsets (java.awt.Insets)) |
261 | 297 |
(WWindowPeer::java.awt.Component getContainerElement (java.awt.Container int)) |
298 |
||
299 |
X (WCanvasPeer::void create (sun.awt.windows.WComponentPeer)) |
|
300 |
||
301 |
X (WTextAreaPeer::void create (sun.awt.windows.WComponentPeer)) |
|
302 |
X (WTextAreaPeer::void insertText (java.lang.String int)) |
|
303 |
(WTextAreaPeer::void replaceText (java.lang.String int int)) |
|
304 |
||
305 |
X (WTextComponentPeer::java.lang.String getText ()) |
|
306 |
X (WTextComponentPeer::void setText (java.lang.String)) |
|
307 |
X (WTextComponentPeer::int getSelectionStart ()) |
|
308 |
X (WTextComponentPeer::int getSelectionEnd ()) |
|
309 |
X (WTextComponentPeer::void select (int int)) |
|
310 |
X (WTextComponentPeer::void enableEditing (boolean)) |
|
311 |
||
312 |
X (WComponentPeer::void show ()) |
|
313 |
X (WComponentPeer::void hide ()) |
|
314 |
X (WComponentPeer::void enable ()) |
|
315 |
X (WComponentPeer::void disable ()) |
|
316 |
(WComponentPeer::java.awt.Point getLocationOnScreen ()) |
|
317 |
X (WComponentPeer::void reshape (int int int int)) |
|
318 |
o (WComponentPeer::void handleEvent (java.awt.AWTEvent)) |
|
319 |
o (WComponentPeer::void _dispose ()) |
|
320 |
X (WComponentPeer::void _setForeground (int)) |
|
321 |
X (WComponentPeer::void _setBackground (int)) |
|
322 |
o (WComponentPeer::void setFont (java.awt.Font)) |
|
323 |
o (WComponentPeer::void requestFocus ()) |
|
324 |
o (WComponentPeer::void setCursor (java.awt.Cursor)) |
|
325 |
o (WComponentPeer::void start ()) |
|
326 |
(WComponentPeer::void _beginValidate ()) |
|
327 |
(WComponentPeer::void endValidate ()) |
|
328 |
o (WComponentPeer::void setZOrderPosition (sun.awt.windows.WComponentPeer)) |
|
329 |
||
330 |
X (WFramePeer::void setMenuBar0 (sun.awt.windows.WMenuBarPeer)) |
|
331 |
X (WFramePeer::void create (sun.awt.windows.WComponentPeer)) |
|
342 | 332 |
X (WFramePeer::void _setIconImage (sun.awt.image.ImageRepresentation)) |
261 | 333 |
|
334 |
o (WFontMetrics::boolean needsConversion (java.awt.Font sun.awt.FontDescriptor)) |
|
335 |
o (WFontMetrics::int getMFCharSegmentWidth (java.awt.Font sun.awt.FontDescriptor boolean char[] int int byte[] int)) |
|
336 |
(WFontMetrics::int bytesWidth (byte[] int int)) |
|
337 |
(WFontMetrics::void init ()) |
|
338 |
||
339 |
o (WChoicePeer::void select (int)) |
|
340 |
o (WChoicePeer::void remove (int)) |
|
341 |
o (WChoicePeer::void addItem (java.lang.String int)) |
|
342 |
X (WChoicePeer::void reshape (int int int int)) |
|
343 |
X (WChoicePeer::void create (sun.awt.windows.WComponentPeer)) |
|
344 |
||
345 |
X (WLabelPeer::void setText (java.lang.String)) |
|
346 |
o (WLabelPeer::void setAlignment (int)) |
|
347 |
X (WLabelPeer::void create (sun.awt.windows.WComponentPeer)) |
|
348 |
||
349 |
X (WMenuItemPeer::void _setLabel (java.lang.String)) |
|
350 |
X (WMenuItemPeer::void create (sun.awt.windows.WMenuPeer)) |
|
351 |
X (WMenuItemPeer::void enable (boolean)) |
|
342 | 352 |
o (WMenuItemPeer::void _dispose ()) |
261 | 353 |
(WMenuPeer::void addSeparator ()) |
354 |
(WMenuPeer::void delItem (int)) |
|
355 |
X (WMenuPeer::void createMenu (sun.awt.windows.WMenuBarPeer)) |
|
356 |
(WMenuPeer::void createSubMenu (sun.awt.windows.WMenuPeer)) |
|
357 |
||
358 |
(WPopupMenuPeer::void createMenu (sun.awt.windows.WComponentPeer)) |
|
359 |
(WPopupMenuPeer::void _show (java.awt.Event)) |
|
360 |
(WMenuBarPeer::void addMenu (java.awt.Menu)) |
|
361 |
(WMenuBarPeer::void delMenu (int)) |
|
362 |
X (WMenuBarPeer::void create (sun.awt.windows.WFramePeer)) |
|
363 |
||
364 |
(WCheckboxMenuItemPeer::void setState (boolean)) |
|
365 |
||
366 |
X (WFileDialogPeer::void show ()) |
|
367 |
||
368 |
X (WCheckboxPeer::void setState (boolean)) |
|
369 |
X (WCheckboxPeer::void setCheckboxGroup (java.awt.CheckboxGroup)) |
|
370 |
(WCheckboxPeer::void setLabel (java.lang.String)) |
|
371 |
X (WCheckboxPeer::void create (sun.awt.windows.WComponentPeer)) |
|
372 |
||
373 |
X (WClipboard::void init ()) |
|
374 |
(WClipboard::void setClipboardText (java.awt.datatransfer.StringSelection)) |
|
375 |
(WClipboard::java.lang.String getClipboardText ()) |
|
376 |
||
342 | 377 |
X (WListPeer::void addItem (java.lang.String int)) |
378 |
X (WListPeer::void delItems (int int)) |
|
379 |
X (WListPeer::void select (int)) |
|
261 | 380 |
(WListPeer::void deselect (int)) |
381 |
(WListPeer::void makeVisible (int)) |
|
342 | 382 |
X (WListPeer::void setMultipleSelections (boolean)) |
383 |
X (WListPeer::void create (sun.awt.windows.WComponentPeer)) |
|
384 |
X (WListPeer::boolean isSelected (int)) |
|
385 |
||
386 |
x (WScrollbarPeer::void _setValues (int int int int)) |
|
387 |
x (WScrollbarPeer::void setLineIncrement (int)) |
|
388 |
x (WScrollbarPeer::void setPageIncrement (int)) |
|
389 |
x (WScrollbarPeer::void create (sun.awt.windows.WComponentPeer)) |
|
390 |
||
391 |
x (ImageRepresentation::void offscreenInit (java.awt.Color)) |
|
261 | 392 |
x (ImageRepresentation::boolean setBytePixels (int int int int java.awt.image.ColorModel byte[] int int)) |
342 | 393 |
x (ImageRepresentation::boolean setIntPixels (int int int int java.awt.image.ColorModel int[] int int)) |
261 | 394 |
x (ImageRepresentation::boolean finish (boolean)) |
395 |
X (ImageRepresentation::void imageDraw (java.awt.Graphics int int java.awt.Color)) |
|
396 |
x (ImageRepresentation::void imageStretch (java.awt.Graphics int int int int int int int int java.awt.Color)) |
|
397 |
x (ImageRepresentation::void disposeImage ()) |
|
398 |
||
399 |
X (WTextFieldPeer::void create (sun.awt.windows.WComponentPeer)) |
|
342 | 400 |
X (WTextFieldPeer::void setEchoCharacter (char)) |
401 |
||
402 |
X (WScrollPanePeer::void create (sun.awt.windows.WComponentPeer)) |
|
403 |
o (WScrollPanePeer::int getOffset (int)) |
|
261 | 404 |
(WScrollPanePeer::void setInsets ()) |
405 |
(WScrollPanePeer::void setScrollPosition (int int)) |
|
342 | 406 |
x (WScrollPanePeer::int _getHScrollbarHeight ()) |
407 |
x (WScrollPanePeer::int _getVScrollbarWidth ()) |
|
408 |
o (WScrollPanePeer::void setSpans (int int int int)) |
|
261 | 409 |
(WScrollPanePeer::java.awt.Component getScrollChild ()) |
410 |
||
411 |
(WEmbeddedFramePeer::void create (sun.awt.windows.WComponentPeer)) |
|
342 | 412 |
X (WButtonPeer::void setLabel (java.lang.String)) |
261 | 413 |
X (WButtonPeer::void create (sun.awt.windows.WComponentPeer)) |
414 |
||
415 |
x (WColor::java.awt.Color getDefaultColor (int)) |
|
416 |
||
417 |
x (GifImageDecoder::boolean parseImage (int int int int boolean int byte[] byte[] java.awt.image.IndexColorModel)) |
|
418 |
||
419 |
x (WGraphics::void createFromComponent (sun.awt.windows.WComponentPeer)) |
|
420 |
x (WGraphics::void createFromGraphics (sun.awt.windows.WGraphics)) |
|
421 |
(WGraphics::void createFromPrintJob (sun.awt.windows.WPrintJob)) |
|
422 |
(WGraphics::void createFromHDC (int)) |
|
423 |
x (WGraphics::void imageCreate (sun.awt.image.ImageRepresentation)) |
|
424 |
x (WGraphics::void pSetFont (java.awt.Font)) |
|
425 |
X (WGraphics::void pSetForeground (int)) |
|
426 |
(WGraphics::void _dispose ()) |
|
427 |
x (WGraphics::void dispose ()) |
|
428 |
x (WGraphics::void setPaintMode ()) |
|
342 | 429 |
x (WGraphics::void setXORMode (java.awt.Color)) |
261 | 430 |
o (WGraphics::java.awt.Rectangle getClipBounds ()) |
431 |
o (WGraphics::void changeClip (int int int int boolean)) |
|
432 |
(WGraphics::void removeClip ()) |
|
433 |
X (WGraphics::void clearRect (int int int int)) |
|
434 |
X (WGraphics::void fillRect (int int int int)) |
|
435 |
X (WGraphics::void drawRect (int int int int)) |
|
436 |
(WGraphics::void drawSFChars (char[] int int int int)) |
|
437 |
x (WGraphics::int drawMFCharsSegment (java.awt.Font sun.awt.FontDescriptor char[] int int int int)) |
|
438 |
(WGraphics::int drawMFCharsConvertedSegment (java.awt.Font sun.awt.FontDescriptor byte[] int int int)) |
|
439 |
(WGraphics::void drawBytes (byte[] int int int int)) |
|
440 |
X (WGraphics::void drawLine (int int int int)) |
|
342 | 441 |
X (WGraphics::void copyArea (int int int int int int)) |
261 | 442 |
o (WGraphics::void drawRoundRect (int int int int int int)) |
443 |
o (WGraphics::void fillRoundRect (int int int int int int)) |
|
444 |
X (WGraphics::void drawPolygon (int[] int[] int)) |
|
445 |
(WGraphics::void drawPolyline (int[] int[] int)) |
|
446 |
X (WGraphics::void fillPolygon (int[] int[] int)) |
|
447 |
x (WGraphics::void drawOval (int int int int)) |
|
448 |
x (WGraphics::void fillOval (int int int int)) |
|
449 |
x (WGraphics::void drawArc (int int int int int int)) |
|
450 |
x (WGraphics::void fillArc (int int int int int int)) |
|
451 |
(WGraphics::void print (sun.awt.windows.WComponentPeer)) |
|
452 |
(WGraphics::void close (sun.awt.windows.WPrintJob)) |
|
453 |
(JPEGImageDecoder::void readImage (java.io.InputStream byte[])) |
|
342 | 454 |
o (OffScreenImageSource::void sendPixels ()) |
457 | 455 |
|
456 |
||
457 |
additional native methods added by microsoft (sigh): |
|
458 |
||
459 |
X (java.lang.String::boolean equals (java.lang.String)) |
|
460 |
X (java.lang.String::int length (java.lang.String)) |
|
461 |
o (java.lang.Runtime::void setInputStreamLocalised (java.io.DataInputStream)) |
|
462 |
o (java.lang.Runtime::void setOutputStreamLocalised (java.io.DataOutputStream)) |
|
463 |
||
464 |
(java.lang.String::int compareTo (java.lang.String)) |
|
465 |
(java.lang.String::boolean equalsIgnoreCase (java.lang.String)) |
|
466 |
(java.lang.String::int indexOf (java.lang.String int)) |
|
467 |
(java.lang.String::boolean startsWith (java.lang.String int)) |
|
468 |
(java.lang.String::boolean regionMatches (int java.lang.String int int)) |
|
469 |
(java.lang.String::boolean regionMatches (boolean int java.lang.String int int)) |
|
470 |
(java.lang.String::int lastIndexOf (java.lang.String int)) |
|
471 |
(java.lang.ClassLoader::void resolveClass (java.lang.Class)) |
|
472 |
(java.lang.ClassLoader::java.lang.Class createArrayClass (java.lang.String java.lang.Class)) |
|
473 |
(java.io.PrintStream::boolean isOutputStreamLocalised (java.io.DataOutputStream)) |
|
474 |
(java.lang.Runtime::boolean isOutputStreamLocalised (java.io.DataOutputStream)) |
|
475 |
(java.lang.Runtime::boolean isInputStreamLocalised (java.io.DataInputStream)) |
|
476 |
(java.lang.ThreadGroup::void initMainThreadGroup0 (java.lang.ThreadGroup)) |
|
477 |
(java.lang.System::void validateSecurityManager (java.lang.SecurityManager)) |
|
478 |
(java.lang.Class::java.lang.reflect.Method getMethod2 (int java.lang.String java.lang.String)) |
|
479 |
(java.io.ObjectOutputStream::void invokeDefaultWriteObject (java.lang.Object java.lang.Class)) |
|
480 |
(java.io.ObjectOutputStream::void invokeWriteObject (java.lang.Object java.lang.Class)) |
|
481 |
(java.io.ObjectInputStream::void invokeDefaultReadObject (java.lang.Object java.lang.Class)) |
|
482 |
(java.io.ObjectInputStream::void invokeReadObject (java.lang.Object java.lang.Class)) |
|
483 |
(java.util.TimeZone::java.util.TimeZone getWin32TimeZone ()) |
|
484 |
(java.net.InetAddress::java.lang.Object[] lookupHostByName (java.lang.String)) |
|
485 |
(java.net.InetAddress::java.lang.Object[] lookupHostByAddr (int)) |
|
486 |
(java.io.ObjectStreamClass::void doMismatchedRead (java.io.ObjectInputStream java.lang.Object)) |
|
487 |
(java.io.ObjectStreamClass::long getClassDefinedUID (java.lang.Class)) |
|
488 |
(java.io.ObjectStreamClass::boolean findObjectMethod0 (java.lang.Class int)) |
|
489 |
(java.lang.reflect.Method::java.lang.String getDescriptor ()) |
|
490 |
(java.lang.reflect.Array::void setShort (java.lang.Object int unsigned short)) |
|
491 |
(java.lang.reflect.Array::char getChar (java.lang.Object int)) |
|
492 |
(java.lang.reflect.Array::void setChar (java.lang.Object int char)) |
|
493 |
(java.lang.reflect.Array::void setDouble (java.lang.Object int double)) |
|
494 |
(java.lang.reflect.Array::java.lang.Object get (java.lang.Object int)) |
|
495 |
(java.lang.reflect.Array::void set (java.lang.Object int java.lang.Object)) |
|
496 |
(java.lang.reflect.Array::int getInt (java.lang.Object int)) |
|
497 |
(java.lang.reflect.Array::void setInt (java.lang.Object int int)) |
|
498 |
(java.lang.reflect.Array::java.lang.Object multiNewArray (java.lang.Class int[])) |
|
499 |
(java.lang.reflect.Array::boolean getBoolean (java.lang.Object int)) |
|
500 |
(java.lang.reflect.Array::byte getByte (java.lang.Object int)) |
|
501 |
(java.lang.reflect.Array::float getFloat (java.lang.Object int)) |
|
502 |
(java.lang.reflect.Array::void setBoolean (java.lang.Object int boolean)) |
|
503 |
(java.lang.reflect.Array::long getLong (java.lang.Object int)) |
|
504 |
(java.lang.reflect.Array::void setByte (java.lang.Object int byte)) |
|
505 |
(java.lang.reflect.Array::void setLong (java.lang.Object int long)) |
|
506 |
(java.lang.reflect.Array::void setFloat (java.lang.Object int float)) |
|
507 |
(java.lang.reflect.Array::java.lang.Object newArray (java.lang.Class int)) |
|
508 |
(java.lang.reflect.Array::int getLength (java.lang.Object)) |
|
509 |
(java.lang.reflect.Array::unsigned short getShort (java.lang.Object int)) |
|
510 |
(java.lang.reflect.Array::double getDouble (java.lang.Object int)) |
|
511 |
(java.lang.reflect.Field::void setShort (java.lang.Object unsigned short)) |
|
512 |
(java.lang.reflect.Field::char getChar (java.lang.Object)) |
|
513 |
(java.lang.reflect.Field::void setChar (java.lang.Object char)) |
|
514 |
(java.lang.reflect.Field::void setDouble (java.lang.Object double)) |
|
515 |
(java.lang.reflect.Field::java.lang.Object get (java.lang.Object)) |
|
516 |
(java.lang.reflect.Field::void set (java.lang.Object java.lang.Object)) |
|
517 |
(java.lang.reflect.Field::int getInt (java.lang.Object)) |
|
518 |
(java.lang.reflect.Field::void setInt (java.lang.Object int)) |
|
519 |
(java.lang.reflect.Field::boolean getBoolean (java.lang.Object)) |
|
520 |
(java.lang.reflect.Field::byte getByte (java.lang.Object)) |
|
521 |
(java.lang.reflect.Field::float getFloat (java.lang.Object)) |
|
522 |
(java.lang.reflect.Field::long getLong (java.lang.Object)) |
|
523 |
(java.lang.reflect.Field::void setBoolean (java.lang.Object boolean)) |
|
524 |
(java.lang.reflect.Field::void setByte (java.lang.Object byte)) |
|
525 |
(java.lang.reflect.Field::void setLong (java.lang.Object long)) |
|
526 |
(java.lang.reflect.Field::void setFloat (java.lang.Object float)) |
|
527 |
(java.lang.reflect.Field::int getModifiers ()) |
|
528 |
(java.lang.reflect.Field::unsigned short getShort (java.lang.Object)) |
|
529 |
(java.lang.reflect.Field::double getDouble (java.lang.Object)) |
|
530 |
(java.lang.reflect.Constructor::java.lang.Object newInstance (java.lang.Object[])) |
|
531 |
(java.lang.reflect.Constructor::int getModifiers ()) |
|
532 |
(java.util.zip.Inflater::void setDictionary0 (byte[] int int)) |
|
533 |
(java.util.zip.Inflater::int getTotalIn0 ()) |
|
534 |
(java.util.zip.Inflater::void reset0 ()) |
|
535 |
(java.util.zip.Inflater::void end0 ()) |
|
536 |
(java.util.zip.Inflater::int inflate0 (byte[] int int)) |
|
537 |
(java.util.zip.Inflater::int getTotalOut0 ()) |
|
538 |
(java.util.zip.Inflater::int getAdler0 ()) |
|
539 |
(java.util.zip.CRC32::void update1 (int)) |
|
540 |
(java.util.zip.CRC32::void update (byte[] int int)) |
|
541 |
||
542 |
(com.ms.security.PolicyEngine::boolean isSystemClass (java.lang.String)) |
|
543 |
(com.ms.security.PolicyEngine::void denyPermission (com.ms.security.PermissionID)) |
|
544 |
(com.ms.security.PolicyEngine::void revertPermission (com.ms.security.PermissionID)) |
|
545 |
(com.ms.security.PolicyEngine::void initPolicyEngine ()) |
|
546 |
(com.ms.security.PolicyEngine::java.lang.Class _getClassOfCaller (java.lang.Class[])) |
|
547 |
(com.ms.security.PolicyEngine::void internalCheckClass (java.lang.Class com.ms.security.PermissionID java.lang.Object)) |
|
548 |
(com.ms.security.PolicyEngine::com.ms.security.PermissionDataSet getPermissionsOfClass (java.lang.Class)) |
|
549 |
(com.ms.security.PolicyEngine::void assertPermission (com.ms.security.PermissionID)) |
|
550 |
(com.ms.security.PolicyEngine::void deepCheck (com.ms.security.PermissionID java.lang.Object)) |
|
551 |
(com.ms.security.PolicyEngine::void shallowCheck (com.ms.security.PermissionID java.lang.Object java.lang.Class[] int)) |
|
552 |
(com.ms.security.PolicyEngine::java.security.Principal getPrincipalOfClass (java.lang.Class)) |
|
553 |
(com.ms.security.permissions.ThreadPermission::boolean pDecodeAsn (byte[])) |
|
554 |
(com.ms.security.permissions.ThreadPermission::byte[] pEncodeAsn ()) |
|
555 |
(com.ms.security.permissions.RegistryPermission::boolean pDecodeAsn (byte[])) |
|
556 |
(com.ms.security.permissions.RegistryPermission::byte[] pEncodeAsn ()) |
|
557 |
(com.ms.security.management.ZonePermissions::byte[] pEncodeAsn ()) |
|
558 |
(com.ms.security.management.ZonePermissions::boolean pDecodeAsn (byte[])) |
|
559 |
(com.ms.security.permissions.UIPermission::byte[] pEncodeAsn ()) |
|
560 |
(com.ms.security.permissions.UIPermission::boolean pDecodeAsn (byte[])) |
|
561 |
(com.ms.security.permissions.NetIOPermission::byte[] pEncodeAsn ()) |
|
562 |
(com.ms.security.permissions.NetIOPermission::boolean pDecodeAsn (byte[])) |
|
563 |
(com.ms.security.permissions.ReflectionPermission::byte[] pEncodeAsn ()) |
|
564 |
(com.ms.security.permissions.ReflectionPermission::boolean pDecodeAsn (byte[])) |
|
565 |
(com.ms.vm.WeakReference::void storeRef (int java.lang.Object)) |
|
566 |
(com.ms.vm.WeakReference::int allocRef (java.lang.Object)) |
|
567 |
(com.ms.vm.WeakReference::void freeRef (int)) |
|
568 |
(com.ms.vm.WeakReference::java.lang.Object fetchRef (int)) |
|
569 |
(com.ms.dll.DllLib::void CoTaskMemFree (int)) |
|
570 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int float[] int int)) |
|
571 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int double[] int int)) |
|
572 |
(com.ms.dll.DllLib::int numParamBytes0 (java.lang.reflect.Method)) |
|
573 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int java.lang.Object int int)) |
|
574 |
(com.ms.dll.DllLib::void write2 (java.lang.Object int unsigned short)) |
|
575 |
(com.ms.dll.DllLib::void write2 (int int unsigned short)) |
|
576 |
(com.ms.dll.DllLib::void write2 (java.lang.Object int char)) |
|
577 |
(com.ms.dll.DllLib::void write2 (int int char)) |
|
578 |
(com.ms.dll.DllLib::int GlobalAlloc (int int)) |
|
579 |
(com.ms.dll.DllLib::void resize (java.lang.Object int)) |
|
580 |
(com.ms.dll.DllLib::long read8 (java.lang.Object int)) |
|
581 |
(com.ms.dll.DllLib::long read8 (int int)) |
|
582 |
(com.ms.dll.DllLib::int lstrcpy (java.lang.StringBuffer int)) |
|
583 |
(com.ms.dll.DllLib::int lstrlenA (int)) |
|
584 |
(com.ms.dll.DllLib::int read4 (java.lang.Object int)) |
|
585 |
(com.ms.dll.DllLib::int CoTaskMemAlloc (int)) |
|
586 |
(com.ms.dll.DllLib::void write8 (java.lang.Object int long)) |
|
587 |
(com.ms.dll.DllLib::int sizeOf0 (java.lang.Class)) |
|
588 |
(com.ms.dll.DllLib::int getSystemDefaultCharSize ()) |
|
589 |
(com.ms.dll.DllLib::void write8 (int int long)) |
|
590 |
(com.ms.dll.DllLib::int read4 (int int)) |
|
591 |
(com.ms.dll.DllLib::byte read1 (java.lang.Object int)) |
|
592 |
(com.ms.dll.DllLib::byte read1 (int int)) |
|
593 |
(com.ms.dll.DllLib::int lstrlen (int)) |
|
594 |
(com.ms.dll.DllLib::void CopyMemoryAnsi (int java.lang.String int)) |
|
595 |
(com.ms.dll.DllLib::void CopyMemoryAnsi (java.lang.StringBuffer int int)) |
|
596 |
(com.ms.dll.DllLib::boolean isStruct (java.lang.reflect.Field)) |
|
597 |
(com.ms.dll.DllLib::boolean GlobalFree (int)) |
|
598 |
(com.ms.dll.DllLib::void internalAttemptCopyPtrToStruct (int java.lang.Object int int)) |
|
599 |
(com.ms.dll.DllLib::int getLastError ()) |
|
600 |
(com.ms.dll.DllLib::void write4 (java.lang.Object int int)) |
|
601 |
(com.ms.dll.DllLib::void write4 (int int int)) |
|
602 |
(com.ms.dll.DllLib::unsigned short read2 (java.lang.Object int)) |
|
603 |
(com.ms.dll.DllLib::unsigned short read2 (int int)) |
|
604 |
(com.ms.dll.DllLib::void release (java.lang.Object)) |
|
605 |
(com.ms.dll.DllLib::void write1 (java.lang.Object int byte)) |
|
606 |
(com.ms.dll.DllLib::void write1 (int int byte)) |
|
607 |
(com.ms.dll.DllLib::boolean isStructCls (java.lang.Class)) |
|
608 |
(com.ms.dll.DllLib::void prelink (java.lang.reflect.Method)) |
|
609 |
(com.ms.dll.DllLib::void CopyMemoryUni (int java.lang.String int)) |
|
610 |
(com.ms.dll.DllLib::void CopyMemoryUni (java.lang.StringBuffer int int)) |
|
611 |
(com.ms.dll.DllLib::void internalAttemptCopyStructToPtr (java.lang.Object int int int)) |
|
612 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (int int int int)) |
|
613 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (byte[] int int int)) |
|
614 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (char[] int int int)) |
|
615 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (unsigned short[] int int int)) |
|
616 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (int[] int int int)) |
|
617 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (long[] int int int)) |
|
618 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (float[] int int int)) |
|
619 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (double[] int int int)) |
|
620 |
(com.ms.dll.DllLib::void CopyWithSrcOffset (java.lang.Object int int int)) |
|
621 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int int int int)) |
|
622 |
(com.ms.dll.DllLib::int lstrlenW (int)) |
|
623 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int byte[] int int)) |
|
624 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int char[] int int)) |
|
625 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int unsigned short[] int int)) |
|
626 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int int[] int int)) |
|
627 |
(com.ms.dll.DllLib::void CopyWithDstOffset (int long[] int int)) |
|
628 |
(com.ms.dll.DllLib::int internalGetStructAddr (java.lang.Object)) |
|
629 |
(com.ms.dll.DllLib::int offsetOf (java.lang.reflect.Field)) |
|
630 |
(com.ms.dll.DllLib::int lstrcpy (int java.lang.String)) |
|
631 |
(com.ms.dll.DllLib::int sizeOf (java.lang.Object)) |
|
632 |
(com.ms.lang.RegKey::com.ms.lang.RegKeyEnumValue pRegEnumValue (int)) |
|
633 |
(com.ms.lang.RegKey::java.lang.String pRegQueryStringValue (java.lang.String)) |
|
634 |
(com.ms.lang.RegKey::byte[] pRegQueryBinaryValue (java.lang.String)) |
|
635 |
(com.ms.lang.RegKey::int pRegQueryIntValue (java.lang.String)) |
|
636 |
(com.ms.lang.RegKey::void pRegSetStringValue (java.lang.String java.lang.String)) |
|
637 |
(com.ms.lang.RegKey::void pRegSetIntValue (java.lang.String int)) |
|
638 |
(com.ms.lang.RegKey::void pRegSetBinaryValue (java.lang.String byte[])) |
|
639 |
(com.ms.lang.RegKey::void pRegDeleteValue (java.lang.String)) |
|
640 |
(com.ms.lang.RegKey::void pRegFlushKey ()) |
|
641 |
(com.ms.lang.RegKey::void pRegDeleteKey (java.lang.String)) |
|
642 |
(com.ms.lang.RegKey::void pRegOpenBaseKey (int)) |
|
643 |
(com.ms.lang.RegKey::void pRegOpenKey (com.ms.lang.RegKey java.lang.String int)) |
|
644 |
(com.ms.lang.RegKey::int pRegQueryInfoKey (com.ms.lang.RegQueryInfo)) |
|
645 |
(com.ms.lang.RegKey::void pRegUnLoadKey (java.lang.String)) |
|
646 |
(com.ms.lang.RegKey::void pRegCreateKey (com.ms.lang.RegKey java.lang.String)) |
|
647 |
(com.ms.lang.RegKey::void pRegRestoreKey (java.lang.String boolean)) |
|
648 |
(com.ms.lang.RegKey::void pRegLoadKey (java.lang.String java.lang.String)) |
|
649 |
(com.ms.lang.RegKey::void pRegCloseKey ()) |
|
650 |
(com.ms.lang.RegKey::java.lang.String pRegEnumKey (int)) |
|
651 |
(com.ms.lang.RegKey::void pRegReplaceKey (java.lang.String java.lang.String java.lang.String)) |
|
652 |
(com.ms.awt.peer.NativeServices::int pGetKeyboardLayouts (int[] int)) |
|
653 |
(com.ms.awt.peer.NativeServices::void jpegReadByte (com.ms.awt.peer.IjpegDecoderCallback byte[] int com.ms.awt.peer.jpegInfoHeader byte[] int)) |
|
654 |
(com.ms.awt.peer.NativeServices::int getColourDataDepth ()) |
|
655 |
(com.ms.awt.peer.NativeServices::java.lang.String pGetFontEnumeratedFamily (int)) |
|
656 |
(com.ms.awt.peer.NativeServices::int pNewFontEnumeration ()) |
|
657 |
(com.ms.awt.peer.NativeServices::int getScreenClipRgn (int)) |
|
658 |
(com.ms.awt.peer.NativeServices::int pSetKeyboardLayout (int int)) |
|
659 |
(com.ms.awt.peer.NativeServices::void ClipboardInit (com.ms.awt.peer.IToolkit)) |
|
660 |
(com.ms.awt.peer.NativeServices::void getDeviceCaps (int int[] int)) |
|
661 |
(com.ms.awt.peer.NativeServices::void getAfcMetrics (int[])) |
|
662 |
(com.ms.awt.peer.NativeServices::void setUserLocale (int int)) |
|
663 |
(com.ms.awt.peer.NativeServices::void getDCDI (com.ms.awt.peer.DirectColourDataInfo)) |
|
664 |
(com.ms.awt.peer.NativeServices::int pGetNumKeyboardLayouts ()) |
|
665 |
(com.ms.awt.peer.NativeServices::void getIndexedColours (byte[] byte[] byte[])) |
|
666 |
(com.ms.awt.peer.NativeServices::int getNativeFont (java.lang.String int int int)) |
|
667 |
(com.ms.awt.peer.NativeServices::int pGetKeyboardLayout ()) |
|
668 |
(com.ms.awt.peer.NativeServices::int getSystemLCID ()) |
|
669 |
(com.ms.awt.peer.NativeServices::void caretSetPos (int int int)) |
|
670 |
(com.ms.awt.peer.NativeServices::java.lang.String getLogFontFromIUnknown (com.ms.com.IUnknown com.ms.awt.peer.LogFontX)) |
|
671 |
(com.ms.awt.peer.NativeServices::java.lang.String ClipboardGetText ()) |
|
672 |
(com.ms.awt.peer.NativeServices::int systemMetric (int)) |
|
673 |
(com.ms.awt.peer.NativeServices::void jpegInit (com.ms.awt.peer.IjpegDecoderCallback byte[] int com.ms.awt.peer.jpegInfoHeader)) |
|
674 |
(com.ms.awt.peer.NativeServices::void caretHide (int)) |
|
675 |
(com.ms.awt.peer.NativeServices::int chooseColor (int int)) |
|
676 |
(com.ms.awt.peer.NativeServices::java.lang.String pGetKeyboardLayoutName (int)) |
|
677 |
(com.ms.awt.peer.NativeServices::int matchFontAndLanguage (int int)) |
|
678 |
(com.ms.awt.peer.NativeServices::java.lang.String chooseFont (com.ms.awt.peer.LogFontX java.lang.String int)) |
|
679 |
(com.ms.awt.peer.NativeServices::java.lang.String getSystemFont (int com.ms.awt.peer.LogFontX)) |
|
680 |
(com.ms.awt.peer.NativeServices::com.ms.com.IUnknown getIUnknownFromLogFont (java.lang.String com.ms.awt.peer.LogFontX)) |
|
681 |
(com.ms.awt.peer.NativeServices::void caretDispose (int)) |
|
682 |
(com.ms.awt.peer.NativeServices::void caretShow (int)) |
|
683 |
(com.ms.awt.peer.NativeServices::void deleteObject (int)) |
|
684 |
(com.ms.awt.peer.NativeServices::void setDebugOutput (com.ms.awt.peer.COMPrintCallback)) |
|
685 |
(com.ms.awt.peer.NativeServices::void jpegReadInt (com.ms.awt.peer.IjpegDecoderCallback byte[] int com.ms.awt.peer.jpegInfoHeader int[] int)) |
|
686 |
(com.ms.awt.peer.NativeServices::int getSystemColourValue (int)) |
|
687 |
(com.ms.awt.peer.NativeServices::void caretCreate (int int int)) |
|
688 |
(com.ms.awt.peer.NativeServices::void ClipboardSetText (java.lang.String)) |
|
689 |
(com.ms.awt.peer.NativeServices::void println (java.lang.String)) |
|
690 |
(com.ms.security.SecurityClassLoader::boolean getSecureState ()) |
|
691 |
(com.ms.security.SecurityClassLoader::void setSecureState (java.lang.String java.lang.String)) |
|
692 |
(com.ms.security.SecurityClassLoader::java.lang.Class internalDefineClass (java.lang.String byte[] int int)) |
|
693 |
(com.ms.security.SecurityClassLoader::void markClass (java.lang.Class com.ms.security.PermissionSet java.security.Principal)) |
|
694 |
(com.ms.security.SecurityClassLoader::java.util.Hashtable getHashTable ()) |
|
695 |
(com.ms.security.auditing.SecurityAuditor::boolean isThreadAuditingEnabled ()) |
|
696 |
(com.ms.security.auditing.SecurityAuditor::void disableThreadAuditing ()) |
|
697 |
(com.ms.security.auditing.SecurityAuditor::void enableThreadAuditing ()) |
|
698 |
(com.ms.security.auditing.SecurityAuditor::void initSecurityAuditor ()) |
|
699 |
(com.ms.security.PermissionDataSet::byte[] pEncodeAsn ()) |
|
700 |
(com.ms.security.PermissionDataSet::boolean pDecodeAsn (byte[])) |
|
701 |
(com.ms.lang.SystemX::int pAnsiToUnicode (byte[] char[] int int int)) |
|
702 |
(com.ms.lang.SystemX::int pQueryUnicodeToAnsi (char[] int int int)) |
|
703 |
(com.ms.lang.SystemX::void gc ()) |
|
704 |
(com.ms.lang.SystemX::boolean arrayCompare (java.lang.Object[] int java.lang.Object[] int int)) |
|
705 |
(com.ms.lang.SystemX::int pUnicodeToAnsi (char[] byte[] int int int)) |
|
706 |
(com.ms.lang.SystemX::boolean isLocalCharDBCSLeadByte (byte)) |
|
707 |
(com.ms.lang.SystemX::int pQueryAnsiToUnicode (byte[] int int int)) |
|
708 |
(com.ms.lang.SystemX::boolean isBaseDBCS ()) |
|
709 |
(com.ms.packagemanager.JavaPackage::byte[] nativeGetSigner (java.lang.Object)) |
|
710 |
(com.ms.packagemanager.JavaPackage::byte[] nativeGetCapabilities (java.lang.Object)) |
|
711 |
(com.ms.com._Guid::void IIDFromString (java.lang.String com.ms.com._Guid)) |
|
712 |
(com.ms.com._Guid::java.lang.String StringFromIID (com.ms.com._Guid)) |
|
713 |
(com.ms.security.auditing.PrintStreamAuditor::int GetModuleHandle (java.lang.String)) |
|
714 |
(com.ms.security.auditing.PrintStreamAuditor::int FormatMessage (int int int int java.lang.StringBuffer int int[])) |
|
715 |
(com.ms.security.permissions.CustomPermission::byte[] pEncodeAsn ()) |
|
716 |
(com.ms.security.permissions.CustomPermission::boolean pDecodeAsn (byte[])) |
|
717 |
(com.ms.security.permissions.X509Signer::boolean pLoad (byte[])) |
|
718 |
(com.ms.packagemanager.PackageManager::java.lang.Class nativeFindClassInNamespace (java.lang.String java.lang.String java.lang.ClassLoader)) |
|
719 |
(com.ms.packagemanager.PackageManager::java.lang.Object nativeGetPackage (java.lang.String java.lang.String)) |
|
720 |
(com.ms.packagemanager.PackageManager::java.lang.String[] nativeGetBeansList ()) |
|
721 |
(com.ms.packagemanager.PackageManager::com.ms.com.IStream nativeGetFileIStream (java.lang.String java.lang.String)) |
|
722 |
(com.ms.packagemanager.PackageManager::java.lang.Class nativeFindClass (java.lang.String java.lang.String java.lang.ClassLoader)) |
|
723 |
(com.ms.security.permissions.UserFileIOPermission::byte[] pEncodeAsn ()) |
|
724 |
(com.ms.security.permissions.UserFileIOPermission::boolean pDecodeAsn (byte[])) |
|
725 |
(com.ms.security.permissions.PropertyPermission::byte[] pEncodeAsn ()) |
|
726 |
(com.ms.security.permissions.PropertyPermission::boolean pDecodeAsn (byte[])) |
|
727 |
(com.ms.security.permissions.ClientStoragePermission::byte[] pEncodeAsn ()) |
|
728 |
(com.ms.security.permissions.ClientStoragePermission::boolean pDecodeAsn (byte[])) |
|
729 |
(com.ms.security.permissions.ExecutionPermission::byte[] pEncodeAsn ()) |
|
730 |
(com.ms.security.permissions.ExecutionPermission::boolean pDecodeAsn (byte[])) |
|
731 |
(com.ms.util.EventLog::boolean DeregisterEventSource (int)) |
|
732 |
(com.ms.util.EventLog::void reportEvent0 (unsigned short unsigned short int java.lang.String[] byte[])) |
|
733 |
(com.ms.util.EventLog::int RegisterEventSource (java.lang.String java.lang.String)) |
|
734 |
(com.ms.applet.BrowserAppletFrame::void signalViewChange (int)) |
|
735 |
(com.ms.applet.BrowserAppletFrame::java.lang.Object newInstance (int java.lang.Class boolean com.ms.security.PermissionSet)) |
|
736 |
(com.ms.applet.BrowserAppletFrame::void showSystemStatus (int int boolean java.lang.String)) |
|
737 |
(com.ms.applet.BrowserAppletFrame::com.ms.security.management.SecurityPolicy getSecurityPolicy0 (int java.lang.String)) |
|
738 |
(com.ms.applet.BrowserAppletFrame::void setDownloadState (int boolean)) |
|
739 |
(com.ms.applet.BrowserAppletFrame::int GetSystemDefaultLCID ()) |
|
740 |
(com.ms.applet.BrowserAppletFrame::void requestResize (int int int)) |
|
741 |
(com.ms.applet.BrowserAppletFrame::void signalObjectLoadDone (int boolean)) |
|
742 |
(com.ms.applet.BrowserAppletFrame::com.ms.applet.BrowserAppletFrame findOfflineContext ()) |
|
743 |
(com.ms.applet.BrowserAppletFrame::void showStatus0 (int java.lang.String)) |
|
744 |
(com.ms.applet.BrowserAppletFrame::boolean checkGlobalOfflineMode0 ()) |
|
745 |
(com.ms.applet.BrowserAppletFrame::void showDocument0 (int java.lang.String java.lang.String)) |
|
746 |
(com.ms.security.permissions.SystemStreamsPermission::byte[] pEncodeAsn ()) |
|
747 |
(com.ms.security.permissions.SystemStreamsPermission::boolean pDecodeAsn (byte[])) |
|
748 |
(com.ms.security.permissions.FileIOPermission::byte[] pEncodeAsn ()) |
|
749 |
(com.ms.security.permissions.FileIOPermission::boolean pDecodeAsn (byte[])) |
|
750 |
(com.ms.com.ComLib::int newGCHandle (java.lang.Object)) |
|
751 |
(com.ms.com.ComLib::java.lang.Object derefGCHandle (int)) |
|
752 |
(com.ms.com.ComLib::void dprinthelper (char[])) |
|
753 |
(com.ms.com.ComLib::void release (java.lang.Object)) |
|
754 |
(com.ms.com.ComLib::int jcdwClassSizeOf (java.lang.Class)) |
|
755 |
(com.ms.com.ComLib::int jcdwOffsetOf (java.lang.Object java.lang.String)) |
|
756 |
(com.ms.com.ComLib::int jcdwClassOffsetOf (java.lang.Class java.lang.String)) |
|
757 |
(com.ms.com.ComLib::boolean isJavaOwned (java.lang.Object)) |
|
758 |
(com.ms.com.ComLib::void brk (java.lang.Object)) |
|
759 |
(com.ms.com.ComLib::void setDataWrapperSize (java.lang.Object int)) |
|
760 |
(com.ms.com.ComLib::void brk (int)) |
|
761 |
(com.ms.com.ComLib::void setJCDWHomeThread (java.lang.Object java.lang.Object)) |
|
762 |
(com.ms.com.ComLib::void propagateOwnership (java.lang.Object int)) |
|
763 |
(com.ms.com.ComLib::void threadStartMTA (java.lang.Thread)) |
|
764 |
(com.ms.com.ComLib::void IENVNextMarshalerJ2C (int)) |
|
765 |
(com.ms.com.ComLib::boolean supportsInterface (java.lang.Object com.ms.com._Guid)) |
|
766 |
(com.ms.com.ComLib::java.lang.Object ptrToStruct (java.lang.Class int)) |
|
767 |
(com.ms.com.ComLib::int jcdwSizeOf (java.lang.Object)) |
|
768 |
(com.ms.com.ComLib::void declareMessagePumpThread ()) |
|
769 |
(com.ms.com.ComLib::void IENVNextMarshalerC2J (int)) |
|
770 |
(com.ms.com.ComLib::void freeGCHandle (int)) |
|
771 |
(com.ms.com.ComLib::boolean isEqualUnknown (java.lang.Object java.lang.Object)) |
|
772 |
(com.ms.com.Dispatch::boolean NIsArray (java.lang.Object)) |
|
773 |
(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[])) |
|
774 |
(com.ms.com.Dispatch::void NGetIDsOfNamesReal (java.lang.Object com.ms.com._Guid int java.lang.String[] int[])) |
|
775 |
(com.ms.com.ComException::int FormatMessage (int int int int java.lang.StringBuffer int int[])) |
|
776 |
(com.ms.com.Variant::int toInt ()) |
|
777 |
(com.ms.com.Variant::double toDate ()) |
|
778 |
(com.ms.com.Variant::boolean toBoolean ()) |
|
779 |
(com.ms.com.Variant::double toDouble ()) |
|
780 |
(com.ms.com.Variant::long toCurrency ()) |
|
781 |
(com.ms.com.Variant::void putVariantArray (com.ms.com.Variant[])) |
|
782 |
(com.ms.com.Variant::com.ms.com.Variant[] getVariantArray ()) |
|
783 |
(com.ms.com.Variant::void putByteArray (java.lang.Object)) |
|
784 |
(com.ms.com.Variant::void putShortRef (unsigned short)) |
|
785 |
(com.ms.com.Variant::void putIntRef (int)) |
|
786 |
(com.ms.com.Variant::void putDoubleRef (double)) |
|
787 |
(com.ms.com.Variant::void putDateRef (double)) |
|
788 |
(com.ms.com.Variant::void putStringRef (java.lang.String)) |
|
789 |
(com.ms.com.Variant::unsigned short getShortRef ()) |
|
790 |
(com.ms.com.Variant::int getIntRef ()) |
|
791 |
(com.ms.com.Variant::double getDoubleRef ()) |
|
792 |
(com.ms.com.Variant::double getDateRef ()) |
|
793 |
(com.ms.com.Variant::java.lang.String getStringRef ()) |
|
794 |
(com.ms.com.Variant::java.lang.String internalToString ()) |
|
795 |
(com.ms.com.Variant::void initSafeArrayByRef (com.ms.com.SafeArray int)) |
|
796 |
(com.ms.com.Variant::java.lang.Object toCharArray ()) |
|
797 |
(com.ms.com.Variant::java.lang.Object toDispatch ()) |
|
798 |
(com.ms.com.Variant::byte toByte ()) |
|
799 |
(com.ms.com.Variant::java.lang.Object getDispatch ()) |
|
800 |
(com.ms.com.Variant::void putDispatch (java.lang.Object)) |
|
801 |
(com.ms.com.Variant::boolean getBoolean ()) |
|
802 |
(com.ms.com.Variant::int toError ()) |
|
803 |
(com.ms.com.Variant::java.lang.Object toObject ()) |
|
804 |
(com.ms.com.Variant::void initSafeArrayByVal (com.ms.com.SafeArray int)) |
|
805 |
(com.ms.com.Variant::java.lang.Object getObject ()) |
|
806 |
(com.ms.com.Variant::void putObject (java.lang.Object)) |
|
807 |
(com.ms.com.Variant::com.ms.com.SafeArray toSafeArrayHelper (java.lang.Class)) |
|
808 |
(com.ms.com.Variant::void putFloatRef (float)) |
|
809 |
(com.ms.com.Variant::void putCurrencyRef (long)) |
|
810 |
(com.ms.com.Variant::void putErrorRef (int)) |
|
811 |
(com.ms.com.Variant::void putBooleanRef (boolean)) |
|
812 |
(com.ms.com.Variant::void putObjectRef (java.lang.Object)) |
|
813 |
(com.ms.com.Variant::void putByteRef (byte)) |
|
814 |
(com.ms.com.Variant::java.lang.String getString ()) |
|
815 |
(com.ms.com.Variant::void putString (java.lang.String)) |
|
816 |
(com.ms.com.Variant::float getFloatRef ()) |
|
817 |
(com.ms.com.Variant::long getCurrencyRef ()) |
|
818 |
(com.ms.com.Variant::int getErrorRef ()) |
|
819 |
(com.ms.com.Variant::boolean getBooleanRef ()) |
|
820 |
(com.ms.com.Variant::java.lang.Object getObjectRef ()) |
|
821 |
(com.ms.com.Variant::byte getByteRef ()) |
|
822 |
(com.ms.com.Variant::float toFloat ()) |
|
823 |
(com.ms.com.Variant::void putCharArray (java.lang.Object)) |
|
824 |
(com.ms.com.Variant::void putDispatchRef (java.lang.Object)) |
|
825 |
(com.ms.com.Variant::java.lang.Object getDispatchRef ()) |
|
826 |
(com.ms.com.Variant::void putVariantArrayRef (com.ms.com.Variant[])) |
|
827 |
(com.ms.com.Variant::com.ms.com.Variant[] getVariantArrayRef ()) |
|
828 |
(com.ms.com.Variant::void changeType (unsigned short)) |
|
829 |
(com.ms.com.Variant::void ncloneIndirect (com.ms.com.Variant)) |
|
830 |
(com.ms.com.Variant::void nFinalize (boolean)) |
|
831 |
(com.ms.com.Variant::void nclone (com.ms.com.Variant)) |
|
832 |
(com.ms.com.Variant::unsigned short toShort ()) |
|
833 |
(com.ms.com.Variant::void putSafeArrayRefHelper (int)) |
|
834 |
(com.ms.com.Variant::com.ms.com.Variant[] toVariantArray ()) |
|
835 |
(com.ms.com.Variant::java.lang.Object toByteArray ()) |
|
836 |
(com.ms.com.Variant::void TrueVariantClear ()) |
|
837 |
(com.ms.awt.WToolkit::boolean MessageBeep (int)) |
|
838 |
(com.ms.applet.AppletPanel::boolean StartCodeDownload (int java.lang.String java.lang.String java.lang.String)) |
|
839 |
(com.ms.applet.AppletPanel::void securedCall0 (int java.lang.Object)) |
|
840 |
(com.ms.applet.AppletPanel::com.ms.security.PermissionSet getDefaultPermissionsFromLoader (com.ms.vm.loader.URLClassLoader)) |
|
841 |
(com.ms.dll.Win32Exception::int FormatMessage (int int int int java.lang.StringBuffer int int[])) |
|
842 |
(com.ms.awt.WGuiCallback::boolean SetEvent (int)) |
|
843 |
(com.ms.awt.WGuiCallback::int CreateSemaphore (int int int int)) |
|
844 |
(com.ms.awt.WGuiCallback::int ReleaseSemaphore (int int int)) |
|
845 |
(com.ms.awt.WGuiCallback::void userYield (boolean)) |
|
846 |
(com.ms.awt.WGuiCallback::int MsgWaitForMultipleObjects (int int[] boolean int int)) |
|
847 |
(com.ms.awt.WGuiCallback::int CreateEvent (int boolean boolean int)) |
|
848 |
(com.ms.activeX.ActiveXToolkit::int GetSysColor (int)) |
|
849 |
(com.ms.awt.peer.NativeGraphics::void setPageDimension (int int)) |
|
850 |
(com.ms.awt.peer.NativeGraphics::void setBkColour (int int)) |
|
851 |
(com.ms.awt.peer.NativeGraphics::void getClipBounds (com.ms.awt.peer.NativeRect int int)) |
|
852 |
(com.ms.awt.peer.NativeGraphics::void pGetCharOutline (int byte[])) |
|
853 |
(com.ms.awt.peer.NativeGraphics::void drawLine (int int int int)) |
|
854 |
(com.ms.awt.peer.NativeGraphics::void setXORMode (int int int int)) |
|
855 |
(com.ms.awt.peer.NativeGraphics::int drawString (java.lang.String int int int int int int int int[] int[])) |
|
856 |
(com.ms.awt.peer.NativeGraphics::int getCoClass ()) |
|
857 |
(com.ms.awt.peer.NativeGraphics::void drawArc (int int int int int int int)) |
|
858 |
(com.ms.awt.peer.NativeGraphics::void getInitialPageDimension (com.ms.awt.peer.NativeRect)) |
|
859 |
(com.ms.awt.peer.NativeGraphics::void setVisRgn (int)) |
|
860 |
(com.ms.awt.peer.NativeGraphics::void pSetForeground (int int)) |
|
861 |
(com.ms.awt.peer.NativeGraphics::int pGetDC ()) |
|
862 |
(com.ms.awt.peer.NativeGraphics::void drawPixels (int[] int int int)) |
|
863 |
(com.ms.awt.peer.NativeGraphics::void drawPolygon (int[] int[] int int int int)) |
|
864 |
(com.ms.awt.peer.NativeGraphics::void createFromImage (com.ms.awt.peer.INativeImage)) |
|
865 |
(com.ms.awt.peer.NativeGraphics::void endPage ()) |
|
866 |
(com.ms.awt.peer.NativeGraphics::int pGetCharOutlineSize (int)) |
|
867 |
(com.ms.awt.peer.NativeGraphics::void pDrawBezier (int int int[] int)) |
|
868 |
(com.ms.awt.peer.NativeGraphics::int drawBytes (byte[] int int int int int)) |
|
869 |
(com.ms.awt.peer.NativeGraphics::void changeClip (int int int int boolean)) |
|
870 |
(com.ms.awt.peer.NativeGraphics::int drawChars (char[] int int int int int int int int int int[] int[])) |
|
871 |
(com.ms.awt.peer.NativeGraphics::void drawT2Curve (float float float float float float int int)) |
|
872 |
(com.ms.awt.peer.NativeGraphics::void createFromPrintJob (java.lang.String com.ms.awt.peer.SPJData)) |
|
873 |
(com.ms.awt.peer.NativeGraphics::void endPrintJob ()) |
|
874 |
(com.ms.awt.peer.NativeGraphics::void pSetOrigin (int int)) |
|
875 |
(com.ms.awt.peer.NativeGraphics::void createFromHDC (int)) |
|
876 |
(com.ms.awt.peer.NativeGraphics::void drawOval (int int int int int)) |
|
877 |
(com.ms.awt.peer.NativeGraphics::int pSetFont (java.lang.String int int int)) |
|
878 |
(com.ms.awt.peer.NativeGraphics::void setPaintMode (int int)) |
|
879 |
(com.ms.awt.peer.NativeGraphics::void startPage ()) |
|
880 |
(com.ms.awt.peer.NativeGraphics::void clearClip ()) |
|
881 |
(com.ms.awt.peer.NativeGraphics::void createFromCopy (com.ms.awt.peer.INativeGraphics)) |
|
882 |
(com.ms.awt.peer.NativeGraphics::void scanLines (int int[] int int int int)) |
|
883 |
(com.ms.awt.peer.NativeGraphics::void drawRoundRect (int int int int int int int)) |
|
884 |
(com.ms.awt.peer.NativeGraphics::void dispose ()) |
|
885 |
(com.ms.awt.peer.NativeGraphics::void clearRect (int int int int int)) |
|
886 |
(com.ms.awt.peer.NativeGraphics::void copyArea (int int int int int int)) |
|
887 |
(com.ms.awt.peer.NativeGraphics::void createFromWindow (int)) |
|
888 |
(com.ms.awt.peer.NativeGraphics::void drawPolyline (int[] int[] int int int)) |
|
889 |
(com.ms.awt.peer.NativeGraphics::void drawRect (int int int int int)) |
|
890 |
(com.ms.awt.peer.CToolkit::void callbackEventLoop (com.ms.awt.peer.IToolkitCallback)) |
|
891 |
(com.ms.awt.peer.CToolkit::int getToolkitHwnd ()) |
|
892 |
(com.ms.awt.peer.CToolkit::int createCompHwnd (int int)) |
|
893 |
(com.ms.awt.peer.CNativeSystemIME::void setCompositionFont (int int)) |
|
894 |
(com.ms.awt.peer.CNativeSystemIME::void setCompositionPos (int int int)) |
|
895 |
(com.ms.awt.peer.CNativeSystemIME::void setOpenStatus (int int)) |
|
896 |
(com.ms.awt.peer.CNativeSystemIME::int getOpenStatus (int)) |
|
897 |
(com.ms.awt.peer.CNativeSystemIME::java.lang.String getCompositionString (int)) |
|
898 |
(com.ms.awt.peer.CNativeSystemIME::java.lang.String getCompositionResultString (int)) |
|
899 |
(com.ms.net.wininet.WininetStreamHandlerFactory::int initNative (java.lang.String)) |
|
900 |
(com.ms.com.SafeArray::void rawGetVariantAs (int com.ms.com.Variant)) |
|
901 |
(com.ms.com.SafeArray::void NSafeArrayInit (int)) |
|
902 |
(com.ms.com.SafeArray::float rawGetDouble (int)) |
|
903 |
(com.ms.com.SafeArray::void NRawBoolCopyToJavaArray (int int boolean[] int)) |
|
904 |
(com.ms.com.SafeArray::void validateArray (int)) |
|
905 |
(com.ms.com.SafeArray::void NSafeArrayCreateFromString (java.lang.String)) |
|
906 |
(com.ms.com.SafeArray::void rawSetString (int java.lang.String)) |
|
907 |
(com.ms.com.SafeArray::int getInt (int)) |
|
908 |
(com.ms.com.SafeArray::void setInt (int int)) |
|
909 |
(com.ms.com.SafeArray::boolean getBoolean (int)) |
|
910 |
(com.ms.com.SafeArray::void setBoolean (int boolean)) |
|
911 |
(com.ms.com.SafeArray::int computeOffset (int)) |
|
912 |
(com.ms.com.SafeArray::void NSafeArrayNullInit ()) |
|
913 |
(com.ms.com.SafeArray::void rawSetVariant (int com.ms.com.Variant)) |
|
914 |
(com.ms.com.SafeArray::float rawGetFloat (int)) |
|
915 |
(com.ms.com.SafeArray::float getFloat (int)) |
|
916 |
(com.ms.com.SafeArray::void setFloat (int float)) |
|
917 |
(com.ms.com.SafeArray::int computeOffset2 (int int)) |
|
918 |
(com.ms.com.SafeArray::void rawSetDouble (int double)) |
|
919 |
(com.ms.com.SafeArray::java.lang.String asString ()) |
|
920 |
(com.ms.com.SafeArray::void NRawCopyToJavaArray (int int java.lang.Object int)) |
|
921 |
(com.ms.com.SafeArray::void NSafeArrayCreate (int int int[] int[])) |
|
922 |
(com.ms.com.SafeArray::void NRawBoolCopyFromJavaArray (boolean[] int int int)) |
|
923 |
(com.ms.com.SafeArray::void NSafeArrayDestroy (boolean boolean)) |
|
924 |
(com.ms.com.SafeArray::int NSafeArrayCopy ()) |
|
925 |
(com.ms.com.SafeArray::int rawGetInt (int)) |
|
926 |
(com.ms.com.SafeArray::boolean rawGetBoolean (int)) |
|
927 |
(com.ms.com.SafeArray::void rawSetFloat (int float)) |
|
928 |
(com.ms.com.SafeArray::java.lang.String rawGetString (int)) |
|
929 |
(com.ms.com.SafeArray::int NTotalNumElems ()) |
|
930 |
(com.ms.com.SafeArray::double getDouble (int)) |
|
931 |
(com.ms.com.SafeArray::void setDouble (int double)) |
|
932 |
(com.ms.com.SafeArray::void Nreinit (com.ms.com.SafeArray)) |
|
933 |
(com.ms.com.SafeArray::int getPhysicalSafeArray ()) |
|
934 |
(com.ms.com.SafeArray::int NgetdwordAt (int)) |
|
935 |
(com.ms.com.SafeArray::void NRawCopyFromJavaArray (java.lang.Object int int int)) |
|
936 |
(com.ms.com.SafeArray::void rawSetBoolean (int boolean)) |
|
937 |
(com.ms.com.SafeArray::void rawSetInt (int int)) |
|
938 |
(com.ms.awt.peer.CNativeComponent::void invalidate (int int int int)) |
|
939 |
(com.ms.awt.peer.CNativeComponent::void hideModal ()) |
|
940 |
(com.ms.awt.peer.CNativeComponent::void hide ()) |
|
941 |
(com.ms.awt.peer.CNativeComponent::void setOnTop (int)) |
|
942 |
(com.ms.awt.peer.CNativeComponent::void registerDragDrop ()) |
|
943 |
(com.ms.awt.peer.CNativeComponent::void endValidate ()) |
|
944 |
(com.ms.awt.peer.CNativeComponent::void enable ()) |
|
945 |
(com.ms.awt.peer.CNativeComponent::void disable ()) |
|
946 |
(com.ms.awt.peer.CNativeComponent::void setTitle (java.lang.String)) |
|
947 |
(com.ms.awt.peer.CNativeComponent::void getBounds (com.ms.awt.peer.NativeRect)) |
|
948 |
(com.ms.awt.peer.CNativeComponent::int gethwnd ()) |
|
949 |
(com.ms.awt.peer.CNativeComponent::void showModal ()) |
|
950 |
(com.ms.awt.peer.CNativeComponent::void setCursor (int)) |
|
951 |
(com.ms.awt.peer.CNativeComponent::void reshape (int int int int)) |
|
952 |
(com.ms.awt.peer.CNativeComponent::void requestFocus ()) |
|
953 |
(com.ms.awt.peer.CNativeComponent::void callDefWindowProc (int int int int)) |
|
954 |
(com.ms.awt.peer.CNativeComponent::void registerCustomDropTarget (com.ms.com.IUnknown)) |
|
955 |
(com.ms.awt.peer.CNativeComponent::void setNoActivate (boolean)) |
|
956 |
(com.ms.awt.peer.CNativeComponent::void getPlaceOnScreen (com.ms.awt.peer.NativeRect)) |
|
957 |
(com.ms.awt.peer.CNativeComponent::void beginValidate ()) |
|
958 |
(com.ms.awt.peer.CNativeComponent::void clippedReshape (int int int int int)) |
|
959 |
(com.ms.awt.peer.CNativeComponent::void setResizable (boolean)) |
|
960 |
(com.ms.awt.peer.CNativeComponent::void setIcon (int)) |
|
961 |
(com.ms.awt.peer.CNativeComponent::void toBack ()) |
|
962 |
(com.ms.awt.peer.CNativeComponent::void setFrameHost (com.ms.awt.peer.IBrowserAppletFrameCallback)) |
|
963 |
(com.ms.awt.peer.CNativeComponent::void toFront ()) |
|
964 |
(com.ms.awt.peer.CNativeComponent::void show ()) |
|
965 |
(com.ms.awt.peer.CNativeComponent::void updateInsets (com.ms.awt.peer.NativeInsets)) |
|
966 |
(com.ms.awt.peer.CNativeComponent::void dispose ()) |
|
967 |
(com.ms.awt.peer.CNativeComponent::void initFromJavaWindow (int com.ms.awt.peer.IComponentCallback com.ms.awt.peer.INativeComponent com.ms.awt.peer.IToolkit int)) |
|
968 |
(com.ms.awt.peer.CNativeComponent::void init (int com.ms.awt.peer.IComponentCallback com.ms.awt.peer.INativeComponent com.ms.awt.peer.IToolkit)) |
|
969 |
(com.ms.awt.peer.CNativeComponent::void beginDrag (com.ms.awt.peer.INativeDragCallback)) |
|
970 |
(com.ms.fx.RegionConverter::int computeNativeRegion (int[])) |
|
971 |
(com.ms.fx.RegionConverter::int[] computeJavaRegion (int)) |
|
972 |
(com.ms.net.wininet.URLUtils::java.lang.String canonicalizeURL (java.lang.String int)) |
|
973 |
(com.ms.net.wininet.URLUtils::java.lang.String combineURL (java.lang.String java.lang.String int)) |
|
974 |
(com.ms.awt.peer.NativeFontMetrics::int bytesWidth (byte[] int int)) |
|
975 |
(com.ms.awt.peer.NativeFontMetrics::int stringWidth (java.lang.String int int[])) |
|
976 |
(com.ms.awt.peer.NativeFontMetrics::int charsWidth (char[] int int int int[])) |
|
977 |
(com.ms.awt.peer.NativeFontMetrics::java.lang.String init (com.ms.awt.peer.INativeGraphics int[] java.lang.String int int int)) |
|
978 |
(com.ms.io.console.Console::int MessageBox (int java.lang.String java.lang.String int)) |
|
979 |
(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)) |
|
980 |
(com.ms.security.management.SecurityZone::byte[] pLoadCustomPermissions (int int java.lang.String)) |
|
981 |
(com.ms.awt.peer.NativeImage::int setBytePixelsDirected (int int int int com.ms.awt.peer.DirectColourModelData byte[] int int com.ms.awt.peer.INativeImageBufferDone)) |
|
982 |
(com.ms.awt.peer.NativeImage::void create (int int int int)) |
|
983 |
(com.ms.awt.peer.NativeImage::int setIntPixelsIndexed (int int int int int[] int int[] int int com.ms.awt.peer.INativeImageBufferDone)) |
|
984 |
(com.ms.awt.peer.NativeImage::int getCoClass ()) |
|
985 |
(com.ms.awt.peer.NativeImage::int getIcon (int int int)) |
|
986 |
(com.ms.awt.peer.NativeImage::int setBytePixelsIndexed (int int int int int[] int byte[] int int com.ms.awt.peer.INativeImageBufferDone)) |
|
987 |
(com.ms.awt.peer.NativeImage::void sendPixels (com.ms.awt.peer.SPData)) |
|
988 |
(com.ms.awt.peer.NativeImage::void fillPixels (com.ms.awt.peer.SPData byte[])) |
|
989 |
(com.ms.awt.peer.NativeImage::void dispose ()) |
|
990 |
(com.ms.awt.peer.NativeImage::void init (int int int int int)) |
|
991 |
(com.ms.awt.peer.NativeImage::int setIntPixelsDirected (int int int int com.ms.awt.peer.DirectColourModelData int[] int int com.ms.awt.peer.INativeImageBufferDone)) |
|
992 |
(com.ms.awt.peer.NativeImage::void imageDrawStretched (com.ms.awt.peer.INativeGraphics int int int int int int int int int int)) |
|
993 |
(com.ms.awt.peer.NativeImage::int finish (int)) |
|
994 |
(com.ms.awt.peer.NativeImage::void imageDraw (int int int int int)) |
|
995 |
(com.ms.awt.peer.NativeResource::java.lang.String loadString (int)) |
|
996 |
(com.ms.awt.peer.NativeResource::int openDialogFromID (int)) |
|
997 |
(com.ms.awt.peer.NativeResource::boolean attach (java.lang.String)) |
|
998 |
(com.ms.awt.peer.NativeResource::void loadBytes (int int java.lang.String byte[] int)) |
|
999 |
(com.ms.awt.peer.NativeResource::int getSize (int int java.lang.String)) |
|
1000 |
(com.ms.awt.peer.NativeResource::void detach ()) |
|
1001 |
(com.ms.awt.peer.NativeResource::int openDialogFromName (java.lang.String)) |
|
1002 |
(com.ms.net.wininet.WininetURLConnection::com.ms.applet.BrowserAppletFrame findOfflineContext ()) |
|
1003 |
(com.ms.com.DispatchProxy::void finalize ()) |
|
1004 |
(com.ms.com.DispatchProxy::void init (com.ms.com._Guid java.lang.reflect.Method[] int[])) |
|
1005 |
(com.ms.net.wininet.WininetInputStream::void close ()) |
|
1006 |
(com.ms.net.wininet.WininetInputStream::int read (byte[] int int)) |
|
1007 |
(com.ms.net.wininet.WininetInputStream::int available ()) |
|
1008 |
(com.ms.net.wininet.WininetInputStream::long skip (long)) |
|
1009 |
(com.ms.net.wininet.WininetInputStream::void connect (java.lang.String boolean boolean java.lang.SecurityManager)) |
|
1010 |
(com.ms.vm.loader.CabSignatureInfo::com.ms.vm.loader.CabSignatureInfo extractFromFile0 (java.lang.String com.ms.security.management.SecurityPolicy)) |
|
1011 |
(com.ms.net.wininet.http.HttpInputStream::byte[] getResponseHeaders ()) |
|
1012 |
(com.ms.net.wininet.http.HttpInputStream::void close0 ()) |
|
1013 |
(com.ms.net.wininet.http.HttpInputStream::void connect (java.lang.String int java.lang.String boolean boolean boolean boolean byte[] byte[] java.lang.SecurityManager)) |
|
1014 |
(com.ms.vm.loader.CabCracker::int GetTempFileName (java.lang.StringBuffer java.lang.String int java.lang.StringBuffer)) |
|
1015 |
(com.ms.vm.loader.CabCracker::void getBytes0 (int int byte[])) |
|
1016 |
(com.ms.vm.loader.CabCracker::void cleanup ()) |
|
1017 |
(com.ms.vm.loader.CabCracker::int GetTempPath (int java.lang.StringBuffer)) |
|
1018 |
(com.ms.vm.loader.CabCracker::void load0 ()) |
|
1019 |
||
1020 |
||
261 | 1021 |
" |
1022 |
||
432 | 1023 |
! |
1024 |
||
1025 |
performance |
|
1026 |
" |
|
447 | 1027 |
JAVA::BenchMark new loopmark |
432 | 1028 |
JAVA::BenchMark new logicmark |
447 | 1029 |
JAVA::BenchMark new sievemark |
1030 |
JAVA::BenchMark new methodmark |
|
432 | 1031 |
JAVA::BenchMark new stringmark |
1032 |
JAVA::BenchMark new newstringmark |
|
1033 |
JAVA::BenchMark new neweststringmark |
|
1034 |
||
1035 |
||
1036 |
" |
|
1037 |
" |
|
457 | 1038 |
caffmark loopmark logicmark sievemark methodmark stringmark float image graphic newstringmark neweststringmark |
1039 |
linux: |
|
1040 |
P6/233 No JIT 84 87 90 40 22 17 10 |
|
1041 |
P6/233 JIT 479 2459 393 649 28 21 12 |
|
1042 |
P6/233 JIT 473 1805 3046 439 986 28 21 12 |
|
460 | 1043 |
533 1808 3382 613 1003 25 105 143 1 |
464 | 1044 |
668 3330 3644 740 |
457 | 1045 |
|
1046 |
w95 |
|
1047 |
P5/200 JIT 90 95 90 95 686 18 60 54 7 |
|
459 | 1048 |
428 1657 2385 684 957 21 61 62 9 |
465 | 1049 |
541 2886 2589 823 976 18 62 55 7 |
432 | 1050 |
" |
1051 |
||
441 | 1052 |
! |
1053 |
||
1054 |
performance2 |
|
1055 |
" |
|
1056 |
symantec benchmarks |
|
1057 |
||
1058 |
||
1059 |
" |
|
1060 |
" |
|
1061 |
BubbleSort BidirBubbleSort QuickSort Sieve Hanoi Dhry Fib Array Tree Total |
|
1062 |
||
1063 |
ST/X+J |
|
455 | 1064 |
233Mhz P6 |
441 | 1065 |
No JIT 352767 354597 69585 43048 101638 28961 108839 48815 |
1066 |
||
1067 |
ST/X+J |
|
455 | 1068 |
233Mhz P6 |
441 | 1069 |
JIT 128724 116810 20259 39733 83160 27613 52093 33166 43996 545554 |
447 | 1070 |
124744 101428 17239 10052 8264 14004 38821 23252 33709 374660 |
455 | 1071 |
+IINC 120324 7265 |
1072 |
+IADD op2 100173 90737 18128 6996 7423 17093 48559 44209 57056 390374 |
|
1073 |
+ISUB op2 90460 17547 5921 57056 390461 |
|
1074 |
+ICMPEQ/NE 99785 90147 5792 43482 56486 388255 |
|
460 | 1075 |
+ICMP 87398 78214 15784 7574 5628 12812 38481 24654 32252 302797 |
461 | 1076 |
+IFICMPLE 84198 74928 13814 5650 11674 23241 293118 |
1077 |
+IFICMPxx 76867 69738 12208 37505 21973 32104 273569 |
|
1078 |
+IFICMPEQ/NE 5580 11202 21723 |
|
1079 |
const IFICMPxx 11856 5463 11032 37372 272726 |
|
462 | 1080 |
+lea for add/sub |
463 | 1081 |
+BALOAD 11700 4600 5015 9431 |
1082 |
+BASTORE 3279 |
|
1083 |
+CALOAD/CASTORE 8907 |
|
466 | 1084 |
regSave change 66119 60365 9997 4917 15386 37851 38202 50027 286497 |
469 | 1085 |
64858 58360 9476 4889 15001 37211 36288 48313 278478 |
1086 |
63146 55949 9302 14899 |
|
1087 |
62970 56085 9352 3226 4837 8779 37573 22815 33899 241297 |
|
471 | 1088 |
-O 43662 40292 7181 2530 4696 8170 34555 22116 32337 195539 |
474 | 1089 |
|
471 | 1090 |
+IALOAD 39162 36347 |
1091 |
+IASTORE 32461 30663 4299 3667 19556 30563 166868 |
|
474 | 1092 |
|
1093 |
-IALOAD/IASTORE |
|
1094 |
34167 19347 |
|
1095 |
19232 29726 |
|
1096 |
18821 |
|
441 | 1097 |
------------------------------------------------------------------------------------------------------------ |
1098 |
||
1099 |
Sun JDK 274625 244461 52676 50653 65183 26668 78133 28572 61608 882583 |
|
455 | 1100 |
(90Mhz P5) |
441 | 1101 |
|
1102 |
Microsoft J++ 9684 8452 2874 1733 3535 3665 3836 4746 25717 64242 |
|
455 | 1103 |
(90Mhz P5) |
441 | 1104 |
|
1105 |
Symantec Cafe 14541 12198 3686 1922 4527 3325 3425 12969 26829 83422 |
|
1106 |
JIT 1.02 |
|
1107 |
(90Mhz P5) |
|
1108 |
||
1109 |
Symantec Cafe 8292 6970 2714 1613 3345 3235 2013 4516 13180 45878 |
|
1110 |
JIT 1.2 |
|
1111 |
(90Mhz P5) |
|
1112 |
" |
|
1113 |
||
471 | 1114 |
" |
1115 |
|b| |
|
1116 |
||
1117 |
b := JAVA::BubbleSortAlgorithm new. |
|
1118 |
b perform:#'setData(JJ)V' with:10000 with:0 with:0 with:0. |
|
1119 |
Time millisecondsToRun:[ |
|
1120 |
b performTest. |
|
1121 |
] |
|
1122 |
" |
|
1123 |
" |
|
1124 |
|b| |
|
1125 |
||
1126 |
b := JAVA::QSortAlgorithm new. |
|
1127 |
b perform:#'setData(JJ)V' with:500000 with:0 with:0 with:0. |
|
1128 |
Time millisecondsToRun:[ |
|
1129 |
b performTest. |
|
1130 |
] |
|
1131 |
" |
|
1132 |
" |
|
1133 |
|t| |
|
1134 |
||
1135 |
t := JAVA::Tree new. |
|
1136 |
t perform:#'setData(JJ)V' with:1000000 with:0 with:0 with:0. |
|
1137 |
Time millisecondsToRun:[ |
|
1138 |
t performTest. |
|
1139 |
] |
|
1140 |
" |
|
1141 |
" |
|
1142 |
|t| |
|
1143 |
||
1144 |
t := JAVA::Array new. |
|
1145 |
t perform:#'setData(JJ)V' with:1000000 with:0 with:0 with:0. |
|
1146 |
Time millisecondsToRun:[ |
|
1147 |
t performTest. |
|
1148 |
] |
|
1149 |
" |
|
1150 |
||
261 | 1151 |
! ! |
253 | 1152 |
|
1153 |
!JavaVM class methodsFor:'initialization'! |
|
1154 |
||
423 | 1155 |
compile:source selector:smalltalkSelector asJavaMethod:javaSelector fakedSource:fakedSource in:aClass |
1156 |
"install additional java protocol in smalltalk classes, req'd for java programs" |
|
1157 |
||
1158 |
|cloneCode| |
|
1159 |
||
1160 |
(aClass implements:javaSelector) ifFalse:[ |
|
1161 |
aClass |
|
1162 |
compile:source |
|
1163 |
classified:'java support' |
|
1164 |
logged:false. |
|
1165 |
||
1166 |
cloneCode := aClass compiledMethodAt:smalltalkSelector. |
|
1167 |
cloneCode source:fakedSource. |
|
1168 |
||
1169 |
Class withoutUpdatingChangesDo:[ |
|
1170 |
aClass removeSelector:smalltalkSelector. |
|
1171 |
aClass addSelector:javaSelector withMethod:cloneCode. |
|
1172 |
] |
|
1173 |
]. |
|
1174 |
||
1175 |
"Created: / 5.11.1998 / 19:30:22 / cg" |
|
1176 |
"Modified: / 5.11.1998 / 19:37:57 / cg" |
|
1177 |
! |
|
1178 |
||
253 | 1179 |
deinitialize |
1180 |
|table| |
|
1181 |
||
1182 |
StandardThreadGroup := nil. |
|
1183 |
self releaseAllMonitors. |
|
1184 |
||
480 | 1185 |
KnownWindows notNil ifTrue:[ |
1186 |
KnownWindows do:[:v | |
|
1187 |
v isTopView ifTrue:[ |
|
1188 |
v destroy |
|
1189 |
] |
|
1190 |
] |
|
1191 |
]. |
|
1192 |
||
253 | 1193 |
JavaWindowGroup := nil. |
1194 |
KnownWindows := nil. |
|
1195 |
OpenFileTable := nil. |
|
1196 |
JavaClasses := nil. |
|
380 | 1197 |
JavaMethods := nil. |
253 | 1198 |
|
1199 |
" |
|
1200 |
JavaVM deinitialize |
|
1201 |
" |
|
1202 |
||
1203 |
"Created: / 3.1.1998 / 21:28:14 / cg" |
|
480 | 1204 |
"Modified: / 3.12.1998 / 20:33:21 / cg" |
253 | 1205 |
! |
1206 |
||
307 | 1207 |
deinitializeAdditionalJavaProtocol |
1208 |
"install additional java protocol in smalltalk classes, req'd for java programs" |
|
1209 |
||
459 | 1210 |
#( |
1211 |
#'clone()Ljava/lang/Object;' |
|
1212 |
#'equals(Ljava/lang/Object;)Z' |
|
1213 |
#'toString()Ljava/lang/String;' |
|
1214 |
) do:[:sel | |
|
1215 |
(Object implements:sel) ifTrue:[ |
|
1216 |
Class withoutUpdatingChangesDo:[ |
|
1217 |
Object removeSelector:sel. |
|
1218 |
] |
|
1219 |
]. |
|
307 | 1220 |
]. |
1221 |
||
1222 |
" |
|
1223 |
self deinitializeAdditionalJavaProtocol |
|
1224 |
" |
|
1225 |
||
1226 |
"Created: / 4.2.1998 / 21:37:10 / cg" |
|
459 | 1227 |
"Modified: / 19.11.1998 / 01:18:36 / cg" |
307 | 1228 |
! |
1229 |
||
253 | 1230 |
initialize |
1231 |
|table| |
|
1232 |
||
1233 |
DUMMY_LONG_HIGHWORD := 1. |
|
1234 |
DUMMY_DOUBLE_HIGHWORD := 2. |
|
1235 |
||
1236 |
StandardThreadGroup := nil. |
|
261 | 1237 |
NoAudio := true. |
262 | 1238 |
"/ NoAudio := false. |
253 | 1239 |
|
1240 |
JavaConsoleStream := Transcript. |
|
1241 |
||
1242 |
FullExceptionTrace := StackTrace := false. |
|
1243 |
WindowOPTrace := DrawOPTrace := EventTrace := ThreadTrace := false. |
|
1244 |
MonitorTrace := ExceptionTrace := FileOpenTrace := FileIOTrace := false. |
|
474 | 1245 |
ExceptionDebug := ExitDebug := false. |
253 | 1246 |
WindowCreationTrace := false. |
1247 |
||
1248 |
FileOpenConfirmation := true. |
|
390 | 1249 |
SocketConnectConfirmation := true. |
253 | 1250 |
|
255 | 1251 |
"/ WindowOPTrace := true. |
1252 |
"/ MonitorTrace := true. |
|
1253 |
"/ ThreadTrace := true. |
|
253 | 1254 |
|
1255 |
UnhandledJavaExceptionSignal := (Signal new) mayProceed:false. |
|
1256 |
UnhandledJavaExceptionSignal nameClass:self message:#unhandledJavaExceptionSignal. |
|
1257 |
UnhandledJavaExceptionSignal notifierString:'unhandled java exception'. |
|
1258 |
||
1259 |
JavaExceptionSignal := (Signal new) mayProceed:false. |
|
1260 |
JavaExceptionSignal nameClass:self message:#javaExceptionSignal. |
|
1261 |
JavaExceptionSignal notifierString:'java exception'. |
|
1262 |
||
1263 |
UnimplementedInstructionSignal := (Signal new) mayProceed:false. |
|
1264 |
UnimplementedInstructionSignal nameClass:self message:#unimplementedInstructionSignal. |
|
1265 |
UnimplementedInstructionSignal notifierString:'unimplemented instruction'. |
|
1266 |
||
1267 |
UnimplementedNativeMethodSignal := (Signal new) mayProceed:false. |
|
1268 |
UnimplementedNativeMethodSignal nameClass:self message:#unimplementedNativeMethodSignal. |
|
1269 |
UnimplementedNativeMethodSignal notifierString:'unimplemented native method'. |
|
1270 |
||
1271 |
BadMessageSignal := (Signal new) mayProceed:false. |
|
1272 |
BadMessageSignal nameClass:self message:#badMessageSignal. |
|
1273 |
BadMessageSignal notifierString:'invalid message to JAVA object'. |
|
1274 |
||
1275 |
InternalErrorSignal := (Signal new) mayProceed:false. |
|
1276 |
InternalErrorSignal nameClass:self message:#internalErrorSignal. |
|
1277 |
InternalErrorSignal notifierString:'internal error'. |
|
1278 |
||
1279 |
CallHandlerSignal := (Signal new) mayProceed:false. |
|
1280 |
CallHandlerSignal nameClass:self message:#callHandlerSignal. |
|
1281 |
CallHandlerSignal notifierString:'internal signal'. |
|
1282 |
||
1283 |
" |
|
1284 |
JavaVM initialize |
|
1285 |
" |
|
1286 |
||
1287 |
"Created: / 2.1.1998 / 18:02:34 / cg" |
|
474 | 1288 |
"Modified: / 2.12.1998 / 23:02:22 / cg" |
253 | 1289 |
! |
1290 |
||
307 | 1291 |
initializeAdditionalJavaProtocol |
1292 |
"install additional java protocol in smalltalk classes, req'd for java programs" |
|
1293 |
||
1294 |
"/ since we use smalltalk Arrays for JavaArray, some |
|
1295 |
"/ additional (java-) protocol is required. |
|
423 | 1296 |
"/ This is also useful, when Smalltalk objects are passed to |
1297 |
"/ java ... |
|
1298 |
"/ We should implement all of the java.lang.Object protocol in |
|
1299 |
"/ Object, to be on the bright side of life; more of this later ... |
|
1300 |
||
1301 |
self |
|
1302 |
compile:'__clone |
|
307 | 1303 |
"this is smalltalk code with a java selector ... |
430 | 1304 |
(This source cannot be accepted in the browser, |
1305 |
since it has a funny selector.) |
|
307 | 1306 |
Has been added by JavaVM>>initializeAdditionalJavaProtocol" |
1307 |
||
1308 |
^ self shallowCopy' |
|
423 | 1309 |
selector:#'__clone' |
1310 |
asJavaMethod:#'clone()Ljava/lang/Object;' |
|
1311 |
fakedSource:'#''clone()Ljava/lang/Object;'' |
|
307 | 1312 |
"this is smalltalk code with a java selector ... |
430 | 1313 |
(This source cannot be accepted in the browser, |
1314 |
since it has a funny selector.) |
|
307 | 1315 |
Has been added by JavaVM>>initializeAdditionalJavaProtocol" |
1316 |
||
423 | 1317 |
^ self shallowCopy' |
1318 |
in:Object. |
|
1319 |
||
1320 |
self |
|
430 | 1321 |
compile:'__equals:arg |
1322 |
"this is smalltalk code with a java selector ... |
|
1323 |
(This source cannot be accepted in the browser, |
|
1324 |
since it has a funny selector.) |
|
1325 |
Has been added by JavaVM>>initializeAdditionalJavaProtocol" |
|
1326 |
||
1327 |
^ (arg = self) ifTrue:[1] ifFalse:[0]' |
|
1328 |
selector:#'__equals:' |
|
1329 |
asJavaMethod:#'equals(Ljava/lang/Object;)Z' |
|
1330 |
fakedSource:'#''equals(Ljava/lang/Object;)Z'' |
|
1331 |
"this is smalltalk code with a java selector ... |
|
1332 |
(This source cannot be accepted in the browser, |
|
1333 |
since it has a funny selector.) |
|
1334 |
Has been added by JavaVM>>initializeAdditionalJavaProtocol" |
|
1335 |
||
1336 |
^ (arg = self) ifTrue:[1] ifFalse:[0]' |
|
1337 |
in:Object. |
|
1338 |
||
1339 |
self |
|
423 | 1340 |
compile:'__toString |
1341 |
"this is smalltalk code with a java selector ... |
|
430 | 1342 |
(This source cannot be accepted in the browser, |
1343 |
since it has a funny selector.) |
|
423 | 1344 |
Has been added by JavaVM>>initializeAdditionalJavaProtocol" |
1345 |
||
1346 |
^ Java as_String:(self displayString)' |
|
1347 |
selector:#'__toString' |
|
1348 |
asJavaMethod:#'toString()Ljava/lang/String;' |
|
1349 |
fakedSource:'#''toString()Ljava/lang/String;'' |
|
1350 |
"this is smalltalk code with a java selector ... |
|
430 | 1351 |
(This source cannot be accepted in the browser, |
1352 |
since it has a funny selector.) |
|
423 | 1353 |
Has been added by JavaVM>>initializeAdditionalJavaProtocol" |
1354 |
||
1355 |
^ Java as_String:(self displayString)' |
|
1356 |
in:Object |
|
307 | 1357 |
|
1358 |
" |
|
1359 |
self initializeAdditionalJavaProtocol |
|
1360 |
" |
|
1361 |
||
1362 |
"Modified: / 28.1.1997 / 19:38:58 / stefan" |
|
1363 |
"Modified: / 22.1.1998 / 21:23:40 / av" |
|
1364 |
"Created: / 4.2.1998 / 21:35:46 / cg" |
|
430 | 1365 |
"Modified: / 10.11.1998 / 16:54:51 / cg" |
307 | 1366 |
! |
1367 |
||
253 | 1368 |
initializeBaseClasses |
1369 |
"load req'd base classes" |
|
1370 |
||
326 | 1371 |
#( |
1372 |
'java.lang.Object' |
|
1373 |
'java.lang.Class' |
|
1374 |
'java.lang.String' |
|
1375 |
'java.lang.System' |
|
1376 |
) do:[:cName | |
|
1377 |
(Java classForName:cName) isNil ifTrue:[ |
|
1378 |
self halt:('could not find required class:' , cName) |
|
1379 |
] |
|
1380 |
]. |
|
253 | 1381 |
|
1382 |
" |
|
1383 |
self initializeBaseClasses |
|
1384 |
" |
|
1385 |
||
1386 |
"Created: / 3.1.1998 / 21:13:28 / cg" |
|
326 | 1387 |
"Modified: / 30.3.1998 / 17:47:02 / cg" |
253 | 1388 |
! |
1389 |
||
1390 |
initializeOpenFileTable |
|
1391 |
OpenFileTable := OrderedCollection |
|
261 | 1392 |
with:Stdin |
1393 |
with:(JavaConsoleStream ? Stdout) |
|
1394 |
with:(JavaConsoleStream ? Stderr). |
|
253 | 1395 |
|
1396 |
" |
|
1397 |
JavaVM initializeOpenFileTable |
|
1398 |
" |
|
1399 |
||
1400 |
"Modified: / 6.8.1997 / 00:40:19 / cg" |
|
1401 |
"Created: / 2.1.1998 / 18:04:32 / cg" |
|
1402 |
! |
|
1403 |
||
1404 |
initializePrimitiveClasses |
|
1405 |
JavaClasses isNil ifTrue:[ |
|
405 | 1406 |
JavaClasses := Dictionary new. |
253 | 1407 |
]. |
1408 |
||
1409 |
#( |
|
405 | 1410 |
(#byte 'B' 1) |
1411 |
(#short 'S' 2) |
|
1412 |
(#int 'I' 4) |
|
1413 |
(#long 'J' 8) |
|
1414 |
(#boolean 'Z' 1) |
|
1415 |
(#char 'C' 2) |
|
1416 |
(#float 'F' 4) |
|
1417 |
(#double 'D' 8) |
|
1418 |
(#void 'V' 0) |
|
253 | 1419 |
) triplesDo:[:nm :sig :len | |
405 | 1420 |
|stClass jClass| |
1421 |
||
1422 |
"/ |
|
1423 |
"/ create a javaClass for it. |
|
1424 |
"/ |
|
1425 |
jClass := (Java at:'java.lang.Class') new. |
|
253 | 1426 |
"/ stClass := Class new. |
1427 |
"/ stClass setName:('JavaBase_' , nm) asSymbol. |
|
1428 |
"/ JavaClasses at:stClass put:jClass. |
|
1429 |
"/ JavaClasses at:jClass put:stClass. |
|
1430 |
||
405 | 1431 |
JavaClasses at:nm put:jClass |
253 | 1432 |
]. |
1433 |
||
1434 |
" |
|
1435 |
self initializePrimitiveClasses |
|
1436 |
" |
|
1437 |
||
405 | 1438 |
"Modified: / 22.10.1998 / 01:56:02 / cg" |
253 | 1439 |
! |
1440 |
||
1441 |
initializeSimulatedLibs |
|
277 | 1442 |
"return a collection of native libs which are considered |
1443 |
being already loaded. (used with jdk < 1.2)" |
|
1444 |
||
432 | 1445 |
LibPath := #( |
1446 |
'__builtIn__' |
|
1447 |
'/usr/local/lib' |
|
1448 |
'/usr/local/lib/java' |
|
1449 |
). |
|
1450 |
||
1451 |
SimulatedLibs := #( |
|
1452 |
'__builtIn__/net' |
|
1453 |
'__builtIn__/awt' |
|
1454 |
'__builtIn__/tawt' |
|
1455 |
'__builtIn__/winawt' |
|
1456 |
'__builtIn__/jpeg' |
|
1457 |
'__builtIn__/mmedia' |
|
1458 |
'__builtIn__/zip' |
|
1459 |
'__builtIn__/math' |
|
1460 |
||
1461 |
"/ KAVA ... |
|
1462 |
'__builtIn__/agent' |
|
457 | 1463 |
|
1464 |
"/ MS-java ... |
|
1465 |
'__builtIn__/msawt' |
|
1466 |
'__builtIn__/javart' |
|
277 | 1467 |
). |
253 | 1468 |
|
457 | 1469 |
" |
1470 |
self initializeSimulatedLibs |
|
1471 |
" |
|
1472 |
||
253 | 1473 |
"Created: / 4.1.1998 / 19:05:03 / cg" |
457 | 1474 |
"Modified: / 17.11.1998 / 23:53:02 / cg" |
277 | 1475 |
! |
1476 |
||
1477 |
initializeSimulatedNativeLibs |
|
1478 |
"return a collection of native libs which are considered |
|
1479 |
being already loaded (used with jdk >= 1.2)" |
|
1480 |
||
1481 |
SimulatedNativeLibs := #( |
|
1482 |
'/libawt.so' |
|
1483 |
). |
|
1484 |
||
1485 |
" |
|
1486 |
self initializeSimulatedNativeLibs |
|
1487 |
" |
|
1488 |
||
1489 |
"Modified: / 27.1.1998 / 18:43:10 / cg" |
|
253 | 1490 |
! |
1491 |
||
1492 |
initializeSystemPropertiesInto:props |
|
1493 |
|cpu os| |
|
1494 |
||
1495 |
"/ use JAVA compatible cpu-name |
|
1496 |
cpu := OperatingSystem getCPUType. |
|
1497 |
cpu = 'i386' ifTrue:[ |
|
280 | 1498 |
cpu := 'ix86' |
253 | 1499 |
]. |
475 | 1500 |
SimulatedOS notNil ifTrue:[ |
474 | 1501 |
os := SimulatedOS |
1502 |
] ifFalse:[ |
|
1503 |
os := OperatingSystem getOSType. |
|
1504 |
os := os asUppercaseFirst. |
|
1505 |
]. |
|
253 | 1506 |
|
1507 |
props at:'java.version' put:'1'. |
|
1508 |
props at:'java.vendor' put:'eXept Software AG'. |
|
342 | 1509 |
props at:'java.vendor.url' put:'http://www.exept.de'. |
253 | 1510 |
props at:'java.home' put:(self defaultJAVAHome). |
1511 |
props at:'java.class.version' put:'1'. |
|
1512 |
props at:'java.class.path' put:(self defaultCLASSPATH). |
|
1513 |
props at:'os.name' put:os. |
|
1514 |
props at:'os.arch' put:cpu. |
|
1515 |
props at:'os.version' put:'1'. |
|
1516 |
props at:'file.separator' put:(Filename separator asString). |
|
1517 |
props at:'path.separator' put:':'. |
|
1518 |
props at:'line.separator' put:(Character cr asString). |
|
1519 |
props at:'user.name' put:(OperatingSystem getLoginName). |
|
388 | 1520 |
props at:'user.home' put:(OperatingSystem getHomeDirectory ? Filename currentDirectory name). |
253 | 1521 |
props at:'user.dir' put:(Filename currentDirectory pathName). |
1522 |
||
1523 |
props at:'awt.toolkit' put:(self defaultWindowingToolKit). |
|
1524 |
||
1525 |
props at:'hotjava.home' put:(self defaultHotJavaHome). |
|
1526 |
||
1527 |
"/ undocumented ? |
|
255 | 1528 |
props at:'file.encoding.pkg' put:'sun.io'. |
253 | 1529 |
|
1530 |
"/ suppress copyright view in appletViewer ... |
|
1531 |
props at:'appletviewer.version' put:'1.1'. |
|
1532 |
||
280 | 1533 |
"/ new with jdk 1.2 |
1534 |
props at:'java.awt.graphicsenv' put:'sun.awt.X11GraphicsEnvironment'. |
|
284 | 1535 |
props at:'java.awt.fonts' put:'/usr/lib/X11/fonts'. |
280 | 1536 |
|
474 | 1537 |
"/ jws |
1538 |
props at:'jws.home' put:(self defaultJWSHome). |
|
1539 |
"/ new with jws 2.0 ... |
|
1540 |
props at:'jws.startcmd' put:'jws.showwin.mainide'. |
|
1541 |
||
253 | 1542 |
^ props |
1543 |
||
388 | 1544 |
" |
1545 |
self initializeSystemPropertiesInto:(Dictionary new) |
|
1546 |
" |
|
1547 |
||
253 | 1548 |
"Created: / 3.1.1998 / 14:26:39 / cg" |
475 | 1549 |
"Modified: / 3.12.1998 / 00:28:21 / cg" |
253 | 1550 |
! |
1551 |
||
1552 |
initializeVM |
|
307 | 1553 |
self initializeAdditionalJavaProtocol. |
1554 |
||
285 | 1555 |
self releaseAllJavaResources. |
255 | 1556 |
|
261 | 1557 |
JavaConsoleStream := Transcript. |
1558 |
||
255 | 1559 |
Java initAllStaticFields. |
1560 |
Java markAllClassesUninitialized. |
|
1561 |
||
429 | 1562 |
"/ force re-resolving; |
1563 |
"/ otherwise, class-inits would not be called |
|
1564 |
"/ by resolver ... (sigh) |
|
1565 |
||
1566 |
JavaMethod allSubInstancesDo:[:m | |
|
1567 |
m checked:false. |
|
1568 |
m code:nil. |
|
1569 |
]. |
|
1570 |
ObjectMemory flushCaches. "/ sigh - must flush inline caches. |
|
1571 |
||
434 | 1572 |
JavaClass startRememberingOrderOfClassInits. |
1573 |
||
277 | 1574 |
self initializeSimulatedLibs. "/ < jdk 1.2 |
1575 |
self initializeSimulatedNativeLibs. "/ >= jdk 1.2 |
|
253 | 1576 |
self initializeOpenFileTable. |
1577 |
||
1578 |
self initializeBaseClasses. |
|
1579 |
self initializePrimitiveClasses. |
|
1580 |
||
1581 |
Java initSystemClass. |
|
1582 |
||
255 | 1583 |
ObjectMemory addDependent:self. |
1584 |
||
253 | 1585 |
" |
285 | 1586 |
JavaVM initialize. |
1587 |
JavaVM initializeVM. |
|
253 | 1588 |
" |
1589 |
||
1590 |
"Created: / 3.1.1998 / 21:29:09 / cg" |
|
480 | 1591 |
"Modified: / 3.12.1998 / 20:33:02 / cg" |
261 | 1592 |
! |
1593 |
||
1594 |
initializeVMIfNoEventThreadRunning |
|
1595 |
(JavaEventThread isNil or:[JavaEventThread isDead]) ifTrue:[ |
|
270 | 1596 |
self initializeVM |
261 | 1597 |
]. |
1598 |
||
1599 |
" |
|
1600 |
JavaVM initializeVMIfNoEventThreadRunning |
|
1601 |
" |
|
1602 |
||
1603 |
"Modified: / 15.1.1998 / 17:29:34 / cg" |
|
1604 |
"Created: / 15.1.1998 / 17:32:27 / cg" |
|
255 | 1605 |
! |
1606 |
||
434 | 1607 |
reinitializeVM |
1608 |
|classesToInit| |
|
1609 |
||
1610 |
self releaseAllJavaResources. |
|
1611 |
||
1612 |
JavaConsoleStream := Transcript. |
|
1613 |
||
1614 |
Java initAllStaticFields. |
|
1615 |
Java markAllClassesUninitialized. |
|
1616 |
||
1617 |
self initializeOpenFileTable. |
|
1618 |
||
1619 |
classesToInit := JavaClass orderOfClassInits. |
|
1620 |
JavaClass startRememberingOrderOfClassInits. |
|
1621 |
||
451 | 1622 |
self initializePrimitiveClasses. |
455 | 1623 |
"/ Java initSystemClass. |
434 | 1624 |
|
1625 |
classesToInit do:[:jClass | |
|
455 | 1626 |
Transcript showCR:'classInit: ' , jClass name. |
434 | 1627 |
jClass classInit |
1628 |
]. |
|
455 | 1629 |
Java initSystemClass. |
434 | 1630 |
|
1631 |
"Created: / 12.11.1998 / 15:37:52 / cg" |
|
455 | 1632 |
"Modified: / 17.11.1998 / 16:10:11 / cg" |
434 | 1633 |
! |
1634 |
||
462 | 1635 |
reinitializeVMIfNoEventThreadRunning |
1636 |
(JavaEventThread isNil or:[JavaEventThread isDead]) ifTrue:[ |
|
1637 |
self reinitializeVM |
|
1638 |
]. |
|
1639 |
||
1640 |
" |
|
1641 |
JavaVM reinitializeVMIfNoEventThreadRunning |
|
1642 |
" |
|
1643 |
||
1644 |
"Modified: / 15.1.1998 / 17:29:34 / cg" |
|
1645 |
"Created: / 24.11.1998 / 15:45:49 / cg" |
|
1646 |
! |
|
1647 |
||
255 | 1648 |
releaseAllJavaResources |
380 | 1649 |
self deinitialize. |
1650 |
||
285 | 1651 |
FirstWindowCreationSemaphore := Semaphore new. |
423 | 1652 |
ScreenUpdaterProcess := nil. |
285 | 1653 |
|
1654 |
LoadedLibs := nil. "/ gc will reclaim them ... |
|
1655 |
LoadedNativeLibs := nil. "/ gc will reclaim them ... |
|
1656 |
||
1657 |
ImageStretchCache := nil. |
|
1658 |
||
1659 |
self terminateAllThreads. |
|
1660 |
||
255 | 1661 |
self releaseAllWindows. |
1662 |
self releaseAllStreams. |
|
1663 |
||
1664 |
" |
|
1665 |
JavaVM releaseAllJavaResources |
|
1666 |
" |
|
1667 |
||
1668 |
"Created: / 7.1.1998 / 22:49:42 / cg" |
|
423 | 1669 |
"Modified: / 5.11.1998 / 20:07:02 / cg" |
253 | 1670 |
! |
1671 |
||
1672 |
releaseAllMonitors |
|
1673 |
LockTable := WeakIdentityDictionary new. |
|
1674 |
LockTableAccess := Semaphore forMutualExclusion. |
|
1675 |
WaitTable := IdentityDictionary new. |
|
1676 |
WaitTableAccess := Semaphore forMutualExclusion. |
|
1677 |
||
1678 |
EnteredMonitorsPerProcess := IdentityDictionary new. |
|
1679 |
||
1680 |
" |
|
1681 |
JavaVM releaseAllMonitors |
|
1682 |
" |
|
1683 |
||
1684 |
"Created: / 2.1.1998 / 18:04:05 / cg" |
|
255 | 1685 |
"Modified: / 7.1.1998 / 22:58:10 / cg" |
1686 |
! |
|
1687 |
||
1688 |
releaseAllStreams |
|
307 | 1689 |
OpenFileTable notNil ifTrue:[ |
1690 |
OpenFileTable do:[:aStream | |
|
1691 |
aStream notNil ifTrue:[ |
|
1692 |
aStream ~~ Stdin ifTrue:[ |
|
1693 |
aStream ~~ Stdout ifTrue:[ |
|
1694 |
aStream ~~ Stderr ifTrue:[ |
|
1695 |
aStream ~~ JavaConsoleStream ifTrue:[ |
|
1696 |
aStream isExternalStream ifTrue:[ |
|
1697 |
aStream shutDown |
|
1698 |
] |
|
1699 |
] |
|
1700 |
] |
|
1701 |
] |
|
1702 |
] |
|
1703 |
] |
|
1704 |
] |
|
1705 |
]. |
|
255 | 1706 |
self initializeOpenFileTable. |
1707 |
||
1708 |
" |
|
261 | 1709 |
JavaVM releaseAllStreams |
255 | 1710 |
" |
1711 |
||
1712 |
"Created: / 7.1.1998 / 22:57:04 / cg" |
|
307 | 1713 |
"Modified: / 4.2.1998 / 19:53:11 / cg" |
255 | 1714 |
! |
1715 |
||
1716 |
releaseAllWindows |
|
1717 |
KnownWindows notNil ifTrue:[ |
|
261 | 1718 |
KnownWindows do:[:aView | |
1719 |
aView destroy |
|
1720 |
]. |
|
1721 |
KnownWindows := nil. |
|
255 | 1722 |
] |
1723 |
||
1724 |
" |
|
1725 |
self releaseAllWindows |
|
1726 |
" |
|
1727 |
||
1728 |
"Created: / 7.1.1998 / 22:58:32 / cg" |
|
1729 |
! |
|
1730 |
||
1731 |
releaseLeftOverMonitors |
|
1732 |
"release monitors held by dead processes" |
|
1733 |
||
1734 |
|deadProcesses| |
|
1735 |
||
1736 |
deadProcesses := IdentitySet new. |
|
1737 |
||
1738 |
EnteredMonitorsPerProcess keysAndValuesDo:[:p :monitors | |
|
261 | 1739 |
p isDead ifTrue:[ |
1740 |
monitors do:[:mon | |
|
1741 |
Transcript showCR:'release leftover monitor ...'. |
|
1742 |
mon release |
|
1743 |
]. |
|
1744 |
deadProcesses add:p. |
|
1745 |
] |
|
255 | 1746 |
]. |
1747 |
deadProcesses do:[:p | |
|
261 | 1748 |
EnteredMonitorsPerProcess removeKey:p |
255 | 1749 |
]. |
1750 |
||
1751 |
" |
|
1752 |
JavaVM releaseLeftOverMonitors |
|
1753 |
" |
|
1754 |
||
1755 |
"Created: / 8.1.1998 / 17:29:26 / cg" |
|
1756 |
"Modified: / 8.1.1998 / 17:38:33 / cg" |
|
253 | 1757 |
! |
1758 |
||
1759 |
systemProperties |
|
1760 |
|props| |
|
1761 |
||
1762 |
props := Dictionary new. |
|
1763 |
self initializeSystemPropertiesInto:props. |
|
1764 |
^ props |
|
1765 |
||
1766 |
"Created: / 3.1.1998 / 14:25:58 / cg" |
|
1767 |
"Modified: / 3.1.1998 / 14:32:38 / cg" |
|
255 | 1768 |
! |
1769 |
||
1770 |
terminateAllThreads |
|
261 | 1771 |
Java terminateAllThreads. |
1772 |
JavaEventThread := nil. |
|
255 | 1773 |
|
1774 |
"Created: / 8.1.1998 / 17:43:54 / cg" |
|
261 | 1775 |
"Modified: / 15.1.1998 / 17:29:00 / cg" |
255 | 1776 |
! |
1777 |
||
1778 |
update:something with:aParameter from:changedObject |
|
1779 |
something == #returnFromSnapshot ifTrue:[ |
|
426 | 1780 |
"/ self initializeVM |
255 | 1781 |
]. |
1782 |
||
1783 |
" |
|
1784 |
JavaVM initializeVM |
|
1785 |
" |
|
1786 |
||
1787 |
"Created: / 9.1.1998 / 10:30:13 / cg" |
|
426 | 1788 |
"Modified: / 6.11.1998 / 00:40:53 / cg" |
253 | 1789 |
! ! |
1790 |
||
1791 |
!JavaVM class methodsFor:'Signal constants'! |
|
1792 |
||
1793 |
badMessageSignal |
|
1794 |
^ BadMessageSignal |
|
1795 |
||
1796 |
"Created: / 2.1.1998 / 18:06:52 / cg" |
|
1797 |
! |
|
1798 |
||
1799 |
callHandlerSignal |
|
1800 |
^ CallHandlerSignal |
|
1801 |
||
1802 |
"Created: / 2.1.1998 / 18:07:16 / cg" |
|
1803 |
! |
|
1804 |
||
1805 |
internalErrorSignal |
|
1806 |
^ InternalErrorSignal |
|
1807 |
||
1808 |
"Created: / 2.1.1998 / 18:07:05 / cg" |
|
1809 |
! |
|
1810 |
||
1811 |
javaExceptionSignal |
|
1812 |
^ JavaExceptionSignal |
|
1813 |
||
1814 |
"Created: / 2.1.1998 / 18:05:58 / cg" |
|
1815 |
! |
|
1816 |
||
1817 |
unhandledJavaExceptionSignal |
|
1818 |
^ UnhandledJavaExceptionSignal |
|
1819 |
||
1820 |
"Created: / 2.1.1998 / 18:05:19 / cg" |
|
1821 |
! |
|
1822 |
||
1823 |
unimplementedInstructionSignal |
|
1824 |
^ UnimplementedInstructionSignal |
|
1825 |
||
1826 |
"Created: / 2.1.1998 / 18:06:15 / cg" |
|
1827 |
! |
|
1828 |
||
1829 |
unimplementedNativeMethodSignal |
|
1830 |
^ UnimplementedNativeMethodSignal |
|
1831 |
||
1832 |
"Created: / 2.1.1998 / 18:06:40 / cg" |
|
1833 |
! ! |
|
1834 |
||
1835 |
!JavaVM class methodsFor:'defaults'! |
|
1836 |
||
359 | 1837 |
audioEnabled |
1838 |
^ NoAudio not |
|
1839 |
||
1840 |
"Created: / 18.7.1998 / 22:31:36 / cg" |
|
1841 |
! |
|
1842 |
||
1843 |
audioEnabled:aBoolean |
|
1844 |
NoAudio := aBoolean not |
|
1845 |
||
1846 |
"Created: / 18.7.1998 / 22:31:20 / cg" |
|
1847 |
! |
|
1848 |
||
253 | 1849 |
defaultCLASSPATH |
1850 |
|s| |
|
1851 |
||
1852 |
s := '' writeStream. |
|
1853 |
Java classPath do:[:p | |
|
261 | 1854 |
s size == 0 ifFalse:[ |
1855 |
s nextPut:$: |
|
1856 |
]. |
|
1857 |
s nextPutAll:p. |
|
253 | 1858 |
]. |
1859 |
||
1860 |
^ s contents |
|
1861 |
||
1862 |
" |
|
1863 |
self defaultCLASSPATH |
|
1864 |
" |
|
1865 |
||
1866 |
"Modified: / 6.8.1997 / 00:51:17 / cg" |
|
1867 |
"Created: / 3.1.1998 / 14:27:21 / cg" |
|
1868 |
! |
|
1869 |
||
1870 |
defaultHotJavaHome |
|
1871 |
^ '/usr/local/java/hotjava'. |
|
1872 |
||
1873 |
"Modified: / 5.8.1997 / 04:13:36 / cg" |
|
1874 |
"Created: / 3.1.1998 / 14:27:34 / cg" |
|
1875 |
! |
|
1876 |
||
1877 |
defaultJAVAHome |
|
1878 |
^ Java javaHome |
|
1879 |
||
1880 |
"Modified: / 6.8.1997 / 00:54:44 / cg" |
|
1881 |
"Created: / 3.1.1998 / 14:27:01 / cg" |
|
1882 |
! |
|
1883 |
||
1884 |
defaultJWSHome |
|
474 | 1885 |
'/phys/idefix/home2/java/JWS2_0/Java-WorkShop2.0/JWS' asFilename exists ifTrue:[ |
479 | 1886 |
^ '/phys/idefix/home2/java/JWS2_0/Java-WorkShop2.0/JWS' |
474 | 1887 |
]. |
1888 |
||
253 | 1889 |
^ '/usr/local/java/JWS'. |
1890 |
||
1891 |
"Created: / 3.1.1998 / 14:27:42 / cg" |
|
479 | 1892 |
"Modified: / 3.12.1998 / 14:54:08 / cg" |
253 | 1893 |
! |
1894 |
||
1895 |
defaultWindowingToolKit |
|
1896 |
"/ prefer the windows toolkit ... |
|
1897 |
||
1898 |
(Java classForName:'sun.awt.windows.WToolkit') notNil ifTrue:[ |
|
277 | 1899 |
^ 'sun.awt.windows.WToolkit'. |
1900 |
]. |
|
1901 |
(Java classForName:'sun.awt.motif.MToolkit') notNil ifTrue:[ |
|
1902 |
^ 'sun.awt.motif.MToolkit'. |
|
1903 |
]. |
|
253 | 1904 |
|
1905 |
^ 'sun.awt.tiny.TinyToolkit'. |
|
1906 |
||
1907 |
||
1908 |
"/ ^ 'sun.awt.win32.MToolkit'. |
|
1909 |
"/ ^ 'sun.awt.motif.MToolkit'. |
|
1910 |
||
277 | 1911 |
" |
1912 |
self defaultWindowingToolKit |
|
1913 |
" |
|
1914 |
||
253 | 1915 |
"Created: / 3.1.1998 / 14:27:49 / cg" |
277 | 1916 |
"Modified: / 27.1.1998 / 21:52:52 / cg" |
253 | 1917 |
! |
1918 |
||
390 | 1919 |
fileOpenConfirmation |
1920 |
^ FileOpenConfirmation |
|
1921 |
||
1922 |
"Created: / 19.10.1998 / 16:01:44 / cg" |
|
1923 |
! |
|
1924 |
||
1925 |
fileOpenConfirmation:aBoolean |
|
1926 |
FileOpenConfirmation := aBoolean |
|
1927 |
||
1928 |
"Created: / 19.10.1998 / 16:01:56 / cg" |
|
1929 |
! |
|
1930 |
||
253 | 1931 |
javaConsole:aStream |
1932 |
JavaConsoleStream := aStream |
|
1933 |
||
1934 |
" |
|
261 | 1935 |
JavaVM javaConsole:Transcript |
253 | 1936 |
" |
1937 |
||
1938 |
"Modified: / 6.8.1997 / 00:34:13 / cg" |
|
1939 |
"Created: / 3.1.1998 / 14:27:58 / cg" |
|
1940 |
! |
|
1941 |
||
1942 |
javaConsoleStream |
|
1943 |
^ JavaConsoleStream |
|
1944 |
||
1945 |
"Created: / 3.1.1998 / 14:32:16 / cg" |
|
390 | 1946 |
! |
1947 |
||
1948 |
socketConnectConfirmation |
|
1949 |
^ SocketConnectConfirmation |
|
1950 |
||
1951 |
"Created: / 19.10.1998 / 16:02:15 / cg" |
|
1952 |
! |
|
1953 |
||
1954 |
socketConnectConfirmation:aBoolean |
|
1955 |
SocketConnectConfirmation := aBoolean |
|
1956 |
||
1957 |
"Created: / 19.10.1998 / 16:02:06 / cg" |
|
253 | 1958 |
! ! |
1959 |
||
1960 |
!JavaVM class methodsFor:'fileIO'! |
|
1961 |
||
1962 |
addOpenFile:aStream |
|
1963 |
OpenFileTable add:aStream. |
|
1964 |
^ OpenFileTable size - 1. |
|
1965 |
||
1966 |
"Created: / 2.1.1998 / 18:32:59 / cg" |
|
1967 |
! |
|
1968 |
||
1969 |
getOpenFileAt:idx |
|
1970 |
^ OpenFileTable at:idx+1 ifAbsent:nil. |
|
1971 |
||
1972 |
"Created: / 2.1.1998 / 18:28:01 / cg" |
|
1973 |
"Modified: / 2.1.1998 / 18:33:06 / cg" |
|
1974 |
! |
|
1975 |
||
1976 |
setOpenFile:aStream at:idx |
|
1977 |
OpenFileTable size < (idx+1) ifTrue:[ |
|
261 | 1978 |
OpenFileTable grow:idx+1. |
253 | 1979 |
]. |
1980 |
OpenFileTable at:idx+1 put:aStream. |
|
1981 |
||
1982 |
"Modified: / 2.1.1998 / 18:33:21 / cg" |
|
1983 |
! ! |
|
1984 |
||
1985 |
!JavaVM class methodsFor:'helpers'! |
|
1986 |
||
268
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1987 |
classForJavaClassObject:aJavaClassObject |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1988 |
"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
|
1989 |
|
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1990 |
^ JavaClasses at:aJavaClassObject ifAbsent:nil. |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1991 |
|
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1992 |
"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
|
1993 |
! |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
1994 |
|
253 | 1995 |
enteredMonitors |
1996 |
|p monitors| |
|
1997 |
||
1998 |
p := Processor activeProcess. |
|
1999 |
monitors := EnteredMonitorsPerProcess at:p ifAbsent:nil. |
|
2000 |
monitors isNil ifTrue:[ |
|
261 | 2001 |
monitors := OrderedCollection new. |
2002 |
EnteredMonitorsPerProcess at:p put:monitors. |
|
253 | 2003 |
]. |
2004 |
^ monitors |
|
2005 |
||
2006 |
"Created: / 2.1.1998 / 21:26:19 / cg" |
|
2007 |
! |
|
2008 |
||
268
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
2009 |
javaClassObjectForClass:aClass |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
2010 |
"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
|
2011 |
instance for it." |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
2012 |
|
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
2013 |
|jClass| |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
2014 |
|
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
2015 |
jClass := JavaClasses at:aClass ifAbsent:nil. |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
2016 |
jClass isNil ifTrue:[ |
405 | 2017 |
"/ class must be initialized (with all of its superclasses ?). |
2018 |
aClass isJavaClass ifTrue:[ |
|
2019 |
aClass classInit. |
|
2020 |
]. |
|
2021 |
JavaClasses at:aClass put:(jClass := (Java at:'java.lang.Class') new). |
|
2022 |
JavaClasses at:jClass put:aClass. |
|
268
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
2023 |
]. |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
2024 |
^ jClass |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
2025 |
|
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
2026 |
"Created: / 23.1.1998 / 17:43:38 / cg" |
405 | 2027 |
"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
|
2028 |
! |
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
2029 |
|
321 | 2030 |
javaMethodObjectForMethod:aMethod |
2031 |
"given a real method, return the corresponding java.lang.reflect.Method |
|
2032 |
instance for it." |
|
2033 |
||
2034 |
|jMethod| |
|
2035 |
||
2036 |
jMethod := JavaMethods at:aMethod ifAbsent:nil. |
|
2037 |
jMethod isNil ifTrue:[ |
|
2038 |
"/ class must be initialized (with all of its superclasses ?). |
|
2039 |
||
2040 |
JavaMethods at:aMethod put:(jMethod := (Java at:'java.lang.reflect.Method') new). |
|
2041 |
JavaMethods at:jMethod put:aMethod. |
|
2042 |
]. |
|
2043 |
^ jMethod |
|
2044 |
||
2045 |
"Modified: / 23.1.1998 / 17:46:51 / cg" |
|
2046 |
"Created: / 9.2.1998 / 15:59:16 / cg" |
|
2047 |
! |
|
2048 |
||
253 | 2049 |
javaThreadForSTProcess:stProcess |
2050 |
|t| |
|
2051 |
||
2052 |
t := Java threads keyAtValue:stProcess ifAbsent:nil. |
|
2053 |
t == 0 ifTrue:[ |
|
261 | 2054 |
^ nil |
253 | 2055 |
]. |
2056 |
^ t |
|
2057 |
||
2058 |
"Modified: / 26.8.1997 / 19:56:31 / cg" |
|
2059 |
"Created: / 3.1.1998 / 01:53:41 / cg" |
|
2060 |
! |
|
2061 |
||
321 | 2062 |
methodForJavaMethodObject:aJavaMethodObject |
2063 |
"given java.lang.reflect.Method instance, return the real method for it." |
|
2064 |
||
2065 |
^ JavaMethods at:aJavaMethodObject ifAbsent:nil. |
|
2066 |
||
2067 |
"Created: / 9.2.1998 / 16:01:48 / cg" |
|
2068 |
! |
|
2069 |
||
253 | 2070 |
newThread:name |
274 | 2071 |
|thread threadClass i| |
253 | 2072 |
|
2073 |
threadClass := Java at:'java.lang.Thread'. |
|
2074 |
||
2075 |
thread := (Java at:'java.lang.Thread') basicNew. |
|
2076 |
thread instVarNamed:'name' put:(Java as_String:name). |
|
2077 |
thread instVarNamed:'priority' put:(threadClass instVarNamed:'NORM_PRIORITY'). |
|
2078 |
thread instVarNamed:'single_step' put:0. |
|
2079 |
thread instVarNamed:'daemon' put:0. |
|
2080 |
thread instVarNamed:'stillborn' put:0. |
|
2081 |
thread instVarNamed:'target' put:nil. |
|
274 | 2082 |
"/ |
2083 |
"/ that on was only temporarily present in JDK1.1.3 (sigh) |
|
2084 |
"/ |
|
2085 |
(i := thread class instVarOffsetOf:'initial_stack_memory') notNil ifTrue:[ |
|
2086 |
thread instVarAt:i put:0. |
|
2087 |
]. |
|
253 | 2088 |
thread instVarNamed:'group' put:(self standardThreadGroup). |
2089 |
^ thread |
|
2090 |
||
2091 |
"Created: / 3.1.1998 / 01:47:30 / cg" |
|
274 | 2092 |
"Modified: / 27.1.1998 / 00:54:33 / cg" |
253 | 2093 |
! |
2094 |
||
2095 |
stProcessForJavaThread:jThread |
|
2096 |
|p| |
|
2097 |
||
2098 |
p := Java threads at:jThread ifAbsent:nil. |
|
2099 |
p == 0 ifTrue:[ |
|
261 | 2100 |
^ nil |
253 | 2101 |
]. |
2102 |
^ p |
|
2103 |
||
2104 |
"Created: / 2.1.1998 / 21:48:27 / cg" |
|
2105 |
"Modified: / 3.1.1998 / 01:53:55 / cg" |
|
2106 |
! |
|
2107 |
||
2108 |
standardThreadGroup |
|
2109 |
|standardGroup threadClass| |
|
2110 |
||
2111 |
StandardThreadGroup isNil ifTrue:[ |
|
457 | 2112 |
threadClass := Java at:'java.lang.Thread'. |
2113 |
||
2114 |
standardGroup := (Java at:'java.lang.ThreadGroup') new. |
|
2115 |
standardGroup instVarNamed:'parent' put:nil. |
|
2116 |
standardGroup instVarNamed:'name' put:(Java as_String:'main'). |
|
2117 |
standardGroup instVarNamed:'maxPriority' put:(threadClass instVarNamed:'MAX_PRIORITY'). |
|
2118 |
standardGroup instVarNamed:'destroyed' put:0. |
|
2119 |
standardGroup instVarNamed:'daemon' put:nil. |
|
2120 |
(standardGroup class instVarOffsetOf:'vmAllowSuspension') notNil ifTrue:[ |
|
2121 |
standardGroup instVarNamed:'vmAllowSuspension' put:0. |
|
2122 |
]. |
|
2123 |
standardGroup instVarNamed:'nthreads' put:0. |
|
2124 |
standardGroup instVarNamed:'ngroups' put:0. |
|
2125 |
standardGroup instVarNamed:'groups' put:nil. |
|
2126 |
StandardThreadGroup := standardGroup. |
|
253 | 2127 |
]. |
2128 |
^ StandardThreadGroup |
|
2129 |
||
2130 |
"Created: / 3.1.1998 / 01:41:54 / cg" |
|
457 | 2131 |
"Modified: / 17.11.1998 / 22:55:30 / cg" |
253 | 2132 |
! |
2133 |
||
2134 |
wakeup:anObject |
|
2135 |
JavaVM releaseAndSignalSemaphoreFor:anObject. |
|
2136 |
||
2137 |
"Created: / 3.1.1998 / 02:29:27 / cg" |
|
2138 |
"Modified: / 3.1.1998 / 03:08:05 / cg" |
|
2139 |
! |
|
2140 |
||
2141 |
wakeupAll:anObject |
|
2142 |
JavaVM releaseAndSignalForAllSemaphoreFor:anObject. |
|
2143 |
||
2144 |
"Created: / 3.1.1998 / 03:07:48 / cg" |
|
2145 |
"Modified: / 3.1.1998 / 03:08:15 / cg" |
|
2146 |
! ! |
|
2147 |
||
2148 |
!JavaVM class methodsFor:'helpers - awt'! |
|
2149 |
||
2150 |
commonReshapeComponent:nativeContext |
|
277 | 2151 |
|view x y width height ext menu| |
2152 |
||
2153 |
view := self viewForWPeer:nativeContext. |
|
253 | 2154 |
|
2155 |
x := nativeContext argAt:1. |
|
2156 |
y := nativeContext argAt:2. |
|
2157 |
width := nativeContext argAt:3. |
|
2158 |
height := nativeContext argAt:4. |
|
261 | 2159 |
ext := width@height. |
253 | 2160 |
|
2161 |
"/ 'pReshape ' print. view print. |
|
2162 |
"/ ' ' print. x print. '/' print. y print. |
|
261 | 2163 |
"/ ' extent: ' print. ext printNL. |
253 | 2164 |
|
2165 |
(view isTopView |
|
2166 |
or:[view isMemberOf:JavaEmbeddedFrameView]) ifTrue:[ |
|
2167 |
"/ |
|
2168 |
"/ dont allow setting the origin |
|
2169 |
"/ |
|
2170 |
menu := self topViewsMenu:view. |
|
2171 |
menu notNil ifTrue:[ |
|
2172 |
"/ must add the menus height |
|
261 | 2173 |
height := height + menu height. |
2174 |
ext := width@height. |
|
253 | 2175 |
]. |
261 | 2176 |
|
2177 |
"/ to prevent a view from not being visible/closable |
|
2178 |
"/ in case Java goes mad .. |
|
2179 |
||
2180 |
(width < 30 |
|
2181 |
or:[height < 10]) ifTrue:[ |
|
2182 |
"/ self halt. |
|
2183 |
width := 30. |
|
2184 |
height := 20. |
|
2185 |
ext := width@height. |
|
2186 |
]. |
|
2187 |
||
2188 |
view extent:ext. |
|
270 | 2189 |
(view isKindOf:ModalBox) ifTrue:[ |
2190 |
view preferredExtent:ext |
|
2191 |
]. |
|
261 | 2192 |
|
2193 |
"/ adjust non-resizable views min/max |
|
2194 |
||
2195 |
view isTopView ifTrue:[ |
|
2196 |
view minExtent notNil ifTrue:[ |
|
2197 |
view minExtent:ext. |
|
2198 |
view maxExtent:ext |
|
2199 |
]. |
|
2200 |
] |
|
253 | 2201 |
] ifFalse:[ |
2202 |
(view superView notNil |
|
2203 |
and:[view superView isTopView]) ifTrue:[ |
|
2204 |
menu := self topViewsMenu:view superView. |
|
2205 |
menu notNil ifTrue:[ |
|
2206 |
"/ must add menus height to yPos |
|
2207 |
y := y + menu height. |
|
2208 |
] |
|
261 | 2209 |
] ifFalse:[ |
2210 |
"/ post a configuration event |
|
318 | 2211 |
EventTrace == true ifTrue:[ |
2212 |
'JAVA: configure: need event' printCR. |
|
2213 |
] |
|
253 | 2214 |
]. |
261 | 2215 |
view origin:x@y extent:ext. |
253 | 2216 |
]. |
2217 |
||
2218 |
^ nil |
|
2219 |
||
2220 |
"Created: / 4.1.1998 / 18:00:52 / cg" |
|
318 | 2221 |
"Modified: / 6.2.1998 / 01:45:46 / cg" |
253 | 2222 |
! |
2223 |
||
2224 |
createdWindowsView:aView for:aJavaPeer |
|
2225 |
"this is only sent with the sun.awt.windows toolkit" |
|
2226 |
||
2227 |
aJavaPeer instVarNamed:'pData' put:aView. |
|
2228 |
||
2229 |
JavaWindowGroup isNil ifTrue:[ |
|
284 | 2230 |
JavaWindowGroup := WindowGroup new. |
2231 |
JavaWindowGroup isForModalSubview:true. |
|
253 | 2232 |
]. |
2233 |
aView windowGroup:JavaWindowGroup. |
|
2234 |
JavaWindowGroup addView:aView. |
|
2235 |
||
2236 |
KnownWindows isNil ifTrue:[ |
|
284 | 2237 |
KnownWindows := IdentityDictionary new. |
253 | 2238 |
]. |
2239 |
KnownWindows at:aJavaPeer put:aView. |
|
2240 |
||
284 | 2241 |
FirstWindowCreationSemaphore signalIf. |
2242 |
||
261 | 2243 |
"/'*** ' print. aJavaPeer print. ' -> ' print. aView printCR. |
2244 |
"/(aView isKindOf:ModalBox) ifTrue:[ |
|
2245 |
"/ self halt. |
|
2246 |
"/]. |
|
2247 |
||
253 | 2248 |
"Created: / 4.1.1998 / 17:57:16 / cg" |
284 | 2249 |
"Modified: / 28.1.1998 / 22:40:19 / cg" |
253 | 2250 |
! |
2251 |
||
255 | 2252 |
gcForWGraphics:nativeContext |
270 | 2253 |
|jGraphics gc orgX orgY trans| |
255 | 2254 |
|
2255 |
jGraphics := nativeContext receiver. |
|
459 | 2256 |
O_WGgraphics_pData isNil ifTrue:[ |
2257 |
O_WGgraphics_pData := (jGraphics class instVarOffsetOf:'pData'). |
|
2258 |
]. |
|
2259 |
O_WGgraphics_originX isNil ifTrue:[ |
|
2260 |
O_WGgraphics_originX := (jGraphics class instVarOffsetOf:'originX'). |
|
2261 |
]. |
|
2262 |
O_WGgraphics_originY isNil ifTrue:[ |
|
2263 |
O_WGgraphics_originY := (jGraphics class instVarOffsetOf:'originY'). |
|
2264 |
]. |
|
2265 |
gc := jGraphics instVarAt:O_WGgraphics_pData. |
|
270 | 2266 |
|
2267 |
trans := gc translation. |
|
459 | 2268 |
orgX := jGraphics instVarAt:O_WGgraphics_originX. |
2269 |
orgY := jGraphics instVarAt:O_WGgraphics_originY. |
|
270 | 2270 |
((orgX ~~ trans x) or:[orgY ~~ trans y]) ifTrue:[ |
2271 |
gc translation:orgX@orgY |
|
2272 |
]. |
|
255 | 2273 |
^ gc |
2274 |
||
2275 |
"Created: / 8.1.1998 / 00:16:38 / cg" |
|
459 | 2276 |
"Modified: / 19.11.1998 / 01:44:12 / cg" |
255 | 2277 |
! |
2278 |
||
261 | 2279 |
jPeerForView:aView |
2280 |
^ KnownWindows keyAtValue:aView ifAbsent:nil |
|
2281 |
||
2282 |
"Created: / 15.1.1998 / 13:48:01 / cg" |
|
2283 |
"Modified: / 15.1.1998 / 13:48:43 / cg" |
|
2284 |
! |
|
2285 |
||
255 | 2286 |
pReshape:nativeContext |
2287 |
|jFramePeer view x y width height menu| |
|
2288 |
||
2289 |
jFramePeer := nativeContext receiver. |
|
2290 |
view := jFramePeer instVarNamed:'pData'. |
|
2291 |
||
2292 |
x := nativeContext argAt:1. |
|
2293 |
y := nativeContext argAt:2. |
|
2294 |
width := nativeContext argAt:3. |
|
2295 |
height := nativeContext argAt:4. |
|
2296 |
||
2297 |
"/ 'pReshape ' print. view print. |
|
2298 |
"/ ' ' print. x print. '/' print. y print. |
|
2299 |
"/ ' extent: ' print. width print. '/' print. height printNL. |
|
2300 |
||
2301 |
(view isTopView |
|
2302 |
or:[view isMemberOf:JavaEmbeddedFrameView]) ifTrue:[ |
|
261 | 2303 |
"/ |
2304 |
"/ dont allow setting the origin |
|
2305 |
"/ |
|
2306 |
menu := self topViewsMenu:view. |
|
2307 |
menu notNil ifTrue:[ |
|
2308 |
"/ must add the menus height |
|
2309 |
height := height + menu height |
|
2310 |
]. |
|
2311 |
view extent:width@height. |
|
255 | 2312 |
] ifFalse:[ |
261 | 2313 |
(view superView notNil |
2314 |
and:[view superView isTopView]) ifTrue:[ |
|
2315 |
menu := self topViewsMenu:view superView. |
|
2316 |
menu notNil ifTrue:[ |
|
2317 |
"/ must add menus height to yPos |
|
2318 |
y := y + menu height. |
|
2319 |
] |
|
2320 |
]. |
|
2321 |
view origin:x@y extent:width@height. |
|
255 | 2322 |
]. |
2323 |
||
2324 |
^ nil |
|
2325 |
||
2326 |
"Modified: / 21.8.1997 / 19:34:16 / cg" |
|
2327 |
"Created: / 7.1.1998 / 21:47:11 / cg" |
|
2328 |
! |
|
2329 |
||
253 | 2330 |
topViewsMenu:view |
2331 |
|idx| |
|
2332 |
||
2333 |
view isTopView ifTrue:[ |
|
261 | 2334 |
view subViews size > 0 ifTrue:[ |
2335 |
(idx := view subViews findFirst:[:v | v isMemberOf:MenuPanel]) ~~ 0 ifTrue:[ |
|
2336 |
"/ must add the menus height |
|
2337 |
^ view subViews at:idx |
|
2338 |
] |
|
2339 |
]. |
|
253 | 2340 |
]. |
2341 |
^ nil |
|
2342 |
||
2343 |
"Modified: / 4.8.1997 / 01:23:06 / cg" |
|
2344 |
"Created: / 4.1.1998 / 18:01:42 / cg" |
|
255 | 2345 |
! |
2346 |
||
2347 |
viewForWPeer:nativeContext |
|
459 | 2348 |
|jPeer| |
255 | 2349 |
|
2350 |
jPeer := nativeContext receiver. |
|
277 | 2351 |
|
2352 |
"/ sigh; pData was renamed to pNativeWidget in jdk1.2 ... |
|
459 | 2353 |
O_FramePeer_pNativeWidget isNil ifTrue:[ |
2354 |
O_FramePeer_pNativeWidget := (jPeer class instVarOffsetOf:'pNativeWidget'). |
|
2355 |
O_FramePeer_pNativeWidget isNil ifTrue:[ |
|
2356 |
O_FramePeer_pNativeWidget := 0. |
|
2357 |
O_FramePeer_pData isNil ifTrue:[ |
|
2358 |
O_FramePeer_pData := (jPeer class instVarOffsetOf:'pData'). |
|
2359 |
]. |
|
2360 |
] |
|
2361 |
]. |
|
2362 |
O_FramePeer_pNativeWidget > 0 ifTrue:[ |
|
277 | 2363 |
"/ ok, we are < 1.2 |
459 | 2364 |
^ jPeer instVarAt:O_FramePeer_pNativeWidget. |
2365 |
]. |
|
2366 |
^ jPeer instVarAt:O_FramePeer_pData. |
|
2367 |
||
2368 |
"Modified: / 19.11.1998 / 01:43:20 / cg" |
|
253 | 2369 |
! ! |
2370 |
||
2371 |
!JavaVM class methodsFor:'helpers - exceptions'! |
|
2372 |
||
261 | 2373 |
throwArrayIndexOutOfBoundsException:badIndex |
2374 |
|exClass ex| |
|
2375 |
||
2376 |
"/ self |
|
2377 |
"/ throwExceptionClassName:'java.lang.ArrayIndexOutOfBoundsException' |
|
2378 |
"/ withMessage:'bad array index: ' , badIndex printString |
|
2379 |
||
2380 |
exClass := Java classForName:'java.lang.ArrayIndexOutOfBoundsException'. |
|
459 | 2381 |
ex := exClass newWith_int:badIndex. |
261 | 2382 |
|
2383 |
self throwException:ex |
|
2384 |
||
2385 |
"Created: / 14.1.1998 / 21:36:05 / cg" |
|
459 | 2386 |
"Modified: / 20.11.1998 / 13:27:14 / cg" |
261 | 2387 |
! |
2388 |
||
253 | 2389 |
throwClassNotFoundException |
255 | 2390 |
self |
261 | 2391 |
throwExceptionClassName:'java.lang.ClassNotFoundException' |
2392 |
withMessage:'no such class' |
|
255 | 2393 |
|
253 | 2394 |
"Created: / 4.1.1998 / 22:25:26 / cg" |
255 | 2395 |
"Modified: / 7.1.1998 / 15:25:35 / cg" |
253 | 2396 |
! |
2397 |
||
2398 |
throwClassNotFoundException:className |
|
255 | 2399 |
self |
429 | 2400 |
throwExceptionClassName:'java.lang.ClassNotFoundException' |
2401 |
withMessage:'no such class: ' , className |
|
255 | 2402 |
|
253 | 2403 |
"Created: / 4.1.1998 / 22:26:09 / cg" |
429 | 2404 |
"Modified: / 10.11.1998 / 13:20:31 / cg" |
255 | 2405 |
! |
2406 |
||
2407 |
throwException:aJavaException |
|
459 | 2408 |
|con jMsg msg exClass srchCon handlerContext handlerPC method pc hPC| |
255 | 2409 |
|
2410 |
ExceptionTrace ifTrue:[ |
|
347 | 2411 |
'JAVA: exception: ' print. aJavaException class fullName printCR. |
255 | 2412 |
]. |
2413 |
ExceptionDebug ifTrue:[ |
|
347 | 2414 |
self halt:('JAVA: exception: ' , aJavaException class fullName). |
448 | 2415 |
"/ self internalError:('JAVA: exception: ' , aJavaException class fullName). |
255 | 2416 |
]. |
2417 |
||
459 | 2418 |
"/ |
2419 |
"/ search stack for a javaContext which handles that exception |
|
2420 |
"/ |
|
2421 |
srchCon := thisContext sender. |
|
2422 |
[handlerContext isNil and:[srchCon notNil]] whileTrue:[ |
|
2423 |
(srchCon isJavaContext) ifTrue:[ |
|
2424 |
method := srchCon method. |
|
2425 |
pc := srchCon pc. |
|
2426 |
(hPC := method handlerFor:aJavaException at:pc) notNil ifTrue:[ |
|
2427 |
handlerPC := hPC. |
|
2428 |
handlerContext := srchCon |
|
2429 |
]. |
|
2430 |
]. |
|
2431 |
srchCon := srchCon sender. |
|
2432 |
]. |
|
2433 |
||
2434 |
handlerContext isNil ifTrue:[ |
|
2435 |
"/ |
|
2436 |
"/ no JavaHandler ... let smalltalk handle it |
|
2437 |
"/ |
|
347 | 2438 |
exClass := aJavaException class. |
459 | 2439 |
msg := 'Java ' , exClass name. |
347 | 2440 |
jMsg := aJavaException instVarNamed:'detailMessage'. |
2441 |
jMsg notNil ifTrue:[ |
|
459 | 2442 |
msg := msg , ': ' , (Java as_ST_String:jMsg). |
347 | 2443 |
]. |
2444 |
||
459 | 2445 |
"/ for our convenience: skip ST contexts |
2446 |
"/ (i.e. the handler or debugger will see the javaContext first ) |
|
2447 |
||
347 | 2448 |
con := thisContext sender. |
2449 |
[con isNil or:[con isJavaContext]] whileFalse:[ |
|
2450 |
con := con sender |
|
2451 |
]. |
|
2452 |
con isNil ifTrue:[con := thisContext sender]. |
|
2453 |
||
2454 |
JavaVM javaExceptionSignal |
|
2455 |
raiseWith:aJavaException |
|
2456 |
errorString:msg |
|
2457 |
in:con. |
|
2458 |
Processor activeProcess terminate. |
|
459 | 2459 |
] ifFalse:[ |
2460 |
"/ |
|
2461 |
"/ found a java exceptionHandler |
|
2462 |
"/ |
|
2463 |
handlerContext setPC:handlerPC. |
|
2464 |
handlerContext exceptionArg:aJavaException. |
|
2465 |
handlerContext markForException. |
|
2466 |
handlerContext unwindAndRestart. |
|
2467 |
self halt:'should not be reached'. |
|
2468 |
Processor activeProcess terminate. |
|
2469 |
]. |
|
255 | 2470 |
|
2471 |
"Created: / 7.1.1998 / 15:28:22 / cg" |
|
459 | 2472 |
"Modified: / 20.11.1998 / 13:25:22 / cg" |
255 | 2473 |
! |
2474 |
||
2475 |
throwExceptionClassName:aJavaExceptionClassName withMessage:someMessage |
|
261 | 2476 |
|exClass ex| |
2477 |
||
2478 |
exClass := Java classForName:aJavaExceptionClassName. |
|
2479 |
ex := exClass newCleared. |
|
2480 |
ex perform:#'<init>(Ljava/lang/String;)V' with:(Java as_String:someMessage). |
|
2481 |
||
2482 |
"/ ex := exClass new. |
|
2483 |
"/ ex instVarNamed:'detailMessage' put:(Java as_String:someMessage). |
|
255 | 2484 |
|
2485 |
self throwException:ex |
|
2486 |
||
2487 |
"Created: / 7.1.1998 / 15:25:09 / cg" |
|
261 | 2488 |
"Modified: / 14.1.1998 / 23:38:30 / cg" |
255 | 2489 |
! |
2490 |
||
2491 |
throwIOExceptionWithMessage:message |
|
2492 |
self |
|
261 | 2493 |
throwExceptionClassName:'java.io.IOException' |
2494 |
withMessage:message |
|
255 | 2495 |
|
2496 |
"Created: / 7.1.1998 / 10:34:24 / cg" |
|
2497 |
"Modified: / 7.1.1998 / 15:26:25 / cg" |
|
2498 |
! |
|
2499 |
||
261 | 2500 |
throwIllegalAccessException |
2501 |
self |
|
270 | 2502 |
throwExceptionClassName:'java.lang.IllegalAccessException' |
2503 |
withMessage:'illegal access' |
|
261 | 2504 |
|
2505 |
"Modified: / 7.1.1998 / 15:25:35 / cg" |
|
2506 |
"Created: / 14.1.1998 / 23:13:44 / cg" |
|
2507 |
! |
|
2508 |
||
2509 |
throwInstantiationException |
|
2510 |
self |
|
270 | 2511 |
throwExceptionClassName:'java.lang.InstantiationException' |
2512 |
withMessage:'cannot instantiate' |
|
261 | 2513 |
|
2514 |
"Modified: / 7.1.1998 / 15:25:35 / cg" |
|
2515 |
"Created: / 14.1.1998 / 23:15:01 / cg" |
|
2516 |
! |
|
2517 |
||
2518 |
throwInstantiationExceptionFor:aJavaClass |
|
2519 |
self |
|
270 | 2520 |
throwExceptionClassName:'java.lang.InstantiationException' |
2521 |
withMessage:('cannot instantiate ' , aJavaClass fullName) |
|
261 | 2522 |
|
2523 |
"Modified: / 7.1.1998 / 15:25:35 / cg" |
|
2524 |
"Created: / 14.1.1998 / 23:17:02 / cg" |
|
2525 |
! |
|
2526 |
||
255 | 2527 |
throwNullPointerException |
280 | 2528 |
self halt:'null pointer exception'. |
255 | 2529 |
self |
280 | 2530 |
throwExceptionClassName:'java.lang.NullPointerException' |
2531 |
withMessage:'null pointer' |
|
2532 |
||
255 | 2533 |
"Created: / 9.1.1998 / 02:26:08 / cg" |
280 | 2534 |
"Modified: / 28.1.1998 / 02:30:09 / cg" |
255 | 2535 |
! |
2536 |
||
2537 |
throwNumberFormatException |
|
2538 |
self |
|
261 | 2539 |
throwExceptionClassName:'java.lang.NumberFormatException' |
2540 |
withMessage:'bad number format' |
|
255 | 2541 |
|
2542 |
"Modified: / 7.1.1998 / 15:25:35 / cg" |
|
2543 |
"Created: / 11.1.1998 / 16:08:22 / cg" |
|
253 | 2544 |
! ! |
2545 |
||
2546 |
!JavaVM class methodsFor:'helpers - io'! |
|
2547 |
||
307 | 2548 |
anyStream_close:nativeContext |
2549 |
|jStream fileNo file| |
|
2550 |
||
2551 |
jStream := nativeContext receiver. |
|
2552 |
||
2553 |
fileNo := self validateFileNo:jStream. |
|
261 | 2554 |
fileNo == 0 ifTrue:[ |
280 | 2555 |
'JAVA: file is already closed' errorPrintCR. |
2556 |
^ self "/ already closed |
|
261 | 2557 |
]. |
253 | 2558 |
file := self getOpenFileAt:fileNo. |
2559 |
file isNil ifTrue:[ |
|
280 | 2560 |
self halt:'invalid fileNo in close'. |
2561 |
self internalError:'invalid fileNo in close'. |
|
2562 |
^ self |
|
253 | 2563 |
]. |
2564 |
||
2565 |
"/ should always be bytes |
|
2566 |
||
2567 |
(file ~~ Stdin |
|
2568 |
and:[file ~~ Stdout |
|
280 | 2569 |
and:[file ~~ Stderr |
2570 |
and:[file ~~ Transcript]]]) ifTrue:[ |
|
2571 |
file close. |
|
253 | 2572 |
]. |
2573 |
self setOpenFile:nil at:fileNo. |
|
2574 |
||
307 | 2575 |
fileNo := jStream instVarNamed:'fd'. |
261 | 2576 |
fileNo isInteger ifFalse:[ |
280 | 2577 |
"/ JDK 1.1.3 |
2578 |
fileNo instVarNamed:'fd' put:0. |
|
261 | 2579 |
] ifTrue:[ |
280 | 2580 |
"/ JDK 1.0 |
307 | 2581 |
jStream instVarNamed:'fd' put:0 |
2582 |
]. |
|
2583 |
||
2584 |
"Created: / 4.2.1998 / 15:22:03 / cg" |
|
374 | 2585 |
"Modified: / 14.10.1998 / 15:10:07 / cg" |
307 | 2586 |
! |
2587 |
||
2588 |
anyStream_readBytes:nativeContext |
|
2589 |
|bytes offset count stream nRead| |
|
2590 |
||
2591 |
bytes := nativeContext argAt:1. |
|
2592 |
offset := nativeContext argAt:2. |
|
2593 |
count := nativeContext argAt:3. |
|
2594 |
||
2595 |
stream := self validateFile:(nativeContext receiver). |
|
2596 |
||
2597 |
"/ should always be bytes |
|
2598 |
bytes class isBytes ifFalse:[ |
|
2599 |
self halt. |
|
2600 |
]. |
|
2601 |
stream == Stdin ifTrue:[ |
|
2602 |
self halt:'reading from standardInput ...'. |
|
432 | 2603 |
^ -1 "/ 0 |
307 | 2604 |
]. |
2605 |
||
2606 |
FileIOTrace ifTrue:[ |
|
2607 |
('JAVA: read ' , count printString , ' bytes from ' , stream pathName) infoPrintCR. |
|
2608 |
]. |
|
2609 |
||
2610 |
stream isPositionable ifFalse:[ |
|
2611 |
"/ mhmh - some kind of socket or pipe |
|
2612 |
||
2613 |
stream readWait. |
|
2614 |
]. |
|
2615 |
||
2616 |
Stream readErrorSignal handle:[:ex | |
|
2617 |
nRead := -1 |
|
2618 |
] do:[ |
|
2619 |
nRead := stream nextAvailableBytes:count into:bytes startingAt:offset+1. |
|
2620 |
]. |
|
2621 |
nRead == 0 ifTrue:[ |
|
2622 |
stream atEnd ifTrue:[ |
|
2623 |
FileIOTrace ifTrue:[ |
|
2624 |
('JAVA: at EOF ' , nRead printString) infoPrintCR. |
|
2625 |
]. |
|
2626 |
^ -1 |
|
2627 |
]. |
|
2628 |
]. |
|
2629 |
count ~~ nRead ifTrue:[ |
|
2630 |
FileIOTrace ifTrue:[ |
|
2631 |
('JAVA: only got ' , nRead printString) infoPrintCR. |
|
2632 |
] |
|
2633 |
]. |
|
2634 |
^ nRead |
|
2635 |
||
2636 |
"Created: / 4.2.1998 / 15:20:00 / cg" |
|
432 | 2637 |
"Modified: / 10.11.1998 / 19:56:47 / cg" |
307 | 2638 |
! |
2639 |
||
2640 |
anyStream_writeBytes:nativeContext |
|
2641 |
|bytes offset count stream| |
|
2642 |
||
2643 |
bytes := nativeContext argAt:1. |
|
2644 |
offset := nativeContext argAt:2. |
|
2645 |
count := nativeContext argAt:3. |
|
2646 |
||
2647 |
stream := self validateFile:(nativeContext receiver). |
|
2648 |
||
2649 |
FileIOTrace ifTrue:[ |
|
2650 |
stream isFileStream ifTrue:[ |
|
2651 |
('JAVA: write ' , count printString , ' bytes to ' , stream pathName) infoPrintCR. |
|
2652 |
] ifFalse:[ |
|
2653 |
stream ~~ Stdout ifTrue:[ |
|
2654 |
stream ~~ Stderr ifTrue:[ |
|
2655 |
('JAVA: write ' , count printString , ' bytes to ' , stream displayString) infoPrintCR. |
|
2656 |
] |
|
2657 |
] |
|
2658 |
] |
|
2659 |
]. |
|
2660 |
||
2661 |
"/ should always be bytes |
|
2662 |
Stream writeErrorSignal handle:[:ex | |
|
2663 |
ex return |
|
2664 |
] do:[ |
|
2665 |
Socket brokenConnectionSignal handle:[:ex | |
|
2666 |
ex return |
|
2667 |
] do:[ |
|
2668 |
stream nextPutBytes:count from:bytes startingAt:offset+1 |
|
2669 |
] |
|
2670 |
]. |
|
2671 |
||
2672 |
"Created: / 4.2.1998 / 15:23:58 / cg" |
|
2673 |
"Modified: / 4.2.1998 / 19:38:26 / cg" |
|
261 | 2674 |
! |
2675 |
||
479 | 2676 |
checkWritePermissionOfDirectory:dir message:msg |
2677 |
|answer| |
|
2678 |
||
2679 |
(PermittedDirectories notNil |
|
2680 |
and:[PermittedDirectories includes:dir]) ifFalse:[ |
|
2681 |
FileOpenConfirmation ifTrue:[ |
|
2682 |
answer := Dialog |
|
2683 |
confirmWithCancel:msg withCRs |
|
2684 |
labels:#('no' 'grant') |
|
2685 |
values:#(false true) |
|
2686 |
default:2. |
|
2687 |
answer == false ifTrue:[ |
|
2688 |
^ false |
|
2689 |
]. |
|
2690 |
||
2691 |
(self confirm:('JAVA Security check\\Always permit writes in this directory (''' , dir pathName , ''') ?') withCRs) |
|
2692 |
ifTrue:[ |
|
2693 |
PermittedDirectories isNil ifTrue:[ |
|
2694 |
PermittedDirectories := Set new |
|
2695 |
]. |
|
2696 |
PermittedDirectories add:dir. |
|
2697 |
] |
|
2698 |
] |
|
2699 |
]. |
|
2700 |
^ true |
|
2701 |
||
2702 |
"Created: / 3.12.1998 / 15:07:56 / cg" |
|
2703 |
"Modified: / 3.12.1998 / 15:16:55 / cg" |
|
2704 |
! |
|
2705 |
||
331 | 2706 |
commonOpen:nativeContext forAppend:forAppend |
442 | 2707 |
|fs fd fn name dir stream fileNo answer readonly| |
331 | 2708 |
|
2709 |
fs := nativeContext receiver. |
|
2710 |
fd := fs instVarNamed:'fd'. |
|
2711 |
(fd instVarNamed:'fd') ~~ 0 ifTrue:[ |
|
2712 |
self halt:'file already open'. |
|
2713 |
self internalError:'file already open'. |
|
2714 |
^ self. |
|
2715 |
]. |
|
2716 |
||
2717 |
name := nativeContext argAt:1. |
|
2718 |
name := Java as_ST_String:name. |
|
2719 |
||
2720 |
FileOpenTrace ifTrue:[ |
|
2721 |
('JAVA: opening ' , name) infoPrintCR. |
|
2722 |
]. |
|
2723 |
||
2724 |
fn := name asFilename. |
|
2725 |
dir := fn directory pathName. |
|
442 | 2726 |
|
331 | 2727 |
(PermittedDirectories notNil |
2728 |
and:[PermittedDirectories includes:dir]) ifFalse:[ |
|
2729 |
FileOpenConfirmation ifTrue:[ |
|
442 | 2730 |
answer := Dialog |
2731 |
confirmWithCancel:('JAVA Security check\\Opening ''' , name , ''' for read/write.\Grant permission ?') withCRs |
|
2732 |
labels:#('no' 'grant' 'readonly') |
|
2733 |
values:#(false true #readonly) |
|
2734 |
default:3. |
|
2735 |
answer == false ifTrue:[ |
|
331 | 2736 |
self throwIOExceptionWithMessage:('no permission to open ' , name , ' for writing'). |
2737 |
^ self |
|
2738 |
]. |
|
442 | 2739 |
readonly := (answer == #readonly). |
2740 |
||
2741 |
readonly ifFalse:[ |
|
2742 |
(self confirm:('JAVA Security check\\Always permit writes in this directory (''' , dir , ''') ?') withCRs) |
|
2743 |
ifTrue:[ |
|
2744 |
PermittedDirectories isNil ifTrue:[ |
|
2745 |
PermittedDirectories := Set new |
|
2746 |
]. |
|
2747 |
PermittedDirectories add:dir. |
|
2748 |
] |
|
331 | 2749 |
] |
2750 |
] |
|
2751 |
]. |
|
2752 |
||
442 | 2753 |
readonly ifTrue:[ |
2754 |
stream := fn readStream. |
|
331 | 2755 |
] ifFalse:[ |
442 | 2756 |
forAppend ifTrue:[ |
2757 |
stream := fn appendingWriteStream. |
|
2758 |
] ifFalse:[ |
|
2759 |
stream := fn writeStream. |
|
2760 |
] |
|
331 | 2761 |
]. |
2762 |
stream isNil ifTrue:[ |
|
2763 |
self throwIOExceptionWithMessage:('cannot open ' , name , ' for writing'). |
|
2764 |
]. |
|
2765 |
||
2766 |
fileNo := self addOpenFile:stream. |
|
2767 |
||
2768 |
FileOpenTrace ifTrue:[ |
|
2769 |
('JAVA: opened ' , name , ' as FD ' , fileNo printString , ' for writing') infoPrintCR. |
|
2770 |
]. |
|
2771 |
||
2772 |
fd instVarNamed:'fd' put:fileNo. |
|
2773 |
||
2774 |
"Created: / 7.4.1998 / 19:14:09 / cg" |
|
442 | 2775 |
"Modified: / 12.11.1998 / 21:31:24 / cg" |
331 | 2776 |
! |
2777 |
||
261 | 2778 |
fileStreamForReading:name |
2779 |
|fn stream tryAlongClassPath| |
|
2780 |
||
2781 |
fn := name asFilename. |
|
2782 |
stream := fn readStream. |
|
2783 |
stream notNil ifTrue:[^ stream]. |
|
2784 |
||
2785 |
fn isAbsolute ifFalse:[ |
|
405 | 2786 |
"/ if not absolute, try along classPath |
2787 |
"/ This allows classes to open local files (JEdit) |
|
2788 |
"/ even if they have NOT been loaded by a Java classLoader. |
|
2789 |
"/ Only do this for image files |
|
2790 |
"/ (and maybe some other config files in the future), |
|
2791 |
"/ to avoid security holes. |
|
2792 |
tryAlongClassPath := true. |
|
2793 |
"/ tryAlongClassPath := false. |
|
2794 |
"/ (fn hasSuffix:'gif') ifTrue:[ |
|
2795 |
"/ tryAlongClassPath := true. |
|
2796 |
"/ ]. |
|
2797 |
"/ (fn hasSuffix:'jpg') ifTrue:[ |
|
2798 |
"/ tryAlongClassPath := true. |
|
2799 |
"/ ]. |
|
2800 |
||
2801 |
tryAlongClassPath ifTrue:[ |
|
2802 |
Java classPath do:[:dirName | |
|
2803 |
|fn| |
|
2804 |
||
2805 |
(fn := dirName asFilename construct:name) exists ifTrue:[ |
|
2806 |
stream := fn readStream. |
|
2807 |
stream notNil ifTrue:[^ stream]. |
|
2808 |
] |
|
2809 |
] |
|
2810 |
] |
|
261 | 2811 |
]. |
2812 |
^ nil. |
|
2813 |
||
405 | 2814 |
"Modified: / 21.10.1998 / 01:38:50 / cg" |
2815 |
! |
|
2816 |
||
2817 |
fixFilename:path |
|
2818 |
OperatingSystem isMSDOSlike ifTrue:[ |
|
2819 |
(#($/ $\) includes:(path at:1)) ifTrue:[ |
|
2820 |
(path at:3) == $: ifTrue:[ |
|
2821 |
^ path copyFrom:2 |
|
2822 |
] |
|
2823 |
] |
|
2824 |
]. |
|
2825 |
^ path |
|
2826 |
||
2827 |
"Created: / 20.10.1998 / 20:58:45 / cg" |
|
2828 |
"Modified: / 20.10.1998 / 21:06:49 / cg" |
|
253 | 2829 |
! |
2830 |
||
2831 |
validateFile:javaStream |
|
2832 |
|fileNo file descriptor| |
|
2833 |
||
2834 |
fileNo := self validateFileNo:javaStream. |
|
2835 |
fileNo isNil ifTrue:[ |
|
2836 |
"/ self halt:'invalid fileNo in read'. |
|
2837 |
"/ self internalError:'invalid fileNo in read'. |
|
261 | 2838 |
self throwIOExceptionWithMessage:'invalid fileNo in read'. |
2839 |
^ nil |
|
253 | 2840 |
]. |
2841 |
||
2842 |
file := self getOpenFileAt:fileNo. |
|
2843 |
||
2844 |
file isNil ifTrue:[ |
|
2845 |
"/ self halt:'invalid fileNo in read'. |
|
2846 |
"/ self internalError:'invalid fileNo in read'. |
|
261 | 2847 |
self throwIOExceptionWithMessage:'invalid fileNo in read'. |
2848 |
^ nil |
|
253 | 2849 |
]. |
2850 |
||
2851 |
^ file |
|
2852 |
||
2853 |
"Created: / 4.1.1998 / 16:50:38 / cg" |
|
2854 |
"Modified: / 4.1.1998 / 17:50:00 / cg" |
|
2855 |
! |
|
2856 |
||
2857 |
validateFileNo:javaStream |
|
2858 |
|fileNo file descriptor| |
|
2859 |
||
261 | 2860 |
"/ JDK 1.1.3 has fileDescriptor wrapped |
2861 |
"/ JDK 1.0 has it directly as integer |
|
2862 |
||
253 | 2863 |
fileNo := javaStream instVarNamed:'fd'. |
2864 |
fileNo isInteger ifFalse:[ |
|
261 | 2865 |
descriptor := fileNo. |
2866 |
fileNo := descriptor instVarNamed:'fd'. |
|
253 | 2867 |
]. |
2868 |
||
2869 |
fileNo isInteger ifFalse:[ |
|
2870 |
"/ self halt:'invalid fileNo in read'. |
|
2871 |
"/ self internalError:'invalid fileNo in read'. |
|
261 | 2872 |
self throwIOExceptionWithMessage:'invalid fileNo in read'. |
2873 |
^ nil |
|
253 | 2874 |
]. |
2875 |
||
2876 |
^ fileNo. |
|
2877 |
||
2878 |
"Created: / 4.1.1998 / 17:49:08 / cg" |
|
261 | 2879 |
"Modified: / 13.1.1998 / 14:07:47 / cg" |
253 | 2880 |
! ! |
2881 |
||
440 | 2882 |
!JavaVM class methodsFor:'native - java.awt.image'! |
2883 |
||
2884 |
_ColorModel_deletepData:nativeContext |
|
2885 |
"/ void deletepData () |
|
2886 |
UnimplementedNativeMethodSignal raise |
|
2887 |
||
2888 |
"Created: / 12.11.1998 / 19:22:05 / cg" |
|
2889 |
! ! |
|
2890 |
||
253 | 2891 |
!JavaVM class methodsFor:'native - java.io'! |
2892 |
||
2893 |
_FileDescriptor_initSystemFD:nativeContext |
|
2894 |
|descriptor fileNo idx myStream| |
|
2895 |
||
2896 |
descriptor := nativeContext argAt:1. |
|
2897 |
fileNo := nativeContext argAt:2. |
|
2898 |
||
2899 |
fileNo == 0 ifTrue:[ |
|
277 | 2900 |
myStream := Stdin |
253 | 2901 |
] ifFalse:[ |
277 | 2902 |
fileNo == 1 ifTrue:[ |
2903 |
myStream := JavaConsoleStream ? Stdout |
|
2904 |
] ifFalse:[ |
|
2905 |
fileNo == 2 ifTrue:[ |
|
2906 |
myStream := JavaConsoleStream ? Stderr |
|
2907 |
] ifFalse:[ |
|
2908 |
self halt:'invalid fileNo given'. |
|
2909 |
self internalError:'invalid fileNo given'. |
|
2910 |
] |
|
2911 |
] |
|
253 | 2912 |
]. |
2913 |
||
2914 |
self setOpenFile:myStream at:fileNo. |
|
2915 |
||
2916 |
descriptor instVarNamed:'fd' put:fileNo. |
|
2917 |
^ descriptor |
|
2918 |
||
277 | 2919 |
"Modified: / 27.1.1998 / 18:15:28 / cg" |
253 | 2920 |
! |
2921 |
||
440 | 2922 |
_FileDescriptor_sync:nativeContext |
2923 |
"/ void sync () |
|
2924 |
UnimplementedNativeMethodSignal raise |
|
2925 |
||
2926 |
"Modified: / 12.11.1998 / 18:57:39 / cg" |
|
2927 |
"Created: / 12.11.1998 / 19:26:25 / cg" |
|
2928 |
! |
|
2929 |
||
2930 |
_FileDescriptor_valid:nativeContext |
|
2931 |
"/ boolean valid () |
|
2932 |
UnimplementedNativeMethodSignal raise |
|
2933 |
||
2934 |
"Modified: / 12.11.1998 / 18:57:39 / cg" |
|
2935 |
! |
|
2936 |
||
261 | 2937 |
_FileInputStream_available:nativeContext |
2938 |
|file| |
|
2939 |
||
2940 |
file := self validateFile:(nativeContext receiver). |
|
2941 |
file isNil ifTrue:[ |
|
2942 |
self throwIOExceptionWithMessage:'invalid fileNo in available'. |
|
2943 |
^ self |
|
2944 |
]. |
|
2945 |
file isFileStream ifTrue:[ |
|
2946 |
^ file size - file position + 1 |
|
2947 |
]. |
|
2948 |
file atEnd ifTrue:[ |
|
2949 |
^ 0. |
|
2950 |
]. |
|
2951 |
self halt. |
|
2952 |
^ 1 |
|
2953 |
||
2954 |
"Modified: / 14.1.1998 / 15:12:52 / cg" |
|
2955 |
! |
|
2956 |
||
253 | 2957 |
_FileInputStream_close:nativeContext |
307 | 2958 |
^ self anyStream_close:nativeContext |
2959 |
||
253 | 2960 |
"Created: / 4.1.1998 / 17:45:23 / cg" |
307 | 2961 |
"Modified: / 4.2.1998 / 15:20:46 / cg" |
253 | 2962 |
! |
2963 |
||
2964 |
_FileInputStream_open:nativeContext |
|
261 | 2965 |
|fs fd fn name stream fileNo| |
253 | 2966 |
|
2967 |
fs := nativeContext receiver. |
|
2968 |
fd := fs instVarNamed:'fd'. |
|
277 | 2969 |
(fileNo := fd instVarNamed:'fd') ~~ 0 ifTrue:[ |
2970 |
fileNo ~~ -1 ifTrue:[ |
|
2971 |
self halt:'file already open'. |
|
2972 |
self internalError:'file already open'. |
|
2973 |
^ self. |
|
2974 |
] |
|
253 | 2975 |
]. |
2976 |
||
2977 |
name := nativeContext argAt:1. |
|
2978 |
name := Java as_ST_String:name. |
|
2979 |
||
405 | 2980 |
name := self fixFilename:name. |
2981 |
||
253 | 2982 |
FileOpenTrace ifTrue:[ |
277 | 2983 |
('JAVA: opening ' , name) infoPrintCR. |
253 | 2984 |
]. |
2985 |
||
261 | 2986 |
stream := self fileStreamForReading:name. |
253 | 2987 |
stream isNil ifTrue:[ |
277 | 2988 |
FileOpenTrace ifTrue:[ |
479 | 2989 |
('JAVA: failed to open ''' , name , ''' for reading.') infoPrintCR. |
277 | 2990 |
]. |
2991 |
||
2992 |
self throwIOExceptionWithMessage:('cannot open ' , name , ' for reading'). |
|
2993 |
||
2994 |
^ self. |
|
253 | 2995 |
]. |
304 | 2996 |
stream buffered:false. |
253 | 2997 |
|
261 | 2998 |
"/ FileOpenConfirmation ifTrue:[ |
2999 |
"/ (self confirm:('JAVA Security check\\Opening ''' , name , ''' for reading.\Grant permission ?') withCRs) |
|
3000 |
"/ ifFalse:[ |
|
3001 |
"/ self throwIOExceptionWithMessage:('no permission to open ' , name , ' for reading'). |
|
3002 |
"/ ^ self |
|
3003 |
"/ ] |
|
3004 |
"/ ]. |
|
3005 |
||
253 | 3006 |
fileNo := self addOpenFile:stream. |
3007 |
||
3008 |
FileOpenTrace ifTrue:[ |
|
277 | 3009 |
('JAVA: opened ' , name , ' as FD ' , fileNo printString) infoPrintCR. |
253 | 3010 |
]. |
3011 |
||
3012 |
fd instVarNamed:'fd' put:fileNo. |
|
3013 |
||
3014 |
"Created: / 4.1.1998 / 16:47:12 / cg" |
|
479 | 3015 |
"Modified: / 3.12.1998 / 15:13:51 / cg" |
253 | 3016 |
! |
3017 |
||
3018 |
_FileInputStream_read:nativeContext |
|
3019 |
|file byte| |
|
3020 |
||
3021 |
file := self validateFile:(nativeContext receiver). |
|
3022 |
||
3023 |
FileIOTrace ifTrue:[ |
|
261 | 3024 |
('JAVA: read 1 byte from ' , file pathName) infoPrintCR. |
253 | 3025 |
]. |
3026 |
||
3027 |
byte := file nextByte. |
|
3028 |
byte isNil ifTrue:[ |
|
261 | 3029 |
^ -1 |
253 | 3030 |
]. |
3031 |
^ byte |
|
3032 |
||
3033 |
"Created: / 5.1.1998 / 02:17:08 / cg" |
|
3034 |
"Modified: / 5.1.1998 / 02:17:25 / cg" |
|
3035 |
! |
|
3036 |
||
3037 |
_FileInputStream_readBytes:nativeContext |
|
307 | 3038 |
^ self anyStream_readBytes:nativeContext |
3039 |
||
3040 |
"Modified: / 4.2.1998 / 15:23:08 / cg" |
|
261 | 3041 |
! |
3042 |
||
440 | 3043 |
_FileInputStream_skip:nativeContext |
3044 |
"/ long skip (long) |
|
3045 |
UnimplementedNativeMethodSignal raise |
|
3046 |
||
3047 |
"Created: / 12.11.1998 / 18:57:12 / cg" |
|
3048 |
"Modified: / 12.11.1998 / 18:57:48 / cg" |
|
3049 |
! |
|
3050 |
||
261 | 3051 |
_FileOutputStream_close:nativeContext |
307 | 3052 |
^ self anyStream_close:nativeContext |
3053 |
||
261 | 3054 |
"Created: / 13.1.1998 / 09:33:16 / cg" |
307 | 3055 |
"Modified: / 4.2.1998 / 15:20:53 / cg" |
261 | 3056 |
! |
3057 |
||
3058 |
_FileOutputStream_open:nativeContext |
|
331 | 3059 |
^ self commonOpen:nativeContext forAppend:false |
3060 |
||
3061 |
"Modified: / 7.4.1998 / 19:14:31 / cg" |
|
3062 |
! |
|
3063 |
||
3064 |
_FileOutputStream_openAppend:nativeContext |
|
3065 |
^ self commonOpen:nativeContext forAppend:true |
|
3066 |
||
3067 |
"Modified: / 7.4.1998 / 19:13:42 / cg" |
|
261 | 3068 |
! |
3069 |
||
3070 |
_FileOutputStream_write:nativeContext |
|
3071 |
|byte file| |
|
3072 |
||
3073 |
byte := nativeContext argAt:1. |
|
3074 |
||
3075 |
file := self validateFile:(nativeContext receiver). |
|
3076 |
||
3077 |
FileIOTrace ifTrue:[ |
|
3078 |
file isFileStream ifTrue:[ |
|
3079 |
('JAVA: write 1 byte to ' , file pathName) infoPrintCR. |
|
3080 |
] ifFalse:[ |
|
3081 |
file ~~ Stdout ifTrue:[ |
|
3082 |
file ~~ Stderr ifTrue:[ |
|
3083 |
('JAVA: write 1 byte to ' , file displayString) infoPrintCR. |
|
3084 |
] |
|
3085 |
] |
|
3086 |
] |
|
3087 |
]. |
|
3088 |
||
3089 |
"/ should always be bytes |
|
3090 |
||
3091 |
file nextPutByte:byte |
|
3092 |
||
3093 |
"Created: / 13.1.1998 / 09:32:13 / cg" |
|
3094 |
"Modified: / 13.1.1998 / 09:32:31 / cg" |
|
253 | 3095 |
! |
3096 |
||
255 | 3097 |
_FileOutputStream_writeBytes:nativeContext |
307 | 3098 |
^ self anyStream_writeBytes:nativeContext |
3099 |
||
3100 |
"Modified: / 4.2.1998 / 15:24:20 / cg" |
|
255 | 3101 |
! |
3102 |
||
253 | 3103 |
_File_canRead0:nativeContext |
3104 |
|file path f| |
|
3105 |
||
3106 |
file := nativeContext receiver. |
|
3107 |
path := file instVarNamed:'path'. |
|
3108 |
path notNil ifTrue:[ |
|
405 | 3109 |
path := Java as_ST_String:path. |
3110 |
path := self fixFilename:path. |
|
3111 |
(f := path asFilename) isReadable ifTrue:[ |
|
3112 |
^ 1 "/ TRUE |
|
3113 |
] |
|
253 | 3114 |
]. |
255 | 3115 |
^ 0 "/ FALSE |
3116 |
||
253 | 3117 |
"Created: / 4.1.1998 / 18:09:55 / cg" |
405 | 3118 |
"Modified: / 20.10.1998 / 20:59:39 / cg" |
253 | 3119 |
! |
3120 |
||
307 | 3121 |
_File_canWrite0:nativeContext |
3122 |
|file path f| |
|
3123 |
||
3124 |
file := nativeContext receiver. |
|
3125 |
path := file instVarNamed:'path'. |
|
3126 |
path notNil ifTrue:[ |
|
3127 |
path := Java as_ST_String:path. |
|
405 | 3128 |
path := self fixFilename:path. |
307 | 3129 |
(f := path asFilename) isWritable ifTrue:[ |
3130 |
^ 1 "/ TRUE |
|
3131 |
] |
|
3132 |
]. |
|
3133 |
^ 0 "/ FALSE |
|
3134 |
||
3135 |
"Created: / 4.2.1998 / 00:19:55 / cg" |
|
405 | 3136 |
"Modified: / 20.10.1998 / 20:59:45 / cg" |
307 | 3137 |
! |
3138 |
||
440 | 3139 |
_File_delete0:nativeContext |
3140 |
"/ boolean delete0 () |
|
480 | 3141 |
|oldFile oldPath oldF| |
3142 |
||
3143 |
oldFile := nativeContext receiver. |
|
3144 |
oldPath := oldFile instVarNamed:'path'. |
|
3145 |
oldPath isNil ifTrue:[^ 0]. "/ FALSE |
|
3146 |
||
3147 |
oldPath := Java as_ST_String:oldPath. |
|
3148 |
oldF := oldPath asFilename. |
|
3149 |
||
3150 |
(self checkWritePermissionOfDirectory:oldF directory message:('JAVA Security check\\Delete of ''' , oldPath , '''.\Grant permission ?')) |
|
3151 |
ifFalse:[ |
|
3152 |
^ 0 "/ FALSE |
|
3153 |
]. |
|
3154 |
||
3155 |
OperatingSystem accessDeniedErrorSignal handle:[:ex | |
|
3156 |
^ 0 "/ FALSE |
|
3157 |
] do:[ |
|
3158 |
oldF delete. |
|
3159 |
^ 1 "/ TRUE |
|
3160 |
]. |
|
3161 |
^ 0 "/ FALSE |
|
3162 |
||
3163 |
"Modified: / 3.12.1998 / 21:02:03 / cg" |
|
440 | 3164 |
! |
3165 |
||
253 | 3166 |
_File_exists0:nativeContext |
3167 |
|file path f| |
|
3168 |
||
3169 |
file := nativeContext receiver. |
|
3170 |
path := file instVarNamed:'path'. |
|
3171 |
path notNil ifTrue:[ |
|
405 | 3172 |
path := Java as_ST_String:path. |
3173 |
path := self fixFilename:path. |
|
3174 |
(f := path asFilename) exists ifTrue:[ |
|
3175 |
^ 1 "TRUE" |
|
3176 |
] |
|
255 | 3177 |
]. |
3178 |
^ 0 "FALSE" |
|
3179 |
||
3180 |
"Created: / 5.1.1998 / 02:07:48 / cg" |
|
405 | 3181 |
"Modified: / 20.10.1998 / 20:59:49 / cg" |
255 | 3182 |
! |
3183 |
||
3184 |
_File_isAbsolute:nativeContext |
|
3185 |
|file path f| |
|
3186 |
||
3187 |
file := nativeContext receiver. |
|
3188 |
path := file instVarNamed:'path'. |
|
3189 |
path notNil ifTrue:[ |
|
405 | 3190 |
path := Java as_ST_String:path. |
3191 |
path := self fixFilename:path. |
|
3192 |
(f := path asFilename) isAbsolute ifTrue:[ |
|
3193 |
^ 1 "/ TRUE |
|
3194 |
] |
|
255 | 3195 |
]. |
3196 |
^ 0 "/ FALSE |
|
3197 |
||
3198 |
"Created: / 11.1.1998 / 09:54:38 / cg" |
|
405 | 3199 |
"Modified: / 20.10.1998 / 20:59:53 / cg" |
255 | 3200 |
! |
3201 |
||
3202 |
_File_isDirectory0:nativeContext |
|
3203 |
|file path f| |
|
3204 |
||
3205 |
file := nativeContext receiver. |
|
3206 |
path := file instVarNamed:'path'. |
|
3207 |
path notNil ifTrue:[ |
|
405 | 3208 |
path := Java as_ST_String:path. |
3209 |
path := self fixFilename:path. |
|
3210 |
(f := path asFilename) exists ifTrue:[ |
|
3211 |
f isDirectory ifTrue:[^ 1 "TRUE"] |
|
3212 |
] |
|
255 | 3213 |
]. |
3214 |
^ 0 "FALSE" |
|
3215 |
||
3216 |
"Created: / 7.1.1998 / 10:31:37 / cg" |
|
405 | 3217 |
"Modified: / 20.10.1998 / 20:59:56 / cg" |
255 | 3218 |
! |
3219 |
||
3220 |
_File_isFile0:nativeContext |
|
3221 |
|file path f| |
|
3222 |
||
3223 |
file := nativeContext receiver. |
|
3224 |
path := file instVarNamed:'path'. |
|
3225 |
path notNil ifTrue:[ |
|
405 | 3226 |
path := Java as_ST_String:path. |
3227 |
path := self fixFilename:path. |
|
3228 |
(f := path asFilename) exists ifTrue:[ |
|
3229 |
f isDirectory ifFalse:[^ 1 "TRUE"] |
|
3230 |
] |
|
255 | 3231 |
]. |
3232 |
^ 0 "/ FALSE |
|
3233 |
||
3234 |
"Created: / 11.1.1998 / 11:40:22 / cg" |
|
405 | 3235 |
"Modified: / 20.10.1998 / 21:00:00 / cg" |
255 | 3236 |
! |
3237 |
||
307 | 3238 |
_File_lastModified0:nativeContext |
3239 |
|file path f| |
|
3240 |
||
3241 |
file := nativeContext receiver. |
|
3242 |
path := file instVarNamed:'path'. |
|
3243 |
path notNil ifTrue:[ |
|
3244 |
path := Java as_ST_String:path. |
|
405 | 3245 |
path := self fixFilename:path. |
307 | 3246 |
(f := path asFilename) exists ifTrue:[ |
3247 |
^ f modificationTime getMilliseconds. |
|
3248 |
] |
|
3249 |
]. |
|
3250 |
^ 0 |
|
3251 |
||
3252 |
"Created: / 4.2.1998 / 16:50:30 / cg" |
|
405 | 3253 |
"Modified: / 20.10.1998 / 21:00:05 / cg" |
307 | 3254 |
! |
3255 |
||
255 | 3256 |
_File_length0:nativeContext |
3257 |
|file path f| |
|
3258 |
||
3259 |
file := nativeContext receiver. |
|
3260 |
path := file instVarNamed:'path'. |
|
3261 |
path notNil ifTrue:[ |
|
405 | 3262 |
path := Java as_ST_String:path. |
3263 |
path := self fixFilename:path. |
|
3264 |
(f := path asFilename) exists ifTrue:[ |
|
3265 |
^ f fileSize |
|
3266 |
] |
|
253 | 3267 |
]. |
261 | 3268 |
^ -1 |
3269 |
||
255 | 3270 |
"Created: / 7.1.1998 / 12:18:57 / cg" |
405 | 3271 |
"Modified: / 20.10.1998 / 21:00:18 / cg" |
261 | 3272 |
! |
3273 |
||
3274 |
_File_list0:nativeContext |
|
3275 |
|file path f files| |
|
3276 |
||
3277 |
file := nativeContext receiver. |
|
3278 |
path := file instVarNamed:'path'. |
|
3279 |
path notNil ifTrue:[ |
|
405 | 3280 |
path := Java as_ST_String:path. |
3281 |
path := self fixFilename:path. |
|
3282 |
(f := path asFilename) exists ifTrue:[ |
|
3283 |
f isDirectory ifTrue:[ |
|
3284 |
files := f directoryContents asArray. |
|
3285 |
files := files collect:[:nm | Java as_String:nm]. |
|
3286 |
^ files |
|
3287 |
] |
|
3288 |
] |
|
261 | 3289 |
]. |
3290 |
^ nil |
|
3291 |
||
3292 |
"Created: / 14.1.1998 / 21:30:22 / cg" |
|
405 | 3293 |
"Modified: / 20.10.1998 / 21:00:21 / cg" |
307 | 3294 |
! |
3295 |
||
3296 |
_File_mkdir0:nativeContext |
|
3297 |
|file path f| |
|
3298 |
||
3299 |
file := nativeContext receiver. |
|
3300 |
path := file instVarNamed:'path'. |
|
3301 |
path notNil ifTrue:[ |
|
3302 |
path := Java as_ST_String:path. |
|
405 | 3303 |
path := self fixFilename:path. |
482 | 3304 |
f := path asFilename. |
3305 |
(f exists and:[f isDirectory]) ifTrue:[ |
|
3306 |
^ 0 "/ FALSE |
|
3307 |
]. |
|
3308 |
||
307 | 3309 |
FileOpenConfirmation ifTrue:[ |
3310 |
(self confirm:('JAVA Security check\\Create directory ''' , path , '''.\Grant permission ?') withCRs) |
|
3311 |
ifFalse:[ |
|
3312 |
^ 0 "/ FALSE |
|
3313 |
] |
|
3314 |
]. |
|
3315 |
OperatingSystem accessDeniedErrorSignal handle:[:ex | |
|
3316 |
^ 0 "/ FALSE |
|
3317 |
] do:[ |
|
3318 |
f makeDirectory. |
|
3319 |
]. |
|
3320 |
f exists ifTrue:[ |
|
3321 |
f isDirectory ifTrue:[^ 1 "TRUE"] |
|
3322 |
] |
|
3323 |
]. |
|
3324 |
^ 0 "FALSE" |
|
3325 |
||
3326 |
"Created: / 4.2.1998 / 00:19:05 / cg" |
|
482 | 3327 |
"Modified: / 4.12.1998 / 14:04:03 / cg" |
307 | 3328 |
! |
3329 |
||
440 | 3330 |
_File_renameTo0:nativeContext |
479 | 3331 |
"/ void renameTo0 (java.io.File) |
3332 |
||
3333 |
|oldFile newFile oldPath newPath oldF newF| |
|
3334 |
||
3335 |
oldFile := nativeContext receiver. |
|
3336 |
oldPath := oldFile instVarNamed:'path'. |
|
480 | 3337 |
oldPath isNil ifTrue:[^ 0]. "/ FALSE |
3338 |
||
3339 |
oldPath := Java as_ST_String:oldPath. |
|
3340 |
oldF := oldPath asFilename. |
|
3341 |
||
3342 |
newFile := nativeContext argAt:1. |
|
3343 |
newPath := newFile instVarNamed:'path'. |
|
3344 |
newPath isNil ifTrue:[^ 0]. "/ FALSE |
|
3345 |
newPath := Java as_ST_String:newPath. |
|
3346 |
||
3347 |
newF := newPath asFilename. |
|
3348 |
||
3349 |
(self checkWritePermissionOfDirectory:oldF directory message:('JAVA Security check\\Rename of ''' , oldPath , ''' to ''' , newPath , '''.\Grant permission ?')) |
|
3350 |
ifFalse:[ |
|
3351 |
^ 0 "/ FALSE |
|
3352 |
]. |
|
3353 |
oldF directory pathName ~= newF directory pathName ifTrue:[ |
|
3354 |
(self checkWritePermissionOfDirectory:newF directory message:('JAVA Security check\\Rename of ''' , oldPath , ''' to ''' , newPath , '''.\Grant permission ?')) |
|
3355 |
ifFalse:[ |
|
3356 |
^ 0 "/ FALSE |
|
3357 |
]. |
|
3358 |
]. |
|
3359 |
||
3360 |
OperatingSystem accessDeniedErrorSignal handle:[:ex | |
|
3361 |
^ 0 "/ FALSE |
|
3362 |
] do:[ |
|
3363 |
oldF renameTo:newF. |
|
3364 |
^ 1 "/ TRUE |
|
3365 |
]. |
|
3366 |
^ 0 "/ FALSE |
|
3367 |
||
3368 |
"Modified: / 3.12.1998 / 21:01:08 / cg" |
|
440 | 3369 |
! |
3370 |
||
3371 |
_File_rmdir0:nativeContext |
|
3372 |
"/ boolean rmdir0 () |
|
3373 |
UnimplementedNativeMethodSignal raise |
|
3374 |
||
3375 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3376 |
"Created: / 12.11.1998 / 19:03:52 / cg" |
|
3377 |
! |
|
3378 |
||
3379 |
_ObjectInputStream_allocateNewArray:nativeContext |
|
3380 |
"/ java.lang.Object allocateNewArray (java.lang.Class int) |
|
3381 |
UnimplementedNativeMethodSignal raise |
|
3382 |
||
3383 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3384 |
"Created: / 12.11.1998 / 19:02:52 / cg" |
|
3385 |
! |
|
3386 |
||
3387 |
_ObjectInputStream_allocateNewObject:nativeContext |
|
3388 |
"/ java.lang.Object allocateNewObject (java.lang.Class java.lang.Class) |
|
3389 |
UnimplementedNativeMethodSignal raise |
|
3390 |
||
3391 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3392 |
"Created: / 12.11.1998 / 19:02:40 / cg" |
|
3393 |
! |
|
3394 |
||
3395 |
_ObjectInputStream_inputClassFields:nativeContext |
|
3396 |
"/ void inputClassFields (java.lang.Object java.lang.Class int[]) |
|
3397 |
UnimplementedNativeMethodSignal raise |
|
3398 |
||
3399 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3400 |
"Created: / 12.11.1998 / 19:02:22 / cg" |
|
3401 |
! |
|
3402 |
||
3403 |
_ObjectInputStream_invokeObjectReader:nativeContext |
|
3404 |
"/ boolean invokeObjectReader (java.lang.Object java.lang.Class) |
|
3405 |
UnimplementedNativeMethodSignal raise |
|
3406 |
||
3407 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3408 |
"Created: / 12.11.1998 / 19:03:06 / cg" |
|
3409 |
! |
|
3410 |
||
3411 |
_ObjectInputStream_loadClass0:nativeContext |
|
3412 |
"/ java.lang.Class loadClass0 (java.lang.Class java.lang.String) |
|
3413 |
UnimplementedNativeMethodSignal raise |
|
3414 |
||
3415 |
"Created: / 12.11.1998 / 19:01:15 / cg" |
|
3416 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3417 |
! |
|
3418 |
||
3419 |
_ObjectOutputStream_invokeObjectWriter:nativeContext |
|
3420 |
"/ boolean invokeObjectWriter (java.lang.Object java.lang.Class) |
|
3421 |
UnimplementedNativeMethodSignal raise |
|
3422 |
||
3423 |
"Created: / 12.11.1998 / 19:00:36 / cg" |
|
3424 |
"Modified: / 12.11.1998 / 19:01:45 / cg" |
|
3425 |
! |
|
3426 |
||
3427 |
_ObjectOutputStream_outputClassFields:nativeContext |
|
3428 |
"/ void outputClassFields (java.lang.Object java.lang.Class int[]) |
|
3429 |
UnimplementedNativeMethodSignal raise |
|
3430 |
||
3431 |
"Created: / 12.11.1998 / 19:00:09 / cg" |
|
3432 |
"Modified: / 12.11.1998 / 19:01:42 / cg" |
|
3433 |
! |
|
3434 |
||
3435 |
_ObjectStreamClass_getClassAccess:nativeContext |
|
3436 |
"/ int getClassAccess (java.lang.Class) |
|
3437 |
UnimplementedNativeMethodSignal raise |
|
3438 |
||
3439 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3440 |
"Created: / 12.11.1998 / 19:04:19 / cg" |
|
3441 |
! |
|
3442 |
||
3443 |
_ObjectStreamClass_getFieldAccess:nativeContext |
|
3444 |
"/ int getFieldAccess (java.lang.Class java.lang.String) |
|
3445 |
UnimplementedNativeMethodSignal raise |
|
3446 |
||
3447 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3448 |
"Created: / 12.11.1998 / 19:05:19 / cg" |
|
3449 |
! |
|
3450 |
||
3451 |
_ObjectStreamClass_getFieldSignatures:nativeContext |
|
3452 |
"/ java.lang.String[] getFieldSignatures (java.lang.Class) |
|
3453 |
UnimplementedNativeMethodSignal raise |
|
3454 |
||
3455 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3456 |
"Created: / 12.11.1998 / 19:05:04 / cg" |
|
3457 |
! |
|
3458 |
||
3459 |
_ObjectStreamClass_getFields0:nativeContext |
|
3460 |
"/ java.io.ObjectStreamField[] getFields0 (java.lang.Class) |
|
3461 |
UnimplementedNativeMethodSignal raise |
|
3462 |
||
3463 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3464 |
"Created: / 12.11.1998 / 19:05:32 / cg" |
|
3465 |
! |
|
3466 |
||
3467 |
_ObjectStreamClass_getMethodAccess:nativeContext |
|
3468 |
"/ int getMethodAccess (java.lang.Class java.lang.String) |
|
3469 |
UnimplementedNativeMethodSignal raise |
|
3470 |
||
3471 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3472 |
"Created: / 12.11.1998 / 19:04:51 / cg" |
|
3473 |
! |
|
3474 |
||
3475 |
_ObjectStreamClass_getMethodSignatures:nativeContext |
|
3476 |
"/ java.lang.String[] getMethodSignatures (java.lang.Class) |
|
3477 |
UnimplementedNativeMethodSignal raise |
|
3478 |
||
3479 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3480 |
"Created: / 12.11.1998 / 19:04:34 / cg" |
|
3481 |
! |
|
3482 |
||
3483 |
_ObjectStreamClass_getSerialVersionUID:nativeContext |
|
3484 |
"/ long getSerialVersionUID (java.lang.Class) |
|
3485 |
UnimplementedNativeMethodSignal raise |
|
3486 |
||
3487 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3488 |
"Created: / 12.11.1998 / 19:05:43 / cg" |
|
3489 |
! |
|
3490 |
||
3491 |
_ObjectStreamClass_hasWriteObject:nativeContext |
|
3492 |
"/ boolean hasWriteObject (java.lang.Class) |
|
3493 |
UnimplementedNativeMethodSignal raise |
|
3494 |
||
3495 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3496 |
"Created: / 12.11.1998 / 19:05:53 / cg" |
|
3497 |
! |
|
3498 |
||
307 | 3499 |
_RandomAccessFile_close:nativeContext |
3500 |
^ self anyStream_close:nativeContext |
|
3501 |
||
3502 |
"Created: / 4.2.1998 / 13:26:53 / cg" |
|
3503 |
"Modified: / 4.2.1998 / 15:21:08 / cg" |
|
3504 |
! |
|
3505 |
||
3506 |
_RandomAccessFile_length:nativeContext |
|
3507 |
|file sz| |
|
3508 |
||
3509 |
file := self validateFile:(nativeContext receiver). |
|
3510 |
||
3511 |
FileIOTrace ifTrue:[ |
|
3512 |
('JAVA: length of ' , file pathName) infoPrintCR. |
|
3513 |
]. |
|
3514 |
||
3515 |
sz := file size. |
|
3516 |
^ sz. |
|
3517 |
||
3518 |
"Created: / 4.2.1998 / 13:27:58 / cg" |
|
3519 |
! |
|
3520 |
||
3521 |
_RandomAccessFile_open:nativeContext |
|
442 | 3522 |
|fs fd name dir stream fileNo answer readonly| |
3523 |
||
3524 |
readonly := false. |
|
307 | 3525 |
|
3526 |
fs := nativeContext receiver. |
|
3527 |
fd := fs instVarNamed:'fd'. |
|
3528 |
(fd instVarNamed:'fd') ~~ 0 ifTrue:[ |
|
3529 |
self halt:'file already open'. |
|
3530 |
self internalError:'file already open'. |
|
3531 |
^ self. |
|
3532 |
]. |
|
3533 |
||
3534 |
name := nativeContext argAt:1. |
|
3535 |
name := Java as_ST_String:name. |
|
405 | 3536 |
name := self fixFilename:name. |
307 | 3537 |
|
3538 |
FileOpenTrace ifTrue:[ |
|
3539 |
('JAVA: opening ' , name) infoPrintCR. |
|
3540 |
]. |
|
3541 |
||
3542 |
dir := name asFilename directory pathName. |
|
442 | 3543 |
|
307 | 3544 |
(PermittedDirectories notNil |
3545 |
and:[PermittedDirectories includes:dir]) ifFalse:[ |
|
3546 |
FileOpenConfirmation ifTrue:[ |
|
442 | 3547 |
answer := Dialog |
3548 |
confirmWithCancel:('JAVA Security check\\Opening ''' , name , ''' for read/write.\Grant permission ?') withCRs |
|
3549 |
labels:#('no' 'grant' 'readonly') |
|
3550 |
values:#(false true #readonly) |
|
3551 |
default:3. |
|
3552 |
answer == false ifTrue:[ |
|
307 | 3553 |
self throwIOExceptionWithMessage:('no permission to open ' , name , ' for writing'). |
3554 |
^ self |
|
3555 |
]. |
|
442 | 3556 |
readonly := (answer == #readonly). |
3557 |
||
3558 |
readonly ifFalse:[ |
|
3559 |
(self confirm:('JAVA Security check\\Always permit writes in this directory (''' , dir , ''') ?') withCRs) |
|
3560 |
ifTrue:[ |
|
3561 |
PermittedDirectories isNil ifTrue:[ |
|
3562 |
PermittedDirectories := Set new |
|
3563 |
]. |
|
3564 |
PermittedDirectories add:dir. |
|
3565 |
] |
|
307 | 3566 |
] |
3567 |
] |
|
3568 |
]. |
|
3569 |
||
442 | 3570 |
readonly ifTrue:[ |
3571 |
stream := name asFilename readStream. |
|
3572 |
] ifFalse:[ |
|
3573 |
stream := name asFilename readWriteStream. |
|
3574 |
]. |
|
307 | 3575 |
stream isNil ifTrue:[ |
3576 |
self throwIOExceptionWithMessage:('cannot open ' , name , ' for writing'). |
|
3577 |
]. |
|
3578 |
||
3579 |
fileNo := self addOpenFile:stream. |
|
3580 |
||
3581 |
FileOpenTrace ifTrue:[ |
|
3582 |
('JAVA: opened ' , name , ' as FD ' , fileNo printString , ' for writing') infoPrintCR. |
|
3583 |
]. |
|
3584 |
||
3585 |
fd instVarNamed:'fd' put:fileNo. |
|
3586 |
||
3587 |
"Created: / 4.2.1998 / 00:14:48 / cg" |
|
442 | 3588 |
"Modified: / 12.11.1998 / 21:29:46 / cg" |
307 | 3589 |
! |
3590 |
||
3591 |
_RandomAccessFile_readBytes:nativeContext |
|
3592 |
^ self anyStream_readBytes:nativeContext |
|
3593 |
||
3594 |
"Modified: / 4.2.1998 / 15:23:27 / cg" |
|
3595 |
! |
|
3596 |
||
3597 |
_RandomAccessFile_seek:nativeContext |
|
3598 |
|file pos| |
|
3599 |
||
3600 |
file := self validateFile:(nativeContext receiver). |
|
3601 |
||
3602 |
FileIOTrace ifTrue:[ |
|
3603 |
('JAVA: seek on ' , file pathName) infoPrintCR. |
|
3604 |
]. |
|
3605 |
||
3606 |
pos := nativeContext argAt:1. |
|
3607 |
file position:pos+1 "/ ST/X position starts at 1 |
|
3608 |
||
3609 |
"Created: / 4.2.1998 / 13:25:38 / cg" |
|
3610 |
"Modified: / 4.2.1998 / 13:28:12 / cg" |
|
3611 |
! |
|
3612 |
||
3613 |
_RandomAccessFile_writeBytes:nativeContext |
|
3614 |
^ self anyStream_writeBytes:nativeContext |
|
3615 |
||
3616 |
"Modified: / 4.2.1998 / 15:24:20 / cg" |
|
3617 |
"Created: / 4.2.1998 / 15:24:35 / cg" |
|
253 | 3618 |
! ! |
3619 |
||
277 | 3620 |
!JavaVM class methodsFor:'native - java.io - jdk1.2'! |
3621 |
||
3622 |
_FileDescriptor_initIDs:nativeContext |
|
3623 |
"/ introduced with jdk1.2 ... (sigh) |
|
3624 |
||
3625 |
"Created: / 27.1.1998 / 18:16:29 / cg" |
|
3626 |
! |
|
3627 |
||
3628 |
_FileInputStream_initIDs:nativeContext |
|
3629 |
"/ introduced with jdk1.2 ... (sigh) |
|
3630 |
||
3631 |
"Created: / 27.1.1998 / 18:15:51 / cg" |
|
3632 |
! |
|
3633 |
||
3634 |
_FileOutputStream_initIDs:nativeContext |
|
3635 |
"/ introduced with jdk1.2 ... (sigh) |
|
3636 |
||
3637 |
"Created: / 27.1.1998 / 18:16:40 / cg" |
|
3638 |
! |
|
3639 |
||
3640 |
_File_canonPath:nativeContext |
|
3641 |
"/ introduced with jdk1.2 ... (sigh) |
|
3642 |
||
3643 |
|jPath path realPath| |
|
3644 |
||
3645 |
jPath := nativeContext argAt:1. |
|
3646 |
jPath isNil ifTrue:[^ jPath]. |
|
3647 |
||
3648 |
path := Java as_ST_String:jPath. |
|
3649 |
realPath := path asFilename pathName. |
|
3650 |
||
3651 |
^ Java as_String:realPath |
|
3652 |
||
3653 |
"Created: / 27.1.1998 / 18:35:58 / cg" |
|
3654 |
"Modified: / 27.1.1998 / 21:36:03 / cg" |
|
3655 |
! |
|
3656 |
||
3657 |
_File_initIDs:nativeContext |
|
3658 |
"/ introduced with jdk1.2 ... (sigh) |
|
3659 |
||
3660 |
"Created: / 27.1.1998 / 18:25:19 / cg" |
|
3661 |
! ! |
|
3662 |
||
253 | 3663 |
!JavaVM class methodsFor:'native - java.lang'! |
3664 |
||
255 | 3665 |
_ClassLoader_defineClass0:nativeContext |
3666 |
"create a new class from a given byteArray. |
|
3667 |
Here, construct a stream on it and pass the work to the |
|
3668 |
JavaClassReader." |
|
3669 |
||
3670 |
|jClassLoader jName name data offset length inStream newClass |
|
3671 |
loaderStub jClass| |
|
3672 |
||
3673 |
jClassLoader := nativeContext receiver. |
|
3674 |
jName := nativeContext argAt:1. |
|
3675 |
||
3676 |
"/ className is now optional ... |
|
3677 |
"/ jName isNil ifTrue:[ |
|
3678 |
"/ self internalError:'nil name in defineClass'. |
|
3679 |
"/ ^ nil |
|
3680 |
"/ ] ifFalse:[ |
|
3681 |
"/ name := Java as_ST_String:jName. |
|
3682 |
"/ ]. |
|
3683 |
||
3684 |
data := nativeContext argAt:2. |
|
3685 |
offset := nativeContext argAt:3. |
|
3686 |
length := nativeContext argAt:4. |
|
3687 |
||
3688 |
inStream := data readStream. |
|
3689 |
inStream position:offset + 1. |
|
3690 |
inStream readLimit:(offset + length). |
|
3691 |
||
270 | 3692 |
"/ loaderStub := Plug new. |
3693 |
"/ loaderStub respondTo:#loadClass: with:[:clsName | |
|
3694 |
"/ |jName| |
|
3695 |
"/ |
|
3696 |
"/self halt. |
|
3697 |
"/ jName := Java as_String:clsName. |
|
3698 |
"/ "/ jClassLoader loadClass:jName |
|
3699 |
"/ jClassLoader |
|
3700 |
"/ perform:#'loadClass(Ljava/lang/String;)Ljava/lang/Class;' |
|
3701 |
"/ with:jName. |
|
3702 |
"/ ]. |
|
255 | 3703 |
|
3704 |
('JAVA: defining class ...') infoPrintCR. |
|
3705 |
||
3706 |
"/ self internalError:'break'. |
|
3707 |
||
3708 |
newClass := JavaClassReader |
|
270 | 3709 |
readStream:inStream |
3710 |
loader:jClassLoader "loaderStub" |
|
3711 |
loadUnresolved:false. |
|
255 | 3712 |
|
3713 |
newClass isNil ifTrue:[ |
|
3714 |
('JAVA: defineClass failed') infoPrintCR. |
|
3715 |
^ nil. |
|
3716 |
]. |
|
3717 |
Transcript showCR:('defined class ' , newClass fullName , '.'). |
|
3718 |
newClass classLoader:jClassLoader. |
|
3719 |
||
3720 |
('Java: defined new class: ' , newClass fullName) infoPrintCR. |
|
3721 |
||
268
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
3722 |
jClass := self javaClassObjectForClass:newClass. |
255 | 3723 |
^ jClass |
3724 |
||
3725 |
"Created: / 7.1.1998 / 12:35:10 / cg" |
|
270 | 3726 |
"Modified: / 24.1.1998 / 15:26:21 / cg" |
255 | 3727 |
! |
3728 |
||
253 | 3729 |
_ClassLoader_findSystemClass0:nativeContext |
3730 |
|loader name class jClass| |
|
3731 |
||
3732 |
loader := nativeContext receiver. |
|
3733 |
name := nativeContext argAt:1. |
|
3734 |
name := Java as_ST_String:name. |
|
3735 |
||
399 | 3736 |
class := Java at:name. |
3737 |
class isNil ifTrue:[ |
|
318 | 3738 |
"/ ('JAVA: findSystemClass0 for ' , name , ' loader is ' , loader displayString) infoPrintCR. |
399 | 3739 |
loader class == (Java classForName:'java.util.SystemClassLoader') ifTrue:[ |
3740 |
"/ Java classForName:name. |
|
3741 |
"/ class := Java at:name. |
|
3742 |
class := JavaClassReader loadSystemClass:name. |
|
3743 |
] ifFalse:[ |
|
3744 |
"/ load using default (ST/X) loader |
|
3745 |
class := JavaClassReader loadSystemClass:name. |
|
3746 |
"/ JavaClassReader classLoaderQuerySignal answer:nil do:[ |
|
3747 |
"/ Java classForName:name. |
|
3748 |
"/ ] |
|
3749 |
]. |
|
253 | 3750 |
]. |
3751 |
||
255 | 3752 |
"/ JavaClassReader classLoaderQuerySignal answer:nil "loader" |
3753 |
"/ do:[ |
|
3754 |
"/ class := Java classForName:name. |
|
3755 |
"/ JavaClassReader postLoadActions:true. |
|
3756 |
"/ ]. |
|
399 | 3757 |
|
255 | 3758 |
(class isNil |
3759 |
"or:[class classLoader notNil]") ifTrue:[ |
|
253 | 3760 |
"/ self halt:'class: ' , name , ' not found.'. |
3761 |
"/ self internalError:'class: ' , name , ' not found.'. |
|
3762 |
||
318 | 3763 |
self |
3764 |
throwExceptionClassName:'java.lang.ClassNotFoundException' |
|
399 | 3765 |
withMessage:('class: ' , name , ' not found.'). |
318 | 3766 |
^ nil |
3767 |
]. |
|
3768 |
||
3769 |
"/ '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
|
3770 |
jClass := self javaClassObjectForClass:class. |
253 | 3771 |
^ jClass |
3772 |
||
3773 |
"Created: / 5.1.1998 / 02:53:04 / cg" |
|
399 | 3774 |
"Modified: / 20.10.1998 / 17:28:34 / cg" |
255 | 3775 |
! |
3776 |
||
440 | 3777 |
_ClassLoader_getSystemResourceAsName0:nativeContext |
3778 |
"/ java.lang.String getSystemResourceAsName0 (java.lang.String) |
|
3779 |
UnimplementedNativeMethodSignal raise |
|
3780 |
||
3781 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3782 |
"Created: / 12.11.1998 / 18:58:34 / cg" |
|
3783 |
! |
|
3784 |
||
255 | 3785 |
_ClassLoader_getSystemResourceAsStream0:nativeContext |
444 | 3786 |
|jString rString dir file text inStream| |
255 | 3787 |
|
3788 |
jString := nativeContext argAt:1. |
|
3789 |
rString := Java as_ST_String:jString. |
|
3790 |
Java classPath do:[:aPath | |
|
444 | 3791 |
|f zipFile zar data| |
3792 |
||
3793 |
f := aPath asFilename. |
|
3794 |
((zipFile := f withSuffix:'jar') exists |
|
3795 |
or:[(zipFile := f withSuffix:'zip') exists]) ifTrue:[ |
|
3796 |
zar := ZipArchive oldFileNamed:zipFile. |
|
3797 |
(Array |
|
3798 |
with:rString |
|
3799 |
with:rString asLowercase |
|
3800 |
with:rString asUppercase) |
|
3801 |
do:[:tryName | |
|
3802 |
data := zar extract:tryName. |
|
3803 |
||
3804 |
inStream := (Java classForName:'java.io.ByteArrayInputStream') newCleared. |
|
3805 |
inStream perform:#'<init>([B)V' with:data. |
|
3806 |
^ inStream. |
|
3807 |
] |
|
3808 |
] ifFalse:[ |
|
3809 |
f exists ifTrue:[ |
|
3810 |
(file := f construct:rString) exists ifTrue:[ |
|
3811 |
(Java isExcludedFromClassPath:file) ifFalse:[ |
|
3812 |
text := file contents asString. |
|
3813 |
||
3814 |
"/ Copy data from returned buffer into Java byte array. |
|
3815 |
||
3816 |
data := text asByteArray. |
|
3817 |
||
3818 |
"/ Create input stream using byte array |
|
3819 |
||
3820 |
inStream := (Java classForName:'java.io.ByteArrayInputStream') newCleared. |
|
3821 |
inStream perform:#'<init>([B)V' with:data. |
|
3822 |
^ inStream. |
|
3823 |
] |
|
277 | 3824 |
] |
3825 |
] |
|
3826 |
] |
|
255 | 3827 |
]. |
3828 |
^ nil |
|
3829 |
||
3830 |
"Created: / 8.1.1998 / 16:06:56 / cg" |
|
444 | 3831 |
"Modified: / 12.11.1998 / 21:51:35 / cg" |
253 | 3832 |
! |
3833 |
||
3834 |
_ClassLoader_init:nativeContext |
|
3835 |
^ nil |
|
3836 |
||
3837 |
"Created: / 5.1.1998 / 02:04:43 / cg" |
|
3838 |
! |
|
3839 |
||
255 | 3840 |
_ClassLoader_resolveClass0:nativeContext |
3841 |
"resolve a new class as previously created by defineClass0" |
|
3842 |
||
399 | 3843 |
|jClassLoader jCls cls loaderStub anyUnresolved| |
255 | 3844 |
|
3845 |
jClassLoader := nativeContext receiver. |
|
3846 |
jCls := nativeContext argAt:1. |
|
3847 |
jCls isNil ifTrue:[ |
|
361
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3848 |
self halt. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3849 |
^ nil |
255 | 3850 |
]. |
3851 |
cls := JavaClasses at:jCls ifAbsent:nil. |
|
3852 |
cls isNil ifTrue:[ |
|
361
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3853 |
self halt. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3854 |
^ nil |
255 | 3855 |
]. |
399 | 3856 |
('JavaVM [info]: resolving class ' , cls fullName , ' ...') infoPrintCR. |
255 | 3857 |
|
3858 |
JavaClassReader classLoaderQuerySignal answer:jClassLoader |
|
3859 |
do:[ |
|
399 | 3860 |
JavaClassReader resolveClass:cls. |
3861 |
"/ JavaClassReader postLoadActions:true. |
|
3862 |
anyUnresolved := false. |
|
361
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3863 |
cls constantPool do:[:entry | |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3864 |
(entry isMemberOf:JavaUnresolvedClassConstant) ifTrue:[ |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3865 |
self halt:'debugHalt'. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3866 |
entry preResolve. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3867 |
self halt:'debugHalt'. |
399 | 3868 |
anyUnresolved := true. |
361
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3869 |
] |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3870 |
] |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3871 |
]. |
399 | 3872 |
anyUnresolved ifTrue:[ |
361
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3873 |
jClassLoader notNil ifTrue:[ |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3874 |
"/ any unresolved left -> try resolving with standard loader |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3875 |
JavaClassReader classLoaderQuerySignal answer:nil |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3876 |
do:[ |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3877 |
JavaClassReader postLoadActions:true. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3878 |
cls constantPool do:[:entry | |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3879 |
(entry isMemberOf:JavaUnresolvedClassConstant) ifTrue:[ |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3880 |
self halt:'debugHalt'. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3881 |
entry preResolve. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3882 |
self halt:'debugHalt'. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3883 |
] |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3884 |
] |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3885 |
] |
255 | 3886 |
]. |
399 | 3887 |
]. |
255 | 3888 |
|
3889 |
"Created: / 7.1.1998 / 13:12:27 / cg" |
|
400 | 3890 |
"Modified: / 20.10.1998 / 19:01:57 / cg" |
255 | 3891 |
! |
3892 |
||
253 | 3893 |
_Class_forName:nativeContext |
3894 |
"get a java.lang.Class by name" |
|
3895 |
||
255 | 3896 |
|jClassName className cls jClass s m c loader| |
253 | 3897 |
|
3898 |
jClassName := nativeContext argAt:1. |
|
3899 |
className := Java as_ST_String:jClassName. |
|
3900 |
||
255 | 3901 |
(s := nativeContext sender) notNil ifTrue:[ |
347 | 3902 |
(s isJavaContext) ifTrue:[ |
307 | 3903 |
c := s method javaClass. |
3904 |
loader := c classLoader. |
|
3905 |
loader isNil ifTrue:[ |
|
255 | 3906 |
"/ self halt. |
307 | 3907 |
] |
3908 |
] |
|
255 | 3909 |
]. |
3910 |
||
3911 |
JavaClassReader classLoaderQuerySignal answer:loader |
|
3912 |
do:[ |
|
307 | 3913 |
cls := Java classForName:className. |
255 | 3914 |
]. |
3915 |
||
3916 |
"/(className startsWith:'sun.awt') ifTrue:[self halt]. |
|
3917 |
"/('classForName: ' , className , ' -> ') print. |
|
3918 |
"/cls notNil ifTrue:[cls fullName printCR] ifFalse:['nil' printCR]. |
|
3919 |
||
253 | 3920 |
cls isNil ifTrue:[ |
307 | 3921 |
ExceptionTrace ifTrue:[ |
3922 |
self halt:'no such class:' , className. |
|
3923 |
]. |
|
3924 |
self throwClassNotFoundException:className. |
|
3925 |
"/ not proceedable |
|
3926 |
AbortSignal raise. |
|
3927 |
"/ not reached |
|
3928 |
^ self |
|
3929 |
]. |
|
3930 |
||
3931 |
^ self javaClassObjectForClass:cls. |
|
3932 |
||
347 | 3933 |
"Modified: / 8.5.1998 / 21:30:03 / cg" |
253 | 3934 |
! |
3935 |
||
3936 |
_Class_getClassLoader:nativeContext |
|
3937 |
"get a classes loader" |
|
3938 |
||
3939 |
|loader| |
|
3940 |
||
3941 |
loader := JavaClassReader classLoaderQuerySignal raise. |
|
3942 |
('JAVA: getClassLoader - ' , loader printString) infoPrintCR. |
|
3943 |
||
3944 |
"/ self unimplementedNativeMethod. |
|
3945 |
^ loader |
|
3946 |
||
3947 |
"Modified: / 21.8.1997 / 16:32:02 / cg" |
|
3948 |
"Created: / 5.1.1998 / 02:51:59 / cg" |
|
3949 |
! |
|
3950 |
||
440 | 3951 |
_Class_getComponentType:nativeContext |
3952 |
UnimplementedNativeMethodSignal raise |
|
3953 |
||
3954 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3955 |
"Created: / 12.11.1998 / 18:54:46 / cg" |
|
3956 |
! |
|
3957 |
||
3958 |
_Class_getConstructor0:nativeContext |
|
3959 |
UnimplementedNativeMethodSignal raise |
|
3960 |
||
3961 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3962 |
"Created: / 12.11.1998 / 18:55:42 / cg" |
|
3963 |
! |
|
3964 |
||
3965 |
_Class_getConstructors0:nativeContext |
|
3966 |
UnimplementedNativeMethodSignal raise |
|
3967 |
||
3968 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3969 |
"Created: / 12.11.1998 / 18:55:26 / cg" |
|
3970 |
! |
|
3971 |
||
3972 |
_Class_getField0:nativeContext |
|
3973 |
UnimplementedNativeMethodSignal raise |
|
3974 |
||
3975 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3976 |
"Created: / 12.11.1998 / 18:55:37 / cg" |
|
3977 |
! |
|
3978 |
||
3979 |
_Class_getFields0:nativeContext |
|
3980 |
UnimplementedNativeMethodSignal raise |
|
3981 |
||
3982 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3983 |
"Created: / 12.11.1998 / 18:55:18 / cg" |
|
3984 |
! |
|
3985 |
||
3986 |
_Class_getInterfaces:nativeContext |
|
3987 |
UnimplementedNativeMethodSignal raise |
|
3988 |
||
3989 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3990 |
"Created: / 12.11.1998 / 18:54:34 / cg" |
|
3991 |
! |
|
3992 |
||
321 | 3993 |
_Class_getMethod0:nativeContext |
3994 |
"get a method, given a name and type spec" |
|
3995 |
||
322 | 3996 |
|jClass cls jmName mName mTypes whichAccess argSig sel| |
321 | 3997 |
|
3998 |
jClass := nativeContext receiver. |
|
3999 |
cls := JavaClasses at:jClass. |
|
4000 |
||
322 | 4001 |
jmName := nativeContext argAt:1. |
4002 |
mName := Java as_ST_String:jmName. |
|
321 | 4003 |
mTypes := nativeContext argAt:2. |
4004 |
whichAccess := nativeContext argAt:3. |
|
405 | 4005 |
self halt. |
322 | 4006 |
argSig := JavaMethod argSignatureFromArgTypeArray:mTypes. |
4007 |
cls methodDictionary keysAndValuesDo:[:sel :mthd | |
|
405 | 4008 |
|i1 i2 jMethod retTypeClass argTypes| |
322 | 4009 |
|
4010 |
JavaMethods notNil ifTrue:[ |
|
4011 |
(jMethod := JavaMethods at:mthd ifAbsent:nil) notNil ifTrue:[ |
|
4012 |
^ jMethod |
|
4013 |
] |
|
4014 |
]. |
|
4015 |
||
4016 |
mthd name printCR. |
|
4017 |
mName printCR. |
|
4018 |
||
4019 |
mthd name = mName ifTrue:[ |
|
4020 |
i1 := mthd signature indexOf:$(. |
|
4021 |
i2 := mthd signature indexOf:$) startingAt:(i1+1). |
|
4022 |
||
4023 |
(mthd signature copyFrom:i1+1 to:i2-1) = argSig ifTrue:[ |
|
4024 |
"/ found it - create a java.lang.reflect.Method for it. |
|
4025 |
jMethod := (Java at:'java.lang.reflect.Method') new. |
|
4026 |
jMethod instVarNamed:'clazz' put:jClass. |
|
4027 |
jMethod instVarNamed:'slot' put:sel. |
|
4028 |
jMethod instVarNamed:'name' put:jmName. |
|
405 | 4029 |
retTypeClass := mthd returnTypeClass. |
4030 |
retTypeClass isNil ifTrue:[ |
|
4031 |
retTypeClass := #void |
|
4032 |
]. |
|
4033 |
argTypes := mthd argSignature. |
|
4034 |
argTypes := argTypes collect:[:s | |
|
4035 |
|c| |
|
4036 |
||
4037 |
c := Java at:s. |
|
4038 |
self javaClassObjectForClass:(c ? s asSymbol) |
|
4039 |
]. |
|
4040 |
jMethod instVarNamed:'returnType' put:(self javaClassObjectForClass:retTypeClass). |
|
4041 |
jMethod instVarNamed:'parameterTypes' put:argTypes. |
|
322 | 4042 |
|
4043 |
JavaMethods isNil ifTrue:[ |
|
4044 |
JavaMethods := IdentityDictionary new |
|
4045 |
]. |
|
4046 |
JavaMethods at:jMethod put:mthd. |
|
4047 |
JavaMethods at:mthd put:jMethod. |
|
4048 |
||
4049 |
^ jMethod. |
|
4050 |
]. |
|
4051 |
]. |
|
4052 |
]. |
|
321 | 4053 |
|
4054 |
self halt. |
|
4055 |
self |
|
4056 |
throwExceptionClassName:'java.lang.NoSuchMethodException' |
|
4057 |
withMessage:'not yet implemented'. |
|
4058 |
||
4059 |
^ nil. |
|
4060 |
||
405 | 4061 |
"Modified: / 22.10.1998 / 01:54:38 / cg" |
321 | 4062 |
! |
4063 |
||
334 | 4064 |
_Class_getMethods0:nativeContext |
4065 |
"get a method, given a name and type spec" |
|
4066 |
||
4067 |
|jClass cls jmName mName mTypes whichAccess argSig sel |
|
4068 |
methods| |
|
4069 |
||
4070 |
jClass := nativeContext receiver. |
|
4071 |
cls := JavaClasses at:jClass. |
|
4072 |
||
405 | 4073 |
"/ 0 = PUBLIC (i.e. includes inherited) / 1 = DECLARED here |
334 | 4074 |
whichAccess := nativeContext argAt:1. |
4075 |
||
4076 |
methods := OrderedCollection new. |
|
4077 |
||
405 | 4078 |
[cls isJavaClass] whileTrue:[ |
4079 |
cls methodDictionary keysAndValuesDo:[:sel :mthd | |
|
4080 |
|i1 i2 jMethod argTypes retTypeClass| |
|
4081 |
||
4082 |
mthd name printCR. |
|
4083 |
||
4084 |
i1 := mthd signature indexOf:$(. |
|
4085 |
i2 := mthd signature indexOf:$) startingAt:(i1+1). |
|
4086 |
||
4087 |
"/ create a java.lang.reflect.Method for it. |
|
4088 |
jMethod := (Java at:'java.lang.reflect.Method') new. |
|
4089 |
jMethod instVarNamed:'clazz' put:jClass. |
|
4090 |
jMethod instVarNamed:'slot' put:sel. |
|
4091 |
jMethod instVarNamed:'name' put:(Java as_String:mthd name). |
|
4092 |
retTypeClass := mthd returnTypeClass. |
|
4093 |
retTypeClass isNil ifTrue:[ |
|
4094 |
retTypeClass := #void |
|
4095 |
]. |
|
4096 |
(name endsWith:')I') ifTrue:[self halt]. |
|
4097 |
argTypes := mthd argSignature. |
|
4098 |
argTypes := argTypes collect:[:s | |
|
4099 |
|c| |
|
4100 |
||
4101 |
c := Java at:s. |
|
4102 |
self javaClassObjectForClass:(c ? s asSymbol) |
|
4103 |
]. |
|
4104 |
||
4105 |
jMethod instVarNamed:'returnType' put:(self javaClassObjectForClass:retTypeClass). |
|
4106 |
jMethod instVarNamed:'parameterTypes' put:argTypes. |
|
334 | 4107 |
|
405 | 4108 |
(mthd name includesString:'setName') ifTrue:[self halt]. |
4109 |
JavaMethods isNil ifTrue:[ |
|
4110 |
JavaMethods := IdentityDictionary new |
|
4111 |
]. |
|
4112 |
JavaMethods at:jMethod put:mthd. |
|
4113 |
JavaMethods at:mthd put:jMethod. |
|
4114 |
||
4115 |
methods add:jMethod. |
|
334 | 4116 |
]. |
405 | 4117 |
whichAccess == 1 ifTrue:[ |
4118 |
"/ local methods only |
|
4119 |
cls := nil |
|
4120 |
] ifFalse:[ |
|
4121 |
cls := cls superclass. |
|
4122 |
] |
|
334 | 4123 |
]. |
4124 |
methods := methods asArray. |
|
4125 |
^ methods. |
|
4126 |
||
405 | 4127 |
"Modified: / 22.10.1998 / 01:53:58 / cg" |
334 | 4128 |
! |
4129 |
||
440 | 4130 |
_Class_getModifiers:nativeContext |
4131 |
UnimplementedNativeMethodSignal raise |
|
4132 |
||
4133 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4134 |
"Created: / 12.11.1998 / 18:54:53 / cg" |
|
4135 |
! |
|
4136 |
||
255 | 4137 |
_Class_getName:nativeContext |
4138 |
"get a classes name" |
|
4139 |
||
4140 |
|jClass cls| |
|
4141 |
||
4142 |
jClass := nativeContext receiver. |
|
4143 |
cls := JavaClasses at:jClass. |
|
359 | 4144 |
^ Java as_String:(cls fullName copyReplaceAll:$/ with:$.). |
4145 |
||
4146 |
"Modified: / 18.7.1998 / 22:59:05 / cg" |
|
255 | 4147 |
! |
4148 |
||
253 | 4149 |
_Class_getPrimitiveClass:nativeContext |
4150 |
"get a primitive class by name" |
|
4151 |
||
4152 |
|jClassName className cls| |
|
4153 |
||
4154 |
jClassName := nativeContext argAt:1. |
|
4155 |
className := Java as_ST_String:jClassName. |
|
4156 |
||
4157 |
JavaClasses isNil ifTrue:[ |
|
261 | 4158 |
self initializePrimitiveClasses |
253 | 4159 |
]. |
4160 |
cls := JavaClasses at:className. |
|
4161 |
||
4162 |
"/ cls := Java classForName:className. |
|
4163 |
"/ cls isNil ifTrue:[ |
|
4164 |
"/ cls := JavaClasses at:('JavaBase_' , className) asSymbol ifAbsent:nil. |
|
4165 |
"/ #( |
|
4166 |
"/ 'boolean' #Boolean |
|
4167 |
"/ 'float' #ShortFloat |
|
4168 |
"/ 'double' #Float |
|
4169 |
"/ 'int' #Integer |
|
4170 |
"/ 'long' #Integer |
|
4171 |
"/ 'char' #Character |
|
4172 |
"/ 'short' #Integer |
|
4173 |
"/ 'byte' #Integer |
|
4174 |
"/ 'void' #UndefinedObject |
|
4175 |
"/ ) pairWiseDo:[:nm :sym | |
|
4176 |
"/ className = nm ifTrue:[ |
|
4177 |
"/ cls := Smalltalk at:sym. |
|
4178 |
"/ ] |
|
4179 |
"/ ]. |
|
4180 |
"/ |
|
4181 |
"/ cls isNil ifTrue:[ |
|
4182 |
"/ self internalError:'class: ' , className , ' not found.'. |
|
4183 |
"/ ]. |
|
4184 |
"/ ]. |
|
4185 |
^ cls |
|
4186 |
||
4187 |
"Created: / 4.1.1998 / 00:46:03 / cg" |
|
4188 |
"Modified: / 4.1.1998 / 01:12:27 / cg" |
|
4189 |
! |
|
4190 |
||
440 | 4191 |
_Class_getSigners:nativeContext |
4192 |
UnimplementedNativeMethodSignal raise |
|
4193 |
||
4194 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4195 |
"Created: / 12.11.1998 / 18:55:01 / cg" |
|
4196 |
! |
|
4197 |
||
255 | 4198 |
_Class_getSuperclass:nativeContext |
4199 |
"return a classes superclass" |
|
4200 |
||
4201 |
|jClass cls superCls| |
|
4202 |
||
4203 |
jClass := nativeContext receiver. |
|
4204 |
cls := JavaClasses at:jClass. |
|
4205 |
superCls := cls superclass. |
|
4206 |
superCls == JavaObject ifTrue:[ |
|
307 | 4207 |
^ nil. |
4208 |
]. |
|
4209 |
^ self javaClassObjectForClass:superCls |
|
255 | 4210 |
|
4211 |
"Created: / 12.1.1998 / 12:38:36 / cg" |
|
307 | 4212 |
"Modified: / 4.2.1998 / 14:51:22 / cg" |
255 | 4213 |
! |
4214 |
||
440 | 4215 |
_Class_isArray:nativeContext |
4216 |
UnimplementedNativeMethodSignal raise |
|
4217 |
||
4218 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4219 |
"Created: / 12.11.1998 / 18:54:24 / cg" |
|
4220 |
! |
|
4221 |
||
4222 |
_Class_isAssignableFrom:nativeContext |
|
4223 |
UnimplementedNativeMethodSignal raise |
|
4224 |
||
4225 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4226 |
"Created: / 12.11.1998 / 18:54:16 / cg" |
|
4227 |
! |
|
4228 |
||
321 | 4229 |
_Class_isInstance:nativeContext |
4230 |
"return true, if something is an instance of a class. |
|
4231 |
(i.e. same as instanceOf - builtin bytecode)" |
|
4232 |
||
4233 |
|jClass cls obj| |
|
4234 |
||
4235 |
obj := nativeContext argAt:1. |
|
4236 |
obj isNil ifTrue:[^ 0 "FALSE"]. |
|
4237 |
||
4238 |
jClass := nativeContext receiver. |
|
4239 |
cls := JavaClasses at:jClass. |
|
4240 |
||
4241 |
(obj isMemberOf:cls) ifTrue:[^ 1 "TRUE"]. |
|
4242 |
(obj isKindOf:cls) ifTrue:[^ 1 "TRUE"]. |
|
4243 |
||
4244 |
cls isBehavior ifTrue:[ |
|
4245 |
cls isInterface ifTrue:[ |
|
4246 |
(obj class hasInterface:cls) ifTrue:[ |
|
4247 |
^ 1 "TRUE" |
|
4248 |
] |
|
4249 |
]. |
|
4250 |
^ (obj isKindOf:cls) ifTrue:[1 "TRUE"] ifFalse:[0 "FALSE"] |
|
4251 |
]. |
|
4252 |
(cls isMemberOf:JavaClassPointerRef) ifTrue:[ |
|
4253 |
"/ must be a pointer to an array of that class |
|
4254 |
||
4255 |
^ (obj isArray) ifTrue:[1 "TRUE"] ifFalse:[0 "FALSE"] |
|
4256 |
]. |
|
4257 |
(cls isMemberOf:JavaBuiltInClassPointerRef) ifTrue:[ |
|
4258 |
cls arrayClass == obj class ifTrue:[ |
|
4259 |
^ 1 "TRUE" |
|
4260 |
]. |
|
4261 |
]. |
|
4262 |
||
4263 |
(obj isMemberOf:Array) ifTrue:[ |
|
4264 |
obj size == 0 ifTrue:[ |
|
4265 |
^ 1 "TRUE" |
|
4266 |
]. |
|
4267 |
^ (self _checkCast:(obj at:1) class:(cls deref)) |
|
4268 |
ifTrue:[1 "TRUE"] ifFalse:[0 "FALSE"] |
|
4269 |
]. |
|
4270 |
self halt. |
|
4271 |
^ 0 "FALSE". |
|
4272 |
||
4273 |
"Modified: / 9.2.1998 / 14:56:23 / cg" |
|
4274 |
! |
|
4275 |
||
255 | 4276 |
_Class_isInterface:nativeContext |
4277 |
"return true, if this class is an interface" |
|
4278 |
||
4279 |
|jClass cls| |
|
4280 |
||
4281 |
jClass := nativeContext receiver. |
|
4282 |
cls := JavaClasses at:jClass. |
|
4283 |
cls isInterface ifTrue:[^ 1 "TRUE"]. |
|
4284 |
^ 0 "FALSE" |
|
4285 |
||
4286 |
"Created: / 12.1.1998 / 12:37:02 / cg" |
|
4287 |
! |
|
4288 |
||
321 | 4289 |
_Class_isPrimitive:nativeContext |
4290 |
"return true, if this class is builtin primitive class |
|
4291 |
(i.e. byteArray, array, string etc." |
|
4292 |
||
4293 |
|jClass cls| |
|
4294 |
||
4295 |
jClass := nativeContext receiver. |
|
4296 |
cls := JavaClasses at:jClass. |
|
4297 |
^ 0 "FALSE" |
|
4298 |
||
4299 |
"Created: / 9.2.1998 / 14:46:07 / cg" |
|
4300 |
! |
|
4301 |
||
253 | 4302 |
_Class_newInstance:nativeContext |
4303 |
"get an instance for a java.lang.Class" |
|
4304 |
||
4305 |
|jClass cls newInst| |
|
4306 |
||
4307 |
jClass := nativeContext receiver. |
|
4308 |
cls := JavaClasses at:jClass. |
|
261 | 4309 |
cls classInit. |
253 | 4310 |
newInst := cls newCleared. |
255 | 4311 |
newInst perform:#'<init>()V'. |
253 | 4312 |
|
4313 |
^ newInst |
|
4314 |
||
4315 |
"Created: / 2.1.1998 / 22:41:38 / cg" |
|
261 | 4316 |
"Modified: / 15.1.1998 / 00:57:37 / cg" |
253 | 4317 |
! |
4318 |
||
440 | 4319 |
_Class_setSigners:nativeContext |
4320 |
UnimplementedNativeMethodSignal raise |
|
4321 |
||
4322 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4323 |
"Created: / 12.11.1998 / 18:55:08 / cg" |
|
4324 |
! |
|
4325 |
||
253 | 4326 |
_Double_doubleToLongBits:nativeContext |
4327 |
|f i| |
|
4328 |
||
4329 |
f := nativeContext argAt:1. |
|
4330 |
||
4331 |
UninterpretedBytes isBigEndian ifTrue:[ |
|
261 | 4332 |
i := f basicAt:8. |
4333 |
i := i bitOr:((f basicAt:7) bitShift:8). |
|
4334 |
i := i bitOr:((f basicAt:6) bitShift:16). |
|
4335 |
i := i bitOr:((f basicAt:5) bitShift:24). |
|
4336 |
i := i bitOr:((f basicAt:4) bitShift:32). |
|
4337 |
i := i bitOr:((f basicAt:3) bitShift:40). |
|
4338 |
i := i bitOr:((f basicAt:2) bitShift:48). |
|
4339 |
i := i bitOr:((f basicAt:1) bitShift:56). |
|
253 | 4340 |
] ifFalse:[ |
261 | 4341 |
i := f basicAt:1. |
4342 |
i := i bitOr:((f basicAt:2) bitShift:8). |
|
4343 |
i := i bitOr:((f basicAt:3) bitShift:16). |
|
4344 |
i := i bitOr:((f basicAt:4) bitShift:24). |
|
4345 |
i := i bitOr:((f basicAt:5) bitShift:32). |
|
4346 |
i := i bitOr:((f basicAt:6) bitShift:40). |
|
4347 |
i := i bitOr:((f basicAt:7) bitShift:48). |
|
4348 |
i := i bitOr:((f basicAt:8) bitShift:56). |
|
253 | 4349 |
]. |
4350 |
||
4351 |
^ i. |
|
4352 |
||
4353 |
"Created: / 4.1.1998 / 01:39:12 / cg" |
|
4354 |
! |
|
4355 |
||
4356 |
_Double_longBitsToDouble:nativeContext |
|
4357 |
|i aFloat| |
|
4358 |
||
4359 |
i := nativeContext argAt:1. |
|
4360 |
||
4361 |
aFloat := Float new. |
|
4362 |
UninterpretedBytes isBigEndian ifTrue:[ |
|
261 | 4363 |
aFloat basicAt:1 put:((i bitShift:-56) bitAnd:16rFF). |
4364 |
aFloat basicAt:2 put:((i bitShift:-48) bitAnd:16rFF). |
|
4365 |
aFloat basicAt:3 put:((i bitShift:-40) bitAnd:16rFF). |
|
4366 |
aFloat basicAt:4 put:((i bitShift:-32) bitAnd:16rFF). |
|
4367 |
aFloat basicAt:5 put:((i bitShift:-24) bitAnd:16rFF). |
|
4368 |
aFloat basicAt:6 put:((i bitShift:-16) bitAnd:16rFF). |
|
4369 |
aFloat basicAt:7 put:((i bitShift:-8) bitAnd:16rFF). |
|
4370 |
aFloat basicAt:8 put:(i bitAnd:16rFF). |
|
253 | 4371 |
] ifFalse:[ |
261 | 4372 |
aFloat basicAt:1 put:(i bitAnd:16rFF). |
4373 |
aFloat basicAt:2 put:((i bitShift:-8) bitAnd:16rFF). |
|
4374 |
aFloat basicAt:3 put:((i bitShift:-16) bitAnd:16rFF). |
|
4375 |
aFloat basicAt:4 put:((i bitShift:-24) bitAnd:16rFF). |
|
4376 |
aFloat basicAt:5 put:((i bitShift:-32) bitAnd:16rFF). |
|
4377 |
aFloat basicAt:6 put:((i bitShift:-40) bitAnd:16rFF). |
|
4378 |
aFloat basicAt:7 put:((i bitShift:-48) bitAnd:16rFF). |
|
4379 |
aFloat basicAt:8 put:((i bitShift:-56) bitAnd:16rFF). |
|
253 | 4380 |
]. |
4381 |
||
4382 |
^ aFloat. |
|
4383 |
||
4384 |
"Created: / 4.1.1998 / 01:45:00 / cg" |
|
4385 |
! |
|
4386 |
||
255 | 4387 |
_Double_valueOf0:nativeContext |
4388 |
|s d| |
|
4389 |
||
4390 |
s := nativeContext argAt:1. |
|
4391 |
s notNil ifTrue:[ |
|
261 | 4392 |
s := Java as_ST_String:s. |
4393 |
d := Float readFrom:s onError:nil. |
|
255 | 4394 |
]. |
4395 |
d isNil ifTrue:[ |
|
261 | 4396 |
self throwNumberFormatException. |
4397 |
"/ not reached |
|
255 | 4398 |
]. |
4399 |
||
4400 |
^ d |
|
4401 |
||
4402 |
"Modified: / 8.8.1997 / 12:03:55 / cg" |
|
4403 |
"Created: / 7.1.1998 / 11:09:43 / cg" |
|
4404 |
! |
|
4405 |
||
253 | 4406 |
_Float_floatToIntBits:nativeContext |
4407 |
|f i| |
|
4408 |
||
4409 |
f := nativeContext argAt:1. |
|
4410 |
||
4411 |
UninterpretedBytes isBigEndian ifTrue:[ |
|
261 | 4412 |
i := f basicAt:4. |
4413 |
i := i bitOr:((f basicAt:3) bitShift:8). |
|
4414 |
i := i bitOr:((f basicAt:2) bitShift:16). |
|
4415 |
i := i bitOr:((f basicAt:1) bitShift:24). |
|
253 | 4416 |
] ifFalse:[ |
261 | 4417 |
i := f basicAt:1. |
4418 |
i := i bitOr:((f basicAt:2) bitShift:8). |
|
4419 |
i := i bitOr:((f basicAt:3) bitShift:16). |
|
4420 |
i := i bitOr:((f basicAt:4) bitShift:24). |
|
253 | 4421 |
]. |
4422 |
||
4423 |
^ i. |
|
4424 |
||
4425 |
"Created: / 4.1.1998 / 01:25:50 / cg" |
|
4426 |
! |
|
4427 |
||
261 | 4428 |
_Float_intBitsToFloat:nativeContet |
4429 |
|i aFloat| |
|
4430 |
||
4431 |
i := nativeContet argAt:1. |
|
4432 |
||
4433 |
aFloat := ShortFloat basicNew. |
|
4434 |
UninterpretedBytes isBigEndian ifTrue:[ |
|
4435 |
aFloat basicAt:1 put:((i bitShift:-24) bitAnd:16rFF). |
|
4436 |
aFloat basicAt:2 put:((i bitShift:-16) bitAnd:16rFF). |
|
4437 |
aFloat basicAt:3 put:((i bitShift:-8) bitAnd:16rFF). |
|
4438 |
aFloat basicAt:4 put:(i bitAnd:16rFF). |
|
4439 |
] ifFalse:[ |
|
4440 |
aFloat basicAt:1 put:(i bitAnd:16rFF). |
|
4441 |
aFloat basicAt:2 put:((i bitShift:-8) bitAnd:16rFF). |
|
4442 |
aFloat basicAt:3 put:((i bitShift:-16) bitAnd:16rFF). |
|
4443 |
aFloat basicAt:4 put:((i bitShift:-24) bitAnd:16rFF). |
|
4444 |
]. |
|
4445 |
||
4446 |
^ aFloat. |
|
4447 |
||
4448 |
"Created: / 13.1.1998 / 23:03:36 / cg" |
|
4449 |
"Modified: / 13.1.1998 / 23:05:01 / cg" |
|
4450 |
! |
|
4451 |
||
440 | 4452 |
_Math_IEEEremainder:nativeContext |
4453 |
UnimplementedNativeMethodSignal raise |
|
4454 |
||
4455 |
"Created: / 12.11.1998 / 18:52:36 / cg" |
|
4456 |
! |
|
4457 |
||
342 | 4458 |
_Math_acos:nativeContext |
4459 |
"arc cosine" |
|
4460 |
||
4461 |
|dVal| |
|
4462 |
||
4463 |
dVal := nativeContext argAt:1. |
|
432 | 4464 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4465 |
"/ dVal isReal ifTrue:[ |
|
4466 |
"/ 'JAVAVM [info]: missing double flag in Math>>acos' infoPrintCR. |
|
4467 |
"/ ] ifFalse:[ |
|
4468 |
"/ self halt:'expected double arg' |
|
4469 |
"/ ] |
|
4470 |
"/ ]. |
|
342 | 4471 |
^ dVal arcCos |
4472 |
||
4473 |
"Created: / 7.5.1998 / 00:34:50 / cg" |
|
432 | 4474 |
"Modified: / 11.11.1998 / 15:08:20 / cg" |
342 | 4475 |
! |
4476 |
||
4477 |
_Math_asin:nativeContext |
|
4478 |
"arc sine" |
|
4479 |
||
4480 |
|dVal| |
|
4481 |
||
4482 |
dVal := nativeContext argAt:1. |
|
432 | 4483 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4484 |
"/ dVal isReal ifTrue:[ |
|
4485 |
"/ 'JAVAVM [info]: missing double flag in Math>>asin' infoPrintCR. |
|
4486 |
"/ ] ifFalse:[ |
|
4487 |
"/ self halt:'expected double arg' |
|
4488 |
"/ ] |
|
4489 |
"/ ]. |
|
342 | 4490 |
^ dVal arcSin |
4491 |
||
4492 |
"Created: / 7.5.1998 / 00:34:26 / cg" |
|
432 | 4493 |
"Modified: / 11.11.1998 / 15:08:15 / cg" |
342 | 4494 |
! |
4495 |
||
440 | 4496 |
_Math_atan2:nativeContext |
4497 |
UnimplementedNativeMethodSignal raise |
|
4498 |
||
4499 |
"Created: / 12.11.1998 / 18:52:52 / cg" |
|
4500 |
! |
|
4501 |
||
317 | 4502 |
_Math_atan:nativeContext |
4503 |
"arc tangens" |
|
4504 |
||
4505 |
|dVal| |
|
4506 |
||
4507 |
dVal := nativeContext argAt:1. |
|
432 | 4508 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4509 |
"/ dVal isReal ifTrue:[ |
|
4510 |
"/ 'JAVAVM [info]: missing double flag in Math>>atan' infoPrintCR. |
|
4511 |
"/ ] ifFalse:[ |
|
4512 |
"/ self halt:'expected double arg' |
|
4513 |
"/ ] |
|
4514 |
"/ ]. |
|
317 | 4515 |
^ dVal arcTan |
4516 |
||
4517 |
"Created: / 6.2.1998 / 01:24:12 / cg" |
|
432 | 4518 |
"Modified: / 11.11.1998 / 15:08:11 / cg" |
317 | 4519 |
! |
4520 |
||
255 | 4521 |
_Math_ceil:nativeContext |
4522 |
"ceiling" |
|
4523 |
||
4524 |
|dVal| |
|
4525 |
||
4526 |
dVal := nativeContext argAt:1. |
|
432 | 4527 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4528 |
"/ dVal isReal ifTrue:[ |
|
4529 |
"/ 'JAVAVM [info]: missing double flag in Math>>ceil' infoPrintCR. |
|
4530 |
"/ ] ifFalse:[ |
|
4531 |
"/ self halt:'expected double arg' |
|
4532 |
"/ ] |
|
4533 |
"/ ]. |
|
255 | 4534 |
^ dVal ceilingAsFloat |
4535 |
||
4536 |
"Created: / 7.1.1998 / 15:43:00 / cg" |
|
432 | 4537 |
"Modified: / 11.11.1998 / 15:08:04 / cg" |
255 | 4538 |
! |
4539 |
||
4540 |
_Math_cos:nativeContext |
|
4541 |
"cosine" |
|
4542 |
||
4543 |
|dVal| |
|
4544 |
||
4545 |
dVal := nativeContext argAt:1. |
|
432 | 4546 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4547 |
"/ dVal isReal ifTrue:[ |
|
4548 |
"/ 'JAVAVM [info]: missing double flag in Math>>cos' infoPrintCR. |
|
4549 |
"/ ] ifFalse:[ |
|
4550 |
"/ self halt:'expected double arg' |
|
4551 |
"/ ] |
|
4552 |
"/ ]. |
|
255 | 4553 |
^ dVal cos |
4554 |
||
4555 |
"Created: / 7.1.1998 / 15:41:30 / cg" |
|
432 | 4556 |
"Modified: / 11.11.1998 / 15:07:59 / cg" |
255 | 4557 |
! |
4558 |
||
342 | 4559 |
_Math_exp:nativeContext |
4560 |
"exponential" |
|
4561 |
||
4562 |
|dVal| |
|
4563 |
||
4564 |
dVal := nativeContext argAt:1. |
|
432 | 4565 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4566 |
"/ dVal isReal ifTrue:[ |
|
4567 |
"/ 'JAVAVM [info]: missing double flag in Math>>exp' infoPrintCR. |
|
4568 |
"/ ] ifFalse:[ |
|
4569 |
"/ self halt:'expected double arg' |
|
4570 |
"/ ] |
|
4571 |
"/ ]. |
|
342 | 4572 |
^ dVal exp |
4573 |
||
4574 |
"Created: / 7.5.1998 / 00:36:19 / cg" |
|
432 | 4575 |
"Modified: / 11.11.1998 / 15:07:50 / cg" |
342 | 4576 |
! |
4577 |
||
255 | 4578 |
_Math_floor:nativeContext |
4579 |
"floor" |
|
4580 |
||
4581 |
|dVal| |
|
4582 |
||
4583 |
dVal := nativeContext argAt:1. |
|
432 | 4584 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4585 |
"/ dVal isReal ifTrue:[ |
|
4586 |
"/ 'JAVAVM [info]: missing double flag in Math>>floor' infoPrintCR. |
|
4587 |
"/ ] ifFalse:[ |
|
4588 |
"/ self halt:'expected double arg' |
|
4589 |
"/ ] |
|
4590 |
"/ ]. |
|
255 | 4591 |
^ dVal floorAsFloat |
4592 |
||
4593 |
"Created: / 7.1.1998 / 19:09:21 / cg" |
|
432 | 4594 |
"Modified: / 11.11.1998 / 15:07:45 / cg" |
255 | 4595 |
! |
4596 |
||
4597 |
_Math_log:nativeContext |
|
4598 |
"logarithm" |
|
4599 |
||
4600 |
|dVal| |
|
4601 |
||
4602 |
dVal := nativeContext argAt:1. |
|
432 | 4603 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4604 |
"/ dVal isReal ifTrue:[ |
|
4605 |
"/ 'JAVAVM [info]: missing double flag in Math>>log' infoPrintCR. |
|
4606 |
"/ ] ifFalse:[ |
|
4607 |
"/ self halt:'expected double arg' |
|
4608 |
"/ ] |
|
4609 |
"/ ]. |
|
255 | 4610 |
^ dVal log |
4611 |
||
4612 |
"Created: / 7.1.1998 / 15:42:19 / cg" |
|
432 | 4613 |
"Modified: / 11.11.1998 / 15:07:38 / cg" |
255 | 4614 |
! |
4615 |
||
4616 |
_Math_pow:nativeContext |
|
4617 |
"power" |
|
4618 |
||
4619 |
|dVal1 dVal2| |
|
4620 |
||
4621 |
dVal1 := nativeContext argAt:1. |
|
432 | 4622 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4623 |
"/ dVal1 isReal ifTrue:[ |
|
4624 |
"/ 'JAVAVM [info]: missing double flag in Math>>pow' infoPrintCR. |
|
4625 |
"/ ] ifFalse:[ |
|
4626 |
"/ self halt:'expected double arg' |
|
4627 |
"/ ] |
|
4628 |
"/ ]. |
|
255 | 4629 |
dVal2 := nativeContext argAt:3. |
432 | 4630 |
"/ (nativeContext argAt:4) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4631 |
"/ dVal2 isReal ifTrue:[ |
|
4632 |
"/ 'JAVAVM [info]: missing double flag in Math>>pow' infoPrintCR. |
|
4633 |
"/ ] ifFalse:[ |
|
4634 |
"/ self halt:'expected double arg' |
|
4635 |
"/ ] |
|
4636 |
"/ ]. |
|
255 | 4637 |
^ dVal1 raisedTo:dVal2 |
4638 |
||
4639 |
"Created: / 7.1.1998 / 15:44:13 / cg" |
|
432 | 4640 |
"Modified: / 11.11.1998 / 15:07:33 / cg" |
255 | 4641 |
! |
4642 |
||
440 | 4643 |
_Math_rint:nativeContext |
4644 |
UnimplementedNativeMethodSignal raise |
|
4645 |
||
4646 |
"Created: / 12.11.1998 / 18:52:47 / cg" |
|
4647 |
! |
|
4648 |
||
255 | 4649 |
_Math_sin:nativeContext |
4650 |
"sine" |
|
4651 |
||
4652 |
|dVal| |
|
4653 |
||
4654 |
dVal := nativeContext argAt:1. |
|
432 | 4655 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4656 |
"/ dVal isReal ifTrue:[ |
|
4657 |
"/ 'JAVAVM [info]: missing double flag in Math>>sin' infoPrintCR. |
|
4658 |
"/ ] ifFalse:[ |
|
4659 |
"/ self halt:'expected double arg' |
|
4660 |
"/ ] |
|
4661 |
"/ ]. |
|
255 | 4662 |
^ dVal sin |
4663 |
||
4664 |
"Created: / 7.1.1998 / 15:41:40 / cg" |
|
432 | 4665 |
"Modified: / 11.11.1998 / 15:07:09 / cg" |
255 | 4666 |
! |
4667 |
||
4668 |
_Math_sqrt:nativeContext |
|
4669 |
"square root" |
|
4670 |
||
4671 |
|dVal| |
|
4672 |
||
4673 |
dVal := nativeContext argAt:1. |
|
432 | 4674 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4675 |
"/ dVal isReal ifTrue:[ |
|
4676 |
"/ 'JAVAVM [info]: missing double flag in Math>>sqrt' infoPrintCR. |
|
4677 |
"/ ] ifFalse:[ |
|
4678 |
"/ self halt:'expected double arg' |
|
4679 |
"/ ] |
|
4680 |
"/ ]. |
|
4681 |
||
4682 |
"/ how about domain errors ? |
|
4683 |
dVal < 0 ifTrue:[ |
|
4684 |
"/ ^ 0.0 |
|
255 | 4685 |
]. |
4686 |
^ dVal sqrt |
|
4687 |
||
4688 |
"Created: / 7.1.1998 / 15:42:40 / cg" |
|
432 | 4689 |
"Modified: / 11.11.1998 / 15:06:55 / cg" |
255 | 4690 |
! |
4691 |
||
342 | 4692 |
_Math_tan:nativeContext |
4693 |
"tangent" |
|
4694 |
||
4695 |
|dVal| |
|
4696 |
||
4697 |
dVal := nativeContext argAt:1. |
|
432 | 4698 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4699 |
"/ dVal isReal ifTrue:[ |
|
4700 |
"/ 'JAVAVM [info]: missing double flag in Math>>tan' infoPrintCR. |
|
4701 |
"/ ] ifFalse:[ |
|
4702 |
"/ self halt:'expected double arg' |
|
4703 |
"/ ] |
|
4704 |
"/ ]. |
|
342 | 4705 |
^ dVal tan |
4706 |
||
4707 |
"Created: / 7.5.1998 / 00:34:03 / cg" |
|
432 | 4708 |
"Modified: / 11.11.1998 / 15:07:14 / cg" |
342 | 4709 |
! |
4710 |
||
334 | 4711 |
_Method_getModifiers:nativeContext |
4712 |
|jMethod mthd retVal| |
|
4713 |
||
4714 |
jMethod := nativeContext receiver. |
|
4715 |
||
4716 |
mthd := JavaMethods at:jMethod ifAbsent:nil. |
|
4717 |
mthd isNil ifTrue:[ |
|
4718 |
self halt. |
|
4719 |
^ 0 |
|
4720 |
]. |
|
4721 |
^ mthd accessFlags |
|
4722 |
||
4723 |
"Modified: / 9.4.1998 / 17:50:01 / cg" |
|
4724 |
! |
|
4725 |
||
322 | 4726 |
_Method_invoke:nativeContext |
4727 |
"invoke a javaMethod" |
|
4728 |
||
4729 |
|jMethod mthd rec args retVal| |
|
4730 |
||
4731 |
jMethod := nativeContext receiver. |
|
4732 |
rec := nativeContext argAt:1. |
|
4733 |
args := nativeContext argAt:2. |
|
4734 |
||
4735 |
mthd := JavaMethods at:jMethod ifAbsent:nil. |
|
4736 |
mthd isNil ifTrue:[ |
|
4737 |
self halt. |
|
4738 |
]. |
|
4739 |
||
4740 |
"/ check for arguments to match the expected types ... |
|
4741 |
||
4742 |
mthd argSignature keysAndValuesDo:[:index :argSig | |
|
4743 |
|cls arg| |
|
4744 |
||
4745 |
cls := Java at:argSig. |
|
4746 |
arg := args at:index. |
|
4747 |
(arg isKindOf:cls) ifFalse:[ |
|
4748 |
self halt. |
|
4749 |
] |
|
4750 |
]. |
|
4751 |
||
4752 |
mthd isStatic ifTrue:[ |
|
4753 |
retVal := mthd valueWithReceiver:(mthd javaClass) arguments:args selector:mthd selector. |
|
4754 |
^ retVal |
|
4755 |
] ifFalse:[ |
|
4756 |
self halt. |
|
4757 |
]. |
|
4758 |
||
4759 |
self halt. |
|
4760 |
||
4761 |
"Created: / 13.2.1998 / 15:15:28 / cg" |
|
4762 |
"Modified: / 13.2.1998 / 15:35:54 / cg" |
|
4763 |
! |
|
4764 |
||
253 | 4765 |
_Object_clone:nativeContext |
4766 |
"clone an object" |
|
4767 |
||
4768 |
|o rslt| |
|
4769 |
||
4770 |
o := nativeContext receiver. |
|
4771 |
rslt := o shallowCopy. |
|
4772 |
^ rslt |
|
4773 |
||
4774 |
"Created: / 4.1.1998 / 19:39:26 / cg" |
|
4775 |
! |
|
4776 |
||
255 | 4777 |
_Object_getClass:nativeContext |
4778 |
"return an objects class" |
|
4779 |
||
4780 |
|o cls jClass| |
|
4781 |
||
4782 |
o := nativeContext receiver. |
|
4783 |
cls := o class. |
|
4784 |
||
268
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
4785 |
jClass := self javaClassObjectForClass:cls. |
255 | 4786 |
^ jClass |
4787 |
||
4788 |
"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
|
4789 |
"Modified: / 23.1.1998 / 17:48:22 / cg" |
255 | 4790 |
! |
4791 |
||
253 | 4792 |
_Object_hashCode:nativeContext |
4793 |
"identityHash" |
|
4794 |
||
4795 |
|o rslt| |
|
4796 |
||
4797 |
o := nativeContext receiver. |
|
4798 |
rslt := o identityHash. |
|
4799 |
^ rslt |
|
4800 |
||
4801 |
"Created: / 4.1.1998 / 19:40:26 / cg" |
|
4802 |
! |
|
4803 |
||
255 | 4804 |
_Object_notify:nativeContext |
4805 |
"wakeup" |
|
4806 |
||
4807 |
self wakeup:(nativeContext receiver). |
|
4808 |
||
4809 |
"Created: / 6.1.1998 / 21:09:26 / cg" |
|
4810 |
! |
|
4811 |
||
253 | 4812 |
_Object_notifyAll:nativeContext |
4813 |
self wakeupAll:(nativeContext receiver). |
|
4814 |
||
4815 |
"Created: / 3.1.1998 / 03:06:56 / cg" |
|
4816 |
! |
|
4817 |
||
4818 |
_Object_wait:nativeMethodContext |
|
4819 |
"wait" |
|
4820 |
||
4821 |
|tmo handle sema enteredMonitors| |
|
4822 |
||
4823 |
handle := nativeMethodContext receiver. |
|
4824 |
tmo := nativeMethodContext argAt:1. |
|
4825 |
||
4826 |
sema := JavaVM semaphoreFor:handle. |
|
4827 |
||
4828 |
"/ temporarily leave all entered monitors. |
|
4829 |
||
4830 |
enteredMonitors := self enteredMonitors. |
|
4831 |
||
4832 |
enteredMonitors size > 0 ifTrue:[ |
|
306 | 4833 |
MonitorTrace ifTrue:[ |
4834 |
('====> wait - exit ' , enteredMonitors size printString , ' monitors in ' , Processor activeProcess name , ' ...') infoPrintCR. |
|
4835 |
]. |
|
4836 |
enteredMonitors do:[:handle | |
|
4837 |
|mon| |
|
4838 |
||
4839 |
mon := LockTable at:handle ifAbsent:nil. |
|
4840 |
mon isNil ifTrue:[ |
|
4841 |
self halt:'no monitor in wait'. |
|
4842 |
] ifFalse:[ |
|
4843 |
MonitorTrace ifTrue:[ |
|
4844 |
('====> wait - exit monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. |
|
4845 |
]. |
|
4846 |
mon exit. |
|
4847 |
]. |
|
4848 |
]. |
|
253 | 4849 |
]. |
4850 |
||
4851 |
[ |
|
306 | 4852 |
ThreadTrace ifTrue:[ |
4853 |
('====> thread ' , Processor activeProcess name , ' waiting ...') infoPrintCR. |
|
4854 |
]. |
|
307 | 4855 |
Processor activeProcess state:#javaWait. |
306 | 4856 |
tmo = 0 ifTrue:[ |
4857 |
sema wait. |
|
4858 |
] ifFalse:[ |
|
4859 |
sema waitWithTimeout:tmo / 1000. |
|
4860 |
]. |
|
4861 |
] valueOnUnwindDo: "valueNowOrOnUnwindDo:" [ |
|
4862 |
JavaVM releaseSemaphoreFor:handle. |
|
253 | 4863 |
]. |
4864 |
||
4865 |
"/ re-enter monitors. |
|
4866 |
||
4867 |
enteredMonitors size > 0 ifTrue:[ |
|
306 | 4868 |
MonitorTrace ifTrue:[ |
4869 |
('====> wait - reenter ' , enteredMonitors size printString , ' monitors in ' , Processor activeProcess name , ' ...') infoPrintCR. |
|
4870 |
]. |
|
4871 |
enteredMonitors do:[:handle | |
|
4872 |
|mon| |
|
4873 |
||
4874 |
LockTableAccess critical:[ |
|
4875 |
mon := LockTable at:handle ifAbsent:nil. |
|
4876 |
mon isNil ifTrue:[ |
|
4877 |
LockTable at:handle put:(mon := Monitor new) |
|
4878 |
] |
|
4879 |
]. |
|
4880 |
MonitorTrace ifTrue:[ |
|
4881 |
('====> wait - reenter monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. |
|
4882 |
]. |
|
4883 |
mon enter. |
|
4884 |
] |
|
253 | 4885 |
]. |
4886 |
||
4887 |
ThreadTrace ifTrue:[ |
|
306 | 4888 |
'====> thread continues ...' printCR. |
253 | 4889 |
] |
4890 |
||
426 | 4891 |
"Modified: / 5.11.1998 / 20:42:46 / cg" |
253 | 4892 |
! |
4893 |
||
4894 |
_Runtime_buildLibName:nativeContext |
|
4895 |
|jPath jFileName path fileName libName| |
|
4896 |
||
4897 |
jPath := nativeContext argAt:1. |
|
4898 |
jFileName := nativeContext argAt:2. |
|
4899 |
||
4900 |
path := Java as_ST_String:jPath. |
|
4901 |
fileName := Java as_ST_String:jFileName. |
|
4902 |
||
4903 |
path = '__builtIn__' ifTrue:[ |
|
261 | 4904 |
libName := path , '/' , fileName |
253 | 4905 |
] ifFalse:[ |
261 | 4906 |
libName := path , '/lib' , fileName , '.so'. |
253 | 4907 |
]. |
4908 |
^ Java as_String:libName. |
|
4909 |
||
4910 |
"Modified: / 8.8.1997 / 12:05:05 / cg" |
|
4911 |
"Created: / 4.1.1998 / 19:07:14 / cg" |
|
4912 |
! |
|
4913 |
||
261 | 4914 |
_Runtime_execInternal:nativeContext |
4915 |
"Run a unix-command; return a process object." |
|
4916 |
||
4917 |
|cmdAndArgArray envArray cmd jProcessClass jProcess| |
|
4918 |
||
432 | 4919 |
cmdAndArgArray := nativeContext argAt:1. |
4920 |
envArray := nativeContext argAt:2. |
|
4921 |
||
4922 |
cmd := cmdAndArgArray at:1. |
|
4923 |
||
4924 |
OperatingSystem isUNIXlike ifTrue:[ |
|
4925 |
jProcessClass := Java classForName:'java.lang.UNIXProcess'. |
|
4926 |
] ifFalse:[ |
|
4927 |
jProcessClass := Java classForName:'java.lang.Win32Process'. |
|
4928 |
]. |
|
261 | 4929 |
"/ |
432 | 4930 |
jProcessClass notNil ifTrue:[ |
4931 |
jProcess := jProcessClass newCleared. |
|
4932 |
jProcess |
|
4933 |
perform:#'<init>([Ljava/lang/String;[Ljava/lang/String;)V' |
|
4934 |
with:cmdAndArgArray |
|
4935 |
with:envArray. |
|
4936 |
^ jProcess |
|
4937 |
]. |
|
4938 |
self halt. |
|
261 | 4939 |
self throwIOExceptionWithMessage:'Process execution disabled/unimplemented'. |
4940 |
^ nil |
|
4941 |
||
4942 |
"Created: / 15.1.1998 / 01:50:31 / cg" |
|
432 | 4943 |
"Modified: / 10.11.1998 / 19:54:29 / cg" |
261 | 4944 |
! |
4945 |
||
255 | 4946 |
_Runtime_exitInternal:nativeContext |
4947 |
"exit - here, we only shut down java threads" |
|
4948 |
||
4949 |
|enteredMonitors| |
|
4950 |
||
474 | 4951 |
ExitDebug == true ifTrue:[ |
4952 |
self halt:'Java code called exit'. |
|
4953 |
]. |
|
4954 |
||
255 | 4955 |
(enteredMonitors := self enteredMonitors) size > 0 ifTrue:[ |
306 | 4956 |
enteredMonitors do:[:handle | |
4957 |
| mon | |
|
4958 |
||
4959 |
mon := LockTable at:handle ifAbsent:nil. |
|
4960 |
mon isNil ifTrue:[ |
|
4961 |
self halt:'no monitor in exitInternal'. |
|
4962 |
] ifFalse:[ |
|
4963 |
mon exit. |
|
255 | 4964 |
('====> terminateThread - exit monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. |
4965 |
"/ LockTableAccess critical:[ |
|
4966 |
"/ mon isFree ifTrue:[ |
|
4967 |
"/ LockTable removeKey:handle |
|
4968 |
"/ ] |
|
4969 |
"/ ] |
|
306 | 4970 |
]. |
4971 |
]. |
|
4972 |
]. |
|
4973 |
||
4974 |
"/ JavaVM releaseAllJavaResources. |
|
255 | 4975 |
AbortSignal raise. |
4976 |
self halt. |
|
4977 |
||
4978 |
"Created: / 7.1.1998 / 22:48:51 / cg" |
|
474 | 4979 |
"Modified: / 2.12.1998 / 23:03:18 / cg" |
255 | 4980 |
! |
4981 |
||
4982 |
_Runtime_freeMemory:nativeContext |
|
4983 |
"free memory - Returns the number of free bytes" |
|
4984 |
||
4985 |
^ ObjectMemory freeListSpace + ObjectMemory freeSpace |
|
4986 |
||
4987 |
"Created: / 12.1.1998 / 12:59:53 / cg" |
|
4988 |
! |
|
4989 |
||
4990 |
_Runtime_gc:nativeContext |
|
4991 |
"Runs the garbage collector. |
|
4992 |
Ignored, since the ST-gc runs all the time." |
|
4993 |
||
4994 |
^ self |
|
4995 |
||
4996 |
"Modified: / 12.1.1998 / 12:58:32 / cg" |
|
4997 |
! |
|
4998 |
||
253 | 4999 |
_Runtime_initializeLinkerInternal:nativeContext |
5000 |
"init sharedLib linker, return searchPath as javaString" |
|
5001 |
||
5002 |
|path| |
|
5003 |
||
5004 |
"/ mhmh - what is done here ? |
|
5005 |
||
5006 |
path := ''. |
|
5007 |
LibPath do:[:comp | path size == 0 ifTrue:[ |
|
261 | 5008 |
path := path , comp |
5009 |
] ifFalse:[ |
|
5010 |
path := path , ':' , comp |
|
5011 |
] |
|
5012 |
]. |
|
253 | 5013 |
|
5014 |
^ Java as_String:path |
|
5015 |
||
5016 |
"Modified: / 7.8.1997 / 21:17:03 / cg" |
|
5017 |
"Created: / 4.1.1998 / 17:53:15 / cg" |
|
5018 |
! |
|
5019 |
||
5020 |
_Runtime_loadFileInternal:nativeContext |
|
5021 |
"load a sharedLib, return boolean 0 (false) if fail; 1 (true) if ok" |
|
5022 |
||
5023 |
|ret| |
|
5024 |
||
5025 |
ret := self _Runtime_loadFileInternalI:nativeContext. |
|
5026 |
ret < 0 ifTrue:[ ret := 0 ]. |
|
5027 |
^ ret |
|
5028 |
||
5029 |
"Created: / 4.1.1998 / 19:10:20 / cg" |
|
5030 |
"Modified: / 4.1.1998 / 19:11:04 / cg" |
|
5031 |
! |
|
5032 |
||
5033 |
_Runtime_loadFileInternalI:nativeContext |
|
5034 |
"1.1b3 change; load a sharedLib like 'loadFileInternal', |
|
5035 |
but return integer: |
|
319 | 5036 |
-1 outOfMemory error |
5037 |
0 failed to load |
|
5038 |
1 loaded or already loaded (i.e. ok)" |
|
253 | 5039 |
|
5040 |
|jLibName libName libHandle| |
|
5041 |
||
5042 |
jLibName := nativeContext argAt:1. |
|
5043 |
libName := Java as_ST_String:jLibName. |
|
5044 |
||
5045 |
(SimulatedLibs includes:libName) ifTrue:[ |
|
319 | 5046 |
"/ ('JAVA: builtIn libLoad simulated: ' , libName) printNL. |
5047 |
^ 1 |
|
253 | 5048 |
]. |
5049 |
(LoadedLibs notNil and:[LoadedLibs includesKey:libName]) ifTrue:[ |
|
319 | 5050 |
"/ ('JAVA: already loaded: ' , libName) printNL. |
5051 |
^ 1 |
|
253 | 5052 |
]. |
5053 |
||
5054 |
libName asFilename exists ifFalse:[ |
|
319 | 5055 |
('JAVA: no file to load: ' , libName) printNL. |
5056 |
^ 0 |
|
5057 |
]. |
|
5058 |
||
5059 |
(self confirm:'permission to load native library: ' , libName , ' ?') ifFalse:[ |
|
5060 |
^ 0 |
|
253 | 5061 |
]. |
5062 |
||
5063 |
libHandle := ObjectFileLoader loadLibrary:libName. |
|
5064 |
libHandle isNil ifTrue:[ |
|
319 | 5065 |
('JAVA: failed to load: ' , libName) printNL. |
5066 |
^ 0 |
|
253 | 5067 |
]. |
5068 |
||
5069 |
LoadedLibs isNil ifTrue:[ |
|
319 | 5070 |
LoadedLibs := Dictionary new. |
253 | 5071 |
]. |
5072 |
||
5073 |
LoadedLibs at:libName put:libHandle. |
|
5074 |
^ 1 |
|
5075 |
||
5076 |
"Created: / 4.1.1998 / 19:10:54 / cg" |
|
319 | 5077 |
"Modified: / 6.2.1998 / 03:11:59 / cg" |
253 | 5078 |
! |
5079 |
||
440 | 5080 |
_Runtime_runFinalization:nativeContext |
5081 |
"/ void runFinalization () |
|
5082 |
UnimplementedNativeMethodSignal raise |
|
5083 |
||
5084 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5085 |
"Created: / 12.11.1998 / 18:59:01 / cg" |
|
5086 |
! |
|
5087 |
||
380 | 5088 |
_Runtime_runFinalizersOnExit0:nativeContext |
5089 |
"" |
|
5090 |
||
5091 |
|onOff| |
|
5092 |
||
5093 |
onOff := nativeContext argAt:1. |
|
5094 |
^ 1 |
|
5095 |
||
5096 |
"Modified: / 6.2.1998 / 03:11:59 / cg" |
|
5097 |
"Created: / 15.10.1998 / 23:34:55 / cg" |
|
5098 |
! |
|
5099 |
||
255 | 5100 |
_Runtime_totalMemory:nativeContext |
5101 |
"free memory - Returns the total number of bytes" |
|
5102 |
||
5103 |
^ ObjectMemory oldSpaceSize + ObjectMemory newSpaceSize |
|
5104 |
||
5105 |
"Created: / 12.1.1998 / 12:59:23 / cg" |
|
5106 |
! |
|
5107 |
||
440 | 5108 |
_Runtime_traceInstructions:nativeContext |
5109 |
"/ void traceInstructions (boolean) |
|
5110 |
UnimplementedNativeMethodSignal raise |
|
5111 |
||
5112 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5113 |
"Created: / 12.11.1998 / 18:59:18 / cg" |
|
5114 |
! |
|
5115 |
||
5116 |
_Runtime_traceMethodCalls:nativeContext |
|
5117 |
"/ void traceMethodCalls (boolean) |
|
5118 |
UnimplementedNativeMethodSignal raise |
|
5119 |
||
5120 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5121 |
"Created: / 12.11.1998 / 18:59:37 / cg" |
|
5122 |
! |
|
5123 |
||
5124 |
_SecurityManager_classDepth:nativeContext |
|
5125 |
UnimplementedNativeMethodSignal raise |
|
5126 |
||
5127 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5128 |
"Created: / 12.11.1998 / 18:56:27 / cg" |
|
5129 |
! |
|
5130 |
||
261 | 5131 |
_SecurityManager_classLoaderDepth:nativeContext |
5132 |
|con depth| |
|
5133 |
||
5134 |
con := thisContext sender. |
|
5135 |
depth := 1. |
|
5136 |
[con notNil] whileTrue:[ |
|
5137 |
con receiver == JavaClassReader classLoaderQuerySignal ifTrue:[ |
|
5138 |
con selector == #handle:do: ifTrue:[ |
|
5139 |
depth := depth + 1 |
|
5140 |
] |
|
5141 |
]. |
|
5142 |
con := con sender. |
|
5143 |
]. |
|
5144 |
'JAVA: classLoaderDepth -> ' infoPrint. depth infoPrintCR. |
|
5145 |
^ depth. |
|
5146 |
||
5147 |
"Created: / 13.1.1998 / 09:21:46 / cg" |
|
5148 |
"Modified: / 13.1.1998 / 09:33:43 / cg" |
|
5149 |
! |
|
5150 |
||
5151 |
_SecurityManager_currentClassLoader:nativeContext |
|
5152 |
|loader| |
|
5153 |
||
5154 |
loader := JavaClassReader classLoaderQuerySignal raise. |
|
5155 |
'JAVA: currentClassLoader -> ' infoPrint. loader displayString infoPrintCR. |
|
5156 |
^ loader. |
|
5157 |
||
5158 |
"Created: / 13.1.1998 / 09:23:28 / cg" |
|
5159 |
! |
|
5160 |
||
440 | 5161 |
_SecurityManager_currentLoadedClass0:nativeContext |
5162 |
UnimplementedNativeMethodSignal raise |
|
5163 |
||
5164 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5165 |
"Created: / 12.11.1998 / 18:56:41 / cg" |
|
5166 |
! |
|
5167 |
||
5168 |
_SecurityManager_getClassContext:nativeContext |
|
5169 |
UnimplementedNativeMethodSignal raise |
|
5170 |
||
5171 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5172 |
"Created: / 12.11.1998 / 18:56:06 / cg" |
|
5173 |
! |
|
5174 |
||
5175 |
_String_intern:nativeContext |
|
5176 |
UnimplementedNativeMethodSignal raise |
|
5177 |
||
5178 |
"Created: / 12.11.1998 / 18:50:56 / cg" |
|
5179 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5180 |
! |
|
5181 |
||
253 | 5182 |
_System_arraycopy:nativeContext |
398 | 5183 |
|srcArray srcIdx dstArray dstIdx count dstEndIdx| |
253 | 5184 |
|
5185 |
srcArray := nativeContext argAt:1. |
|
5186 |
srcIdx := nativeContext argAt:2. |
|
5187 |
dstArray := nativeContext argAt:3. |
|
5188 |
dstIdx := nativeContext argAt:4. |
|
5189 |
count := nativeContext argAt:5. |
|
5190 |
||
398 | 5191 |
dstEndIdx := dstIdx + count. |
5192 |
dstIdx := dstIdx + 1. "/ ST uses 1-based indexing |
|
5193 |
srcIdx := srcIdx + 1. "/ ST uses 1-based indexing |
|
5194 |
||
253 | 5195 |
srcArray class isBytes ifTrue:[ |
398 | 5196 |
dstArray class isBytes ifFalse:[ |
5197 |
self halt:'incompatible arraycopy collections'. |
|
5198 |
]. |
|
5199 |
dstArray replaceBytesFrom:dstIdx to:dstEndIdx with:srcArray startingAt:srcIdx. |
|
253 | 5200 |
] ifFalse:[ |
398 | 5201 |
dstArray replaceFrom:dstIdx to:dstEndIdx with:srcArray startingAt:srcIdx. |
253 | 5202 |
]. |
5203 |
^ nil. |
|
5204 |
||
5205 |
"Created: / 3.1.1998 / 01:56:44 / cg" |
|
398 | 5206 |
"Modified: / 20.10.1998 / 16:22:46 / cg" |
253 | 5207 |
! |
5208 |
||
5209 |
_System_currentTimeMillis:nativeContext |
|
5210 |
"return the milliseconds since 1.jan.1970" |
|
5211 |
||
368 | 5212 |
|seconds delta| |
5213 |
||
5214 |
"/ workaround win32 bug (use 01:01:01 as base) |
|
5215 |
delta := AbsoluteTime now millisecondDeltaFrom:(AbsoluteTime day:1 month:1 year:1970 hour:1 minutes:1 seconds:1). |
|
5216 |
delta := delta - 3600 - 60 - 1. |
|
409 | 5217 |
"/ make certain, it fits 64 signed bits |
5218 |
delta := delta bitAnd:16r7FFFFFFFFFFFFFFF. |
|
368 | 5219 |
^ delta max:0 |
253 | 5220 |
|
5221 |
"Created: / 3.1.1998 / 03:25:50 / cg" |
|
409 | 5222 |
"Modified: / 2.11.1998 / 16:42:00 / cg" |
253 | 5223 |
! |
5224 |
||
440 | 5225 |
_System_identityHashCode:nativeContext |
5226 |
UnimplementedNativeMethodSignal raise |
|
5227 |
||
5228 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5229 |
"Created: / 12.11.1998 / 18:54:00 / cg" |
|
5230 |
! |
|
5231 |
||
253 | 5232 |
_System_initProperties:nativeContext |
5233 |
|props stProps| |
|
5234 |
||
5235 |
props := nativeContext argAt:1. |
|
5236 |
stProps := self systemProperties. |
|
5237 |
||
5238 |
"/ recursively invoke myself on the Java HashTable. |
|
5239 |
"/ calling 'put' to stuff in the values ... |
|
5240 |
||
5241 |
stProps keysAndValuesDo:[:key :value | |
|
270 | 5242 |
|keyObj valueObj| |
5243 |
||
5244 |
keyObj := Java as_String:key. |
|
5245 |
valueObj := Java as_String:value. |
|
5246 |
||
5247 |
props |
|
5248 |
perform:#'put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' |
|
5249 |
with:keyObj |
|
5250 |
with:valueObj. |
|
253 | 5251 |
]. |
5252 |
^ props |
|
5253 |
||
5254 |
"Created: / 3.1.1998 / 14:25:22 / cg" |
|
5255 |
"Modified: / 4.1.1998 / 14:23:18 / cg" |
|
5256 |
! |
|
5257 |
||
5258 |
_System_setErr0:nativeContext |
|
5259 |
|stream| |
|
5260 |
||
5261 |
stream := nativeContext argAt:1. |
|
5262 |
||
5263 |
self setOpenFile:(self javaConsoleStream ? Stderr) at:2. |
|
5264 |
||
5265 |
nativeContext receiver instVarNamed:'err' put:stream. |
|
5266 |
||
5267 |
"Created: / 18.3.1997 / 15:02:05 / cg" |
|
5268 |
"Modified: / 4.1.1998 / 16:21:15 / cg" |
|
5269 |
! |
|
5270 |
||
5271 |
_System_setIn0:nativeContext |
|
5272 |
|stream| |
|
5273 |
||
5274 |
stream := nativeContext argAt:1. |
|
5275 |
||
5276 |
self setOpenFile:Stdin at:0. |
|
5277 |
||
5278 |
nativeContext receiver instVarNamed:'in' put:stream. |
|
5279 |
||
5280 |
"Created: / 4.1.1998 / 16:16:38 / cg" |
|
5281 |
"Modified: / 4.1.1998 / 16:20:44 / cg" |
|
5282 |
! |
|
5283 |
||
5284 |
_System_setOut0:nativeContext |
|
5285 |
|stream| |
|
5286 |
||
5287 |
stream := nativeContext argAt:1. |
|
5288 |
||
5289 |
self setOpenFile:(self javaConsoleStream ? Stdout) at:1. |
|
5290 |
||
5291 |
nativeContext receiver instVarNamed:'out' put:stream. |
|
5292 |
||
5293 |
"Created: / 4.1.1998 / 16:18:26 / cg" |
|
5294 |
"Modified: / 4.1.1998 / 16:20:23 / cg" |
|
5295 |
! |
|
5296 |
||
440 | 5297 |
_Thread_countStackFrames:nativeContext |
5298 |
"/ int countStackFrames () |
|
5299 |
UnimplementedNativeMethodSignal raise |
|
5300 |
||
5301 |
"Created: / 12.11.1998 / 19:06:21 / cg" |
|
5302 |
! |
|
5303 |
||
253 | 5304 |
_Thread_currentThread:nativeMethodContext |
5305 |
|t p prio| |
|
5306 |
||
5307 |
p := Processor activeProcess. |
|
5308 |
t := self javaThreadForSTProcess:p. |
|
5309 |
t notNil ifTrue:[ |
|
261 | 5310 |
^ t |
253 | 5311 |
]. |
5312 |
t := self newThread:'main'. |
|
5313 |
Java threads at:t put:p. |
|
5314 |
^ t |
|
5315 |
||
5316 |
"Created: / 3.1.1998 / 01:42:28 / cg" |
|
5317 |
"Modified: / 4.1.1998 / 14:59:13 / cg" |
|
5318 |
! |
|
5319 |
||
339 | 5320 |
_Thread_interrupt0:nativeContext |
5321 |
"ask if a thread is interrupted (clear interruptState if arg is true)" |
|
5322 |
||
5323 |
|jThread stProcess| |
|
5324 |
||
5325 |
jThread := nativeContext receiver. |
|
5326 |
stProcess := self stProcessForJavaThread:jThread. |
|
5327 |
stProcess isNil ifTrue:[ |
|
5328 |
self halt. |
|
5329 |
^ 0 |
|
5330 |
]. |
|
5331 |
||
5332 |
stProcess markInterrupted |
|
5333 |
||
5334 |
"Modified: / 2.1.1998 / 21:49:06 / cg" |
|
5335 |
"Created: / 10.4.1998 / 15:21:43 / cg" |
|
5336 |
! |
|
5337 |
||
253 | 5338 |
_Thread_isAlive:nativeContext |
5339 |
"is it alive ?" |
|
5340 |
||
5341 |
|jThread stProcess| |
|
5342 |
||
5343 |
jThread := nativeContext receiver. |
|
5344 |
stProcess := JavaVM stProcessForJavaThread:jThread. |
|
5345 |
stProcess isNil ifTrue:[ |
|
318 | 5346 |
ThreadTrace == true ifTrue:[ |
5347 |
('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL. |
|
5348 |
]. |
|
5349 |
^ 0 "FALSE" |
|
255 | 5350 |
]. |
5351 |
stProcess isDead ifTrue:[^ 0 "FALSE"]. |
|
5352 |
^ 1 "TRUE" |
|
5353 |
||
5354 |
"Created: / 5.1.1998 / 02:03:51 / cg" |
|
318 | 5355 |
"Modified: / 6.2.1998 / 02:15:01 / cg" |
255 | 5356 |
! |
5357 |
||
5358 |
_Thread_isInterrupted:nativeContext |
|
5359 |
"ask if a thread is interrupted (clear interruptState if arg is true)" |
|
5360 |
||
5361 |
|jThread stProcess clearInterrupt rslt| |
|
5362 |
||
5363 |
jThread := nativeContext receiver. |
|
5364 |
stProcess := self stProcessForJavaThread:jThread. |
|
5365 |
stProcess isNil ifTrue:[ |
|
261 | 5366 |
self halt. |
5367 |
^ 0 |
|
253 | 5368 |
]. |
255 | 5369 |
|
5370 |
clearInterrupt := nativeContext argAt:1. |
|
5371 |
rslt := stProcess isInterrupted ifTrue:[1] ifFalse:[0]. |
|
5372 |
clearInterrupt ~~ 0 ifTrue:[stProcess clearInterruptActions]. |
|
5373 |
^ rslt |
|
5374 |
||
5375 |
"Modified: / 2.1.1998 / 21:49:06 / cg" |
|
5376 |
"Created: / 7.1.1998 / 18:50:26 / cg" |
|
5377 |
! |
|
5378 |
||
5379 |
_Thread_resume0:nativeContext |
|
5380 |
"yield" |
|
5381 |
||
5382 |
|jThread stProcess| |
|
5383 |
||
5384 |
jThread := nativeContext receiver. |
|
5385 |
stProcess := JavaVM stProcessForJavaThread:jThread. |
|
5386 |
stProcess isNil ifTrue:[ |
|
318 | 5387 |
ThreadTrace == true ifTrue:[ |
5388 |
('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL. |
|
5389 |
]. |
|
5390 |
^ nil "void" |
|
255 | 5391 |
]. |
5392 |
stProcess resume |
|
5393 |
||
5394 |
"Created: / 8.1.1998 / 01:06:27 / cg" |
|
318 | 5395 |
"Modified: / 6.2.1998 / 02:15:08 / cg" |
253 | 5396 |
! |
5397 |
||
5398 |
_Thread_setPriority0:nativeMethodContext |
|
5399 |
|t p prio| |
|
5400 |
||
5401 |
t := nativeMethodContext receiver. |
|
5402 |
p := JavaVM stProcessForJavaThread:t. |
|
5403 |
prio := nativeMethodContext argAt:1. |
|
5404 |
||
5405 |
p isNil ifTrue:[ |
|
318 | 5406 |
ThreadTrace == true ifTrue:[ |
5407 |
'JAVA [info]: no process yet (in setPriority)' infoPrintCR. |
|
5408 |
]. |
|
5409 |
^ nil |
|
253 | 5410 |
]. |
5411 |
||
5412 |
ThreadTrace ifTrue:[ |
|
318 | 5413 |
'JAVA [info]: setPrio: ' print. t print. ' pri= ' print. prio print. ' p= ' print. p printNL. |
253 | 5414 |
]. |
5415 |
^ nil |
|
5416 |
||
5417 |
"Created: / 2.1.1998 / 19:05:55 / cg" |
|
318 | 5418 |
"Modified: / 6.2.1998 / 02:28:18 / cg" |
253 | 5419 |
! |
5420 |
||
255 | 5421 |
_Thread_sleep:nativeContext |
5422 |
"sleep for some milliseconds " |
|
5423 |
||
5424 |
|millis| |
|
5425 |
||
432 | 5426 |
millis := nativeContext argAt:1. |
5427 |
Delay waitForMilliseconds:(millis max:50) |
|
255 | 5428 |
|
5429 |
"Created: / 7.1.1998 / 15:34:23 / cg" |
|
432 | 5430 |
"Modified: / 10.11.1998 / 22:28:04 / cg" |
255 | 5431 |
! |
5432 |
||
253 | 5433 |
_Thread_start:nativeContext |
5434 |
"start the thread" |
|
5435 |
||
5436 |
|jThread jName name stProcess| |
|
5437 |
||
5438 |
jThread := nativeContext receiver. |
|
5439 |
(jThread instVarNamed:'priority') < 1 ifTrue:[ |
|
297 | 5440 |
self halt. |
5441 |
jThread instVarNamed:'priority' put:1. |
|
253 | 5442 |
]. |
5443 |
||
5444 |
stProcess := JavaProcess |
|
297 | 5445 |
for:[ |
405 | 5446 |
|procName| |
5447 |
||
5448 |
Object abortSignal handle:[:ex | |
|
5449 |
procName := stProcess name. |
|
5450 |
('JAVA: thread ' , procName , ' aborted - restarting process.') infoPrintCR. |
|
457 | 5451 |
"/ ex restart. |
405 | 5452 |
] do:[ |
297 | 5453 |
[ |
5454 |
JavaVM javaExceptionSignal handle:[:ex | |
|
405 | 5455 |
|exClass| |
297 | 5456 |
|
5457 |
procName := stProcess name. |
|
5458 |
exClass := ex parameter class. |
|
5459 |
||
5460 |
exClass == (Java at:'java.lang.ThreadDeath') ifTrue:[ |
|
5461 |
('JAVA: thread ' , procName , ' terminated') infoPrintCR. |
|
5462 |
] ifFalse:[ |
|
5463 |
Transcript |
|
5464 |
showCR:('JAVA: thread ''' |
|
5465 |
, procName |
|
5466 |
, ''' terminated with exception: ' |
|
5467 |
, exClass name). |
|
5468 |
]. |
|
5469 |
ex return. |
|
5470 |
] do:[ |
|
5471 |
jThread perform:#'run()V'. |
|
316 | 5472 |
ThreadTrace == true ifTrue:[ |
5473 |
('JAVA: thread ' , stProcess name , ' terminated') infoPrintCR. |
|
5474 |
]. |
|
297 | 5475 |
jThread perform:#'exit()V'. |
316 | 5476 |
ThreadTrace == true ifTrue:[ |
5477 |
('JAVA: after exit of thread ' , stProcess name) infoPrintCR. |
|
5478 |
] |
|
297 | 5479 |
] |
5480 |
] valueNowOrOnUnwindDo:[ |
|
5481 |
Java threads removeKey:jThread ifAbsent:[]. |
|
5482 |
] |
|
405 | 5483 |
] |
297 | 5484 |
] |
5485 |
priority:(Processor activePriority). |
|
253 | 5486 |
|
5487 |
jName := jThread instVarNamed:'name'. |
|
5488 |
jName isString ifFalse:[ |
|
297 | 5489 |
name := Java as_ST_String:jName. |
253 | 5490 |
] ifTrue:[ |
297 | 5491 |
name := jName |
5492 |
]. |
|
5493 |
||
5494 |
"/ kludge - remember the ScreenUpdater ... |
|
5495 |
name = 'Screen Updater' ifTrue:[ |
|
5496 |
ScreenUpdaterProcess := stProcess. |
|
253 | 5497 |
]. |
5498 |
||
5499 |
"/ when that process terminates, wakup any waiters |
|
5500 |
stProcess addExitAction:[self wakeup:jThread]. |
|
5501 |
||
5502 |
stProcess name:'JAVA-' , name. |
|
5503 |
stProcess resume. |
|
5504 |
||
5505 |
Java threads at:jThread put:stProcess. |
|
5506 |
||
5507 |
^ nil |
|
5508 |
||
5509 |
"Created: / 3.1.1998 / 02:05:52 / cg" |
|
457 | 5510 |
"Modified: / 17.11.1998 / 23:01:17 / cg" |
255 | 5511 |
! |
5512 |
||
5513 |
_Thread_stop0:nativeContext |
|
5514 |
"terminate a thread" |
|
5515 |
||
5516 |
|jThread stProcess death| |
|
5517 |
||
5518 |
jThread := nativeContext receiver. |
|
5519 |
||
5520 |
stProcess := JavaVM stProcessForJavaThread:jThread. |
|
5521 |
stProcess isNil ifTrue:[ |
|
318 | 5522 |
ThreadTrace == true ifTrue:[ |
5523 |
('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL. |
|
5524 |
]. |
|
5525 |
^ nil "void" |
|
255 | 5526 |
]. |
5527 |
death := nativeContext argAt:1. |
|
5528 |
stProcess |
|
318 | 5529 |
interruptWith:[ |
5530 |
JavaVM javaExceptionSignal handle:[:ex | |
|
5531 |
Processor activeProcess terminate |
|
5532 |
] do:[ |
|
5533 |
ThreadTrace == true ifTrue:[ |
|
5534 |
('JAVA: thread exit: ' , jThread displayString) infoPrintNL. |
|
5535 |
]. |
|
5536 |
jThread perform:#'exit()V'. |
|
5537 |
self throwException:death. |
|
5538 |
] |
|
5539 |
]. |
|
255 | 5540 |
stProcess resume. |
5541 |
||
5542 |
[stProcess isDead] whileFalse:[ |
|
318 | 5543 |
stProcess resume. |
466 | 5544 |
'JavaVM: wait for death' infoPrintCR. |
318 | 5545 |
Delay waitForSeconds:0.1 |
255 | 5546 |
]. |
5547 |
stProcess terminate |
|
5548 |
||
5549 |
"Created: / 8.1.1998 / 13:11:17 / cg" |
|
466 | 5550 |
"Modified: / 25.11.1998 / 20:21:19 / cg" |
255 | 5551 |
! |
5552 |
||
5553 |
_Thread_suspend0:nativeContext |
|
5554 |
"yield" |
|
5555 |
||
5556 |
|jThread stProcess| |
|
5557 |
||
5558 |
jThread := nativeContext receiver. |
|
5559 |
stProcess := JavaVM stProcessForJavaThread:jThread. |
|
5560 |
stProcess isNil ifTrue:[ |
|
318 | 5561 |
ThreadTrace == true ifTrue:[ |
5562 |
('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL. |
|
5563 |
]. |
|
5564 |
^ nil "void" |
|
255 | 5565 |
]. |
5566 |
stProcess suspend |
|
5567 |
||
5568 |
"Created: / 8.1.1998 / 01:05:49 / cg" |
|
318 | 5569 |
"Modified: / 6.2.1998 / 02:15:23 / cg" |
255 | 5570 |
! |
5571 |
||
5572 |
_Thread_yield:nativeContext |
|
5573 |
"yield" |
|
5574 |
||
5575 |
|jThread stProcess| |
|
5576 |
||
5577 |
jThread := nativeContext receiver. |
|
5578 |
stProcess := JavaVM stProcessForJavaThread:jThread. |
|
5579 |
stProcess isNil ifTrue:[ |
|
318 | 5580 |
ThreadTrace == true ifTrue:[ |
5581 |
('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL. |
|
5582 |
]. |
|
5583 |
^ nil "void" |
|
255 | 5584 |
]. |
5585 |
stProcess == Processor activeProcess ifTrue:[ |
|
318 | 5586 |
Processor yield. |
255 | 5587 |
] ifFalse:[ |
318 | 5588 |
self halt. |
255 | 5589 |
]. |
5590 |
||
5591 |
"Created: / 5.1.1998 / 02:03:51 / cg" |
|
318 | 5592 |
"Modified: / 6.2.1998 / 02:15:29 / cg" |
253 | 5593 |
! |
5594 |
||
5595 |
_Throwable_fillInStackTrace:nativeContext |
|
255 | 5596 |
|exClass exceptionObject list con| |
253 | 5597 |
|
5598 |
exClass := Java classNamed:'java.lang.Throwable'. |
|
5599 |
||
5600 |
exceptionObject := nativeContext receiver. |
|
5601 |
||
5602 |
"/ |
|
5603 |
"/ debugging only |
|
5604 |
"/ |
|
5605 |
(exceptionObject isKindOf:(Java classNamed:'java.lang.Throwable')) ifFalse:[ |
|
347 | 5606 |
self halt |
253 | 5607 |
]. |
5608 |
||
5609 |
con := thisContext sender. |
|
5610 |
||
5611 |
"/ |
|
5612 |
"/ we are not interrested in all intermediate Exception frames ... |
|
5613 |
"/ |
|
5614 |
FullExceptionTrace ifFalse:[ |
|
347 | 5615 |
"/ first, skip any JavaVM contexts |
5616 |
[con receiver == exceptionObject] whileFalse:[ |
|
5617 |
con := con sender |
|
5618 |
]. |
|
5619 |
"/ then, all exception-init contexts |
|
5620 |
[con receiver == exceptionObject] whileTrue:[ |
|
5621 |
con := con sender |
|
5622 |
]. |
|
253 | 5623 |
]. |
5624 |
||
255 | 5625 |
list := OrderedCollection new. |
5626 |
[con notNil] whileTrue:[ |
|
347 | 5627 |
(con isJavaContext) ifTrue:[ |
5628 |
"/ add a copy, in case the context continues with some |
|
5629 |
"/ cleanup ... |
|
5630 |
list add:con shallowCopy |
|
5631 |
]. |
|
5632 |
con := con sender |
|
255 | 5633 |
]. |
5634 |
||
5635 |
exceptionObject instVarNamed:'backtrace' put:(list asArray). |
|
253 | 5636 |
|
5637 |
^ nil. |
|
5638 |
||
5639 |
"Created: / 4.1.1998 / 14:27:40 / cg" |
|
347 | 5640 |
"Modified: / 8.5.1998 / 21:29:53 / cg" |
255 | 5641 |
! |
5642 |
||
5643 |
_Throwable_printStackTrace0:nativeContext |
|
261 | 5644 |
|out outStream exceptionObject contextList| |
255 | 5645 |
|
5646 |
outStream := nativeContext argAt:1. |
|
5647 |
exceptionObject := nativeContext receiver. |
|
5648 |
||
5649 |
contextList := exceptionObject instVarNamed:'backtrace'. |
|
5650 |
||
261 | 5651 |
out := self javaConsoleStream. |
5652 |
out cr. |
|
5653 |
out nextPutLine:'JAVA: stackTrace:'. |
|
255 | 5654 |
|
5655 |
contextList do:[:con | |
|
429 | 5656 |
out |
5657 |
nextPutAll:' '; |
|
5658 |
nextPutAll:(con method javaClass fullName); |
|
5659 |
nextPutAll:'.'; |
|
5660 |
nextPutAll:(con method selector); |
|
5661 |
nextPutAll:' ['; |
|
5662 |
nextPutAll:(con method javaClass sourceFile); |
|
5663 |
nextPutAll:' '; |
|
5664 |
nextPutAll:(con quickLineNumber displayString); |
|
5665 |
nextPutAll:']'. |
|
5666 |
out cr |
|
261 | 5667 |
]. |
5668 |
out nextPutLine:'----------------------------------------------------' |
|
255 | 5669 |
|
5670 |
"Created: / 4.1.1998 / 14:27:40 / cg" |
|
429 | 5671 |
"Modified: / 10.11.1998 / 14:19:32 / cg" |
432 | 5672 |
! |
5673 |
||
5674 |
_Win32Process_create:nativeContext |
|
5675 |
"really create a win32 process" |
|
5676 |
||
5677 |
|env cmd jProcess p inPipe outPipe errorPipe| |
|
5678 |
||
5679 |
jProcess := nativeContext receiver. |
|
5680 |
cmd := nativeContext argAt:1. |
|
5681 |
cmd := Java as_ST_String:cmd. |
|
5682 |
||
5683 |
env := nativeContext argAt:2. |
|
5684 |
env notNil ifTrue:[ |
|
5685 |
self halt |
|
5686 |
]. |
|
5687 |
self halt. |
|
5688 |
||
5689 |
p := Win32Process new. |
|
5690 |
p command:cmd. |
|
5691 |
p environment:env. |
|
5692 |
p inStream:inPipe. |
|
5693 |
p outStream:outPipe. |
|
5694 |
p errorStream:errorPipe. |
|
5695 |
p directory:nil. |
|
5696 |
p startProcess. |
|
5697 |
self halt. |
|
5698 |
||
5699 |
jProcess instVarNamed:'handle' put:p. |
|
5700 |
||
5701 |
"Created: / 10.11.1998 / 19:50:31 / cg" |
|
5702 |
"Modified: / 10.11.1998 / 21:34:18 / cg" |
|
255 | 5703 |
! ! |
5704 |
||
277 | 5705 |
!JavaVM class methodsFor:'native - java.lang - jdk1.2'! |
5706 |
||
5707 |
_AccessController_beginPrivileged:nativeContext |
|
5708 |
"/ introduced with jdk1.2 |
|
5709 |
||
5710 |
"Created: / 27.1.1998 / 18:18:11 / cg" |
|
5711 |
! |
|
5712 |
||
5713 |
_AccessController_endPrivileged:nativeContext |
|
5714 |
"/ introduced with jdk1.2 |
|
5715 |
||
5716 |
"Created: / 27.1.1998 / 18:18:32 / cg" |
|
5717 |
! |
|
5718 |
||
5719 |
_AccessController_getStackAccessControlContext:nativeContext |
|
5720 |
"/ introduced with jdk1.2 |
|
5721 |
||
5722 |
"/ supposed to do more here ... |
|
5723 |
||
5724 |
^ nil |
|
5725 |
||
5726 |
"Created: / 27.1.1998 / 18:22:15 / cg" |
|
5727 |
! |
|
5728 |
||
5729 |
_ClassLoader$NativeLibrary_load:nativeContext |
|
5730 |
"/ introduced with jdk1.2 ... (sigh) |
|
5731 |
||
5732 |
|nativeLoader jLibName libName libHandle index| |
|
5733 |
||
5734 |
nativeLoader := nativeContext receiver. |
|
5735 |
jLibName := nativeContext argAt:1. |
|
5736 |
libName := Java as_ST_String:jLibName. |
|
5737 |
||
5738 |
(index := SimulatedNativeLibs indexOf:libName) ~~ 0 ifTrue:[ |
|
319 | 5739 |
"/ ('JAVA: builtIn nativeLibLoad simulated: ' , libName) printNL. |
277 | 5740 |
nativeLoader instVarNamed:'handle' put:index. |
5741 |
^ self "/ void |
|
5742 |
]. |
|
5743 |
(LoadedNativeLibs notNil |
|
5744 |
and:[LoadedNativeLibs includesKey:libName]) ifTrue:[ |
|
319 | 5745 |
"/ ('JAVA: native library already loaded: ' , libName) printNL. |
277 | 5746 |
nativeLoader instVarNamed:'handle' put:(LoadedNativeLibs at:libName). |
5747 |
^ self "/ void |
|
5748 |
]. |
|
319 | 5749 |
|
5750 |
(self confirm:'permission to load native library: ' , libName , ' ?') ifFalse:[ |
|
5751 |
^ self |
|
5752 |
]. |
|
284 | 5753 |
self halt. |
277 | 5754 |
|
5755 |
libName asFilename exists ifFalse:[ |
|
5756 |
('JAVA: no file to load nativeLib: ' , libName) printNL. |
|
5757 |
^ self "/ void |
|
5758 |
]. |
|
5759 |
||
5760 |
libHandle := ObjectFileLoader loadLibrary:libName. |
|
5761 |
libHandle isNil ifTrue:[ |
|
5762 |
('JAVA: failed to load nativeLib: ' , libName) printNL. |
|
5763 |
^ self "/ void |
|
5764 |
]. |
|
5765 |
||
5766 |
LoadedNativeLibs isNil ifTrue:[ |
|
5767 |
LoadedNativeLibs := Dictionary new. |
|
5768 |
]. |
|
5769 |
||
5770 |
LoadedNativeLibs at:libName put:libHandle. |
|
5771 |
nativeLoader instVarNamed:'handle' put:(LoadedNativeLibs at:libName). |
|
5772 |
^ self "/ void |
|
5773 |
||
5774 |
"Created: / 27.1.1998 / 18:38:37 / cg" |
|
319 | 5775 |
"Modified: / 6.2.1998 / 03:12:17 / cg" |
277 | 5776 |
! |
5777 |
||
5778 |
_ClassLoader_initIDs:nativeContext |
|
5779 |
"/ introduced with jdk1.2 ... (sigh) |
|
5780 |
||
5781 |
"Created: / 27.1.1998 / 18:37:08 / cg" |
|
5782 |
! |
|
5783 |
||
5784 |
_Component_initIDs:nativeContext |
|
5785 |
"/ introduced with jdk1.2 ... (sigh) |
|
5786 |
||
5787 |
"Created: / 27.1.1998 / 19:53:29 / cg" |
|
5788 |
! |
|
5789 |
||
5790 |
_System_getCallerClass:nativeContext |
|
5791 |
"/ introduced with jdk1.2 |
|
5792 |
||
5793 |
|senderContext cls| |
|
5794 |
||
5795 |
senderContext := nativeContext sender. |
|
5796 |
[senderContext receiver == (Java at:'java.lang.System')] whileTrue:[ |
|
5797 |
senderContext := senderContext sender. |
|
5798 |
]. |
|
5799 |
||
5800 |
senderContext method isStatic ifTrue:[ |
|
5801 |
cls := senderContext receiver |
|
5802 |
] ifFalse:[ |
|
5803 |
cls := senderContext receiver class |
|
5804 |
]. |
|
5805 |
cls isJavaClass ifTrue:[ |
|
5806 |
^ self javaClassObjectForClass:cls |
|
5807 |
]. |
|
5808 |
(cls isMemberOf:(Java at:'java.lang.Class')) ifTrue:[ |
|
5809 |
^ Java at:'java.lang.Class' |
|
5810 |
]. |
|
5811 |
self halt. |
|
5812 |
^ nil |
|
5813 |
||
5814 |
"Modified: / 27.1.1998 / 18:33:13 / cg" |
|
5815 |
! |
|
5816 |
||
5817 |
_Toolkit_initIDs:nativeContext |
|
5818 |
"/ introduced with jdk1.2 ... (sigh) |
|
5819 |
||
5820 |
"Created: / 27.1.1998 / 19:53:50 / cg" |
|
5821 |
! ! |
|
5822 |
||
457 | 5823 |
!JavaVM class methodsFor:'native - java.lang - ms'! |
5824 |
||
5825 |
_Runtime_setInputStreamLocalised:nativeContext |
|
5826 |
||
5827 |
"Created: / 18.11.1998 / 00:48:24 / cg" |
|
5828 |
"Modified: / 18.11.1998 / 00:55:01 / cg" |
|
5829 |
! |
|
5830 |
||
5831 |
_Runtime_setOutputStreamLocalised:nativeContext |
|
5832 |
||
5833 |
"Created: / 18.11.1998 / 00:50:15 / cg" |
|
5834 |
"Modified: / 18.11.1998 / 00:55:06 / cg" |
|
5835 |
! |
|
5836 |
||
5837 |
_String_equals:nativeContext |
|
5838 |
|jString1 jString2| |
|
5839 |
||
5840 |
jString1 := nativeContext receiver. |
|
5841 |
jString2 := nativeContext argAt:1. |
|
5842 |
^ (jString1 instVarAt:1) = (jString2 instVarAt:1) |
|
5843 |
||
5844 |
"Created: / 18.11.1998 / 00:52:03 / cg" |
|
5845 |
"Modified: / 18.11.1998 / 00:53:01 / cg" |
|
5846 |
! |
|
5847 |
||
5848 |
_String_length:nativeContext |
|
5849 |
|jString| |
|
5850 |
||
5851 |
jString := nativeContext receiver. |
|
5852 |
^ (jString instVarAt:3) |
|
5853 |
||
5854 |
"Created: / 18.11.1998 / 00:53:50 / cg" |
|
5855 |
"Modified: / 18.11.1998 / 00:54:18 / cg" |
|
5856 |
! ! |
|
5857 |
||
255 | 5858 |
!JavaVM class methodsFor:'native - java.math'! |
5859 |
||
5860 |
_BigInteger_plumbInit:nativeContext |
|
440 | 5861 |
UnimplementedNativeMethodSignal raise |
5862 |
||
5863 |
"Modified: / 12.11.1998 / 19:23:00 / cg" |
|
253 | 5864 |
! ! |
5865 |
||
5866 |
!JavaVM class methodsFor:'native - java.net'! |
|
5867 |
||
440 | 5868 |
_InetAddressImpl_getHostByAddr:nativeContext |
5869 |
"/ java.lang.String getHostByAddr (int) |
|
5870 |
UnimplementedNativeMethodSignal raise |
|
5871 |
||
5872 |
"Created: / 12.11.1998 / 19:08:04 / cg" |
|
5873 |
! |
|
5874 |
||
253 | 5875 |
_InetAddressImpl_getInetFamily:nativeContext |
5876 |
"/ self unimplementedNativeMethod. |
|
5877 |
^ 0 |
|
5878 |
||
5879 |
"Modified: / 15.8.1997 / 17:04:43 / cg" |
|
5880 |
"Created: / 5.1.1998 / 02:05:48 / cg" |
|
5881 |
! |
|
5882 |
||
5883 |
_InetAddressImpl_getLocalHostName:nativeContext |
|
5884 |
"" |
|
5885 |
||
5886 |
|hostName| |
|
5887 |
||
5888 |
hostName := OperatingSystem getHostName. |
|
5889 |
||
5890 |
^ (Java as_String:hostName). |
|
5891 |
||
5892 |
"Modified: / 7.8.1997 / 21:16:55 / cg" |
|
5893 |
"Created: / 5.1.1998 / 02:07:03 / cg" |
|
5894 |
! |
|
5895 |
||
255 | 5896 |
_InetAddressImpl_lookupAllHostAddr:nativeContext |
5897 |
"" |
|
5898 |
||
5899 |
|jAddrImpl jHostName hostName addrBytes| |
|
5900 |
||
5901 |
jAddrImpl := nativeContext receiver. |
|
5902 |
jHostName := nativeContext argAt:1. |
|
5903 |
||
5904 |
hostName := Java as_ST_String:jHostName. |
|
5905 |
addrBytes := Socket ipAddressOfHost:hostName. |
|
5906 |
addrBytes isNil ifTrue:[ |
|
261 | 5907 |
addrBytes := #[0 0 0 0] copy |
255 | 5908 |
]. |
5909 |
^ Array with:addrBytes |
|
5910 |
||
5911 |
"Modified: / 8.8.1997 / 12:04:25 / cg" |
|
5912 |
"Created: / 7.1.1998 / 18:51:31 / cg" |
|
5913 |
! |
|
5914 |
||
253 | 5915 |
_InetAddressImpl_makeAnyLocalAddress:nativeContext |
5916 |
"" |
|
5917 |
||
5918 |
|jAddrImpl jAddr hostName addrBytes address| |
|
5919 |
||
5920 |
jAddrImpl := nativeContext receiver. |
|
5921 |
jAddr := nativeContext argAt:1. |
|
5922 |
||
5923 |
hostName := OperatingSystem getHostName. |
|
5924 |
addrBytes := Socket ipAddressOfHost:hostName. |
|
405 | 5925 |
addrBytes isNil ifTrue:[ |
5926 |
addrBytes := #[127 0 0 0]. |
|
5927 |
]. |
|
253 | 5928 |
"/ MSB first into an integer. |
5929 |
address := (addrBytes at:1). |
|
5930 |
address := (address bitShift:8) bitOr:(addrBytes at:2). |
|
5931 |
address := (address bitShift:8) bitOr:(addrBytes at:3). |
|
5932 |
address := (address bitShift:8) bitOr:(addrBytes at:4). |
|
5933 |
||
5934 |
jAddr instVarNamed:'hostName' put:(Java as_String:hostName). |
|
5935 |
jAddr instVarNamed:'address' put:address. |
|
5936 |
jAddr instVarNamed:'family' put:0. |
|
5937 |
||
5938 |
^ nil |
|
5939 |
||
5940 |
"Created: / 5.1.1998 / 02:06:27 / cg" |
|
405 | 5941 |
"Modified: / 21.10.1998 / 03:30:29 / cg" |
255 | 5942 |
! |
5943 |
||
5944 |
_PlainSocketImpl_initProto:nativeContext |
|
5945 |
||
5946 |
"Created: / 12.1.1998 / 12:56:52 / cg" |
|
271 | 5947 |
! |
5948 |
||
307 | 5949 |
_PlainSocketImpl_socketAccept:nativeContext |
5950 |
|jsock fd newJSock sock newSock fileNo| |
|
5951 |
||
5952 |
jsock := nativeContext receiver. |
|
5953 |
||
5954 |
sock := self validateFile:jsock. |
|
5955 |
sock isNil ifTrue:[ |
|
5956 |
self |
|
5957 |
throwExceptionClassName:'java.io.IOException' |
|
5958 |
withMessage:'nil socket in accept'. |
|
5959 |
^ self. |
|
5960 |
]. |
|
5961 |
||
5962 |
newJSock := nativeContext argAt:1. |
|
5963 |
fd := newJSock instVarNamed:'fd'. |
|
5964 |
(fd instVarNamed:'fd') ~~ 0 ifTrue:[ |
|
5965 |
self halt:'file already open'. |
|
5966 |
self internalError:'file already open'. |
|
5967 |
self |
|
5968 |
throwExceptionClassName:'java.io.IOException' |
|
5969 |
withMessage:'socket already open in socketAccept'. |
|
5970 |
^ self. |
|
5971 |
]. |
|
5972 |
FileIOTrace ifTrue:[ |
|
5973 |
'JAVA: socket accept' infoPrintCR |
|
5974 |
]. |
|
5975 |
newSock := sock accept. |
|
5976 |
newSock isNil ifTrue:[ |
|
5977 |
self |
|
5978 |
throwExceptionClassName:'java.io.IOException' |
|
5979 |
withMessage:'accept failed'. |
|
5980 |
]. |
|
5981 |
fileNo := self addOpenFile:newSock. |
|
5982 |
fd instVarNamed:'fd' put:fileNo. |
|
5983 |
||
5984 |
"Created: / 4.2.1998 / 15:26:49 / cg" |
|
5985 |
"Modified: / 4.2.1998 / 15:45:20 / cg" |
|
5986 |
! |
|
5987 |
||
5988 |
_PlainSocketImpl_socketAvailable:nativeContext |
|
5989 |
|jSock sock n| |
|
5990 |
||
5991 |
jSock := nativeContext receiver. |
|
5992 |
||
5993 |
sock := self validateFile:jSock. |
|
5994 |
sock isNil ifTrue:[ |
|
5995 |
self |
|
5996 |
throwExceptionClassName:'java.io.IOException' |
|
5997 |
withMessage:'socketAvailable on closed socket'. |
|
5998 |
^ self. |
|
5999 |
]. |
|
6000 |
||
6001 |
n := sock numAvailable. |
|
6002 |
^ n |
|
6003 |
||
6004 |
"Created: / 4.2.1998 / 16:58:49 / cg" |
|
6005 |
! |
|
6006 |
||
6007 |
_PlainSocketImpl_socketBind:nativeContext |
|
6008 |
|jsock jaddr port sock hostName ok err| |
|
6009 |
||
6010 |
jsock := nativeContext receiver. |
|
6011 |
jaddr := nativeContext argAt:1. |
|
6012 |
port := nativeContext argAt:2. |
|
6013 |
||
6014 |
hostName := jaddr instVarNamed:'hostName'. |
|
6015 |
hostName isNil ifTrue:[ |
|
6016 |
self halt. |
|
6017 |
] ifFalse:[ |
|
6018 |
hostName := Java as_ST_String:hostName |
|
6019 |
]. |
|
6020 |
||
6021 |
sock := self validateFile:jsock. |
|
6022 |
sock notNil ifTrue:[ |
|
6023 |
FileIOTrace ifTrue:[ |
|
6024 |
('JAVA: socket bind to ' , hostName printString, ' port ' , port printString) infoPrintCR |
|
6025 |
]. |
|
6026 |
||
6027 |
ok := sock bindTo:port address:nil "hostName". |
|
6028 |
ok ifFalse:[ |
|
6029 |
err := OperatingSystem lastErrorString. |
|
6030 |
Transcript showCR:'sock err: ' , err printString. |
|
6031 |
self |
|
6032 |
throwExceptionClassName:'java.io.IOException' |
|
6033 |
withMessage:'bind failed'. |
|
6034 |
] |
|
6035 |
]. |
|
6036 |
||
6037 |
"Created: / 4.2.1998 / 15:06:20 / cg" |
|
6038 |
"Modified: / 4.2.1998 / 15:34:08 / cg" |
|
6039 |
! |
|
6040 |
||
271 | 6041 |
_PlainSocketImpl_socketClose:nativeContext |
6042 |
|jsock sock| |
|
6043 |
||
6044 |
jsock := nativeContext receiver. |
|
6045 |
||
6046 |
sock := self validateFile:jsock. |
|
6047 |
sock notNil ifTrue:[ |
|
6048 |
FileIOTrace ifTrue:[ |
|
6049 |
'JAVA: close socket' infoPrintCR |
|
6050 |
]. |
|
6051 |
sock close. |
|
6052 |
]. |
|
6053 |
||
6054 |
"Modified: / 21.8.1997 / 17:09:40 / cg" |
|
6055 |
"Created: / 25.1.1998 / 20:04:24 / cg" |
|
6056 |
! |
|
6057 |
||
6058 |
_PlainSocketImpl_socketConnect:nativeContext |
|
272 | 6059 |
|jsock jaddr port sock addr hostName ok| |
271 | 6060 |
|
6061 |
jsock := nativeContext receiver. |
|
6062 |
jaddr := nativeContext argAt:1. |
|
6063 |
port := nativeContext argAt:2. |
|
6064 |
||
6065 |
hostName := jaddr instVarNamed:'hostName'. |
|
6066 |
hostName notNil ifTrue:[ |
|
6067 |
hostName := Java as_ST_String:hostName |
|
6068 |
] ifFalse:[ |
|
272 | 6069 |
addr := jaddr instVarNamed:'address'. |
6070 |
addr notNil ifTrue:[ |
|
6071 |
hostName := ByteArray new:4. |
|
6072 |
hostName at:4 put:(addr bitAnd:16rFF). |
|
6073 |
addr := addr bitShift:-8. |
|
6074 |
hostName at:3 put:(addr bitAnd:16rFF). |
|
6075 |
addr := addr bitShift:-8. |
|
6076 |
hostName at:2 put:(addr bitAnd:16rFF). |
|
6077 |
addr := addr bitShift:-8. |
|
6078 |
hostName at:1 put:(addr bitAnd:16rFF). |
|
6079 |
]. |
|
271 | 6080 |
]. |
6081 |
hostName isNil ifTrue:[ |
|
6082 |
self halt. |
|
6083 |
]. |
|
6084 |
||
6085 |
sock := self validateFile:jsock. |
|
6086 |
sock notNil ifTrue:[ |
|
6087 |
FileIOTrace ifTrue:[ |
|
6088 |
('JAVA: socket connect to ' , hostName printString , ' port ' , port printString) infoPrintCR |
|
6089 |
]. |
|
390 | 6090 |
SocketConnectConfirmation ifTrue:[ |
6091 |
(self confirm:'connect to host: ' , hostName printString , ' - ok ?') |
|
6092 |
ifFalse:[ |
|
6093 |
self |
|
6094 |
throwExceptionClassName:'java.io.IOException' |
|
6095 |
withMessage:'connect permission denied'. |
|
6096 |
]. |
|
271 | 6097 |
]. |
6098 |
||
6099 |
ok := sock connectTo:hostName port:port. |
|
6100 |
ok ifFalse:[ |
|
6101 |
self |
|
6102 |
throwExceptionClassName:'java.io.IOException' |
|
6103 |
withMessage:'connect failed'. |
|
6104 |
] |
|
6105 |
]. |
|
6106 |
||
6107 |
"Created: / 25.1.1998 / 20:02:27 / cg" |
|
390 | 6108 |
"Modified: / 19.10.1998 / 16:24:48 / cg" |
271 | 6109 |
! |
6110 |
||
6111 |
_PlainSocketImpl_socketCreate:nativeContext |
|
6112 |
|jsock isStream fd sock fileNo| |
|
6113 |
||
6114 |
jsock := nativeContext receiver. |
|
6115 |
isStream := (nativeContext argAt:1) == 1. |
|
6116 |
||
6117 |
fd := jsock instVarNamed:'fd'. |
|
6118 |
(fd instVarNamed:'fd') ~~ 0 ifTrue:[ |
|
6119 |
self halt:'file already open'. |
|
6120 |
self internalError:'file already open'. |
|
6121 |
self |
|
6122 |
throwExceptionClassName:'java.io.IOException' |
|
6123 |
withMessage:'file already open in socketCreate'. |
|
6124 |
^ self. |
|
6125 |
]. |
|
6126 |
||
6127 |
FileOpenTrace ifTrue:[ |
|
6128 |
('JAVA: create socket') infoPrintCR. |
|
6129 |
]. |
|
6130 |
||
6131 |
isStream ifTrue:[ |
|
6132 |
sock := Socket newTCP |
|
6133 |
] ifFalse:[ |
|
6134 |
sock := Socket newUDP |
|
6135 |
]. |
|
6136 |
sock isNil ifTrue:[ |
|
6137 |
self |
|
6138 |
throwExceptionClassName:'java.io.IOException' |
|
6139 |
withMessage:'socketCreate failed'. |
|
6140 |
]. |
|
6141 |
||
6142 |
fileNo := self addOpenFile:sock. |
|
6143 |
fd instVarNamed:'fd' put:fileNo. |
|
6144 |
||
6145 |
"Created: / 25.1.1998 / 19:59:25 / cg" |
|
6146 |
"Modified: / 25.1.1998 / 19:59:45 / cg" |
|
272 | 6147 |
! |
6148 |
||
307 | 6149 |
_PlainSocketImpl_socketListen:nativeContext |
6150 |
|jSock time sock ok| |
|
6151 |
||
6152 |
jSock := nativeContext receiver. |
|
6153 |
time := nativeContext argAt:1. |
|
6154 |
||
6155 |
sock := self validateFile:jSock. |
|
6156 |
sock notNil ifTrue:[ |
|
6157 |
FileIOTrace ifTrue:[ |
|
6158 |
('JAVA: socket listen with timeout ' , time printString) infoPrintCR. |
|
6159 |
]. |
|
6160 |
ok := sock listenWithBacklog:5. |
|
6161 |
ok ifFalse:[ |
|
6162 |
self |
|
6163 |
throwExceptionClassName:'java.io.IOException' |
|
6164 |
withMessage:'listen failed'. |
|
6165 |
^ self. |
|
6166 |
]. |
|
6167 |
time ~~ 0 ifTrue:[ |
|
6168 |
sock readWaitWithTimeoutMs:time |
|
6169 |
] |
|
6170 |
]. |
|
6171 |
||
6172 |
"Created: / 4.2.1998 / 15:17:48 / cg" |
|
6173 |
"Modified: / 4.2.1998 / 15:18:26 / cg" |
|
6174 |
! |
|
6175 |
||
272 | 6176 |
_SocketInputStream_socketRead:nativeContext |
307 | 6177 |
^ self anyStream_readBytes:nativeContext |
272 | 6178 |
|
6179 |
"Created: / 25.1.1998 / 20:56:53 / cg" |
|
307 | 6180 |
"Modified: / 4.2.1998 / 15:52:31 / cg" |
272 | 6181 |
! |
6182 |
||
6183 |
_SocketOutputStream_socketWrite:nativeContext |
|
307 | 6184 |
^ self anyStream_writeBytes:nativeContext |
272 | 6185 |
|
6186 |
"Created: / 25.1.1998 / 21:06:55 / cg" |
|
307 | 6187 |
"Modified: / 4.2.1998 / 15:52:40 / cg" |
253 | 6188 |
! ! |
6189 |
||
457 | 6190 |
!JavaVM class methodsFor:'native - java.net - ms'! |
6191 |
||
6192 |
_ClassLoader_findSystemClass:nativeContext |
|
6193 |
^ self _ClassLoader_findSystemClass0:nativeContext |
|
6194 |
||
6195 |
"Created: / 18.11.1998 / 00:00:14 / cg" |
|
6196 |
! |
|
6197 |
||
6198 |
_InetAddress_getInetFamily:nativeContext |
|
6199 |
"/ self unimplementedNativeMethod. |
|
6200 |
^ 0 |
|
6201 |
||
6202 |
"Modified: / 15.8.1997 / 17:04:43 / cg" |
|
6203 |
"Created: / 17.11.1998 / 23:54:38 / cg" |
|
6204 |
! |
|
6205 |
||
6206 |
_InetAddress_getLocalHostName:nativeContext |
|
6207 |
"" |
|
6208 |
||
6209 |
|hostName| |
|
6210 |
||
6211 |
hostName := OperatingSystem getHostName. |
|
6212 |
||
6213 |
^ (Java as_String:hostName). |
|
6214 |
||
6215 |
"Modified: / 7.8.1997 / 21:16:55 / cg" |
|
6216 |
"Created: / 17.11.1998 / 23:54:54 / cg" |
|
6217 |
! |
|
6218 |
||
6219 |
_InetAddress_lookupAllHostAddr:nativeContext |
|
6220 |
"" |
|
6221 |
||
6222 |
|jAddrImpl jHostName hostName addrBytes| |
|
6223 |
||
6224 |
jAddrImpl := nativeContext receiver. |
|
6225 |
jHostName := nativeContext argAt:1. |
|
6226 |
||
6227 |
hostName := Java as_ST_String:jHostName. |
|
6228 |
addrBytes := Socket ipAddressOfHost:hostName. |
|
6229 |
addrBytes isNil ifTrue:[ |
|
6230 |
addrBytes := #[0 0 0 0] copy |
|
6231 |
]. |
|
6232 |
^ Array with:addrBytes |
|
6233 |
||
6234 |
"Modified: / 8.8.1997 / 12:04:25 / cg" |
|
6235 |
"Created: / 17.11.1998 / 23:56:10 / cg" |
|
6236 |
! |
|
6237 |
||
6238 |
_InetAddress_makeAnyLocalAddress:nativeContext |
|
6239 |
"" |
|
6240 |
||
6241 |
|jAddrImpl jAddr hostName addrBytes address| |
|
6242 |
||
6243 |
jAddrImpl := nativeContext receiver. |
|
6244 |
jAddr := nativeContext argAt:1. |
|
6245 |
||
6246 |
hostName := OperatingSystem getHostName. |
|
6247 |
addrBytes := Socket ipAddressOfHost:hostName. |
|
6248 |
addrBytes isNil ifTrue:[ |
|
6249 |
addrBytes := #[127 0 0 0]. |
|
6250 |
]. |
|
6251 |
"/ MSB first into an integer. |
|
6252 |
address := (addrBytes at:1). |
|
6253 |
address := (address bitShift:8) bitOr:(addrBytes at:2). |
|
6254 |
address := (address bitShift:8) bitOr:(addrBytes at:3). |
|
6255 |
address := (address bitShift:8) bitOr:(addrBytes at:4). |
|
6256 |
||
6257 |
jAddr instVarNamed:'hostName' put:(Java as_String:hostName). |
|
6258 |
jAddr instVarNamed:'address' put:address. |
|
6259 |
jAddr instVarNamed:'family' put:0. |
|
6260 |
||
6261 |
^ nil |
|
6262 |
||
6263 |
"Modified: / 21.10.1998 / 03:30:29 / cg" |
|
6264 |
"Created: / 17.11.1998 / 23:54:00 / cg" |
|
6265 |
! ! |
|
6266 |
||
253 | 6267 |
!JavaVM class methodsFor:'native - java.utils'! |
6268 |
||
6269 |
_ResourceBundle_getClassContext:nativeContext |
|
6270 |
"returns an array filled with the contextChain receivers classes. |
|
6271 |
What an ugly, messy interface." |
|
6272 |
||
6273 |
|chain con cls jClass| |
|
6274 |
||
6275 |
chain := OrderedCollection new. |
|
6276 |
con := thisContext sender. |
|
6277 |
[con notNil] whileTrue:[ |
|
347 | 6278 |
(con isJavaContext) ifTrue:[ |
6279 |
cls := con receiver class. |
|
6280 |
cls isMeta ifTrue:[ |
|
6281 |
"/ t'was a static method |
|
6282 |
cls := cls soleInstance |
|
6283 |
]. |
|
6284 |
jClass := JavaClasses at:cls ifAbsent:nil. |
|
6285 |
jClass isNil ifTrue:[ |
|
6286 |
JavaClasses at:cls put:(jClass := (Java at:'java.lang.Class') new). |
|
6287 |
JavaClasses at:jClass put:cls. |
|
6288 |
]. |
|
6289 |
chain add:jClass. |
|
6290 |
]. |
|
6291 |
con := con sender. |
|
253 | 6292 |
]. |
6293 |
^ chain asArray |
|
6294 |
||
6295 |
"Created: / 5.1.1998 / 02:47:00 / cg" |
|
347 | 6296 |
"Modified: / 8.5.1998 / 21:29:57 / cg" |
253 | 6297 |
! ! |
6298 |
||
304 | 6299 |
!JavaVM class methodsFor:'native - java.utils.zip'! |
6300 |
||
6301 |
_Inflater_init:nativeContext |
|
6302 |
||
6303 |
"Created: / 1.2.1998 / 20:14:01 / cg" |
|
6304 |
! |
|
6305 |
||
6306 |
_Inflater_reset:nativeContext |
|
6307 |
||
6308 |
"Created: / 1.2.1998 / 20:14:13 / cg" |
|
6309 |
! ! |
|
6310 |
||
255 | 6311 |
!JavaVM class methodsFor:'native - netscape'! |
6312 |
||
6313 |
_MozillaAppletContext_pMochaOnLoad:nativeContext |
|
6314 |
|id| |
|
6315 |
||
6316 |
id := nativeContext argAt:1. |
|
318 | 6317 |
"/ 'JAVA: MozillaAppletContext_pMochaOnLoad: ' print. id printNL. |
255 | 6318 |
^ nil |
6319 |
||
6320 |
"Created: / 6.1.1998 / 20:37:13 / cg" |
|
318 | 6321 |
"Modified: / 6.2.1998 / 02:13:09 / cg" |
255 | 6322 |
! |
6323 |
||
325 | 6324 |
_MozillaAppletContext_pShowDocument:nativeContext |
6325 |
|s js| |
|
6326 |
||
6327 |
js := nativeContext argAt:1. |
|
6328 |
s := Java as_ST_String:js. |
|
6329 |
||
6330 |
"/ somehow pass it to the html browser .... |
|
6331 |
"/ Transcript showCR:s. |
|
6332 |
^ nil |
|
6333 |
||
6334 |
"Modified: / 8.1.1998 / 17:06:13 / cg" |
|
6335 |
"Created: / 29.3.1998 / 15:53:17 / cg" |
|
6336 |
! |
|
6337 |
||
255 | 6338 |
_MozillaAppletContext_pShowStatus:nativeContext |
6339 |
|s js| |
|
6340 |
||
6341 |
js := nativeContext argAt:1. |
|
405 | 6342 |
js isNil ifTrue:[ |
6343 |
s := '' |
|
6344 |
] ifFalse:[ |
|
6345 |
s := Java as_ST_String:js. |
|
6346 |
]. |
|
255 | 6347 |
|
6348 |
self activityNotification:s. |
|
6349 |
"/ Transcript showCR:s. |
|
6350 |
^ nil |
|
6351 |
||
6352 |
"Created: / 6.1.1998 / 18:31:34 / cg" |
|
405 | 6353 |
"Modified: / 22.10.1998 / 01:17:46 / cg" |
255 | 6354 |
! |
6355 |
||
440 | 6356 |
_MozillaAppletContext_setConsoleState0:nativeContext |
6357 |
"/ void setConsoleState0 (int) |
|
6358 |
UnimplementedNativeMethodSignal raise |
|
6359 |
||
6360 |
"Created: / 12.11.1998 / 19:23:22 / cg" |
|
6361 |
! |
|
6362 |
||
6363 |
_URLConnection_close:nativeContext |
|
6364 |
"/ void close () |
|
6365 |
UnimplementedNativeMethodSignal raise |
|
6366 |
||
6367 |
"Created: / 12.11.1998 / 19:26:03 / cg" |
|
6368 |
! |
|
6369 |
||
6370 |
_URLConnection_finalize:nativeContext |
|
6371 |
"/ void finalize () |
|
6372 |
UnimplementedNativeMethodSignal raise |
|
6373 |
||
6374 |
"Created: / 12.11.1998 / 19:25:22 / cg" |
|
6375 |
! |
|
6376 |
||
6377 |
_URLConnection_getContentLength0:nativeContext |
|
6378 |
"/ int getContentLength0 () |
|
6379 |
UnimplementedNativeMethodSignal raise |
|
6380 |
||
6381 |
"Created: / 12.11.1998 / 19:25:34 / cg" |
|
6382 |
! |
|
6383 |
||
6384 |
_URLConnection_getContentType0:nativeContext |
|
6385 |
"/ java.lang.String getContentType0 () |
|
6386 |
UnimplementedNativeMethodSignal raise |
|
6387 |
||
6388 |
"Created: / 12.11.1998 / 19:25:42 / cg" |
|
6389 |
! |
|
6390 |
||
6391 |
_URLConnection_getHeaderField0:nativeContext |
|
6392 |
"/ java.lang.String getHeaderField0 (java.lang.String) |
|
6393 |
UnimplementedNativeMethodSignal raise |
|
6394 |
||
6395 |
"Created: / 12.11.1998 / 19:25:53 / cg" |
|
6396 |
! |
|
6397 |
||
6398 |
_URLConnection_pCreate:nativeContext |
|
6399 |
"/ void pCreate (java.lang.String java.lang.String) |
|
6400 |
UnimplementedNativeMethodSignal raise |
|
6401 |
||
6402 |
"Created: / 12.11.1998 / 19:25:14 / cg" |
|
6403 |
! |
|
6404 |
||
6405 |
_URLInputStream_available:nativeContext |
|
6406 |
"/ int available () |
|
6407 |
UnimplementedNativeMethodSignal raise |
|
6408 |
||
6409 |
"Created: / 12.11.1998 / 19:24:26 / cg" |
|
6410 |
! |
|
6411 |
||
6412 |
_URLInputStream_open:nativeContext |
|
6413 |
"/ void open () |
|
6414 |
UnimplementedNativeMethodSignal raise |
|
6415 |
||
6416 |
"Created: / 12.11.1998 / 19:24:01 / cg" |
|
6417 |
! |
|
6418 |
||
6419 |
_URLInputStream_read:nativeContext |
|
6420 |
"/ int read (byte[] int int) |
|
6421 |
UnimplementedNativeMethodSignal raise |
|
6422 |
||
6423 |
"Created: / 12.11.1998 / 19:24:12 / cg" |
|
6424 |
! |
|
6425 |
||
6426 |
_URLOutputStream_open:nativeContext |
|
6427 |
"/ void open () |
|
6428 |
UnimplementedNativeMethodSignal raise |
|
6429 |
||
6430 |
"Created: / 12.11.1998 / 19:24:38 / cg" |
|
6431 |
! |
|
6432 |
||
6433 |
_URLOutputStream_pClose:nativeContext |
|
6434 |
"/ void pClose () |
|
6435 |
UnimplementedNativeMethodSignal raise |
|
6436 |
||
6437 |
"Created: / 12.11.1998 / 19:25:02 / cg" |
|
6438 |
! |
|
6439 |
||
6440 |
_URLOutputStream_write:nativeContext |
|
6441 |
"/ void write (int) |
|
6442 |
UnimplementedNativeMethodSignal raise |
|
6443 |
||
6444 |
"Created: / 12.11.1998 / 19:24:45 / cg" |
|
6445 |
! |
|
6446 |
||
6447 |
_URLOutputStream_writeBytes:nativeContext |
|
6448 |
"/ void writeBytes (byte[] int int) |
|
6449 |
UnimplementedNativeMethodSignal raise |
|
6450 |
||
6451 |
"Created: / 12.11.1998 / 19:24:55 / cg" |
|
6452 |
! |
|
6453 |
||
255 | 6454 |
_URLStreamHandlerFactory_pInit:nativeContext |
6455 |
"/ self unimplementedNativeMethod. |
|
6456 |
||
6457 |
"Created: / 10.1.1998 / 15:47:24 / cg" |
|
440 | 6458 |
! |
6459 |
||
6460 |
_URLStreamHandlerFactory_pSupportsProtocol:nativeContext |
|
6461 |
"/ boolean pSupportsProtocol (java.lang.String) |
|
6462 |
UnimplementedNativeMethodSignal raise |
|
6463 |
||
6464 |
"Created: / 12.11.1998 / 19:23:43 / cg" |
|
255 | 6465 |
! ! |
6466 |
||
6467 |
!JavaVM class methodsFor:'native - sun.audio'! |
|
6468 |
||
6469 |
_AudioDevice_audioClose:nativeContext |
|
261 | 6470 |
|device fd stream| |
6471 |
||
6472 |
device := nativeContext receiver. |
|
6473 |
device notNil ifTrue:[ |
|
6474 |
fd := device instVarNamed:'dev'. |
|
6475 |
(fd notNil and:[fd > 0]) ifTrue:[ |
|
6476 |
stream := self getOpenFileAt:fd. |
|
6477 |
stream notNil ifTrue:[ |
|
6478 |
stream close. |
|
6479 |
device instVarNamed:'dev' put:0. |
|
6480 |
] |
|
6481 |
] |
|
6482 |
] |
|
255 | 6483 |
|
6484 |
"Created: / 10.1.1998 / 15:45:16 / cg" |
|
261 | 6485 |
"Modified: / 13.1.1998 / 18:08:20 / cg" |
255 | 6486 |
! |
6487 |
||
6488 |
_AudioDevice_audioOpen:nativeContext |
|
261 | 6489 |
|f stream fileNo| |
6490 |
||
6491 |
NoAudio ifTrue:[ |
|
374 | 6492 |
Transcript showCR:'JAVA: audio disabled'. |
6493 |
^ -1 |
|
6494 |
]. |
|
6495 |
||
261 | 6496 |
Stream streamErrorSignal handle:[:ex | |
374 | 6497 |
Stream streamErrorSignal handle:[:ex | |
6498 |
stream := nil. |
|
6499 |
ex return. |
|
6500 |
] do:[ |
|
6501 |
stream := SoundStream writing. |
|
6502 |
]. |
|
261 | 6503 |
] do:[ |
374 | 6504 |
stream := SoundStream writing. |
6505 |
stream notNil ifTrue:[ |
|
6506 |
stream setSampleRate:8000. |
|
6507 |
] |
|
261 | 6508 |
]. |
6509 |
stream isNil ifTrue:[ |
|
374 | 6510 |
"/ ^ -1. |
6511 |
||
6512 |
f := '/dev/audio' asFilename. |
|
6513 |
f exists ifFalse:[ |
|
6514 |
Transcript showCR:'JAVA: neither SoundStream nor /dev/audio available'. |
|
6515 |
^ -1 |
|
6516 |
]. |
|
6517 |
stream := f readWriteStream. |
|
6518 |
stream isNil ifTrue:[ |
|
6519 |
Transcript showCR:'JAVA: /dev/audio exists, but cannot be opened'. |
|
6520 |
^ -1 |
|
6521 |
]. |
|
6522 |
fileNo := self addOpenFile:stream. |
|
6523 |
]. |
|
6524 |
||
261 | 6525 |
fileNo := self addOpenFile:stream. |
6526 |
||
6527 |
FileOpenTrace ifTrue:[ |
|
374 | 6528 |
('JAVA: opened audioDevice as FD ' , fileNo printString) infoPrintCR. |
261 | 6529 |
]. |
6530 |
||
6531 |
^ fileNo |
|
255 | 6532 |
|
6533 |
"Created: / 10.1.1998 / 15:45:30 / cg" |
|
374 | 6534 |
"Modified: / 14.10.1998 / 15:20:52 / cg" |
261 | 6535 |
! |
6536 |
||
6537 |
_AudioDevice_audioWrite:nativeContext |
|
6538 |
|device fd stream bytes count| |
|
6539 |
||
6540 |
device := nativeContext receiver. |
|
6541 |
device notNil ifTrue:[ |
|
6542 |
fd := device instVarNamed:'dev'. |
|
6543 |
(fd notNil and:[fd > 0]) ifTrue:[ |
|
6544 |
stream := self getOpenFileAt:fd. |
|
6545 |
stream notNil ifTrue:[ |
|
6546 |
bytes := nativeContext argAt:1. |
|
6547 |
count := nativeContext argAt:2. |
|
6548 |
stream nextPutBytes:count from:bytes startingAt:1 |
|
6549 |
] |
|
6550 |
] |
|
6551 |
] |
|
6552 |
||
6553 |
"Created: / 10.1.1998 / 15:45:16 / cg" |
|
6554 |
"Modified: / 13.1.1998 / 18:07:20 / cg" |
|
255 | 6555 |
! ! |
6556 |
||
6557 |
!JavaVM class methodsFor:'native - sun.awt'! |
|
6558 |
||
6559 |
_GifImageDecoder_parseImage:nativeContext |
|
261 | 6560 |
|decoder width height bool1 depth subHdrBytes dstBytes i1 i2 colorModel |
6561 |
stream byte compressedData compressedSize index count data |
|
304 | 6562 |
leftOffs topOffs codeLen flags pixelStore clrModel t buffSize |
6563 |
countGot countGot2| |
|
255 | 6564 |
|
6565 |
decoder := nativeContext receiver. |
|
6566 |
||
6567 |
i1 := nativeContext argAt:1. |
|
6568 |
i2 := nativeContext argAt:2. |
|
6569 |
width := nativeContext argAt:3. |
|
6570 |
height := nativeContext argAt:4. |
|
6571 |
bool1 := nativeContext argAt:5. |
|
6572 |
depth := nativeContext argAt:6. |
|
261 | 6573 |
subHdrBytes := nativeContext argAt:7. |
255 | 6574 |
dstBytes := nativeContext argAt:8. |
6575 |
colorModel := nativeContext argAt:9. |
|
6576 |
||
261 | 6577 |
leftOffs := subHdrBytes wordAt:1 MSB:false. |
6578 |
topOffs := subHdrBytes wordAt:3 MSB:false. |
|
6579 |
width := subHdrBytes wordAt:5 MSB:false. |
|
6580 |
height := subHdrBytes wordAt:7 MSB:false. |
|
6581 |
flags := subHdrBytes at:9. |
|
6582 |
codeLen := subHdrBytes at:10. |
|
6583 |
||
6584 |
stream := decoder instVarNamed:'input'. |
|
6585 |
pixelStore := decoder instVarNamed:'store'. |
|
339 | 6586 |
pixelStore isNil ifTrue:[ |
6587 |
^ 0 |
|
6588 |
]. |
|
261 | 6589 |
|
6590 |
buffSize := (width * height // 2) max:4096. |
|
6591 |
compressedData := ByteArray uninitializedNew:buffSize. |
|
6592 |
"get compressed data" |
|
6593 |
index := 1. |
|
304 | 6594 |
count := stream perform:#'read()I'. |
261 | 6595 |
|
6596 |
[count notNil and:[count > 0]] whileTrue:[ |
|
304 | 6597 |
(index + count) > buffSize ifTrue:[ |
6598 |
t := ByteArray uninitializedNew:(buffSize * 2). |
|
6599 |
t replaceFrom:1 to:buffSize with:compressedData startingAt:1. |
|
6600 |
compressedData := t. |
|
6601 |
buffSize := buffSize * 2. |
|
6602 |
]. |
|
6603 |
[count ~~ 0] whileTrue:[ |
|
6604 |
countGot := stream |
|
6605 |
perform:#'read([BII)I' |
|
6606 |
with:compressedData |
|
6607 |
with:index-1 |
|
6608 |
with:count. |
|
6609 |
||
6610 |
countGot > 0 ifTrue:[ |
|
6611 |
count := count - countGot. |
|
6612 |
index := index + countGot. |
|
6613 |
] ifFalse:[ |
|
6614 |
count := -1. |
|
6615 |
] |
|
6616 |
]. |
|
6617 |
||
6618 |
count >= 0 ifTrue:[ |
|
6619 |
count := stream perform:#read. |
|
6620 |
] |
|
261 | 6621 |
]. |
6622 |
compressedSize := index - 1. |
|
6623 |
||
6624 |
data := pixelStore perform:#'allocateLines(I)Ljava/lang/Object;' with:height. |
|
6625 |
(data isMemberOf:ByteArray) ifFalse:[ |
|
304 | 6626 |
self halt. |
6627 |
^ 0. |
|
261 | 6628 |
]. |
6629 |
"/ 'GIFReader: decompressing ...' infoPrintCR. |
|
6630 |
||
6631 |
||
6632 |
GIFReader |
|
304 | 6633 |
decompressGIFFrom:compressedData |
6634 |
count:compressedSize |
|
6635 |
into:data |
|
6636 |
startingAt:1 |
|
6637 |
codeLen:(codeLen + 1). |
|
261 | 6638 |
|
6639 |
clrModel := pixelStore instVarNamed:'colormodel'. |
|
6640 |
||
6641 |
pixelStore |
|
304 | 6642 |
perform:#'setPixels(IIII[BII)Z' |
6643 |
withArguments: |
|
6644 |
(Array |
|
6645 |
with:0 "/ x |
|
6646 |
with:0 "/ y |
|
6647 |
with:width "/ w |
|
6648 |
with:height "/ h |
|
6649 |
with:data |
|
6650 |
with:0 "/ offs |
|
6651 |
with:width). "/ scanSize |
|
261 | 6652 |
|
6653 |
pixelStore perform:#'imageComplete()V'. |
|
6654 |
"/ perform:#'imageComplete(I)V' |
|
6655 |
"/ with:((Java at:'java.awt.image.ImageConsumer') instVarNamed:'STATICIMAGEDONE'). |
|
6656 |
||
255 | 6657 |
"/ self internalError:'breakPoint'. |
6658 |
^ 1 "/ true |
|
6659 |
||
339 | 6660 |
"Modified: / 10.4.1998 / 14:31:59 / cg" |
255 | 6661 |
! |
6662 |
||
6663 |
_ImageRepresentation_disposeImage:nativeContext |
|
262 | 6664 |
|imgRep img| |
255 | 6665 |
|
6666 |
imgRep := nativeContext receiver. |
|
262 | 6667 |
|
6668 |
img := imgRep instVarNamed:'pData'. |
|
6669 |
(img notNil and:[img ~~ 0]) ifTrue:[ |
|
270 | 6670 |
ImageStretchCache notNil ifTrue:[ |
6671 |
ImageStretchCache removeKey:img ifAbsent:nil. |
|
6672 |
] |
|
262 | 6673 |
]. |
6674 |
||
261 | 6675 |
imgRep instVarNamed:'pData' put:0. |
6676 |
"/ self halt. |
|
255 | 6677 |
|
6678 |
"Created: / 7.1.1998 / 22:31:46 / cg" |
|
262 | 6679 |
"Modified: / 17.1.1998 / 13:26:55 / cg" |
255 | 6680 |
! |
6681 |
||
6682 |
_ImageRepresentation_finish:nativeContext |
|
6683 |
|imgRep bool| |
|
6684 |
||
6685 |
imgRep := nativeContext receiver. |
|
6686 |
bool := nativeContext argAt:1. |
|
261 | 6687 |
"/ self halt. |
318 | 6688 |
"/ 'JAVA: ImageRepresentation_finish ignored for now' infoPrintCR. |
255 | 6689 |
|
6690 |
^ 1 "/ true |
|
6691 |
||
6692 |
"Created: / 8.1.1998 / 00:11:40 / cg" |
|
318 | 6693 |
"Modified: / 6.2.1998 / 02:12:54 / cg" |
261 | 6694 |
! |
6695 |
||
6696 |
_ImageRepresentation_imageDraw:nativeContext |
|
6697 |
|imgRep x y img deviceImage jGraphics gc clr| |
|
6698 |
||
6699 |
imgRep := nativeContext receiver. |
|
6700 |
img := imgRep instVarNamed:'pData'. |
|
6701 |
(img isNil or:[img == 0]) ifTrue:[ |
|
466 | 6702 |
"/ self halt. |
6703 |
^ self. |
|
261 | 6704 |
]. |
6705 |
jGraphics := nativeContext argAt:1. |
|
6706 |
gc := jGraphics instVarNamed:'pData'. |
|
6707 |
gc realized ifFalse:[^ self]. |
|
6708 |
||
6709 |
x := nativeContext argAt:2. |
|
6710 |
y := nativeContext argAt:3. |
|
6711 |
clr := nativeContext argAt:4. |
|
6712 |
deviceImage := img onDevice:gc device. |
|
6713 |
deviceImage ~~ img ifTrue:[ |
|
466 | 6714 |
imgRep instVarNamed:'pData' put:deviceImage. |
6715 |
]. |
|
6716 |
gc realized ifFalse:[^ self]. |
|
261 | 6717 |
deviceImage displayOn:gc x:x y:y. |
6718 |
^ 1. |
|
6719 |
||
6720 |
"Created: / 13.1.1998 / 13:32:28 / cg" |
|
466 | 6721 |
"Modified: / 25.11.1998 / 15:36:38 / cg" |
261 | 6722 |
! |
6723 |
||
6724 |
_ImageRepresentation_imageStretch:nativeContext |
|
6725 |
|imgRep x1 y1 x2 y2 srcX1 srcY1 w h |
|
6726 |
img deviceImage jGraphics gc clr stretchWidth stretchHeight| |
|
6727 |
||
6728 |
imgRep := nativeContext receiver. |
|
6729 |
img := imgRep instVarNamed:'pData'. |
|
6730 |
(img isNil or:[img == 0]) ifTrue:[ |
|
270 | 6731 |
"/ self halt. |
6732 |
^ self. |
|
261 | 6733 |
]. |
6734 |
||
6735 |
jGraphics := nativeContext argAt:1. |
|
6736 |
gc := jGraphics instVarNamed:'pData'. |
|
6737 |
gc realized ifFalse:[^ self]. |
|
6738 |
||
6739 |
x1 := nativeContext argAt:2. |
|
6740 |
y1 := nativeContext argAt:3. |
|
6741 |
x2 := nativeContext argAt:4. |
|
6742 |
y2:= nativeContext argAt:5. |
|
6743 |
srcX1 := nativeContext argAt:6. |
|
6744 |
srcY1 := nativeContext argAt:7. |
|
6745 |
w := nativeContext argAt:8. |
|
6746 |
h := nativeContext argAt:9. |
|
6747 |
clr := nativeContext argAt:10. |
|
6748 |
||
6749 |
(srcX1 ~~ 0 or:[srcY1 ~~ 0]) ifTrue:[ |
|
270 | 6750 |
self halt. |
6751 |
^ self. |
|
261 | 6752 |
]. |
6753 |
(w ~~ img width or:[h ~~ img height]) ifTrue:[ |
|
270 | 6754 |
self halt. |
6755 |
^ self |
|
261 | 6756 |
]. |
6757 |
||
6758 |
"/ TODO: remember magnified images somewhere for a while, |
|
6759 |
"/ to avoid repeated action ... |
|
6760 |
||
6761 |
stretchWidth := (x2-x1). |
|
6762 |
stretchHeight := (y2-y1). |
|
6763 |
||
6764 |
(stretchWidth == img width |
|
6765 |
and:[stretchHeight == img height]) ifTrue:[ |
|
270 | 6766 |
deviceImage := img onDevice:gc device. |
6767 |
deviceImage ~~ img ifTrue:[ |
|
6768 |
imgRep instVarNamed:'pData' put:deviceImage. |
|
6769 |
]. |
|
261 | 6770 |
] ifFalse:[ |
270 | 6771 |
ImageStretchCache notNil ifTrue:[ |
6772 |
deviceImage := ImageStretchCache at:img ifAbsent:nil. |
|
6773 |
]. |
|
6774 |
(deviceImage isNil |
|
6775 |
or:[deviceImage width ~~ stretchWidth |
|
6776 |
or:[deviceImage height ~~ stretchHeight]]) ifTrue:[ |
|
6777 |
deviceImage := (img magnifiedTo:stretchWidth@stretchHeight) onDevice:gc device. |
|
6778 |
ImageStretchCache isNil ifTrue:[ |
|
6779 |
ImageStretchCache := WeakIdentityDictionary new. |
|
6780 |
]. |
|
6781 |
ImageStretchCache at:img put:deviceImage |
|
6782 |
]. |
|
261 | 6783 |
]. |
6784 |
deviceImage displayOn:gc x:x1 y:y1 |
|
6785 |
||
6786 |
"Created: / 13.1.1998 / 13:32:28 / cg" |
|
6787 |
"Modified: / 15.1.1998 / 13:14:47 / cg" |
|
255 | 6788 |
! |
6789 |
||
6790 |
_ImageRepresentation_offscreenInit:nativeContext |
|
262 | 6791 |
|imgRep jclr w h form screenDevice| |
255 | 6792 |
|
6793 |
imgRep := nativeContext receiver. |
|
261 | 6794 |
jclr := nativeContext argAt:1. |
262 | 6795 |
|
6796 |
w := imgRep instVarNamed:'width'. |
|
6797 |
h := imgRep instVarNamed:'height'. |
|
6798 |
||
6799 |
screenDevice := Screen current. |
|
6800 |
form := Form width:w height:h depth:(screenDevice depth) on:screenDevice. |
|
6801 |
||
6802 |
imgRep instVarNamed:'pData' put:form. |
|
6803 |
"/ self halt. |
|
255 | 6804 |
|
6805 |
"Created: / 7.1.1998 / 22:31:46 / cg" |
|
262 | 6806 |
"Modified: / 17.1.1998 / 12:36:43 / cg" |
261 | 6807 |
! |
6808 |
||
6809 |
_ImageRepresentation_setBytePixels:nativeContext |
|
318 | 6810 |
|imgRep x y w h clrModel bytes offs i2 |
6811 |
img depth cmap rgbMap opaque transparentColorIndex |
|
6812 |
scanLineWidth nBytes srcIdx dstIdx| |
|
261 | 6813 |
|
6814 |
imgRep := nativeContext receiver. |
|
6815 |
x := nativeContext argAt:1. |
|
6816 |
y := nativeContext argAt:2. |
|
6817 |
w := nativeContext argAt:3. |
|
6818 |
h := nativeContext argAt:4. |
|
6819 |
clrModel := nativeContext argAt:5. |
|
6820 |
bytes := nativeContext argAt:6. |
|
318 | 6821 |
offs := nativeContext argAt:7. "/ offset ?? |
6822 |
scanLineWidth := nativeContext argAt:8. |
|
261 | 6823 |
|
6824 |
depth := clrModel instVarNamed:'pixel_bits'. |
|
6825 |
(clrModel instVarNamed:'map_size') ~~ 0 ifTrue:[ |
|
318 | 6826 |
rgbMap := clrModel instVarNamed:'rgb'. |
6827 |
cmap := Array new:rgbMap size. |
|
6828 |
rgbMap |
|
6829 |
keysAndValuesDo:[:idx :rgb | |
|
6830 |
cmap at:idx put:(Color rgbValue:(rgb bitAnd:16rFFFFFF)) |
|
6831 |
]. |
|
261 | 6832 |
]. |
6833 |
||
6834 |
opaque := (clrModel instVarNamed:'opaque') ~~ 0. |
|
6835 |
opaque ifFalse:[ |
|
318 | 6836 |
transparentColorIndex := clrModel instVarNamed:'transparent_index' |
261 | 6837 |
]. |
6838 |
||
6839 |
img := imgRep instVarNamed:'pData'. |
|
405 | 6840 |
(img isNil or:[img == 0]) ifFalse:[ |
6841 |
"/ self halt |
|
6842 |
]. |
|
6843 |
||
6844 |
(offs ~~ 0 or:[scanLineWidth ~~ w]) ifTrue:[ |
|
6845 |
nBytes := ByteArray new:w*h. |
|
6846 |
srcIdx := offs+1. |
|
6847 |
dstIdx := 1. |
|
6848 |
1 to:h do:[:y | |
|
6849 |
nBytes replaceFrom:dstIdx to:(dstIdx+w-1) with:bytes startingAt:srcIdx. |
|
6850 |
srcIdx := srcIdx + scanLineWidth. |
|
6851 |
dstIdx := dstIdx + w. |
|
318 | 6852 |
]. |
405 | 6853 |
bytes := nBytes. |
6854 |
]. |
|
6855 |
img := Image width:w height:h depth:depth fromArray:bytes. |
|
6856 |
cmap notNil ifTrue:[ |
|
6857 |
img colorMap:cmap. |
|
6858 |
img photometric:#palette |
|
6859 |
]. |
|
6860 |
opaque ifFalse:[ |
|
6861 |
img mask:(ImageReader |
|
6862 |
buildMaskFromColor:transparentColorIndex |
|
6863 |
for:bytes |
|
6864 |
width:w |
|
6865 |
height:h) |
|
6866 |
]. |
|
6867 |
||
6868 |
imgRep instVarNamed:'pData' put:img. |
|
261 | 6869 |
^ 1. |
6870 |
||
6871 |
"Created: / 7.1.1998 / 22:31:46 / cg" |
|
405 | 6872 |
"Modified: / 21.10.1998 / 00:35:45 / cg" |
262 | 6873 |
! |
6874 |
||
297 | 6875 |
_ImageRepresentation_setIntPixels:nativeContext |
318 | 6876 |
|imgRep x y w h clrModel ints offs scanLineWidth |
316 | 6877 |
img depth cmap rgbMap opaque transparentColorIndex |
373 | 6878 |
bytes srcIdx dstIdx val red green blue |
6879 |
redMask greenMask blueMask redShift greenShift blueShift| |
|
297 | 6880 |
|
6881 |
imgRep := nativeContext receiver. |
|
6882 |
x := nativeContext argAt:1. |
|
6883 |
y := nativeContext argAt:2. |
|
6884 |
w := nativeContext argAt:3. |
|
6885 |
h := nativeContext argAt:4. |
|
6886 |
clrModel := nativeContext argAt:5. |
|
6887 |
ints := nativeContext argAt:6. |
|
318 | 6888 |
offs := nativeContext argAt:7. "/ offset ?? |
6889 |
scanLineWidth := nativeContext argAt:8. "/ scanLineWidth ?? |
|
297 | 6890 |
opaque := false. |
373 | 6891 |
offs ~~ 0 ifTrue:[ |
6892 |
self halt |
|
6893 |
]. |
|
297 | 6894 |
|
6895 |
depth := clrModel instVarNamed:'pixel_bits'. |
|
6896 |
clrModel class == (Java at:'java.awt.image.DirectColorModel') ifTrue:[ |
|
6897 |
] ifFalse:[ |
|
6898 |
(clrModel instVarNamed:'map_size') ~~ 0 ifTrue:[ |
|
6899 |
rgbMap := clrModel instVarNamed:'rgb'. |
|
6900 |
cmap := Array new:rgbMap size. |
|
6901 |
rgbMap |
|
6902 |
keysAndValuesDo:[:idx :rgb | |
|
6903 |
cmap at:idx put:(Color rgbValue:(rgb bitAnd:16rFFFFFF)) |
|
6904 |
]. |
|
6905 |
]. |
|
6906 |
opaque := (clrModel instVarNamed:'opaque') ~~ 0. |
|
6907 |
opaque ifFalse:[ |
|
6908 |
transparentColorIndex := clrModel instVarNamed:'transparent_index' |
|
6909 |
]. |
|
6910 |
]. |
|
6911 |
||
6912 |
img := imgRep instVarNamed:'pData'. |
|
405 | 6913 |
(img isNil or:[img == 0]) ifFalse:[ |
6914 |
"/ self halt. |
|
6915 |
]. |
|
6916 |
||
6917 |
depth == 32 ifTrue:[ |
|
6918 |
"/ temporary kludge - ony use 24 bits/pixel |
|
6919 |
bytes := ByteArray new:w*h*3. |
|
6920 |
srcIdx := 1. |
|
6921 |
dstIdx := 1. |
|
6922 |
redMask := clrModel instVarNamed:'red_mask'. |
|
6923 |
greenMask := clrModel instVarNamed:'green_mask'. |
|
6924 |
blueMask := clrModel instVarNamed:'blue_mask'. |
|
6925 |
redShift := (clrModel instVarNamed:'red_offset') negated. |
|
6926 |
greenShift := (clrModel instVarNamed:'green_offset') negated. |
|
6927 |
blueShift := (clrModel instVarNamed:'blue_offset') negated. |
|
6928 |
1 to:h do:[:y | |
|
6929 |
1 to:w do:[:x | |
|
6930 |
val := ints at:srcIdx. |
|
6931 |
red := (val bitAnd:redMask) bitShift:redShift. |
|
6932 |
green := (val bitAnd:greenMask) bitShift:greenShift. |
|
6933 |
blue := (val bitAnd:blueMask) bitShift:blueShift. |
|
6934 |
bytes at:dstIdx put:red. |
|
6935 |
bytes at:dstIdx+1 put:green. |
|
6936 |
bytes at:dstIdx+2 put:blue. |
|
6937 |
dstIdx := dstIdx + 3. |
|
6938 |
srcIdx := srcIdx + 1. |
|
316 | 6939 |
]. |
405 | 6940 |
srcIdx := srcIdx + (scanLineWidth - w). |
316 | 6941 |
]. |
405 | 6942 |
img := Depth24Image width:w height:h depth:24 fromArray:bytes. |
6943 |
] ifFalse:[ |
|
6944 |
scanLineWidth ~~ w ifTrue:[ |
|
6945 |
self halt |
|
297 | 6946 |
]. |
405 | 6947 |
img := Image width:w height:h depth:depth fromArray:ints. |
6948 |
]. |
|
6949 |
cmap notNil ifTrue:[ |
|
6950 |
img colorMap:cmap. |
|
6951 |
img photometric:#palette |
|
297 | 6952 |
] ifFalse:[ |
405 | 6953 |
img photometric:#rgb |
6954 |
]. |
|
6955 |
opaque ifFalse:[ |
|
6956 |
img mask:(ImageReader |
|
6957 |
buildMaskFromColor:transparentColorIndex |
|
6958 |
for:ints |
|
6959 |
width:w |
|
6960 |
height:h) |
|
6961 |
]. |
|
6962 |
||
6963 |
imgRep instVarNamed:'pData' put:img. |
|
297 | 6964 |
^ 1. |
6965 |
||
6966 |
"Created: / 1.2.1998 / 17:38:47 / cg" |
|
405 | 6967 |
"Modified: / 21.10.1998 / 00:35:37 / cg" |
297 | 6968 |
! |
6969 |
||
440 | 6970 |
_JPEGImageDecoder_readImage:nativeContext |
6971 |
UnimplementedNativeMethodSignal raise |
|
6972 |
||
6973 |
"Created: / 12.11.1998 / 18:53:30 / cg" |
|
6974 |
"Modified: / 12.11.1998 / 18:53:40 / cg" |
|
6975 |
! |
|
6976 |
||
262 | 6977 |
_OffScreenImageSource_sendPixels:nativeContext |
6978 |
"/ self halt. |
|
6979 |
||
6980 |
"Modified: / 16.1.1998 / 18:22:23 / cg" |
|
6981 |
"Created: / 17.1.1998 / 12:36:25 / cg" |
|
255 | 6982 |
! ! |
6983 |
||
280 | 6984 |
!JavaVM class methodsFor:'native - sun.awt - jdk1.2'! |
6985 |
||
284 | 6986 |
_ColorModel_initIDs:nativeContext |
6987 |
"/ new with jdk1.2 ... |
|
6988 |
||
6989 |
"Created: / 28.1.1998 / 22:19:23 / cg" |
|
6990 |
! |
|
6991 |
||
6992 |
_FontDescriptor_initIDs:nativeContext |
|
6993 |
"/ new with jdk1.2 ... |
|
6994 |
||
6995 |
"Created: / 28.1.1998 / 22:30:52 / cg" |
|
6996 |
! |
|
6997 |
||
6998 |
_Font_initIDs:nativeContext |
|
6999 |
"/ new with jdk1.2 ... |
|
7000 |
||
7001 |
"Created: / 27.1.1998 / 21:43:25 / cg" |
|
7002 |
! |
|
7003 |
||
7004 |
_PackedColorModel_initIDs:nativeContext |
|
7005 |
"/ new with jdk1.2 ... |
|
7006 |
||
7007 |
"Created: / 28.1.1998 / 22:19:35 / cg" |
|
7008 |
! |
|
7009 |
||
7010 |
_PlatformFont_initIDs:nativeContext |
|
7011 |
"/ new with jdk1.2 ... |
|
7012 |
||
7013 |
"Created: / 28.1.1998 / 22:30:41 / cg" |
|
7014 |
! |
|
7015 |
||
7016 |
_X11GraphicsDevice_getConfigType:nativeContext |
|
7017 |
"/ new with jdk1.2 ... |
|
7018 |
||
7019 |
|configNr cls| |
|
7020 |
||
7021 |
"/ for now, only one config. |
|
7022 |
configNr := nativeContext argAt:1. |
|
7023 |
||
7024 |
cls := Java classNamed:'java.awt.GraphicsDevice'. |
|
7025 |
^ cls instVarNamed:'TYPE_RASTER_SCREEN'. |
|
7026 |
||
7027 |
"Created: / 28.1.1998 / 22:19:05 / cg" |
|
7028 |
! |
|
7029 |
||
7030 |
_X11GraphicsDevice_getNumConfigs:nativeContext |
|
7031 |
"/ new with jdk1.2 ... |
|
7032 |
||
7033 |
^ 1 |
|
7034 |
||
7035 |
"Created: / 28.1.1998 / 22:13:26 / cg" |
|
7036 |
"Modified: / 28.1.1998 / 22:14:33 / cg" |
|
7037 |
! |
|
7038 |
||
7039 |
_X11GraphicsEnvironment_getNumScreens:nativeContext |
|
7040 |
"/ new with jdk1.2 ... |
|
7041 |
||
7042 |
"/ could return the actual number of screens ... |
|
7043 |
||
7044 |
^ 1 |
|
7045 |
||
7046 |
"Created: / 28.1.1998 / 01:50:22 / cg" |
|
7047 |
"Modified: / 28.1.1998 / 22:12:32 / cg" |
|
7048 |
! |
|
7049 |
||
280 | 7050 |
_X11GraphicsEnvironment_initDisplay:nativeContext |
7051 |
"/ new with jdk1.2 ... |
|
7052 |
||
7053 |
"Created: / 28.1.1998 / 01:50:22 / cg" |
|
7054 |
! ! |
|
7055 |
||
284 | 7056 |
!JavaVM class methodsFor:'native - sun.awt.motif - jdk1.2'! |
7057 |
||
7058 |
_InputThread_run:nativeContext |
|
7059 |
self _WToolkit_eventLoop:nativeContext. |
|
7060 |
||
7061 |
"Created: / 28.1.1998 / 22:34:47 / cg" |
|
7062 |
"Modified: / 28.1.1998 / 22:35:16 / cg" |
|
7063 |
! |
|
7064 |
||
7065 |
_MComponentPeer_cacheInit:nativeContext |
|
7066 |
||
7067 |
"Created: / 28.1.1998 / 22:22:30 / cg" |
|
7068 |
! |
|
7069 |
||
457 | 7070 |
_MComponentPeer_pHide:nativeContext |
7071 |
^ self _WComponentPeer_hide:nativeContext |
|
7072 |
||
7073 |
"Created: / 18.11.1998 / 00:15:18 / cg" |
|
7074 |
! |
|
7075 |
||
284 | 7076 |
_MComponentPeer_pInitialize:nativeContext |
7077 |
||
7078 |
"Created: / 28.1.1998 / 22:27:25 / cg" |
|
7079 |
! |
|
7080 |
||
7081 |
_MComponentPeer_setCursor:nativeContext |
|
7082 |
||
7083 |
"Created: / 28.1.1998 / 22:27:35 / cg" |
|
7084 |
! |
|
7085 |
||
7086 |
_MFramePeer_create:nativeContext |
|
7087 |
^ self _WFramePeer_create:nativeContext |
|
7088 |
||
7089 |
"Created: / 28.1.1998 / 22:25:44 / cg" |
|
7090 |
! |
|
7091 |
||
7092 |
_MFramePeer_pHide:nativeContext |
|
7093 |
^ self _WComponentPeer_hide:nativeContext |
|
7094 |
||
7095 |
"Created: / 28.1.1998 / 22:27:04 / cg" |
|
7096 |
! |
|
7097 |
||
7098 |
_MFramePeer_pReshape:nativeContext |
|
7099 |
self commonReshapeComponent:nativeContext |
|
7100 |
||
7101 |
"Created: / 28.1.1998 / 22:28:00 / cg" |
|
7102 |
"Modified: / 28.1.1998 / 22:29:34 / cg" |
|
7103 |
! |
|
7104 |
||
7105 |
_MFramePeer_pSetTitle:nativeContext |
|
7106 |
self _WWindowPeer__setTitle:nativeContext |
|
7107 |
||
7108 |
"Created: / 28.1.1998 / 22:30:23 / cg" |
|
7109 |
! |
|
7110 |
||
7111 |
_MToolkit_init:nativeContext |
|
7112 |
||
7113 |
"Created: / 28.1.1998 / 22:21:54 / cg" |
|
7114 |
! |
|
7115 |
||
7116 |
_MToolkit_run:nativeContext |
|
7117 |
||
7118 |
"Created: / 28.1.1998 / 22:22:10 / cg" |
|
7119 |
! ! |
|
7120 |
||
7121 |
!JavaVM class methodsFor:'native - sun.awt.windows'! |
|
7122 |
||
457 | 7123 |
_MComponentPeer_handleEvent:nativeContext |
7124 |
^ self _WComponentPeer_handleEvent:nativeContext |
|
7125 |
||
7126 |
"Created: / 18.11.1998 / 00:21:17 / cg" |
|
7127 |
! |
|
7128 |
||
7129 |
_MComponentPeer_pShow:nativeContext |
|
7130 |
|view| |
|
7131 |
||
7132 |
view := self viewForWPeer:nativeContext. |
|
7133 |
||
7134 |
"/ frame views are under my browsers own control |
|
7135 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
7136 |
view beVisible. |
|
7137 |
view realize. |
|
7138 |
]. |
|
7139 |
||
7140 |
"/ view windowGroup notNil ifTrue:[ |
|
7141 |
"/ windowServer addGroup:(view windowGroup) |
|
7142 |
"/ ]. |
|
7143 |
||
7144 |
^ nil |
|
7145 |
||
7146 |
"/ self halt. |
|
7147 |
||
7148 |
"Modified: / 25.1.1998 / 09:54:07 / cg" |
|
7149 |
"Created: / 18.11.1998 / 00:21:51 / cg" |
|
7150 |
! |
|
7151 |
||
284 | 7152 |
_WButtonPeer_create:nativeContext |
7153 |
|jButtonPeer jButton jFrame frame button |
|
7154 |
lbl| |
|
7155 |
||
7156 |
jButtonPeer := nativeContext receiver. |
|
7157 |
jButton := jButtonPeer instVarNamed:'target'. |
|
7158 |
||
7159 |
jFrame := nativeContext argAt:1. |
|
7160 |
frame := jFrame instVarNamed:'pData'. |
|
7161 |
||
7162 |
button := Button in:frame. |
|
448 | 7163 |
button action:[ |
7164 |
jButtonPeer perform:#'handleAction()V'. |
|
7165 |
]. |
|
284 | 7166 |
|
7167 |
lbl := jButton instVarNamed:'label'. |
|
7168 |
lbl notNil ifTrue:[ |
|
419 | 7169 |
lbl := Java as_ST_String:lbl. |
7170 |
button label:lbl |
|
284 | 7171 |
]. |
7172 |
self createdWindowsView:button for:jButtonPeer. |
|
7173 |
||
7174 |
WindowCreationTrace == true ifTrue:[ |
|
419 | 7175 |
'WButtonPeer_create: ' print. frame print. ' -> ' print. button printNL. |
284 | 7176 |
]. |
7177 |
||
7178 |
"Created: / 5.1.1998 / 01:53:30 / cg" |
|
448 | 7179 |
"Modified: / 13.11.1998 / 22:59:46 / cg" |
284 | 7180 |
! |
7181 |
||
297 | 7182 |
_WButtonPeer_setLabel:nativeContext |
7183 |
|label jString| |
|
7184 |
||
7185 |
jString := nativeContext argAt:1. |
|
7186 |
||
7187 |
label := self viewForWPeer:nativeContext. |
|
7188 |
label label:(Java as_ST_String:jString) |
|
7189 |
||
7190 |
"Modified: / 8.1.1998 / 17:35:50 / cg" |
|
7191 |
"Created: / 1.2.1998 / 17:05:47 / cg" |
|
7192 |
! |
|
7193 |
||
284 | 7194 |
_WCanvasPeer_create:nativeContext |
7195 |
|jCanvasPeer jFrame frame subView| |
|
7196 |
||
7197 |
jCanvasPeer := nativeContext receiver. |
|
7198 |
||
7199 |
jFrame := nativeContext argAt:1. |
|
7200 |
jFrame isNil ifTrue:[ |
|
7201 |
self halt:'no frame in canvasPeer create'. |
|
7202 |
self internalError:'no frame in canvasPeer create'. |
|
7203 |
^ self. |
|
7204 |
]. |
|
7205 |
frame := jFrame instVarNamed:'pData'. |
|
7206 |
||
7207 |
subView := JavaView in:frame. |
|
7208 |
subView delegate:self. |
|
7209 |
subView javaPeer:jCanvasPeer. |
|
7210 |
||
7211 |
self createdWindowsView:subView for:jCanvasPeer. |
|
7212 |
||
7213 |
WindowCreationTrace == true ifTrue:[ |
|
7214 |
'WCanvasPeer_create: ' print. frame print. ' -> ' print. subView printNL. |
|
7215 |
]. |
|
7216 |
||
7217 |
"Created: / 5.1.1998 / 00:59:19 / cg" |
|
7218 |
"Modified: / 16.1.1998 / 13:40:00 / cg" |
|
7219 |
! |
|
7220 |
||
440 | 7221 |
_WCheckboxMenuItemPeer_setState:nativeContext |
7222 |
"/ void setState (boolean) |
|
482 | 7223 |
"/ UnimplementedNativeMethodSignal raise |
440 | 7224 |
|
7225 |
"Created: / 12.11.1998 / 19:14:35 / cg" |
|
482 | 7226 |
"Modified: / 3.12.1998 / 21:41:13 / cg" |
440 | 7227 |
! |
7228 |
||
284 | 7229 |
_WCheckboxPeer_create:nativeContext |
7230 |
|jCheckboxPeer jCheckbox jFrame frame checkBox lbl| |
|
7231 |
||
7232 |
jCheckboxPeer := nativeContext receiver. |
|
7233 |
jCheckbox := jCheckboxPeer instVarNamed:'target'. |
|
7234 |
||
7235 |
jFrame := nativeContext argAt:1. |
|
7236 |
frame := jFrame instVarNamed:'pData'. |
|
7237 |
||
7238 |
checkBox := CheckBox in:frame. |
|
7239 |
checkBox action:[ |
|
7240 |
jCheckboxPeer |
|
7241 |
perform:#'handleAction(Z)V' |
|
7242 |
with:(checkBox isOn ifTrue:[1] ifFalse:[0]) |
|
7243 |
]. |
|
7244 |
||
7245 |
lbl := jCheckbox instVarNamed:'label'. |
|
7246 |
lbl notNil ifTrue:[ |
|
7247 |
lbl := Java as_ST_String:lbl. |
|
7248 |
checkBox label:lbl |
|
7249 |
]. |
|
7250 |
||
7251 |
self createdWindowsView:checkBox for:jCheckboxPeer. |
|
7252 |
||
7253 |
WindowCreationTrace == true ifTrue:[ |
|
7254 |
'WCheckboxPeer_create: ' print. frame print. ' -> ' print. checkBox printNL. |
|
7255 |
]. |
|
7256 |
||
7257 |
"Created: / 7.1.1998 / 21:48:03 / cg" |
|
7258 |
"Modified: / 15.1.1998 / 12:27:04 / cg" |
|
7259 |
! |
|
7260 |
||
7261 |
_WCheckboxPeer_setCheckboxGroup:nativeContext |
|
7262 |
|checkBox jGroup| |
|
7263 |
||
7264 |
checkBox := self viewForWPeer:nativeContext. |
|
7265 |
||
7266 |
jGroup := nativeContext argAt:1. |
|
7267 |
||
7268 |
"Created: / 7.1.1998 / 21:48:47 / cg" |
|
7269 |
"Modified: / 25.1.1998 / 01:20:42 / cg" |
|
7270 |
! |
|
7271 |
||
440 | 7272 |
_WCheckboxPeer_setLabel:nativeContext |
7273 |
"/ void setLabel (java.lang.String) |
|
7274 |
UnimplementedNativeMethodSignal raise |
|
7275 |
||
7276 |
"Created: / 12.11.1998 / 19:14:53 / cg" |
|
7277 |
! |
|
7278 |
||
284 | 7279 |
_WCheckboxPeer_setState:nativeContext |
7280 |
|checkBox state| |
|
7281 |
||
7282 |
checkBox := self viewForWPeer:nativeContext. |
|
7283 |
||
7284 |
state := nativeContext argAt:1. |
|
7285 |
state ~~ 0 ifTrue:[ |
|
7286 |
checkBox turnOn |
|
7287 |
] ifFalse:[ |
|
7288 |
checkBox turnOff |
|
7289 |
]. |
|
7290 |
||
7291 |
"Created: / 7.1.1998 / 21:49:13 / cg" |
|
7292 |
"Modified: / 25.1.1998 / 01:26:18 / cg" |
|
7293 |
! |
|
7294 |
||
7295 |
_WChoicePeer_addItem:nativeContext |
|
7296 |
|jString index comboBox| |
|
7297 |
||
7298 |
comboBox := self viewForWPeer:nativeContext. |
|
7299 |
||
7300 |
jString := nativeContext argAt:1. |
|
7301 |
index := nativeContext argAt:2. |
|
7302 |
||
7303 |
comboBox model list addLast:(Java as_ST_String:jString). |
|
7304 |
comboBox model changed:#list. |
|
7305 |
||
7306 |
"Created: / 7.1.1998 / 21:45:12 / cg" |
|
7307 |
"Modified: / 24.1.1998 / 18:51:32 / cg" |
|
7308 |
! |
|
7309 |
||
7310 |
_WChoicePeer_create:nativeContext |
|
7311 |
|jChoicePeer jChoice jFrame frame comboBox| |
|
7312 |
||
7313 |
jChoicePeer := nativeContext receiver. |
|
7314 |
jChoice := jChoicePeer instVarNamed:'target'. |
|
7315 |
||
7316 |
jFrame := nativeContext argAt:1. |
|
7317 |
frame := jFrame instVarNamed:'pData'. |
|
7318 |
||
7319 |
comboBox := ComboListView in:frame. |
|
7320 |
comboBox model:(SelectionInList new list:(OrderedCollection new)). |
|
285 | 7321 |
comboBox action:[:index | |
7322 |
jChoicePeer |
|
7323 |
perform:#'handleAction(I)V' |
|
7324 |
with:(comboBox model selectionIndex - 1) |
|
7325 |
]. |
|
284 | 7326 |
|
7327 |
self createdWindowsView:comboBox for:jChoicePeer. |
|
7328 |
||
7329 |
WindowCreationTrace == true ifTrue:[ |
|
7330 |
'WChoicePeer_create: ' print. frame print. ' -> ' print. comboBox printNL. |
|
7331 |
]. |
|
7332 |
||
7333 |
"Created: / 7.1.1998 / 21:44:31 / cg" |
|
285 | 7334 |
"Modified: / 28.1.1998 / 23:19:17 / cg" |
284 | 7335 |
! |
7336 |
||
440 | 7337 |
_WChoicePeer_remove:nativeContext |
7338 |
"/ void remove (int) |
|
7339 |
UnimplementedNativeMethodSignal raise |
|
7340 |
||
7341 |
"Created: / 12.11.1998 / 19:12:20 / cg" |
|
7342 |
! |
|
7343 |
||
284 | 7344 |
_WChoicePeer_reshape:nativeContext |
7345 |
self pReshape:nativeContext. |
|
7346 |
^ self. |
|
7347 |
||
7348 |
"Modified: / 15.8.1997 / 15:36:29 / cg" |
|
7349 |
"Created: / 7.1.1998 / 21:46:18 / cg" |
|
7350 |
! |
|
7351 |
||
7352 |
_WChoicePeer_select:nativeContext |
|
7353 |
|comboBox index| |
|
7354 |
||
7355 |
comboBox := self viewForWPeer:nativeContext. |
|
7356 |
||
7357 |
index := nativeContext argAt:1. |
|
7358 |
comboBox model selectionIndex:(index + 1). "/ JAVA indexing starts at 0 |
|
7359 |
||
7360 |
"Created: / 7.1.1998 / 21:45:43 / cg" |
|
7361 |
"Modified: / 25.1.1998 / 09:55:05 / cg" |
|
7362 |
! |
|
7363 |
||
440 | 7364 |
_WClipboard_getClipboardText:nativeContext |
7365 |
"/ java.lang.String getClipboardText () |
|
7366 |
UnimplementedNativeMethodSignal raise |
|
7367 |
||
7368 |
"Created: / 12.11.1998 / 19:15:45 / cg" |
|
7369 |
! |
|
7370 |
||
284 | 7371 |
_WClipboard_init:nativeContext |
7372 |
"/ self halt. |
|
7373 |
||
7374 |
"Modified: / 18.3.1997 / 18:43:18 / cg" |
|
7375 |
"Created: / 4.1.1998 / 19:03:59 / cg" |
|
7376 |
! |
|
7377 |
||
440 | 7378 |
_WClipboard_setClipboardText:nativeContext |
7379 |
"/ void setClipboardText (java.awt.datatransfer.StringSelection) |
|
7380 |
UnimplementedNativeMethodSignal raise |
|
7381 |
||
7382 |
"Created: / 12.11.1998 / 19:15:31 / cg" |
|
7383 |
! |
|
7384 |
||
284 | 7385 |
_WColor_getDefaultColor:nativeContext |
7386 |
|clrIndex jClr clr | |
|
7387 |
||
7388 |
clrIndex := nativeContext argAt:1. |
|
7389 |
"/ windows defaults: |
|
7390 |
"/ 1: view background |
|
7391 |
||
7392 |
clrIndex == 1 ifTrue:[ |
|
7393 |
clr := View defaultViewBackgroundColor. |
|
7394 |
clr isColor ifFalse:[ |
|
7395 |
clr := Color gray:50. |
|
7396 |
]. |
|
7397 |
]. |
|
7398 |
clrIndex == 2 ifTrue:[ |
|
7399 |
clr := Color black. |
|
7400 |
]. |
|
7401 |
clr isNil ifTrue:[ |
|
7402 |
self halt. |
|
7403 |
self internalError:'breakpoint'. |
|
7404 |
^ nil. |
|
7405 |
]. |
|
7406 |
||
7407 |
clr := clr on:(Screen current). |
|
7408 |
||
7409 |
jClr := (Java classForName:'java.awt.Color') new. |
|
7410 |
||
7411 |
jClr instVarNamed:'pData' put:clr. |
|
7412 |
jClr instVarNamed:'value' put:(clr rgbValue). |
|
7413 |
"/ self halt. |
|
7414 |
^ jClr. |
|
7415 |
||
7416 |
"Created: / 15.8.1997 / 15:38:10 / cg" |
|
7417 |
"Modified: / 4.1.1998 / 18:06:51 / cg" |
|
7418 |
! |
|
7419 |
||
440 | 7420 |
_WComponentPeer__beginValidate:nativeContext |
7421 |
"/ void _beginValidate () |
|
7422 |
UnimplementedNativeMethodSignal raise |
|
7423 |
||
7424 |
"Created: / 12.11.1998 / 19:10:08 / cg" |
|
7425 |
! |
|
7426 |
||
284 | 7427 |
_WComponentPeer__dispose:nativeContext |
7428 |
|view jPeer| |
|
7429 |
||
7430 |
view := self viewForWPeer:nativeContext. |
|
7431 |
||
7432 |
Object errorSignal catch:[ |
|
7433 |
view destroy. |
|
7434 |
]. |
|
7435 |
JavaWindowGroup removeView:view. |
|
7436 |
||
7437 |
jPeer := nativeContext receiver. |
|
7438 |
jPeer instVarNamed:'pData' put:0. |
|
7439 |
||
7440 |
"Created: / 7.1.1998 / 22:36:25 / cg" |
|
7441 |
"Modified: / 25.1.1998 / 16:43:06 / cg" |
|
7442 |
! |
|
7443 |
||
7444 |
_WComponentPeer__setBackground:nativeContext |
|
7445 |
|rgb clr view| |
|
7446 |
||
7447 |
view := self viewForWPeer:nativeContext. |
|
7448 |
||
7449 |
rgb := nativeContext argAt:1. |
|
7450 |
clr := Color rgbValue:rgb. |
|
7451 |
||
7452 |
"/ self halt. |
|
7453 |
"/ self internalError:'breakPoint'. |
|
7454 |
||
7455 |
clr := clr on:(view device). |
|
7456 |
||
7457 |
"/ (view superView isMemberOf:JavaEmbeddedFrameView) ifTrue:[ |
|
7458 |
"/ view viewBackground:(view superView viewBackground). |
|
7459 |
"/ view backgroundPaint:(view superView viewBackground). |
|
7460 |
"/ ] ifFalse:[ |
|
7461 |
"/ (view isMemberOf:JavaView) ifTrue:[ |
|
7462 |
"/ view viewBackground:clr. |
|
7463 |
"/ view backgroundPaint:clr. |
|
7464 |
"/ ] |
|
7465 |
"/ ]. |
|
7466 |
||
7467 |
(view isKindOf:ScrollableView) ifTrue:[ |
|
7468 |
view := view scrolledView |
|
7469 |
]. |
|
7470 |
view viewBackground:clr. |
|
7471 |
view backgroundPaint:clr. |
|
7472 |
||
7473 |
"Created: / 4.1.1998 / 18:07:39 / cg" |
|
7474 |
"Modified: / 15.1.1998 / 13:06:44 / cg" |
|
7475 |
! |
|
7476 |
||
7477 |
_WComponentPeer__setForeground:nativeContext |
|
7478 |
|rgb clr view| |
|
7479 |
||
7480 |
view := self viewForWPeer:nativeContext. |
|
7481 |
||
7482 |
rgb := nativeContext argAt:1. |
|
7483 |
clr := Color rgbValue:rgb. |
|
7484 |
||
7485 |
"/ self halt. |
|
7486 |
"/ self internalError:'breakPoint'. |
|
7487 |
||
7488 |
clr := clr on:(view device). |
|
7489 |
||
7490 |
view paint:clr. |
|
7491 |
||
7492 |
"Created: / 4.1.1998 / 18:08:13 / cg" |
|
7493 |
"Modified: / 8.1.1998 / 17:32:45 / cg" |
|
7494 |
! |
|
7495 |
||
7496 |
_WComponentPeer_disable:nativeContext |
|
7497 |
|view| |
|
7498 |
||
7499 |
view := self viewForWPeer:nativeContext. |
|
7500 |
||
7501 |
Object errorSignal handle:[:ex | |
|
7502 |
] do:[ |
|
7503 |
view disable |
|
7504 |
] |
|
7505 |
||
7506 |
"Created: / 6.1.1998 / 18:26:36 / cg" |
|
7507 |
"Modified: / 8.1.1998 / 17:32:53 / cg" |
|
7508 |
! |
|
7509 |
||
7510 |
_WComponentPeer_enable:nativeContext |
|
7511 |
|view| |
|
7512 |
||
7513 |
view := self viewForWPeer:nativeContext. |
|
7514 |
||
7515 |
Object errorSignal handle:[:ex | |
|
7516 |
] do:[ |
|
7517 |
view enable |
|
7518 |
] |
|
7519 |
||
7520 |
"Modified: / 8.1.1998 / 17:32:53 / cg" |
|
7521 |
"Created: / 13.1.1998 / 23:08:05 / cg" |
|
7522 |
! |
|
7523 |
||
440 | 7524 |
_WComponentPeer_endValidate:nativeContext |
7525 |
"/ void endValidate () |
|
7526 |
UnimplementedNativeMethodSignal raise |
|
7527 |
||
7528 |
"Created: / 12.11.1998 / 19:10:20 / cg" |
|
7529 |
! |
|
7530 |
||
7531 |
_WComponentPeer_getLocationOnScreen:nativeContext |
|
7532 |
"/ java.awt.Point getLocationOnScreen () |
|
480 | 7533 |
|
7534 |
|view p jP| |
|
7535 |
||
7536 |
view := self viewForWPeer:nativeContext. |
|
7537 |
view isNil ifTrue:[^ nil]. |
|
7538 |
||
7539 |
p := view originRelativeTo:nil. |
|
7540 |
jP := (Java classForName:'java.awt.Point') newCleared. |
|
7541 |
jP instVarNamed:'x' put:p x. |
|
7542 |
jP instVarNamed:'y' put:p y. |
|
7543 |
^ jP |
|
7544 |
||
7545 |
"Modified: / 3.12.1998 / 21:16:05 / cg" |
|
440 | 7546 |
! |
7547 |
||
284 | 7548 |
_WComponentPeer_handleEvent:nativeContext |
7549 |
"this is invoked by java, to let a widget handle any event which |
|
7550 |
was not consumed (eaten) by java. |
|
7551 |
If the view in question is some ST-widget, forward it. |
|
7552 |
Ignore for JavaViews." |
|
7553 |
||
7554 |
|view jEv stEv| |
|
7555 |
||
7556 |
view := self viewForWPeer:nativeContext. |
|
7557 |
view notNil ifTrue:[ |
|
474 | 7558 |
jEv := nativeContext argAt:1. |
7559 |
stEv := jEv instVarNamed:'data'. |
|
7560 |
(stEv notNil and:[stEv ~~ 0]) ifTrue:[ |
|
7561 |
(view isKindOf:JavaView) ifFalse:[ |
|
316 | 7562 |
EventTrace == true ifTrue:[ |
7563 |
('JAVA: WComponent - handleEvent: ' , stEv type , ' for ' , view printString) infoPrintCR. |
|
7564 |
]. |
|
474 | 7565 |
view dispatchEvent:stEv. |
316 | 7566 |
^ self. |
7567 |
] |
|
7568 |
] |
|
7569 |
]. |
|
7570 |
EventTrace == true ifTrue:[ |
|
7571 |
('JAVA: WComponent - handleEvent ignored') infoPrintCR. |
|
7572 |
] |
|
284 | 7573 |
|
7574 |
"Created: / 6.1.1998 / 21:10:17 / cg" |
|
477 | 7575 |
"Modified: / 3.12.1998 / 00:36:33 / cg" |
284 | 7576 |
! |
7577 |
||
7578 |
_WComponentPeer_hide:nativeContext |
|
7579 |
|view| |
|
7580 |
||
7581 |
view := self viewForWPeer:nativeContext. |
|
7582 |
||
7583 |
Object errorSignal handle:[:ex | |
|
7584 |
] do:[ |
|
7585 |
view beInvisible |
|
7586 |
] |
|
7587 |
||
7588 |
"Created: / 7.1.1998 / 22:35:32 / cg" |
|
7589 |
"Modified: / 8.1.1998 / 17:33:08 / cg" |
|
7590 |
! |
|
7591 |
||
391 | 7592 |
_WComponentPeer_nativeHandleEvent:nativeContext |
7593 |
"this is invoked by java, to let a widget handle any event which |
|
7594 |
was not consumed (eaten) by java. |
|
7595 |
If the view in question is some ST-widget, forward it. |
|
7596 |
Ignore for JavaViews." |
|
7597 |
||
7598 |
|view jEv stEv| |
|
7599 |
||
7600 |
^self. |
|
7601 |
view := self viewForWPeer:nativeContext. |
|
7602 |
view notNil ifTrue:[ |
|
7603 |
(view isKindOf:JavaView) ifFalse:[ |
|
7604 |
jEv := nativeContext argAt:1. |
|
7605 |
stEv := jEv instVarNamed:'data'. |
|
7606 |
(stEv notNil and:[stEv ~~ 0]) ifTrue:[ |
|
7607 |
EventTrace == true ifTrue:[ |
|
7608 |
('JAVA: WComponent - handleEvent: ' , stEv type , ' for ' , view printString) infoPrintCR. |
|
7609 |
]. |
|
7610 |
stEv sendEventWithFocusOn:nil. |
|
7611 |
^ self. |
|
7612 |
] |
|
7613 |
] |
|
7614 |
]. |
|
7615 |
EventTrace == true ifTrue:[ |
|
7616 |
('JAVA: WComponent - handleEvent ignored') infoPrintCR. |
|
7617 |
] |
|
7618 |
||
7619 |
"Created: / 19.10.1998 / 21:26:16 / cg" |
|
7620 |
"Modified: / 19.10.1998 / 23:26:37 / cg" |
|
7621 |
! |
|
7622 |
||
284 | 7623 |
_WComponentPeer_requestFocus:nativeContext |
7624 |
|view| |
|
7625 |
||
7626 |
view := self viewForWPeer:nativeContext. |
|
318 | 7627 |
"/ 'getFocus - ' print. view displayString printCR. |
284 | 7628 |
|
7629 |
view getKeyboardFocus |
|
7630 |
||
7631 |
"Created: / 7.1.1998 / 22:30:03 / cg" |
|
318 | 7632 |
"Modified: / 6.2.1998 / 02:22:17 / cg" |
284 | 7633 |
! |
7634 |
||
7635 |
_WComponentPeer_reshape:nativeContext |
|
7636 |
self commonReshapeComponent:nativeContext |
|
7637 |
||
7638 |
"Modified: / 18.3.1997 / 19:30:21 / cg" |
|
7639 |
"Created: / 4.1.1998 / 18:01:11 / cg" |
|
7640 |
! |
|
7641 |
||
7642 |
_WComponentPeer_setCursor:nativeContext |
|
7643 |
|view| |
|
7644 |
||
7645 |
view := self viewForWPeer:nativeContext. |
|
7646 |
"/ self halt. |
|
7647 |
||
7648 |
"Created: / 5.1.1998 / 01:52:30 / cg" |
|
7649 |
"Modified: / 25.1.1998 / 01:21:52 / cg" |
|
7650 |
! |
|
7651 |
||
7652 |
_WComponentPeer_setFont:nativeContext |
|
7653 |
|view| |
|
7654 |
||
7655 |
view := self viewForWPeer:nativeContext. |
|
7656 |
"/ self halt. |
|
7657 |
||
7658 |
"Created: / 5.1.1998 / 00:55:17 / cg" |
|
7659 |
"Modified: / 25.1.1998 / 01:22:19 / cg" |
|
7660 |
! |
|
7661 |
||
7662 |
_WComponentPeer_setZOrderPosition:nativeContext |
|
7663 |
|view| |
|
7664 |
||
7665 |
view := self viewForWPeer:nativeContext. |
|
7666 |
"/ self unimplementedNativeMethod. |
|
7667 |
"/ self halt. |
|
7668 |
"/ self internalError:'breakPoint' |
|
7669 |
||
7670 |
"Created: / 4.1.1998 / 17:59:26 / cg" |
|
7671 |
"Modified: / 25.1.1998 / 01:22:32 / cg" |
|
7672 |
! |
|
7673 |
||
7674 |
_WComponentPeer_show:nativeContext |
|
7675 |
|view| |
|
7676 |
||
7677 |
view := self viewForWPeer:nativeContext. |
|
7678 |
||
7679 |
"/ frame views are under my browsers own control |
|
7680 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
7681 |
view beVisible. |
|
7682 |
view realize. |
|
7683 |
]. |
|
7684 |
||
7685 |
"/ view windowGroup notNil ifTrue:[ |
|
7686 |
"/ windowServer addGroup:(view windowGroup) |
|
7687 |
"/ ]. |
|
7688 |
||
7689 |
^ nil |
|
7690 |
||
7691 |
"/ self halt. |
|
7692 |
||
7693 |
"Created: / 5.1.1998 / 01:26:22 / cg" |
|
7694 |
"Modified: / 25.1.1998 / 09:54:07 / cg" |
|
7695 |
! |
|
7696 |
||
7697 |
_WComponentPeer_start:nativeContext |
|
7698 |
"/ self halt. |
|
7699 |
||
7700 |
"Modified: / 18.3.1997 / 18:43:18 / cg" |
|
7701 |
"Created: / 5.1.1998 / 00:58:40 / cg" |
|
7702 |
! |
|
7703 |
||
7704 |
_WDefaultFontCharset_canConvert:nativeContext |
|
7705 |
^ 1 |
|
7706 |
||
7707 |
"Modified: / 21.8.1997 / 15:56:57 / cg" |
|
7708 |
"Created: / 5.1.1998 / 01:55:47 / cg" |
|
7709 |
! |
|
7710 |
||
7711 |
_WDialogPeer__hide:nativeContext |
|
7712 |
|dialog| |
|
7713 |
||
7714 |
dialog := self viewForWPeer:nativeContext. |
|
7715 |
||
7716 |
dialog hide. |
|
7717 |
||
7718 |
"Created: / 7.1.1998 / 22:34:10 / cg" |
|
7719 |
"Modified: / 8.1.1998 / 17:34:10 / cg" |
|
7720 |
! |
|
7721 |
||
7722 |
_WDialogPeer__show:nativeContext |
|
7723 |
|dialog| |
|
7724 |
||
7725 |
dialog := self viewForWPeer:nativeContext. |
|
7726 |
"/ |
|
7727 |
"/ show does not work (yet); must setup windowgroup |
|
7728 |
"/ for it to get events ... |
|
480 | 7729 |
"/ dialog realize. |
7730 |
||
7731 |
dialog show. |
|
284 | 7732 |
|
7733 |
"Created: / 7.1.1998 / 21:52:15 / cg" |
|
480 | 7734 |
"Modified: / 3.12.1998 / 20:40:05 / cg" |
284 | 7735 |
! |
7736 |
||
7737 |
_WDialogPeer_create:nativeContext |
|
7738 |
|jDialogPeer dialog| |
|
7739 |
||
7740 |
jDialogPeer := nativeContext receiver. |
|
7741 |
||
7742 |
dialog := ModalBox new. |
|
7743 |
jDialogPeer instVarNamed:'pData' put:dialog. |
|
7744 |
||
7745 |
self createdWindowsView:dialog for:jDialogPeer. |
|
7746 |
dialog windowGroup:JavaWindowGroup. |
|
7747 |
JavaWindowGroup addTopView:dialog. |
|
7748 |
||
7749 |
WindowCreationTrace == true ifTrue:[ |
|
7750 |
'WDialogPeer_create: ' print. dialog printNL. |
|
7751 |
]. |
|
7752 |
||
7753 |
"Created: / 7.1.1998 / 21:51:00 / cg" |
|
7754 |
"Modified: / 15.1.1998 / 16:12:44 / cg" |
|
7755 |
! |
|
7756 |
||
440 | 7757 |
_WDrawingSurfaceInfo_getDepth:nativeContext |
7758 |
"/ int getDepth () |
|
7759 |
UnimplementedNativeMethodSignal raise |
|
7760 |
||
7761 |
"Created: / 12.11.1998 / 19:21:00 / cg" |
|
7762 |
! |
|
7763 |
||
7764 |
_WDrawingSurfaceInfo_getHBitmap:nativeContext |
|
7765 |
"/ int getHBitmap () |
|
7766 |
UnimplementedNativeMethodSignal raise |
|
7767 |
||
7768 |
"Created: / 12.11.1998 / 19:20:32 / cg" |
|
7769 |
! |
|
7770 |
||
7771 |
_WDrawingSurfaceInfo_getHDC:nativeContext |
|
7772 |
"/ int getHDC () |
|
7773 |
UnimplementedNativeMethodSignal raise |
|
7774 |
||
7775 |
"Created: / 12.11.1998 / 19:20:50 / cg" |
|
7776 |
! |
|
7777 |
||
7778 |
_WDrawingSurfaceInfo_getHPalette:nativeContext |
|
7779 |
"/ int getHPalette () |
|
7780 |
UnimplementedNativeMethodSignal raise |
|
7781 |
||
7782 |
"Created: / 12.11.1998 / 19:21:07 / cg" |
|
7783 |
! |
|
7784 |
||
7785 |
_WDrawingSurfaceInfo_getHWnd:nativeContext |
|
7786 |
"/ int getHWnd () |
|
7787 |
UnimplementedNativeMethodSignal raise |
|
7788 |
||
7789 |
"Created: / 12.11.1998 / 19:20:23 / cg" |
|
7790 |
! |
|
7791 |
||
7792 |
_WDrawingSurfaceInfo_getPBits:nativeContext |
|
7793 |
"/ int getPBits () |
|
7794 |
UnimplementedNativeMethodSignal raise |
|
7795 |
||
7796 |
"Created: / 12.11.1998 / 19:20:41 / cg" |
|
7797 |
! |
|
7798 |
||
7799 |
_WDrawingSurfaceInfo_lock:nativeContext |
|
7800 |
"/ int lock () |
|
7801 |
UnimplementedNativeMethodSignal raise |
|
7802 |
||
7803 |
"Created: / 12.11.1998 / 19:20:00 / cg" |
|
7804 |
! |
|
7805 |
||
7806 |
_WDrawingSurfaceInfo_unlock:nativeContext |
|
7807 |
"/ void unlock () |
|
7808 |
UnimplementedNativeMethodSignal raise |
|
7809 |
||
7810 |
"Created: / 12.11.1998 / 19:20:13 / cg" |
|
7811 |
! |
|
7812 |
||
7813 |
_WEmbeddedFramePeer_create:nativeContext |
|
7814 |
"/ void create (sun.awt.windows.WComponentPeer) |
|
7815 |
UnimplementedNativeMethodSignal raise |
|
7816 |
||
7817 |
"Created: / 12.11.1998 / 19:16:09 / cg" |
|
7818 |
! |
|
7819 |
||
284 | 7820 |
_WFileDialogPeer_show:nativeContext |
7821 |
|jDialogPeer jDialog dialogView stDialog |
|
7822 |
title dir pattern f| |
|
7823 |
||
7824 |
jDialogPeer := nativeContext receiver. |
|
7825 |
jDialog := jDialogPeer instVarNamed:'target'. |
|
7826 |
dialogView := jDialogPeer instVarNamed:'pData'. |
|
7827 |
||
7828 |
stDialog := FileSelectionBox new. |
|
7829 |
||
7830 |
dir := jDialog instVarNamed:'dir'. |
|
7831 |
dir notNil ifTrue:[ |
|
7832 |
stDialog directory:(Java as_ST_String:dir). |
|
7833 |
]. |
|
7834 |
pattern := jDialog instVarNamed:'file'. |
|
7835 |
pattern notNil ifTrue:[ |
|
7836 |
stDialog pattern:(Java as_ST_String:pattern). |
|
7837 |
]. |
|
7838 |
title := jDialog instVarNamed:'title'. |
|
7839 |
title notNil ifTrue:[ |
|
7840 |
stDialog title:(Java as_ST_String:title). |
|
7841 |
stDialog label:(Java as_ST_String:title). |
|
7842 |
]. |
|
7843 |
||
7844 |
stDialog show. |
|
7845 |
||
7846 |
stDialog accepted ifTrue:[ |
|
7847 |
f := stDialog pathName. |
|
7848 |
||
7849 |
"/ cannot use the one below - it has a builtIn fileSeparator if '\' (sigh) |
|
7850 |
"/ jDialogPeer perform:#'handleSelected(Ljava/lang/String;)V' with:(Java as_String:f). |
|
7851 |
||
7852 |
jDialog |
|
7853 |
perform:#'setFile(Ljava/lang/String;)V' |
|
7854 |
with:(Java as_String:(f asFilename baseName)). |
|
7855 |
jDialog |
|
7856 |
perform:#'setDirectory(Ljava/lang/String;)V' |
|
7857 |
with:(Java as_String:(f asFilename directoryName , Filename separator asString)). |
|
7858 |
jDialog |
|
7859 |
perform:#'setVisible(Z)V' |
|
7860 |
with:0. |
|
7861 |
] ifFalse:[ |
|
7862 |
jDialogPeer |
|
7863 |
perform:#'handleCancel()V' |
|
7864 |
]. |
|
7865 |
"/ self halt. |
|
7866 |
||
7867 |
"Created: / 7.1.1998 / 22:38:45 / cg" |
|
7868 |
"Modified: / 15.1.1998 / 13:04:05 / cg" |
|
7869 |
! |
|
7870 |
||
440 | 7871 |
_WFontMetrics_bytesWidth:nativeContext |
7872 |
"/ int bytesWidth (byte[] int int) |
|
7873 |
UnimplementedNativeMethodSignal raise |
|
7874 |
||
7875 |
"Created: / 12.11.1998 / 19:11:46 / cg" |
|
7876 |
! |
|
7877 |
||
284 | 7878 |
_WFontMetrics_getMFCharSegmentWidth:nativeContext |
7879 |
"get multi-font string-segment width. |
|
7880 |
Not yet supported - use standard strings width" |
|
7881 |
||
7882 |
|jMetrics jFont jFontDescr stFont w |
|
7883 |
bool1 cp offs lenght bp int1| |
|
7884 |
||
7885 |
jMetrics := nativeContext receiver. |
|
7886 |
jFont := nativeContext argAt:1. |
|
7887 |
jFontDescr := nativeContext argAt:2. |
|
7888 |
bool1 := nativeContext argAt:3. |
|
7889 |
cp := nativeContext argAt:4. |
|
7890 |
offs := nativeContext argAt:5. |
|
7891 |
lenght := nativeContext argAt:6. |
|
7892 |
bp := nativeContext argAt:7. |
|
7893 |
int1 := nativeContext argAt:8. |
|
7894 |
||
7895 |
stFont := jFont instVarNamed:'pData'. |
|
7896 |
(stFont isNil or:[stFont == 0]) ifTrue:[ |
|
7897 |
self halt |
|
7898 |
]. |
|
7899 |
||
7900 |
stFont device isNil ifTrue:[ |
|
7901 |
stFont := stFont on:Display. |
|
7902 |
jFont instVarNamed:'pData' put:stFont. |
|
7903 |
]. |
|
7904 |
w := stFont widthOf:cp from:offs+1 to:offs+lenght. |
|
7905 |
^ w. |
|
7906 |
||
7907 |
"Created: / 5.1.1998 / 01:57:45 / cg" |
|
7908 |
"Modified: / 13.1.1998 / 23:44:03 / cg" |
|
7909 |
! |
|
7910 |
||
7911 |
_WFontMetrics_init:nativeContext |
|
7912 |
|jMetrics jFont stFont widths family name style size| |
|
7913 |
||
7914 |
jMetrics := nativeContext receiver. |
|
7915 |
jFont := jMetrics instVarNamed:'font'. |
|
7916 |
||
7917 |
family := jFont instVarNamed:'family'. |
|
7918 |
family := Java as_ST_String:family. |
|
7919 |
||
7920 |
name := jFont instVarNamed:'name'. |
|
7921 |
name := Java as_ST_String:name. |
|
7922 |
||
7923 |
style := jFont instVarNamed:'style'. |
|
7924 |
size := jFont instVarNamed:'size'. |
|
7925 |
||
7926 |
stFont := Font family:family size:size. |
|
7927 |
stFont isNil ifTrue:[ |
|
7928 |
stFont := Font family:'helvetica' size:size. |
|
7929 |
]. |
|
7930 |
stFont := stFont on:Display. |
|
7931 |
||
7932 |
"/ stFont := jFont instVarNamed:'pData'. |
|
7933 |
"/ stFont isNil ifTrue:[ |
|
7934 |
"/ self halt |
|
7935 |
"/ ]. |
|
7936 |
||
7937 |
stFont := stFont on:Display. |
|
7938 |
jFont instVarNamed:'pData' put:stFont. |
|
7939 |
||
7940 |
jMetrics instVarNamed:'ascent' put:stFont ascent. |
|
7941 |
jMetrics instVarNamed:'descent' put:stFont descent. |
|
7942 |
jMetrics instVarNamed:'leading' put:0. |
|
7943 |
jMetrics instVarNamed:'height' put:stFont height. |
|
7944 |
jMetrics instVarNamed:'maxAscent' put:stFont maxAscent. |
|
7945 |
jMetrics instVarNamed:'maxDescent' put:stFont maxDescent. |
|
7946 |
jMetrics instVarNamed:'maxHeight' put:stFont maxHeight. |
|
7947 |
jMetrics instVarNamed:'maxAdvance' put:stFont maxWidth. |
|
7948 |
||
7949 |
widths := Array new:256. |
|
7950 |
0 to:255 do:[:i | |
|
7951 |
widths at:(i+1) put:(stFont widthOf:(Character value:i)) |
|
7952 |
]. |
|
7953 |
jMetrics instVarNamed:'widths' put:widths. |
|
7954 |
"/ self halt. |
|
7955 |
||
7956 |
"Modified: / 8.8.1997 / 12:06:53 / cg" |
|
7957 |
"Created: / 5.1.1998 / 01:54:29 / cg" |
|
7958 |
! |
|
7959 |
||
7960 |
_WFontMetrics_needsConversion:nativeContext |
|
7961 |
|jFont jFontDescr stFont| |
|
7962 |
||
7963 |
jFont := nativeContext argAt:1. |
|
7964 |
jFontDescr := nativeContext argAt:2. |
|
7965 |
||
7966 |
stFont := jFont instVarNamed:'pData'. |
|
7967 |
"/ stFont isNil ifTrue:[ |
|
7968 |
"/ self halt |
|
7969 |
"/ ]. |
|
7970 |
"/ stFont device isNil ifTrue:[ |
|
7971 |
"/ stFont := stFont on:Display. |
|
7972 |
"/ jFont instVarNamed:'pData' put:stFont. |
|
7973 |
"/ ]. |
|
7974 |
"/ |
|
7975 |
||
7976 |
^ 0 |
|
7977 |
||
7978 |
"Modified: / 17.8.1997 / 17:16:29 / cg" |
|
7979 |
"Created: / 5.1.1998 / 01:56:42 / cg" |
|
7980 |
! |
|
7981 |
||
341 | 7982 |
_WFramePeer__setIconImage:nativeContext |
7983 |
|frame imgRep image| |
|
7984 |
||
7985 |
frame := self viewForWPeer:nativeContext. |
|
7986 |
imgRep := nativeContext argAt:1. |
|
7987 |
imgRep notNil ifTrue:[ |
|
7988 |
image := imgRep instVarNamed:'pData'. |
|
7989 |
image notNil ifTrue:[ |
|
7990 |
frame icon:image. |
|
7991 |
] |
|
7992 |
]. |
|
7993 |
||
7994 |
"Created: / 27.4.1998 / 17:15:09 / cg" |
|
7995 |
"Modified: / 27.4.1998 / 17:18:24 / cg" |
|
7996 |
! |
|
7997 |
||
284 | 7998 |
_WFramePeer_create:nativeContext |
474 | 7999 |
|jFramePeer jFrame top frame pDataIdx| |
284 | 8000 |
|
8001 |
jFramePeer := nativeContext receiver. |
|
8002 |
||
8003 |
"/ for now: a kludge to create an embedded frame for |
|
8004 |
"/ mozillaFrames |
|
8005 |
||
8006 |
jFrame := jFramePeer instVarNamed:'target'. |
|
8007 |
(jFrame notNil |
|
8008 |
and:[(pDataIdx := jFrame class instVarOffsetOf:'pData') notNil]) |
|
8009 |
ifTrue:[ |
|
8010 |
((frame := jFrame instVarAt:pDataIdx) notNil |
|
8011 |
and:[frame ~~ 0]) ifTrue:[ |
|
318 | 8012 |
WindowCreationTrace == true ifTrue:[ |
8013 |
'JAVA: targetFrame view already created: ' infoPrintCR. |
|
8014 |
]. |
|
284 | 8015 |
"/ sigh; pData was renamed to pNativeWidget in jdk1.2 ... |
8016 |
pDataIdx := jFramePeer class instVarOffsetOf:'pNativeWidget'. |
|
8017 |
pDataIdx isNil ifTrue:[ |
|
8018 |
"/ ok, we are < 1.2 |
|
8019 |
pDataIdx := jFramePeer class instVarOffsetOf:'pData'. |
|
8020 |
]. |
|
8021 |
jFramePeer instVarAt:pDataIdx put:frame. |
|
8022 |
] |
|
8023 |
] ifFalse:[ |
|
8024 |
frame := jFramePeer instVarNamed:'pData' |
|
8025 |
]. |
|
8026 |
||
8027 |
(frame notNil and:[frame ~~ 0]) ifTrue:[ |
|
318 | 8028 |
WindowCreationTrace == true ifTrue:[ |
8029 |
'JAVA: frame view already created: ' infoPrint. |
|
8030 |
jFramePeer class name infoPrintCR. |
|
8031 |
]. |
|
284 | 8032 |
] ifFalse:[ |
474 | 8033 |
"/ OLD |
8034 |
"/ frame := StandardSystemView new. |
|
8035 |
"/ self createdWindowsView:frame for:jFramePeer. |
|
8036 |
"/ JavaWindowGroup addTopView:frame. |
|
8037 |
||
8038 |
frame := JavaTopView new. |
|
8039 |
frame delegate:self. |
|
8040 |
frame javaPeer:jFramePeer. |
|
284 | 8041 |
self createdWindowsView:frame for:jFramePeer. |
8042 |
JavaWindowGroup addTopView:frame. |
|
474 | 8043 |
|
8044 |
"/ top := StandardSystemView new. |
|
8045 |
"/ frame := JavaView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
8046 |
"/ frame delegate:self. |
|
8047 |
"/ frame javaPeer:jFramePeer. |
|
8048 |
"/ self createdWindowsView:frame for:jFramePeer. |
|
8049 |
"/ JavaWindowGroup addTopView:top. |
|
8050 |
||
284 | 8051 |
]. |
8052 |
||
8053 |
WindowCreationTrace == true ifTrue:[ |
|
8054 |
'JAVA: WFramePeer_create: ' print. jFramePeer displayString print. |
|
8055 |
' frame: ' print. frame printNL. |
|
8056 |
]. |
|
8057 |
||
8058 |
"Created: / 4.1.1998 / 17:56:39 / cg" |
|
474 | 8059 |
"Modified: / 3.12.1998 / 00:10:21 / cg" |
284 | 8060 |
! |
8061 |
||
8062 |
_WFramePeer_setMenuBar0:nativeContext |
|
8063 |
|frame jMenuBarPeer menuPanel| |
|
8064 |
||
8065 |
frame := self viewForWPeer:nativeContext. |
|
8066 |
||
8067 |
jMenuBarPeer := nativeContext argAt:1. |
|
8068 |
jMenuBarPeer isNil ifTrue:[ |
|
8069 |
"/ mhmh - JAVA wants to remove the frames menuPanel. |
|
8070 |
"/ but I have no handle on it (for destroy). |
|
8071 |
"/ search it in subViews of the frame. |
|
8072 |
frame subViews copy do:[:v | |
|
8073 |
(v isKindOf:MenuPanel) ifTrue:[ |
|
8074 |
v destroy |
|
8075 |
] |
|
8076 |
] |
|
8077 |
] ifFalse:[ |
|
8078 |
menuPanel := jMenuBarPeer instVarNamed:'pData'. |
|
8079 |
||
8080 |
menuPanel origin:0.0@0.0 corner:1.0@(menuPanel preferredExtent y). |
|
8081 |
frame addSubView:menuPanel. |
|
8082 |
]. |
|
8083 |
^ nil |
|
8084 |
||
8085 |
"Created: / 7.1.1998 / 21:41:35 / cg" |
|
8086 |
"Modified: / 8.1.1998 / 17:35:04 / cg" |
|
8087 |
! |
|
8088 |
||
440 | 8089 |
_WGraphics__dispose:nativeContext |
8090 |
"/ void _dispose() |
|
8091 |
UnimplementedNativeMethodSignal raise |
|
8092 |
||
8093 |
"Created: / 12.11.1998 / 19:17:51 / cg" |
|
8094 |
! |
|
8095 |
||
284 | 8096 |
_WGraphics_changeClip:nativeContext |
391 | 8097 |
|gc x y w h r bool| |
284 | 8098 |
|
8099 |
gc := self gcForWGraphics:nativeContext. |
|
8100 |
||
8101 |
x := nativeContext argAt:1. |
|
8102 |
y := nativeContext argAt:2. |
|
8103 |
w := nativeContext argAt:3. |
|
8104 |
h := nativeContext argAt:4. |
|
8105 |
bool := (nativeContext argAt:5) ~~ 0. |
|
8106 |
||
391 | 8107 |
r := Rectangle left:x top:y width:w height:h. |
401 | 8108 |
"/ 'WGraphics_changeClip: ' infoPrint. r infoPrintCR. |
391 | 8109 |
gc clippingRectangle:r. |
284 | 8110 |
|
8111 |
"Created: / 6.1.1998 / 20:57:21 / cg" |
|
401 | 8112 |
"Modified: / 20.10.1998 / 19:40:10 / cg" |
284 | 8113 |
! |
8114 |
||
8115 |
_WGraphics_clearRect:nativeContext |
|
8116 |
|gc x y w h| |
|
8117 |
||
8118 |
gc := self gcForWGraphics:nativeContext. |
|
8119 |
"/ gc isNil ifTrue:[^ self]. |
|
8120 |
||
8121 |
gc realized ifFalse:[ |
|
8122 |
'JAVA: drawing on unrealized gc - ignored' infoPrintCR. |
|
8123 |
^ self |
|
8124 |
]. |
|
8125 |
||
8126 |
x := nativeContext argAt:1. |
|
8127 |
y := nativeContext argAt:2. |
|
8128 |
w := nativeContext argAt:3. |
|
8129 |
h := nativeContext argAt:4. |
|
8130 |
||
8131 |
"/ self halt. |
|
8132 |
"/ self internalError:'breakPoint'. |
|
8133 |
||
8134 |
gc clearRectangleX:x y:y width:w height:h. |
|
8135 |
||
8136 |
"Created: / 8.1.1998 / 00:16:00 / cg" |
|
8137 |
"Modified: / 8.1.1998 / 00:21:09 / cg" |
|
8138 |
! |
|
8139 |
||
440 | 8140 |
_WGraphics_close:nativeContext |
8141 |
"/ void close (sun.awt.windows.WPrintJob) |
|
8142 |
UnimplementedNativeMethodSignal raise |
|
8143 |
||
8144 |
"Created: / 12.11.1998 / 19:19:40 / cg" |
|
8145 |
! |
|
8146 |
||
337 | 8147 |
_WGraphics_copyArea:nativeContext |
8148 |
|gc srcX srcY w h deltaX deltaY| |
|
8149 |
||
8150 |
gc := self gcForWGraphics:nativeContext. |
|
8151 |
"/ gc isNil ifTrue:[^ self]. |
|
8152 |
||
8153 |
gc realized ifFalse:[ |
|
8154 |
'JAVA: copyArea on unrealized gc - ignored' infoPrintCR. |
|
8155 |
^ self |
|
8156 |
]. |
|
8157 |
||
8158 |
srcX := nativeContext argAt:1. |
|
8159 |
srcY := nativeContext argAt:2. |
|
8160 |
w := nativeContext argAt:3. |
|
8161 |
h := nativeContext argAt:4. |
|
8162 |
deltaX := nativeContext argAt:5. |
|
8163 |
deltaY := nativeContext argAt:6. |
|
8164 |
||
8165 |
gc |
|
8166 |
copyFrom:gc |
|
8167 |
x:srcX y:srcY |
|
8168 |
toX:srcX+deltaX y:srcY+deltaY |
|
8169 |
width:w height:h |
|
8170 |
||
8171 |
"Created: / 8.1.1998 / 00:16:00 / cg" |
|
8172 |
"Modified: / 9.4.1998 / 22:01:32 / cg" |
|
8173 |
! |
|
8174 |
||
284 | 8175 |
_WGraphics_createFromComponent:nativeContext |
8176 |
|jGraphics jWin view| |
|
8177 |
||
8178 |
jGraphics := nativeContext receiver. |
|
8179 |
jWin := nativeContext argAt:1. |
|
8180 |
||
8181 |
view := KnownWindows at:jWin ifAbsent:nil. |
|
8182 |
view isNil ifTrue:[ |
|
401 | 8183 |
self halt. |
8184 |
^ self |
|
8185 |
]. |
|
8186 |
view clippingRectangle:nil. |
|
284 | 8187 |
|
8188 |
"/ "/ just a consistency check ... |
|
8189 |
"/ (jWin instVarNamed:'xid') ~~ view ifTrue:[ |
|
8190 |
"/ self halt:'consistency check' |
|
8191 |
"/ ]. |
|
8192 |
||
8193 |
jGraphics instVarNamed:'pData' put:view. |
|
8194 |
||
8195 |
"Created: / 6.1.1998 / 20:55:18 / cg" |
|
401 | 8196 |
"Modified: / 20.10.1998 / 19:38:18 / cg" |
284 | 8197 |
! |
8198 |
||
8199 |
_WGraphics_createFromGraphics:nativeContext |
|
8200 |
|jGraphics graphics gc| |
|
8201 |
||
8202 |
jGraphics := nativeContext receiver. |
|
8203 |
graphics := nativeContext argAt:1. |
|
8204 |
gc := graphics instVarNamed:'pData'. |
|
8205 |
||
8206 |
jGraphics instVarNamed:'pData' put:gc. |
|
401 | 8207 |
gc clippingRectangle:nil. |
284 | 8208 |
|
8209 |
"Created: / 8.1.1998 / 00:47:39 / cg" |
|
401 | 8210 |
"Modified: / 20.10.1998 / 19:37:58 / cg" |
284 | 8211 |
! |
8212 |
||
440 | 8213 |
_WGraphics_createFromHDC:nativeContext |
8214 |
"/ void createFromHDC (int) |
|
8215 |
UnimplementedNativeMethodSignal raise |
|
8216 |
||
8217 |
"Created: / 12.11.1998 / 19:17:32 / cg" |
|
8218 |
! |
|
8219 |
||
8220 |
_WGraphics_createFromPrintJob:nativeContext |
|
8221 |
"/ void createFromPrintJob (sun.awt.windows.WPrintJob) |
|
8222 |
UnimplementedNativeMethodSignal raise |
|
8223 |
||
8224 |
"Created: / 12.11.1998 / 19:17:20 / cg" |
|
8225 |
! |
|
8226 |
||
284 | 8227 |
_WGraphics_dispose:nativeContext |
8228 |
|gc| |
|
8229 |
||
8230 |
gc := self gcForWGraphics:nativeContext. |
|
8231 |
gc isNil ifTrue:[^ self]. |
|
401 | 8232 |
gc clippingRectangle:nil. |
284 | 8233 |
|
8234 |
"Created: / 6.1.1998 / 20:58:38 / cg" |
|
401 | 8235 |
"Modified: / 20.10.1998 / 19:35:05 / cg" |
284 | 8236 |
! |
8237 |
||
8238 |
_WGraphics_drawArc:nativeContext |
|
8239 |
|gc x y w h startAngle endAngle| |
|
8240 |
||
8241 |
gc := self gcForWGraphics:nativeContext. |
|
8242 |
"/ gc isNil ifTrue:[^ self]. |
|
8243 |
gc realized ifFalse:[^ self]. |
|
8244 |
||
8245 |
x := nativeContext argAt:1. |
|
8246 |
y := nativeContext argAt:2. |
|
8247 |
w := nativeContext argAt:3. |
|
8248 |
h := nativeContext argAt:4. |
|
8249 |
startAngle := nativeContext argAt:5. |
|
8250 |
endAngle := nativeContext argAt:6. |
|
8251 |
||
8252 |
DrawOPTrace ifTrue:[ |
|
285 | 8253 |
'drawArc x/y= ' print. x print. '@' print. y print. |
8254 |
' w/h= ' print. w print. '@' print. h print. |
|
8255 |
' startAngle= ' print. startAngle print. ' endAngle= ' print. endAngle printCR. |
|
8256 |
]. |
|
8257 |
gc |
|
8258 |
displayArcX:x y:y |
|
8259 |
width:w height:h |
|
8260 |
from:startAngle angle:(endAngle - startAngle). |
|
284 | 8261 |
|
8262 |
"Created: / 6.1.1998 / 21:00:15 / cg" |
|
285 | 8263 |
"Modified: / 28.1.1998 / 23:23:42 / cg" |
284 | 8264 |
! |
8265 |
||
440 | 8266 |
_WGraphics_drawBytes:nativeContext |
8267 |
"/ void drawBytes (byte[] int int int int) |
|
8268 |
UnimplementedNativeMethodSignal raise |
|
8269 |
||
8270 |
"Created: / 12.11.1998 / 19:18:56 / cg" |
|
8271 |
! |
|
8272 |
||
284 | 8273 |
_WGraphics_drawLine:nativeContext |
8274 |
|gc x y x2 y2| |
|
8275 |
||
8276 |
gc := self gcForWGraphics:nativeContext. |
|
8277 |
"/ gc isNil ifTrue:[^ self]. |
|
8278 |
gc realized ifFalse:[^ self]. |
|
8279 |
||
8280 |
x := nativeContext argAt:1. |
|
8281 |
y := nativeContext argAt:2. |
|
8282 |
x2 := nativeContext argAt:3. |
|
8283 |
y2 := nativeContext argAt:4. |
|
8284 |
||
8285 |
DrawOPTrace ifTrue:[ |
|
8286 |
'drawLine x/y= ' print. x print. '@' print. y print. ' x2/y2= ' print. x2 print. '@' print. y2 printCR. |
|
8287 |
]. |
|
8288 |
gc displayLineFromX:x y:y toX:x2 y:y2 |
|
8289 |
||
8290 |
"Created: / 6.1.1998 / 20:59:27 / cg" |
|
8291 |
"Modified: / 8.1.1998 / 00:34:23 / cg" |
|
8292 |
! |
|
8293 |
||
440 | 8294 |
_WGraphics_drawMFCharsConvertedSegment:nativeContext |
8295 |
"/ int drawMFCharsConvertedSegment (java.awt.Font sun.awt.FontDescriptor byte[] int int int) |
|
8296 |
UnimplementedNativeMethodSignal raise |
|
8297 |
||
8298 |
"Created: / 12.11.1998 / 19:18:44 / cg" |
|
8299 |
! |
|
8300 |
||
284 | 8301 |
_WGraphics_drawMFCharsSegment:nativeContext |
8302 |
|jFont jFontDescr s gc x y offs len| |
|
8303 |
||
8304 |
gc := self gcForWGraphics:nativeContext. |
|
8305 |
gc realized ifFalse:[^ self]. |
|
8306 |
||
8307 |
jFont := nativeContext argAt:1. |
|
8308 |
jFontDescr := nativeContext argAt:2. |
|
8309 |
s := nativeContext argAt:3. |
|
8310 |
offs := nativeContext argAt:4. |
|
8311 |
len := nativeContext argAt:5. |
|
8312 |
x := nativeContext argAt:6. |
|
8313 |
y := nativeContext argAt:7. |
|
8314 |
||
8315 |
DrawOPTrace ifTrue:[ |
|
8316 |
'drawMFCharsSegment x/y= ' print. x print. '@' print. y print. ' s= ' print. s printCR. |
|
8317 |
]. |
|
8318 |
gc displayString:s from:offs+1 to:offs+len x:x y:y. |
|
8319 |
^ (gc font onDevice:(gc graphicsDevice)) widthOf:s. |
|
8320 |
||
8321 |
"Created: / 6.1.1998 / 21:01:07 / cg" |
|
8322 |
"Modified: / 25.1.1998 / 20:45:55 / cg" |
|
8323 |
! |
|
8324 |
||
8325 |
_WGraphics_drawOval:nativeContext |
|
8326 |
|gc x y w h| |
|
8327 |
||
8328 |
gc := self gcForWGraphics:nativeContext. |
|
8329 |
"/ gc isNil ifTrue:[^ self]. |
|
8330 |
gc realized ifFalse:[^ self]. |
|
8331 |
||
8332 |
x := nativeContext argAt:1. |
|
8333 |
y := nativeContext argAt:2. |
|
8334 |
w := nativeContext argAt:3. |
|
8335 |
h := nativeContext argAt:4. |
|
8336 |
||
337 | 8337 |
DrawOPTrace ifTrue:[ |
285 | 8338 |
'drawOval x/y= ' print. x print. '@' print. y print. |
8339 |
' w/h= ' print. w print. '@' print. h printCR. |
|
8340 |
]. |
|
8341 |
gc displayArcX:x y:y width:w height:h from:0 angle:360. |
|
284 | 8342 |
|
8343 |
"Created: / 8.1.1998 / 00:44:31 / cg" |
|
337 | 8344 |
"Modified: / 9.4.1998 / 22:10:23 / cg" |
284 | 8345 |
! |
8346 |
||
8347 |
_WGraphics_drawPolygon:nativeContext |
|
8348 |
|gc xVector yVector count points| |
|
8349 |
||
8350 |
gc := self gcForWGraphics:nativeContext. |
|
8351 |
"/ gc isNil ifTrue:[^ self]. |
|
8352 |
gc realized ifFalse:[^ self]. |
|
8353 |
||
8354 |
xVector := nativeContext argAt:1. |
|
8355 |
yVector := nativeContext argAt:2. |
|
8356 |
count := nativeContext argAt:3. |
|
8357 |
||
8358 |
DrawOPTrace ifTrue:[ |
|
8359 |
'drawPolgon' printCR. |
|
8360 |
]. |
|
8361 |
||
8362 |
points := (1 to:count) collect:[:i | (xVector at:i) @ (yVector at:i)]. |
|
8363 |
gc displayPolygon:points |
|
8364 |
||
8365 |
"Created: / 8.1.1998 / 00:57:28 / cg" |
|
8366 |
"Modified: / 8.1.1998 / 00:57:49 / cg" |
|
8367 |
! |
|
8368 |
||
440 | 8369 |
_WGraphics_drawPolyline:nativeContext |
8370 |
"/ void drawPolyline (int[] int[] int) |
|
8371 |
UnimplementedNativeMethodSignal raise |
|
8372 |
||
8373 |
"Created: / 12.11.1998 / 19:19:07 / cg" |
|
8374 |
! |
|
8375 |
||
284 | 8376 |
_WGraphics_drawRect:nativeContext |
8377 |
|gc x y w h| |
|
8378 |
||
8379 |
gc := self gcForWGraphics:nativeContext. |
|
8380 |
"/ gc isNil ifTrue:[^ self]. |
|
8381 |
gc realized ifFalse:[^ self]. |
|
8382 |
||
8383 |
x := nativeContext argAt:1. |
|
8384 |
y := nativeContext argAt:2. |
|
8385 |
w := nativeContext argAt:3. |
|
8386 |
h := nativeContext argAt:4. |
|
8387 |
||
8388 |
"/ self halt. |
|
8389 |
"/ self internalError:'breakPoint'. |
|
8390 |
||
8391 |
gc displayRectangleX:x y:y width:w height:h. |
|
8392 |
||
8393 |
"Modified: / 8.1.1998 / 00:34:33 / cg" |
|
8394 |
"Created: / 8.1.1998 / 00:59:05 / cg" |
|
8395 |
! |
|
8396 |
||
8397 |
_WGraphics_drawRoundRect:nativeContext |
|
8398 |
|gc x y w h| |
|
8399 |
||
8400 |
gc := self gcForWGraphics:nativeContext. |
|
8401 |
"/ gc isNil ifTrue:[^ self]. |
|
8402 |
gc realized ifFalse:[^ self]. |
|
8403 |
||
8404 |
x := nativeContext argAt:1. |
|
8405 |
y := nativeContext argAt:2. |
|
8406 |
w := nativeContext argAt:3. |
|
8407 |
h := nativeContext argAt:4. |
|
8408 |
||
8409 |
"/ self halt. |
|
8410 |
"/ self internalError:'breakPoint'. |
|
8411 |
||
8412 |
gc displayRectangleX:x y:y width:w height:h. |
|
8413 |
||
8414 |
"Modified: / 8.1.1998 / 00:34:33 / cg" |
|
8415 |
"Created: / 8.1.1998 / 00:59:26 / cg" |
|
8416 |
! |
|
8417 |
||
440 | 8418 |
_WGraphics_drawSFChars:nativeContext |
8419 |
"/ void drawSFChars (char[] int int int int) |
|
8420 |
UnimplementedNativeMethodSignal raise |
|
8421 |
||
8422 |
"Created: / 12.11.1998 / 19:18:20 / cg" |
|
8423 |
! |
|
8424 |
||
284 | 8425 |
_WGraphics_fillArc:nativeContext |
8426 |
|gc x y w h startAngle endAngle| |
|
8427 |
||
8428 |
gc := self gcForWGraphics:nativeContext. |
|
8429 |
"/ gc isNil ifTrue:[^ self]. |
|
8430 |
gc realized ifFalse:[^ self]. |
|
8431 |
||
8432 |
x := nativeContext argAt:1. |
|
8433 |
y := nativeContext argAt:2. |
|
8434 |
w := nativeContext argAt:3. |
|
8435 |
h := nativeContext argAt:4. |
|
8436 |
startAngle := nativeContext argAt:5. |
|
8437 |
endAngle := nativeContext argAt:6. |
|
8438 |
||
8439 |
DrawOPTrace ifTrue:[ |
|
8440 |
'fillArc x/y= ' print. x print. '@' print. y print. |
|
8441 |
' w/h= ' print. w print. '@' print. h print. |
|
8442 |
' startAngle= ' print. startAngle print. ' endAngle= ' print. endAngle printCR. |
|
8443 |
]. |
|
8444 |
gc fillArcX:x y:y width:w height:h from:startAngle angle:(endAngle - startAngle) |
|
8445 |
||
8446 |
"Created: / 6.1.1998 / 21:11:31 / cg" |
|
8447 |
"Modified: / 8.1.1998 / 00:33:59 / cg" |
|
8448 |
! |
|
8449 |
||
8450 |
_WGraphics_fillOval:nativeContext |
|
8451 |
|gc x y w h| |
|
8452 |
||
8453 |
gc := self gcForWGraphics:nativeContext. |
|
8454 |
"/ gc isNil ifTrue:[^ self]. |
|
8455 |
gc realized ifFalse:[^ self]. |
|
8456 |
||
8457 |
x := nativeContext argAt:1. |
|
8458 |
y := nativeContext argAt:2. |
|
8459 |
w := nativeContext argAt:3. |
|
8460 |
h := nativeContext argAt:4. |
|
8461 |
||
8462 |
DrawOPTrace ifTrue:[ |
|
8463 |
'drawOval x/y= ' print. x print. '@' print. y print. |
|
8464 |
' w/h= ' print. w print. '@' print. h printCR. |
|
8465 |
]. |
|
8466 |
gc fillArcX:x y:y width:w height:h from:0 angle:360 |
|
8467 |
||
8468 |
"Created: / 8.1.1998 / 00:46:00 / cg" |
|
8469 |
"Modified: / 8.1.1998 / 00:46:20 / cg" |
|
8470 |
! |
|
8471 |
||
8472 |
_WGraphics_fillPolygon:nativeContext |
|
8473 |
|gc xVector yVector count points| |
|
8474 |
||
8475 |
gc := self gcForWGraphics:nativeContext. |
|
8476 |
"/ gc isNil ifTrue:[^ self]. |
|
8477 |
gc realized ifFalse:[^ self]. |
|
8478 |
||
8479 |
xVector := nativeContext argAt:1. |
|
8480 |
yVector := nativeContext argAt:2. |
|
8481 |
count := nativeContext argAt:3. |
|
8482 |
||
8483 |
DrawOPTrace ifTrue:[ |
|
8484 |
'fillPolgon' printCR. |
|
8485 |
]. |
|
8486 |
||
8487 |
points := (1 to:count-1) collect:[:i | (xVector at:i) @ (yVector at:i)]. |
|
8488 |
gc fillPolygon:points |
|
8489 |
||
8490 |
"Created: / 8.1.1998 / 00:58:09 / cg" |
|
8491 |
"Modified: / 25.1.1998 / 11:03:19 / cg" |
|
8492 |
! |
|
8493 |
||
8494 |
_WGraphics_fillRect:nativeContext |
|
8495 |
|gc x y w h| |
|
8496 |
||
8497 |
gc := self gcForWGraphics:nativeContext. |
|
8498 |
"/ gc isNil ifTrue:[^ self]. |
|
8499 |
gc realized ifFalse:[^ self]. |
|
8500 |
||
8501 |
x := nativeContext argAt:1. |
|
8502 |
y := nativeContext argAt:2. |
|
8503 |
w := nativeContext argAt:3. |
|
8504 |
h := nativeContext argAt:4. |
|
8505 |
||
8506 |
"/ self halt. |
|
8507 |
"/ self internalError:'breakPoint'. |
|
8508 |
||
8509 |
gc fillRectangleX:x y:y width:w height:h. |
|
8510 |
||
8511 |
"Created: / 15.8.1997 / 15:43:10 / cg" |
|
8512 |
"Modified: / 8.1.1998 / 00:34:33 / cg" |
|
8513 |
! |
|
8514 |
||
8515 |
_WGraphics_fillRoundRect:nativeContext |
|
8516 |
|gc x y w h| |
|
8517 |
||
8518 |
gc := self gcForWGraphics:nativeContext. |
|
8519 |
"/ gc isNil ifTrue:[^ self]. |
|
8520 |
gc realized ifFalse:[^ self]. |
|
8521 |
||
8522 |
x := nativeContext argAt:1. |
|
8523 |
y := nativeContext argAt:2. |
|
8524 |
w := nativeContext argAt:3. |
|
8525 |
h := nativeContext argAt:4. |
|
8526 |
||
8527 |
"/ self halt. |
|
8528 |
"/ self internalError:'breakPoint'. |
|
8529 |
||
8530 |
gc displayRectangleX:x y:y width:w height:h. |
|
8531 |
||
8532 |
"Modified: / 8.1.1998 / 00:34:33 / cg" |
|
8533 |
"Created: / 8.1.1998 / 00:59:36 / cg" |
|
8534 |
! |
|
8535 |
||
8536 |
_WGraphics_getClipBounds:nativeContext |
|
8537 |
|gc rect r x y w h| |
|
8538 |
||
8539 |
gc := self gcForWGraphics:nativeContext. |
|
391 | 8540 |
"/ gc isNil ifTrue:[^ nil]. |
284 | 8541 |
|
8542 |
rect := (Java classForName:'java.awt.Rectangle') basicNew. |
|
8543 |
||
8544 |
(gc isMemberOf:JavaView) ifTrue:[ |
|
391 | 8545 |
"/ r := gc clippingRectangleOrNil. |
8546 |
r := gc getNextUpdateRectangle. |
|
401 | 8547 |
]. |
8548 |
r isNil ifTrue:[ |
|
8549 |
r := gc clippingRectangleOrNil. |
|
8550 |
]. |
|
8551 |
||
8552 |
r isNil ifTrue:[ |
|
391 | 8553 |
x := y := 0. |
8554 |
w := (gc width). |
|
8555 |
h := (gc height). |
|
401 | 8556 |
] ifFalse:[ |
8557 |
x := (r left). |
|
8558 |
y := (r top). |
|
8559 |
w := (r width). |
|
8560 |
h := (r height). |
|
284 | 8561 |
]. |
8562 |
rect instVarNamed:'x' put:x. |
|
8563 |
rect instVarNamed:'y' put:y. |
|
8564 |
rect instVarNamed:'width' put:w. |
|
8565 |
rect instVarNamed:'height' put:h. |
|
8566 |
||
401 | 8567 |
'WGraphics__getClipBounds ' infoPrint. (x@y extent:w@h) infoPrintCR. |
284 | 8568 |
"/ self halt. |
8569 |
||
8570 |
^ rect |
|
8571 |
||
8572 |
"Created: / 6.1.1998 / 20:58:07 / cg" |
|
401 | 8573 |
"Modified: / 20.10.1998 / 19:26:34 / cg" |
284 | 8574 |
! |
8575 |
||
8576 |
_WGraphics_imageCreate:nativeContext |
|
8577 |
|jGraphics imgRep| |
|
8578 |
||
8579 |
jGraphics := nativeContext receiver. |
|
8580 |
imgRep := nativeContext argAt:1. |
|
8581 |
||
8582 |
jGraphics instVarNamed:'pData' put:(imgRep instVarNamed:'pData'). |
|
8583 |
"/ self halt. |
|
8584 |
||
8585 |
"Created: / 11.1.1998 / 16:34:30 / cg" |
|
8586 |
"Modified: / 17.1.1998 / 12:37:18 / cg" |
|
8587 |
! |
|
8588 |
||
8589 |
_WGraphics_pSetFont:nativeContext |
|
8590 |
|gc jFont stFont| |
|
8591 |
||
8592 |
gc := self gcForWGraphics:nativeContext. |
|
8593 |
jFont := nativeContext argAt:1. |
|
8594 |
||
8595 |
stFont := jFont instVarNamed:'pData'. |
|
8596 |
(stFont isNil or:[stFont == 0]) ifTrue:[ |
|
8597 |
"/ self halt. |
|
8598 |
] ifFalse:[ |
|
8599 |
gc font:stFont |
|
8600 |
]. |
|
8601 |
||
8602 |
"Created: / 6.1.1998 / 20:56:47 / cg" |
|
8603 |
"Modified: / 15.1.1998 / 12:31:20 / cg" |
|
8604 |
! |
|
8605 |
||
8606 |
_WGraphics_pSetForeground:nativeContext |
|
8607 |
|gc rgb clr| |
|
8608 |
||
8609 |
gc := self gcForWGraphics:nativeContext. |
|
8610 |
||
8611 |
rgb := nativeContext argAt:1. |
|
8612 |
||
8613 |
clr := Color rgbValue:rgb. |
|
8614 |
gc paint:clr. |
|
8615 |
||
8616 |
"/ self halt. |
|
8617 |
"/ self internalError:'breakPoint'. |
|
8618 |
||
8619 |
"Created: / 6.1.1998 / 20:56:14 / cg" |
|
8620 |
"Modified: / 8.1.1998 / 00:34:51 / cg" |
|
8621 |
! |
|
8622 |
||
440 | 8623 |
_WGraphics_print:nativeContext |
8624 |
"/ void print (sun.awt.windows.WComponentPeer) |
|
8625 |
UnimplementedNativeMethodSignal raise |
|
8626 |
||
8627 |
"Created: / 12.11.1998 / 19:19:25 / cg" |
|
8628 |
! |
|
8629 |
||
8630 |
_WGraphics_removeClip:nativeContext |
|
8631 |
"/ void removeClip () |
|
8632 |
UnimplementedNativeMethodSignal raise |
|
8633 |
||
8634 |
"Created: / 12.11.1998 / 19:18:05 / cg" |
|
8635 |
! |
|
8636 |
||
284 | 8637 |
_WGraphics_setPaintMode:nativeContext |
8638 |
|gc| |
|
8639 |
||
8640 |
gc := self gcForWGraphics:nativeContext. |
|
8641 |
gc function:#copy. |
|
285 | 8642 |
|
8643 |
true "DrawOPTrace" ifTrue:[ |
|
8644 |
'copyMode' infoPrintCR. |
|
8645 |
]. |
|
284 | 8646 |
|
8647 |
"Created: / 8.1.1998 / 00:33:44 / cg" |
|
285 | 8648 |
"Modified: / 28.1.1998 / 23:25:56 / cg" |
284 | 8649 |
! |
8650 |
||
8651 |
_WGraphics_setXORMode:nativeContext |
|
8652 |
|gc jColor rgb invColor device| |
|
8653 |
||
8654 |
gc := self gcForWGraphics:nativeContext. |
|
8655 |
jColor := nativeContext argAt:1. |
|
8656 |
device := gc graphicsDevice. |
|
285 | 8657 |
|
8658 |
"/ "/ on trueColor systems, use the provided |
|
8659 |
"/ "/ rgb value for inverting. |
|
8660 |
"/ "/ on palette systems, use white ^ black |
|
8661 |
"/ |
|
8662 |
"/ device visualType == #TrueColor ifTrue:[ |
|
8663 |
"/ rgb := jColor instVarNamed:'value'. |
|
8664 |
"/ rgb := rgb bitAnd:16rFFFFFF. |
|
8665 |
"/ rgb == 0 ifTrue:[ |
|
8666 |
"/ rgb := 16rFFFFFF. |
|
8667 |
"/ ]. |
|
8668 |
"/ invColor := rgb |
|
8669 |
"/ ] ifFalse:[ |
|
8670 |
"/ invColor := device blackpixel bitXor:device whitepixel. |
|
8671 |
"/ ]. |
|
8672 |
||
8673 |
invColor := device blackpixel bitXor:device whitepixel. |
|
8674 |
||
8675 |
"/ gc foreground:(Color colorId:invColor) |
|
8676 |
"/ background:device blackColor. |
|
8677 |
device |
|
8678 |
setForeground:invColor background:0 |
|
8679 |
in:gc gcId. |
|
284 | 8680 |
gc function:#xor. |
285 | 8681 |
|
8682 |
true "DrawOPTrace" ifTrue:[ |
|
8683 |
'xorMode' infoPrintCR. |
|
8684 |
]. |
|
284 | 8685 |
|
8686 |
"Created: / 8.1.1998 / 00:36:17 / cg" |
|
285 | 8687 |
"Modified: / 28.1.1998 / 23:45:03 / cg" |
284 | 8688 |
! |
8689 |
||
8690 |
_WLabelPeer_create:nativeContext |
|
8691 |
|jLabelPeer jLabel jFrame frame label |
|
8692 |
lbl| |
|
8693 |
||
8694 |
jLabelPeer := nativeContext receiver. |
|
8695 |
jLabel := jLabelPeer instVarNamed:'target'. |
|
8696 |
||
8697 |
lbl := jLabel instVarNamed:'text'. |
|
8698 |
lbl notNil ifTrue:[ |
|
8699 |
lbl := Java as_ST_String:lbl |
|
8700 |
]. |
|
8701 |
||
8702 |
jFrame := nativeContext argAt:1. |
|
8703 |
frame := jFrame instVarNamed:'pData'. |
|
8704 |
||
8705 |
label := Label in:frame. |
|
8706 |
lbl notNil ifTrue:[ |
|
8707 |
label label:lbl |
|
8708 |
]. |
|
8709 |
self createdWindowsView:label for:jLabelPeer. |
|
8710 |
||
8711 |
WindowCreationTrace == true ifTrue:[ |
|
8712 |
'WLabelPeer_create: ' print. frame print. ' -> ' print. label printNL. |
|
8713 |
]. |
|
8714 |
||
8715 |
"Created: / 7.1.1998 / 21:42:31 / cg" |
|
8716 |
"Modified: / 13.1.1998 / 22:10:47 / cg" |
|
8717 |
! |
|
8718 |
||
8719 |
_WLabelPeer_setAlignment:nativeContext |
|
8720 |
|label alignNr| |
|
8721 |
||
8722 |
alignNr := nativeContext argAt:1. |
|
8723 |
label := self viewForWPeer:nativeContext. |
|
8724 |
label notNil ifTrue:[ |
|
8725 |
]. |
|
8726 |
||
8727 |
"Created: / 7.1.1998 / 21:43:12 / cg" |
|
8728 |
"Modified: / 8.1.1998 / 17:35:29 / cg" |
|
8729 |
! |
|
8730 |
||
8731 |
_WLabelPeer_setText:nativeContext |
|
479 | 8732 |
|label jString str| |
284 | 8733 |
|
8734 |
jString := nativeContext argAt:1. |
|
8735 |
||
8736 |
label := self viewForWPeer:nativeContext. |
|
479 | 8737 |
str := jString. |
8738 |
str notNil ifTrue:[ |
|
8739 |
str := Java as_ST_String:str |
|
8740 |
]. |
|
8741 |
label label:str |
|
284 | 8742 |
|
8743 |
"Created: / 7.1.1998 / 21:43:51 / cg" |
|
479 | 8744 |
"Modified: / 3.12.1998 / 14:59:18 / cg" |
284 | 8745 |
! |
8746 |
||
408 | 8747 |
_WListPeer__addItem:nativeContext |
448 | 8748 |
|jString index1 length selListView m| |
408 | 8749 |
|
8750 |
selListView := self viewForWPeer:nativeContext. |
|
8751 |
||
8752 |
jString := nativeContext argAt:1. |
|
8753 |
index1 := nativeContext argAt:2. |
|
8754 |
length := nativeContext argAt:3. |
|
8755 |
||
448 | 8756 |
(m := selListView model) notNil ifTrue:[ |
8757 |
m list addLast:(Java as_ST_String:jString). |
|
8758 |
m changed:#list. |
|
8759 |
]. |
|
408 | 8760 |
|
8761 |
"Created: / 26.10.1998 / 20:11:30 / cg" |
|
448 | 8762 |
"Modified: / 14.11.1998 / 01:21:03 / cg" |
408 | 8763 |
! |
8764 |
||
284 | 8765 |
_WListPeer_addItem:nativeContext |
410 | 8766 |
|jString index selListView m| |
284 | 8767 |
|
8768 |
selListView := self viewForWPeer:nativeContext. |
|
8769 |
||
8770 |
jString := nativeContext argAt:1. |
|
8771 |
index := nativeContext argAt:2. |
|
8772 |
||
410 | 8773 |
m := selListView model. |
8774 |
m isNil ifTrue:[ |
|
8775 |
Transcript showCR:'JAVA: access to listModel of closed view'. |
|
8776 |
] ifFalse:[ |
|
8777 |
m list addLast:(Java as_ST_String:jString). |
|
8778 |
m changed:#list. |
|
8779 |
] |
|
8780 |
||
284 | 8781 |
"Created: / 24.1.1998 / 21:10:05 / cg" |
410 | 8782 |
"Modified: / 2.11.1998 / 17:12:52 / cg" |
284 | 8783 |
! |
8784 |
||
8785 |
_WListPeer_create:nativeContext |
|
8786 |
|jListPeer jFrame frame selectionInListView| |
|
8787 |
||
8788 |
jListPeer := nativeContext receiver. |
|
8789 |
||
8790 |
jFrame := nativeContext argAt:1. |
|
8791 |
frame := jFrame instVarNamed:'pData'. |
|
8792 |
||
8793 |
selectionInListView := ScrollableView for:SelectionInListView in:frame. |
|
8794 |
selectionInListView action:[:index | jListPeer perform:#'handleListChanged(I)V' with:(index - 1)]. |
|
8795 |
selectionInListView doubleClickAction:[:index | jListPeer perform:#'handleAction(I)V' with:(index - 1)]. |
|
337 | 8796 |
selectionInListView model:(SelectionInList new list:(List new)). |
284 | 8797 |
selectionInListView useIndex:true. |
8798 |
||
8799 |
self createdWindowsView:selectionInListView for:jListPeer. |
|
8800 |
||
8801 |
WindowCreationTrace == true ifTrue:[ |
|
8802 |
'WTextAreaPeer_create: ' print. frame print. ' -> ' print. selectionInListView printNL. |
|
8803 |
]. |
|
8804 |
||
8805 |
"Created: / 24.1.1998 / 19:58:54 / cg" |
|
337 | 8806 |
"Modified: / 9.4.1998 / 22:19:07 / cg" |
8807 |
! |
|
8808 |
||
8809 |
_WListPeer_delItems:nativeContext |
|
8810 |
|jString index1 index2 selListView| |
|
8811 |
||
8812 |
selListView := self viewForWPeer:nativeContext. |
|
8813 |
||
8814 |
index1 := nativeContext argAt:1. |
|
8815 |
index2 := nativeContext argAt:2. |
|
8816 |
||
8817 |
selListView model list removeFromIndex:(index1+1) toIndex:(index2+1). |
|
8818 |
selListView model changed:#list. |
|
8819 |
||
8820 |
"Created: / 9.4.1998 / 22:19:25 / cg" |
|
8821 |
"Modified: / 9.4.1998 / 22:20:08 / cg" |
|
284 | 8822 |
! |
8823 |
||
440 | 8824 |
_WListPeer_deselect:nativeContext |
8825 |
"/ void deselect (int) |
|
8826 |
UnimplementedNativeMethodSignal raise |
|
8827 |
||
8828 |
"Created: / 12.11.1998 / 19:15:10 / cg" |
|
8829 |
! |
|
8830 |
||
448 | 8831 |
_WListPeer_getMaxWidth:nativeContext |
8832 |
"/ int getMaxWidth () |
|
8833 |
UnimplementedNativeMethodSignal raise |
|
8834 |
||
8835 |
"Created: / 14.11.1998 / 10:44:29 / cg" |
|
8836 |
! |
|
8837 |
||
284 | 8838 |
_WListPeer_isSelected:nativeContext |
8839 |
|selectionInListView index model| |
|
8840 |
||
8841 |
selectionInListView := self viewForWPeer:nativeContext. |
|
8842 |
||
8843 |
index := nativeContext argAt:1. |
|
8844 |
(model := selectionInListView model) notNil ifTrue:[ |
|
8845 |
(model selectionIndex == (index + 1)) "/ JAVA indexing starts at 0 |
|
8846 |
ifTrue:[ |
|
8847 |
^ 1 |
|
8848 |
] |
|
8849 |
]. |
|
8850 |
^ 0. |
|
8851 |
||
8852 |
"Created: / 24.1.1998 / 22:42:31 / cg" |
|
8853 |
"Modified: / 25.1.1998 / 01:35:32 / cg" |
|
8854 |
! |
|
8855 |
||
396 | 8856 |
_WListPeer_makeVisible:nativeContext |
8857 |
|selectionInListView lineNr| |
|
8858 |
||
8859 |
selectionInListView := self viewForWPeer:nativeContext. |
|
8860 |
||
8861 |
lineNr := nativeContext argAt:1. |
|
8862 |
||
8863 |
selectionInListView makeLineVisible:(lineNr + 1) |
|
8864 |
||
8865 |
"Modified: / 24.1.1998 / 20:01:06 / cg" |
|
8866 |
"Created: / 20.10.1998 / 14:14:50 / cg" |
|
8867 |
! |
|
8868 |
||
284 | 8869 |
_WListPeer_select:nativeContext |
8870 |
|selectionInListView index model| |
|
8871 |
||
8872 |
selectionInListView := self viewForWPeer:nativeContext. |
|
8873 |
||
8874 |
index := nativeContext argAt:1. |
|
8875 |
(model := selectionInListView model) notNil ifTrue:[ |
|
8876 |
model selectionIndex:(index + 1). "/ JAVA indexing starts at 0 |
|
8877 |
] |
|
8878 |
||
8879 |
"Created: / 24.1.1998 / 22:32:35 / cg" |
|
8880 |
"Modified: / 25.1.1998 / 01:28:46 / cg" |
|
8881 |
! |
|
8882 |
||
8883 |
_WListPeer_setMultipleSelections:nativeContext |
|
8884 |
|selectionInListView onOff| |
|
8885 |
||
8886 |
selectionInListView := self viewForWPeer:nativeContext. |
|
8887 |
||
8888 |
onOff := (nativeContext argAt:1) ~~ 0. |
|
8889 |
||
8890 |
selectionInListView multipleSelectOk:onOff. |
|
8891 |
||
8892 |
"Modified: / 24.1.1998 / 20:01:06 / cg" |
|
8893 |
! |
|
8894 |
||
408 | 8895 |
_WListPeer_updateMaxItemWidth:nativeContext |
8896 |
|selectionInListView lineNr| |
|
8897 |
||
8898 |
selectionInListView := self viewForWPeer:nativeContext. |
|
8899 |
||
8900 |
"Created: / 26.10.1998 / 20:09:46 / cg" |
|
8901 |
! |
|
8902 |
||
440 | 8903 |
_WMenuBarPeer_addMenu:nativeContext |
8904 |
"/ void addMenu (java.awt.Menu) |
|
8905 |
UnimplementedNativeMethodSignal raise |
|
8906 |
||
8907 |
"Created: / 12.11.1998 / 19:14:00 / cg" |
|
8908 |
! |
|
8909 |
||
284 | 8910 |
_WMenuBarPeer_create:nativeContext |
8911 |
|jMenuBarPeer jMenuBar jFrame frame menuBar| |
|
8912 |
||
8913 |
jMenuBarPeer := nativeContext receiver. |
|
8914 |
jMenuBar := jMenuBarPeer instVarNamed:'target'. |
|
8915 |
||
8916 |
jFrame := nativeContext argAt:1. |
|
8917 |
frame := jFrame instVarNamed:'pData'. |
|
8918 |
||
8919 |
menuBar := MenuPanel in:frame. |
|
8920 |
menuBar verticalLayout:false. |
|
8921 |
menuBar realize. |
|
8922 |
||
8923 |
self createdWindowsView:menuBar for:jMenuBarPeer. |
|
8924 |
||
8925 |
WindowCreationTrace == true ifTrue:[ |
|
8926 |
'WMenuBarPeer_create: ' print. frame print. ' -> ' print. menuBar printNL. |
|
8927 |
]. |
|
8928 |
||
8929 |
"Created: / 7.1.1998 / 21:38:31 / cg" |
|
8930 |
"Modified: / 25.1.1998 / 13:19:03 / cg" |
|
8931 |
! |
|
8932 |
||
440 | 8933 |
_WMenuBarPeer_delMenu:nativeContext |
8934 |
"/ void delMenu (int) |
|
8935 |
UnimplementedNativeMethodSignal raise |
|
8936 |
||
8937 |
"Created: / 12.11.1998 / 19:14:11 / cg" |
|
8938 |
! |
|
8939 |
||
325 | 8940 |
_WMenuItemPeer__dispose:nativeContext |
8941 |
|jMenuItemPeer item| |
|
8942 |
||
8943 |
jMenuItemPeer := nativeContext receiver. |
|
8944 |
item := jMenuItemPeer instVarNamed:'pData'. |
|
8945 |
||
8946 |
"/ what should be done here ? |
|
8947 |
||
8948 |
"Created: / 29.3.1998 / 17:16:05 / cg" |
|
8949 |
"Modified: / 29.3.1998 / 17:16:35 / cg" |
|
8950 |
! |
|
8951 |
||
440 | 8952 |
_WMenuItemPeer__setLabel:nativeContext |
8953 |
"/ void _setLabel (java.lang.String) |
|
480 | 8954 |
'JAVA: unimplemented: _WMenuItemPeer__setLabel' infoPrintCR. |
8955 |
"/ UnimplementedNativeMethodSignal raise |
|
440 | 8956 |
|
8957 |
"Created: / 12.11.1998 / 19:12:06 / cg" |
|
480 | 8958 |
"Modified: / 3.12.1998 / 21:06:44 / cg" |
440 | 8959 |
! |
8960 |
||
284 | 8961 |
_WMenuItemPeer_create:nativeContext |
8962 |
|jMenuItemPeer jMenuItem jMenuPeer menu item lbl| |
|
8963 |
||
8964 |
jMenuItemPeer := nativeContext receiver. |
|
8965 |
jMenuItem := jMenuItemPeer instVarNamed:'target'. |
|
8966 |
||
8967 |
jMenuPeer := nativeContext argAt:1. |
|
8968 |
menu := jMenuPeer instVarNamed:'pData'. |
|
480 | 8969 |
(menu isNil or:[menu == 0]) ifTrue:[ |
8970 |
'JAVA: no menu to create item in' infoPrintCR. |
|
8971 |
^ self |
|
8972 |
]. |
|
284 | 8973 |
item := menu createAtIndex:nil. |
325 | 8974 |
item value:[ |
8975 |
jMenuItemPeer perform:#'handleAction(I)V' with:0 |
|
8976 |
]. |
|
284 | 8977 |
|
8978 |
lbl := jMenuItem instVarNamed:'label'. |
|
8979 |
lbl notNil ifTrue:[ |
|
325 | 8980 |
lbl := Java as_ST_String:lbl. |
8981 |
item label:lbl |
|
284 | 8982 |
]. |
8983 |
||
8984 |
jMenuItemPeer instVarNamed:'pData' put:item. |
|
8985 |
||
8986 |
WindowOPTrace == true ifTrue:[ |
|
325 | 8987 |
'WMenuItem_create: ' print. menu print. ' -> ' print. item printNL. |
284 | 8988 |
]. |
8989 |
||
8990 |
"Created: / 7.1.1998 / 21:40:44 / cg" |
|
480 | 8991 |
"Modified: / 3.12.1998 / 20:43:20 / cg" |
284 | 8992 |
! |
8993 |
||
8994 |
_WMenuItemPeer_enable:nativeContext |
|
8995 |
|jMenuItemPeer item state| |
|
8996 |
||
8997 |
jMenuItemPeer := nativeContext receiver. |
|
8998 |
item := jMenuItemPeer instVarNamed:'pData'. |
|
480 | 8999 |
(item isNil or:[item == 0]) ifTrue:[ |
9000 |
'JAVA [warning]: enabling NULL menu item' infoPrintCR. |
|
9001 |
^ self |
|
9002 |
]. |
|
284 | 9003 |
|
9004 |
state := nativeContext argAt:1. |
|
9005 |
item enabled:(state == 0) not |
|
9006 |
||
9007 |
"Created: / 7.1.1998 / 22:41:38 / cg" |
|
480 | 9008 |
"Modified: / 3.12.1998 / 21:04:10 / cg" |
284 | 9009 |
! |
9010 |
||
440 | 9011 |
_WMenuPeer_addSeparator:nativeContext |
9012 |
"/ void addSeparator () |
|
9013 |
UnimplementedNativeMethodSignal raise |
|
9014 |
||
9015 |
"Created: / 12.11.1998 / 19:13:14 / cg" |
|
9016 |
! |
|
9017 |
||
284 | 9018 |
_WMenuPeer_createMenu:nativeContext |
9019 |
|jMenuPeer jMenu jMenuBarPeer menuPanel menu |
|
9020 |
lbl item| |
|
9021 |
||
9022 |
jMenuPeer := nativeContext receiver. |
|
9023 |
jMenu := jMenuPeer instVarNamed:'target'. |
|
9024 |
||
9025 |
jMenuBarPeer := nativeContext argAt:1. |
|
9026 |
menuPanel := jMenuBarPeer instVarNamed:'pData'. |
|
9027 |
||
9028 |
item := menuPanel createAtIndex:nil. |
|
9029 |
lbl := jMenu instVarNamed:'label'. |
|
9030 |
lbl notNil ifTrue:[ |
|
9031 |
lbl := Java as_ST_String:lbl. |
|
9032 |
item label:lbl |
|
9033 |
]. |
|
9034 |
||
9035 |
menu := MenuPanel new. |
|
9036 |
item submenu:menu. |
|
9037 |
||
9038 |
jMenuPeer instVarNamed:'pData' put:menu. |
|
9039 |
||
9040 |
'createMenuPeer: ' print. menuPanel print. ' -> ' print. menu printNL. |
|
9041 |
||
9042 |
"Created: / 7.1.1998 / 21:39:50 / cg" |
|
9043 |
"Modified: / 13.1.1998 / 22:11:09 / cg" |
|
9044 |
! |
|
9045 |
||
440 | 9046 |
_WMenuPeer_createSubMenu:nativeContext |
9047 |
"/ void createSubMenu (sun.awt.windows.WMenuPeer) |
|
482 | 9048 |
"/ UnimplementedNativeMethodSignal raise |
440 | 9049 |
|
9050 |
"Created: / 12.11.1998 / 19:13:43 / cg" |
|
482 | 9051 |
"Modified: / 3.12.1998 / 21:41:07 / cg" |
440 | 9052 |
! |
9053 |
||
9054 |
_WMenuPeer_delItem:nativeContext |
|
9055 |
"/ void delItem (int) |
|
9056 |
UnimplementedNativeMethodSignal raise |
|
9057 |
||
9058 |
"Created: / 12.11.1998 / 19:13:30 / cg" |
|
9059 |
! |
|
9060 |
||
9061 |
_WPopupMenuPeer__show:nativeContext |
|
9062 |
"/ void _show (java.awt.Event) |
|
9063 |
UnimplementedNativeMethodSignal raise |
|
9064 |
||
9065 |
"Created: / 12.11.1998 / 19:12:53 / cg" |
|
9066 |
! |
|
9067 |
||
9068 |
_WPopupMenuPeer_createMenu:nativeContext |
|
9069 |
"/ void createMenu (sun.awt.windows.WComponentPeer) |
|
9070 |
UnimplementedNativeMethodSignal raise |
|
9071 |
||
9072 |
"Created: / 12.11.1998 / 19:12:43 / cg" |
|
9073 |
! |
|
9074 |
||
9075 |
_WPrintJob_end:nativeContext |
|
9076 |
"/ void end () |
|
9077 |
UnimplementedNativeMethodSignal raise |
|
9078 |
||
9079 |
"Created: / 12.11.1998 / 19:11:28 / cg" |
|
9080 |
! |
|
9081 |
||
334 | 9082 |
_WScrollPanePeer__getHScrollbarHeight:nativeContext |
9083 |
|scrollPane| |
|
9084 |
||
9085 |
scrollPane := self viewForWPeer:nativeContext. |
|
339 | 9086 |
^ HorizontalScrollBar new preferredExtent y. |
9087 |
||
334 | 9088 |
"Created: / 9.4.1998 / 17:30:56 / cg" |
339 | 9089 |
"Modified: / 10.4.1998 / 14:59:28 / cg" |
341 | 9090 |
! |
334 | 9091 |
|
9092 |
_WScrollPanePeer__getVScrollbarWidth:nativeContext |
|
9093 |
|scrollPane| |
|
9094 |
||
9095 |
scrollPane := self viewForWPeer:nativeContext. |
|
339 | 9096 |
^ ScrollBar new preferredExtent x. |
334 | 9097 |
|
9098 |
"Created: / 9.4.1998 / 17:29:48 / cg" |
|
339 | 9099 |
"Modified: / 10.4.1998 / 15:00:33 / cg" |
334 | 9100 |
! |
9101 |
||
9102 |
_WScrollPanePeer_create:nativeContext |
|
9103 |
|jScrollPanePeer jScrollPane jFrame frame scrollPane |
|
9104 |
lbl| |
|
9105 |
||
9106 |
jScrollPanePeer := nativeContext receiver. |
|
9107 |
jScrollPane := jScrollPanePeer instVarNamed:'target'. |
|
9108 |
||
9109 |
jFrame := nativeContext argAt:1. |
|
9110 |
frame := jFrame instVarNamed:'pData'. |
|
9111 |
||
9112 |
"/ create with a simple view ... |
|
337 | 9113 |
scrollPane := ScrollableView for:JavaView in:frame. |
334 | 9114 |
|
9115 |
self createdWindowsView:scrollPane for:jScrollPanePeer. |
|
9116 |
||
9117 |
WindowCreationTrace == true ifTrue:[ |
|
9118 |
'WScrollPanePeer_create: ' print. frame print. ' -> ' print. scrollPane printNL. |
|
9119 |
]. |
|
9120 |
||
9121 |
"Created: / 9.4.1998 / 17:25:08 / cg" |
|
337 | 9122 |
"Modified: / 9.4.1998 / 22:06:09 / cg" |
334 | 9123 |
! |
9124 |
||
440 | 9125 |
_WScrollPanePeer_getOffset:nativeContext |
9126 |
"/ int getOffset (int) |
|
9127 |
UnimplementedNativeMethodSignal raise |
|
9128 |
||
9129 |
"Created: / 12.11.1998 / 19:16:29 / cg" |
|
9130 |
! |
|
9131 |
||
9132 |
_WScrollPanePeer_getScrollChild:nativeContext |
|
9133 |
"/ java.awt.Component getScrollChild () |
|
9134 |
UnimplementedNativeMethodSignal raise |
|
9135 |
||
9136 |
"Created: / 12.11.1998 / 19:17:00 / cg" |
|
9137 |
! |
|
9138 |
||
334 | 9139 |
_WScrollPanePeer_setInsets:nativeContext |
9140 |
||
9141 |
"Modified: / 9.4.1998 / 17:26:11 / cg" |
|
9142 |
"Created: / 9.4.1998 / 17:29:10 / cg" |
|
9143 |
! |
|
9144 |
||
440 | 9145 |
_WScrollPanePeer_setScrollPosition:nativeContext |
9146 |
"/ void setScrollPosition (int int) |
|
9147 |
UnimplementedNativeMethodSignal raise |
|
9148 |
||
9149 |
"Created: / 12.11.1998 / 19:16:44 / cg" |
|
9150 |
! |
|
9151 |
||
334 | 9152 |
_WScrollPanePeer_setSpans:nativeContext |
9153 |
||
9154 |
"Created: / 9.4.1998 / 17:31:44 / cg" |
|
9155 |
! |
|
9156 |
||
284 | 9157 |
_WScrollbarPeer__setValues:nativeContext |
9158 |
|scrollBar value visibleAmount min max| |
|
9159 |
||
9160 |
scrollBar := self viewForWPeer:nativeContext. |
|
9161 |
||
9162 |
value := nativeContext argAt:1. |
|
9163 |
visibleAmount := nativeContext argAt:2. |
|
9164 |
min := nativeContext argAt:3. |
|
9165 |
max := nativeContext argAt:4. |
|
9166 |
||
374 | 9167 |
(min ~~ 0 or:[max ~~ 100]) ifTrue:[ |
284 | 9168 |
scrollBar thumb start:min stop:max. |
9169 |
]. |
|
9170 |
||
9171 |
scrollBar thumbOrigin:value thumbHeight:visibleAmount. |
|
9172 |
||
9173 |
"Created: / 13.1.1998 / 22:13:57 / cg" |
|
374 | 9174 |
"Modified: / 14.10.1998 / 14:53:00 / cg" |
284 | 9175 |
! |
9176 |
||
9177 |
_WScrollbarPeer_create:nativeContext |
|
9178 |
|jScrollbarPeer jScrollbar jFrame frame scrollBar |
|
334 | 9179 |
min max| |
284 | 9180 |
|
9181 |
jScrollbarPeer := nativeContext receiver. |
|
9182 |
jScrollbar := jScrollbarPeer instVarNamed:'target'. |
|
9183 |
||
9184 |
jFrame := nativeContext argAt:1. |
|
9185 |
frame := jFrame instVarNamed:'pData'. |
|
9186 |
||
9187 |
(jScrollbar instVarNamed:'orientation') == 0 "HORIZONTAL" ifTrue:[ |
|
9188 |
scrollBar := HorizontalScrollBar in:frame. |
|
9189 |
] ifFalse:[ |
|
9190 |
scrollBar := ScrollBar in:frame. |
|
9191 |
]. |
|
9192 |
min := jScrollbar instVarNamed:'minimum'. |
|
9193 |
max := jScrollbar instVarNamed:'maximum'. |
|
9194 |
||
374 | 9195 |
scrollBar scrollDownAction:[ |
9196 |
scrollBar thumbOrigin:(scrollBar thumbOrigin + ((max-min)/10) min:max). |
|
9197 |
jScrollbarPeer perform:#'dragAbsolute(I)V' with:scrollBar thumbOrigin rounded. |
|
9198 |
]. |
|
9199 |
scrollBar scrollUpAction:[ |
|
9200 |
scrollBar thumbOrigin:(scrollBar thumbOrigin - ((max-min)/10) max:min). |
|
9201 |
jScrollbarPeer perform:#'dragAbsolute(I)V' with:scrollBar thumbOrigin rounded. |
|
9202 |
]. |
|
9203 |
scrollBar scrollAction:[:org | |
|
9204 |
jScrollbarPeer perform:#'dragAbsolute(I)V' with:org rounded. |
|
9205 |
]. |
|
284 | 9206 |
self createdWindowsView:scrollBar for:jScrollbarPeer. |
9207 |
||
9208 |
WindowCreationTrace == true ifTrue:[ |
|
9209 |
'WScrollbarPeer_create: ' print. frame print. ' -> ' print. scrollBar printNL. |
|
9210 |
]. |
|
9211 |
||
9212 |
"Created: / 5.1.1998 / 01:53:30 / cg" |
|
374 | 9213 |
"Modified: / 14.10.1998 / 15:36:19 / cg" |
284 | 9214 |
! |
9215 |
||
9216 |
_WScrollbarPeer_setLineIncrement:nativeContext |
|
9217 |
|scrollBar inc| |
|
9218 |
||
374 | 9219 |
Transcript showCR:'JavaVM: WScrollbarPeer_setLineIncrement unimplemented'. |
9220 |
||
284 | 9221 |
scrollBar := self viewForWPeer:nativeContext. |
9222 |
||
9223 |
inc := nativeContext argAt:1. |
|
9224 |
"/ scrollBar thumb lineIncrement:inc. |
|
9225 |
||
9226 |
"Created: / 25.1.1998 / 11:52:19 / cg" |
|
374 | 9227 |
"Modified: / 14.10.1998 / 14:53:56 / cg" |
284 | 9228 |
! |
9229 |
||
9230 |
_WScrollbarPeer_setPageIncrement:nativeContext |
|
9231 |
|scrollBar inc| |
|
9232 |
||
374 | 9233 |
Transcript showCR:'JavaVM: WScrollbarPeer_setPageIncrement unimplemented'. |
9234 |
||
284 | 9235 |
scrollBar := self viewForWPeer:nativeContext. |
9236 |
||
9237 |
inc := nativeContext argAt:1. |
|
9238 |
"/ scrollBar thumb pageIncrement:inc. |
|
9239 |
||
9240 |
"Created: / 25.1.1998 / 11:52:01 / cg" |
|
374 | 9241 |
"Modified: / 14.10.1998 / 14:54:04 / cg" |
284 | 9242 |
! |
9243 |
||
9244 |
_WTextAreaPeer_create:nativeContext |
|
9245 |
|jTextAreaPeer jFrame frame editTextView| |
|
9246 |
||
9247 |
jTextAreaPeer := nativeContext receiver. |
|
9248 |
||
9249 |
jFrame := nativeContext argAt:1. |
|
9250 |
frame := jFrame instVarNamed:'pData'. |
|
9251 |
||
9252 |
editTextView := HVScrollableView for:EditTextView in:frame. |
|
9253 |
||
9254 |
self createdWindowsView:editTextView for:jTextAreaPeer. |
|
9255 |
||
9256 |
WindowCreationTrace == true ifTrue:[ |
|
9257 |
'WTextAreaPeer_create: ' print. frame print. ' -> ' print. editTextView printNL. |
|
9258 |
]. |
|
9259 |
||
9260 |
"Created: / 7.1.1998 / 21:49:49 / cg" |
|
9261 |
"Modified: / 15.1.1998 / 12:56:18 / cg" |
|
9262 |
! |
|
9263 |
||
9264 |
_WTextAreaPeer_insertText:nativeContext |
|
9265 |
|textView pos string jstring| |
|
9266 |
||
9267 |
textView := self viewForWPeer:nativeContext. |
|
329 | 9268 |
(textView isKindOf:ScrollableView) ifTrue:[ |
9269 |
textView := textView scrolledView |
|
9270 |
]. |
|
284 | 9271 |
|
9272 |
jstring := nativeContext argAt:1. |
|
9273 |
string := Java as_ST_String:jstring. |
|
9274 |
pos := nativeContext argAt:2. |
|
9275 |
||
9276 |
textView insert:string at:pos. |
|
329 | 9277 |
textView cursorToCharacterPosition:pos + string size. |
9278 |
textView makeCursorVisible. |
|
9279 |
"/ textView invalidateRepairNow:true. |
|
284 | 9280 |
^ nil |
9281 |
||
9282 |
"Created: / 7.1.1998 / 21:50:23 / cg" |
|
329 | 9283 |
"Modified: / 5.4.1998 / 17:37:24 / cg" |
284 | 9284 |
! |
9285 |
||
440 | 9286 |
_WTextAreaPeer_replaceText:nativeContext |
9287 |
"/ void replaceText (java.lang.String int int) |
|
9288 |
UnimplementedNativeMethodSignal raise |
|
9289 |
||
9290 |
"Created: / 12.11.1998 / 19:11:14 / cg" |
|
9291 |
! |
|
9292 |
||
284 | 9293 |
_WTextComponentPeer_enableEditing:nativeContext |
9294 |
|textView enabled| |
|
9295 |
||
9296 |
textView := self viewForWPeer:nativeContext. |
|
9297 |
enabled := (nativeContext argAt:1) ~~ 0. |
|
9298 |
||
9299 |
^ textView readOnly:enabled not |
|
9300 |
||
9301 |
"Created: / 5.1.1998 / 01:29:38 / cg" |
|
9302 |
"Modified: / 25.1.1998 / 16:29:56 / cg" |
|
9303 |
! |
|
9304 |
||
9305 |
_WTextComponentPeer_getSelectionEnd:nativeContext |
|
9306 |
|textView| |
|
9307 |
||
9308 |
textView := self viewForWPeer:nativeContext. |
|
9309 |
||
9310 |
^ textView characterPositionOfSelectionEnd |
|
9311 |
||
9312 |
"Created: / 8.1.1998 / 17:41:56 / cg" |
|
9313 |
"Modified: / 15.1.1998 / 15:47:18 / cg" |
|
9314 |
! |
|
9315 |
||
9316 |
_WTextComponentPeer_getSelectionStart:nativeContext |
|
9317 |
|textView| |
|
9318 |
||
9319 |
textView := self viewForWPeer:nativeContext. |
|
9320 |
||
9321 |
^ textView characterPositionOfSelection - 1 |
|
9322 |
||
9323 |
"Created: / 15.8.1997 / 15:45:45 / cg" |
|
9324 |
"Modified: / 15.1.1998 / 15:46:51 / cg" |
|
9325 |
! |
|
9326 |
||
9327 |
_WTextComponentPeer_getText:nativeContext |
|
9328 |
|textView string jString| |
|
9329 |
||
9330 |
textView := self viewForWPeer:nativeContext. |
|
9331 |
||
9332 |
string := textView contents asString. |
|
9333 |
jString := Java as_String:string. |
|
9334 |
^ jString |
|
9335 |
||
9336 |
"Created: / 6.1.1998 / 21:05:15 / cg" |
|
9337 |
"Modified: / 8.1.1998 / 17:36:52 / cg" |
|
9338 |
! |
|
9339 |
||
9340 |
_WTextComponentPeer_select:nativeContext |
|
9341 |
|textView selStart selEnd| |
|
9342 |
||
9343 |
textView := self viewForWPeer:nativeContext. |
|
9344 |
selStart := nativeContext argAt:1. |
|
9345 |
selEnd := nativeContext argAt:2. |
|
9346 |
||
9347 |
selStart == selEnd ifTrue:[ |
|
9348 |
"/ clear selection |
|
9349 |
textView unselect. |
|
9350 |
"/ and set caret |
|
9351 |
textView cursorToCharacterPosition:selStart + 1 |
|
9352 |
] ifFalse:[ |
|
9353 |
"/ change selection |
|
9354 |
textView selectFromCharacterPosition:selStart+1 to:selEnd |
|
9355 |
]. |
|
9356 |
||
9357 |
"Created: / 15.8.1997 / 15:45:58 / cg" |
|
9358 |
"Modified: / 15.1.1998 / 21:55:57 / cg" |
|
9359 |
! |
|
9360 |
||
9361 |
_WTextComponentPeer_setText:nativeContext |
|
9362 |
|textView string jstring| |
|
9363 |
||
9364 |
textView := self viewForWPeer:nativeContext. |
|
9365 |
||
9366 |
jstring := nativeContext argAt:1. |
|
9367 |
string := Java as_ST_String:jstring. |
|
9368 |
||
9369 |
textView contents:string. |
|
9370 |
||
9371 |
"Created: / 5.1.1998 / 01:28:23 / cg" |
|
9372 |
"Modified: / 15.1.1998 / 15:59:57 / cg" |
|
9373 |
! |
|
9374 |
||
9375 |
_WTextFieldPeer_create:nativeContext |
|
9376 |
|jTextFieldPeer jFrame frame editField| |
|
9377 |
||
9378 |
jTextFieldPeer := nativeContext receiver. |
|
9379 |
||
9380 |
jFrame := nativeContext argAt:1. |
|
9381 |
frame := jFrame instVarNamed:'pData'. |
|
9382 |
||
9383 |
editField := EditField in:frame. |
|
9384 |
||
9385 |
self createdWindowsView:editField for:jTextFieldPeer. |
|
9386 |
||
9387 |
editField crAction:[ |
|
419 | 9388 |
jTextFieldPeer perform:#handleAction. |
284 | 9389 |
]. |
9390 |
WindowCreationTrace == true ifTrue:[ |
|
9391 |
'WTextFieldPeer_create: ' print. frame print. ' -> ' print. editField printNL. |
|
9392 |
]. |
|
9393 |
||
9394 |
"Created: / 5.1.1998 / 01:27:37 / cg" |
|
419 | 9395 |
"Modified: / 4.11.1998 / 21:07:30 / cg" |
284 | 9396 |
! |
9397 |
||
9398 |
_WTextFieldPeer_setEchoCharacter:nativeContext |
|
9399 |
|editField char| |
|
9400 |
||
9401 |
editField := self viewForWPeer:nativeContext. |
|
9402 |
||
9403 |
char := nativeContext argAt:1. |
|
9404 |
editField passwordCharacter:(Character value:char). |
|
9405 |
||
9406 |
"Created: / 25.1.1998 / 16:28:30 / cg" |
|
9407 |
! |
|
9408 |
||
440 | 9409 |
_WToolkit_beep:nativeContext |
9410 |
"/ void beep () |
|
9411 |
UnimplementedNativeMethodSignal raise |
|
9412 |
||
9413 |
"Created: / 12.11.1998 / 19:09:23 / cg" |
|
9414 |
! |
|
9415 |
||
284 | 9416 |
_WToolkit_eventLoop:nativeContext |
9417 |
JavaEventThread := Processor activeProcess. |
|
9418 |
[ |
|
9419 |
[true] whileTrue:[ |
|
9420 |
AbortSignal handle:[:ex | |
|
9421 |
ex return |
|
9422 |
] do:[ |
|
9423 |
self doWindowsEventThread. |
|
9424 |
] |
|
9425 |
]. |
|
9426 |
] valueNowOrOnUnwindDo:[ |
|
9427 |
JavaEventThread := nil. |
|
9428 |
]. |
|
9429 |
||
9430 |
"Created: / 6.1.1998 / 21:01:44 / cg" |
|
9431 |
"Modified: / 15.1.1998 / 19:48:55 / cg" |
|
9432 |
! |
|
9433 |
||
405 | 9434 |
_WToolkit_getComboHeightOffset:nativeContext |
9435 |
^ 0 |
|
9436 |
||
9437 |
"Modified: / 20.3.1997 / 13:50:04 / cg" |
|
9438 |
"Created: / 22.10.1998 / 00:59:14 / cg" |
|
9439 |
! |
|
9440 |
||
284 | 9441 |
_WToolkit_getScreenHeight:nativeContext |
9442 |
^ Screen current height |
|
9443 |
||
9444 |
"Modified: / 20.3.1997 / 13:50:04 / cg" |
|
9445 |
"Created: / 13.1.1998 / 09:24:45 / cg" |
|
9446 |
! |
|
9447 |
||
9448 |
_WToolkit_getScreenResolution:nativeContext |
|
9449 |
^ Screen current resolution x rounded |
|
9450 |
||
9451 |
"Modified: / 20.3.1997 / 13:50:04 / cg" |
|
9452 |
"Created: / 17.1.1998 / 21:54:48 / cg" |
|
9453 |
! |
|
9454 |
||
9455 |
_WToolkit_getScreenWidth:nativeContext |
|
9456 |
^ Screen current width |
|
9457 |
||
9458 |
"Modified: / 20.3.1997 / 13:50:04 / cg" |
|
9459 |
"Created: / 13.1.1998 / 09:24:37 / cg" |
|
9460 |
! |
|
9461 |
||
9462 |
_WToolkit_init:nativeContext |
|
9463 |
||
9464 |
"Created: / 3.1.1998 / 02:30:57 / cg" |
|
9465 |
! |
|
9466 |
||
9467 |
_WToolkit_loadSystemColors:nativeContext |
|
9468 |
"/ self halt. |
|
9469 |
||
9470 |
"Modified: / 18.3.1997 / 18:43:26 / cg" |
|
9471 |
"Created: / 5.1.1998 / 02:19:09 / cg" |
|
9472 |
! |
|
9473 |
||
440 | 9474 |
_WToolkit_makeColorModel:nativeContext |
9475 |
"/ java.awt.image.ColorModel makeColorModel () |
|
9476 |
UnimplementedNativeMethodSignal raise |
|
9477 |
||
9478 |
"Created: / 12.11.1998 / 19:08:47 / cg" |
|
9479 |
! |
|
9480 |
||
9481 |
_WToolkit_sync:nativeContext |
|
9482 |
"/ void sync () |
|
9483 |
UnimplementedNativeMethodSignal raise |
|
9484 |
||
9485 |
"Created: / 12.11.1998 / 19:09:14 / cg" |
|
9486 |
! |
|
9487 |
||
284 | 9488 |
_WWindowPeer__setResizable:nativeContext |
9489 |
|view onOff| |
|
9490 |
||
9491 |
view := self viewForWPeer:nativeContext. |
|
9492 |
||
9493 |
onOff := (nativeContext argAt:1) == 1. |
|
9494 |
view isTopView ifTrue:[ |
|
9495 |
onOff ifTrue:[ |
|
9496 |
view minExtent:10@10. |
|
9497 |
view maxExtent:(Screen current extent). |
|
9498 |
] ifFalse:[ |
|
9499 |
view minExtent:view extent. |
|
9500 |
view maxExtent:view extent. |
|
9501 |
] |
|
9502 |
] ifFalse:[ |
|
9503 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
9504 |
self halt. |
|
9505 |
] |
|
9506 |
]. |
|
9507 |
||
9508 |
"/ 'JAVA: WWindowPeer_setResizable: ' print. view print. ' yes/no: ' print. onOff printNL. |
|
9509 |
||
9510 |
^ nil |
|
9511 |
||
9512 |
"Created: / 5.1.1998 / 00:57:59 / cg" |
|
9513 |
"Modified: / 16.1.1998 / 18:08:00 / cg" |
|
9514 |
! |
|
9515 |
||
9516 |
_WWindowPeer__setTitle:nativeContext |
|
9517 |
|view jString string| |
|
9518 |
||
9519 |
view := self viewForWPeer:nativeContext. |
|
9520 |
||
9521 |
jString := nativeContext argAt:1. |
|
9522 |
string := Java as_ST_String:jString. |
|
9523 |
||
9524 |
"/ 'JAVA: WWindowPeer_pSetTitle: ' print. string print. ' ' print. view printNL. |
|
9525 |
||
9526 |
view label:string. |
|
9527 |
^ nil |
|
9528 |
||
9529 |
"Created: / 5.1.1998 / 00:57:17 / cg" |
|
9530 |
"Modified: / 8.1.1998 / 17:37:41 / cg" |
|
9531 |
! |
|
9532 |
||
440 | 9533 |
_WWindowPeer_create:nativeContext |
9534 |
"/ void create (sun.awt.windows.WComponentPeer) |
|
482 | 9535 |
|jWindowPeer jWindow top window pDataIdx| |
9536 |
||
9537 |
jWindowPeer := nativeContext receiver. |
|
9538 |
||
9539 |
jWindow := jWindowPeer instVarNamed:'target'. |
|
9540 |
window := jWindowPeer instVarNamed:'pData'. |
|
9541 |
||
9542 |
(window notNil and:[window ~~ 0]) ifTrue:[ |
|
9543 |
WindowCreationTrace == true ifTrue:[ |
|
9544 |
'JAVA: window view already created: ' infoPrint. |
|
9545 |
jWindowPeer class name infoPrintCR. |
|
9546 |
]. |
|
9547 |
] ifFalse:[ |
|
9548 |
"/ OLD |
|
9549 |
"/ window := StandardSystemView new. |
|
9550 |
"/ self createdWindowsView:window for:jWindowPeer. |
|
9551 |
"/ JavaWindowGroup addTopView:window. |
|
9552 |
||
9553 |
window := JavaPopUpView new. |
|
9554 |
window delegate:self. |
|
9555 |
window javaPeer:jWindowPeer. |
|
9556 |
self createdWindowsView:window for:jWindowPeer. |
|
9557 |
JavaWindowGroup addTopView:window. |
|
9558 |
||
9559 |
"/ top := StandardSystemView new. |
|
9560 |
"/ window := JavaView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
9561 |
"/ window delegate:self. |
|
9562 |
"/ window javaPeer:jWindowPeer. |
|
9563 |
"/ self createdWindowsView:window for:jWindowPeer. |
|
9564 |
"/ JavaWindowGroup addTopView:top. |
|
9565 |
||
9566 |
]. |
|
9567 |
||
9568 |
WindowCreationTrace == true ifTrue:[ |
|
9569 |
'JAVA: WWindowPeer_create: ' print. jWindowPeer displayString print. |
|
9570 |
' window: ' print. window printNL. |
|
9571 |
]. |
|
9572 |
||
9573 |
"Created: / 4.1.1998 / 17:56:39 / cg" |
|
9574 |
"Modified: / 4.12.1998 / 15:08:53 / cg" |
|
440 | 9575 |
! |
9576 |
||
9577 |
_WWindowPeer_getContainerElement:nativeContext |
|
9578 |
"/ java.awt.Component getContainerElement (java.awt.Container int) |
|
9579 |
UnimplementedNativeMethodSignal raise |
|
9580 |
||
9581 |
"Created: / 12.11.1998 / 19:10:54 / cg" |
|
9582 |
! |
|
9583 |
||
342 | 9584 |
_WWindowPeer_toBack:nativeContext |
9585 |
|view| |
|
9586 |
||
9587 |
view := self viewForWPeer:nativeContext. |
|
9588 |
view lower. |
|
9589 |
||
9590 |
"Created: / 7.5.1998 / 00:23:03 / cg" |
|
9591 |
! |
|
9592 |
||
337 | 9593 |
_WWindowPeer_toFront:nativeContext |
9594 |
|view| |
|
9595 |
||
9596 |
view := self viewForWPeer:nativeContext. |
|
9597 |
view raise. |
|
9598 |
||
9599 |
"Created: / 9.4.1998 / 22:17:28 / cg" |
|
9600 |
! |
|
9601 |
||
284 | 9602 |
_WWindowPeer_updateInsets:nativeContext |
9603 |
"/ self halt. |
|
9604 |
||
9605 |
"Modified: / 18.3.1997 / 18:43:18 / cg" |
|
9606 |
"Created: / 4.1.1998 / 18:09:04 / cg" |
|
9607 |
! ! |
|
9608 |
||
9609 |
!JavaVM class methodsFor:'native - sun.awt.windows - jdk1.2'! |
|
9610 |
||
9611 |
_WFramePeer_setTitle:nativeContext |
|
9612 |
|view jString string| |
|
9613 |
||
9614 |
view := self viewForWPeer:nativeContext. |
|
9615 |
||
9616 |
jString := nativeContext argAt:1. |
|
9617 |
string := Java as_ST_String:jString. |
|
9618 |
||
9619 |
"/ 'JAVA: WFramePeer_pSetTitle: ' print. string print. ' ' print. view printNL. |
|
9620 |
||
9621 |
view label:string. |
|
9622 |
^ nil |
|
9623 |
||
9624 |
"Modified: / 8.1.1998 / 17:37:41 / cg" |
|
9625 |
"Created: / 27.1.1998 / 21:42:57 / cg" |
|
9626 |
! |
|
9627 |
||
9628 |
_WPanelPeer_calculateInsets:nativeContext |
|
9629 |
"/ new with jdk1.2 ... |
|
9630 |
||
9631 |
"Created: / 27.1.1998 / 21:40:00 / cg" |
|
9632 |
! ! |
|
9633 |
||
457 | 9634 |
!JavaVM class methodsFor:'native - sun.awt.windows - ms'! |
9635 |
||
9636 |
_MCanvasPeer_create:nativeContext |
|
9637 |
|jCanvasPeer jFrame frame subView| |
|
9638 |
||
9639 |
jCanvasPeer := nativeContext receiver. |
|
9640 |
||
9641 |
jFrame := nativeContext argAt:1. |
|
9642 |
jFrame isNil ifTrue:[ |
|
9643 |
self halt:'no frame in canvasPeer create'. |
|
9644 |
self internalError:'no frame in canvasPeer create'. |
|
9645 |
^ self. |
|
9646 |
]. |
|
9647 |
frame := jFrame instVarNamed:'pData'. |
|
9648 |
||
9649 |
subView := JavaView in:frame. |
|
9650 |
subView delegate:self. |
|
9651 |
subView javaPeer:jCanvasPeer. |
|
9652 |
||
9653 |
self createdWindowsView:subView for:jCanvasPeer. |
|
9654 |
||
9655 |
WindowCreationTrace == true ifTrue:[ |
|
9656 |
'WCanvasPeer_create: ' print. frame print. ' -> ' print. subView printNL. |
|
9657 |
]. |
|
9658 |
||
9659 |
"Modified: / 16.1.1998 / 13:40:00 / cg" |
|
9660 |
"Created: / 18.11.1998 / 00:14:44 / cg" |
|
9661 |
! |
|
9662 |
||
9663 |
_MComponentPeer_pReshape:nativeContext |
|
9664 |
self commonReshapeComponent:nativeContext |
|
9665 |
||
9666 |
"Created: / 18.11.1998 / 00:18:17 / cg" |
|
9667 |
! |
|
9668 |
||
9669 |
_MComponentPeer_setBackground:nativeContext |
|
9670 |
|jClr rgb clr view| |
|
9671 |
||
9672 |
view := self viewForWPeer:nativeContext. |
|
9673 |
||
9674 |
jClr := nativeContext argAt:1. |
|
9675 |
rgb := jClr instVarNamed:'value'. |
|
9676 |
"/ self halt. |
|
9677 |
clr := Color rgbValue:rgb. |
|
9678 |
||
9679 |
||
9680 |
clr := clr on:(view device). |
|
9681 |
||
9682 |
(view isKindOf:ScrollableView) ifTrue:[ |
|
9683 |
view := view scrolledView |
|
9684 |
]. |
|
9685 |
view viewBackground:clr. |
|
9686 |
view backgroundPaint:clr. |
|
9687 |
||
9688 |
"Created: / 17.11.1998 / 23:49:41 / cg" |
|
9689 |
! |
|
9690 |
||
9691 |
_MComponentPeer_setFont:nativeContext |
|
9692 |
|view| |
|
9693 |
||
9694 |
view := self viewForWPeer:nativeContext. |
|
9695 |
"/ self halt. |
|
9696 |
||
9697 |
"Modified: / 25.1.1998 / 01:22:19 / cg" |
|
9698 |
"Created: / 17.11.1998 / 23:43:48 / cg" |
|
9699 |
! |
|
9700 |
||
9701 |
_MComponentPeer_setForeground:nativeContext |
|
9702 |
|jClr rgb clr view| |
|
9703 |
||
9704 |
view := self viewForWPeer:nativeContext. |
|
9705 |
||
9706 |
jClr := nativeContext argAt:1. |
|
9707 |
rgb := jClr instVarNamed:'value'. |
|
9708 |
"/ self halt. |
|
9709 |
clr := Color rgbValue:rgb. |
|
9710 |
||
9711 |
clr := clr on:(view device). |
|
9712 |
||
9713 |
view paint:clr. |
|
9714 |
||
9715 |
"Created: / 17.11.1998 / 23:50:31 / cg" |
|
9716 |
"Modified: / 17.11.1998 / 23:57:29 / cg" |
|
9717 |
! |
|
9718 |
||
9719 |
_MFramePeer_getWindowBackgroundColor:nativeContext |
|
9720 |
^ View defaultViewBackgroundColor rgbValue. |
|
9721 |
||
9722 |
"Created: / 17.11.1998 / 23:55:42 / cg" |
|
9723 |
! |
|
9724 |
||
9725 |
_MFramePeer_pShow:nativeContext |
|
9726 |
|view| |
|
9727 |
||
9728 |
view := self viewForWPeer:nativeContext. |
|
9729 |
||
9730 |
"/ frame views are under my browsers own control |
|
9731 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
9732 |
view beVisible. |
|
9733 |
view realize. |
|
9734 |
]. |
|
9735 |
||
9736 |
"/ view windowGroup notNil ifTrue:[ |
|
9737 |
"/ windowServer addGroup:(view windowGroup) |
|
9738 |
"/ ]. |
|
9739 |
||
9740 |
^ nil |
|
9741 |
||
9742 |
"/ self halt. |
|
9743 |
||
9744 |
"Modified: / 25.1.1998 / 09:54:07 / cg" |
|
9745 |
"Created: / 18.11.1998 / 00:19:59 / cg" |
|
9746 |
! |
|
9747 |
||
9748 |
_MFramePeer_setInsets:nativeContext |
|
9749 |
||
9750 |
"Created: / 17.11.1998 / 23:55:32 / cg" |
|
9751 |
! |
|
9752 |
||
9753 |
_MFramePeer_setResizable:nativeContext |
|
9754 |
|view onOff| |
|
9755 |
||
9756 |
view := self viewForWPeer:nativeContext. |
|
9757 |
||
9758 |
onOff := (nativeContext argAt:1) == 1. |
|
9759 |
view isTopView ifTrue:[ |
|
9760 |
onOff ifTrue:[ |
|
9761 |
view minExtent:10@10. |
|
9762 |
view maxExtent:(Screen current extent). |
|
9763 |
] ifFalse:[ |
|
9764 |
view minExtent:view extent. |
|
9765 |
view maxExtent:view extent. |
|
9766 |
] |
|
9767 |
] ifFalse:[ |
|
9768 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
9769 |
self halt. |
|
9770 |
] |
|
9771 |
]. |
|
9772 |
||
9773 |
"/ 'JAVA: WWindowPeer_setResizable: ' print. view print. ' yes/no: ' print. onOff printNL. |
|
9774 |
||
9775 |
^ nil |
|
9776 |
||
9777 |
"Modified: / 16.1.1998 / 18:08:00 / cg" |
|
9778 |
"Created: / 17.11.1998 / 23:51:45 / cg" |
|
9779 |
! |
|
9780 |
||
9781 |
_MToolkit_callbackLoop:nativeContext |
|
9782 |
|toolKit| |
|
9783 |
||
9784 |
toolKit := nativeContext receiver. |
|
9785 |
^ self. |
|
9786 |
self halt. |
|
9787 |
self wakeup:toolKit. |
|
9788 |
self halt. |
|
9789 |
||
9790 |
JavaEventThread := Processor activeProcess. |
|
9791 |
[ |
|
9792 |
[true] whileTrue:[ |
|
9793 |
AbortSignal handle:[:ex | |
|
9794 |
ex return |
|
9795 |
] do:[ |
|
9796 |
self doWindowsEventThread. |
|
9797 |
] |
|
9798 |
]. |
|
9799 |
] valueNowOrOnUnwindDo:[ |
|
9800 |
JavaEventThread := nil. |
|
9801 |
]. |
|
9802 |
||
9803 |
"Created: / 17.11.1998 / 23:58:33 / cg" |
|
9804 |
"Modified: / 18.11.1998 / 00:13:19 / cg" |
|
9805 |
! |
|
9806 |
||
9807 |
_MToolkit_eventLoop:nativeContext |
|
9808 |
|toolKit| |
|
9809 |
||
9810 |
toolKit := nativeContext receiver. |
|
9811 |
||
9812 |
self wakeup:toolKit. |
|
9813 |
self halt. |
|
9814 |
||
9815 |
JavaEventThread := Processor activeProcess. |
|
9816 |
[ |
|
9817 |
[true] whileTrue:[ |
|
9818 |
AbortSignal handle:[:ex | |
|
9819 |
ex return |
|
9820 |
] do:[ |
|
9821 |
self doWindowsEventThread. |
|
9822 |
] |
|
9823 |
]. |
|
9824 |
] valueNowOrOnUnwindDo:[ |
|
9825 |
JavaEventThread := nil. |
|
9826 |
]. |
|
9827 |
||
9828 |
"Created: / 17.11.1998 / 23:04:29 / cg" |
|
9829 |
"Modified: / 18.11.1998 / 00:11:29 / cg" |
|
9830 |
! ! |
|
9831 |
||
380 | 9832 |
!JavaVM class methodsFor:'native - sun.awt.windows - ns4.0'! |
9833 |
||
9834 |
_WComponentPeer_setBackground:nativeContext |
|
9835 |
|jClr rgb clr view| |
|
9836 |
||
9837 |
view := self viewForWPeer:nativeContext. |
|
9838 |
||
9839 |
jClr := nativeContext argAt:1. |
|
9840 |
rgb := jClr instVarNamed:'value'. |
|
9841 |
"/ self halt. |
|
9842 |
clr := Color rgbValue:rgb. |
|
9843 |
||
9844 |
||
9845 |
clr := clr on:(view device). |
|
9846 |
||
9847 |
"/ (view superView isMemberOf:JavaEmbeddedFrameView) ifTrue:[ |
|
9848 |
"/ view viewBackground:(view superView viewBackground). |
|
9849 |
"/ view backgroundPaint:(view superView viewBackground). |
|
9850 |
"/ ] ifFalse:[ |
|
9851 |
"/ (view isMemberOf:JavaView) ifTrue:[ |
|
9852 |
"/ view viewBackground:clr. |
|
9853 |
"/ view backgroundPaint:clr. |
|
9854 |
"/ ] |
|
9855 |
"/ ]. |
|
9856 |
||
9857 |
(view isKindOf:ScrollableView) ifTrue:[ |
|
9858 |
view := view scrolledView |
|
9859 |
]. |
|
9860 |
view viewBackground:clr. |
|
9861 |
view backgroundPaint:clr. |
|
9862 |
||
9863 |
"Created: / 16.10.1998 / 02:16:31 / cg" |
|
9864 |
"Modified: / 16.10.1998 / 02:26:29 / cg" |
|
9865 |
! |
|
9866 |
||
9867 |
_WComponentPeer_setForeground:nativeContext |
|
9868 |
|jClr rgb clr view| |
|
9869 |
||
9870 |
view := self viewForWPeer:nativeContext. |
|
9871 |
||
9872 |
jClr := nativeContext argAt:1. |
|
9873 |
rgb := jClr instVarNamed:'value'. |
|
9874 |
"/ self halt. |
|
9875 |
clr := Color rgbValue:rgb. |
|
9876 |
||
9877 |
||
9878 |
clr := clr on:(view device). |
|
9879 |
||
9880 |
(view isKindOf:ScrollableView) ifTrue:[ |
|
9881 |
view := view scrolledView |
|
9882 |
]. |
|
9883 |
view paint:clr. |
|
9884 |
||
9885 |
"Created: / 16.10.1998 / 02:18:58 / cg" |
|
9886 |
"Modified: / 16.10.1998 / 02:26:37 / cg" |
|
9887 |
! |
|
9888 |
||
9889 |
_WContainerPeer_calculateInsets:nativeContext |
|
9890 |
"/ new with ns4.0 ... |
|
9891 |
||
9892 |
"Created: / 16.10.1998 / 02:12:59 / cg" |
|
9893 |
! |
|
9894 |
||
9895 |
_WFramePeer_setResizable:nativeContext |
|
9896 |
|view onOff| |
|
9897 |
||
9898 |
view := self viewForWPeer:nativeContext. |
|
9899 |
||
9900 |
onOff := (nativeContext argAt:1) == 1. |
|
9901 |
view isTopView ifTrue:[ |
|
9902 |
onOff ifTrue:[ |
|
9903 |
view minExtent:10@10. |
|
9904 |
view maxExtent:(Screen current extent). |
|
9905 |
] ifFalse:[ |
|
9906 |
view minExtent:view extent. |
|
9907 |
view maxExtent:view extent. |
|
9908 |
] |
|
9909 |
] ifFalse:[ |
|
9910 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
9911 |
self halt. |
|
9912 |
] |
|
9913 |
]. |
|
9914 |
||
9915 |
"/ 'JAVA: WWindowPeer_setResizable: ' print. view print. ' yes/no: ' print. onOff printNL. |
|
9916 |
||
9917 |
^ nil |
|
9918 |
||
9919 |
"Modified: / 16.1.1998 / 18:08:00 / cg" |
|
9920 |
"Created: / 16.10.1998 / 02:21:34 / cg" |
|
9921 |
! ! |
|
9922 |
||
440 | 9923 |
!JavaVM class methodsFor:'native - sun.misc'! |
9924 |
||
9925 |
_VM_getState:nativeContext |
|
9926 |
"/ int getState () |
|
9927 |
UnimplementedNativeMethodSignal raise |
|
9928 |
||
9929 |
"Created: / 12.11.1998 / 19:06:44 / cg" |
|
9930 |
! |
|
9931 |
||
448 | 9932 |
_VM_resetJavaMonitor:nativeContext |
9933 |
"/ void resetJavaMonitor () |
|
9934 |
UnimplementedNativeMethodSignal raise |
|
9935 |
||
9936 |
"Created: / 14.11.1998 / 10:43:23 / cg" |
|
9937 |
! |
|
9938 |
||
9939 |
_VM_resumeJavaMonitor:nativeContext |
|
9940 |
"/ void resumeJavaMonitor () |
|
9941 |
UnimplementedNativeMethodSignal raise |
|
9942 |
||
9943 |
"Created: / 14.11.1998 / 10:42:49 / cg" |
|
9944 |
! |
|
9945 |
||
9946 |
_VM_suspendJavaMonitor:nativeContext |
|
9947 |
"/ void suspendJavaMonitor () |
|
9948 |
UnimplementedNativeMethodSignal raise |
|
9949 |
||
9950 |
"Created: / 14.11.1998 / 10:43:07 / cg" |
|
9951 |
! |
|
9952 |
||
440 | 9953 |
_VM_threadsSuspended:nativeContext |
9954 |
"/ boolean threadsSuspended () |
|
9955 |
UnimplementedNativeMethodSignal raise |
|
9956 |
||
9957 |
"Created: / 12.11.1998 / 19:07:10 / cg" |
|
9958 |
! |
|
9959 |
||
9960 |
_VM_unsuspendSomeThreads:nativeContext |
|
9961 |
"/ void unsuspendSomeThreads () |
|
9962 |
UnimplementedNativeMethodSignal raise |
|
9963 |
||
9964 |
"Created: / 12.11.1998 / 19:07:29 / cg" |
|
9965 |
! |
|
9966 |
||
9967 |
_VM_unsuspendThreads:nativeContext |
|
9968 |
"/ void unsuspendThreads () |
|
9969 |
UnimplementedNativeMethodSignal raise |
|
9970 |
||
9971 |
"Created: / 12.11.1998 / 19:07:20 / cg" |
|
448 | 9972 |
! |
9973 |
||
9974 |
_VM_writeJavaMonitorReport:nativeContext |
|
9975 |
"/ void writeJavaMonitorReport () |
|
9976 |
UnimplementedNativeMethodSignal raise |
|
9977 |
||
9978 |
"Created: / 14.11.1998 / 10:43:37 / cg" |
|
440 | 9979 |
! ! |
9980 |
||
253 | 9981 |
!JavaVM class methodsFor:'semaphores & monitors'! |
9982 |
||
9983 |
monitorFor:someObject |
|
9984 |
|mon| |
|
9985 |
||
9986 |
LockTableAccess critical:[ |
|
261 | 9987 |
mon := LockTable at:someObject ifAbsent:nil. |
9988 |
mon isNil ifTrue:[ |
|
9989 |
LockTable at:someObject put:(mon := Monitor new) |
|
9990 |
] |
|
253 | 9991 |
]. |
9992 |
^ mon |
|
9993 |
||
9994 |
"Created: / 2.1.1998 / 19:01:52 / cg" |
|
9995 |
! |
|
9996 |
||
9997 |
releaseAndSignalForAllSemaphoreFor:someObject |
|
9998 |
|sema| |
|
9999 |
||
10000 |
WaitTableAccess critical:[ |
|
306 | 10001 |
sema := WaitTable at:someObject ifAbsent:nil. |
10002 |
"/ sema notNil ifTrue:[ |
|
10003 |
"/ WaitTable removeKey:someObject |
|
10004 |
"/ ] |
|
253 | 10005 |
]. |
10006 |
||
10007 |
sema notNil ifTrue:[ |
|
306 | 10008 |
sema signalForAll |
253 | 10009 |
] |
10010 |
||
10011 |
"Created: / 2.1.1998 / 18:21:51 / cg" |
|
306 | 10012 |
"Modified: / 3.2.1998 / 16:11:58 / cg" |
253 | 10013 |
! |
10014 |
||
10015 |
releaseAndSignalSemaphoreFor:someObject |
|
10016 |
|sema| |
|
10017 |
||
10018 |
WaitTableAccess critical:[ |
|
306 | 10019 |
sema := WaitTable at:someObject ifAbsent:nil. |
10020 |
"/ sema notNil ifTrue:[ |
|
10021 |
"/ WaitTable removeKey:someObject |
|
10022 |
"/ ] |
|
253 | 10023 |
]. |
10024 |
||
10025 |
sema notNil ifTrue:[ |
|
306 | 10026 |
sema signal |
253 | 10027 |
] |
10028 |
||
10029 |
"Created: / 2.1.1998 / 18:20:20 / cg" |
|
306 | 10030 |
"Modified: / 3.2.1998 / 16:11:51 / cg" |
253 | 10031 |
! |
10032 |
||
10033 |
releaseSemaphoreFor:someObject |
|
10034 |
WaitTableAccess critical:[ |
|
261 | 10035 |
WaitTable removeKey:someObject ifAbsent:nil |
253 | 10036 |
] |
10037 |
||
10038 |
"Created: / 2.1.1998 / 18:17:14 / cg" |
|
10039 |
"Modified: / 2.1.1998 / 21:52:03 / cg" |
|
10040 |
! |
|
10041 |
||
10042 |
semaphoreFor:someObject |
|
10043 |
|sema| |
|
10044 |
||
10045 |
WaitTableAccess critical:[ |
|
261 | 10046 |
sema := WaitTable at:someObject ifAbsent:nil. |
10047 |
sema isNil ifTrue:[ |
|
10048 |
WaitTable at:someObject put:(sema := Semaphore new) |
|
10049 |
] |
|
253 | 10050 |
]. |
10051 |
^ sema |
|
10052 |
||
10053 |
"Created: / 2.1.1998 / 18:15:59 / cg" |
|
10054 |
"Modified: / 2.1.1998 / 18:20:31 / cg" |
|
10055 |
! ! |
|
10056 |
||
10057 |
!JavaVM class methodsFor:'vm support'! |
|
10058 |
||
10059 |
monitorEnter:someObject |
|
10060 |
| mon thisProcess| |
|
10061 |
||
10062 |
someObject isNil ifTrue:[ |
|
261 | 10063 |
self halt |
253 | 10064 |
]. |
10065 |
||
10066 |
mon := self monitorFor:someObject. |
|
10067 |
||
10068 |
MonitorTrace ifTrue:[ |
|
261 | 10069 |
('====> entering monitor for ' , someObject displayString , ' in ' , Processor activeProcess name , ' ...') printCR. |
253 | 10070 |
]. |
10071 |
mon enter. |
|
10072 |
MonitorTrace ifTrue:[ |
|
261 | 10073 |
('====> entered it in ' , Processor activeProcess name , ' ...') printCR. |
253 | 10074 |
]. |
10075 |
||
10076 |
self enteredMonitors add:someObject. |
|
10077 |
||
10078 |
"Created: / 2.1.1998 / 23:44:49 / cg" |
|
10079 |
"Modified: / 3.1.1998 / 03:05:02 / cg" |
|
10080 |
! |
|
10081 |
||
10082 |
monitorExit:someObject |
|
10083 |
| mon thisProcess| |
|
10084 |
||
10085 |
someObject isNil ifTrue:[ |
|
261 | 10086 |
self halt |
253 | 10087 |
]. |
10088 |
||
10089 |
mon := self monitorFor:someObject. |
|
10090 |
||
10091 |
MonitorTrace ifTrue:[ |
|
261 | 10092 |
('====> leaving monitor for ' , someObject displayString , ' in ' , Processor activeProcess name , ' ...') printCR. |
253 | 10093 |
]. |
10094 |
mon exit. |
|
10095 |
MonitorTrace ifTrue:[ |
|
261 | 10096 |
('====> left it in ' , Processor activeProcess name , ' ...') printCR. |
253 | 10097 |
]. |
10098 |
||
10099 |
"/ enteredMonitorHandles isNil ifTrue:[ |
|
10100 |
"/ self halt:'oops - no monitor entered'. |
|
10101 |
"/ ]. |
|
10102 |
||
10103 |
self enteredMonitors removeLast ~~ someObject ifTrue:[ |
|
261 | 10104 |
self halt:'oops - monitor enter/exit nesting wrong' |
253 | 10105 |
]. |
10106 |
||
10107 |
"Created: / 2.1.1998 / 23:47:28 / cg" |
|
10108 |
"Modified: / 3.1.1998 / 03:05:18 / cg" |
|
10109 |
! ! |
|
10110 |
||
255 | 10111 |
!JavaVM class methodsFor:'windows - events'! |
10112 |
||
10113 |
awtEventsForEvent:anEvent javaWindow:jWin |
|
10114 |
"given an ST/X event, create corresponding AWT event(s) for it" |
|
10115 |
||
10116 |
|jEv jEv1 jEv2 |
|
261 | 10117 |
modifiers key keyChar untranslatedKey id |
466 | 10118 |
type x y w h view menu resized moved |
255 | 10119 |
eventArgs clickCount jRect |
10120 |
jKeyEventClass jInputEventClass jMouseEventClass |
|
10121 |
jWindowEventClass jPaintEventClass jComponentEventClass| |
|
10122 |
||
10123 |
type := anEvent type. |
|
10124 |
eventArgs := anEvent arguments. |
|
10125 |
||
10126 |
key := 0. |
|
10127 |
modifiers := 0. |
|
10128 |
x := 0. |
|
10129 |
y := 0. |
|
10130 |
||
476 | 10131 |
|
10132 |
((type == #'exposeX:y:width:height:') |
|
10133 |
or:[(type == #'graphicExposeX:y:width:height:') |
|
10134 |
or:[(type == #damage)]]) ifTrue:[ |
|
10135 |
"/ jWindowEventClass := Java classForName:'java.awt.event.WindowEvent'. |
|
10136 |
"/ id := (jPaintEventClass instVarNamed:'PAINT'). |
|
10137 |
||
10138 |
jPaintEventClass := Java classForName:'java.awt.event.PaintEvent'. |
|
10139 |
id := (jPaintEventClass instVarNamed:'UPDATE'). |
|
10140 |
||
10141 |
((type == #'exposeX:y:width:height:') |
|
10142 |
or:[(type == #'graphicExposeX:y:width:height:')]) ifTrue:[ |
|
10143 |
x := eventArgs at:1. |
|
10144 |
y := eventArgs at:2. |
|
10145 |
w := eventArgs at:3. |
|
10146 |
h := eventArgs at:4. |
|
10147 |
] ifFalse:[ |
|
10148 |
x := eventArgs left. |
|
10149 |
y := eventArgs top. |
|
10150 |
w := eventArgs width. |
|
10151 |
h := eventArgs height. |
|
10152 |
]. |
|
10153 |
jRect := (Java classForName:'java.awt.Rectangle') basicNew. |
|
10154 |
jRect instVarNamed:'x' put:x. |
|
10155 |
jRect instVarNamed:'y' put:y. |
|
10156 |
jRect instVarNamed:'width' put:w. |
|
10157 |
jRect instVarNamed:'height' put:h. |
|
10158 |
||
10159 |
jEv := jPaintEventClass newCleared "basicNew". |
|
10160 |
jEv instVarNamed:'id' put:id. |
|
10161 |
jEv instVarNamed:'updateRect' put:jRect. |
|
10162 |
||
10163 |
"/ jEv instVarNamed:'g' put:jWin. |
|
10164 |
||
10165 |
^ Array with:jEv. |
|
10166 |
]. |
|
10167 |
||
255 | 10168 |
(anEvent isKeyEvent |
10169 |
or:[anEvent isButtonEvent |
|
10170 |
or:[anEvent isPointerEnterLeaveEvent]]) ifTrue:[ |
|
439 | 10171 |
jInputEventClass := Java classForName:'java.awt.event.InputEvent'. |
10172 |
||
255 | 10173 |
anEvent hasAlt ifTrue:[ |
10174 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'ALT_MASK') |
|
10175 |
]. |
|
10176 |
anEvent hasCtrl ifTrue:[ |
|
10177 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'CTRL_MASK') |
|
10178 |
]. |
|
10179 |
anEvent hasMeta ifTrue:[ |
|
10180 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'META_MASK') |
|
10181 |
]. |
|
10182 |
anEvent hasShift ifTrue:[ |
|
10183 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'SHIFT_MASK') |
|
10184 |
]. |
|
10185 |
anEvent hasButton1 ifTrue:[ |
|
10186 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'BUTTON1_MASK') |
|
10187 |
]. |
|
10188 |
anEvent hasButton2 ifTrue:[ |
|
10189 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'BUTTON2_MASK') |
|
10190 |
]. |
|
10191 |
anEvent hasButton3 ifTrue:[ |
|
10192 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'BUTTON3_MASK') |
|
10193 |
]. |
|
10194 |
||
10195 |
anEvent isPointerEnterLeaveEvent ifFalse:[ |
|
10196 |
"/ ST/X does not (yet) record this information |
|
10197 |
"/ with pointerLeave events. |
|
10198 |
||
10199 |
x := anEvent x. |
|
10200 |
y := anEvent y. |
|
10201 |
]. |
|
10202 |
]. |
|
10203 |
||
10204 |
anEvent isKeyEvent ifTrue:[ |
|
10205 |
jKeyEventClass := Java classForName:'java.awt.event.KeyEvent'. |
|
10206 |
||
10207 |
key := 0. |
|
10208 |
keyChar := 0. |
|
10209 |
||
10210 |
key := anEvent key. |
|
10211 |
key isCharacter ifTrue:[ |
|
10212 |
key := keyChar := key asciiValue |
|
10213 |
] ifFalse:[ |
|
10214 |
untranslatedKey := anEvent view device keyboardMap keyAtValue:key ifAbsent:key. |
|
482 | 10215 |
untranslatedKey == #Insert ifTrue:[ |
10216 |
key := jKeyEventClass instVarNamed:'VK_INSERT' |
|
10217 |
]. |
|
255 | 10218 |
untranslatedKey == #Delete ifTrue:[ |
10219 |
key := jKeyEventClass instVarNamed:'VK_DELETE' "/ 127 |
|
10220 |
]. |
|
10221 |
untranslatedKey == #BackSpace ifTrue:[ |
|
10222 |
key := jKeyEventClass instVarNamed:'VK_BACK_SPACE' "/ 8 |
|
10223 |
]. |
|
10224 |
untranslatedKey == #Return ifTrue:[ |
|
10225 |
key := jKeyEventClass instVarNamed:'VK_ENTER' "/ 13 |
|
10226 |
]. |
|
10227 |
untranslatedKey == #Tab ifTrue:[ |
|
10228 |
key := jKeyEventClass instVarNamed:'VK_TAB' "/ 9 |
|
10229 |
]. |
|
10230 |
untranslatedKey == #Home ifTrue:[ |
|
10231 |
key := jKeyEventClass instVarNamed:'VK_HOME' |
|
10232 |
]. |
|
10233 |
untranslatedKey == #End ifTrue:[ |
|
10234 |
key := jKeyEventClass instVarNamed:'VK_END' |
|
10235 |
]. |
|
482 | 10236 |
(key == #PreviousPage or:[untranslatedKey == #Prior]) ifTrue:[ |
255 | 10237 |
key := jKeyEventClass instVarNamed:'VK_PAGE_UP' |
10238 |
]. |
|
482 | 10239 |
(key == #NextPage or:[key == #EndOfText]) ifTrue:[ |
255 | 10240 |
key := jKeyEventClass instVarNamed:'VK_PAGE_DOWN' |
10241 |
]. |
|
10242 |
untranslatedKey == #CursorUp ifTrue:[ |
|
10243 |
key := jKeyEventClass instVarNamed:'VK_UP' |
|
10244 |
]. |
|
10245 |
untranslatedKey == #CursorDown ifTrue:[ |
|
10246 |
key := jKeyEventClass instVarNamed:'VK_DOWN' |
|
10247 |
]. |
|
10248 |
untranslatedKey == #CursorLeft ifTrue:[ |
|
10249 |
key := jKeyEventClass instVarNamed:'VK_LEFT' |
|
10250 |
]. |
|
10251 |
untranslatedKey == #CursorRight ifTrue:[ |
|
10252 |
key := jKeyEventClass instVarNamed:'VK_RIGHT' |
|
10253 |
]. |
|
482 | 10254 |
(#( F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12) |
255 | 10255 |
includes:untranslatedKey) ifTrue:[ |
10256 |
key := jKeyEventClass instVarNamed:('VK_' , untranslatedKey) |
|
10257 |
]. |
|
10258 |
]. |
|
10259 |
(type == #'keyPress:x:y:') ifTrue:[ |
|
10260 |
id := jKeyEventClass instVarNamed:'KEY_PRESSED' |
|
10261 |
] ifFalse:[ |
|
10262 |
id := jKeyEventClass instVarNamed:'KEY_RELEASED' |
|
10263 |
]. |
|
261 | 10264 |
jEv := jKeyEventClass newCleared "basicNew". |
255 | 10265 |
jEv instVarNamed:'modifiers' put:modifiers. |
10266 |
jEv instVarNamed:'keyCode' put:key. |
|
10267 |
jEv instVarNamed:'keyChar' put:keyChar. |
|
10268 |
jEv instVarNamed:'id' put:id. |
|
10269 |
"/ jEv instVarNamed:'x' put:x. |
|
10270 |
"/ jEv instVarNamed:'y' put:y. |
|
10271 |
jEv instVarNamed:'when' put:(OperatingSystem getMillisecondTime). |
|
10272 |
^ Array with:jEv |
|
10273 |
]. |
|
10274 |
||
10275 |
(anEvent isButtonEvent |
|
10276 |
or:[anEvent isPointerEnterLeaveEvent]) ifTrue:[ |
|
10277 |
jMouseEventClass := Java classForName:'java.awt.event.MouseEvent'. |
|
10278 |
clickCount := 1. |
|
10279 |
||
10280 |
(type == #'buttonPress:x:y:') ifTrue:[ |
|
270 | 10281 |
id := jMouseEventClass instVarNamed:'MOUSE_PRESSED'. |
255 | 10282 |
] ifFalse:[ |
10283 |
(type == #'buttonRelease:x:y:') ifTrue:[ |
|
270 | 10284 |
id := jMouseEventClass instVarNamed:'MOUSE_RELEASED'. |
255 | 10285 |
] ifFalse:[ |
10286 |
(type == #'buttonMotion:x:y:') ifTrue:[ |
|
439 | 10287 |
anEvent state == 0 ifTrue:[ |
270 | 10288 |
id := jMouseEventClass instVarNamed:'MOUSE_MOVED'. |
10289 |
] ifFalse:[ |
|
10290 |
id := jMouseEventClass instVarNamed:'MOUSE_DRAGGED'. |
|
10291 |
]. |
|
255 | 10292 |
] ifFalse:[ |
10293 |
"/ (type == #'pointerMotion:x:y:') ifTrue:[ |
|
270 | 10294 |
"/ id := jMouseEventClass instVarNamed:'MOUSE_MOVED'. |
255 | 10295 |
"/ ] ifFalse:[ |
10296 |
(type == #'pointerEnter:x:y:') ifTrue:[ |
|
270 | 10297 |
id := jMouseEventClass instVarNamed:'MOUSE_ENTERED'. |
255 | 10298 |
] ifFalse:[ |
10299 |
(type == #'pointerLeave:') ifTrue:[ |
|
270 | 10300 |
id := jMouseEventClass instVarNamed:'MOUSE_EXITED'. |
255 | 10301 |
] ifFalse:[ |
10302 |
(type == #'buttonMultiPress:x:y:') ifTrue:[ |
|
10303 |
id := jMouseEventClass instVarNamed:'MOUSE_PRESSED'. |
|
10304 |
clickCount := 2. |
|
10305 |
] ifFalse:[ |
|
10306 |
self halt. |
|
10307 |
] |
|
10308 |
] |
|
10309 |
"/ ] |
|
10310 |
] |
|
10311 |
] |
|
10312 |
] |
|
10313 |
]. |
|
261 | 10314 |
jEv := jMouseEventClass newCleared "basicNew". |
255 | 10315 |
jEv instVarNamed:'modifiers' put:modifiers. |
10316 |
jEv instVarNamed:'id' put:id. |
|
10317 |
jEv instVarNamed:'x' put:x. |
|
10318 |
jEv instVarNamed:'y' put:y. |
|
10319 |
jEv instVarNamed:'when' put:(OperatingSystem getMillisecondTime). |
|
10320 |
^ Array with:jEv |
|
10321 |
]. |
|
10322 |
||
10323 |
||
10324 |
(type == #'configureX:y:width:height:') ifTrue:[ |
|
261 | 10325 |
"/ x := eventArgs at:1. |
10326 |
"/ y := eventArgs at:2. |
|
10327 |
||
10328 |
view := anEvent view. |
|
466 | 10329 |
x := eventArgs at:1. |
10330 |
y := eventArgs at:2. |
|
261 | 10331 |
w := eventArgs at:3. |
10332 |
h := eventArgs at:4. |
|
10333 |
||
466 | 10334 |
resized := moved := true. |
10335 |
(w == view width and:[h == view height]) ifTrue:[ |
|
10336 |
resized := false. |
|
10337 |
]. |
|
10338 |
(x == view left and:[y == view top]) ifTrue:[ |
|
10339 |
moved := false. |
|
10340 |
]. |
|
10341 |
||
261 | 10342 |
"/ |
10343 |
"/ must change the components extent |
|
10344 |
"/ is there no cleaner way to do this ? |
|
10345 |
"/ |
|
10346 |
view isTopView ifTrue:[ |
|
466 | 10347 |
|
261 | 10348 |
"/ |
10349 |
"/ sigh - don't include the menu. |
|
10350 |
"/ |
|
10351 |
menu := self topViewsMenu:view. |
|
10352 |
menu notNil ifTrue:[ |
|
10353 |
"/ must add the menus height |
|
10354 |
h := h - menu height |
|
10355 |
] |
|
10356 |
]. |
|
466 | 10357 |
|
261 | 10358 |
jWin instVarNamed:'width' put:w. |
10359 |
jWin instVarNamed:'height' put:h. |
|
10360 |
||
255 | 10361 |
jComponentEventClass := Java classForName:'java.awt.event.ComponentEvent'. |
466 | 10362 |
moved ifTrue:[ |
10363 |
id := (jComponentEventClass instVarNamed:'COMPONENT_MOVED'). |
|
10364 |
jEv1 := jComponentEventClass newCleared "basicNew". |
|
10365 |
jEv1 instVarNamed:'id' put:id. |
|
10366 |
]. |
|
10367 |
resized ifTrue:[ |
|
10368 |
id := (jComponentEventClass instVarNamed:'COMPONENT_RESIZED'). |
|
10369 |
jEv2 := jComponentEventClass newCleared "basicNew". |
|
10370 |
jEv2 instVarNamed:'id' put:id. |
|
10371 |
]. |
|
10372 |
jEv1 isNil ifTrue:[ |
|
10373 |
jEv2 isNil ifTrue:[^ nil]. |
|
10374 |
^ Array with:jEv2 |
|
10375 |
] ifFalse:[ |
|
10376 |
jEv2 isNil ifTrue:[ |
|
10377 |
^ Array with:jEv1 |
|
10378 |
] |
|
10379 |
]. |
|
255 | 10380 |
^ Array with:jEv1 with:jEv2. |
10381 |
]. |
|
10382 |
(type == #'focusIn') ifTrue:[ |
|
318 | 10383 |
"/ 'focusIn' printCR. |
255 | 10384 |
jComponentEventClass := Java classForName:'java.awt.event.FocusEvent'. |
10385 |
id := (jComponentEventClass instVarNamed:'FOCUS_GAINED'). |
|
261 | 10386 |
jEv := jComponentEventClass newCleared "basicNew". |
255 | 10387 |
jEv instVarNamed:'id' put:id. |
10388 |
^ Array with:jEv. |
|
10389 |
]. |
|
10390 |
(type == #'focusOut') ifTrue:[ |
|
318 | 10391 |
"/ 'focusOut' printCR. |
255 | 10392 |
jComponentEventClass := Java classForName:'java.awt.event.FocusEvent'. |
10393 |
id := (jComponentEventClass instVarNamed:'FOCUS_LOST'). |
|
261 | 10394 |
jEv := jComponentEventClass newCleared "basicNew". |
255 | 10395 |
jEv instVarNamed:'id' put:id. |
10396 |
^ Array with:jEv. |
|
10397 |
]. |
|
10398 |
(type == #'mapped') ifTrue:[ |
|
318 | 10399 |
"/ 'mapped' printCR. |
255 | 10400 |
jComponentEventClass := Java classForName:'java.awt.event.ComponentEvent'. |
10401 |
id := (jComponentEventClass instVarNamed:'COMPONENT_SHOWN'). |
|
10402 |
"/ x := eventArgs at:1. |
|
10403 |
"/ y := eventArgs at:2. |
|
261 | 10404 |
jEv := jComponentEventClass newCleared "basicNew". |
255 | 10405 |
jEv instVarNamed:'id' put:id. |
10406 |
^ Array with:jEv. |
|
10407 |
]. |
|
10408 |
(type == #'unmapped') ifTrue:[ |
|
318 | 10409 |
"/ 'unmapped' printCR. |
255 | 10410 |
jComponentEventClass := Java classForName:'java.awt.event.ComponentEvent'. |
10411 |
id := (jComponentEventClass instVarNamed:'COMPONENT_HIDDEN'). |
|
10412 |
"/ x := eventArgs at:1. |
|
10413 |
"/ y := eventArgs at:2. |
|
261 | 10414 |
jEv := jComponentEventClass newCleared "basicNew". |
255 | 10415 |
jEv instVarNamed:'id' put:id. |
10416 |
^ Array with:jEv. |
|
10417 |
]. |
|
10418 |
||
10419 |
(type == #terminate) ifTrue:[ |
|
10420 |
jWindowEventClass := Java classForName:'java.awt.event.WindowEvent'. |
|
474 | 10421 |
id := (jWindowEventClass instVarNamed:'WINDOW_CLOSING'). |
10422 |
"/OLD id := (jWindowEventClass instVarNamed:'WINDOW_CLOSED'). |
|
261 | 10423 |
jEv := jWindowEventClass newCleared "basicNew". |
255 | 10424 |
jEv instVarNamed:'id' put:id. |
10425 |
^ Array with:jEv. |
|
10426 |
]. |
|
439 | 10427 |
|
319 | 10428 |
EventTrace == true ifTrue:[ |
10429 |
('JAVA: unhandled event:' , type) infoPrintCR. |
|
10430 |
]. |
|
255 | 10431 |
^ nil. |
10432 |
||
10433 |
"Created: / 6.1.1998 / 20:38:58 / cg" |
|
482 | 10434 |
"Modified: / 4.12.1998 / 15:27:47 / cg" |
255 | 10435 |
! |
10436 |
||
10437 |
doWindowsEventThread |
|
10438 |
"invoked in an endless loop by the WToolkit-eventLoop |
|
10439 |
native method." |
|
10440 |
||
270 | 10441 |
|sensor event more| |
255 | 10442 |
|
10443 |
JavaWindowGroup isNil ifTrue:[ |
|
270 | 10444 |
"/ '*** eventThread: no windowGroup ...' printCR. |
284 | 10445 |
FirstWindowCreationSemaphore wait. |
10446 |
"/ Delay waitForSeconds:0.1. |
|
270 | 10447 |
^ self |
255 | 10448 |
]. |
10449 |
||
10450 |
KnownWindows isNil ifTrue:[ |
|
270 | 10451 |
"/ '*** eventThread: no views ...' printCR. |
284 | 10452 |
FirstWindowCreationSemaphore wait. |
10453 |
"/ Delay waitForSeconds:0.1. |
|
270 | 10454 |
^ self |
255 | 10455 |
]. |
10456 |
||
10457 |
"/ wait for an event to arrive ... |
|
10458 |
||
10459 |
sensor := JavaWindowGroup sensor. |
|
329 | 10460 |
[sensor hasEvents or:[sensor damageCount ~~ 0]] whileFalse:[ |
270 | 10461 |
EventTrace ifTrue:[ |
10462 |
'*** eventThread waiting ...' printCR. |
|
10463 |
]. |
|
10464 |
Processor activeProcess state:#eventWait. |
|
10465 |
sensor eventSemaphore wait. |
|
255 | 10466 |
]. |
10467 |
||
10468 |
EventTrace ifTrue:[ |
|
270 | 10469 |
'*** eventThread event arrived ...' printCR. |
255 | 10470 |
]. |
10471 |
||
10472 |
"/ EventTrace := true |
|
270 | 10473 |
more := true. |
10474 |
[more] whileTrue:[ |
|
10475 |
sensor hasDamage ifTrue:[ |
|
10476 |
EventTrace ifTrue:[ |
|
10477 |
'*** eventThread: damage arrived ...' printCR. |
|
10478 |
]. |
|
10479 |
event := sensor nextDamage. |
|
10480 |
] ifFalse:[ |
|
10481 |
event := sensor nextEvent. |
|
10482 |
]. |
|
10483 |
event isNil ifTrue:[ |
|
319 | 10484 |
EventTrace == true ifTrue:[ |
10485 |
'*** eventThread: nil event ignored' printCR. |
|
10486 |
]. |
|
270 | 10487 |
^ self |
10488 |
]. |
|
10489 |
||
10490 |
more := self processEvent:event |
|
10491 |
] |
|
255 | 10492 |
|
10493 |
"Created: / 6.1.1998 / 21:02:40 / cg" |
|
329 | 10494 |
"Modified: / 5.4.1998 / 16:10:53 / cg" |
255 | 10495 |
! |
10496 |
||
10497 |
processEvent:event |
|
439 | 10498 |
|evQ jEvents jWToolKitClass jWToolKit jWinPeer jWin v eventConsumed| |
255 | 10499 |
|
10500 |
KnownWindows isNil ifTrue:[ |
|
270 | 10501 |
^ false |
255 | 10502 |
]. |
10503 |
||
10504 |
v := event view. |
|
261 | 10505 |
jWinPeer := self jPeerForView:v. |
255 | 10506 |
jWinPeer isNil ifTrue:[ |
482 | 10507 |
v isJavaView ifTrue:[ |
261 | 10508 |
"/ mhmh - an event for a JavaView, |
10509 |
"/ which has no peer (anyMore ?) |
|
10510 |
"/ should not happen. |
|
10511 |
] ifFalse:[ |
|
10512 |
"/ mhmh - an event for a subcomponent of an ST widget. |
|
10513 |
"/ let it be handled normally. |
|
255 | 10514 |
EventTrace ifTrue:[ |
261 | 10515 |
('*** eventThread: ' , event type , '-event for unknown java-view - passed to view.') printCR. |
255 | 10516 |
]. |
359 | 10517 |
event view dispatchEvent:event. |
255 | 10518 |
]. |
270 | 10519 |
^ true |
261 | 10520 |
]. |
10521 |
||
10522 |
"/ change: |
|
10523 |
"/ in the previous version, events for ST/X widgets (i.e. buttons etc) |
|
10524 |
"/ where not passed to java, but instead forwarded directly to the widget |
|
10525 |
"/ by the code below. |
|
10526 |
"/ This has changed, to pass it to Java, which eventually passes it to the |
|
10527 |
"/ peer via the handleEvent native method (unless the event got consumed). |
|
10528 |
"/ This is req'd to let java keep track of keyboard/mouse input for widgets. |
|
10529 |
||
10530 |
false ifTrue:[ |
|
10531 |
"/ "/ most views handle their events themself (being ST/X views) ... |
|
10532 |
"/ |
|
10533 |
"/ v class ~~ JavaView ifTrue:[ |
|
10534 |
"/"/ v class ~~ StandardSystemView ifTrue:[ |
|
10535 |
"/"/ EventTrace ifTrue:[ |
|
10536 |
"/"/ ('*** eventThread: event handled by view itself (' , v class name , ')') printCR. |
|
10537 |
"/"/ ]. |
|
10538 |
"/"/ event sendEventWithFocusOn:nil. |
|
10539 |
"/"/ ^ self. |
|
10540 |
"/"/ ]. |
|
10541 |
"/ (event type == #'exposeX:y:width:height' |
|
10542 |
"/ or:[event type == #'graphicsExposeX:y:width:height']) ifTrue:[ |
|
10543 |
"/ "/ send to view, but also handle in JAVA |
|
10544 |
"/ event sendEventWithFocusOn:nil. |
|
10545 |
"/ ] |
|
10546 |
"/ ]. |
|
10547 |
||
10548 |
(#( |
|
10549 |
#'mapped' |
|
10550 |
#'unmapped' |
|
10551 |
#'configureX:y:width:height:' |
|
10552 |
#'exposeX:y:width:height:' |
|
10553 |
#'graphicsExposeX:y:width:height:' |
|
10554 |
) includes:event type) ifTrue:[ |
|
255 | 10555 |
event sendEventWithFocusOn:nil. |
10556 |
]. |
|
261 | 10557 |
]. |
10558 |
||
10559 |
"/ what a kludge - some events are passed back to |
|
10560 |
"/ ST via the WComponent-handleEvent native method. |
|
10561 |
"/ However, repaints are not. |
|
10562 |
"/ In order to let ST widgets do the drawing, |
|
10563 |
"/ selectively filter exposeEvents from Java ... |
|
10564 |
||
10565 |
eventConsumed := false. |
|
482 | 10566 |
v isJavaView ifTrue:[ |
261 | 10567 |
"/ all events handled by Java ... |
10568 |
] ifFalse:[ |
|
10569 |
eventConsumed := true. |
|
10570 |
||
10571 |
"/ let widget handle it. |
|
359 | 10572 |
event view dispatchEvent:event. |
261 | 10573 |
|
10574 |
"/ some are not passed to Java ... |
|
10575 |
event isDamage ifTrue:[ |
|
480 | 10576 |
(v isKindOf:Button) ifTrue:[ |
10577 |
^ true |
|
10578 |
]. |
|
261 | 10579 |
(v isKindOf:TextView) ifTrue:[ |
270 | 10580 |
^ true |
10581 |
]. |
|
10582 |
(v isKindOf:Label) ifTrue:[ |
|
10583 |
^ true |
|
10584 |
]. |
|
10585 |
(v isKindOf:ComboBoxView) ifTrue:[ |
|
10586 |
^ true |
|
10587 |
]. |
|
10588 |
(v isKindOf:ScrollBar) ifTrue:[ |
|
482 | 10589 |
^ true |
261 | 10590 |
]. |
270 | 10591 |
(v isKindOf:Scroller) ifTrue:[ |
482 | 10592 |
^ true |
261 | 10593 |
]. |
270 | 10594 |
(v isKindOf:MenuPanel) ifTrue:[ |
10595 |
^ true |
|
10596 |
]. |
|
261 | 10597 |
]. |
10598 |
]. |
|
255 | 10599 |
|
10600 |
jWin := jWinPeer instVarNamed:'target'. |
|
10601 |
||
10602 |
EventTrace ifTrue:[ |
|
10603 |
('*** eventThread: event (' , event type , ') handled by JAVA: ') infoPrint. |
|
10604 |
jWinPeer class name infoPrint. ' (' infoPrint. |
|
10605 |
jWin class name infoPrint. ')' infoPrintCR. |
|
10606 |
]. |
|
10607 |
||
10608 |
"/ create an event |
|
10609 |
||
10610 |
jEvents := self awtEventsForEvent:event javaWindow:jWin. |
|
10611 |
jEvents isNil ifTrue:[ |
|
10612 |
EventTrace ifTrue:[ |
|
10613 |
('*** eventThread: event ignored: ' , event type) printCR. |
|
10614 |
]. |
|
270 | 10615 |
^ true |
255 | 10616 |
]. |
10617 |
||
10618 |
"/ v superView isNil ifTrue:[ |
|
10619 |
"/ ('*** eventThread: event ignored for topView: ' , event type) printCR. |
|
10620 |
"/ ^ self |
|
10621 |
"/ ]. |
|
10622 |
||
439 | 10623 |
jWToolKitClass := Java classForName:'java.awt.Toolkit'. |
10624 |
"/ jWToolKit := jWToolKitClass perform:#getDefaultToolkit. |
|
10625 |
jWToolKit := jWToolKitClass performStatic:#'getDefaultToolkit()Ljava/awt/Toolkit;'. |
|
255 | 10626 |
|
10627 |
jEvents do:[:jEv | |
|
10628 |
jEv instVarNamed:'source' put:jWin. |
|
10629 |
jEv instVarNamed:'consumed' put:0. |
|
261 | 10630 |
eventConsumed ifFalse:[ |
10631 |
"/ the first gets the original event as data |
|
10632 |
jEv instVarNamed:'data' put:event. |
|
10633 |
eventConsumed := true |
|
10634 |
]. |
|
255 | 10635 |
|
10636 |
"/ post it (them) to the event queue |
|
318 | 10637 |
EventTrace == true ifTrue:[ |
10638 |
'postEvent to Java ...' printCR. |
|
10639 |
]. |
|
439 | 10640 |
jWToolKit "class" perform:#'postEvent(Ljava/awt/AWTEvent;)V' with:jEv. |
255 | 10641 |
]. |
10642 |
||
270 | 10643 |
^ false |
10644 |
||
255 | 10645 |
"Created: / 6.1.1998 / 20:36:36 / cg" |
482 | 10646 |
"Modified: / 4.12.1998 / 15:25:09 / cg" |
255 | 10647 |
! ! |
10648 |
||
253 | 10649 |
!JavaVM class methodsFor:'documentation'! |
10650 |
||
10651 |
version |
|
482 | 10652 |
^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaVM.st,v 1.90 1998/12/04 14:37:29 cg Exp $' |
253 | 10653 |
! ! |
10654 |
JavaVM initialize! |