author | cg |
Thu, 03 Dec 1998 20:38:52 +0000 | |
changeset 480 | 9aec33a9e04d |
parent 479 | 0ae3179779eb |
child 482 | 08fd07acb9b7 |
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. |
307 | 3304 |
FileOpenConfirmation ifTrue:[ |
3305 |
(self confirm:('JAVA Security check\\Create directory ''' , path , '''.\Grant permission ?') withCRs) |
|
3306 |
ifFalse:[ |
|
3307 |
^ 0 "/ FALSE |
|
3308 |
] |
|
3309 |
]. |
|
3310 |
f := path asFilename. |
|
3311 |
OperatingSystem accessDeniedErrorSignal handle:[:ex | |
|
3312 |
^ 0 "/ FALSE |
|
3313 |
] do:[ |
|
3314 |
f makeDirectory. |
|
3315 |
]. |
|
3316 |
f exists ifTrue:[ |
|
3317 |
f isDirectory ifTrue:[^ 1 "TRUE"] |
|
3318 |
] |
|
3319 |
]. |
|
3320 |
^ 0 "FALSE" |
|
3321 |
||
3322 |
"Created: / 4.2.1998 / 00:19:05 / cg" |
|
405 | 3323 |
"Modified: / 20.10.1998 / 21:00:25 / cg" |
307 | 3324 |
! |
3325 |
||
440 | 3326 |
_File_renameTo0:nativeContext |
479 | 3327 |
"/ void renameTo0 (java.io.File) |
3328 |
||
3329 |
|oldFile newFile oldPath newPath oldF newF| |
|
3330 |
||
3331 |
oldFile := nativeContext receiver. |
|
3332 |
oldPath := oldFile instVarNamed:'path'. |
|
480 | 3333 |
oldPath isNil ifTrue:[^ 0]. "/ FALSE |
3334 |
||
3335 |
oldPath := Java as_ST_String:oldPath. |
|
3336 |
oldF := oldPath asFilename. |
|
3337 |
||
3338 |
newFile := nativeContext argAt:1. |
|
3339 |
newPath := newFile instVarNamed:'path'. |
|
3340 |
newPath isNil ifTrue:[^ 0]. "/ FALSE |
|
3341 |
newPath := Java as_ST_String:newPath. |
|
3342 |
||
3343 |
newF := newPath asFilename. |
|
3344 |
||
3345 |
(self checkWritePermissionOfDirectory:oldF directory message:('JAVA Security check\\Rename of ''' , oldPath , ''' to ''' , newPath , '''.\Grant permission ?')) |
|
3346 |
ifFalse:[ |
|
3347 |
^ 0 "/ FALSE |
|
3348 |
]. |
|
3349 |
oldF directory pathName ~= newF directory pathName ifTrue:[ |
|
3350 |
(self checkWritePermissionOfDirectory:newF directory message:('JAVA Security check\\Rename of ''' , oldPath , ''' to ''' , newPath , '''.\Grant permission ?')) |
|
3351 |
ifFalse:[ |
|
3352 |
^ 0 "/ FALSE |
|
3353 |
]. |
|
3354 |
]. |
|
3355 |
||
3356 |
OperatingSystem accessDeniedErrorSignal handle:[:ex | |
|
3357 |
^ 0 "/ FALSE |
|
3358 |
] do:[ |
|
3359 |
oldF renameTo:newF. |
|
3360 |
^ 1 "/ TRUE |
|
3361 |
]. |
|
3362 |
^ 0 "/ FALSE |
|
3363 |
||
3364 |
"Modified: / 3.12.1998 / 21:01:08 / cg" |
|
440 | 3365 |
! |
3366 |
||
3367 |
_File_rmdir0:nativeContext |
|
3368 |
"/ boolean rmdir0 () |
|
3369 |
UnimplementedNativeMethodSignal raise |
|
3370 |
||
3371 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3372 |
"Created: / 12.11.1998 / 19:03:52 / cg" |
|
3373 |
! |
|
3374 |
||
3375 |
_ObjectInputStream_allocateNewArray:nativeContext |
|
3376 |
"/ java.lang.Object allocateNewArray (java.lang.Class int) |
|
3377 |
UnimplementedNativeMethodSignal raise |
|
3378 |
||
3379 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3380 |
"Created: / 12.11.1998 / 19:02:52 / cg" |
|
3381 |
! |
|
3382 |
||
3383 |
_ObjectInputStream_allocateNewObject:nativeContext |
|
3384 |
"/ java.lang.Object allocateNewObject (java.lang.Class java.lang.Class) |
|
3385 |
UnimplementedNativeMethodSignal raise |
|
3386 |
||
3387 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3388 |
"Created: / 12.11.1998 / 19:02:40 / cg" |
|
3389 |
! |
|
3390 |
||
3391 |
_ObjectInputStream_inputClassFields:nativeContext |
|
3392 |
"/ void inputClassFields (java.lang.Object java.lang.Class int[]) |
|
3393 |
UnimplementedNativeMethodSignal raise |
|
3394 |
||
3395 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3396 |
"Created: / 12.11.1998 / 19:02:22 / cg" |
|
3397 |
! |
|
3398 |
||
3399 |
_ObjectInputStream_invokeObjectReader:nativeContext |
|
3400 |
"/ boolean invokeObjectReader (java.lang.Object java.lang.Class) |
|
3401 |
UnimplementedNativeMethodSignal raise |
|
3402 |
||
3403 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3404 |
"Created: / 12.11.1998 / 19:03:06 / cg" |
|
3405 |
! |
|
3406 |
||
3407 |
_ObjectInputStream_loadClass0:nativeContext |
|
3408 |
"/ java.lang.Class loadClass0 (java.lang.Class java.lang.String) |
|
3409 |
UnimplementedNativeMethodSignal raise |
|
3410 |
||
3411 |
"Created: / 12.11.1998 / 19:01:15 / cg" |
|
3412 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3413 |
! |
|
3414 |
||
3415 |
_ObjectOutputStream_invokeObjectWriter:nativeContext |
|
3416 |
"/ boolean invokeObjectWriter (java.lang.Object java.lang.Class) |
|
3417 |
UnimplementedNativeMethodSignal raise |
|
3418 |
||
3419 |
"Created: / 12.11.1998 / 19:00:36 / cg" |
|
3420 |
"Modified: / 12.11.1998 / 19:01:45 / cg" |
|
3421 |
! |
|
3422 |
||
3423 |
_ObjectOutputStream_outputClassFields:nativeContext |
|
3424 |
"/ void outputClassFields (java.lang.Object java.lang.Class int[]) |
|
3425 |
UnimplementedNativeMethodSignal raise |
|
3426 |
||
3427 |
"Created: / 12.11.1998 / 19:00:09 / cg" |
|
3428 |
"Modified: / 12.11.1998 / 19:01:42 / cg" |
|
3429 |
! |
|
3430 |
||
3431 |
_ObjectStreamClass_getClassAccess:nativeContext |
|
3432 |
"/ int getClassAccess (java.lang.Class) |
|
3433 |
UnimplementedNativeMethodSignal raise |
|
3434 |
||
3435 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3436 |
"Created: / 12.11.1998 / 19:04:19 / cg" |
|
3437 |
! |
|
3438 |
||
3439 |
_ObjectStreamClass_getFieldAccess:nativeContext |
|
3440 |
"/ int getFieldAccess (java.lang.Class java.lang.String) |
|
3441 |
UnimplementedNativeMethodSignal raise |
|
3442 |
||
3443 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3444 |
"Created: / 12.11.1998 / 19:05:19 / cg" |
|
3445 |
! |
|
3446 |
||
3447 |
_ObjectStreamClass_getFieldSignatures:nativeContext |
|
3448 |
"/ java.lang.String[] getFieldSignatures (java.lang.Class) |
|
3449 |
UnimplementedNativeMethodSignal raise |
|
3450 |
||
3451 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3452 |
"Created: / 12.11.1998 / 19:05:04 / cg" |
|
3453 |
! |
|
3454 |
||
3455 |
_ObjectStreamClass_getFields0:nativeContext |
|
3456 |
"/ java.io.ObjectStreamField[] getFields0 (java.lang.Class) |
|
3457 |
UnimplementedNativeMethodSignal raise |
|
3458 |
||
3459 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3460 |
"Created: / 12.11.1998 / 19:05:32 / cg" |
|
3461 |
! |
|
3462 |
||
3463 |
_ObjectStreamClass_getMethodAccess:nativeContext |
|
3464 |
"/ int getMethodAccess (java.lang.Class java.lang.String) |
|
3465 |
UnimplementedNativeMethodSignal raise |
|
3466 |
||
3467 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3468 |
"Created: / 12.11.1998 / 19:04:51 / cg" |
|
3469 |
! |
|
3470 |
||
3471 |
_ObjectStreamClass_getMethodSignatures:nativeContext |
|
3472 |
"/ java.lang.String[] getMethodSignatures (java.lang.Class) |
|
3473 |
UnimplementedNativeMethodSignal raise |
|
3474 |
||
3475 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3476 |
"Created: / 12.11.1998 / 19:04:34 / cg" |
|
3477 |
! |
|
3478 |
||
3479 |
_ObjectStreamClass_getSerialVersionUID:nativeContext |
|
3480 |
"/ long getSerialVersionUID (java.lang.Class) |
|
3481 |
UnimplementedNativeMethodSignal raise |
|
3482 |
||
3483 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3484 |
"Created: / 12.11.1998 / 19:05:43 / cg" |
|
3485 |
! |
|
3486 |
||
3487 |
_ObjectStreamClass_hasWriteObject:nativeContext |
|
3488 |
"/ boolean hasWriteObject (java.lang.Class) |
|
3489 |
UnimplementedNativeMethodSignal raise |
|
3490 |
||
3491 |
"Modified: / 12.11.1998 / 19:01:48 / cg" |
|
3492 |
"Created: / 12.11.1998 / 19:05:53 / cg" |
|
3493 |
! |
|
3494 |
||
307 | 3495 |
_RandomAccessFile_close:nativeContext |
3496 |
^ self anyStream_close:nativeContext |
|
3497 |
||
3498 |
"Created: / 4.2.1998 / 13:26:53 / cg" |
|
3499 |
"Modified: / 4.2.1998 / 15:21:08 / cg" |
|
3500 |
! |
|
3501 |
||
3502 |
_RandomAccessFile_length:nativeContext |
|
3503 |
|file sz| |
|
3504 |
||
3505 |
file := self validateFile:(nativeContext receiver). |
|
3506 |
||
3507 |
FileIOTrace ifTrue:[ |
|
3508 |
('JAVA: length of ' , file pathName) infoPrintCR. |
|
3509 |
]. |
|
3510 |
||
3511 |
sz := file size. |
|
3512 |
^ sz. |
|
3513 |
||
3514 |
"Created: / 4.2.1998 / 13:27:58 / cg" |
|
3515 |
! |
|
3516 |
||
3517 |
_RandomAccessFile_open:nativeContext |
|
442 | 3518 |
|fs fd name dir stream fileNo answer readonly| |
3519 |
||
3520 |
readonly := false. |
|
307 | 3521 |
|
3522 |
fs := nativeContext receiver. |
|
3523 |
fd := fs instVarNamed:'fd'. |
|
3524 |
(fd instVarNamed:'fd') ~~ 0 ifTrue:[ |
|
3525 |
self halt:'file already open'. |
|
3526 |
self internalError:'file already open'. |
|
3527 |
^ self. |
|
3528 |
]. |
|
3529 |
||
3530 |
name := nativeContext argAt:1. |
|
3531 |
name := Java as_ST_String:name. |
|
405 | 3532 |
name := self fixFilename:name. |
307 | 3533 |
|
3534 |
FileOpenTrace ifTrue:[ |
|
3535 |
('JAVA: opening ' , name) infoPrintCR. |
|
3536 |
]. |
|
3537 |
||
3538 |
dir := name asFilename directory pathName. |
|
442 | 3539 |
|
307 | 3540 |
(PermittedDirectories notNil |
3541 |
and:[PermittedDirectories includes:dir]) ifFalse:[ |
|
3542 |
FileOpenConfirmation ifTrue:[ |
|
442 | 3543 |
answer := Dialog |
3544 |
confirmWithCancel:('JAVA Security check\\Opening ''' , name , ''' for read/write.\Grant permission ?') withCRs |
|
3545 |
labels:#('no' 'grant' 'readonly') |
|
3546 |
values:#(false true #readonly) |
|
3547 |
default:3. |
|
3548 |
answer == false ifTrue:[ |
|
307 | 3549 |
self throwIOExceptionWithMessage:('no permission to open ' , name , ' for writing'). |
3550 |
^ self |
|
3551 |
]. |
|
442 | 3552 |
readonly := (answer == #readonly). |
3553 |
||
3554 |
readonly ifFalse:[ |
|
3555 |
(self confirm:('JAVA Security check\\Always permit writes in this directory (''' , dir , ''') ?') withCRs) |
|
3556 |
ifTrue:[ |
|
3557 |
PermittedDirectories isNil ifTrue:[ |
|
3558 |
PermittedDirectories := Set new |
|
3559 |
]. |
|
3560 |
PermittedDirectories add:dir. |
|
3561 |
] |
|
307 | 3562 |
] |
3563 |
] |
|
3564 |
]. |
|
3565 |
||
442 | 3566 |
readonly ifTrue:[ |
3567 |
stream := name asFilename readStream. |
|
3568 |
] ifFalse:[ |
|
3569 |
stream := name asFilename readWriteStream. |
|
3570 |
]. |
|
307 | 3571 |
stream isNil ifTrue:[ |
3572 |
self throwIOExceptionWithMessage:('cannot open ' , name , ' for writing'). |
|
3573 |
]. |
|
3574 |
||
3575 |
fileNo := self addOpenFile:stream. |
|
3576 |
||
3577 |
FileOpenTrace ifTrue:[ |
|
3578 |
('JAVA: opened ' , name , ' as FD ' , fileNo printString , ' for writing') infoPrintCR. |
|
3579 |
]. |
|
3580 |
||
3581 |
fd instVarNamed:'fd' put:fileNo. |
|
3582 |
||
3583 |
"Created: / 4.2.1998 / 00:14:48 / cg" |
|
442 | 3584 |
"Modified: / 12.11.1998 / 21:29:46 / cg" |
307 | 3585 |
! |
3586 |
||
3587 |
_RandomAccessFile_readBytes:nativeContext |
|
3588 |
^ self anyStream_readBytes:nativeContext |
|
3589 |
||
3590 |
"Modified: / 4.2.1998 / 15:23:27 / cg" |
|
3591 |
! |
|
3592 |
||
3593 |
_RandomAccessFile_seek:nativeContext |
|
3594 |
|file pos| |
|
3595 |
||
3596 |
file := self validateFile:(nativeContext receiver). |
|
3597 |
||
3598 |
FileIOTrace ifTrue:[ |
|
3599 |
('JAVA: seek on ' , file pathName) infoPrintCR. |
|
3600 |
]. |
|
3601 |
||
3602 |
pos := nativeContext argAt:1. |
|
3603 |
file position:pos+1 "/ ST/X position starts at 1 |
|
3604 |
||
3605 |
"Created: / 4.2.1998 / 13:25:38 / cg" |
|
3606 |
"Modified: / 4.2.1998 / 13:28:12 / cg" |
|
3607 |
! |
|
3608 |
||
3609 |
_RandomAccessFile_writeBytes:nativeContext |
|
3610 |
^ self anyStream_writeBytes:nativeContext |
|
3611 |
||
3612 |
"Modified: / 4.2.1998 / 15:24:20 / cg" |
|
3613 |
"Created: / 4.2.1998 / 15:24:35 / cg" |
|
253 | 3614 |
! ! |
3615 |
||
277 | 3616 |
!JavaVM class methodsFor:'native - java.io - jdk1.2'! |
3617 |
||
3618 |
_FileDescriptor_initIDs:nativeContext |
|
3619 |
"/ introduced with jdk1.2 ... (sigh) |
|
3620 |
||
3621 |
"Created: / 27.1.1998 / 18:16:29 / cg" |
|
3622 |
! |
|
3623 |
||
3624 |
_FileInputStream_initIDs:nativeContext |
|
3625 |
"/ introduced with jdk1.2 ... (sigh) |
|
3626 |
||
3627 |
"Created: / 27.1.1998 / 18:15:51 / cg" |
|
3628 |
! |
|
3629 |
||
3630 |
_FileOutputStream_initIDs:nativeContext |
|
3631 |
"/ introduced with jdk1.2 ... (sigh) |
|
3632 |
||
3633 |
"Created: / 27.1.1998 / 18:16:40 / cg" |
|
3634 |
! |
|
3635 |
||
3636 |
_File_canonPath:nativeContext |
|
3637 |
"/ introduced with jdk1.2 ... (sigh) |
|
3638 |
||
3639 |
|jPath path realPath| |
|
3640 |
||
3641 |
jPath := nativeContext argAt:1. |
|
3642 |
jPath isNil ifTrue:[^ jPath]. |
|
3643 |
||
3644 |
path := Java as_ST_String:jPath. |
|
3645 |
realPath := path asFilename pathName. |
|
3646 |
||
3647 |
^ Java as_String:realPath |
|
3648 |
||
3649 |
"Created: / 27.1.1998 / 18:35:58 / cg" |
|
3650 |
"Modified: / 27.1.1998 / 21:36:03 / cg" |
|
3651 |
! |
|
3652 |
||
3653 |
_File_initIDs:nativeContext |
|
3654 |
"/ introduced with jdk1.2 ... (sigh) |
|
3655 |
||
3656 |
"Created: / 27.1.1998 / 18:25:19 / cg" |
|
3657 |
! ! |
|
3658 |
||
253 | 3659 |
!JavaVM class methodsFor:'native - java.lang'! |
3660 |
||
255 | 3661 |
_ClassLoader_defineClass0:nativeContext |
3662 |
"create a new class from a given byteArray. |
|
3663 |
Here, construct a stream on it and pass the work to the |
|
3664 |
JavaClassReader." |
|
3665 |
||
3666 |
|jClassLoader jName name data offset length inStream newClass |
|
3667 |
loaderStub jClass| |
|
3668 |
||
3669 |
jClassLoader := nativeContext receiver. |
|
3670 |
jName := nativeContext argAt:1. |
|
3671 |
||
3672 |
"/ className is now optional ... |
|
3673 |
"/ jName isNil ifTrue:[ |
|
3674 |
"/ self internalError:'nil name in defineClass'. |
|
3675 |
"/ ^ nil |
|
3676 |
"/ ] ifFalse:[ |
|
3677 |
"/ name := Java as_ST_String:jName. |
|
3678 |
"/ ]. |
|
3679 |
||
3680 |
data := nativeContext argAt:2. |
|
3681 |
offset := nativeContext argAt:3. |
|
3682 |
length := nativeContext argAt:4. |
|
3683 |
||
3684 |
inStream := data readStream. |
|
3685 |
inStream position:offset + 1. |
|
3686 |
inStream readLimit:(offset + length). |
|
3687 |
||
270 | 3688 |
"/ loaderStub := Plug new. |
3689 |
"/ loaderStub respondTo:#loadClass: with:[:clsName | |
|
3690 |
"/ |jName| |
|
3691 |
"/ |
|
3692 |
"/self halt. |
|
3693 |
"/ jName := Java as_String:clsName. |
|
3694 |
"/ "/ jClassLoader loadClass:jName |
|
3695 |
"/ jClassLoader |
|
3696 |
"/ perform:#'loadClass(Ljava/lang/String;)Ljava/lang/Class;' |
|
3697 |
"/ with:jName. |
|
3698 |
"/ ]. |
|
255 | 3699 |
|
3700 |
('JAVA: defining class ...') infoPrintCR. |
|
3701 |
||
3702 |
"/ self internalError:'break'. |
|
3703 |
||
3704 |
newClass := JavaClassReader |
|
270 | 3705 |
readStream:inStream |
3706 |
loader:jClassLoader "loaderStub" |
|
3707 |
loadUnresolved:false. |
|
255 | 3708 |
|
3709 |
newClass isNil ifTrue:[ |
|
3710 |
('JAVA: defineClass failed') infoPrintCR. |
|
3711 |
^ nil. |
|
3712 |
]. |
|
3713 |
Transcript showCR:('defined class ' , newClass fullName , '.'). |
|
3714 |
newClass classLoader:jClassLoader. |
|
3715 |
||
3716 |
('Java: defined new class: ' , newClass fullName) infoPrintCR. |
|
3717 |
||
268
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
3718 |
jClass := self javaClassObjectForClass:newClass. |
255 | 3719 |
^ jClass |
3720 |
||
3721 |
"Created: / 7.1.1998 / 12:35:10 / cg" |
|
270 | 3722 |
"Modified: / 24.1.1998 / 15:26:21 / cg" |
255 | 3723 |
! |
3724 |
||
253 | 3725 |
_ClassLoader_findSystemClass0:nativeContext |
3726 |
|loader name class jClass| |
|
3727 |
||
3728 |
loader := nativeContext receiver. |
|
3729 |
name := nativeContext argAt:1. |
|
3730 |
name := Java as_ST_String:name. |
|
3731 |
||
399 | 3732 |
class := Java at:name. |
3733 |
class isNil ifTrue:[ |
|
318 | 3734 |
"/ ('JAVA: findSystemClass0 for ' , name , ' loader is ' , loader displayString) infoPrintCR. |
399 | 3735 |
loader class == (Java classForName:'java.util.SystemClassLoader') ifTrue:[ |
3736 |
"/ Java classForName:name. |
|
3737 |
"/ class := Java at:name. |
|
3738 |
class := JavaClassReader loadSystemClass:name. |
|
3739 |
] ifFalse:[ |
|
3740 |
"/ load using default (ST/X) loader |
|
3741 |
class := JavaClassReader loadSystemClass:name. |
|
3742 |
"/ JavaClassReader classLoaderQuerySignal answer:nil do:[ |
|
3743 |
"/ Java classForName:name. |
|
3744 |
"/ ] |
|
3745 |
]. |
|
253 | 3746 |
]. |
3747 |
||
255 | 3748 |
"/ JavaClassReader classLoaderQuerySignal answer:nil "loader" |
3749 |
"/ do:[ |
|
3750 |
"/ class := Java classForName:name. |
|
3751 |
"/ JavaClassReader postLoadActions:true. |
|
3752 |
"/ ]. |
|
399 | 3753 |
|
255 | 3754 |
(class isNil |
3755 |
"or:[class classLoader notNil]") ifTrue:[ |
|
253 | 3756 |
"/ self halt:'class: ' , name , ' not found.'. |
3757 |
"/ self internalError:'class: ' , name , ' not found.'. |
|
3758 |
||
318 | 3759 |
self |
3760 |
throwExceptionClassName:'java.lang.ClassNotFoundException' |
|
399 | 3761 |
withMessage:('class: ' , name , ' not found.'). |
318 | 3762 |
^ nil |
3763 |
]. |
|
3764 |
||
3765 |
"/ '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
|
3766 |
jClass := self javaClassObjectForClass:class. |
253 | 3767 |
^ jClass |
3768 |
||
3769 |
"Created: / 5.1.1998 / 02:53:04 / cg" |
|
399 | 3770 |
"Modified: / 20.10.1998 / 17:28:34 / cg" |
255 | 3771 |
! |
3772 |
||
440 | 3773 |
_ClassLoader_getSystemResourceAsName0:nativeContext |
3774 |
"/ java.lang.String getSystemResourceAsName0 (java.lang.String) |
|
3775 |
UnimplementedNativeMethodSignal raise |
|
3776 |
||
3777 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3778 |
"Created: / 12.11.1998 / 18:58:34 / cg" |
|
3779 |
! |
|
3780 |
||
255 | 3781 |
_ClassLoader_getSystemResourceAsStream0:nativeContext |
444 | 3782 |
|jString rString dir file text inStream| |
255 | 3783 |
|
3784 |
jString := nativeContext argAt:1. |
|
3785 |
rString := Java as_ST_String:jString. |
|
3786 |
Java classPath do:[:aPath | |
|
444 | 3787 |
|f zipFile zar data| |
3788 |
||
3789 |
f := aPath asFilename. |
|
3790 |
((zipFile := f withSuffix:'jar') exists |
|
3791 |
or:[(zipFile := f withSuffix:'zip') exists]) ifTrue:[ |
|
3792 |
zar := ZipArchive oldFileNamed:zipFile. |
|
3793 |
(Array |
|
3794 |
with:rString |
|
3795 |
with:rString asLowercase |
|
3796 |
with:rString asUppercase) |
|
3797 |
do:[:tryName | |
|
3798 |
data := zar extract:tryName. |
|
3799 |
||
3800 |
inStream := (Java classForName:'java.io.ByteArrayInputStream') newCleared. |
|
3801 |
inStream perform:#'<init>([B)V' with:data. |
|
3802 |
^ inStream. |
|
3803 |
] |
|
3804 |
] ifFalse:[ |
|
3805 |
f exists ifTrue:[ |
|
3806 |
(file := f construct:rString) exists ifTrue:[ |
|
3807 |
(Java isExcludedFromClassPath:file) ifFalse:[ |
|
3808 |
text := file contents asString. |
|
3809 |
||
3810 |
"/ Copy data from returned buffer into Java byte array. |
|
3811 |
||
3812 |
data := text asByteArray. |
|
3813 |
||
3814 |
"/ Create input stream using byte array |
|
3815 |
||
3816 |
inStream := (Java classForName:'java.io.ByteArrayInputStream') newCleared. |
|
3817 |
inStream perform:#'<init>([B)V' with:data. |
|
3818 |
^ inStream. |
|
3819 |
] |
|
277 | 3820 |
] |
3821 |
] |
|
3822 |
] |
|
255 | 3823 |
]. |
3824 |
^ nil |
|
3825 |
||
3826 |
"Created: / 8.1.1998 / 16:06:56 / cg" |
|
444 | 3827 |
"Modified: / 12.11.1998 / 21:51:35 / cg" |
253 | 3828 |
! |
3829 |
||
3830 |
_ClassLoader_init:nativeContext |
|
3831 |
^ nil |
|
3832 |
||
3833 |
"Created: / 5.1.1998 / 02:04:43 / cg" |
|
3834 |
! |
|
3835 |
||
255 | 3836 |
_ClassLoader_resolveClass0:nativeContext |
3837 |
"resolve a new class as previously created by defineClass0" |
|
3838 |
||
399 | 3839 |
|jClassLoader jCls cls loaderStub anyUnresolved| |
255 | 3840 |
|
3841 |
jClassLoader := nativeContext receiver. |
|
3842 |
jCls := nativeContext argAt:1. |
|
3843 |
jCls isNil ifTrue:[ |
|
361
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3844 |
self halt. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3845 |
^ nil |
255 | 3846 |
]. |
3847 |
cls := JavaClasses at:jCls ifAbsent:nil. |
|
3848 |
cls isNil ifTrue:[ |
|
361
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3849 |
self halt. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3850 |
^ nil |
255 | 3851 |
]. |
399 | 3852 |
('JavaVM [info]: resolving class ' , cls fullName , ' ...') infoPrintCR. |
255 | 3853 |
|
3854 |
JavaClassReader classLoaderQuerySignal answer:jClassLoader |
|
3855 |
do:[ |
|
399 | 3856 |
JavaClassReader resolveClass:cls. |
3857 |
"/ JavaClassReader postLoadActions:true. |
|
3858 |
anyUnresolved := false. |
|
361
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3859 |
cls constantPool do:[:entry | |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3860 |
(entry isMemberOf:JavaUnresolvedClassConstant) ifTrue:[ |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3861 |
self halt:'debugHalt'. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3862 |
entry preResolve. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3863 |
self halt:'debugHalt'. |
399 | 3864 |
anyUnresolved := true. |
361
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3865 |
] |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3866 |
] |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3867 |
]. |
399 | 3868 |
anyUnresolved ifTrue:[ |
361
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3869 |
jClassLoader notNil ifTrue:[ |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3870 |
"/ any unresolved left -> try resolving with standard loader |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3871 |
JavaClassReader classLoaderQuerySignal answer:nil |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3872 |
do:[ |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3873 |
JavaClassReader postLoadActions:true. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3874 |
cls constantPool do:[:entry | |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3875 |
(entry isMemberOf:JavaUnresolvedClassConstant) ifTrue:[ |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3876 |
self halt:'debugHalt'. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3877 |
entry preResolve. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3878 |
self halt:'debugHalt'. |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3879 |
] |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3880 |
] |
466623e0a2d6
with private classLoader - also try using standard loader
cg
parents:
359
diff
changeset
|
3881 |
] |
255 | 3882 |
]. |
399 | 3883 |
]. |
255 | 3884 |
|
3885 |
"Created: / 7.1.1998 / 13:12:27 / cg" |
|
400 | 3886 |
"Modified: / 20.10.1998 / 19:01:57 / cg" |
255 | 3887 |
! |
3888 |
||
253 | 3889 |
_Class_forName:nativeContext |
3890 |
"get a java.lang.Class by name" |
|
3891 |
||
255 | 3892 |
|jClassName className cls jClass s m c loader| |
253 | 3893 |
|
3894 |
jClassName := nativeContext argAt:1. |
|
3895 |
className := Java as_ST_String:jClassName. |
|
3896 |
||
255 | 3897 |
(s := nativeContext sender) notNil ifTrue:[ |
347 | 3898 |
(s isJavaContext) ifTrue:[ |
307 | 3899 |
c := s method javaClass. |
3900 |
loader := c classLoader. |
|
3901 |
loader isNil ifTrue:[ |
|
255 | 3902 |
"/ self halt. |
307 | 3903 |
] |
3904 |
] |
|
255 | 3905 |
]. |
3906 |
||
3907 |
JavaClassReader classLoaderQuerySignal answer:loader |
|
3908 |
do:[ |
|
307 | 3909 |
cls := Java classForName:className. |
255 | 3910 |
]. |
3911 |
||
3912 |
"/(className startsWith:'sun.awt') ifTrue:[self halt]. |
|
3913 |
"/('classForName: ' , className , ' -> ') print. |
|
3914 |
"/cls notNil ifTrue:[cls fullName printCR] ifFalse:['nil' printCR]. |
|
3915 |
||
253 | 3916 |
cls isNil ifTrue:[ |
307 | 3917 |
ExceptionTrace ifTrue:[ |
3918 |
self halt:'no such class:' , className. |
|
3919 |
]. |
|
3920 |
self throwClassNotFoundException:className. |
|
3921 |
"/ not proceedable |
|
3922 |
AbortSignal raise. |
|
3923 |
"/ not reached |
|
3924 |
^ self |
|
3925 |
]. |
|
3926 |
||
3927 |
^ self javaClassObjectForClass:cls. |
|
3928 |
||
347 | 3929 |
"Modified: / 8.5.1998 / 21:30:03 / cg" |
253 | 3930 |
! |
3931 |
||
3932 |
_Class_getClassLoader:nativeContext |
|
3933 |
"get a classes loader" |
|
3934 |
||
3935 |
|loader| |
|
3936 |
||
3937 |
loader := JavaClassReader classLoaderQuerySignal raise. |
|
3938 |
('JAVA: getClassLoader - ' , loader printString) infoPrintCR. |
|
3939 |
||
3940 |
"/ self unimplementedNativeMethod. |
|
3941 |
^ loader |
|
3942 |
||
3943 |
"Modified: / 21.8.1997 / 16:32:02 / cg" |
|
3944 |
"Created: / 5.1.1998 / 02:51:59 / cg" |
|
3945 |
! |
|
3946 |
||
440 | 3947 |
_Class_getComponentType:nativeContext |
3948 |
UnimplementedNativeMethodSignal raise |
|
3949 |
||
3950 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3951 |
"Created: / 12.11.1998 / 18:54:46 / cg" |
|
3952 |
! |
|
3953 |
||
3954 |
_Class_getConstructor0:nativeContext |
|
3955 |
UnimplementedNativeMethodSignal raise |
|
3956 |
||
3957 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3958 |
"Created: / 12.11.1998 / 18:55:42 / cg" |
|
3959 |
! |
|
3960 |
||
3961 |
_Class_getConstructors0:nativeContext |
|
3962 |
UnimplementedNativeMethodSignal raise |
|
3963 |
||
3964 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3965 |
"Created: / 12.11.1998 / 18:55:26 / cg" |
|
3966 |
! |
|
3967 |
||
3968 |
_Class_getField0:nativeContext |
|
3969 |
UnimplementedNativeMethodSignal raise |
|
3970 |
||
3971 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3972 |
"Created: / 12.11.1998 / 18:55:37 / cg" |
|
3973 |
! |
|
3974 |
||
3975 |
_Class_getFields0:nativeContext |
|
3976 |
UnimplementedNativeMethodSignal raise |
|
3977 |
||
3978 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3979 |
"Created: / 12.11.1998 / 18:55:18 / cg" |
|
3980 |
! |
|
3981 |
||
3982 |
_Class_getInterfaces:nativeContext |
|
3983 |
UnimplementedNativeMethodSignal raise |
|
3984 |
||
3985 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
3986 |
"Created: / 12.11.1998 / 18:54:34 / cg" |
|
3987 |
! |
|
3988 |
||
321 | 3989 |
_Class_getMethod0:nativeContext |
3990 |
"get a method, given a name and type spec" |
|
3991 |
||
322 | 3992 |
|jClass cls jmName mName mTypes whichAccess argSig sel| |
321 | 3993 |
|
3994 |
jClass := nativeContext receiver. |
|
3995 |
cls := JavaClasses at:jClass. |
|
3996 |
||
322 | 3997 |
jmName := nativeContext argAt:1. |
3998 |
mName := Java as_ST_String:jmName. |
|
321 | 3999 |
mTypes := nativeContext argAt:2. |
4000 |
whichAccess := nativeContext argAt:3. |
|
405 | 4001 |
self halt. |
322 | 4002 |
argSig := JavaMethod argSignatureFromArgTypeArray:mTypes. |
4003 |
cls methodDictionary keysAndValuesDo:[:sel :mthd | |
|
405 | 4004 |
|i1 i2 jMethod retTypeClass argTypes| |
322 | 4005 |
|
4006 |
JavaMethods notNil ifTrue:[ |
|
4007 |
(jMethod := JavaMethods at:mthd ifAbsent:nil) notNil ifTrue:[ |
|
4008 |
^ jMethod |
|
4009 |
] |
|
4010 |
]. |
|
4011 |
||
4012 |
mthd name printCR. |
|
4013 |
mName printCR. |
|
4014 |
||
4015 |
mthd name = mName ifTrue:[ |
|
4016 |
i1 := mthd signature indexOf:$(. |
|
4017 |
i2 := mthd signature indexOf:$) startingAt:(i1+1). |
|
4018 |
||
4019 |
(mthd signature copyFrom:i1+1 to:i2-1) = argSig ifTrue:[ |
|
4020 |
"/ found it - create a java.lang.reflect.Method for it. |
|
4021 |
jMethod := (Java at:'java.lang.reflect.Method') new. |
|
4022 |
jMethod instVarNamed:'clazz' put:jClass. |
|
4023 |
jMethod instVarNamed:'slot' put:sel. |
|
4024 |
jMethod instVarNamed:'name' put:jmName. |
|
405 | 4025 |
retTypeClass := mthd returnTypeClass. |
4026 |
retTypeClass isNil ifTrue:[ |
|
4027 |
retTypeClass := #void |
|
4028 |
]. |
|
4029 |
argTypes := mthd argSignature. |
|
4030 |
argTypes := argTypes collect:[:s | |
|
4031 |
|c| |
|
4032 |
||
4033 |
c := Java at:s. |
|
4034 |
self javaClassObjectForClass:(c ? s asSymbol) |
|
4035 |
]. |
|
4036 |
jMethod instVarNamed:'returnType' put:(self javaClassObjectForClass:retTypeClass). |
|
4037 |
jMethod instVarNamed:'parameterTypes' put:argTypes. |
|
322 | 4038 |
|
4039 |
JavaMethods isNil ifTrue:[ |
|
4040 |
JavaMethods := IdentityDictionary new |
|
4041 |
]. |
|
4042 |
JavaMethods at:jMethod put:mthd. |
|
4043 |
JavaMethods at:mthd put:jMethod. |
|
4044 |
||
4045 |
^ jMethod. |
|
4046 |
]. |
|
4047 |
]. |
|
4048 |
]. |
|
321 | 4049 |
|
4050 |
self halt. |
|
4051 |
self |
|
4052 |
throwExceptionClassName:'java.lang.NoSuchMethodException' |
|
4053 |
withMessage:'not yet implemented'. |
|
4054 |
||
4055 |
^ nil. |
|
4056 |
||
405 | 4057 |
"Modified: / 22.10.1998 / 01:54:38 / cg" |
321 | 4058 |
! |
4059 |
||
334 | 4060 |
_Class_getMethods0:nativeContext |
4061 |
"get a method, given a name and type spec" |
|
4062 |
||
4063 |
|jClass cls jmName mName mTypes whichAccess argSig sel |
|
4064 |
methods| |
|
4065 |
||
4066 |
jClass := nativeContext receiver. |
|
4067 |
cls := JavaClasses at:jClass. |
|
4068 |
||
405 | 4069 |
"/ 0 = PUBLIC (i.e. includes inherited) / 1 = DECLARED here |
334 | 4070 |
whichAccess := nativeContext argAt:1. |
4071 |
||
4072 |
methods := OrderedCollection new. |
|
4073 |
||
405 | 4074 |
[cls isJavaClass] whileTrue:[ |
4075 |
cls methodDictionary keysAndValuesDo:[:sel :mthd | |
|
4076 |
|i1 i2 jMethod argTypes retTypeClass| |
|
4077 |
||
4078 |
mthd name printCR. |
|
4079 |
||
4080 |
i1 := mthd signature indexOf:$(. |
|
4081 |
i2 := mthd signature indexOf:$) startingAt:(i1+1). |
|
4082 |
||
4083 |
"/ create a java.lang.reflect.Method for it. |
|
4084 |
jMethod := (Java at:'java.lang.reflect.Method') new. |
|
4085 |
jMethod instVarNamed:'clazz' put:jClass. |
|
4086 |
jMethod instVarNamed:'slot' put:sel. |
|
4087 |
jMethod instVarNamed:'name' put:(Java as_String:mthd name). |
|
4088 |
retTypeClass := mthd returnTypeClass. |
|
4089 |
retTypeClass isNil ifTrue:[ |
|
4090 |
retTypeClass := #void |
|
4091 |
]. |
|
4092 |
(name endsWith:')I') ifTrue:[self halt]. |
|
4093 |
argTypes := mthd argSignature. |
|
4094 |
argTypes := argTypes collect:[:s | |
|
4095 |
|c| |
|
4096 |
||
4097 |
c := Java at:s. |
|
4098 |
self javaClassObjectForClass:(c ? s asSymbol) |
|
4099 |
]. |
|
4100 |
||
4101 |
jMethod instVarNamed:'returnType' put:(self javaClassObjectForClass:retTypeClass). |
|
4102 |
jMethod instVarNamed:'parameterTypes' put:argTypes. |
|
334 | 4103 |
|
405 | 4104 |
(mthd name includesString:'setName') ifTrue:[self halt]. |
4105 |
JavaMethods isNil ifTrue:[ |
|
4106 |
JavaMethods := IdentityDictionary new |
|
4107 |
]. |
|
4108 |
JavaMethods at:jMethod put:mthd. |
|
4109 |
JavaMethods at:mthd put:jMethod. |
|
4110 |
||
4111 |
methods add:jMethod. |
|
334 | 4112 |
]. |
405 | 4113 |
whichAccess == 1 ifTrue:[ |
4114 |
"/ local methods only |
|
4115 |
cls := nil |
|
4116 |
] ifFalse:[ |
|
4117 |
cls := cls superclass. |
|
4118 |
] |
|
334 | 4119 |
]. |
4120 |
methods := methods asArray. |
|
4121 |
^ methods. |
|
4122 |
||
405 | 4123 |
"Modified: / 22.10.1998 / 01:53:58 / cg" |
334 | 4124 |
! |
4125 |
||
440 | 4126 |
_Class_getModifiers:nativeContext |
4127 |
UnimplementedNativeMethodSignal raise |
|
4128 |
||
4129 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4130 |
"Created: / 12.11.1998 / 18:54:53 / cg" |
|
4131 |
! |
|
4132 |
||
255 | 4133 |
_Class_getName:nativeContext |
4134 |
"get a classes name" |
|
4135 |
||
4136 |
|jClass cls| |
|
4137 |
||
4138 |
jClass := nativeContext receiver. |
|
4139 |
cls := JavaClasses at:jClass. |
|
359 | 4140 |
^ Java as_String:(cls fullName copyReplaceAll:$/ with:$.). |
4141 |
||
4142 |
"Modified: / 18.7.1998 / 22:59:05 / cg" |
|
255 | 4143 |
! |
4144 |
||
253 | 4145 |
_Class_getPrimitiveClass:nativeContext |
4146 |
"get a primitive class by name" |
|
4147 |
||
4148 |
|jClassName className cls| |
|
4149 |
||
4150 |
jClassName := nativeContext argAt:1. |
|
4151 |
className := Java as_ST_String:jClassName. |
|
4152 |
||
4153 |
JavaClasses isNil ifTrue:[ |
|
261 | 4154 |
self initializePrimitiveClasses |
253 | 4155 |
]. |
4156 |
cls := JavaClasses at:className. |
|
4157 |
||
4158 |
"/ cls := Java classForName:className. |
|
4159 |
"/ cls isNil ifTrue:[ |
|
4160 |
"/ cls := JavaClasses at:('JavaBase_' , className) asSymbol ifAbsent:nil. |
|
4161 |
"/ #( |
|
4162 |
"/ 'boolean' #Boolean |
|
4163 |
"/ 'float' #ShortFloat |
|
4164 |
"/ 'double' #Float |
|
4165 |
"/ 'int' #Integer |
|
4166 |
"/ 'long' #Integer |
|
4167 |
"/ 'char' #Character |
|
4168 |
"/ 'short' #Integer |
|
4169 |
"/ 'byte' #Integer |
|
4170 |
"/ 'void' #UndefinedObject |
|
4171 |
"/ ) pairWiseDo:[:nm :sym | |
|
4172 |
"/ className = nm ifTrue:[ |
|
4173 |
"/ cls := Smalltalk at:sym. |
|
4174 |
"/ ] |
|
4175 |
"/ ]. |
|
4176 |
"/ |
|
4177 |
"/ cls isNil ifTrue:[ |
|
4178 |
"/ self internalError:'class: ' , className , ' not found.'. |
|
4179 |
"/ ]. |
|
4180 |
"/ ]. |
|
4181 |
^ cls |
|
4182 |
||
4183 |
"Created: / 4.1.1998 / 00:46:03 / cg" |
|
4184 |
"Modified: / 4.1.1998 / 01:12:27 / cg" |
|
4185 |
! |
|
4186 |
||
440 | 4187 |
_Class_getSigners:nativeContext |
4188 |
UnimplementedNativeMethodSignal raise |
|
4189 |
||
4190 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4191 |
"Created: / 12.11.1998 / 18:55:01 / cg" |
|
4192 |
! |
|
4193 |
||
255 | 4194 |
_Class_getSuperclass:nativeContext |
4195 |
"return a classes superclass" |
|
4196 |
||
4197 |
|jClass cls superCls| |
|
4198 |
||
4199 |
jClass := nativeContext receiver. |
|
4200 |
cls := JavaClasses at:jClass. |
|
4201 |
superCls := cls superclass. |
|
4202 |
superCls == JavaObject ifTrue:[ |
|
307 | 4203 |
^ nil. |
4204 |
]. |
|
4205 |
^ self javaClassObjectForClass:superCls |
|
255 | 4206 |
|
4207 |
"Created: / 12.1.1998 / 12:38:36 / cg" |
|
307 | 4208 |
"Modified: / 4.2.1998 / 14:51:22 / cg" |
255 | 4209 |
! |
4210 |
||
440 | 4211 |
_Class_isArray:nativeContext |
4212 |
UnimplementedNativeMethodSignal raise |
|
4213 |
||
4214 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4215 |
"Created: / 12.11.1998 / 18:54:24 / cg" |
|
4216 |
! |
|
4217 |
||
4218 |
_Class_isAssignableFrom:nativeContext |
|
4219 |
UnimplementedNativeMethodSignal raise |
|
4220 |
||
4221 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4222 |
"Created: / 12.11.1998 / 18:54:16 / cg" |
|
4223 |
! |
|
4224 |
||
321 | 4225 |
_Class_isInstance:nativeContext |
4226 |
"return true, if something is an instance of a class. |
|
4227 |
(i.e. same as instanceOf - builtin bytecode)" |
|
4228 |
||
4229 |
|jClass cls obj| |
|
4230 |
||
4231 |
obj := nativeContext argAt:1. |
|
4232 |
obj isNil ifTrue:[^ 0 "FALSE"]. |
|
4233 |
||
4234 |
jClass := nativeContext receiver. |
|
4235 |
cls := JavaClasses at:jClass. |
|
4236 |
||
4237 |
(obj isMemberOf:cls) ifTrue:[^ 1 "TRUE"]. |
|
4238 |
(obj isKindOf:cls) ifTrue:[^ 1 "TRUE"]. |
|
4239 |
||
4240 |
cls isBehavior ifTrue:[ |
|
4241 |
cls isInterface ifTrue:[ |
|
4242 |
(obj class hasInterface:cls) ifTrue:[ |
|
4243 |
^ 1 "TRUE" |
|
4244 |
] |
|
4245 |
]. |
|
4246 |
^ (obj isKindOf:cls) ifTrue:[1 "TRUE"] ifFalse:[0 "FALSE"] |
|
4247 |
]. |
|
4248 |
(cls isMemberOf:JavaClassPointerRef) ifTrue:[ |
|
4249 |
"/ must be a pointer to an array of that class |
|
4250 |
||
4251 |
^ (obj isArray) ifTrue:[1 "TRUE"] ifFalse:[0 "FALSE"] |
|
4252 |
]. |
|
4253 |
(cls isMemberOf:JavaBuiltInClassPointerRef) ifTrue:[ |
|
4254 |
cls arrayClass == obj class ifTrue:[ |
|
4255 |
^ 1 "TRUE" |
|
4256 |
]. |
|
4257 |
]. |
|
4258 |
||
4259 |
(obj isMemberOf:Array) ifTrue:[ |
|
4260 |
obj size == 0 ifTrue:[ |
|
4261 |
^ 1 "TRUE" |
|
4262 |
]. |
|
4263 |
^ (self _checkCast:(obj at:1) class:(cls deref)) |
|
4264 |
ifTrue:[1 "TRUE"] ifFalse:[0 "FALSE"] |
|
4265 |
]. |
|
4266 |
self halt. |
|
4267 |
^ 0 "FALSE". |
|
4268 |
||
4269 |
"Modified: / 9.2.1998 / 14:56:23 / cg" |
|
4270 |
! |
|
4271 |
||
255 | 4272 |
_Class_isInterface:nativeContext |
4273 |
"return true, if this class is an interface" |
|
4274 |
||
4275 |
|jClass cls| |
|
4276 |
||
4277 |
jClass := nativeContext receiver. |
|
4278 |
cls := JavaClasses at:jClass. |
|
4279 |
cls isInterface ifTrue:[^ 1 "TRUE"]. |
|
4280 |
^ 0 "FALSE" |
|
4281 |
||
4282 |
"Created: / 12.1.1998 / 12:37:02 / cg" |
|
4283 |
! |
|
4284 |
||
321 | 4285 |
_Class_isPrimitive:nativeContext |
4286 |
"return true, if this class is builtin primitive class |
|
4287 |
(i.e. byteArray, array, string etc." |
|
4288 |
||
4289 |
|jClass cls| |
|
4290 |
||
4291 |
jClass := nativeContext receiver. |
|
4292 |
cls := JavaClasses at:jClass. |
|
4293 |
^ 0 "FALSE" |
|
4294 |
||
4295 |
"Created: / 9.2.1998 / 14:46:07 / cg" |
|
4296 |
! |
|
4297 |
||
253 | 4298 |
_Class_newInstance:nativeContext |
4299 |
"get an instance for a java.lang.Class" |
|
4300 |
||
4301 |
|jClass cls newInst| |
|
4302 |
||
4303 |
jClass := nativeContext receiver. |
|
4304 |
cls := JavaClasses at:jClass. |
|
261 | 4305 |
cls classInit. |
253 | 4306 |
newInst := cls newCleared. |
255 | 4307 |
newInst perform:#'<init>()V'. |
253 | 4308 |
|
4309 |
^ newInst |
|
4310 |
||
4311 |
"Created: / 2.1.1998 / 22:41:38 / cg" |
|
261 | 4312 |
"Modified: / 15.1.1998 / 00:57:37 / cg" |
253 | 4313 |
! |
4314 |
||
440 | 4315 |
_Class_setSigners:nativeContext |
4316 |
UnimplementedNativeMethodSignal raise |
|
4317 |
||
4318 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
4319 |
"Created: / 12.11.1998 / 18:55:08 / cg" |
|
4320 |
! |
|
4321 |
||
253 | 4322 |
_Double_doubleToLongBits:nativeContext |
4323 |
|f i| |
|
4324 |
||
4325 |
f := nativeContext argAt:1. |
|
4326 |
||
4327 |
UninterpretedBytes isBigEndian ifTrue:[ |
|
261 | 4328 |
i := f basicAt:8. |
4329 |
i := i bitOr:((f basicAt:7) bitShift:8). |
|
4330 |
i := i bitOr:((f basicAt:6) bitShift:16). |
|
4331 |
i := i bitOr:((f basicAt:5) bitShift:24). |
|
4332 |
i := i bitOr:((f basicAt:4) bitShift:32). |
|
4333 |
i := i bitOr:((f basicAt:3) bitShift:40). |
|
4334 |
i := i bitOr:((f basicAt:2) bitShift:48). |
|
4335 |
i := i bitOr:((f basicAt:1) bitShift:56). |
|
253 | 4336 |
] ifFalse:[ |
261 | 4337 |
i := f basicAt:1. |
4338 |
i := i bitOr:((f basicAt:2) bitShift:8). |
|
4339 |
i := i bitOr:((f basicAt:3) bitShift:16). |
|
4340 |
i := i bitOr:((f basicAt:4) bitShift:24). |
|
4341 |
i := i bitOr:((f basicAt:5) bitShift:32). |
|
4342 |
i := i bitOr:((f basicAt:6) bitShift:40). |
|
4343 |
i := i bitOr:((f basicAt:7) bitShift:48). |
|
4344 |
i := i bitOr:((f basicAt:8) bitShift:56). |
|
253 | 4345 |
]. |
4346 |
||
4347 |
^ i. |
|
4348 |
||
4349 |
"Created: / 4.1.1998 / 01:39:12 / cg" |
|
4350 |
! |
|
4351 |
||
4352 |
_Double_longBitsToDouble:nativeContext |
|
4353 |
|i aFloat| |
|
4354 |
||
4355 |
i := nativeContext argAt:1. |
|
4356 |
||
4357 |
aFloat := Float new. |
|
4358 |
UninterpretedBytes isBigEndian ifTrue:[ |
|
261 | 4359 |
aFloat basicAt:1 put:((i bitShift:-56) bitAnd:16rFF). |
4360 |
aFloat basicAt:2 put:((i bitShift:-48) bitAnd:16rFF). |
|
4361 |
aFloat basicAt:3 put:((i bitShift:-40) bitAnd:16rFF). |
|
4362 |
aFloat basicAt:4 put:((i bitShift:-32) bitAnd:16rFF). |
|
4363 |
aFloat basicAt:5 put:((i bitShift:-24) bitAnd:16rFF). |
|
4364 |
aFloat basicAt:6 put:((i bitShift:-16) bitAnd:16rFF). |
|
4365 |
aFloat basicAt:7 put:((i bitShift:-8) bitAnd:16rFF). |
|
4366 |
aFloat basicAt:8 put:(i bitAnd:16rFF). |
|
253 | 4367 |
] ifFalse:[ |
261 | 4368 |
aFloat basicAt:1 put:(i bitAnd:16rFF). |
4369 |
aFloat basicAt:2 put:((i bitShift:-8) bitAnd:16rFF). |
|
4370 |
aFloat basicAt:3 put:((i bitShift:-16) bitAnd:16rFF). |
|
4371 |
aFloat basicAt:4 put:((i bitShift:-24) bitAnd:16rFF). |
|
4372 |
aFloat basicAt:5 put:((i bitShift:-32) bitAnd:16rFF). |
|
4373 |
aFloat basicAt:6 put:((i bitShift:-40) bitAnd:16rFF). |
|
4374 |
aFloat basicAt:7 put:((i bitShift:-48) bitAnd:16rFF). |
|
4375 |
aFloat basicAt:8 put:((i bitShift:-56) bitAnd:16rFF). |
|
253 | 4376 |
]. |
4377 |
||
4378 |
^ aFloat. |
|
4379 |
||
4380 |
"Created: / 4.1.1998 / 01:45:00 / cg" |
|
4381 |
! |
|
4382 |
||
255 | 4383 |
_Double_valueOf0:nativeContext |
4384 |
|s d| |
|
4385 |
||
4386 |
s := nativeContext argAt:1. |
|
4387 |
s notNil ifTrue:[ |
|
261 | 4388 |
s := Java as_ST_String:s. |
4389 |
d := Float readFrom:s onError:nil. |
|
255 | 4390 |
]. |
4391 |
d isNil ifTrue:[ |
|
261 | 4392 |
self throwNumberFormatException. |
4393 |
"/ not reached |
|
255 | 4394 |
]. |
4395 |
||
4396 |
^ d |
|
4397 |
||
4398 |
"Modified: / 8.8.1997 / 12:03:55 / cg" |
|
4399 |
"Created: / 7.1.1998 / 11:09:43 / cg" |
|
4400 |
! |
|
4401 |
||
253 | 4402 |
_Float_floatToIntBits:nativeContext |
4403 |
|f i| |
|
4404 |
||
4405 |
f := nativeContext argAt:1. |
|
4406 |
||
4407 |
UninterpretedBytes isBigEndian ifTrue:[ |
|
261 | 4408 |
i := f basicAt:4. |
4409 |
i := i bitOr:((f basicAt:3) bitShift:8). |
|
4410 |
i := i bitOr:((f basicAt:2) bitShift:16). |
|
4411 |
i := i bitOr:((f basicAt:1) bitShift:24). |
|
253 | 4412 |
] ifFalse:[ |
261 | 4413 |
i := f basicAt:1. |
4414 |
i := i bitOr:((f basicAt:2) bitShift:8). |
|
4415 |
i := i bitOr:((f basicAt:3) bitShift:16). |
|
4416 |
i := i bitOr:((f basicAt:4) bitShift:24). |
|
253 | 4417 |
]. |
4418 |
||
4419 |
^ i. |
|
4420 |
||
4421 |
"Created: / 4.1.1998 / 01:25:50 / cg" |
|
4422 |
! |
|
4423 |
||
261 | 4424 |
_Float_intBitsToFloat:nativeContet |
4425 |
|i aFloat| |
|
4426 |
||
4427 |
i := nativeContet argAt:1. |
|
4428 |
||
4429 |
aFloat := ShortFloat basicNew. |
|
4430 |
UninterpretedBytes isBigEndian ifTrue:[ |
|
4431 |
aFloat basicAt:1 put:((i bitShift:-24) bitAnd:16rFF). |
|
4432 |
aFloat basicAt:2 put:((i bitShift:-16) bitAnd:16rFF). |
|
4433 |
aFloat basicAt:3 put:((i bitShift:-8) bitAnd:16rFF). |
|
4434 |
aFloat basicAt:4 put:(i bitAnd:16rFF). |
|
4435 |
] ifFalse:[ |
|
4436 |
aFloat basicAt:1 put:(i bitAnd:16rFF). |
|
4437 |
aFloat basicAt:2 put:((i bitShift:-8) bitAnd:16rFF). |
|
4438 |
aFloat basicAt:3 put:((i bitShift:-16) bitAnd:16rFF). |
|
4439 |
aFloat basicAt:4 put:((i bitShift:-24) bitAnd:16rFF). |
|
4440 |
]. |
|
4441 |
||
4442 |
^ aFloat. |
|
4443 |
||
4444 |
"Created: / 13.1.1998 / 23:03:36 / cg" |
|
4445 |
"Modified: / 13.1.1998 / 23:05:01 / cg" |
|
4446 |
! |
|
4447 |
||
440 | 4448 |
_Math_IEEEremainder:nativeContext |
4449 |
UnimplementedNativeMethodSignal raise |
|
4450 |
||
4451 |
"Created: / 12.11.1998 / 18:52:36 / cg" |
|
4452 |
! |
|
4453 |
||
342 | 4454 |
_Math_acos:nativeContext |
4455 |
"arc cosine" |
|
4456 |
||
4457 |
|dVal| |
|
4458 |
||
4459 |
dVal := nativeContext argAt:1. |
|
432 | 4460 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4461 |
"/ dVal isReal ifTrue:[ |
|
4462 |
"/ 'JAVAVM [info]: missing double flag in Math>>acos' infoPrintCR. |
|
4463 |
"/ ] ifFalse:[ |
|
4464 |
"/ self halt:'expected double arg' |
|
4465 |
"/ ] |
|
4466 |
"/ ]. |
|
342 | 4467 |
^ dVal arcCos |
4468 |
||
4469 |
"Created: / 7.5.1998 / 00:34:50 / cg" |
|
432 | 4470 |
"Modified: / 11.11.1998 / 15:08:20 / cg" |
342 | 4471 |
! |
4472 |
||
4473 |
_Math_asin:nativeContext |
|
4474 |
"arc sine" |
|
4475 |
||
4476 |
|dVal| |
|
4477 |
||
4478 |
dVal := nativeContext argAt:1. |
|
432 | 4479 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4480 |
"/ dVal isReal ifTrue:[ |
|
4481 |
"/ 'JAVAVM [info]: missing double flag in Math>>asin' infoPrintCR. |
|
4482 |
"/ ] ifFalse:[ |
|
4483 |
"/ self halt:'expected double arg' |
|
4484 |
"/ ] |
|
4485 |
"/ ]. |
|
342 | 4486 |
^ dVal arcSin |
4487 |
||
4488 |
"Created: / 7.5.1998 / 00:34:26 / cg" |
|
432 | 4489 |
"Modified: / 11.11.1998 / 15:08:15 / cg" |
342 | 4490 |
! |
4491 |
||
440 | 4492 |
_Math_atan2:nativeContext |
4493 |
UnimplementedNativeMethodSignal raise |
|
4494 |
||
4495 |
"Created: / 12.11.1998 / 18:52:52 / cg" |
|
4496 |
! |
|
4497 |
||
317 | 4498 |
_Math_atan:nativeContext |
4499 |
"arc tangens" |
|
4500 |
||
4501 |
|dVal| |
|
4502 |
||
4503 |
dVal := nativeContext argAt:1. |
|
432 | 4504 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4505 |
"/ dVal isReal ifTrue:[ |
|
4506 |
"/ 'JAVAVM [info]: missing double flag in Math>>atan' infoPrintCR. |
|
4507 |
"/ ] ifFalse:[ |
|
4508 |
"/ self halt:'expected double arg' |
|
4509 |
"/ ] |
|
4510 |
"/ ]. |
|
317 | 4511 |
^ dVal arcTan |
4512 |
||
4513 |
"Created: / 6.2.1998 / 01:24:12 / cg" |
|
432 | 4514 |
"Modified: / 11.11.1998 / 15:08:11 / cg" |
317 | 4515 |
! |
4516 |
||
255 | 4517 |
_Math_ceil:nativeContext |
4518 |
"ceiling" |
|
4519 |
||
4520 |
|dVal| |
|
4521 |
||
4522 |
dVal := nativeContext argAt:1. |
|
432 | 4523 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4524 |
"/ dVal isReal ifTrue:[ |
|
4525 |
"/ 'JAVAVM [info]: missing double flag in Math>>ceil' infoPrintCR. |
|
4526 |
"/ ] ifFalse:[ |
|
4527 |
"/ self halt:'expected double arg' |
|
4528 |
"/ ] |
|
4529 |
"/ ]. |
|
255 | 4530 |
^ dVal ceilingAsFloat |
4531 |
||
4532 |
"Created: / 7.1.1998 / 15:43:00 / cg" |
|
432 | 4533 |
"Modified: / 11.11.1998 / 15:08:04 / cg" |
255 | 4534 |
! |
4535 |
||
4536 |
_Math_cos:nativeContext |
|
4537 |
"cosine" |
|
4538 |
||
4539 |
|dVal| |
|
4540 |
||
4541 |
dVal := nativeContext argAt:1. |
|
432 | 4542 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4543 |
"/ dVal isReal ifTrue:[ |
|
4544 |
"/ 'JAVAVM [info]: missing double flag in Math>>cos' infoPrintCR. |
|
4545 |
"/ ] ifFalse:[ |
|
4546 |
"/ self halt:'expected double arg' |
|
4547 |
"/ ] |
|
4548 |
"/ ]. |
|
255 | 4549 |
^ dVal cos |
4550 |
||
4551 |
"Created: / 7.1.1998 / 15:41:30 / cg" |
|
432 | 4552 |
"Modified: / 11.11.1998 / 15:07:59 / cg" |
255 | 4553 |
! |
4554 |
||
342 | 4555 |
_Math_exp:nativeContext |
4556 |
"exponential" |
|
4557 |
||
4558 |
|dVal| |
|
4559 |
||
4560 |
dVal := nativeContext argAt:1. |
|
432 | 4561 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4562 |
"/ dVal isReal ifTrue:[ |
|
4563 |
"/ 'JAVAVM [info]: missing double flag in Math>>exp' infoPrintCR. |
|
4564 |
"/ ] ifFalse:[ |
|
4565 |
"/ self halt:'expected double arg' |
|
4566 |
"/ ] |
|
4567 |
"/ ]. |
|
342 | 4568 |
^ dVal exp |
4569 |
||
4570 |
"Created: / 7.5.1998 / 00:36:19 / cg" |
|
432 | 4571 |
"Modified: / 11.11.1998 / 15:07:50 / cg" |
342 | 4572 |
! |
4573 |
||
255 | 4574 |
_Math_floor:nativeContext |
4575 |
"floor" |
|
4576 |
||
4577 |
|dVal| |
|
4578 |
||
4579 |
dVal := nativeContext argAt:1. |
|
432 | 4580 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4581 |
"/ dVal isReal ifTrue:[ |
|
4582 |
"/ 'JAVAVM [info]: missing double flag in Math>>floor' infoPrintCR. |
|
4583 |
"/ ] ifFalse:[ |
|
4584 |
"/ self halt:'expected double arg' |
|
4585 |
"/ ] |
|
4586 |
"/ ]. |
|
255 | 4587 |
^ dVal floorAsFloat |
4588 |
||
4589 |
"Created: / 7.1.1998 / 19:09:21 / cg" |
|
432 | 4590 |
"Modified: / 11.11.1998 / 15:07:45 / cg" |
255 | 4591 |
! |
4592 |
||
4593 |
_Math_log:nativeContext |
|
4594 |
"logarithm" |
|
4595 |
||
4596 |
|dVal| |
|
4597 |
||
4598 |
dVal := nativeContext argAt:1. |
|
432 | 4599 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4600 |
"/ dVal isReal ifTrue:[ |
|
4601 |
"/ 'JAVAVM [info]: missing double flag in Math>>log' infoPrintCR. |
|
4602 |
"/ ] ifFalse:[ |
|
4603 |
"/ self halt:'expected double arg' |
|
4604 |
"/ ] |
|
4605 |
"/ ]. |
|
255 | 4606 |
^ dVal log |
4607 |
||
4608 |
"Created: / 7.1.1998 / 15:42:19 / cg" |
|
432 | 4609 |
"Modified: / 11.11.1998 / 15:07:38 / cg" |
255 | 4610 |
! |
4611 |
||
4612 |
_Math_pow:nativeContext |
|
4613 |
"power" |
|
4614 |
||
4615 |
|dVal1 dVal2| |
|
4616 |
||
4617 |
dVal1 := nativeContext argAt:1. |
|
432 | 4618 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4619 |
"/ dVal1 isReal ifTrue:[ |
|
4620 |
"/ 'JAVAVM [info]: missing double flag in Math>>pow' infoPrintCR. |
|
4621 |
"/ ] ifFalse:[ |
|
4622 |
"/ self halt:'expected double arg' |
|
4623 |
"/ ] |
|
4624 |
"/ ]. |
|
255 | 4625 |
dVal2 := nativeContext argAt:3. |
432 | 4626 |
"/ (nativeContext argAt:4) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4627 |
"/ dVal2 isReal ifTrue:[ |
|
4628 |
"/ 'JAVAVM [info]: missing double flag in Math>>pow' infoPrintCR. |
|
4629 |
"/ ] ifFalse:[ |
|
4630 |
"/ self halt:'expected double arg' |
|
4631 |
"/ ] |
|
4632 |
"/ ]. |
|
255 | 4633 |
^ dVal1 raisedTo:dVal2 |
4634 |
||
4635 |
"Created: / 7.1.1998 / 15:44:13 / cg" |
|
432 | 4636 |
"Modified: / 11.11.1998 / 15:07:33 / cg" |
255 | 4637 |
! |
4638 |
||
440 | 4639 |
_Math_rint:nativeContext |
4640 |
UnimplementedNativeMethodSignal raise |
|
4641 |
||
4642 |
"Created: / 12.11.1998 / 18:52:47 / cg" |
|
4643 |
! |
|
4644 |
||
255 | 4645 |
_Math_sin:nativeContext |
4646 |
"sine" |
|
4647 |
||
4648 |
|dVal| |
|
4649 |
||
4650 |
dVal := nativeContext argAt:1. |
|
432 | 4651 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4652 |
"/ dVal isReal ifTrue:[ |
|
4653 |
"/ 'JAVAVM [info]: missing double flag in Math>>sin' infoPrintCR. |
|
4654 |
"/ ] ifFalse:[ |
|
4655 |
"/ self halt:'expected double arg' |
|
4656 |
"/ ] |
|
4657 |
"/ ]. |
|
255 | 4658 |
^ dVal sin |
4659 |
||
4660 |
"Created: / 7.1.1998 / 15:41:40 / cg" |
|
432 | 4661 |
"Modified: / 11.11.1998 / 15:07:09 / cg" |
255 | 4662 |
! |
4663 |
||
4664 |
_Math_sqrt:nativeContext |
|
4665 |
"square root" |
|
4666 |
||
4667 |
|dVal| |
|
4668 |
||
4669 |
dVal := nativeContext argAt:1. |
|
432 | 4670 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4671 |
"/ dVal isReal ifTrue:[ |
|
4672 |
"/ 'JAVAVM [info]: missing double flag in Math>>sqrt' infoPrintCR. |
|
4673 |
"/ ] ifFalse:[ |
|
4674 |
"/ self halt:'expected double arg' |
|
4675 |
"/ ] |
|
4676 |
"/ ]. |
|
4677 |
||
4678 |
"/ how about domain errors ? |
|
4679 |
dVal < 0 ifTrue:[ |
|
4680 |
"/ ^ 0.0 |
|
255 | 4681 |
]. |
4682 |
^ dVal sqrt |
|
4683 |
||
4684 |
"Created: / 7.1.1998 / 15:42:40 / cg" |
|
432 | 4685 |
"Modified: / 11.11.1998 / 15:06:55 / cg" |
255 | 4686 |
! |
4687 |
||
342 | 4688 |
_Math_tan:nativeContext |
4689 |
"tangent" |
|
4690 |
||
4691 |
|dVal| |
|
4692 |
||
4693 |
dVal := nativeContext argAt:1. |
|
432 | 4694 |
"/ (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[ |
4695 |
"/ dVal isReal ifTrue:[ |
|
4696 |
"/ 'JAVAVM [info]: missing double flag in Math>>tan' infoPrintCR. |
|
4697 |
"/ ] ifFalse:[ |
|
4698 |
"/ self halt:'expected double arg' |
|
4699 |
"/ ] |
|
4700 |
"/ ]. |
|
342 | 4701 |
^ dVal tan |
4702 |
||
4703 |
"Created: / 7.5.1998 / 00:34:03 / cg" |
|
432 | 4704 |
"Modified: / 11.11.1998 / 15:07:14 / cg" |
342 | 4705 |
! |
4706 |
||
334 | 4707 |
_Method_getModifiers:nativeContext |
4708 |
|jMethod mthd retVal| |
|
4709 |
||
4710 |
jMethod := nativeContext receiver. |
|
4711 |
||
4712 |
mthd := JavaMethods at:jMethod ifAbsent:nil. |
|
4713 |
mthd isNil ifTrue:[ |
|
4714 |
self halt. |
|
4715 |
^ 0 |
|
4716 |
]. |
|
4717 |
^ mthd accessFlags |
|
4718 |
||
4719 |
"Modified: / 9.4.1998 / 17:50:01 / cg" |
|
4720 |
! |
|
4721 |
||
322 | 4722 |
_Method_invoke:nativeContext |
4723 |
"invoke a javaMethod" |
|
4724 |
||
4725 |
|jMethod mthd rec args retVal| |
|
4726 |
||
4727 |
jMethod := nativeContext receiver. |
|
4728 |
rec := nativeContext argAt:1. |
|
4729 |
args := nativeContext argAt:2. |
|
4730 |
||
4731 |
mthd := JavaMethods at:jMethod ifAbsent:nil. |
|
4732 |
mthd isNil ifTrue:[ |
|
4733 |
self halt. |
|
4734 |
]. |
|
4735 |
||
4736 |
"/ check for arguments to match the expected types ... |
|
4737 |
||
4738 |
mthd argSignature keysAndValuesDo:[:index :argSig | |
|
4739 |
|cls arg| |
|
4740 |
||
4741 |
cls := Java at:argSig. |
|
4742 |
arg := args at:index. |
|
4743 |
(arg isKindOf:cls) ifFalse:[ |
|
4744 |
self halt. |
|
4745 |
] |
|
4746 |
]. |
|
4747 |
||
4748 |
mthd isStatic ifTrue:[ |
|
4749 |
retVal := mthd valueWithReceiver:(mthd javaClass) arguments:args selector:mthd selector. |
|
4750 |
^ retVal |
|
4751 |
] ifFalse:[ |
|
4752 |
self halt. |
|
4753 |
]. |
|
4754 |
||
4755 |
self halt. |
|
4756 |
||
4757 |
"Created: / 13.2.1998 / 15:15:28 / cg" |
|
4758 |
"Modified: / 13.2.1998 / 15:35:54 / cg" |
|
4759 |
! |
|
4760 |
||
253 | 4761 |
_Object_clone:nativeContext |
4762 |
"clone an object" |
|
4763 |
||
4764 |
|o rslt| |
|
4765 |
||
4766 |
o := nativeContext receiver. |
|
4767 |
rslt := o shallowCopy. |
|
4768 |
^ rslt |
|
4769 |
||
4770 |
"Created: / 4.1.1998 / 19:39:26 / cg" |
|
4771 |
! |
|
4772 |
||
255 | 4773 |
_Object_getClass:nativeContext |
4774 |
"return an objects class" |
|
4775 |
||
4776 |
|o cls jClass| |
|
4777 |
||
4778 |
o := nativeContext receiver. |
|
4779 |
cls := o class. |
|
4780 |
||
268
f7357f1142c8
provide & use a helper to associate java.lang.class insts to javaClasses
cg
parents:
266
diff
changeset
|
4781 |
jClass := self javaClassObjectForClass:cls. |
255 | 4782 |
^ jClass |
4783 |
||
4784 |
"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
|
4785 |
"Modified: / 23.1.1998 / 17:48:22 / cg" |
255 | 4786 |
! |
4787 |
||
253 | 4788 |
_Object_hashCode:nativeContext |
4789 |
"identityHash" |
|
4790 |
||
4791 |
|o rslt| |
|
4792 |
||
4793 |
o := nativeContext receiver. |
|
4794 |
rslt := o identityHash. |
|
4795 |
^ rslt |
|
4796 |
||
4797 |
"Created: / 4.1.1998 / 19:40:26 / cg" |
|
4798 |
! |
|
4799 |
||
255 | 4800 |
_Object_notify:nativeContext |
4801 |
"wakeup" |
|
4802 |
||
4803 |
self wakeup:(nativeContext receiver). |
|
4804 |
||
4805 |
"Created: / 6.1.1998 / 21:09:26 / cg" |
|
4806 |
! |
|
4807 |
||
253 | 4808 |
_Object_notifyAll:nativeContext |
4809 |
self wakeupAll:(nativeContext receiver). |
|
4810 |
||
4811 |
"Created: / 3.1.1998 / 03:06:56 / cg" |
|
4812 |
! |
|
4813 |
||
4814 |
_Object_wait:nativeMethodContext |
|
4815 |
"wait" |
|
4816 |
||
4817 |
|tmo handle sema enteredMonitors| |
|
4818 |
||
4819 |
handle := nativeMethodContext receiver. |
|
4820 |
tmo := nativeMethodContext argAt:1. |
|
4821 |
||
4822 |
sema := JavaVM semaphoreFor:handle. |
|
4823 |
||
4824 |
"/ temporarily leave all entered monitors. |
|
4825 |
||
4826 |
enteredMonitors := self enteredMonitors. |
|
4827 |
||
4828 |
enteredMonitors size > 0 ifTrue:[ |
|
306 | 4829 |
MonitorTrace ifTrue:[ |
4830 |
('====> wait - exit ' , enteredMonitors size printString , ' monitors in ' , Processor activeProcess name , ' ...') infoPrintCR. |
|
4831 |
]. |
|
4832 |
enteredMonitors do:[:handle | |
|
4833 |
|mon| |
|
4834 |
||
4835 |
mon := LockTable at:handle ifAbsent:nil. |
|
4836 |
mon isNil ifTrue:[ |
|
4837 |
self halt:'no monitor in wait'. |
|
4838 |
] ifFalse:[ |
|
4839 |
MonitorTrace ifTrue:[ |
|
4840 |
('====> wait - exit monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. |
|
4841 |
]. |
|
4842 |
mon exit. |
|
4843 |
]. |
|
4844 |
]. |
|
253 | 4845 |
]. |
4846 |
||
4847 |
[ |
|
306 | 4848 |
ThreadTrace ifTrue:[ |
4849 |
('====> thread ' , Processor activeProcess name , ' waiting ...') infoPrintCR. |
|
4850 |
]. |
|
307 | 4851 |
Processor activeProcess state:#javaWait. |
306 | 4852 |
tmo = 0 ifTrue:[ |
4853 |
sema wait. |
|
4854 |
] ifFalse:[ |
|
4855 |
sema waitWithTimeout:tmo / 1000. |
|
4856 |
]. |
|
4857 |
] valueOnUnwindDo: "valueNowOrOnUnwindDo:" [ |
|
4858 |
JavaVM releaseSemaphoreFor:handle. |
|
253 | 4859 |
]. |
4860 |
||
4861 |
"/ re-enter monitors. |
|
4862 |
||
4863 |
enteredMonitors size > 0 ifTrue:[ |
|
306 | 4864 |
MonitorTrace ifTrue:[ |
4865 |
('====> wait - reenter ' , enteredMonitors size printString , ' monitors in ' , Processor activeProcess name , ' ...') infoPrintCR. |
|
4866 |
]. |
|
4867 |
enteredMonitors do:[:handle | |
|
4868 |
|mon| |
|
4869 |
||
4870 |
LockTableAccess critical:[ |
|
4871 |
mon := LockTable at:handle ifAbsent:nil. |
|
4872 |
mon isNil ifTrue:[ |
|
4873 |
LockTable at:handle put:(mon := Monitor new) |
|
4874 |
] |
|
4875 |
]. |
|
4876 |
MonitorTrace ifTrue:[ |
|
4877 |
('====> wait - reenter monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. |
|
4878 |
]. |
|
4879 |
mon enter. |
|
4880 |
] |
|
253 | 4881 |
]. |
4882 |
||
4883 |
ThreadTrace ifTrue:[ |
|
306 | 4884 |
'====> thread continues ...' printCR. |
253 | 4885 |
] |
4886 |
||
426 | 4887 |
"Modified: / 5.11.1998 / 20:42:46 / cg" |
253 | 4888 |
! |
4889 |
||
4890 |
_Runtime_buildLibName:nativeContext |
|
4891 |
|jPath jFileName path fileName libName| |
|
4892 |
||
4893 |
jPath := nativeContext argAt:1. |
|
4894 |
jFileName := nativeContext argAt:2. |
|
4895 |
||
4896 |
path := Java as_ST_String:jPath. |
|
4897 |
fileName := Java as_ST_String:jFileName. |
|
4898 |
||
4899 |
path = '__builtIn__' ifTrue:[ |
|
261 | 4900 |
libName := path , '/' , fileName |
253 | 4901 |
] ifFalse:[ |
261 | 4902 |
libName := path , '/lib' , fileName , '.so'. |
253 | 4903 |
]. |
4904 |
^ Java as_String:libName. |
|
4905 |
||
4906 |
"Modified: / 8.8.1997 / 12:05:05 / cg" |
|
4907 |
"Created: / 4.1.1998 / 19:07:14 / cg" |
|
4908 |
! |
|
4909 |
||
261 | 4910 |
_Runtime_execInternal:nativeContext |
4911 |
"Run a unix-command; return a process object." |
|
4912 |
||
4913 |
|cmdAndArgArray envArray cmd jProcessClass jProcess| |
|
4914 |
||
432 | 4915 |
cmdAndArgArray := nativeContext argAt:1. |
4916 |
envArray := nativeContext argAt:2. |
|
4917 |
||
4918 |
cmd := cmdAndArgArray at:1. |
|
4919 |
||
4920 |
OperatingSystem isUNIXlike ifTrue:[ |
|
4921 |
jProcessClass := Java classForName:'java.lang.UNIXProcess'. |
|
4922 |
] ifFalse:[ |
|
4923 |
jProcessClass := Java classForName:'java.lang.Win32Process'. |
|
4924 |
]. |
|
261 | 4925 |
"/ |
432 | 4926 |
jProcessClass notNil ifTrue:[ |
4927 |
jProcess := jProcessClass newCleared. |
|
4928 |
jProcess |
|
4929 |
perform:#'<init>([Ljava/lang/String;[Ljava/lang/String;)V' |
|
4930 |
with:cmdAndArgArray |
|
4931 |
with:envArray. |
|
4932 |
^ jProcess |
|
4933 |
]. |
|
4934 |
self halt. |
|
261 | 4935 |
self throwIOExceptionWithMessage:'Process execution disabled/unimplemented'. |
4936 |
^ nil |
|
4937 |
||
4938 |
"Created: / 15.1.1998 / 01:50:31 / cg" |
|
432 | 4939 |
"Modified: / 10.11.1998 / 19:54:29 / cg" |
261 | 4940 |
! |
4941 |
||
255 | 4942 |
_Runtime_exitInternal:nativeContext |
4943 |
"exit - here, we only shut down java threads" |
|
4944 |
||
4945 |
|enteredMonitors| |
|
4946 |
||
474 | 4947 |
ExitDebug == true ifTrue:[ |
4948 |
self halt:'Java code called exit'. |
|
4949 |
]. |
|
4950 |
||
255 | 4951 |
(enteredMonitors := self enteredMonitors) size > 0 ifTrue:[ |
306 | 4952 |
enteredMonitors do:[:handle | |
4953 |
| mon | |
|
4954 |
||
4955 |
mon := LockTable at:handle ifAbsent:nil. |
|
4956 |
mon isNil ifTrue:[ |
|
4957 |
self halt:'no monitor in exitInternal'. |
|
4958 |
] ifFalse:[ |
|
4959 |
mon exit. |
|
255 | 4960 |
('====> terminateThread - exit monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. |
4961 |
"/ LockTableAccess critical:[ |
|
4962 |
"/ mon isFree ifTrue:[ |
|
4963 |
"/ LockTable removeKey:handle |
|
4964 |
"/ ] |
|
4965 |
"/ ] |
|
306 | 4966 |
]. |
4967 |
]. |
|
4968 |
]. |
|
4969 |
||
4970 |
"/ JavaVM releaseAllJavaResources. |
|
255 | 4971 |
AbortSignal raise. |
4972 |
self halt. |
|
4973 |
||
4974 |
"Created: / 7.1.1998 / 22:48:51 / cg" |
|
474 | 4975 |
"Modified: / 2.12.1998 / 23:03:18 / cg" |
255 | 4976 |
! |
4977 |
||
4978 |
_Runtime_freeMemory:nativeContext |
|
4979 |
"free memory - Returns the number of free bytes" |
|
4980 |
||
4981 |
^ ObjectMemory freeListSpace + ObjectMemory freeSpace |
|
4982 |
||
4983 |
"Created: / 12.1.1998 / 12:59:53 / cg" |
|
4984 |
! |
|
4985 |
||
4986 |
_Runtime_gc:nativeContext |
|
4987 |
"Runs the garbage collector. |
|
4988 |
Ignored, since the ST-gc runs all the time." |
|
4989 |
||
4990 |
^ self |
|
4991 |
||
4992 |
"Modified: / 12.1.1998 / 12:58:32 / cg" |
|
4993 |
! |
|
4994 |
||
253 | 4995 |
_Runtime_initializeLinkerInternal:nativeContext |
4996 |
"init sharedLib linker, return searchPath as javaString" |
|
4997 |
||
4998 |
|path| |
|
4999 |
||
5000 |
"/ mhmh - what is done here ? |
|
5001 |
||
5002 |
path := ''. |
|
5003 |
LibPath do:[:comp | path size == 0 ifTrue:[ |
|
261 | 5004 |
path := path , comp |
5005 |
] ifFalse:[ |
|
5006 |
path := path , ':' , comp |
|
5007 |
] |
|
5008 |
]. |
|
253 | 5009 |
|
5010 |
^ Java as_String:path |
|
5011 |
||
5012 |
"Modified: / 7.8.1997 / 21:17:03 / cg" |
|
5013 |
"Created: / 4.1.1998 / 17:53:15 / cg" |
|
5014 |
! |
|
5015 |
||
5016 |
_Runtime_loadFileInternal:nativeContext |
|
5017 |
"load a sharedLib, return boolean 0 (false) if fail; 1 (true) if ok" |
|
5018 |
||
5019 |
|ret| |
|
5020 |
||
5021 |
ret := self _Runtime_loadFileInternalI:nativeContext. |
|
5022 |
ret < 0 ifTrue:[ ret := 0 ]. |
|
5023 |
^ ret |
|
5024 |
||
5025 |
"Created: / 4.1.1998 / 19:10:20 / cg" |
|
5026 |
"Modified: / 4.1.1998 / 19:11:04 / cg" |
|
5027 |
! |
|
5028 |
||
5029 |
_Runtime_loadFileInternalI:nativeContext |
|
5030 |
"1.1b3 change; load a sharedLib like 'loadFileInternal', |
|
5031 |
but return integer: |
|
319 | 5032 |
-1 outOfMemory error |
5033 |
0 failed to load |
|
5034 |
1 loaded or already loaded (i.e. ok)" |
|
253 | 5035 |
|
5036 |
|jLibName libName libHandle| |
|
5037 |
||
5038 |
jLibName := nativeContext argAt:1. |
|
5039 |
libName := Java as_ST_String:jLibName. |
|
5040 |
||
5041 |
(SimulatedLibs includes:libName) ifTrue:[ |
|
319 | 5042 |
"/ ('JAVA: builtIn libLoad simulated: ' , libName) printNL. |
5043 |
^ 1 |
|
253 | 5044 |
]. |
5045 |
(LoadedLibs notNil and:[LoadedLibs includesKey:libName]) ifTrue:[ |
|
319 | 5046 |
"/ ('JAVA: already loaded: ' , libName) printNL. |
5047 |
^ 1 |
|
253 | 5048 |
]. |
5049 |
||
5050 |
libName asFilename exists ifFalse:[ |
|
319 | 5051 |
('JAVA: no file to load: ' , libName) printNL. |
5052 |
^ 0 |
|
5053 |
]. |
|
5054 |
||
5055 |
(self confirm:'permission to load native library: ' , libName , ' ?') ifFalse:[ |
|
5056 |
^ 0 |
|
253 | 5057 |
]. |
5058 |
||
5059 |
libHandle := ObjectFileLoader loadLibrary:libName. |
|
5060 |
libHandle isNil ifTrue:[ |
|
319 | 5061 |
('JAVA: failed to load: ' , libName) printNL. |
5062 |
^ 0 |
|
253 | 5063 |
]. |
5064 |
||
5065 |
LoadedLibs isNil ifTrue:[ |
|
319 | 5066 |
LoadedLibs := Dictionary new. |
253 | 5067 |
]. |
5068 |
||
5069 |
LoadedLibs at:libName put:libHandle. |
|
5070 |
^ 1 |
|
5071 |
||
5072 |
"Created: / 4.1.1998 / 19:10:54 / cg" |
|
319 | 5073 |
"Modified: / 6.2.1998 / 03:11:59 / cg" |
253 | 5074 |
! |
5075 |
||
440 | 5076 |
_Runtime_runFinalization:nativeContext |
5077 |
"/ void runFinalization () |
|
5078 |
UnimplementedNativeMethodSignal raise |
|
5079 |
||
5080 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5081 |
"Created: / 12.11.1998 / 18:59:01 / cg" |
|
5082 |
! |
|
5083 |
||
380 | 5084 |
_Runtime_runFinalizersOnExit0:nativeContext |
5085 |
"" |
|
5086 |
||
5087 |
|onOff| |
|
5088 |
||
5089 |
onOff := nativeContext argAt:1. |
|
5090 |
^ 1 |
|
5091 |
||
5092 |
"Modified: / 6.2.1998 / 03:11:59 / cg" |
|
5093 |
"Created: / 15.10.1998 / 23:34:55 / cg" |
|
5094 |
! |
|
5095 |
||
255 | 5096 |
_Runtime_totalMemory:nativeContext |
5097 |
"free memory - Returns the total number of bytes" |
|
5098 |
||
5099 |
^ ObjectMemory oldSpaceSize + ObjectMemory newSpaceSize |
|
5100 |
||
5101 |
"Created: / 12.1.1998 / 12:59:23 / cg" |
|
5102 |
! |
|
5103 |
||
440 | 5104 |
_Runtime_traceInstructions:nativeContext |
5105 |
"/ void traceInstructions (boolean) |
|
5106 |
UnimplementedNativeMethodSignal raise |
|
5107 |
||
5108 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5109 |
"Created: / 12.11.1998 / 18:59:18 / cg" |
|
5110 |
! |
|
5111 |
||
5112 |
_Runtime_traceMethodCalls:nativeContext |
|
5113 |
"/ void traceMethodCalls (boolean) |
|
5114 |
UnimplementedNativeMethodSignal raise |
|
5115 |
||
5116 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5117 |
"Created: / 12.11.1998 / 18:59:37 / cg" |
|
5118 |
! |
|
5119 |
||
5120 |
_SecurityManager_classDepth:nativeContext |
|
5121 |
UnimplementedNativeMethodSignal raise |
|
5122 |
||
5123 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5124 |
"Created: / 12.11.1998 / 18:56:27 / cg" |
|
5125 |
! |
|
5126 |
||
261 | 5127 |
_SecurityManager_classLoaderDepth:nativeContext |
5128 |
|con depth| |
|
5129 |
||
5130 |
con := thisContext sender. |
|
5131 |
depth := 1. |
|
5132 |
[con notNil] whileTrue:[ |
|
5133 |
con receiver == JavaClassReader classLoaderQuerySignal ifTrue:[ |
|
5134 |
con selector == #handle:do: ifTrue:[ |
|
5135 |
depth := depth + 1 |
|
5136 |
] |
|
5137 |
]. |
|
5138 |
con := con sender. |
|
5139 |
]. |
|
5140 |
'JAVA: classLoaderDepth -> ' infoPrint. depth infoPrintCR. |
|
5141 |
^ depth. |
|
5142 |
||
5143 |
"Created: / 13.1.1998 / 09:21:46 / cg" |
|
5144 |
"Modified: / 13.1.1998 / 09:33:43 / cg" |
|
5145 |
! |
|
5146 |
||
5147 |
_SecurityManager_currentClassLoader:nativeContext |
|
5148 |
|loader| |
|
5149 |
||
5150 |
loader := JavaClassReader classLoaderQuerySignal raise. |
|
5151 |
'JAVA: currentClassLoader -> ' infoPrint. loader displayString infoPrintCR. |
|
5152 |
^ loader. |
|
5153 |
||
5154 |
"Created: / 13.1.1998 / 09:23:28 / cg" |
|
5155 |
! |
|
5156 |
||
440 | 5157 |
_SecurityManager_currentLoadedClass0:nativeContext |
5158 |
UnimplementedNativeMethodSignal raise |
|
5159 |
||
5160 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5161 |
"Created: / 12.11.1998 / 18:56:41 / cg" |
|
5162 |
! |
|
5163 |
||
5164 |
_SecurityManager_getClassContext:nativeContext |
|
5165 |
UnimplementedNativeMethodSignal raise |
|
5166 |
||
5167 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5168 |
"Created: / 12.11.1998 / 18:56:06 / cg" |
|
5169 |
! |
|
5170 |
||
5171 |
_String_intern:nativeContext |
|
5172 |
UnimplementedNativeMethodSignal raise |
|
5173 |
||
5174 |
"Created: / 12.11.1998 / 18:50:56 / cg" |
|
5175 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5176 |
! |
|
5177 |
||
253 | 5178 |
_System_arraycopy:nativeContext |
398 | 5179 |
|srcArray srcIdx dstArray dstIdx count dstEndIdx| |
253 | 5180 |
|
5181 |
srcArray := nativeContext argAt:1. |
|
5182 |
srcIdx := nativeContext argAt:2. |
|
5183 |
dstArray := nativeContext argAt:3. |
|
5184 |
dstIdx := nativeContext argAt:4. |
|
5185 |
count := nativeContext argAt:5. |
|
5186 |
||
398 | 5187 |
dstEndIdx := dstIdx + count. |
5188 |
dstIdx := dstIdx + 1. "/ ST uses 1-based indexing |
|
5189 |
srcIdx := srcIdx + 1. "/ ST uses 1-based indexing |
|
5190 |
||
253 | 5191 |
srcArray class isBytes ifTrue:[ |
398 | 5192 |
dstArray class isBytes ifFalse:[ |
5193 |
self halt:'incompatible arraycopy collections'. |
|
5194 |
]. |
|
5195 |
dstArray replaceBytesFrom:dstIdx to:dstEndIdx with:srcArray startingAt:srcIdx. |
|
253 | 5196 |
] ifFalse:[ |
398 | 5197 |
dstArray replaceFrom:dstIdx to:dstEndIdx with:srcArray startingAt:srcIdx. |
253 | 5198 |
]. |
5199 |
^ nil. |
|
5200 |
||
5201 |
"Created: / 3.1.1998 / 01:56:44 / cg" |
|
398 | 5202 |
"Modified: / 20.10.1998 / 16:22:46 / cg" |
253 | 5203 |
! |
5204 |
||
5205 |
_System_currentTimeMillis:nativeContext |
|
5206 |
"return the milliseconds since 1.jan.1970" |
|
5207 |
||
368 | 5208 |
|seconds delta| |
5209 |
||
5210 |
"/ workaround win32 bug (use 01:01:01 as base) |
|
5211 |
delta := AbsoluteTime now millisecondDeltaFrom:(AbsoluteTime day:1 month:1 year:1970 hour:1 minutes:1 seconds:1). |
|
5212 |
delta := delta - 3600 - 60 - 1. |
|
409 | 5213 |
"/ make certain, it fits 64 signed bits |
5214 |
delta := delta bitAnd:16r7FFFFFFFFFFFFFFF. |
|
368 | 5215 |
^ delta max:0 |
253 | 5216 |
|
5217 |
"Created: / 3.1.1998 / 03:25:50 / cg" |
|
409 | 5218 |
"Modified: / 2.11.1998 / 16:42:00 / cg" |
253 | 5219 |
! |
5220 |
||
440 | 5221 |
_System_identityHashCode:nativeContext |
5222 |
UnimplementedNativeMethodSignal raise |
|
5223 |
||
5224 |
"Modified: / 12.11.1998 / 18:52:07 / cg" |
|
5225 |
"Created: / 12.11.1998 / 18:54:00 / cg" |
|
5226 |
! |
|
5227 |
||
253 | 5228 |
_System_initProperties:nativeContext |
5229 |
|props stProps| |
|
5230 |
||
5231 |
props := nativeContext argAt:1. |
|
5232 |
stProps := self systemProperties. |
|
5233 |
||
5234 |
"/ recursively invoke myself on the Java HashTable. |
|
5235 |
"/ calling 'put' to stuff in the values ... |
|
5236 |
||
5237 |
stProps keysAndValuesDo:[:key :value | |
|
270 | 5238 |
|keyObj valueObj| |
5239 |
||
5240 |
keyObj := Java as_String:key. |
|
5241 |
valueObj := Java as_String:value. |
|
5242 |
||
5243 |
props |
|
5244 |
perform:#'put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' |
|
5245 |
with:keyObj |
|
5246 |
with:valueObj. |
|
253 | 5247 |
]. |
5248 |
^ props |
|
5249 |
||
5250 |
"Created: / 3.1.1998 / 14:25:22 / cg" |
|
5251 |
"Modified: / 4.1.1998 / 14:23:18 / cg" |
|
5252 |
! |
|
5253 |
||
5254 |
_System_setErr0:nativeContext |
|
5255 |
|stream| |
|
5256 |
||
5257 |
stream := nativeContext argAt:1. |
|
5258 |
||
5259 |
self setOpenFile:(self javaConsoleStream ? Stderr) at:2. |
|
5260 |
||
5261 |
nativeContext receiver instVarNamed:'err' put:stream. |
|
5262 |
||
5263 |
"Created: / 18.3.1997 / 15:02:05 / cg" |
|
5264 |
"Modified: / 4.1.1998 / 16:21:15 / cg" |
|
5265 |
! |
|
5266 |
||
5267 |
_System_setIn0:nativeContext |
|
5268 |
|stream| |
|
5269 |
||
5270 |
stream := nativeContext argAt:1. |
|
5271 |
||
5272 |
self setOpenFile:Stdin at:0. |
|
5273 |
||
5274 |
nativeContext receiver instVarNamed:'in' put:stream. |
|
5275 |
||
5276 |
"Created: / 4.1.1998 / 16:16:38 / cg" |
|
5277 |
"Modified: / 4.1.1998 / 16:20:44 / cg" |
|
5278 |
! |
|
5279 |
||
5280 |
_System_setOut0:nativeContext |
|
5281 |
|stream| |
|
5282 |
||
5283 |
stream := nativeContext argAt:1. |
|
5284 |
||
5285 |
self setOpenFile:(self javaConsoleStream ? Stdout) at:1. |
|
5286 |
||
5287 |
nativeContext receiver instVarNamed:'out' put:stream. |
|
5288 |
||
5289 |
"Created: / 4.1.1998 / 16:18:26 / cg" |
|
5290 |
"Modified: / 4.1.1998 / 16:20:23 / cg" |
|
5291 |
! |
|
5292 |
||
440 | 5293 |
_Thread_countStackFrames:nativeContext |
5294 |
"/ int countStackFrames () |
|
5295 |
UnimplementedNativeMethodSignal raise |
|
5296 |
||
5297 |
"Created: / 12.11.1998 / 19:06:21 / cg" |
|
5298 |
! |
|
5299 |
||
253 | 5300 |
_Thread_currentThread:nativeMethodContext |
5301 |
|t p prio| |
|
5302 |
||
5303 |
p := Processor activeProcess. |
|
5304 |
t := self javaThreadForSTProcess:p. |
|
5305 |
t notNil ifTrue:[ |
|
261 | 5306 |
^ t |
253 | 5307 |
]. |
5308 |
t := self newThread:'main'. |
|
5309 |
Java threads at:t put:p. |
|
5310 |
^ t |
|
5311 |
||
5312 |
"Created: / 3.1.1998 / 01:42:28 / cg" |
|
5313 |
"Modified: / 4.1.1998 / 14:59:13 / cg" |
|
5314 |
! |
|
5315 |
||
339 | 5316 |
_Thread_interrupt0:nativeContext |
5317 |
"ask if a thread is interrupted (clear interruptState if arg is true)" |
|
5318 |
||
5319 |
|jThread stProcess| |
|
5320 |
||
5321 |
jThread := nativeContext receiver. |
|
5322 |
stProcess := self stProcessForJavaThread:jThread. |
|
5323 |
stProcess isNil ifTrue:[ |
|
5324 |
self halt. |
|
5325 |
^ 0 |
|
5326 |
]. |
|
5327 |
||
5328 |
stProcess markInterrupted |
|
5329 |
||
5330 |
"Modified: / 2.1.1998 / 21:49:06 / cg" |
|
5331 |
"Created: / 10.4.1998 / 15:21:43 / cg" |
|
5332 |
! |
|
5333 |
||
253 | 5334 |
_Thread_isAlive:nativeContext |
5335 |
"is it alive ?" |
|
5336 |
||
5337 |
|jThread stProcess| |
|
5338 |
||
5339 |
jThread := nativeContext receiver. |
|
5340 |
stProcess := JavaVM stProcessForJavaThread:jThread. |
|
5341 |
stProcess isNil ifTrue:[ |
|
318 | 5342 |
ThreadTrace == true ifTrue:[ |
5343 |
('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL. |
|
5344 |
]. |
|
5345 |
^ 0 "FALSE" |
|
255 | 5346 |
]. |
5347 |
stProcess isDead ifTrue:[^ 0 "FALSE"]. |
|
5348 |
^ 1 "TRUE" |
|
5349 |
||
5350 |
"Created: / 5.1.1998 / 02:03:51 / cg" |
|
318 | 5351 |
"Modified: / 6.2.1998 / 02:15:01 / cg" |
255 | 5352 |
! |
5353 |
||
5354 |
_Thread_isInterrupted:nativeContext |
|
5355 |
"ask if a thread is interrupted (clear interruptState if arg is true)" |
|
5356 |
||
5357 |
|jThread stProcess clearInterrupt rslt| |
|
5358 |
||
5359 |
jThread := nativeContext receiver. |
|
5360 |
stProcess := self stProcessForJavaThread:jThread. |
|
5361 |
stProcess isNil ifTrue:[ |
|
261 | 5362 |
self halt. |
5363 |
^ 0 |
|
253 | 5364 |
]. |
255 | 5365 |
|
5366 |
clearInterrupt := nativeContext argAt:1. |
|
5367 |
rslt := stProcess isInterrupted ifTrue:[1] ifFalse:[0]. |
|
5368 |
clearInterrupt ~~ 0 ifTrue:[stProcess clearInterruptActions]. |
|
5369 |
^ rslt |
|
5370 |
||
5371 |
"Modified: / 2.1.1998 / 21:49:06 / cg" |
|
5372 |
"Created: / 7.1.1998 / 18:50:26 / cg" |
|
5373 |
! |
|
5374 |
||
5375 |
_Thread_resume0:nativeContext |
|
5376 |
"yield" |
|
5377 |
||
5378 |
|jThread stProcess| |
|
5379 |
||
5380 |
jThread := nativeContext receiver. |
|
5381 |
stProcess := JavaVM stProcessForJavaThread:jThread. |
|
5382 |
stProcess isNil ifTrue:[ |
|
318 | 5383 |
ThreadTrace == true ifTrue:[ |
5384 |
('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL. |
|
5385 |
]. |
|
5386 |
^ nil "void" |
|
255 | 5387 |
]. |
5388 |
stProcess resume |
|
5389 |
||
5390 |
"Created: / 8.1.1998 / 01:06:27 / cg" |
|
318 | 5391 |
"Modified: / 6.2.1998 / 02:15:08 / cg" |
253 | 5392 |
! |
5393 |
||
5394 |
_Thread_setPriority0:nativeMethodContext |
|
5395 |
|t p prio| |
|
5396 |
||
5397 |
t := nativeMethodContext receiver. |
|
5398 |
p := JavaVM stProcessForJavaThread:t. |
|
5399 |
prio := nativeMethodContext argAt:1. |
|
5400 |
||
5401 |
p isNil ifTrue:[ |
|
318 | 5402 |
ThreadTrace == true ifTrue:[ |
5403 |
'JAVA [info]: no process yet (in setPriority)' infoPrintCR. |
|
5404 |
]. |
|
5405 |
^ nil |
|
253 | 5406 |
]. |
5407 |
||
5408 |
ThreadTrace ifTrue:[ |
|
318 | 5409 |
'JAVA [info]: setPrio: ' print. t print. ' pri= ' print. prio print. ' p= ' print. p printNL. |
253 | 5410 |
]. |
5411 |
^ nil |
|
5412 |
||
5413 |
"Created: / 2.1.1998 / 19:05:55 / cg" |
|
318 | 5414 |
"Modified: / 6.2.1998 / 02:28:18 / cg" |
253 | 5415 |
! |
5416 |
||
255 | 5417 |
_Thread_sleep:nativeContext |
5418 |
"sleep for some milliseconds " |
|
5419 |
||
5420 |
|millis| |
|
5421 |
||
432 | 5422 |
millis := nativeContext argAt:1. |
5423 |
Delay waitForMilliseconds:(millis max:50) |
|
255 | 5424 |
|
5425 |
"Created: / 7.1.1998 / 15:34:23 / cg" |
|
432 | 5426 |
"Modified: / 10.11.1998 / 22:28:04 / cg" |
255 | 5427 |
! |
5428 |
||
253 | 5429 |
_Thread_start:nativeContext |
5430 |
"start the thread" |
|
5431 |
||
5432 |
|jThread jName name stProcess| |
|
5433 |
||
5434 |
jThread := nativeContext receiver. |
|
5435 |
(jThread instVarNamed:'priority') < 1 ifTrue:[ |
|
297 | 5436 |
self halt. |
5437 |
jThread instVarNamed:'priority' put:1. |
|
253 | 5438 |
]. |
5439 |
||
5440 |
stProcess := JavaProcess |
|
297 | 5441 |
for:[ |
405 | 5442 |
|procName| |
5443 |
||
5444 |
Object abortSignal handle:[:ex | |
|
5445 |
procName := stProcess name. |
|
5446 |
('JAVA: thread ' , procName , ' aborted - restarting process.') infoPrintCR. |
|
457 | 5447 |
"/ ex restart. |
405 | 5448 |
] do:[ |
297 | 5449 |
[ |
5450 |
JavaVM javaExceptionSignal handle:[:ex | |
|
405 | 5451 |
|exClass| |
297 | 5452 |
|
5453 |
procName := stProcess name. |
|
5454 |
exClass := ex parameter class. |
|
5455 |
||
5456 |
exClass == (Java at:'java.lang.ThreadDeath') ifTrue:[ |
|
5457 |
('JAVA: thread ' , procName , ' terminated') infoPrintCR. |
|
5458 |
] ifFalse:[ |
|
5459 |
Transcript |
|
5460 |
showCR:('JAVA: thread ''' |
|
5461 |
, procName |
|
5462 |
, ''' terminated with exception: ' |
|
5463 |
, exClass name). |
|
5464 |
]. |
|
5465 |
ex return. |
|
5466 |
] do:[ |
|
5467 |
jThread perform:#'run()V'. |
|
316 | 5468 |
ThreadTrace == true ifTrue:[ |
5469 |
('JAVA: thread ' , stProcess name , ' terminated') infoPrintCR. |
|
5470 |
]. |
|
297 | 5471 |
jThread perform:#'exit()V'. |
316 | 5472 |
ThreadTrace == true ifTrue:[ |
5473 |
('JAVA: after exit of thread ' , stProcess name) infoPrintCR. |
|
5474 |
] |
|
297 | 5475 |
] |
5476 |
] valueNowOrOnUnwindDo:[ |
|
5477 |
Java threads removeKey:jThread ifAbsent:[]. |
|
5478 |
] |
|
405 | 5479 |
] |
297 | 5480 |
] |
5481 |
priority:(Processor activePriority). |
|
253 | 5482 |
|
5483 |
jName := jThread instVarNamed:'name'. |
|
5484 |
jName isString ifFalse:[ |
|
297 | 5485 |
name := Java as_ST_String:jName. |
253 | 5486 |
] ifTrue:[ |
297 | 5487 |
name := jName |
5488 |
]. |
|
5489 |
||
5490 |
"/ kludge - remember the ScreenUpdater ... |
|
5491 |
name = 'Screen Updater' ifTrue:[ |
|
5492 |
ScreenUpdaterProcess := stProcess. |
|
253 | 5493 |
]. |
5494 |
||
5495 |
"/ when that process terminates, wakup any waiters |
|
5496 |
stProcess addExitAction:[self wakeup:jThread]. |
|
5497 |
||
5498 |
stProcess name:'JAVA-' , name. |
|
5499 |
stProcess resume. |
|
5500 |
||
5501 |
Java threads at:jThread put:stProcess. |
|
5502 |
||
5503 |
^ nil |
|
5504 |
||
5505 |
"Created: / 3.1.1998 / 02:05:52 / cg" |
|
457 | 5506 |
"Modified: / 17.11.1998 / 23:01:17 / cg" |
255 | 5507 |
! |
5508 |
||
5509 |
_Thread_stop0:nativeContext |
|
5510 |
"terminate a thread" |
|
5511 |
||
5512 |
|jThread stProcess death| |
|
5513 |
||
5514 |
jThread := nativeContext receiver. |
|
5515 |
||
5516 |
stProcess := JavaVM stProcessForJavaThread:jThread. |
|
5517 |
stProcess isNil ifTrue:[ |
|
318 | 5518 |
ThreadTrace == true ifTrue:[ |
5519 |
('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL. |
|
5520 |
]. |
|
5521 |
^ nil "void" |
|
255 | 5522 |
]. |
5523 |
death := nativeContext argAt:1. |
|
5524 |
stProcess |
|
318 | 5525 |
interruptWith:[ |
5526 |
JavaVM javaExceptionSignal handle:[:ex | |
|
5527 |
Processor activeProcess terminate |
|
5528 |
] do:[ |
|
5529 |
ThreadTrace == true ifTrue:[ |
|
5530 |
('JAVA: thread exit: ' , jThread displayString) infoPrintNL. |
|
5531 |
]. |
|
5532 |
jThread perform:#'exit()V'. |
|
5533 |
self throwException:death. |
|
5534 |
] |
|
5535 |
]. |
|
255 | 5536 |
stProcess resume. |
5537 |
||
5538 |
[stProcess isDead] whileFalse:[ |
|
318 | 5539 |
stProcess resume. |
466 | 5540 |
'JavaVM: wait for death' infoPrintCR. |
318 | 5541 |
Delay waitForSeconds:0.1 |
255 | 5542 |
]. |
5543 |
stProcess terminate |
|
5544 |
||
5545 |
"Created: / 8.1.1998 / 13:11:17 / cg" |
|
466 | 5546 |
"Modified: / 25.11.1998 / 20:21:19 / cg" |
255 | 5547 |
! |
5548 |
||
5549 |
_Thread_suspend0:nativeContext |
|
5550 |
"yield" |
|
5551 |
||
5552 |
|jThread stProcess| |
|
5553 |
||
5554 |
jThread := nativeContext receiver. |
|
5555 |
stProcess := JavaVM stProcessForJavaThread:jThread. |
|
5556 |
stProcess isNil ifTrue:[ |
|
318 | 5557 |
ThreadTrace == true ifTrue:[ |
5558 |
('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL. |
|
5559 |
]. |
|
5560 |
^ nil "void" |
|
255 | 5561 |
]. |
5562 |
stProcess suspend |
|
5563 |
||
5564 |
"Created: / 8.1.1998 / 01:05:49 / cg" |
|
318 | 5565 |
"Modified: / 6.2.1998 / 02:15:23 / cg" |
255 | 5566 |
! |
5567 |
||
5568 |
_Thread_yield:nativeContext |
|
5569 |
"yield" |
|
5570 |
||
5571 |
|jThread stProcess| |
|
5572 |
||
5573 |
jThread := nativeContext receiver. |
|
5574 |
stProcess := JavaVM stProcessForJavaThread:jThread. |
|
5575 |
stProcess isNil ifTrue:[ |
|
318 | 5576 |
ThreadTrace == true ifTrue:[ |
5577 |
('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL. |
|
5578 |
]. |
|
5579 |
^ nil "void" |
|
255 | 5580 |
]. |
5581 |
stProcess == Processor activeProcess ifTrue:[ |
|
318 | 5582 |
Processor yield. |
255 | 5583 |
] ifFalse:[ |
318 | 5584 |
self halt. |
255 | 5585 |
]. |
5586 |
||
5587 |
"Created: / 5.1.1998 / 02:03:51 / cg" |
|
318 | 5588 |
"Modified: / 6.2.1998 / 02:15:29 / cg" |
253 | 5589 |
! |
5590 |
||
5591 |
_Throwable_fillInStackTrace:nativeContext |
|
255 | 5592 |
|exClass exceptionObject list con| |
253 | 5593 |
|
5594 |
exClass := Java classNamed:'java.lang.Throwable'. |
|
5595 |
||
5596 |
exceptionObject := nativeContext receiver. |
|
5597 |
||
5598 |
"/ |
|
5599 |
"/ debugging only |
|
5600 |
"/ |
|
5601 |
(exceptionObject isKindOf:(Java classNamed:'java.lang.Throwable')) ifFalse:[ |
|
347 | 5602 |
self halt |
253 | 5603 |
]. |
5604 |
||
5605 |
con := thisContext sender. |
|
5606 |
||
5607 |
"/ |
|
5608 |
"/ we are not interrested in all intermediate Exception frames ... |
|
5609 |
"/ |
|
5610 |
FullExceptionTrace ifFalse:[ |
|
347 | 5611 |
"/ first, skip any JavaVM contexts |
5612 |
[con receiver == exceptionObject] whileFalse:[ |
|
5613 |
con := con sender |
|
5614 |
]. |
|
5615 |
"/ then, all exception-init contexts |
|
5616 |
[con receiver == exceptionObject] whileTrue:[ |
|
5617 |
con := con sender |
|
5618 |
]. |
|
253 | 5619 |
]. |
5620 |
||
255 | 5621 |
list := OrderedCollection new. |
5622 |
[con notNil] whileTrue:[ |
|
347 | 5623 |
(con isJavaContext) ifTrue:[ |
5624 |
"/ add a copy, in case the context continues with some |
|
5625 |
"/ cleanup ... |
|
5626 |
list add:con shallowCopy |
|
5627 |
]. |
|
5628 |
con := con sender |
|
255 | 5629 |
]. |
5630 |
||
5631 |
exceptionObject instVarNamed:'backtrace' put:(list asArray). |
|
253 | 5632 |
|
5633 |
^ nil. |
|
5634 |
||
5635 |
"Created: / 4.1.1998 / 14:27:40 / cg" |
|
347 | 5636 |
"Modified: / 8.5.1998 / 21:29:53 / cg" |
255 | 5637 |
! |
5638 |
||
5639 |
_Throwable_printStackTrace0:nativeContext |
|
261 | 5640 |
|out outStream exceptionObject contextList| |
255 | 5641 |
|
5642 |
outStream := nativeContext argAt:1. |
|
5643 |
exceptionObject := nativeContext receiver. |
|
5644 |
||
5645 |
contextList := exceptionObject instVarNamed:'backtrace'. |
|
5646 |
||
261 | 5647 |
out := self javaConsoleStream. |
5648 |
out cr. |
|
5649 |
out nextPutLine:'JAVA: stackTrace:'. |
|
255 | 5650 |
|
5651 |
contextList do:[:con | |
|
429 | 5652 |
out |
5653 |
nextPutAll:' '; |
|
5654 |
nextPutAll:(con method javaClass fullName); |
|
5655 |
nextPutAll:'.'; |
|
5656 |
nextPutAll:(con method selector); |
|
5657 |
nextPutAll:' ['; |
|
5658 |
nextPutAll:(con method javaClass sourceFile); |
|
5659 |
nextPutAll:' '; |
|
5660 |
nextPutAll:(con quickLineNumber displayString); |
|
5661 |
nextPutAll:']'. |
|
5662 |
out cr |
|
261 | 5663 |
]. |
5664 |
out nextPutLine:'----------------------------------------------------' |
|
255 | 5665 |
|
5666 |
"Created: / 4.1.1998 / 14:27:40 / cg" |
|
429 | 5667 |
"Modified: / 10.11.1998 / 14:19:32 / cg" |
432 | 5668 |
! |
5669 |
||
5670 |
_Win32Process_create:nativeContext |
|
5671 |
"really create a win32 process" |
|
5672 |
||
5673 |
|env cmd jProcess p inPipe outPipe errorPipe| |
|
5674 |
||
5675 |
jProcess := nativeContext receiver. |
|
5676 |
cmd := nativeContext argAt:1. |
|
5677 |
cmd := Java as_ST_String:cmd. |
|
5678 |
||
5679 |
env := nativeContext argAt:2. |
|
5680 |
env notNil ifTrue:[ |
|
5681 |
self halt |
|
5682 |
]. |
|
5683 |
self halt. |
|
5684 |
||
5685 |
p := Win32Process new. |
|
5686 |
p command:cmd. |
|
5687 |
p environment:env. |
|
5688 |
p inStream:inPipe. |
|
5689 |
p outStream:outPipe. |
|
5690 |
p errorStream:errorPipe. |
|
5691 |
p directory:nil. |
|
5692 |
p startProcess. |
|
5693 |
self halt. |
|
5694 |
||
5695 |
jProcess instVarNamed:'handle' put:p. |
|
5696 |
||
5697 |
"Created: / 10.11.1998 / 19:50:31 / cg" |
|
5698 |
"Modified: / 10.11.1998 / 21:34:18 / cg" |
|
255 | 5699 |
! ! |
5700 |
||
277 | 5701 |
!JavaVM class methodsFor:'native - java.lang - jdk1.2'! |
5702 |
||
5703 |
_AccessController_beginPrivileged:nativeContext |
|
5704 |
"/ introduced with jdk1.2 |
|
5705 |
||
5706 |
"Created: / 27.1.1998 / 18:18:11 / cg" |
|
5707 |
! |
|
5708 |
||
5709 |
_AccessController_endPrivileged:nativeContext |
|
5710 |
"/ introduced with jdk1.2 |
|
5711 |
||
5712 |
"Created: / 27.1.1998 / 18:18:32 / cg" |
|
5713 |
! |
|
5714 |
||
5715 |
_AccessController_getStackAccessControlContext:nativeContext |
|
5716 |
"/ introduced with jdk1.2 |
|
5717 |
||
5718 |
"/ supposed to do more here ... |
|
5719 |
||
5720 |
^ nil |
|
5721 |
||
5722 |
"Created: / 27.1.1998 / 18:22:15 / cg" |
|
5723 |
! |
|
5724 |
||
5725 |
_ClassLoader$NativeLibrary_load:nativeContext |
|
5726 |
"/ introduced with jdk1.2 ... (sigh) |
|
5727 |
||
5728 |
|nativeLoader jLibName libName libHandle index| |
|
5729 |
||
5730 |
nativeLoader := nativeContext receiver. |
|
5731 |
jLibName := nativeContext argAt:1. |
|
5732 |
libName := Java as_ST_String:jLibName. |
|
5733 |
||
5734 |
(index := SimulatedNativeLibs indexOf:libName) ~~ 0 ifTrue:[ |
|
319 | 5735 |
"/ ('JAVA: builtIn nativeLibLoad simulated: ' , libName) printNL. |
277 | 5736 |
nativeLoader instVarNamed:'handle' put:index. |
5737 |
^ self "/ void |
|
5738 |
]. |
|
5739 |
(LoadedNativeLibs notNil |
|
5740 |
and:[LoadedNativeLibs includesKey:libName]) ifTrue:[ |
|
319 | 5741 |
"/ ('JAVA: native library already loaded: ' , libName) printNL. |
277 | 5742 |
nativeLoader instVarNamed:'handle' put:(LoadedNativeLibs at:libName). |
5743 |
^ self "/ void |
|
5744 |
]. |
|
319 | 5745 |
|
5746 |
(self confirm:'permission to load native library: ' , libName , ' ?') ifFalse:[ |
|
5747 |
^ self |
|
5748 |
]. |
|
284 | 5749 |
self halt. |
277 | 5750 |
|
5751 |
libName asFilename exists ifFalse:[ |
|
5752 |
('JAVA: no file to load nativeLib: ' , libName) printNL. |
|
5753 |
^ self "/ void |
|
5754 |
]. |
|
5755 |
||
5756 |
libHandle := ObjectFileLoader loadLibrary:libName. |
|
5757 |
libHandle isNil ifTrue:[ |
|
5758 |
('JAVA: failed to load nativeLib: ' , libName) printNL. |
|
5759 |
^ self "/ void |
|
5760 |
]. |
|
5761 |
||
5762 |
LoadedNativeLibs isNil ifTrue:[ |
|
5763 |
LoadedNativeLibs := Dictionary new. |
|
5764 |
]. |
|
5765 |
||
5766 |
LoadedNativeLibs at:libName put:libHandle. |
|
5767 |
nativeLoader instVarNamed:'handle' put:(LoadedNativeLibs at:libName). |
|
5768 |
^ self "/ void |
|
5769 |
||
5770 |
"Created: / 27.1.1998 / 18:38:37 / cg" |
|
319 | 5771 |
"Modified: / 6.2.1998 / 03:12:17 / cg" |
277 | 5772 |
! |
5773 |
||
5774 |
_ClassLoader_initIDs:nativeContext |
|
5775 |
"/ introduced with jdk1.2 ... (sigh) |
|
5776 |
||
5777 |
"Created: / 27.1.1998 / 18:37:08 / cg" |
|
5778 |
! |
|
5779 |
||
5780 |
_Component_initIDs:nativeContext |
|
5781 |
"/ introduced with jdk1.2 ... (sigh) |
|
5782 |
||
5783 |
"Created: / 27.1.1998 / 19:53:29 / cg" |
|
5784 |
! |
|
5785 |
||
5786 |
_System_getCallerClass:nativeContext |
|
5787 |
"/ introduced with jdk1.2 |
|
5788 |
||
5789 |
|senderContext cls| |
|
5790 |
||
5791 |
senderContext := nativeContext sender. |
|
5792 |
[senderContext receiver == (Java at:'java.lang.System')] whileTrue:[ |
|
5793 |
senderContext := senderContext sender. |
|
5794 |
]. |
|
5795 |
||
5796 |
senderContext method isStatic ifTrue:[ |
|
5797 |
cls := senderContext receiver |
|
5798 |
] ifFalse:[ |
|
5799 |
cls := senderContext receiver class |
|
5800 |
]. |
|
5801 |
cls isJavaClass ifTrue:[ |
|
5802 |
^ self javaClassObjectForClass:cls |
|
5803 |
]. |
|
5804 |
(cls isMemberOf:(Java at:'java.lang.Class')) ifTrue:[ |
|
5805 |
^ Java at:'java.lang.Class' |
|
5806 |
]. |
|
5807 |
self halt. |
|
5808 |
^ nil |
|
5809 |
||
5810 |
"Modified: / 27.1.1998 / 18:33:13 / cg" |
|
5811 |
! |
|
5812 |
||
5813 |
_Toolkit_initIDs:nativeContext |
|
5814 |
"/ introduced with jdk1.2 ... (sigh) |
|
5815 |
||
5816 |
"Created: / 27.1.1998 / 19:53:50 / cg" |
|
5817 |
! ! |
|
5818 |
||
457 | 5819 |
!JavaVM class methodsFor:'native - java.lang - ms'! |
5820 |
||
5821 |
_Runtime_setInputStreamLocalised:nativeContext |
|
5822 |
||
5823 |
"Created: / 18.11.1998 / 00:48:24 / cg" |
|
5824 |
"Modified: / 18.11.1998 / 00:55:01 / cg" |
|
5825 |
! |
|
5826 |
||
5827 |
_Runtime_setOutputStreamLocalised:nativeContext |
|
5828 |
||
5829 |
"Created: / 18.11.1998 / 00:50:15 / cg" |
|
5830 |
"Modified: / 18.11.1998 / 00:55:06 / cg" |
|
5831 |
! |
|
5832 |
||
5833 |
_String_equals:nativeContext |
|
5834 |
|jString1 jString2| |
|
5835 |
||
5836 |
jString1 := nativeContext receiver. |
|
5837 |
jString2 := nativeContext argAt:1. |
|
5838 |
^ (jString1 instVarAt:1) = (jString2 instVarAt:1) |
|
5839 |
||
5840 |
"Created: / 18.11.1998 / 00:52:03 / cg" |
|
5841 |
"Modified: / 18.11.1998 / 00:53:01 / cg" |
|
5842 |
! |
|
5843 |
||
5844 |
_String_length:nativeContext |
|
5845 |
|jString| |
|
5846 |
||
5847 |
jString := nativeContext receiver. |
|
5848 |
^ (jString instVarAt:3) |
|
5849 |
||
5850 |
"Created: / 18.11.1998 / 00:53:50 / cg" |
|
5851 |
"Modified: / 18.11.1998 / 00:54:18 / cg" |
|
5852 |
! ! |
|
5853 |
||
255 | 5854 |
!JavaVM class methodsFor:'native - java.math'! |
5855 |
||
5856 |
_BigInteger_plumbInit:nativeContext |
|
440 | 5857 |
UnimplementedNativeMethodSignal raise |
5858 |
||
5859 |
"Modified: / 12.11.1998 / 19:23:00 / cg" |
|
253 | 5860 |
! ! |
5861 |
||
5862 |
!JavaVM class methodsFor:'native - java.net'! |
|
5863 |
||
440 | 5864 |
_InetAddressImpl_getHostByAddr:nativeContext |
5865 |
"/ java.lang.String getHostByAddr (int) |
|
5866 |
UnimplementedNativeMethodSignal raise |
|
5867 |
||
5868 |
"Created: / 12.11.1998 / 19:08:04 / cg" |
|
5869 |
! |
|
5870 |
||
253 | 5871 |
_InetAddressImpl_getInetFamily:nativeContext |
5872 |
"/ self unimplementedNativeMethod. |
|
5873 |
^ 0 |
|
5874 |
||
5875 |
"Modified: / 15.8.1997 / 17:04:43 / cg" |
|
5876 |
"Created: / 5.1.1998 / 02:05:48 / cg" |
|
5877 |
! |
|
5878 |
||
5879 |
_InetAddressImpl_getLocalHostName:nativeContext |
|
5880 |
"" |
|
5881 |
||
5882 |
|hostName| |
|
5883 |
||
5884 |
hostName := OperatingSystem getHostName. |
|
5885 |
||
5886 |
^ (Java as_String:hostName). |
|
5887 |
||
5888 |
"Modified: / 7.8.1997 / 21:16:55 / cg" |
|
5889 |
"Created: / 5.1.1998 / 02:07:03 / cg" |
|
5890 |
! |
|
5891 |
||
255 | 5892 |
_InetAddressImpl_lookupAllHostAddr:nativeContext |
5893 |
"" |
|
5894 |
||
5895 |
|jAddrImpl jHostName hostName addrBytes| |
|
5896 |
||
5897 |
jAddrImpl := nativeContext receiver. |
|
5898 |
jHostName := nativeContext argAt:1. |
|
5899 |
||
5900 |
hostName := Java as_ST_String:jHostName. |
|
5901 |
addrBytes := Socket ipAddressOfHost:hostName. |
|
5902 |
addrBytes isNil ifTrue:[ |
|
261 | 5903 |
addrBytes := #[0 0 0 0] copy |
255 | 5904 |
]. |
5905 |
^ Array with:addrBytes |
|
5906 |
||
5907 |
"Modified: / 8.8.1997 / 12:04:25 / cg" |
|
5908 |
"Created: / 7.1.1998 / 18:51:31 / cg" |
|
5909 |
! |
|
5910 |
||
253 | 5911 |
_InetAddressImpl_makeAnyLocalAddress:nativeContext |
5912 |
"" |
|
5913 |
||
5914 |
|jAddrImpl jAddr hostName addrBytes address| |
|
5915 |
||
5916 |
jAddrImpl := nativeContext receiver. |
|
5917 |
jAddr := nativeContext argAt:1. |
|
5918 |
||
5919 |
hostName := OperatingSystem getHostName. |
|
5920 |
addrBytes := Socket ipAddressOfHost:hostName. |
|
405 | 5921 |
addrBytes isNil ifTrue:[ |
5922 |
addrBytes := #[127 0 0 0]. |
|
5923 |
]. |
|
253 | 5924 |
"/ MSB first into an integer. |
5925 |
address := (addrBytes at:1). |
|
5926 |
address := (address bitShift:8) bitOr:(addrBytes at:2). |
|
5927 |
address := (address bitShift:8) bitOr:(addrBytes at:3). |
|
5928 |
address := (address bitShift:8) bitOr:(addrBytes at:4). |
|
5929 |
||
5930 |
jAddr instVarNamed:'hostName' put:(Java as_String:hostName). |
|
5931 |
jAddr instVarNamed:'address' put:address. |
|
5932 |
jAddr instVarNamed:'family' put:0. |
|
5933 |
||
5934 |
^ nil |
|
5935 |
||
5936 |
"Created: / 5.1.1998 / 02:06:27 / cg" |
|
405 | 5937 |
"Modified: / 21.10.1998 / 03:30:29 / cg" |
255 | 5938 |
! |
5939 |
||
5940 |
_PlainSocketImpl_initProto:nativeContext |
|
5941 |
||
5942 |
"Created: / 12.1.1998 / 12:56:52 / cg" |
|
271 | 5943 |
! |
5944 |
||
307 | 5945 |
_PlainSocketImpl_socketAccept:nativeContext |
5946 |
|jsock fd newJSock sock newSock fileNo| |
|
5947 |
||
5948 |
jsock := nativeContext receiver. |
|
5949 |
||
5950 |
sock := self validateFile:jsock. |
|
5951 |
sock isNil ifTrue:[ |
|
5952 |
self |
|
5953 |
throwExceptionClassName:'java.io.IOException' |
|
5954 |
withMessage:'nil socket in accept'. |
|
5955 |
^ self. |
|
5956 |
]. |
|
5957 |
||
5958 |
newJSock := nativeContext argAt:1. |
|
5959 |
fd := newJSock instVarNamed:'fd'. |
|
5960 |
(fd instVarNamed:'fd') ~~ 0 ifTrue:[ |
|
5961 |
self halt:'file already open'. |
|
5962 |
self internalError:'file already open'. |
|
5963 |
self |
|
5964 |
throwExceptionClassName:'java.io.IOException' |
|
5965 |
withMessage:'socket already open in socketAccept'. |
|
5966 |
^ self. |
|
5967 |
]. |
|
5968 |
FileIOTrace ifTrue:[ |
|
5969 |
'JAVA: socket accept' infoPrintCR |
|
5970 |
]. |
|
5971 |
newSock := sock accept. |
|
5972 |
newSock isNil ifTrue:[ |
|
5973 |
self |
|
5974 |
throwExceptionClassName:'java.io.IOException' |
|
5975 |
withMessage:'accept failed'. |
|
5976 |
]. |
|
5977 |
fileNo := self addOpenFile:newSock. |
|
5978 |
fd instVarNamed:'fd' put:fileNo. |
|
5979 |
||
5980 |
"Created: / 4.2.1998 / 15:26:49 / cg" |
|
5981 |
"Modified: / 4.2.1998 / 15:45:20 / cg" |
|
5982 |
! |
|
5983 |
||
5984 |
_PlainSocketImpl_socketAvailable:nativeContext |
|
5985 |
|jSock sock n| |
|
5986 |
||
5987 |
jSock := nativeContext receiver. |
|
5988 |
||
5989 |
sock := self validateFile:jSock. |
|
5990 |
sock isNil ifTrue:[ |
|
5991 |
self |
|
5992 |
throwExceptionClassName:'java.io.IOException' |
|
5993 |
withMessage:'socketAvailable on closed socket'. |
|
5994 |
^ self. |
|
5995 |
]. |
|
5996 |
||
5997 |
n := sock numAvailable. |
|
5998 |
^ n |
|
5999 |
||
6000 |
"Created: / 4.2.1998 / 16:58:49 / cg" |
|
6001 |
! |
|
6002 |
||
6003 |
_PlainSocketImpl_socketBind:nativeContext |
|
6004 |
|jsock jaddr port sock hostName ok err| |
|
6005 |
||
6006 |
jsock := nativeContext receiver. |
|
6007 |
jaddr := nativeContext argAt:1. |
|
6008 |
port := nativeContext argAt:2. |
|
6009 |
||
6010 |
hostName := jaddr instVarNamed:'hostName'. |
|
6011 |
hostName isNil ifTrue:[ |
|
6012 |
self halt. |
|
6013 |
] ifFalse:[ |
|
6014 |
hostName := Java as_ST_String:hostName |
|
6015 |
]. |
|
6016 |
||
6017 |
sock := self validateFile:jsock. |
|
6018 |
sock notNil ifTrue:[ |
|
6019 |
FileIOTrace ifTrue:[ |
|
6020 |
('JAVA: socket bind to ' , hostName printString, ' port ' , port printString) infoPrintCR |
|
6021 |
]. |
|
6022 |
||
6023 |
ok := sock bindTo:port address:nil "hostName". |
|
6024 |
ok ifFalse:[ |
|
6025 |
err := OperatingSystem lastErrorString. |
|
6026 |
Transcript showCR:'sock err: ' , err printString. |
|
6027 |
self |
|
6028 |
throwExceptionClassName:'java.io.IOException' |
|
6029 |
withMessage:'bind failed'. |
|
6030 |
] |
|
6031 |
]. |
|
6032 |
||
6033 |
"Created: / 4.2.1998 / 15:06:20 / cg" |
|
6034 |
"Modified: / 4.2.1998 / 15:34:08 / cg" |
|
6035 |
! |
|
6036 |
||
271 | 6037 |
_PlainSocketImpl_socketClose:nativeContext |
6038 |
|jsock sock| |
|
6039 |
||
6040 |
jsock := nativeContext receiver. |
|
6041 |
||
6042 |
sock := self validateFile:jsock. |
|
6043 |
sock notNil ifTrue:[ |
|
6044 |
FileIOTrace ifTrue:[ |
|
6045 |
'JAVA: close socket' infoPrintCR |
|
6046 |
]. |
|
6047 |
sock close. |
|
6048 |
]. |
|
6049 |
||
6050 |
"Modified: / 21.8.1997 / 17:09:40 / cg" |
|
6051 |
"Created: / 25.1.1998 / 20:04:24 / cg" |
|
6052 |
! |
|
6053 |
||
6054 |
_PlainSocketImpl_socketConnect:nativeContext |
|
272 | 6055 |
|jsock jaddr port sock addr hostName ok| |
271 | 6056 |
|
6057 |
jsock := nativeContext receiver. |
|
6058 |
jaddr := nativeContext argAt:1. |
|
6059 |
port := nativeContext argAt:2. |
|
6060 |
||
6061 |
hostName := jaddr instVarNamed:'hostName'. |
|
6062 |
hostName notNil ifTrue:[ |
|
6063 |
hostName := Java as_ST_String:hostName |
|
6064 |
] ifFalse:[ |
|
272 | 6065 |
addr := jaddr instVarNamed:'address'. |
6066 |
addr notNil ifTrue:[ |
|
6067 |
hostName := ByteArray new:4. |
|
6068 |
hostName at:4 put:(addr bitAnd:16rFF). |
|
6069 |
addr := addr bitShift:-8. |
|
6070 |
hostName at:3 put:(addr bitAnd:16rFF). |
|
6071 |
addr := addr bitShift:-8. |
|
6072 |
hostName at:2 put:(addr bitAnd:16rFF). |
|
6073 |
addr := addr bitShift:-8. |
|
6074 |
hostName at:1 put:(addr bitAnd:16rFF). |
|
6075 |
]. |
|
271 | 6076 |
]. |
6077 |
hostName isNil ifTrue:[ |
|
6078 |
self halt. |
|
6079 |
]. |
|
6080 |
||
6081 |
sock := self validateFile:jsock. |
|
6082 |
sock notNil ifTrue:[ |
|
6083 |
FileIOTrace ifTrue:[ |
|
6084 |
('JAVA: socket connect to ' , hostName printString , ' port ' , port printString) infoPrintCR |
|
6085 |
]. |
|
390 | 6086 |
SocketConnectConfirmation ifTrue:[ |
6087 |
(self confirm:'connect to host: ' , hostName printString , ' - ok ?') |
|
6088 |
ifFalse:[ |
|
6089 |
self |
|
6090 |
throwExceptionClassName:'java.io.IOException' |
|
6091 |
withMessage:'connect permission denied'. |
|
6092 |
]. |
|
271 | 6093 |
]. |
6094 |
||
6095 |
ok := sock connectTo:hostName port:port. |
|
6096 |
ok ifFalse:[ |
|
6097 |
self |
|
6098 |
throwExceptionClassName:'java.io.IOException' |
|
6099 |
withMessage:'connect failed'. |
|
6100 |
] |
|
6101 |
]. |
|
6102 |
||
6103 |
"Created: / 25.1.1998 / 20:02:27 / cg" |
|
390 | 6104 |
"Modified: / 19.10.1998 / 16:24:48 / cg" |
271 | 6105 |
! |
6106 |
||
6107 |
_PlainSocketImpl_socketCreate:nativeContext |
|
6108 |
|jsock isStream fd sock fileNo| |
|
6109 |
||
6110 |
jsock := nativeContext receiver. |
|
6111 |
isStream := (nativeContext argAt:1) == 1. |
|
6112 |
||
6113 |
fd := jsock instVarNamed:'fd'. |
|
6114 |
(fd instVarNamed:'fd') ~~ 0 ifTrue:[ |
|
6115 |
self halt:'file already open'. |
|
6116 |
self internalError:'file already open'. |
|
6117 |
self |
|
6118 |
throwExceptionClassName:'java.io.IOException' |
|
6119 |
withMessage:'file already open in socketCreate'. |
|
6120 |
^ self. |
|
6121 |
]. |
|
6122 |
||
6123 |
FileOpenTrace ifTrue:[ |
|
6124 |
('JAVA: create socket') infoPrintCR. |
|
6125 |
]. |
|
6126 |
||
6127 |
isStream ifTrue:[ |
|
6128 |
sock := Socket newTCP |
|
6129 |
] ifFalse:[ |
|
6130 |
sock := Socket newUDP |
|
6131 |
]. |
|
6132 |
sock isNil ifTrue:[ |
|
6133 |
self |
|
6134 |
throwExceptionClassName:'java.io.IOException' |
|
6135 |
withMessage:'socketCreate failed'. |
|
6136 |
]. |
|
6137 |
||
6138 |
fileNo := self addOpenFile:sock. |
|
6139 |
fd instVarNamed:'fd' put:fileNo. |
|
6140 |
||
6141 |
"Created: / 25.1.1998 / 19:59:25 / cg" |
|
6142 |
"Modified: / 25.1.1998 / 19:59:45 / cg" |
|
272 | 6143 |
! |
6144 |
||
307 | 6145 |
_PlainSocketImpl_socketListen:nativeContext |
6146 |
|jSock time sock ok| |
|
6147 |
||
6148 |
jSock := nativeContext receiver. |
|
6149 |
time := nativeContext argAt:1. |
|
6150 |
||
6151 |
sock := self validateFile:jSock. |
|
6152 |
sock notNil ifTrue:[ |
|
6153 |
FileIOTrace ifTrue:[ |
|
6154 |
('JAVA: socket listen with timeout ' , time printString) infoPrintCR. |
|
6155 |
]. |
|
6156 |
ok := sock listenWithBacklog:5. |
|
6157 |
ok ifFalse:[ |
|
6158 |
self |
|
6159 |
throwExceptionClassName:'java.io.IOException' |
|
6160 |
withMessage:'listen failed'. |
|
6161 |
^ self. |
|
6162 |
]. |
|
6163 |
time ~~ 0 ifTrue:[ |
|
6164 |
sock readWaitWithTimeoutMs:time |
|
6165 |
] |
|
6166 |
]. |
|
6167 |
||
6168 |
"Created: / 4.2.1998 / 15:17:48 / cg" |
|
6169 |
"Modified: / 4.2.1998 / 15:18:26 / cg" |
|
6170 |
! |
|
6171 |
||
272 | 6172 |
_SocketInputStream_socketRead:nativeContext |
307 | 6173 |
^ self anyStream_readBytes:nativeContext |
272 | 6174 |
|
6175 |
"Created: / 25.1.1998 / 20:56:53 / cg" |
|
307 | 6176 |
"Modified: / 4.2.1998 / 15:52:31 / cg" |
272 | 6177 |
! |
6178 |
||
6179 |
_SocketOutputStream_socketWrite:nativeContext |
|
307 | 6180 |
^ self anyStream_writeBytes:nativeContext |
272 | 6181 |
|
6182 |
"Created: / 25.1.1998 / 21:06:55 / cg" |
|
307 | 6183 |
"Modified: / 4.2.1998 / 15:52:40 / cg" |
253 | 6184 |
! ! |
6185 |
||
457 | 6186 |
!JavaVM class methodsFor:'native - java.net - ms'! |
6187 |
||
6188 |
_ClassLoader_findSystemClass:nativeContext |
|
6189 |
^ self _ClassLoader_findSystemClass0:nativeContext |
|
6190 |
||
6191 |
"Created: / 18.11.1998 / 00:00:14 / cg" |
|
6192 |
! |
|
6193 |
||
6194 |
_InetAddress_getInetFamily:nativeContext |
|
6195 |
"/ self unimplementedNativeMethod. |
|
6196 |
^ 0 |
|
6197 |
||
6198 |
"Modified: / 15.8.1997 / 17:04:43 / cg" |
|
6199 |
"Created: / 17.11.1998 / 23:54:38 / cg" |
|
6200 |
! |
|
6201 |
||
6202 |
_InetAddress_getLocalHostName:nativeContext |
|
6203 |
"" |
|
6204 |
||
6205 |
|hostName| |
|
6206 |
||
6207 |
hostName := OperatingSystem getHostName. |
|
6208 |
||
6209 |
^ (Java as_String:hostName). |
|
6210 |
||
6211 |
"Modified: / 7.8.1997 / 21:16:55 / cg" |
|
6212 |
"Created: / 17.11.1998 / 23:54:54 / cg" |
|
6213 |
! |
|
6214 |
||
6215 |
_InetAddress_lookupAllHostAddr:nativeContext |
|
6216 |
"" |
|
6217 |
||
6218 |
|jAddrImpl jHostName hostName addrBytes| |
|
6219 |
||
6220 |
jAddrImpl := nativeContext receiver. |
|
6221 |
jHostName := nativeContext argAt:1. |
|
6222 |
||
6223 |
hostName := Java as_ST_String:jHostName. |
|
6224 |
addrBytes := Socket ipAddressOfHost:hostName. |
|
6225 |
addrBytes isNil ifTrue:[ |
|
6226 |
addrBytes := #[0 0 0 0] copy |
|
6227 |
]. |
|
6228 |
^ Array with:addrBytes |
|
6229 |
||
6230 |
"Modified: / 8.8.1997 / 12:04:25 / cg" |
|
6231 |
"Created: / 17.11.1998 / 23:56:10 / cg" |
|
6232 |
! |
|
6233 |
||
6234 |
_InetAddress_makeAnyLocalAddress:nativeContext |
|
6235 |
"" |
|
6236 |
||
6237 |
|jAddrImpl jAddr hostName addrBytes address| |
|
6238 |
||
6239 |
jAddrImpl := nativeContext receiver. |
|
6240 |
jAddr := nativeContext argAt:1. |
|
6241 |
||
6242 |
hostName := OperatingSystem getHostName. |
|
6243 |
addrBytes := Socket ipAddressOfHost:hostName. |
|
6244 |
addrBytes isNil ifTrue:[ |
|
6245 |
addrBytes := #[127 0 0 0]. |
|
6246 |
]. |
|
6247 |
"/ MSB first into an integer. |
|
6248 |
address := (addrBytes at:1). |
|
6249 |
address := (address bitShift:8) bitOr:(addrBytes at:2). |
|
6250 |
address := (address bitShift:8) bitOr:(addrBytes at:3). |
|
6251 |
address := (address bitShift:8) bitOr:(addrBytes at:4). |
|
6252 |
||
6253 |
jAddr instVarNamed:'hostName' put:(Java as_String:hostName). |
|
6254 |
jAddr instVarNamed:'address' put:address. |
|
6255 |
jAddr instVarNamed:'family' put:0. |
|
6256 |
||
6257 |
^ nil |
|
6258 |
||
6259 |
"Modified: / 21.10.1998 / 03:30:29 / cg" |
|
6260 |
"Created: / 17.11.1998 / 23:54:00 / cg" |
|
6261 |
! ! |
|
6262 |
||
253 | 6263 |
!JavaVM class methodsFor:'native - java.utils'! |
6264 |
||
6265 |
_ResourceBundle_getClassContext:nativeContext |
|
6266 |
"returns an array filled with the contextChain receivers classes. |
|
6267 |
What an ugly, messy interface." |
|
6268 |
||
6269 |
|chain con cls jClass| |
|
6270 |
||
6271 |
chain := OrderedCollection new. |
|
6272 |
con := thisContext sender. |
|
6273 |
[con notNil] whileTrue:[ |
|
347 | 6274 |
(con isJavaContext) ifTrue:[ |
6275 |
cls := con receiver class. |
|
6276 |
cls isMeta ifTrue:[ |
|
6277 |
"/ t'was a static method |
|
6278 |
cls := cls soleInstance |
|
6279 |
]. |
|
6280 |
jClass := JavaClasses at:cls ifAbsent:nil. |
|
6281 |
jClass isNil ifTrue:[ |
|
6282 |
JavaClasses at:cls put:(jClass := (Java at:'java.lang.Class') new). |
|
6283 |
JavaClasses at:jClass put:cls. |
|
6284 |
]. |
|
6285 |
chain add:jClass. |
|
6286 |
]. |
|
6287 |
con := con sender. |
|
253 | 6288 |
]. |
6289 |
^ chain asArray |
|
6290 |
||
6291 |
"Created: / 5.1.1998 / 02:47:00 / cg" |
|
347 | 6292 |
"Modified: / 8.5.1998 / 21:29:57 / cg" |
253 | 6293 |
! ! |
6294 |
||
304 | 6295 |
!JavaVM class methodsFor:'native - java.utils.zip'! |
6296 |
||
6297 |
_Inflater_init:nativeContext |
|
6298 |
||
6299 |
"Created: / 1.2.1998 / 20:14:01 / cg" |
|
6300 |
! |
|
6301 |
||
6302 |
_Inflater_reset:nativeContext |
|
6303 |
||
6304 |
"Created: / 1.2.1998 / 20:14:13 / cg" |
|
6305 |
! ! |
|
6306 |
||
255 | 6307 |
!JavaVM class methodsFor:'native - netscape'! |
6308 |
||
6309 |
_MozillaAppletContext_pMochaOnLoad:nativeContext |
|
6310 |
|id| |
|
6311 |
||
6312 |
id := nativeContext argAt:1. |
|
318 | 6313 |
"/ 'JAVA: MozillaAppletContext_pMochaOnLoad: ' print. id printNL. |
255 | 6314 |
^ nil |
6315 |
||
6316 |
"Created: / 6.1.1998 / 20:37:13 / cg" |
|
318 | 6317 |
"Modified: / 6.2.1998 / 02:13:09 / cg" |
255 | 6318 |
! |
6319 |
||
325 | 6320 |
_MozillaAppletContext_pShowDocument:nativeContext |
6321 |
|s js| |
|
6322 |
||
6323 |
js := nativeContext argAt:1. |
|
6324 |
s := Java as_ST_String:js. |
|
6325 |
||
6326 |
"/ somehow pass it to the html browser .... |
|
6327 |
"/ Transcript showCR:s. |
|
6328 |
^ nil |
|
6329 |
||
6330 |
"Modified: / 8.1.1998 / 17:06:13 / cg" |
|
6331 |
"Created: / 29.3.1998 / 15:53:17 / cg" |
|
6332 |
! |
|
6333 |
||
255 | 6334 |
_MozillaAppletContext_pShowStatus:nativeContext |
6335 |
|s js| |
|
6336 |
||
6337 |
js := nativeContext argAt:1. |
|
405 | 6338 |
js isNil ifTrue:[ |
6339 |
s := '' |
|
6340 |
] ifFalse:[ |
|
6341 |
s := Java as_ST_String:js. |
|
6342 |
]. |
|
255 | 6343 |
|
6344 |
self activityNotification:s. |
|
6345 |
"/ Transcript showCR:s. |
|
6346 |
^ nil |
|
6347 |
||
6348 |
"Created: / 6.1.1998 / 18:31:34 / cg" |
|
405 | 6349 |
"Modified: / 22.10.1998 / 01:17:46 / cg" |
255 | 6350 |
! |
6351 |
||
440 | 6352 |
_MozillaAppletContext_setConsoleState0:nativeContext |
6353 |
"/ void setConsoleState0 (int) |
|
6354 |
UnimplementedNativeMethodSignal raise |
|
6355 |
||
6356 |
"Created: / 12.11.1998 / 19:23:22 / cg" |
|
6357 |
! |
|
6358 |
||
6359 |
_URLConnection_close:nativeContext |
|
6360 |
"/ void close () |
|
6361 |
UnimplementedNativeMethodSignal raise |
|
6362 |
||
6363 |
"Created: / 12.11.1998 / 19:26:03 / cg" |
|
6364 |
! |
|
6365 |
||
6366 |
_URLConnection_finalize:nativeContext |
|
6367 |
"/ void finalize () |
|
6368 |
UnimplementedNativeMethodSignal raise |
|
6369 |
||
6370 |
"Created: / 12.11.1998 / 19:25:22 / cg" |
|
6371 |
! |
|
6372 |
||
6373 |
_URLConnection_getContentLength0:nativeContext |
|
6374 |
"/ int getContentLength0 () |
|
6375 |
UnimplementedNativeMethodSignal raise |
|
6376 |
||
6377 |
"Created: / 12.11.1998 / 19:25:34 / cg" |
|
6378 |
! |
|
6379 |
||
6380 |
_URLConnection_getContentType0:nativeContext |
|
6381 |
"/ java.lang.String getContentType0 () |
|
6382 |
UnimplementedNativeMethodSignal raise |
|
6383 |
||
6384 |
"Created: / 12.11.1998 / 19:25:42 / cg" |
|
6385 |
! |
|
6386 |
||
6387 |
_URLConnection_getHeaderField0:nativeContext |
|
6388 |
"/ java.lang.String getHeaderField0 (java.lang.String) |
|
6389 |
UnimplementedNativeMethodSignal raise |
|
6390 |
||
6391 |
"Created: / 12.11.1998 / 19:25:53 / cg" |
|
6392 |
! |
|
6393 |
||
6394 |
_URLConnection_pCreate:nativeContext |
|
6395 |
"/ void pCreate (java.lang.String java.lang.String) |
|
6396 |
UnimplementedNativeMethodSignal raise |
|
6397 |
||
6398 |
"Created: / 12.11.1998 / 19:25:14 / cg" |
|
6399 |
! |
|
6400 |
||
6401 |
_URLInputStream_available:nativeContext |
|
6402 |
"/ int available () |
|
6403 |
UnimplementedNativeMethodSignal raise |
|
6404 |
||
6405 |
"Created: / 12.11.1998 / 19:24:26 / cg" |
|
6406 |
! |
|
6407 |
||
6408 |
_URLInputStream_open:nativeContext |
|
6409 |
"/ void open () |
|
6410 |
UnimplementedNativeMethodSignal raise |
|
6411 |
||
6412 |
"Created: / 12.11.1998 / 19:24:01 / cg" |
|
6413 |
! |
|
6414 |
||
6415 |
_URLInputStream_read:nativeContext |
|
6416 |
"/ int read (byte[] int int) |
|
6417 |
UnimplementedNativeMethodSignal raise |
|
6418 |
||
6419 |
"Created: / 12.11.1998 / 19:24:12 / cg" |
|
6420 |
! |
|
6421 |
||
6422 |
_URLOutputStream_open:nativeContext |
|
6423 |
"/ void open () |
|
6424 |
UnimplementedNativeMethodSignal raise |
|
6425 |
||
6426 |
"Created: / 12.11.1998 / 19:24:38 / cg" |
|
6427 |
! |
|
6428 |
||
6429 |
_URLOutputStream_pClose:nativeContext |
|
6430 |
"/ void pClose () |
|
6431 |
UnimplementedNativeMethodSignal raise |
|
6432 |
||
6433 |
"Created: / 12.11.1998 / 19:25:02 / cg" |
|
6434 |
! |
|
6435 |
||
6436 |
_URLOutputStream_write:nativeContext |
|
6437 |
"/ void write (int) |
|
6438 |
UnimplementedNativeMethodSignal raise |
|
6439 |
||
6440 |
"Created: / 12.11.1998 / 19:24:45 / cg" |
|
6441 |
! |
|
6442 |
||
6443 |
_URLOutputStream_writeBytes:nativeContext |
|
6444 |
"/ void writeBytes (byte[] int int) |
|
6445 |
UnimplementedNativeMethodSignal raise |
|
6446 |
||
6447 |
"Created: / 12.11.1998 / 19:24:55 / cg" |
|
6448 |
! |
|
6449 |
||
255 | 6450 |
_URLStreamHandlerFactory_pInit:nativeContext |
6451 |
"/ self unimplementedNativeMethod. |
|
6452 |
||
6453 |
"Created: / 10.1.1998 / 15:47:24 / cg" |
|
440 | 6454 |
! |
6455 |
||
6456 |
_URLStreamHandlerFactory_pSupportsProtocol:nativeContext |
|
6457 |
"/ boolean pSupportsProtocol (java.lang.String) |
|
6458 |
UnimplementedNativeMethodSignal raise |
|
6459 |
||
6460 |
"Created: / 12.11.1998 / 19:23:43 / cg" |
|
255 | 6461 |
! ! |
6462 |
||
6463 |
!JavaVM class methodsFor:'native - sun.audio'! |
|
6464 |
||
6465 |
_AudioDevice_audioClose:nativeContext |
|
261 | 6466 |
|device fd stream| |
6467 |
||
6468 |
device := nativeContext receiver. |
|
6469 |
device notNil ifTrue:[ |
|
6470 |
fd := device instVarNamed:'dev'. |
|
6471 |
(fd notNil and:[fd > 0]) ifTrue:[ |
|
6472 |
stream := self getOpenFileAt:fd. |
|
6473 |
stream notNil ifTrue:[ |
|
6474 |
stream close. |
|
6475 |
device instVarNamed:'dev' put:0. |
|
6476 |
] |
|
6477 |
] |
|
6478 |
] |
|
255 | 6479 |
|
6480 |
"Created: / 10.1.1998 / 15:45:16 / cg" |
|
261 | 6481 |
"Modified: / 13.1.1998 / 18:08:20 / cg" |
255 | 6482 |
! |
6483 |
||
6484 |
_AudioDevice_audioOpen:nativeContext |
|
261 | 6485 |
|f stream fileNo| |
6486 |
||
6487 |
NoAudio ifTrue:[ |
|
374 | 6488 |
Transcript showCR:'JAVA: audio disabled'. |
6489 |
^ -1 |
|
6490 |
]. |
|
6491 |
||
261 | 6492 |
Stream streamErrorSignal handle:[:ex | |
374 | 6493 |
Stream streamErrorSignal handle:[:ex | |
6494 |
stream := nil. |
|
6495 |
ex return. |
|
6496 |
] do:[ |
|
6497 |
stream := SoundStream writing. |
|
6498 |
]. |
|
261 | 6499 |
] do:[ |
374 | 6500 |
stream := SoundStream writing. |
6501 |
stream notNil ifTrue:[ |
|
6502 |
stream setSampleRate:8000. |
|
6503 |
] |
|
261 | 6504 |
]. |
6505 |
stream isNil ifTrue:[ |
|
374 | 6506 |
"/ ^ -1. |
6507 |
||
6508 |
f := '/dev/audio' asFilename. |
|
6509 |
f exists ifFalse:[ |
|
6510 |
Transcript showCR:'JAVA: neither SoundStream nor /dev/audio available'. |
|
6511 |
^ -1 |
|
6512 |
]. |
|
6513 |
stream := f readWriteStream. |
|
6514 |
stream isNil ifTrue:[ |
|
6515 |
Transcript showCR:'JAVA: /dev/audio exists, but cannot be opened'. |
|
6516 |
^ -1 |
|
6517 |
]. |
|
6518 |
fileNo := self addOpenFile:stream. |
|
6519 |
]. |
|
6520 |
||
261 | 6521 |
fileNo := self addOpenFile:stream. |
6522 |
||
6523 |
FileOpenTrace ifTrue:[ |
|
374 | 6524 |
('JAVA: opened audioDevice as FD ' , fileNo printString) infoPrintCR. |
261 | 6525 |
]. |
6526 |
||
6527 |
^ fileNo |
|
255 | 6528 |
|
6529 |
"Created: / 10.1.1998 / 15:45:30 / cg" |
|
374 | 6530 |
"Modified: / 14.10.1998 / 15:20:52 / cg" |
261 | 6531 |
! |
6532 |
||
6533 |
_AudioDevice_audioWrite:nativeContext |
|
6534 |
|device fd stream bytes count| |
|
6535 |
||
6536 |
device := nativeContext receiver. |
|
6537 |
device notNil ifTrue:[ |
|
6538 |
fd := device instVarNamed:'dev'. |
|
6539 |
(fd notNil and:[fd > 0]) ifTrue:[ |
|
6540 |
stream := self getOpenFileAt:fd. |
|
6541 |
stream notNil ifTrue:[ |
|
6542 |
bytes := nativeContext argAt:1. |
|
6543 |
count := nativeContext argAt:2. |
|
6544 |
stream nextPutBytes:count from:bytes startingAt:1 |
|
6545 |
] |
|
6546 |
] |
|
6547 |
] |
|
6548 |
||
6549 |
"Created: / 10.1.1998 / 15:45:16 / cg" |
|
6550 |
"Modified: / 13.1.1998 / 18:07:20 / cg" |
|
255 | 6551 |
! ! |
6552 |
||
6553 |
!JavaVM class methodsFor:'native - sun.awt'! |
|
6554 |
||
6555 |
_GifImageDecoder_parseImage:nativeContext |
|
261 | 6556 |
|decoder width height bool1 depth subHdrBytes dstBytes i1 i2 colorModel |
6557 |
stream byte compressedData compressedSize index count data |
|
304 | 6558 |
leftOffs topOffs codeLen flags pixelStore clrModel t buffSize |
6559 |
countGot countGot2| |
|
255 | 6560 |
|
6561 |
decoder := nativeContext receiver. |
|
6562 |
||
6563 |
i1 := nativeContext argAt:1. |
|
6564 |
i2 := nativeContext argAt:2. |
|
6565 |
width := nativeContext argAt:3. |
|
6566 |
height := nativeContext argAt:4. |
|
6567 |
bool1 := nativeContext argAt:5. |
|
6568 |
depth := nativeContext argAt:6. |
|
261 | 6569 |
subHdrBytes := nativeContext argAt:7. |
255 | 6570 |
dstBytes := nativeContext argAt:8. |
6571 |
colorModel := nativeContext argAt:9. |
|
6572 |
||
261 | 6573 |
leftOffs := subHdrBytes wordAt:1 MSB:false. |
6574 |
topOffs := subHdrBytes wordAt:3 MSB:false. |
|
6575 |
width := subHdrBytes wordAt:5 MSB:false. |
|
6576 |
height := subHdrBytes wordAt:7 MSB:false. |
|
6577 |
flags := subHdrBytes at:9. |
|
6578 |
codeLen := subHdrBytes at:10. |
|
6579 |
||
6580 |
stream := decoder instVarNamed:'input'. |
|
6581 |
pixelStore := decoder instVarNamed:'store'. |
|
339 | 6582 |
pixelStore isNil ifTrue:[ |
6583 |
^ 0 |
|
6584 |
]. |
|
261 | 6585 |
|
6586 |
buffSize := (width * height // 2) max:4096. |
|
6587 |
compressedData := ByteArray uninitializedNew:buffSize. |
|
6588 |
"get compressed data" |
|
6589 |
index := 1. |
|
304 | 6590 |
count := stream perform:#'read()I'. |
261 | 6591 |
|
6592 |
[count notNil and:[count > 0]] whileTrue:[ |
|
304 | 6593 |
(index + count) > buffSize ifTrue:[ |
6594 |
t := ByteArray uninitializedNew:(buffSize * 2). |
|
6595 |
t replaceFrom:1 to:buffSize with:compressedData startingAt:1. |
|
6596 |
compressedData := t. |
|
6597 |
buffSize := buffSize * 2. |
|
6598 |
]. |
|
6599 |
[count ~~ 0] whileTrue:[ |
|
6600 |
countGot := stream |
|
6601 |
perform:#'read([BII)I' |
|
6602 |
with:compressedData |
|
6603 |
with:index-1 |
|
6604 |
with:count. |
|
6605 |
||
6606 |
countGot > 0 ifTrue:[ |
|
6607 |
count := count - countGot. |
|
6608 |
index := index + countGot. |
|
6609 |
] ifFalse:[ |
|
6610 |
count := -1. |
|
6611 |
] |
|
6612 |
]. |
|
6613 |
||
6614 |
count >= 0 ifTrue:[ |
|
6615 |
count := stream perform:#read. |
|
6616 |
] |
|
261 | 6617 |
]. |
6618 |
compressedSize := index - 1. |
|
6619 |
||
6620 |
data := pixelStore perform:#'allocateLines(I)Ljava/lang/Object;' with:height. |
|
6621 |
(data isMemberOf:ByteArray) ifFalse:[ |
|
304 | 6622 |
self halt. |
6623 |
^ 0. |
|
261 | 6624 |
]. |
6625 |
"/ 'GIFReader: decompressing ...' infoPrintCR. |
|
6626 |
||
6627 |
||
6628 |
GIFReader |
|
304 | 6629 |
decompressGIFFrom:compressedData |
6630 |
count:compressedSize |
|
6631 |
into:data |
|
6632 |
startingAt:1 |
|
6633 |
codeLen:(codeLen + 1). |
|
261 | 6634 |
|
6635 |
clrModel := pixelStore instVarNamed:'colormodel'. |
|
6636 |
||
6637 |
pixelStore |
|
304 | 6638 |
perform:#'setPixels(IIII[BII)Z' |
6639 |
withArguments: |
|
6640 |
(Array |
|
6641 |
with:0 "/ x |
|
6642 |
with:0 "/ y |
|
6643 |
with:width "/ w |
|
6644 |
with:height "/ h |
|
6645 |
with:data |
|
6646 |
with:0 "/ offs |
|
6647 |
with:width). "/ scanSize |
|
261 | 6648 |
|
6649 |
pixelStore perform:#'imageComplete()V'. |
|
6650 |
"/ perform:#'imageComplete(I)V' |
|
6651 |
"/ with:((Java at:'java.awt.image.ImageConsumer') instVarNamed:'STATICIMAGEDONE'). |
|
6652 |
||
255 | 6653 |
"/ self internalError:'breakPoint'. |
6654 |
^ 1 "/ true |
|
6655 |
||
339 | 6656 |
"Modified: / 10.4.1998 / 14:31:59 / cg" |
255 | 6657 |
! |
6658 |
||
6659 |
_ImageRepresentation_disposeImage:nativeContext |
|
262 | 6660 |
|imgRep img| |
255 | 6661 |
|
6662 |
imgRep := nativeContext receiver. |
|
262 | 6663 |
|
6664 |
img := imgRep instVarNamed:'pData'. |
|
6665 |
(img notNil and:[img ~~ 0]) ifTrue:[ |
|
270 | 6666 |
ImageStretchCache notNil ifTrue:[ |
6667 |
ImageStretchCache removeKey:img ifAbsent:nil. |
|
6668 |
] |
|
262 | 6669 |
]. |
6670 |
||
261 | 6671 |
imgRep instVarNamed:'pData' put:0. |
6672 |
"/ self halt. |
|
255 | 6673 |
|
6674 |
"Created: / 7.1.1998 / 22:31:46 / cg" |
|
262 | 6675 |
"Modified: / 17.1.1998 / 13:26:55 / cg" |
255 | 6676 |
! |
6677 |
||
6678 |
_ImageRepresentation_finish:nativeContext |
|
6679 |
|imgRep bool| |
|
6680 |
||
6681 |
imgRep := nativeContext receiver. |
|
6682 |
bool := nativeContext argAt:1. |
|
261 | 6683 |
"/ self halt. |
318 | 6684 |
"/ 'JAVA: ImageRepresentation_finish ignored for now' infoPrintCR. |
255 | 6685 |
|
6686 |
^ 1 "/ true |
|
6687 |
||
6688 |
"Created: / 8.1.1998 / 00:11:40 / cg" |
|
318 | 6689 |
"Modified: / 6.2.1998 / 02:12:54 / cg" |
261 | 6690 |
! |
6691 |
||
6692 |
_ImageRepresentation_imageDraw:nativeContext |
|
6693 |
|imgRep x y img deviceImage jGraphics gc clr| |
|
6694 |
||
6695 |
imgRep := nativeContext receiver. |
|
6696 |
img := imgRep instVarNamed:'pData'. |
|
6697 |
(img isNil or:[img == 0]) ifTrue:[ |
|
466 | 6698 |
"/ self halt. |
6699 |
^ self. |
|
261 | 6700 |
]. |
6701 |
jGraphics := nativeContext argAt:1. |
|
6702 |
gc := jGraphics instVarNamed:'pData'. |
|
6703 |
gc realized ifFalse:[^ self]. |
|
6704 |
||
6705 |
x := nativeContext argAt:2. |
|
6706 |
y := nativeContext argAt:3. |
|
6707 |
clr := nativeContext argAt:4. |
|
6708 |
deviceImage := img onDevice:gc device. |
|
6709 |
deviceImage ~~ img ifTrue:[ |
|
466 | 6710 |
imgRep instVarNamed:'pData' put:deviceImage. |
6711 |
]. |
|
6712 |
gc realized ifFalse:[^ self]. |
|
261 | 6713 |
deviceImage displayOn:gc x:x y:y. |
6714 |
^ 1. |
|
6715 |
||
6716 |
"Created: / 13.1.1998 / 13:32:28 / cg" |
|
466 | 6717 |
"Modified: / 25.11.1998 / 15:36:38 / cg" |
261 | 6718 |
! |
6719 |
||
6720 |
_ImageRepresentation_imageStretch:nativeContext |
|
6721 |
|imgRep x1 y1 x2 y2 srcX1 srcY1 w h |
|
6722 |
img deviceImage jGraphics gc clr stretchWidth stretchHeight| |
|
6723 |
||
6724 |
imgRep := nativeContext receiver. |
|
6725 |
img := imgRep instVarNamed:'pData'. |
|
6726 |
(img isNil or:[img == 0]) ifTrue:[ |
|
270 | 6727 |
"/ self halt. |
6728 |
^ self. |
|
261 | 6729 |
]. |
6730 |
||
6731 |
jGraphics := nativeContext argAt:1. |
|
6732 |
gc := jGraphics instVarNamed:'pData'. |
|
6733 |
gc realized ifFalse:[^ self]. |
|
6734 |
||
6735 |
x1 := nativeContext argAt:2. |
|
6736 |
y1 := nativeContext argAt:3. |
|
6737 |
x2 := nativeContext argAt:4. |
|
6738 |
y2:= nativeContext argAt:5. |
|
6739 |
srcX1 := nativeContext argAt:6. |
|
6740 |
srcY1 := nativeContext argAt:7. |
|
6741 |
w := nativeContext argAt:8. |
|
6742 |
h := nativeContext argAt:9. |
|
6743 |
clr := nativeContext argAt:10. |
|
6744 |
||
6745 |
(srcX1 ~~ 0 or:[srcY1 ~~ 0]) ifTrue:[ |
|
270 | 6746 |
self halt. |
6747 |
^ self. |
|
261 | 6748 |
]. |
6749 |
(w ~~ img width or:[h ~~ img height]) ifTrue:[ |
|
270 | 6750 |
self halt. |
6751 |
^ self |
|
261 | 6752 |
]. |
6753 |
||
6754 |
"/ TODO: remember magnified images somewhere for a while, |
|
6755 |
"/ to avoid repeated action ... |
|
6756 |
||
6757 |
stretchWidth := (x2-x1). |
|
6758 |
stretchHeight := (y2-y1). |
|
6759 |
||
6760 |
(stretchWidth == img width |
|
6761 |
and:[stretchHeight == img height]) ifTrue:[ |
|
270 | 6762 |
deviceImage := img onDevice:gc device. |
6763 |
deviceImage ~~ img ifTrue:[ |
|
6764 |
imgRep instVarNamed:'pData' put:deviceImage. |
|
6765 |
]. |
|
261 | 6766 |
] ifFalse:[ |
270 | 6767 |
ImageStretchCache notNil ifTrue:[ |
6768 |
deviceImage := ImageStretchCache at:img ifAbsent:nil. |
|
6769 |
]. |
|
6770 |
(deviceImage isNil |
|
6771 |
or:[deviceImage width ~~ stretchWidth |
|
6772 |
or:[deviceImage height ~~ stretchHeight]]) ifTrue:[ |
|
6773 |
deviceImage := (img magnifiedTo:stretchWidth@stretchHeight) onDevice:gc device. |
|
6774 |
ImageStretchCache isNil ifTrue:[ |
|
6775 |
ImageStretchCache := WeakIdentityDictionary new. |
|
6776 |
]. |
|
6777 |
ImageStretchCache at:img put:deviceImage |
|
6778 |
]. |
|
261 | 6779 |
]. |
6780 |
deviceImage displayOn:gc x:x1 y:y1 |
|
6781 |
||
6782 |
"Created: / 13.1.1998 / 13:32:28 / cg" |
|
6783 |
"Modified: / 15.1.1998 / 13:14:47 / cg" |
|
255 | 6784 |
! |
6785 |
||
6786 |
_ImageRepresentation_offscreenInit:nativeContext |
|
262 | 6787 |
|imgRep jclr w h form screenDevice| |
255 | 6788 |
|
6789 |
imgRep := nativeContext receiver. |
|
261 | 6790 |
jclr := nativeContext argAt:1. |
262 | 6791 |
|
6792 |
w := imgRep instVarNamed:'width'. |
|
6793 |
h := imgRep instVarNamed:'height'. |
|
6794 |
||
6795 |
screenDevice := Screen current. |
|
6796 |
form := Form width:w height:h depth:(screenDevice depth) on:screenDevice. |
|
6797 |
||
6798 |
imgRep instVarNamed:'pData' put:form. |
|
6799 |
"/ self halt. |
|
255 | 6800 |
|
6801 |
"Created: / 7.1.1998 / 22:31:46 / cg" |
|
262 | 6802 |
"Modified: / 17.1.1998 / 12:36:43 / cg" |
261 | 6803 |
! |
6804 |
||
6805 |
_ImageRepresentation_setBytePixels:nativeContext |
|
318 | 6806 |
|imgRep x y w h clrModel bytes offs i2 |
6807 |
img depth cmap rgbMap opaque transparentColorIndex |
|
6808 |
scanLineWidth nBytes srcIdx dstIdx| |
|
261 | 6809 |
|
6810 |
imgRep := nativeContext receiver. |
|
6811 |
x := nativeContext argAt:1. |
|
6812 |
y := nativeContext argAt:2. |
|
6813 |
w := nativeContext argAt:3. |
|
6814 |
h := nativeContext argAt:4. |
|
6815 |
clrModel := nativeContext argAt:5. |
|
6816 |
bytes := nativeContext argAt:6. |
|
318 | 6817 |
offs := nativeContext argAt:7. "/ offset ?? |
6818 |
scanLineWidth := nativeContext argAt:8. |
|
261 | 6819 |
|
6820 |
depth := clrModel instVarNamed:'pixel_bits'. |
|
6821 |
(clrModel instVarNamed:'map_size') ~~ 0 ifTrue:[ |
|
318 | 6822 |
rgbMap := clrModel instVarNamed:'rgb'. |
6823 |
cmap := Array new:rgbMap size. |
|
6824 |
rgbMap |
|
6825 |
keysAndValuesDo:[:idx :rgb | |
|
6826 |
cmap at:idx put:(Color rgbValue:(rgb bitAnd:16rFFFFFF)) |
|
6827 |
]. |
|
261 | 6828 |
]. |
6829 |
||
6830 |
opaque := (clrModel instVarNamed:'opaque') ~~ 0. |
|
6831 |
opaque ifFalse:[ |
|
318 | 6832 |
transparentColorIndex := clrModel instVarNamed:'transparent_index' |
261 | 6833 |
]. |
6834 |
||
6835 |
img := imgRep instVarNamed:'pData'. |
|
405 | 6836 |
(img isNil or:[img == 0]) ifFalse:[ |
6837 |
"/ self halt |
|
6838 |
]. |
|
6839 |
||
6840 |
(offs ~~ 0 or:[scanLineWidth ~~ w]) ifTrue:[ |
|
6841 |
nBytes := ByteArray new:w*h. |
|
6842 |
srcIdx := offs+1. |
|
6843 |
dstIdx := 1. |
|
6844 |
1 to:h do:[:y | |
|
6845 |
nBytes replaceFrom:dstIdx to:(dstIdx+w-1) with:bytes startingAt:srcIdx. |
|
6846 |
srcIdx := srcIdx + scanLineWidth. |
|
6847 |
dstIdx := dstIdx + w. |
|
318 | 6848 |
]. |
405 | 6849 |
bytes := nBytes. |
6850 |
]. |
|
6851 |
img := Image width:w height:h depth:depth fromArray:bytes. |
|
6852 |
cmap notNil ifTrue:[ |
|
6853 |
img colorMap:cmap. |
|
6854 |
img photometric:#palette |
|
6855 |
]. |
|
6856 |
opaque ifFalse:[ |
|
6857 |
img mask:(ImageReader |
|
6858 |
buildMaskFromColor:transparentColorIndex |
|
6859 |
for:bytes |
|
6860 |
width:w |
|
6861 |
height:h) |
|
6862 |
]. |
|
6863 |
||
6864 |
imgRep instVarNamed:'pData' put:img. |
|
261 | 6865 |
^ 1. |
6866 |
||
6867 |
"Created: / 7.1.1998 / 22:31:46 / cg" |
|
405 | 6868 |
"Modified: / 21.10.1998 / 00:35:45 / cg" |
262 | 6869 |
! |
6870 |
||
297 | 6871 |
_ImageRepresentation_setIntPixels:nativeContext |
318 | 6872 |
|imgRep x y w h clrModel ints offs scanLineWidth |
316 | 6873 |
img depth cmap rgbMap opaque transparentColorIndex |
373 | 6874 |
bytes srcIdx dstIdx val red green blue |
6875 |
redMask greenMask blueMask redShift greenShift blueShift| |
|
297 | 6876 |
|
6877 |
imgRep := nativeContext receiver. |
|
6878 |
x := nativeContext argAt:1. |
|
6879 |
y := nativeContext argAt:2. |
|
6880 |
w := nativeContext argAt:3. |
|
6881 |
h := nativeContext argAt:4. |
|
6882 |
clrModel := nativeContext argAt:5. |
|
6883 |
ints := nativeContext argAt:6. |
|
318 | 6884 |
offs := nativeContext argAt:7. "/ offset ?? |
6885 |
scanLineWidth := nativeContext argAt:8. "/ scanLineWidth ?? |
|
297 | 6886 |
opaque := false. |
373 | 6887 |
offs ~~ 0 ifTrue:[ |
6888 |
self halt |
|
6889 |
]. |
|
297 | 6890 |
|
6891 |
depth := clrModel instVarNamed:'pixel_bits'. |
|
6892 |
clrModel class == (Java at:'java.awt.image.DirectColorModel') ifTrue:[ |
|
6893 |
] ifFalse:[ |
|
6894 |
(clrModel instVarNamed:'map_size') ~~ 0 ifTrue:[ |
|
6895 |
rgbMap := clrModel instVarNamed:'rgb'. |
|
6896 |
cmap := Array new:rgbMap size. |
|
6897 |
rgbMap |
|
6898 |
keysAndValuesDo:[:idx :rgb | |
|
6899 |
cmap at:idx put:(Color rgbValue:(rgb bitAnd:16rFFFFFF)) |
|
6900 |
]. |
|
6901 |
]. |
|
6902 |
opaque := (clrModel instVarNamed:'opaque') ~~ 0. |
|
6903 |
opaque ifFalse:[ |
|
6904 |
transparentColorIndex := clrModel instVarNamed:'transparent_index' |
|
6905 |
]. |
|
6906 |
]. |
|
6907 |
||
6908 |
img := imgRep instVarNamed:'pData'. |
|
405 | 6909 |
(img isNil or:[img == 0]) ifFalse:[ |
6910 |
"/ self halt. |
|
6911 |
]. |
|
6912 |
||
6913 |
depth == 32 ifTrue:[ |
|
6914 |
"/ temporary kludge - ony use 24 bits/pixel |
|
6915 |
bytes := ByteArray new:w*h*3. |
|
6916 |
srcIdx := 1. |
|
6917 |
dstIdx := 1. |
|
6918 |
redMask := clrModel instVarNamed:'red_mask'. |
|
6919 |
greenMask := clrModel instVarNamed:'green_mask'. |
|
6920 |
blueMask := clrModel instVarNamed:'blue_mask'. |
|
6921 |
redShift := (clrModel instVarNamed:'red_offset') negated. |
|
6922 |
greenShift := (clrModel instVarNamed:'green_offset') negated. |
|
6923 |
blueShift := (clrModel instVarNamed:'blue_offset') negated. |
|
6924 |
1 to:h do:[:y | |
|
6925 |
1 to:w do:[:x | |
|
6926 |
val := ints at:srcIdx. |
|
6927 |
red := (val bitAnd:redMask) bitShift:redShift. |
|
6928 |
green := (val bitAnd:greenMask) bitShift:greenShift. |
|
6929 |
blue := (val bitAnd:blueMask) bitShift:blueShift. |
|
6930 |
bytes at:dstIdx put:red. |
|
6931 |
bytes at:dstIdx+1 put:green. |
|
6932 |
bytes at:dstIdx+2 put:blue. |
|
6933 |
dstIdx := dstIdx + 3. |
|
6934 |
srcIdx := srcIdx + 1. |
|
316 | 6935 |
]. |
405 | 6936 |
srcIdx := srcIdx + (scanLineWidth - w). |
316 | 6937 |
]. |
405 | 6938 |
img := Depth24Image width:w height:h depth:24 fromArray:bytes. |
6939 |
] ifFalse:[ |
|
6940 |
scanLineWidth ~~ w ifTrue:[ |
|
6941 |
self halt |
|
297 | 6942 |
]. |
405 | 6943 |
img := Image width:w height:h depth:depth fromArray:ints. |
6944 |
]. |
|
6945 |
cmap notNil ifTrue:[ |
|
6946 |
img colorMap:cmap. |
|
6947 |
img photometric:#palette |
|
297 | 6948 |
] ifFalse:[ |
405 | 6949 |
img photometric:#rgb |
6950 |
]. |
|
6951 |
opaque ifFalse:[ |
|
6952 |
img mask:(ImageReader |
|
6953 |
buildMaskFromColor:transparentColorIndex |
|
6954 |
for:ints |
|
6955 |
width:w |
|
6956 |
height:h) |
|
6957 |
]. |
|
6958 |
||
6959 |
imgRep instVarNamed:'pData' put:img. |
|
297 | 6960 |
^ 1. |
6961 |
||
6962 |
"Created: / 1.2.1998 / 17:38:47 / cg" |
|
405 | 6963 |
"Modified: / 21.10.1998 / 00:35:37 / cg" |
297 | 6964 |
! |
6965 |
||
440 | 6966 |
_JPEGImageDecoder_readImage:nativeContext |
6967 |
UnimplementedNativeMethodSignal raise |
|
6968 |
||
6969 |
"Created: / 12.11.1998 / 18:53:30 / cg" |
|
6970 |
"Modified: / 12.11.1998 / 18:53:40 / cg" |
|
6971 |
! |
|
6972 |
||
262 | 6973 |
_OffScreenImageSource_sendPixels:nativeContext |
6974 |
"/ self halt. |
|
6975 |
||
6976 |
"Modified: / 16.1.1998 / 18:22:23 / cg" |
|
6977 |
"Created: / 17.1.1998 / 12:36:25 / cg" |
|
255 | 6978 |
! ! |
6979 |
||
280 | 6980 |
!JavaVM class methodsFor:'native - sun.awt - jdk1.2'! |
6981 |
||
284 | 6982 |
_ColorModel_initIDs:nativeContext |
6983 |
"/ new with jdk1.2 ... |
|
6984 |
||
6985 |
"Created: / 28.1.1998 / 22:19:23 / cg" |
|
6986 |
! |
|
6987 |
||
6988 |
_FontDescriptor_initIDs:nativeContext |
|
6989 |
"/ new with jdk1.2 ... |
|
6990 |
||
6991 |
"Created: / 28.1.1998 / 22:30:52 / cg" |
|
6992 |
! |
|
6993 |
||
6994 |
_Font_initIDs:nativeContext |
|
6995 |
"/ new with jdk1.2 ... |
|
6996 |
||
6997 |
"Created: / 27.1.1998 / 21:43:25 / cg" |
|
6998 |
! |
|
6999 |
||
7000 |
_PackedColorModel_initIDs:nativeContext |
|
7001 |
"/ new with jdk1.2 ... |
|
7002 |
||
7003 |
"Created: / 28.1.1998 / 22:19:35 / cg" |
|
7004 |
! |
|
7005 |
||
7006 |
_PlatformFont_initIDs:nativeContext |
|
7007 |
"/ new with jdk1.2 ... |
|
7008 |
||
7009 |
"Created: / 28.1.1998 / 22:30:41 / cg" |
|
7010 |
! |
|
7011 |
||
7012 |
_X11GraphicsDevice_getConfigType:nativeContext |
|
7013 |
"/ new with jdk1.2 ... |
|
7014 |
||
7015 |
|configNr cls| |
|
7016 |
||
7017 |
"/ for now, only one config. |
|
7018 |
configNr := nativeContext argAt:1. |
|
7019 |
||
7020 |
cls := Java classNamed:'java.awt.GraphicsDevice'. |
|
7021 |
^ cls instVarNamed:'TYPE_RASTER_SCREEN'. |
|
7022 |
||
7023 |
"Created: / 28.1.1998 / 22:19:05 / cg" |
|
7024 |
! |
|
7025 |
||
7026 |
_X11GraphicsDevice_getNumConfigs:nativeContext |
|
7027 |
"/ new with jdk1.2 ... |
|
7028 |
||
7029 |
^ 1 |
|
7030 |
||
7031 |
"Created: / 28.1.1998 / 22:13:26 / cg" |
|
7032 |
"Modified: / 28.1.1998 / 22:14:33 / cg" |
|
7033 |
! |
|
7034 |
||
7035 |
_X11GraphicsEnvironment_getNumScreens:nativeContext |
|
7036 |
"/ new with jdk1.2 ... |
|
7037 |
||
7038 |
"/ could return the actual number of screens ... |
|
7039 |
||
7040 |
^ 1 |
|
7041 |
||
7042 |
"Created: / 28.1.1998 / 01:50:22 / cg" |
|
7043 |
"Modified: / 28.1.1998 / 22:12:32 / cg" |
|
7044 |
! |
|
7045 |
||
280 | 7046 |
_X11GraphicsEnvironment_initDisplay:nativeContext |
7047 |
"/ new with jdk1.2 ... |
|
7048 |
||
7049 |
"Created: / 28.1.1998 / 01:50:22 / cg" |
|
7050 |
! ! |
|
7051 |
||
284 | 7052 |
!JavaVM class methodsFor:'native - sun.awt.motif - jdk1.2'! |
7053 |
||
7054 |
_InputThread_run:nativeContext |
|
7055 |
self _WToolkit_eventLoop:nativeContext. |
|
7056 |
||
7057 |
"Created: / 28.1.1998 / 22:34:47 / cg" |
|
7058 |
"Modified: / 28.1.1998 / 22:35:16 / cg" |
|
7059 |
! |
|
7060 |
||
7061 |
_MComponentPeer_cacheInit:nativeContext |
|
7062 |
||
7063 |
"Created: / 28.1.1998 / 22:22:30 / cg" |
|
7064 |
! |
|
7065 |
||
457 | 7066 |
_MComponentPeer_pHide:nativeContext |
7067 |
^ self _WComponentPeer_hide:nativeContext |
|
7068 |
||
7069 |
"Created: / 18.11.1998 / 00:15:18 / cg" |
|
7070 |
! |
|
7071 |
||
284 | 7072 |
_MComponentPeer_pInitialize:nativeContext |
7073 |
||
7074 |
"Created: / 28.1.1998 / 22:27:25 / cg" |
|
7075 |
! |
|
7076 |
||
7077 |
_MComponentPeer_setCursor:nativeContext |
|
7078 |
||
7079 |
"Created: / 28.1.1998 / 22:27:35 / cg" |
|
7080 |
! |
|
7081 |
||
7082 |
_MFramePeer_create:nativeContext |
|
7083 |
^ self _WFramePeer_create:nativeContext |
|
7084 |
||
7085 |
"Created: / 28.1.1998 / 22:25:44 / cg" |
|
7086 |
! |
|
7087 |
||
7088 |
_MFramePeer_pHide:nativeContext |
|
7089 |
^ self _WComponentPeer_hide:nativeContext |
|
7090 |
||
7091 |
"Created: / 28.1.1998 / 22:27:04 / cg" |
|
7092 |
! |
|
7093 |
||
7094 |
_MFramePeer_pReshape:nativeContext |
|
7095 |
self commonReshapeComponent:nativeContext |
|
7096 |
||
7097 |
"Created: / 28.1.1998 / 22:28:00 / cg" |
|
7098 |
"Modified: / 28.1.1998 / 22:29:34 / cg" |
|
7099 |
! |
|
7100 |
||
7101 |
_MFramePeer_pSetTitle:nativeContext |
|
7102 |
self _WWindowPeer__setTitle:nativeContext |
|
7103 |
||
7104 |
"Created: / 28.1.1998 / 22:30:23 / cg" |
|
7105 |
! |
|
7106 |
||
7107 |
_MToolkit_init:nativeContext |
|
7108 |
||
7109 |
"Created: / 28.1.1998 / 22:21:54 / cg" |
|
7110 |
! |
|
7111 |
||
7112 |
_MToolkit_run:nativeContext |
|
7113 |
||
7114 |
"Created: / 28.1.1998 / 22:22:10 / cg" |
|
7115 |
! ! |
|
7116 |
||
7117 |
!JavaVM class methodsFor:'native - sun.awt.windows'! |
|
7118 |
||
457 | 7119 |
_MComponentPeer_handleEvent:nativeContext |
7120 |
^ self _WComponentPeer_handleEvent:nativeContext |
|
7121 |
||
7122 |
"Created: / 18.11.1998 / 00:21:17 / cg" |
|
7123 |
! |
|
7124 |
||
7125 |
_MComponentPeer_pShow:nativeContext |
|
7126 |
|view| |
|
7127 |
||
7128 |
view := self viewForWPeer:nativeContext. |
|
7129 |
||
7130 |
"/ frame views are under my browsers own control |
|
7131 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
7132 |
view beVisible. |
|
7133 |
view realize. |
|
7134 |
]. |
|
7135 |
||
7136 |
"/ view windowGroup notNil ifTrue:[ |
|
7137 |
"/ windowServer addGroup:(view windowGroup) |
|
7138 |
"/ ]. |
|
7139 |
||
7140 |
^ nil |
|
7141 |
||
7142 |
"/ self halt. |
|
7143 |
||
7144 |
"Modified: / 25.1.1998 / 09:54:07 / cg" |
|
7145 |
"Created: / 18.11.1998 / 00:21:51 / cg" |
|
7146 |
! |
|
7147 |
||
284 | 7148 |
_WButtonPeer_create:nativeContext |
7149 |
|jButtonPeer jButton jFrame frame button |
|
7150 |
lbl| |
|
7151 |
||
7152 |
jButtonPeer := nativeContext receiver. |
|
7153 |
jButton := jButtonPeer instVarNamed:'target'. |
|
7154 |
||
7155 |
jFrame := nativeContext argAt:1. |
|
7156 |
frame := jFrame instVarNamed:'pData'. |
|
7157 |
||
7158 |
button := Button in:frame. |
|
448 | 7159 |
button action:[ |
7160 |
jButtonPeer perform:#'handleAction()V'. |
|
7161 |
]. |
|
284 | 7162 |
|
7163 |
lbl := jButton instVarNamed:'label'. |
|
7164 |
lbl notNil ifTrue:[ |
|
419 | 7165 |
lbl := Java as_ST_String:lbl. |
7166 |
button label:lbl |
|
284 | 7167 |
]. |
7168 |
self createdWindowsView:button for:jButtonPeer. |
|
7169 |
||
7170 |
WindowCreationTrace == true ifTrue:[ |
|
419 | 7171 |
'WButtonPeer_create: ' print. frame print. ' -> ' print. button printNL. |
284 | 7172 |
]. |
7173 |
||
7174 |
"Created: / 5.1.1998 / 01:53:30 / cg" |
|
448 | 7175 |
"Modified: / 13.11.1998 / 22:59:46 / cg" |
284 | 7176 |
! |
7177 |
||
297 | 7178 |
_WButtonPeer_setLabel:nativeContext |
7179 |
|label jString| |
|
7180 |
||
7181 |
jString := nativeContext argAt:1. |
|
7182 |
||
7183 |
label := self viewForWPeer:nativeContext. |
|
7184 |
label label:(Java as_ST_String:jString) |
|
7185 |
||
7186 |
"Modified: / 8.1.1998 / 17:35:50 / cg" |
|
7187 |
"Created: / 1.2.1998 / 17:05:47 / cg" |
|
7188 |
! |
|
7189 |
||
284 | 7190 |
_WCanvasPeer_create:nativeContext |
7191 |
|jCanvasPeer jFrame frame subView| |
|
7192 |
||
7193 |
jCanvasPeer := nativeContext receiver. |
|
7194 |
||
7195 |
jFrame := nativeContext argAt:1. |
|
7196 |
jFrame isNil ifTrue:[ |
|
7197 |
self halt:'no frame in canvasPeer create'. |
|
7198 |
self internalError:'no frame in canvasPeer create'. |
|
7199 |
^ self. |
|
7200 |
]. |
|
7201 |
frame := jFrame instVarNamed:'pData'. |
|
7202 |
||
7203 |
subView := JavaView in:frame. |
|
7204 |
subView delegate:self. |
|
7205 |
subView javaPeer:jCanvasPeer. |
|
7206 |
||
7207 |
self createdWindowsView:subView for:jCanvasPeer. |
|
7208 |
||
7209 |
WindowCreationTrace == true ifTrue:[ |
|
7210 |
'WCanvasPeer_create: ' print. frame print. ' -> ' print. subView printNL. |
|
7211 |
]. |
|
7212 |
||
7213 |
"Created: / 5.1.1998 / 00:59:19 / cg" |
|
7214 |
"Modified: / 16.1.1998 / 13:40:00 / cg" |
|
7215 |
! |
|
7216 |
||
440 | 7217 |
_WCheckboxMenuItemPeer_setState:nativeContext |
7218 |
"/ void setState (boolean) |
|
7219 |
UnimplementedNativeMethodSignal raise |
|
7220 |
||
7221 |
"Created: / 12.11.1998 / 19:14:35 / cg" |
|
7222 |
! |
|
7223 |
||
284 | 7224 |
_WCheckboxPeer_create:nativeContext |
7225 |
|jCheckboxPeer jCheckbox jFrame frame checkBox lbl| |
|
7226 |
||
7227 |
jCheckboxPeer := nativeContext receiver. |
|
7228 |
jCheckbox := jCheckboxPeer instVarNamed:'target'. |
|
7229 |
||
7230 |
jFrame := nativeContext argAt:1. |
|
7231 |
frame := jFrame instVarNamed:'pData'. |
|
7232 |
||
7233 |
checkBox := CheckBox in:frame. |
|
7234 |
checkBox action:[ |
|
7235 |
jCheckboxPeer |
|
7236 |
perform:#'handleAction(Z)V' |
|
7237 |
with:(checkBox isOn ifTrue:[1] ifFalse:[0]) |
|
7238 |
]. |
|
7239 |
||
7240 |
lbl := jCheckbox instVarNamed:'label'. |
|
7241 |
lbl notNil ifTrue:[ |
|
7242 |
lbl := Java as_ST_String:lbl. |
|
7243 |
checkBox label:lbl |
|
7244 |
]. |
|
7245 |
||
7246 |
self createdWindowsView:checkBox for:jCheckboxPeer. |
|
7247 |
||
7248 |
WindowCreationTrace == true ifTrue:[ |
|
7249 |
'WCheckboxPeer_create: ' print. frame print. ' -> ' print. checkBox printNL. |
|
7250 |
]. |
|
7251 |
||
7252 |
"Created: / 7.1.1998 / 21:48:03 / cg" |
|
7253 |
"Modified: / 15.1.1998 / 12:27:04 / cg" |
|
7254 |
! |
|
7255 |
||
7256 |
_WCheckboxPeer_setCheckboxGroup:nativeContext |
|
7257 |
|checkBox jGroup| |
|
7258 |
||
7259 |
checkBox := self viewForWPeer:nativeContext. |
|
7260 |
||
7261 |
jGroup := nativeContext argAt:1. |
|
7262 |
||
7263 |
"Created: / 7.1.1998 / 21:48:47 / cg" |
|
7264 |
"Modified: / 25.1.1998 / 01:20:42 / cg" |
|
7265 |
! |
|
7266 |
||
440 | 7267 |
_WCheckboxPeer_setLabel:nativeContext |
7268 |
"/ void setLabel (java.lang.String) |
|
7269 |
UnimplementedNativeMethodSignal raise |
|
7270 |
||
7271 |
"Created: / 12.11.1998 / 19:14:53 / cg" |
|
7272 |
! |
|
7273 |
||
284 | 7274 |
_WCheckboxPeer_setState:nativeContext |
7275 |
|checkBox state| |
|
7276 |
||
7277 |
checkBox := self viewForWPeer:nativeContext. |
|
7278 |
||
7279 |
state := nativeContext argAt:1. |
|
7280 |
state ~~ 0 ifTrue:[ |
|
7281 |
checkBox turnOn |
|
7282 |
] ifFalse:[ |
|
7283 |
checkBox turnOff |
|
7284 |
]. |
|
7285 |
||
7286 |
"Created: / 7.1.1998 / 21:49:13 / cg" |
|
7287 |
"Modified: / 25.1.1998 / 01:26:18 / cg" |
|
7288 |
! |
|
7289 |
||
7290 |
_WChoicePeer_addItem:nativeContext |
|
7291 |
|jString index comboBox| |
|
7292 |
||
7293 |
comboBox := self viewForWPeer:nativeContext. |
|
7294 |
||
7295 |
jString := nativeContext argAt:1. |
|
7296 |
index := nativeContext argAt:2. |
|
7297 |
||
7298 |
comboBox model list addLast:(Java as_ST_String:jString). |
|
7299 |
comboBox model changed:#list. |
|
7300 |
||
7301 |
"Created: / 7.1.1998 / 21:45:12 / cg" |
|
7302 |
"Modified: / 24.1.1998 / 18:51:32 / cg" |
|
7303 |
! |
|
7304 |
||
7305 |
_WChoicePeer_create:nativeContext |
|
7306 |
|jChoicePeer jChoice jFrame frame comboBox| |
|
7307 |
||
7308 |
jChoicePeer := nativeContext receiver. |
|
7309 |
jChoice := jChoicePeer instVarNamed:'target'. |
|
7310 |
||
7311 |
jFrame := nativeContext argAt:1. |
|
7312 |
frame := jFrame instVarNamed:'pData'. |
|
7313 |
||
7314 |
comboBox := ComboListView in:frame. |
|
7315 |
comboBox model:(SelectionInList new list:(OrderedCollection new)). |
|
285 | 7316 |
comboBox action:[:index | |
7317 |
jChoicePeer |
|
7318 |
perform:#'handleAction(I)V' |
|
7319 |
with:(comboBox model selectionIndex - 1) |
|
7320 |
]. |
|
284 | 7321 |
|
7322 |
self createdWindowsView:comboBox for:jChoicePeer. |
|
7323 |
||
7324 |
WindowCreationTrace == true ifTrue:[ |
|
7325 |
'WChoicePeer_create: ' print. frame print. ' -> ' print. comboBox printNL. |
|
7326 |
]. |
|
7327 |
||
7328 |
"Created: / 7.1.1998 / 21:44:31 / cg" |
|
285 | 7329 |
"Modified: / 28.1.1998 / 23:19:17 / cg" |
284 | 7330 |
! |
7331 |
||
440 | 7332 |
_WChoicePeer_remove:nativeContext |
7333 |
"/ void remove (int) |
|
7334 |
UnimplementedNativeMethodSignal raise |
|
7335 |
||
7336 |
"Created: / 12.11.1998 / 19:12:20 / cg" |
|
7337 |
! |
|
7338 |
||
284 | 7339 |
_WChoicePeer_reshape:nativeContext |
7340 |
self pReshape:nativeContext. |
|
7341 |
^ self. |
|
7342 |
||
7343 |
"Modified: / 15.8.1997 / 15:36:29 / cg" |
|
7344 |
"Created: / 7.1.1998 / 21:46:18 / cg" |
|
7345 |
! |
|
7346 |
||
7347 |
_WChoicePeer_select:nativeContext |
|
7348 |
|comboBox index| |
|
7349 |
||
7350 |
comboBox := self viewForWPeer:nativeContext. |
|
7351 |
||
7352 |
index := nativeContext argAt:1. |
|
7353 |
comboBox model selectionIndex:(index + 1). "/ JAVA indexing starts at 0 |
|
7354 |
||
7355 |
"Created: / 7.1.1998 / 21:45:43 / cg" |
|
7356 |
"Modified: / 25.1.1998 / 09:55:05 / cg" |
|
7357 |
! |
|
7358 |
||
440 | 7359 |
_WClipboard_getClipboardText:nativeContext |
7360 |
"/ java.lang.String getClipboardText () |
|
7361 |
UnimplementedNativeMethodSignal raise |
|
7362 |
||
7363 |
"Created: / 12.11.1998 / 19:15:45 / cg" |
|
7364 |
! |
|
7365 |
||
284 | 7366 |
_WClipboard_init:nativeContext |
7367 |
"/ self halt. |
|
7368 |
||
7369 |
"Modified: / 18.3.1997 / 18:43:18 / cg" |
|
7370 |
"Created: / 4.1.1998 / 19:03:59 / cg" |
|
7371 |
! |
|
7372 |
||
440 | 7373 |
_WClipboard_setClipboardText:nativeContext |
7374 |
"/ void setClipboardText (java.awt.datatransfer.StringSelection) |
|
7375 |
UnimplementedNativeMethodSignal raise |
|
7376 |
||
7377 |
"Created: / 12.11.1998 / 19:15:31 / cg" |
|
7378 |
! |
|
7379 |
||
284 | 7380 |
_WColor_getDefaultColor:nativeContext |
7381 |
|clrIndex jClr clr | |
|
7382 |
||
7383 |
clrIndex := nativeContext argAt:1. |
|
7384 |
"/ windows defaults: |
|
7385 |
"/ 1: view background |
|
7386 |
||
7387 |
clrIndex == 1 ifTrue:[ |
|
7388 |
clr := View defaultViewBackgroundColor. |
|
7389 |
clr isColor ifFalse:[ |
|
7390 |
clr := Color gray:50. |
|
7391 |
]. |
|
7392 |
]. |
|
7393 |
clrIndex == 2 ifTrue:[ |
|
7394 |
clr := Color black. |
|
7395 |
]. |
|
7396 |
clr isNil ifTrue:[ |
|
7397 |
self halt. |
|
7398 |
self internalError:'breakpoint'. |
|
7399 |
^ nil. |
|
7400 |
]. |
|
7401 |
||
7402 |
clr := clr on:(Screen current). |
|
7403 |
||
7404 |
jClr := (Java classForName:'java.awt.Color') new. |
|
7405 |
||
7406 |
jClr instVarNamed:'pData' put:clr. |
|
7407 |
jClr instVarNamed:'value' put:(clr rgbValue). |
|
7408 |
"/ self halt. |
|
7409 |
^ jClr. |
|
7410 |
||
7411 |
"Created: / 15.8.1997 / 15:38:10 / cg" |
|
7412 |
"Modified: / 4.1.1998 / 18:06:51 / cg" |
|
7413 |
! |
|
7414 |
||
440 | 7415 |
_WComponentPeer__beginValidate:nativeContext |
7416 |
"/ void _beginValidate () |
|
7417 |
UnimplementedNativeMethodSignal raise |
|
7418 |
||
7419 |
"Created: / 12.11.1998 / 19:10:08 / cg" |
|
7420 |
! |
|
7421 |
||
284 | 7422 |
_WComponentPeer__dispose:nativeContext |
7423 |
|view jPeer| |
|
7424 |
||
7425 |
view := self viewForWPeer:nativeContext. |
|
7426 |
||
7427 |
Object errorSignal catch:[ |
|
7428 |
view destroy. |
|
7429 |
]. |
|
7430 |
JavaWindowGroup removeView:view. |
|
7431 |
||
7432 |
jPeer := nativeContext receiver. |
|
7433 |
jPeer instVarNamed:'pData' put:0. |
|
7434 |
||
7435 |
"Created: / 7.1.1998 / 22:36:25 / cg" |
|
7436 |
"Modified: / 25.1.1998 / 16:43:06 / cg" |
|
7437 |
! |
|
7438 |
||
7439 |
_WComponentPeer__setBackground:nativeContext |
|
7440 |
|rgb clr view| |
|
7441 |
||
7442 |
view := self viewForWPeer:nativeContext. |
|
7443 |
||
7444 |
rgb := nativeContext argAt:1. |
|
7445 |
clr := Color rgbValue:rgb. |
|
7446 |
||
7447 |
"/ self halt. |
|
7448 |
"/ self internalError:'breakPoint'. |
|
7449 |
||
7450 |
clr := clr on:(view device). |
|
7451 |
||
7452 |
"/ (view superView isMemberOf:JavaEmbeddedFrameView) ifTrue:[ |
|
7453 |
"/ view viewBackground:(view superView viewBackground). |
|
7454 |
"/ view backgroundPaint:(view superView viewBackground). |
|
7455 |
"/ ] ifFalse:[ |
|
7456 |
"/ (view isMemberOf:JavaView) ifTrue:[ |
|
7457 |
"/ view viewBackground:clr. |
|
7458 |
"/ view backgroundPaint:clr. |
|
7459 |
"/ ] |
|
7460 |
"/ ]. |
|
7461 |
||
7462 |
(view isKindOf:ScrollableView) ifTrue:[ |
|
7463 |
view := view scrolledView |
|
7464 |
]. |
|
7465 |
view viewBackground:clr. |
|
7466 |
view backgroundPaint:clr. |
|
7467 |
||
7468 |
"Created: / 4.1.1998 / 18:07:39 / cg" |
|
7469 |
"Modified: / 15.1.1998 / 13:06:44 / cg" |
|
7470 |
! |
|
7471 |
||
7472 |
_WComponentPeer__setForeground:nativeContext |
|
7473 |
|rgb clr view| |
|
7474 |
||
7475 |
view := self viewForWPeer:nativeContext. |
|
7476 |
||
7477 |
rgb := nativeContext argAt:1. |
|
7478 |
clr := Color rgbValue:rgb. |
|
7479 |
||
7480 |
"/ self halt. |
|
7481 |
"/ self internalError:'breakPoint'. |
|
7482 |
||
7483 |
clr := clr on:(view device). |
|
7484 |
||
7485 |
view paint:clr. |
|
7486 |
||
7487 |
"Created: / 4.1.1998 / 18:08:13 / cg" |
|
7488 |
"Modified: / 8.1.1998 / 17:32:45 / cg" |
|
7489 |
! |
|
7490 |
||
7491 |
_WComponentPeer_disable:nativeContext |
|
7492 |
|view| |
|
7493 |
||
7494 |
view := self viewForWPeer:nativeContext. |
|
7495 |
||
7496 |
Object errorSignal handle:[:ex | |
|
7497 |
] do:[ |
|
7498 |
view disable |
|
7499 |
] |
|
7500 |
||
7501 |
"Created: / 6.1.1998 / 18:26:36 / cg" |
|
7502 |
"Modified: / 8.1.1998 / 17:32:53 / cg" |
|
7503 |
! |
|
7504 |
||
7505 |
_WComponentPeer_enable:nativeContext |
|
7506 |
|view| |
|
7507 |
||
7508 |
view := self viewForWPeer:nativeContext. |
|
7509 |
||
7510 |
Object errorSignal handle:[:ex | |
|
7511 |
] do:[ |
|
7512 |
view enable |
|
7513 |
] |
|
7514 |
||
7515 |
"Modified: / 8.1.1998 / 17:32:53 / cg" |
|
7516 |
"Created: / 13.1.1998 / 23:08:05 / cg" |
|
7517 |
! |
|
7518 |
||
440 | 7519 |
_WComponentPeer_endValidate:nativeContext |
7520 |
"/ void endValidate () |
|
7521 |
UnimplementedNativeMethodSignal raise |
|
7522 |
||
7523 |
"Created: / 12.11.1998 / 19:10:20 / cg" |
|
7524 |
! |
|
7525 |
||
7526 |
_WComponentPeer_getLocationOnScreen:nativeContext |
|
7527 |
"/ java.awt.Point getLocationOnScreen () |
|
480 | 7528 |
|
7529 |
|view p jP| |
|
7530 |
||
7531 |
view := self viewForWPeer:nativeContext. |
|
7532 |
view isNil ifTrue:[^ nil]. |
|
7533 |
||
7534 |
p := view originRelativeTo:nil. |
|
7535 |
jP := (Java classForName:'java.awt.Point') newCleared. |
|
7536 |
jP instVarNamed:'x' put:p x. |
|
7537 |
jP instVarNamed:'y' put:p y. |
|
7538 |
^ jP |
|
7539 |
||
7540 |
"Modified: / 3.12.1998 / 21:16:05 / cg" |
|
440 | 7541 |
! |
7542 |
||
284 | 7543 |
_WComponentPeer_handleEvent:nativeContext |
7544 |
"this is invoked by java, to let a widget handle any event which |
|
7545 |
was not consumed (eaten) by java. |
|
7546 |
If the view in question is some ST-widget, forward it. |
|
7547 |
Ignore for JavaViews." |
|
7548 |
||
7549 |
|view jEv stEv| |
|
7550 |
||
7551 |
view := self viewForWPeer:nativeContext. |
|
7552 |
view notNil ifTrue:[ |
|
474 | 7553 |
jEv := nativeContext argAt:1. |
7554 |
stEv := jEv instVarNamed:'data'. |
|
7555 |
(stEv notNil and:[stEv ~~ 0]) ifTrue:[ |
|
7556 |
(view isKindOf:JavaView) ifFalse:[ |
|
316 | 7557 |
EventTrace == true ifTrue:[ |
7558 |
('JAVA: WComponent - handleEvent: ' , stEv type , ' for ' , view printString) infoPrintCR. |
|
7559 |
]. |
|
474 | 7560 |
view dispatchEvent:stEv. |
316 | 7561 |
^ self. |
7562 |
] |
|
7563 |
] |
|
7564 |
]. |
|
7565 |
EventTrace == true ifTrue:[ |
|
7566 |
('JAVA: WComponent - handleEvent ignored') infoPrintCR. |
|
7567 |
] |
|
284 | 7568 |
|
7569 |
"Created: / 6.1.1998 / 21:10:17 / cg" |
|
477 | 7570 |
"Modified: / 3.12.1998 / 00:36:33 / cg" |
284 | 7571 |
! |
7572 |
||
7573 |
_WComponentPeer_hide:nativeContext |
|
7574 |
|view| |
|
7575 |
||
7576 |
view := self viewForWPeer:nativeContext. |
|
7577 |
||
7578 |
Object errorSignal handle:[:ex | |
|
7579 |
] do:[ |
|
7580 |
view beInvisible |
|
7581 |
] |
|
7582 |
||
7583 |
"Created: / 7.1.1998 / 22:35:32 / cg" |
|
7584 |
"Modified: / 8.1.1998 / 17:33:08 / cg" |
|
7585 |
! |
|
7586 |
||
391 | 7587 |
_WComponentPeer_nativeHandleEvent:nativeContext |
7588 |
"this is invoked by java, to let a widget handle any event which |
|
7589 |
was not consumed (eaten) by java. |
|
7590 |
If the view in question is some ST-widget, forward it. |
|
7591 |
Ignore for JavaViews." |
|
7592 |
||
7593 |
|view jEv stEv| |
|
7594 |
||
7595 |
^self. |
|
7596 |
view := self viewForWPeer:nativeContext. |
|
7597 |
view notNil ifTrue:[ |
|
7598 |
(view isKindOf:JavaView) ifFalse:[ |
|
7599 |
jEv := nativeContext argAt:1. |
|
7600 |
stEv := jEv instVarNamed:'data'. |
|
7601 |
(stEv notNil and:[stEv ~~ 0]) ifTrue:[ |
|
7602 |
EventTrace == true ifTrue:[ |
|
7603 |
('JAVA: WComponent - handleEvent: ' , stEv type , ' for ' , view printString) infoPrintCR. |
|
7604 |
]. |
|
7605 |
stEv sendEventWithFocusOn:nil. |
|
7606 |
^ self. |
|
7607 |
] |
|
7608 |
] |
|
7609 |
]. |
|
7610 |
EventTrace == true ifTrue:[ |
|
7611 |
('JAVA: WComponent - handleEvent ignored') infoPrintCR. |
|
7612 |
] |
|
7613 |
||
7614 |
"Created: / 19.10.1998 / 21:26:16 / cg" |
|
7615 |
"Modified: / 19.10.1998 / 23:26:37 / cg" |
|
7616 |
! |
|
7617 |
||
284 | 7618 |
_WComponentPeer_requestFocus:nativeContext |
7619 |
|view| |
|
7620 |
||
7621 |
view := self viewForWPeer:nativeContext. |
|
318 | 7622 |
"/ 'getFocus - ' print. view displayString printCR. |
284 | 7623 |
|
7624 |
view getKeyboardFocus |
|
7625 |
||
7626 |
"Created: / 7.1.1998 / 22:30:03 / cg" |
|
318 | 7627 |
"Modified: / 6.2.1998 / 02:22:17 / cg" |
284 | 7628 |
! |
7629 |
||
7630 |
_WComponentPeer_reshape:nativeContext |
|
7631 |
self commonReshapeComponent:nativeContext |
|
7632 |
||
7633 |
"Modified: / 18.3.1997 / 19:30:21 / cg" |
|
7634 |
"Created: / 4.1.1998 / 18:01:11 / cg" |
|
7635 |
! |
|
7636 |
||
7637 |
_WComponentPeer_setCursor:nativeContext |
|
7638 |
|view| |
|
7639 |
||
7640 |
view := self viewForWPeer:nativeContext. |
|
7641 |
"/ self halt. |
|
7642 |
||
7643 |
"Created: / 5.1.1998 / 01:52:30 / cg" |
|
7644 |
"Modified: / 25.1.1998 / 01:21:52 / cg" |
|
7645 |
! |
|
7646 |
||
7647 |
_WComponentPeer_setFont:nativeContext |
|
7648 |
|view| |
|
7649 |
||
7650 |
view := self viewForWPeer:nativeContext. |
|
7651 |
"/ self halt. |
|
7652 |
||
7653 |
"Created: / 5.1.1998 / 00:55:17 / cg" |
|
7654 |
"Modified: / 25.1.1998 / 01:22:19 / cg" |
|
7655 |
! |
|
7656 |
||
7657 |
_WComponentPeer_setZOrderPosition:nativeContext |
|
7658 |
|view| |
|
7659 |
||
7660 |
view := self viewForWPeer:nativeContext. |
|
7661 |
"/ self unimplementedNativeMethod. |
|
7662 |
"/ self halt. |
|
7663 |
"/ self internalError:'breakPoint' |
|
7664 |
||
7665 |
"Created: / 4.1.1998 / 17:59:26 / cg" |
|
7666 |
"Modified: / 25.1.1998 / 01:22:32 / cg" |
|
7667 |
! |
|
7668 |
||
7669 |
_WComponentPeer_show:nativeContext |
|
7670 |
|view| |
|
7671 |
||
7672 |
view := self viewForWPeer:nativeContext. |
|
7673 |
||
7674 |
"/ frame views are under my browsers own control |
|
7675 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
7676 |
view beVisible. |
|
7677 |
view realize. |
|
7678 |
]. |
|
7679 |
||
7680 |
"/ view windowGroup notNil ifTrue:[ |
|
7681 |
"/ windowServer addGroup:(view windowGroup) |
|
7682 |
"/ ]. |
|
7683 |
||
7684 |
^ nil |
|
7685 |
||
7686 |
"/ self halt. |
|
7687 |
||
7688 |
"Created: / 5.1.1998 / 01:26:22 / cg" |
|
7689 |
"Modified: / 25.1.1998 / 09:54:07 / cg" |
|
7690 |
! |
|
7691 |
||
7692 |
_WComponentPeer_start:nativeContext |
|
7693 |
"/ self halt. |
|
7694 |
||
7695 |
"Modified: / 18.3.1997 / 18:43:18 / cg" |
|
7696 |
"Created: / 5.1.1998 / 00:58:40 / cg" |
|
7697 |
! |
|
7698 |
||
7699 |
_WDefaultFontCharset_canConvert:nativeContext |
|
7700 |
^ 1 |
|
7701 |
||
7702 |
"Modified: / 21.8.1997 / 15:56:57 / cg" |
|
7703 |
"Created: / 5.1.1998 / 01:55:47 / cg" |
|
7704 |
! |
|
7705 |
||
7706 |
_WDialogPeer__hide:nativeContext |
|
7707 |
|dialog| |
|
7708 |
||
7709 |
dialog := self viewForWPeer:nativeContext. |
|
7710 |
||
7711 |
dialog hide. |
|
7712 |
||
7713 |
"Created: / 7.1.1998 / 22:34:10 / cg" |
|
7714 |
"Modified: / 8.1.1998 / 17:34:10 / cg" |
|
7715 |
! |
|
7716 |
||
7717 |
_WDialogPeer__show:nativeContext |
|
7718 |
|dialog| |
|
7719 |
||
7720 |
dialog := self viewForWPeer:nativeContext. |
|
7721 |
"/ |
|
7722 |
"/ show does not work (yet); must setup windowgroup |
|
7723 |
"/ for it to get events ... |
|
480 | 7724 |
"/ dialog realize. |
7725 |
||
7726 |
dialog show. |
|
284 | 7727 |
|
7728 |
"Created: / 7.1.1998 / 21:52:15 / cg" |
|
480 | 7729 |
"Modified: / 3.12.1998 / 20:40:05 / cg" |
284 | 7730 |
! |
7731 |
||
7732 |
_WDialogPeer_create:nativeContext |
|
7733 |
|jDialogPeer dialog| |
|
7734 |
||
7735 |
jDialogPeer := nativeContext receiver. |
|
7736 |
||
7737 |
dialog := ModalBox new. |
|
7738 |
jDialogPeer instVarNamed:'pData' put:dialog. |
|
7739 |
||
7740 |
self createdWindowsView:dialog for:jDialogPeer. |
|
7741 |
dialog windowGroup:JavaWindowGroup. |
|
7742 |
JavaWindowGroup addTopView:dialog. |
|
7743 |
||
7744 |
WindowCreationTrace == true ifTrue:[ |
|
7745 |
'WDialogPeer_create: ' print. dialog printNL. |
|
7746 |
]. |
|
7747 |
||
7748 |
"Created: / 7.1.1998 / 21:51:00 / cg" |
|
7749 |
"Modified: / 15.1.1998 / 16:12:44 / cg" |
|
7750 |
! |
|
7751 |
||
440 | 7752 |
_WDrawingSurfaceInfo_getDepth:nativeContext |
7753 |
"/ int getDepth () |
|
7754 |
UnimplementedNativeMethodSignal raise |
|
7755 |
||
7756 |
"Created: / 12.11.1998 / 19:21:00 / cg" |
|
7757 |
! |
|
7758 |
||
7759 |
_WDrawingSurfaceInfo_getHBitmap:nativeContext |
|
7760 |
"/ int getHBitmap () |
|
7761 |
UnimplementedNativeMethodSignal raise |
|
7762 |
||
7763 |
"Created: / 12.11.1998 / 19:20:32 / cg" |
|
7764 |
! |
|
7765 |
||
7766 |
_WDrawingSurfaceInfo_getHDC:nativeContext |
|
7767 |
"/ int getHDC () |
|
7768 |
UnimplementedNativeMethodSignal raise |
|
7769 |
||
7770 |
"Created: / 12.11.1998 / 19:20:50 / cg" |
|
7771 |
! |
|
7772 |
||
7773 |
_WDrawingSurfaceInfo_getHPalette:nativeContext |
|
7774 |
"/ int getHPalette () |
|
7775 |
UnimplementedNativeMethodSignal raise |
|
7776 |
||
7777 |
"Created: / 12.11.1998 / 19:21:07 / cg" |
|
7778 |
! |
|
7779 |
||
7780 |
_WDrawingSurfaceInfo_getHWnd:nativeContext |
|
7781 |
"/ int getHWnd () |
|
7782 |
UnimplementedNativeMethodSignal raise |
|
7783 |
||
7784 |
"Created: / 12.11.1998 / 19:20:23 / cg" |
|
7785 |
! |
|
7786 |
||
7787 |
_WDrawingSurfaceInfo_getPBits:nativeContext |
|
7788 |
"/ int getPBits () |
|
7789 |
UnimplementedNativeMethodSignal raise |
|
7790 |
||
7791 |
"Created: / 12.11.1998 / 19:20:41 / cg" |
|
7792 |
! |
|
7793 |
||
7794 |
_WDrawingSurfaceInfo_lock:nativeContext |
|
7795 |
"/ int lock () |
|
7796 |
UnimplementedNativeMethodSignal raise |
|
7797 |
||
7798 |
"Created: / 12.11.1998 / 19:20:00 / cg" |
|
7799 |
! |
|
7800 |
||
7801 |
_WDrawingSurfaceInfo_unlock:nativeContext |
|
7802 |
"/ void unlock () |
|
7803 |
UnimplementedNativeMethodSignal raise |
|
7804 |
||
7805 |
"Created: / 12.11.1998 / 19:20:13 / cg" |
|
7806 |
! |
|
7807 |
||
7808 |
_WEmbeddedFramePeer_create:nativeContext |
|
7809 |
"/ void create (sun.awt.windows.WComponentPeer) |
|
7810 |
UnimplementedNativeMethodSignal raise |
|
7811 |
||
7812 |
"Created: / 12.11.1998 / 19:16:09 / cg" |
|
7813 |
! |
|
7814 |
||
284 | 7815 |
_WFileDialogPeer_show:nativeContext |
7816 |
|jDialogPeer jDialog dialogView stDialog |
|
7817 |
title dir pattern f| |
|
7818 |
||
7819 |
jDialogPeer := nativeContext receiver. |
|
7820 |
jDialog := jDialogPeer instVarNamed:'target'. |
|
7821 |
dialogView := jDialogPeer instVarNamed:'pData'. |
|
7822 |
||
7823 |
stDialog := FileSelectionBox new. |
|
7824 |
||
7825 |
dir := jDialog instVarNamed:'dir'. |
|
7826 |
dir notNil ifTrue:[ |
|
7827 |
stDialog directory:(Java as_ST_String:dir). |
|
7828 |
]. |
|
7829 |
pattern := jDialog instVarNamed:'file'. |
|
7830 |
pattern notNil ifTrue:[ |
|
7831 |
stDialog pattern:(Java as_ST_String:pattern). |
|
7832 |
]. |
|
7833 |
title := jDialog instVarNamed:'title'. |
|
7834 |
title notNil ifTrue:[ |
|
7835 |
stDialog title:(Java as_ST_String:title). |
|
7836 |
stDialog label:(Java as_ST_String:title). |
|
7837 |
]. |
|
7838 |
||
7839 |
stDialog show. |
|
7840 |
||
7841 |
stDialog accepted ifTrue:[ |
|
7842 |
f := stDialog pathName. |
|
7843 |
||
7844 |
"/ cannot use the one below - it has a builtIn fileSeparator if '\' (sigh) |
|
7845 |
"/ jDialogPeer perform:#'handleSelected(Ljava/lang/String;)V' with:(Java as_String:f). |
|
7846 |
||
7847 |
jDialog |
|
7848 |
perform:#'setFile(Ljava/lang/String;)V' |
|
7849 |
with:(Java as_String:(f asFilename baseName)). |
|
7850 |
jDialog |
|
7851 |
perform:#'setDirectory(Ljava/lang/String;)V' |
|
7852 |
with:(Java as_String:(f asFilename directoryName , Filename separator asString)). |
|
7853 |
jDialog |
|
7854 |
perform:#'setVisible(Z)V' |
|
7855 |
with:0. |
|
7856 |
] ifFalse:[ |
|
7857 |
jDialogPeer |
|
7858 |
perform:#'handleCancel()V' |
|
7859 |
]. |
|
7860 |
"/ self halt. |
|
7861 |
||
7862 |
"Created: / 7.1.1998 / 22:38:45 / cg" |
|
7863 |
"Modified: / 15.1.1998 / 13:04:05 / cg" |
|
7864 |
! |
|
7865 |
||
440 | 7866 |
_WFontMetrics_bytesWidth:nativeContext |
7867 |
"/ int bytesWidth (byte[] int int) |
|
7868 |
UnimplementedNativeMethodSignal raise |
|
7869 |
||
7870 |
"Created: / 12.11.1998 / 19:11:46 / cg" |
|
7871 |
! |
|
7872 |
||
284 | 7873 |
_WFontMetrics_getMFCharSegmentWidth:nativeContext |
7874 |
"get multi-font string-segment width. |
|
7875 |
Not yet supported - use standard strings width" |
|
7876 |
||
7877 |
|jMetrics jFont jFontDescr stFont w |
|
7878 |
bool1 cp offs lenght bp int1| |
|
7879 |
||
7880 |
jMetrics := nativeContext receiver. |
|
7881 |
jFont := nativeContext argAt:1. |
|
7882 |
jFontDescr := nativeContext argAt:2. |
|
7883 |
bool1 := nativeContext argAt:3. |
|
7884 |
cp := nativeContext argAt:4. |
|
7885 |
offs := nativeContext argAt:5. |
|
7886 |
lenght := nativeContext argAt:6. |
|
7887 |
bp := nativeContext argAt:7. |
|
7888 |
int1 := nativeContext argAt:8. |
|
7889 |
||
7890 |
stFont := jFont instVarNamed:'pData'. |
|
7891 |
(stFont isNil or:[stFont == 0]) ifTrue:[ |
|
7892 |
self halt |
|
7893 |
]. |
|
7894 |
||
7895 |
stFont device isNil ifTrue:[ |
|
7896 |
stFont := stFont on:Display. |
|
7897 |
jFont instVarNamed:'pData' put:stFont. |
|
7898 |
]. |
|
7899 |
w := stFont widthOf:cp from:offs+1 to:offs+lenght. |
|
7900 |
^ w. |
|
7901 |
||
7902 |
"Created: / 5.1.1998 / 01:57:45 / cg" |
|
7903 |
"Modified: / 13.1.1998 / 23:44:03 / cg" |
|
7904 |
! |
|
7905 |
||
7906 |
_WFontMetrics_init:nativeContext |
|
7907 |
|jMetrics jFont stFont widths family name style size| |
|
7908 |
||
7909 |
jMetrics := nativeContext receiver. |
|
7910 |
jFont := jMetrics instVarNamed:'font'. |
|
7911 |
||
7912 |
family := jFont instVarNamed:'family'. |
|
7913 |
family := Java as_ST_String:family. |
|
7914 |
||
7915 |
name := jFont instVarNamed:'name'. |
|
7916 |
name := Java as_ST_String:name. |
|
7917 |
||
7918 |
style := jFont instVarNamed:'style'. |
|
7919 |
size := jFont instVarNamed:'size'. |
|
7920 |
||
7921 |
stFont := Font family:family size:size. |
|
7922 |
stFont isNil ifTrue:[ |
|
7923 |
stFont := Font family:'helvetica' size:size. |
|
7924 |
]. |
|
7925 |
stFont := stFont on:Display. |
|
7926 |
||
7927 |
"/ stFont := jFont instVarNamed:'pData'. |
|
7928 |
"/ stFont isNil ifTrue:[ |
|
7929 |
"/ self halt |
|
7930 |
"/ ]. |
|
7931 |
||
7932 |
stFont := stFont on:Display. |
|
7933 |
jFont instVarNamed:'pData' put:stFont. |
|
7934 |
||
7935 |
jMetrics instVarNamed:'ascent' put:stFont ascent. |
|
7936 |
jMetrics instVarNamed:'descent' put:stFont descent. |
|
7937 |
jMetrics instVarNamed:'leading' put:0. |
|
7938 |
jMetrics instVarNamed:'height' put:stFont height. |
|
7939 |
jMetrics instVarNamed:'maxAscent' put:stFont maxAscent. |
|
7940 |
jMetrics instVarNamed:'maxDescent' put:stFont maxDescent. |
|
7941 |
jMetrics instVarNamed:'maxHeight' put:stFont maxHeight. |
|
7942 |
jMetrics instVarNamed:'maxAdvance' put:stFont maxWidth. |
|
7943 |
||
7944 |
widths := Array new:256. |
|
7945 |
0 to:255 do:[:i | |
|
7946 |
widths at:(i+1) put:(stFont widthOf:(Character value:i)) |
|
7947 |
]. |
|
7948 |
jMetrics instVarNamed:'widths' put:widths. |
|
7949 |
"/ self halt. |
|
7950 |
||
7951 |
"Modified: / 8.8.1997 / 12:06:53 / cg" |
|
7952 |
"Created: / 5.1.1998 / 01:54:29 / cg" |
|
7953 |
! |
|
7954 |
||
7955 |
_WFontMetrics_needsConversion:nativeContext |
|
7956 |
|jFont jFontDescr stFont| |
|
7957 |
||
7958 |
jFont := nativeContext argAt:1. |
|
7959 |
jFontDescr := nativeContext argAt:2. |
|
7960 |
||
7961 |
stFont := jFont instVarNamed:'pData'. |
|
7962 |
"/ stFont isNil ifTrue:[ |
|
7963 |
"/ self halt |
|
7964 |
"/ ]. |
|
7965 |
"/ stFont device isNil ifTrue:[ |
|
7966 |
"/ stFont := stFont on:Display. |
|
7967 |
"/ jFont instVarNamed:'pData' put:stFont. |
|
7968 |
"/ ]. |
|
7969 |
"/ |
|
7970 |
||
7971 |
^ 0 |
|
7972 |
||
7973 |
"Modified: / 17.8.1997 / 17:16:29 / cg" |
|
7974 |
"Created: / 5.1.1998 / 01:56:42 / cg" |
|
7975 |
! |
|
7976 |
||
341 | 7977 |
_WFramePeer__setIconImage:nativeContext |
7978 |
|frame imgRep image| |
|
7979 |
||
7980 |
frame := self viewForWPeer:nativeContext. |
|
7981 |
imgRep := nativeContext argAt:1. |
|
7982 |
imgRep notNil ifTrue:[ |
|
7983 |
image := imgRep instVarNamed:'pData'. |
|
7984 |
image notNil ifTrue:[ |
|
7985 |
frame icon:image. |
|
7986 |
] |
|
7987 |
]. |
|
7988 |
||
7989 |
"Created: / 27.4.1998 / 17:15:09 / cg" |
|
7990 |
"Modified: / 27.4.1998 / 17:18:24 / cg" |
|
7991 |
! |
|
7992 |
||
284 | 7993 |
_WFramePeer_create:nativeContext |
474 | 7994 |
|jFramePeer jFrame top frame pDataIdx| |
284 | 7995 |
|
7996 |
jFramePeer := nativeContext receiver. |
|
7997 |
||
7998 |
"/ for now: a kludge to create an embedded frame for |
|
7999 |
"/ mozillaFrames |
|
8000 |
||
8001 |
jFrame := jFramePeer instVarNamed:'target'. |
|
8002 |
(jFrame notNil |
|
8003 |
and:[(pDataIdx := jFrame class instVarOffsetOf:'pData') notNil]) |
|
8004 |
ifTrue:[ |
|
8005 |
((frame := jFrame instVarAt:pDataIdx) notNil |
|
8006 |
and:[frame ~~ 0]) ifTrue:[ |
|
318 | 8007 |
WindowCreationTrace == true ifTrue:[ |
8008 |
'JAVA: targetFrame view already created: ' infoPrintCR. |
|
8009 |
]. |
|
284 | 8010 |
"/ sigh; pData was renamed to pNativeWidget in jdk1.2 ... |
8011 |
pDataIdx := jFramePeer class instVarOffsetOf:'pNativeWidget'. |
|
8012 |
pDataIdx isNil ifTrue:[ |
|
8013 |
"/ ok, we are < 1.2 |
|
8014 |
pDataIdx := jFramePeer class instVarOffsetOf:'pData'. |
|
8015 |
]. |
|
8016 |
jFramePeer instVarAt:pDataIdx put:frame. |
|
8017 |
] |
|
8018 |
] ifFalse:[ |
|
8019 |
frame := jFramePeer instVarNamed:'pData' |
|
8020 |
]. |
|
8021 |
||
8022 |
(frame notNil and:[frame ~~ 0]) ifTrue:[ |
|
318 | 8023 |
WindowCreationTrace == true ifTrue:[ |
8024 |
'JAVA: frame view already created: ' infoPrint. |
|
8025 |
jFramePeer class name infoPrintCR. |
|
8026 |
]. |
|
284 | 8027 |
] ifFalse:[ |
474 | 8028 |
"/ OLD |
8029 |
"/ frame := StandardSystemView new. |
|
8030 |
"/ self createdWindowsView:frame for:jFramePeer. |
|
8031 |
"/ JavaWindowGroup addTopView:frame. |
|
8032 |
||
8033 |
frame := JavaTopView new. |
|
8034 |
frame delegate:self. |
|
8035 |
frame javaPeer:jFramePeer. |
|
284 | 8036 |
self createdWindowsView:frame for:jFramePeer. |
8037 |
JavaWindowGroup addTopView:frame. |
|
474 | 8038 |
|
8039 |
"/ top := StandardSystemView new. |
|
8040 |
"/ frame := JavaView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
8041 |
"/ frame delegate:self. |
|
8042 |
"/ frame javaPeer:jFramePeer. |
|
8043 |
"/ self createdWindowsView:frame for:jFramePeer. |
|
8044 |
"/ JavaWindowGroup addTopView:top. |
|
8045 |
||
284 | 8046 |
]. |
8047 |
||
8048 |
WindowCreationTrace == true ifTrue:[ |
|
8049 |
'JAVA: WFramePeer_create: ' print. jFramePeer displayString print. |
|
8050 |
' frame: ' print. frame printNL. |
|
8051 |
]. |
|
8052 |
||
8053 |
"Created: / 4.1.1998 / 17:56:39 / cg" |
|
474 | 8054 |
"Modified: / 3.12.1998 / 00:10:21 / cg" |
284 | 8055 |
! |
8056 |
||
8057 |
_WFramePeer_setMenuBar0:nativeContext |
|
8058 |
|frame jMenuBarPeer menuPanel| |
|
8059 |
||
8060 |
frame := self viewForWPeer:nativeContext. |
|
8061 |
||
8062 |
jMenuBarPeer := nativeContext argAt:1. |
|
8063 |
jMenuBarPeer isNil ifTrue:[ |
|
8064 |
"/ mhmh - JAVA wants to remove the frames menuPanel. |
|
8065 |
"/ but I have no handle on it (for destroy). |
|
8066 |
"/ search it in subViews of the frame. |
|
8067 |
frame subViews copy do:[:v | |
|
8068 |
(v isKindOf:MenuPanel) ifTrue:[ |
|
8069 |
v destroy |
|
8070 |
] |
|
8071 |
] |
|
8072 |
] ifFalse:[ |
|
8073 |
menuPanel := jMenuBarPeer instVarNamed:'pData'. |
|
8074 |
||
8075 |
menuPanel origin:0.0@0.0 corner:1.0@(menuPanel preferredExtent y). |
|
8076 |
frame addSubView:menuPanel. |
|
8077 |
]. |
|
8078 |
^ nil |
|
8079 |
||
8080 |
"Created: / 7.1.1998 / 21:41:35 / cg" |
|
8081 |
"Modified: / 8.1.1998 / 17:35:04 / cg" |
|
8082 |
! |
|
8083 |
||
440 | 8084 |
_WGraphics__dispose:nativeContext |
8085 |
"/ void _dispose() |
|
8086 |
UnimplementedNativeMethodSignal raise |
|
8087 |
||
8088 |
"Created: / 12.11.1998 / 19:17:51 / cg" |
|
8089 |
! |
|
8090 |
||
284 | 8091 |
_WGraphics_changeClip:nativeContext |
391 | 8092 |
|gc x y w h r bool| |
284 | 8093 |
|
8094 |
gc := self gcForWGraphics:nativeContext. |
|
8095 |
||
8096 |
x := nativeContext argAt:1. |
|
8097 |
y := nativeContext argAt:2. |
|
8098 |
w := nativeContext argAt:3. |
|
8099 |
h := nativeContext argAt:4. |
|
8100 |
bool := (nativeContext argAt:5) ~~ 0. |
|
8101 |
||
391 | 8102 |
r := Rectangle left:x top:y width:w height:h. |
401 | 8103 |
"/ 'WGraphics_changeClip: ' infoPrint. r infoPrintCR. |
391 | 8104 |
gc clippingRectangle:r. |
284 | 8105 |
|
8106 |
"Created: / 6.1.1998 / 20:57:21 / cg" |
|
401 | 8107 |
"Modified: / 20.10.1998 / 19:40:10 / cg" |
284 | 8108 |
! |
8109 |
||
8110 |
_WGraphics_clearRect:nativeContext |
|
8111 |
|gc x y w h| |
|
8112 |
||
8113 |
gc := self gcForWGraphics:nativeContext. |
|
8114 |
"/ gc isNil ifTrue:[^ self]. |
|
8115 |
||
8116 |
gc realized ifFalse:[ |
|
8117 |
'JAVA: drawing on unrealized gc - ignored' infoPrintCR. |
|
8118 |
^ self |
|
8119 |
]. |
|
8120 |
||
8121 |
x := nativeContext argAt:1. |
|
8122 |
y := nativeContext argAt:2. |
|
8123 |
w := nativeContext argAt:3. |
|
8124 |
h := nativeContext argAt:4. |
|
8125 |
||
8126 |
"/ self halt. |
|
8127 |
"/ self internalError:'breakPoint'. |
|
8128 |
||
8129 |
gc clearRectangleX:x y:y width:w height:h. |
|
8130 |
||
8131 |
"Created: / 8.1.1998 / 00:16:00 / cg" |
|
8132 |
"Modified: / 8.1.1998 / 00:21:09 / cg" |
|
8133 |
! |
|
8134 |
||
440 | 8135 |
_WGraphics_close:nativeContext |
8136 |
"/ void close (sun.awt.windows.WPrintJob) |
|
8137 |
UnimplementedNativeMethodSignal raise |
|
8138 |
||
8139 |
"Created: / 12.11.1998 / 19:19:40 / cg" |
|
8140 |
! |
|
8141 |
||
337 | 8142 |
_WGraphics_copyArea:nativeContext |
8143 |
|gc srcX srcY w h deltaX deltaY| |
|
8144 |
||
8145 |
gc := self gcForWGraphics:nativeContext. |
|
8146 |
"/ gc isNil ifTrue:[^ self]. |
|
8147 |
||
8148 |
gc realized ifFalse:[ |
|
8149 |
'JAVA: copyArea on unrealized gc - ignored' infoPrintCR. |
|
8150 |
^ self |
|
8151 |
]. |
|
8152 |
||
8153 |
srcX := nativeContext argAt:1. |
|
8154 |
srcY := nativeContext argAt:2. |
|
8155 |
w := nativeContext argAt:3. |
|
8156 |
h := nativeContext argAt:4. |
|
8157 |
deltaX := nativeContext argAt:5. |
|
8158 |
deltaY := nativeContext argAt:6. |
|
8159 |
||
8160 |
gc |
|
8161 |
copyFrom:gc |
|
8162 |
x:srcX y:srcY |
|
8163 |
toX:srcX+deltaX y:srcY+deltaY |
|
8164 |
width:w height:h |
|
8165 |
||
8166 |
"Created: / 8.1.1998 / 00:16:00 / cg" |
|
8167 |
"Modified: / 9.4.1998 / 22:01:32 / cg" |
|
8168 |
! |
|
8169 |
||
284 | 8170 |
_WGraphics_createFromComponent:nativeContext |
8171 |
|jGraphics jWin view| |
|
8172 |
||
8173 |
jGraphics := nativeContext receiver. |
|
8174 |
jWin := nativeContext argAt:1. |
|
8175 |
||
8176 |
view := KnownWindows at:jWin ifAbsent:nil. |
|
8177 |
view isNil ifTrue:[ |
|
401 | 8178 |
self halt. |
8179 |
^ self |
|
8180 |
]. |
|
8181 |
view clippingRectangle:nil. |
|
284 | 8182 |
|
8183 |
"/ "/ just a consistency check ... |
|
8184 |
"/ (jWin instVarNamed:'xid') ~~ view ifTrue:[ |
|
8185 |
"/ self halt:'consistency check' |
|
8186 |
"/ ]. |
|
8187 |
||
8188 |
jGraphics instVarNamed:'pData' put:view. |
|
8189 |
||
8190 |
"Created: / 6.1.1998 / 20:55:18 / cg" |
|
401 | 8191 |
"Modified: / 20.10.1998 / 19:38:18 / cg" |
284 | 8192 |
! |
8193 |
||
8194 |
_WGraphics_createFromGraphics:nativeContext |
|
8195 |
|jGraphics graphics gc| |
|
8196 |
||
8197 |
jGraphics := nativeContext receiver. |
|
8198 |
graphics := nativeContext argAt:1. |
|
8199 |
gc := graphics instVarNamed:'pData'. |
|
8200 |
||
8201 |
jGraphics instVarNamed:'pData' put:gc. |
|
401 | 8202 |
gc clippingRectangle:nil. |
284 | 8203 |
|
8204 |
"Created: / 8.1.1998 / 00:47:39 / cg" |
|
401 | 8205 |
"Modified: / 20.10.1998 / 19:37:58 / cg" |
284 | 8206 |
! |
8207 |
||
440 | 8208 |
_WGraphics_createFromHDC:nativeContext |
8209 |
"/ void createFromHDC (int) |
|
8210 |
UnimplementedNativeMethodSignal raise |
|
8211 |
||
8212 |
"Created: / 12.11.1998 / 19:17:32 / cg" |
|
8213 |
! |
|
8214 |
||
8215 |
_WGraphics_createFromPrintJob:nativeContext |
|
8216 |
"/ void createFromPrintJob (sun.awt.windows.WPrintJob) |
|
8217 |
UnimplementedNativeMethodSignal raise |
|
8218 |
||
8219 |
"Created: / 12.11.1998 / 19:17:20 / cg" |
|
8220 |
! |
|
8221 |
||
284 | 8222 |
_WGraphics_dispose:nativeContext |
8223 |
|gc| |
|
8224 |
||
8225 |
gc := self gcForWGraphics:nativeContext. |
|
8226 |
gc isNil ifTrue:[^ self]. |
|
401 | 8227 |
gc clippingRectangle:nil. |
284 | 8228 |
|
8229 |
"Created: / 6.1.1998 / 20:58:38 / cg" |
|
401 | 8230 |
"Modified: / 20.10.1998 / 19:35:05 / cg" |
284 | 8231 |
! |
8232 |
||
8233 |
_WGraphics_drawArc:nativeContext |
|
8234 |
|gc x y w h startAngle endAngle| |
|
8235 |
||
8236 |
gc := self gcForWGraphics:nativeContext. |
|
8237 |
"/ gc isNil ifTrue:[^ self]. |
|
8238 |
gc realized ifFalse:[^ self]. |
|
8239 |
||
8240 |
x := nativeContext argAt:1. |
|
8241 |
y := nativeContext argAt:2. |
|
8242 |
w := nativeContext argAt:3. |
|
8243 |
h := nativeContext argAt:4. |
|
8244 |
startAngle := nativeContext argAt:5. |
|
8245 |
endAngle := nativeContext argAt:6. |
|
8246 |
||
8247 |
DrawOPTrace ifTrue:[ |
|
285 | 8248 |
'drawArc x/y= ' print. x print. '@' print. y print. |
8249 |
' w/h= ' print. w print. '@' print. h print. |
|
8250 |
' startAngle= ' print. startAngle print. ' endAngle= ' print. endAngle printCR. |
|
8251 |
]. |
|
8252 |
gc |
|
8253 |
displayArcX:x y:y |
|
8254 |
width:w height:h |
|
8255 |
from:startAngle angle:(endAngle - startAngle). |
|
284 | 8256 |
|
8257 |
"Created: / 6.1.1998 / 21:00:15 / cg" |
|
285 | 8258 |
"Modified: / 28.1.1998 / 23:23:42 / cg" |
284 | 8259 |
! |
8260 |
||
440 | 8261 |
_WGraphics_drawBytes:nativeContext |
8262 |
"/ void drawBytes (byte[] int int int int) |
|
8263 |
UnimplementedNativeMethodSignal raise |
|
8264 |
||
8265 |
"Created: / 12.11.1998 / 19:18:56 / cg" |
|
8266 |
! |
|
8267 |
||
284 | 8268 |
_WGraphics_drawLine:nativeContext |
8269 |
|gc x y x2 y2| |
|
8270 |
||
8271 |
gc := self gcForWGraphics:nativeContext. |
|
8272 |
"/ gc isNil ifTrue:[^ self]. |
|
8273 |
gc realized ifFalse:[^ self]. |
|
8274 |
||
8275 |
x := nativeContext argAt:1. |
|
8276 |
y := nativeContext argAt:2. |
|
8277 |
x2 := nativeContext argAt:3. |
|
8278 |
y2 := nativeContext argAt:4. |
|
8279 |
||
8280 |
DrawOPTrace ifTrue:[ |
|
8281 |
'drawLine x/y= ' print. x print. '@' print. y print. ' x2/y2= ' print. x2 print. '@' print. y2 printCR. |
|
8282 |
]. |
|
8283 |
gc displayLineFromX:x y:y toX:x2 y:y2 |
|
8284 |
||
8285 |
"Created: / 6.1.1998 / 20:59:27 / cg" |
|
8286 |
"Modified: / 8.1.1998 / 00:34:23 / cg" |
|
8287 |
! |
|
8288 |
||
440 | 8289 |
_WGraphics_drawMFCharsConvertedSegment:nativeContext |
8290 |
"/ int drawMFCharsConvertedSegment (java.awt.Font sun.awt.FontDescriptor byte[] int int int) |
|
8291 |
UnimplementedNativeMethodSignal raise |
|
8292 |
||
8293 |
"Created: / 12.11.1998 / 19:18:44 / cg" |
|
8294 |
! |
|
8295 |
||
284 | 8296 |
_WGraphics_drawMFCharsSegment:nativeContext |
8297 |
|jFont jFontDescr s gc x y offs len| |
|
8298 |
||
8299 |
gc := self gcForWGraphics:nativeContext. |
|
8300 |
gc realized ifFalse:[^ self]. |
|
8301 |
||
8302 |
jFont := nativeContext argAt:1. |
|
8303 |
jFontDescr := nativeContext argAt:2. |
|
8304 |
s := nativeContext argAt:3. |
|
8305 |
offs := nativeContext argAt:4. |
|
8306 |
len := nativeContext argAt:5. |
|
8307 |
x := nativeContext argAt:6. |
|
8308 |
y := nativeContext argAt:7. |
|
8309 |
||
8310 |
DrawOPTrace ifTrue:[ |
|
8311 |
'drawMFCharsSegment x/y= ' print. x print. '@' print. y print. ' s= ' print. s printCR. |
|
8312 |
]. |
|
8313 |
gc displayString:s from:offs+1 to:offs+len x:x y:y. |
|
8314 |
^ (gc font onDevice:(gc graphicsDevice)) widthOf:s. |
|
8315 |
||
8316 |
"Created: / 6.1.1998 / 21:01:07 / cg" |
|
8317 |
"Modified: / 25.1.1998 / 20:45:55 / cg" |
|
8318 |
! |
|
8319 |
||
8320 |
_WGraphics_drawOval:nativeContext |
|
8321 |
|gc x y w h| |
|
8322 |
||
8323 |
gc := self gcForWGraphics:nativeContext. |
|
8324 |
"/ gc isNil ifTrue:[^ self]. |
|
8325 |
gc realized ifFalse:[^ self]. |
|
8326 |
||
8327 |
x := nativeContext argAt:1. |
|
8328 |
y := nativeContext argAt:2. |
|
8329 |
w := nativeContext argAt:3. |
|
8330 |
h := nativeContext argAt:4. |
|
8331 |
||
337 | 8332 |
DrawOPTrace ifTrue:[ |
285 | 8333 |
'drawOval x/y= ' print. x print. '@' print. y print. |
8334 |
' w/h= ' print. w print. '@' print. h printCR. |
|
8335 |
]. |
|
8336 |
gc displayArcX:x y:y width:w height:h from:0 angle:360. |
|
284 | 8337 |
|
8338 |
"Created: / 8.1.1998 / 00:44:31 / cg" |
|
337 | 8339 |
"Modified: / 9.4.1998 / 22:10:23 / cg" |
284 | 8340 |
! |
8341 |
||
8342 |
_WGraphics_drawPolygon:nativeContext |
|
8343 |
|gc xVector yVector count points| |
|
8344 |
||
8345 |
gc := self gcForWGraphics:nativeContext. |
|
8346 |
"/ gc isNil ifTrue:[^ self]. |
|
8347 |
gc realized ifFalse:[^ self]. |
|
8348 |
||
8349 |
xVector := nativeContext argAt:1. |
|
8350 |
yVector := nativeContext argAt:2. |
|
8351 |
count := nativeContext argAt:3. |
|
8352 |
||
8353 |
DrawOPTrace ifTrue:[ |
|
8354 |
'drawPolgon' printCR. |
|
8355 |
]. |
|
8356 |
||
8357 |
points := (1 to:count) collect:[:i | (xVector at:i) @ (yVector at:i)]. |
|
8358 |
gc displayPolygon:points |
|
8359 |
||
8360 |
"Created: / 8.1.1998 / 00:57:28 / cg" |
|
8361 |
"Modified: / 8.1.1998 / 00:57:49 / cg" |
|
8362 |
! |
|
8363 |
||
440 | 8364 |
_WGraphics_drawPolyline:nativeContext |
8365 |
"/ void drawPolyline (int[] int[] int) |
|
8366 |
UnimplementedNativeMethodSignal raise |
|
8367 |
||
8368 |
"Created: / 12.11.1998 / 19:19:07 / cg" |
|
8369 |
! |
|
8370 |
||
284 | 8371 |
_WGraphics_drawRect:nativeContext |
8372 |
|gc x y w h| |
|
8373 |
||
8374 |
gc := self gcForWGraphics:nativeContext. |
|
8375 |
"/ gc isNil ifTrue:[^ self]. |
|
8376 |
gc realized ifFalse:[^ self]. |
|
8377 |
||
8378 |
x := nativeContext argAt:1. |
|
8379 |
y := nativeContext argAt:2. |
|
8380 |
w := nativeContext argAt:3. |
|
8381 |
h := nativeContext argAt:4. |
|
8382 |
||
8383 |
"/ self halt. |
|
8384 |
"/ self internalError:'breakPoint'. |
|
8385 |
||
8386 |
gc displayRectangleX:x y:y width:w height:h. |
|
8387 |
||
8388 |
"Modified: / 8.1.1998 / 00:34:33 / cg" |
|
8389 |
"Created: / 8.1.1998 / 00:59:05 / cg" |
|
8390 |
! |
|
8391 |
||
8392 |
_WGraphics_drawRoundRect:nativeContext |
|
8393 |
|gc x y w h| |
|
8394 |
||
8395 |
gc := self gcForWGraphics:nativeContext. |
|
8396 |
"/ gc isNil ifTrue:[^ self]. |
|
8397 |
gc realized ifFalse:[^ self]. |
|
8398 |
||
8399 |
x := nativeContext argAt:1. |
|
8400 |
y := nativeContext argAt:2. |
|
8401 |
w := nativeContext argAt:3. |
|
8402 |
h := nativeContext argAt:4. |
|
8403 |
||
8404 |
"/ self halt. |
|
8405 |
"/ self internalError:'breakPoint'. |
|
8406 |
||
8407 |
gc displayRectangleX:x y:y width:w height:h. |
|
8408 |
||
8409 |
"Modified: / 8.1.1998 / 00:34:33 / cg" |
|
8410 |
"Created: / 8.1.1998 / 00:59:26 / cg" |
|
8411 |
! |
|
8412 |
||
440 | 8413 |
_WGraphics_drawSFChars:nativeContext |
8414 |
"/ void drawSFChars (char[] int int int int) |
|
8415 |
UnimplementedNativeMethodSignal raise |
|
8416 |
||
8417 |
"Created: / 12.11.1998 / 19:18:20 / cg" |
|
8418 |
! |
|
8419 |
||
284 | 8420 |
_WGraphics_fillArc:nativeContext |
8421 |
|gc x y w h startAngle endAngle| |
|
8422 |
||
8423 |
gc := self gcForWGraphics:nativeContext. |
|
8424 |
"/ gc isNil ifTrue:[^ self]. |
|
8425 |
gc realized ifFalse:[^ self]. |
|
8426 |
||
8427 |
x := nativeContext argAt:1. |
|
8428 |
y := nativeContext argAt:2. |
|
8429 |
w := nativeContext argAt:3. |
|
8430 |
h := nativeContext argAt:4. |
|
8431 |
startAngle := nativeContext argAt:5. |
|
8432 |
endAngle := nativeContext argAt:6. |
|
8433 |
||
8434 |
DrawOPTrace ifTrue:[ |
|
8435 |
'fillArc x/y= ' print. x print. '@' print. y print. |
|
8436 |
' w/h= ' print. w print. '@' print. h print. |
|
8437 |
' startAngle= ' print. startAngle print. ' endAngle= ' print. endAngle printCR. |
|
8438 |
]. |
|
8439 |
gc fillArcX:x y:y width:w height:h from:startAngle angle:(endAngle - startAngle) |
|
8440 |
||
8441 |
"Created: / 6.1.1998 / 21:11:31 / cg" |
|
8442 |
"Modified: / 8.1.1998 / 00:33:59 / cg" |
|
8443 |
! |
|
8444 |
||
8445 |
_WGraphics_fillOval:nativeContext |
|
8446 |
|gc x y w h| |
|
8447 |
||
8448 |
gc := self gcForWGraphics:nativeContext. |
|
8449 |
"/ gc isNil ifTrue:[^ self]. |
|
8450 |
gc realized ifFalse:[^ self]. |
|
8451 |
||
8452 |
x := nativeContext argAt:1. |
|
8453 |
y := nativeContext argAt:2. |
|
8454 |
w := nativeContext argAt:3. |
|
8455 |
h := nativeContext argAt:4. |
|
8456 |
||
8457 |
DrawOPTrace ifTrue:[ |
|
8458 |
'drawOval x/y= ' print. x print. '@' print. y print. |
|
8459 |
' w/h= ' print. w print. '@' print. h printCR. |
|
8460 |
]. |
|
8461 |
gc fillArcX:x y:y width:w height:h from:0 angle:360 |
|
8462 |
||
8463 |
"Created: / 8.1.1998 / 00:46:00 / cg" |
|
8464 |
"Modified: / 8.1.1998 / 00:46:20 / cg" |
|
8465 |
! |
|
8466 |
||
8467 |
_WGraphics_fillPolygon:nativeContext |
|
8468 |
|gc xVector yVector count points| |
|
8469 |
||
8470 |
gc := self gcForWGraphics:nativeContext. |
|
8471 |
"/ gc isNil ifTrue:[^ self]. |
|
8472 |
gc realized ifFalse:[^ self]. |
|
8473 |
||
8474 |
xVector := nativeContext argAt:1. |
|
8475 |
yVector := nativeContext argAt:2. |
|
8476 |
count := nativeContext argAt:3. |
|
8477 |
||
8478 |
DrawOPTrace ifTrue:[ |
|
8479 |
'fillPolgon' printCR. |
|
8480 |
]. |
|
8481 |
||
8482 |
points := (1 to:count-1) collect:[:i | (xVector at:i) @ (yVector at:i)]. |
|
8483 |
gc fillPolygon:points |
|
8484 |
||
8485 |
"Created: / 8.1.1998 / 00:58:09 / cg" |
|
8486 |
"Modified: / 25.1.1998 / 11:03:19 / cg" |
|
8487 |
! |
|
8488 |
||
8489 |
_WGraphics_fillRect:nativeContext |
|
8490 |
|gc x y w h| |
|
8491 |
||
8492 |
gc := self gcForWGraphics:nativeContext. |
|
8493 |
"/ gc isNil ifTrue:[^ self]. |
|
8494 |
gc realized ifFalse:[^ self]. |
|
8495 |
||
8496 |
x := nativeContext argAt:1. |
|
8497 |
y := nativeContext argAt:2. |
|
8498 |
w := nativeContext argAt:3. |
|
8499 |
h := nativeContext argAt:4. |
|
8500 |
||
8501 |
"/ self halt. |
|
8502 |
"/ self internalError:'breakPoint'. |
|
8503 |
||
8504 |
gc fillRectangleX:x y:y width:w height:h. |
|
8505 |
||
8506 |
"Created: / 15.8.1997 / 15:43:10 / cg" |
|
8507 |
"Modified: / 8.1.1998 / 00:34:33 / cg" |
|
8508 |
! |
|
8509 |
||
8510 |
_WGraphics_fillRoundRect:nativeContext |
|
8511 |
|gc x y w h| |
|
8512 |
||
8513 |
gc := self gcForWGraphics:nativeContext. |
|
8514 |
"/ gc isNil ifTrue:[^ self]. |
|
8515 |
gc realized ifFalse:[^ self]. |
|
8516 |
||
8517 |
x := nativeContext argAt:1. |
|
8518 |
y := nativeContext argAt:2. |
|
8519 |
w := nativeContext argAt:3. |
|
8520 |
h := nativeContext argAt:4. |
|
8521 |
||
8522 |
"/ self halt. |
|
8523 |
"/ self internalError:'breakPoint'. |
|
8524 |
||
8525 |
gc displayRectangleX:x y:y width:w height:h. |
|
8526 |
||
8527 |
"Modified: / 8.1.1998 / 00:34:33 / cg" |
|
8528 |
"Created: / 8.1.1998 / 00:59:36 / cg" |
|
8529 |
! |
|
8530 |
||
8531 |
_WGraphics_getClipBounds:nativeContext |
|
8532 |
|gc rect r x y w h| |
|
8533 |
||
8534 |
gc := self gcForWGraphics:nativeContext. |
|
391 | 8535 |
"/ gc isNil ifTrue:[^ nil]. |
284 | 8536 |
|
8537 |
rect := (Java classForName:'java.awt.Rectangle') basicNew. |
|
8538 |
||
8539 |
(gc isMemberOf:JavaView) ifTrue:[ |
|
391 | 8540 |
"/ r := gc clippingRectangleOrNil. |
8541 |
r := gc getNextUpdateRectangle. |
|
401 | 8542 |
]. |
8543 |
r isNil ifTrue:[ |
|
8544 |
r := gc clippingRectangleOrNil. |
|
8545 |
]. |
|
8546 |
||
8547 |
r isNil ifTrue:[ |
|
391 | 8548 |
x := y := 0. |
8549 |
w := (gc width). |
|
8550 |
h := (gc height). |
|
401 | 8551 |
] ifFalse:[ |
8552 |
x := (r left). |
|
8553 |
y := (r top). |
|
8554 |
w := (r width). |
|
8555 |
h := (r height). |
|
284 | 8556 |
]. |
8557 |
rect instVarNamed:'x' put:x. |
|
8558 |
rect instVarNamed:'y' put:y. |
|
8559 |
rect instVarNamed:'width' put:w. |
|
8560 |
rect instVarNamed:'height' put:h. |
|
8561 |
||
401 | 8562 |
'WGraphics__getClipBounds ' infoPrint. (x@y extent:w@h) infoPrintCR. |
284 | 8563 |
"/ self halt. |
8564 |
||
8565 |
^ rect |
|
8566 |
||
8567 |
"Created: / 6.1.1998 / 20:58:07 / cg" |
|
401 | 8568 |
"Modified: / 20.10.1998 / 19:26:34 / cg" |
284 | 8569 |
! |
8570 |
||
8571 |
_WGraphics_imageCreate:nativeContext |
|
8572 |
|jGraphics imgRep| |
|
8573 |
||
8574 |
jGraphics := nativeContext receiver. |
|
8575 |
imgRep := nativeContext argAt:1. |
|
8576 |
||
8577 |
jGraphics instVarNamed:'pData' put:(imgRep instVarNamed:'pData'). |
|
8578 |
"/ self halt. |
|
8579 |
||
8580 |
"Created: / 11.1.1998 / 16:34:30 / cg" |
|
8581 |
"Modified: / 17.1.1998 / 12:37:18 / cg" |
|
8582 |
! |
|
8583 |
||
8584 |
_WGraphics_pSetFont:nativeContext |
|
8585 |
|gc jFont stFont| |
|
8586 |
||
8587 |
gc := self gcForWGraphics:nativeContext. |
|
8588 |
jFont := nativeContext argAt:1. |
|
8589 |
||
8590 |
stFont := jFont instVarNamed:'pData'. |
|
8591 |
(stFont isNil or:[stFont == 0]) ifTrue:[ |
|
8592 |
"/ self halt. |
|
8593 |
] ifFalse:[ |
|
8594 |
gc font:stFont |
|
8595 |
]. |
|
8596 |
||
8597 |
"Created: / 6.1.1998 / 20:56:47 / cg" |
|
8598 |
"Modified: / 15.1.1998 / 12:31:20 / cg" |
|
8599 |
! |
|
8600 |
||
8601 |
_WGraphics_pSetForeground:nativeContext |
|
8602 |
|gc rgb clr| |
|
8603 |
||
8604 |
gc := self gcForWGraphics:nativeContext. |
|
8605 |
||
8606 |
rgb := nativeContext argAt:1. |
|
8607 |
||
8608 |
clr := Color rgbValue:rgb. |
|
8609 |
gc paint:clr. |
|
8610 |
||
8611 |
"/ self halt. |
|
8612 |
"/ self internalError:'breakPoint'. |
|
8613 |
||
8614 |
"Created: / 6.1.1998 / 20:56:14 / cg" |
|
8615 |
"Modified: / 8.1.1998 / 00:34:51 / cg" |
|
8616 |
! |
|
8617 |
||
440 | 8618 |
_WGraphics_print:nativeContext |
8619 |
"/ void print (sun.awt.windows.WComponentPeer) |
|
8620 |
UnimplementedNativeMethodSignal raise |
|
8621 |
||
8622 |
"Created: / 12.11.1998 / 19:19:25 / cg" |
|
8623 |
! |
|
8624 |
||
8625 |
_WGraphics_removeClip:nativeContext |
|
8626 |
"/ void removeClip () |
|
8627 |
UnimplementedNativeMethodSignal raise |
|
8628 |
||
8629 |
"Created: / 12.11.1998 / 19:18:05 / cg" |
|
8630 |
! |
|
8631 |
||
284 | 8632 |
_WGraphics_setPaintMode:nativeContext |
8633 |
|gc| |
|
8634 |
||
8635 |
gc := self gcForWGraphics:nativeContext. |
|
8636 |
gc function:#copy. |
|
285 | 8637 |
|
8638 |
true "DrawOPTrace" ifTrue:[ |
|
8639 |
'copyMode' infoPrintCR. |
|
8640 |
]. |
|
284 | 8641 |
|
8642 |
"Created: / 8.1.1998 / 00:33:44 / cg" |
|
285 | 8643 |
"Modified: / 28.1.1998 / 23:25:56 / cg" |
284 | 8644 |
! |
8645 |
||
8646 |
_WGraphics_setXORMode:nativeContext |
|
8647 |
|gc jColor rgb invColor device| |
|
8648 |
||
8649 |
gc := self gcForWGraphics:nativeContext. |
|
8650 |
jColor := nativeContext argAt:1. |
|
8651 |
device := gc graphicsDevice. |
|
285 | 8652 |
|
8653 |
"/ "/ on trueColor systems, use the provided |
|
8654 |
"/ "/ rgb value for inverting. |
|
8655 |
"/ "/ on palette systems, use white ^ black |
|
8656 |
"/ |
|
8657 |
"/ device visualType == #TrueColor ifTrue:[ |
|
8658 |
"/ rgb := jColor instVarNamed:'value'. |
|
8659 |
"/ rgb := rgb bitAnd:16rFFFFFF. |
|
8660 |
"/ rgb == 0 ifTrue:[ |
|
8661 |
"/ rgb := 16rFFFFFF. |
|
8662 |
"/ ]. |
|
8663 |
"/ invColor := rgb |
|
8664 |
"/ ] ifFalse:[ |
|
8665 |
"/ invColor := device blackpixel bitXor:device whitepixel. |
|
8666 |
"/ ]. |
|
8667 |
||
8668 |
invColor := device blackpixel bitXor:device whitepixel. |
|
8669 |
||
8670 |
"/ gc foreground:(Color colorId:invColor) |
|
8671 |
"/ background:device blackColor. |
|
8672 |
device |
|
8673 |
setForeground:invColor background:0 |
|
8674 |
in:gc gcId. |
|
284 | 8675 |
gc function:#xor. |
285 | 8676 |
|
8677 |
true "DrawOPTrace" ifTrue:[ |
|
8678 |
'xorMode' infoPrintCR. |
|
8679 |
]. |
|
284 | 8680 |
|
8681 |
"Created: / 8.1.1998 / 00:36:17 / cg" |
|
285 | 8682 |
"Modified: / 28.1.1998 / 23:45:03 / cg" |
284 | 8683 |
! |
8684 |
||
8685 |
_WLabelPeer_create:nativeContext |
|
8686 |
|jLabelPeer jLabel jFrame frame label |
|
8687 |
lbl| |
|
8688 |
||
8689 |
jLabelPeer := nativeContext receiver. |
|
8690 |
jLabel := jLabelPeer instVarNamed:'target'. |
|
8691 |
||
8692 |
lbl := jLabel instVarNamed:'text'. |
|
8693 |
lbl notNil ifTrue:[ |
|
8694 |
lbl := Java as_ST_String:lbl |
|
8695 |
]. |
|
8696 |
||
8697 |
jFrame := nativeContext argAt:1. |
|
8698 |
frame := jFrame instVarNamed:'pData'. |
|
8699 |
||
8700 |
label := Label in:frame. |
|
8701 |
lbl notNil ifTrue:[ |
|
8702 |
label label:lbl |
|
8703 |
]. |
|
8704 |
self createdWindowsView:label for:jLabelPeer. |
|
8705 |
||
8706 |
WindowCreationTrace == true ifTrue:[ |
|
8707 |
'WLabelPeer_create: ' print. frame print. ' -> ' print. label printNL. |
|
8708 |
]. |
|
8709 |
||
8710 |
"Created: / 7.1.1998 / 21:42:31 / cg" |
|
8711 |
"Modified: / 13.1.1998 / 22:10:47 / cg" |
|
8712 |
! |
|
8713 |
||
8714 |
_WLabelPeer_setAlignment:nativeContext |
|
8715 |
|label alignNr| |
|
8716 |
||
8717 |
alignNr := nativeContext argAt:1. |
|
8718 |
label := self viewForWPeer:nativeContext. |
|
8719 |
label notNil ifTrue:[ |
|
8720 |
]. |
|
8721 |
||
8722 |
"Created: / 7.1.1998 / 21:43:12 / cg" |
|
8723 |
"Modified: / 8.1.1998 / 17:35:29 / cg" |
|
8724 |
! |
|
8725 |
||
8726 |
_WLabelPeer_setText:nativeContext |
|
479 | 8727 |
|label jString str| |
284 | 8728 |
|
8729 |
jString := nativeContext argAt:1. |
|
8730 |
||
8731 |
label := self viewForWPeer:nativeContext. |
|
479 | 8732 |
str := jString. |
8733 |
str notNil ifTrue:[ |
|
8734 |
str := Java as_ST_String:str |
|
8735 |
]. |
|
8736 |
label label:str |
|
284 | 8737 |
|
8738 |
"Created: / 7.1.1998 / 21:43:51 / cg" |
|
479 | 8739 |
"Modified: / 3.12.1998 / 14:59:18 / cg" |
284 | 8740 |
! |
8741 |
||
408 | 8742 |
_WListPeer__addItem:nativeContext |
448 | 8743 |
|jString index1 length selListView m| |
408 | 8744 |
|
8745 |
selListView := self viewForWPeer:nativeContext. |
|
8746 |
||
8747 |
jString := nativeContext argAt:1. |
|
8748 |
index1 := nativeContext argAt:2. |
|
8749 |
length := nativeContext argAt:3. |
|
8750 |
||
448 | 8751 |
(m := selListView model) notNil ifTrue:[ |
8752 |
m list addLast:(Java as_ST_String:jString). |
|
8753 |
m changed:#list. |
|
8754 |
]. |
|
408 | 8755 |
|
8756 |
"Created: / 26.10.1998 / 20:11:30 / cg" |
|
448 | 8757 |
"Modified: / 14.11.1998 / 01:21:03 / cg" |
408 | 8758 |
! |
8759 |
||
284 | 8760 |
_WListPeer_addItem:nativeContext |
410 | 8761 |
|jString index selListView m| |
284 | 8762 |
|
8763 |
selListView := self viewForWPeer:nativeContext. |
|
8764 |
||
8765 |
jString := nativeContext argAt:1. |
|
8766 |
index := nativeContext argAt:2. |
|
8767 |
||
410 | 8768 |
m := selListView model. |
8769 |
m isNil ifTrue:[ |
|
8770 |
Transcript showCR:'JAVA: access to listModel of closed view'. |
|
8771 |
] ifFalse:[ |
|
8772 |
m list addLast:(Java as_ST_String:jString). |
|
8773 |
m changed:#list. |
|
8774 |
] |
|
8775 |
||
284 | 8776 |
"Created: / 24.1.1998 / 21:10:05 / cg" |
410 | 8777 |
"Modified: / 2.11.1998 / 17:12:52 / cg" |
284 | 8778 |
! |
8779 |
||
8780 |
_WListPeer_create:nativeContext |
|
8781 |
|jListPeer jFrame frame selectionInListView| |
|
8782 |
||
8783 |
jListPeer := nativeContext receiver. |
|
8784 |
||
8785 |
jFrame := nativeContext argAt:1. |
|
8786 |
frame := jFrame instVarNamed:'pData'. |
|
8787 |
||
8788 |
selectionInListView := ScrollableView for:SelectionInListView in:frame. |
|
8789 |
selectionInListView action:[:index | jListPeer perform:#'handleListChanged(I)V' with:(index - 1)]. |
|
8790 |
selectionInListView doubleClickAction:[:index | jListPeer perform:#'handleAction(I)V' with:(index - 1)]. |
|
337 | 8791 |
selectionInListView model:(SelectionInList new list:(List new)). |
284 | 8792 |
selectionInListView useIndex:true. |
8793 |
||
8794 |
self createdWindowsView:selectionInListView for:jListPeer. |
|
8795 |
||
8796 |
WindowCreationTrace == true ifTrue:[ |
|
8797 |
'WTextAreaPeer_create: ' print. frame print. ' -> ' print. selectionInListView printNL. |
|
8798 |
]. |
|
8799 |
||
8800 |
"Created: / 24.1.1998 / 19:58:54 / cg" |
|
337 | 8801 |
"Modified: / 9.4.1998 / 22:19:07 / cg" |
8802 |
! |
|
8803 |
||
8804 |
_WListPeer_delItems:nativeContext |
|
8805 |
|jString index1 index2 selListView| |
|
8806 |
||
8807 |
selListView := self viewForWPeer:nativeContext. |
|
8808 |
||
8809 |
index1 := nativeContext argAt:1. |
|
8810 |
index2 := nativeContext argAt:2. |
|
8811 |
||
8812 |
selListView model list removeFromIndex:(index1+1) toIndex:(index2+1). |
|
8813 |
selListView model changed:#list. |
|
8814 |
||
8815 |
"Created: / 9.4.1998 / 22:19:25 / cg" |
|
8816 |
"Modified: / 9.4.1998 / 22:20:08 / cg" |
|
284 | 8817 |
! |
8818 |
||
440 | 8819 |
_WListPeer_deselect:nativeContext |
8820 |
"/ void deselect (int) |
|
8821 |
UnimplementedNativeMethodSignal raise |
|
8822 |
||
8823 |
"Created: / 12.11.1998 / 19:15:10 / cg" |
|
8824 |
! |
|
8825 |
||
448 | 8826 |
_WListPeer_getMaxWidth:nativeContext |
8827 |
"/ int getMaxWidth () |
|
8828 |
UnimplementedNativeMethodSignal raise |
|
8829 |
||
8830 |
"Created: / 14.11.1998 / 10:44:29 / cg" |
|
8831 |
! |
|
8832 |
||
284 | 8833 |
_WListPeer_isSelected:nativeContext |
8834 |
|selectionInListView index model| |
|
8835 |
||
8836 |
selectionInListView := self viewForWPeer:nativeContext. |
|
8837 |
||
8838 |
index := nativeContext argAt:1. |
|
8839 |
(model := selectionInListView model) notNil ifTrue:[ |
|
8840 |
(model selectionIndex == (index + 1)) "/ JAVA indexing starts at 0 |
|
8841 |
ifTrue:[ |
|
8842 |
^ 1 |
|
8843 |
] |
|
8844 |
]. |
|
8845 |
^ 0. |
|
8846 |
||
8847 |
"Created: / 24.1.1998 / 22:42:31 / cg" |
|
8848 |
"Modified: / 25.1.1998 / 01:35:32 / cg" |
|
8849 |
! |
|
8850 |
||
396 | 8851 |
_WListPeer_makeVisible:nativeContext |
8852 |
|selectionInListView lineNr| |
|
8853 |
||
8854 |
selectionInListView := self viewForWPeer:nativeContext. |
|
8855 |
||
8856 |
lineNr := nativeContext argAt:1. |
|
8857 |
||
8858 |
selectionInListView makeLineVisible:(lineNr + 1) |
|
8859 |
||
8860 |
"Modified: / 24.1.1998 / 20:01:06 / cg" |
|
8861 |
"Created: / 20.10.1998 / 14:14:50 / cg" |
|
8862 |
! |
|
8863 |
||
284 | 8864 |
_WListPeer_select:nativeContext |
8865 |
|selectionInListView index model| |
|
8866 |
||
8867 |
selectionInListView := self viewForWPeer:nativeContext. |
|
8868 |
||
8869 |
index := nativeContext argAt:1. |
|
8870 |
(model := selectionInListView model) notNil ifTrue:[ |
|
8871 |
model selectionIndex:(index + 1). "/ JAVA indexing starts at 0 |
|
8872 |
] |
|
8873 |
||
8874 |
"Created: / 24.1.1998 / 22:32:35 / cg" |
|
8875 |
"Modified: / 25.1.1998 / 01:28:46 / cg" |
|
8876 |
! |
|
8877 |
||
8878 |
_WListPeer_setMultipleSelections:nativeContext |
|
8879 |
|selectionInListView onOff| |
|
8880 |
||
8881 |
selectionInListView := self viewForWPeer:nativeContext. |
|
8882 |
||
8883 |
onOff := (nativeContext argAt:1) ~~ 0. |
|
8884 |
||
8885 |
selectionInListView multipleSelectOk:onOff. |
|
8886 |
||
8887 |
"Modified: / 24.1.1998 / 20:01:06 / cg" |
|
8888 |
! |
|
8889 |
||
408 | 8890 |
_WListPeer_updateMaxItemWidth:nativeContext |
8891 |
|selectionInListView lineNr| |
|
8892 |
||
8893 |
selectionInListView := self viewForWPeer:nativeContext. |
|
8894 |
||
8895 |
"Created: / 26.10.1998 / 20:09:46 / cg" |
|
8896 |
! |
|
8897 |
||
440 | 8898 |
_WMenuBarPeer_addMenu:nativeContext |
8899 |
"/ void addMenu (java.awt.Menu) |
|
8900 |
UnimplementedNativeMethodSignal raise |
|
8901 |
||
8902 |
"Created: / 12.11.1998 / 19:14:00 / cg" |
|
8903 |
! |
|
8904 |
||
284 | 8905 |
_WMenuBarPeer_create:nativeContext |
8906 |
|jMenuBarPeer jMenuBar jFrame frame menuBar| |
|
8907 |
||
8908 |
jMenuBarPeer := nativeContext receiver. |
|
8909 |
jMenuBar := jMenuBarPeer instVarNamed:'target'. |
|
8910 |
||
8911 |
jFrame := nativeContext argAt:1. |
|
8912 |
frame := jFrame instVarNamed:'pData'. |
|
8913 |
||
8914 |
menuBar := MenuPanel in:frame. |
|
8915 |
menuBar verticalLayout:false. |
|
8916 |
menuBar realize. |
|
8917 |
||
8918 |
self createdWindowsView:menuBar for:jMenuBarPeer. |
|
8919 |
||
8920 |
WindowCreationTrace == true ifTrue:[ |
|
8921 |
'WMenuBarPeer_create: ' print. frame print. ' -> ' print. menuBar printNL. |
|
8922 |
]. |
|
8923 |
||
8924 |
"Created: / 7.1.1998 / 21:38:31 / cg" |
|
8925 |
"Modified: / 25.1.1998 / 13:19:03 / cg" |
|
8926 |
! |
|
8927 |
||
440 | 8928 |
_WMenuBarPeer_delMenu:nativeContext |
8929 |
"/ void delMenu (int) |
|
8930 |
UnimplementedNativeMethodSignal raise |
|
8931 |
||
8932 |
"Created: / 12.11.1998 / 19:14:11 / cg" |
|
8933 |
! |
|
8934 |
||
325 | 8935 |
_WMenuItemPeer__dispose:nativeContext |
8936 |
|jMenuItemPeer item| |
|
8937 |
||
8938 |
jMenuItemPeer := nativeContext receiver. |
|
8939 |
item := jMenuItemPeer instVarNamed:'pData'. |
|
8940 |
||
8941 |
"/ what should be done here ? |
|
8942 |
||
8943 |
"Created: / 29.3.1998 / 17:16:05 / cg" |
|
8944 |
"Modified: / 29.3.1998 / 17:16:35 / cg" |
|
8945 |
! |
|
8946 |
||
440 | 8947 |
_WMenuItemPeer__setLabel:nativeContext |
8948 |
"/ void _setLabel (java.lang.String) |
|
480 | 8949 |
'JAVA: unimplemented: _WMenuItemPeer__setLabel' infoPrintCR. |
8950 |
"/ UnimplementedNativeMethodSignal raise |
|
440 | 8951 |
|
8952 |
"Created: / 12.11.1998 / 19:12:06 / cg" |
|
480 | 8953 |
"Modified: / 3.12.1998 / 21:06:44 / cg" |
440 | 8954 |
! |
8955 |
||
284 | 8956 |
_WMenuItemPeer_create:nativeContext |
8957 |
|jMenuItemPeer jMenuItem jMenuPeer menu item lbl| |
|
8958 |
||
8959 |
jMenuItemPeer := nativeContext receiver. |
|
8960 |
jMenuItem := jMenuItemPeer instVarNamed:'target'. |
|
8961 |
||
8962 |
jMenuPeer := nativeContext argAt:1. |
|
8963 |
menu := jMenuPeer instVarNamed:'pData'. |
|
480 | 8964 |
(menu isNil or:[menu == 0]) ifTrue:[ |
8965 |
'JAVA: no menu to create item in' infoPrintCR. |
|
8966 |
^ self |
|
8967 |
]. |
|
284 | 8968 |
item := menu createAtIndex:nil. |
325 | 8969 |
item value:[ |
8970 |
jMenuItemPeer perform:#'handleAction(I)V' with:0 |
|
8971 |
]. |
|
284 | 8972 |
|
8973 |
lbl := jMenuItem instVarNamed:'label'. |
|
8974 |
lbl notNil ifTrue:[ |
|
325 | 8975 |
lbl := Java as_ST_String:lbl. |
8976 |
item label:lbl |
|
284 | 8977 |
]. |
8978 |
||
8979 |
jMenuItemPeer instVarNamed:'pData' put:item. |
|
8980 |
||
8981 |
WindowOPTrace == true ifTrue:[ |
|
325 | 8982 |
'WMenuItem_create: ' print. menu print. ' -> ' print. item printNL. |
284 | 8983 |
]. |
8984 |
||
8985 |
"Created: / 7.1.1998 / 21:40:44 / cg" |
|
480 | 8986 |
"Modified: / 3.12.1998 / 20:43:20 / cg" |
284 | 8987 |
! |
8988 |
||
8989 |
_WMenuItemPeer_enable:nativeContext |
|
8990 |
|jMenuItemPeer item state| |
|
8991 |
||
8992 |
jMenuItemPeer := nativeContext receiver. |
|
8993 |
item := jMenuItemPeer instVarNamed:'pData'. |
|
480 | 8994 |
(item isNil or:[item == 0]) ifTrue:[ |
8995 |
'JAVA [warning]: enabling NULL menu item' infoPrintCR. |
|
8996 |
^ self |
|
8997 |
]. |
|
284 | 8998 |
|
8999 |
state := nativeContext argAt:1. |
|
9000 |
item enabled:(state == 0) not |
|
9001 |
||
9002 |
"Created: / 7.1.1998 / 22:41:38 / cg" |
|
480 | 9003 |
"Modified: / 3.12.1998 / 21:04:10 / cg" |
284 | 9004 |
! |
9005 |
||
440 | 9006 |
_WMenuPeer_addSeparator:nativeContext |
9007 |
"/ void addSeparator () |
|
9008 |
UnimplementedNativeMethodSignal raise |
|
9009 |
||
9010 |
"Created: / 12.11.1998 / 19:13:14 / cg" |
|
9011 |
! |
|
9012 |
||
284 | 9013 |
_WMenuPeer_createMenu:nativeContext |
9014 |
|jMenuPeer jMenu jMenuBarPeer menuPanel menu |
|
9015 |
lbl item| |
|
9016 |
||
9017 |
jMenuPeer := nativeContext receiver. |
|
9018 |
jMenu := jMenuPeer instVarNamed:'target'. |
|
9019 |
||
9020 |
jMenuBarPeer := nativeContext argAt:1. |
|
9021 |
menuPanel := jMenuBarPeer instVarNamed:'pData'. |
|
9022 |
||
9023 |
item := menuPanel createAtIndex:nil. |
|
9024 |
lbl := jMenu instVarNamed:'label'. |
|
9025 |
lbl notNil ifTrue:[ |
|
9026 |
lbl := Java as_ST_String:lbl. |
|
9027 |
item label:lbl |
|
9028 |
]. |
|
9029 |
||
9030 |
menu := MenuPanel new. |
|
9031 |
item submenu:menu. |
|
9032 |
||
9033 |
jMenuPeer instVarNamed:'pData' put:menu. |
|
9034 |
||
9035 |
'createMenuPeer: ' print. menuPanel print. ' -> ' print. menu printNL. |
|
9036 |
||
9037 |
"Created: / 7.1.1998 / 21:39:50 / cg" |
|
9038 |
"Modified: / 13.1.1998 / 22:11:09 / cg" |
|
9039 |
! |
|
9040 |
||
440 | 9041 |
_WMenuPeer_createSubMenu:nativeContext |
9042 |
"/ void createSubMenu (sun.awt.windows.WMenuPeer) |
|
9043 |
UnimplementedNativeMethodSignal raise |
|
9044 |
||
9045 |
"Created: / 12.11.1998 / 19:13:43 / cg" |
|
9046 |
! |
|
9047 |
||
9048 |
_WMenuPeer_delItem:nativeContext |
|
9049 |
"/ void delItem (int) |
|
9050 |
UnimplementedNativeMethodSignal raise |
|
9051 |
||
9052 |
"Created: / 12.11.1998 / 19:13:30 / cg" |
|
9053 |
! |
|
9054 |
||
9055 |
_WPopupMenuPeer__show:nativeContext |
|
9056 |
"/ void _show (java.awt.Event) |
|
9057 |
UnimplementedNativeMethodSignal raise |
|
9058 |
||
9059 |
"Created: / 12.11.1998 / 19:12:53 / cg" |
|
9060 |
! |
|
9061 |
||
9062 |
_WPopupMenuPeer_createMenu:nativeContext |
|
9063 |
"/ void createMenu (sun.awt.windows.WComponentPeer) |
|
9064 |
UnimplementedNativeMethodSignal raise |
|
9065 |
||
9066 |
"Created: / 12.11.1998 / 19:12:43 / cg" |
|
9067 |
! |
|
9068 |
||
9069 |
_WPrintJob_end:nativeContext |
|
9070 |
"/ void end () |
|
9071 |
UnimplementedNativeMethodSignal raise |
|
9072 |
||
9073 |
"Created: / 12.11.1998 / 19:11:28 / cg" |
|
9074 |
! |
|
9075 |
||
334 | 9076 |
_WScrollPanePeer__getHScrollbarHeight:nativeContext |
9077 |
|scrollPane| |
|
9078 |
||
9079 |
scrollPane := self viewForWPeer:nativeContext. |
|
339 | 9080 |
^ HorizontalScrollBar new preferredExtent y. |
9081 |
||
334 | 9082 |
"Created: / 9.4.1998 / 17:30:56 / cg" |
339 | 9083 |
"Modified: / 10.4.1998 / 14:59:28 / cg" |
341 | 9084 |
! |
334 | 9085 |
|
9086 |
_WScrollPanePeer__getVScrollbarWidth:nativeContext |
|
9087 |
|scrollPane| |
|
9088 |
||
9089 |
scrollPane := self viewForWPeer:nativeContext. |
|
339 | 9090 |
^ ScrollBar new preferredExtent x. |
334 | 9091 |
|
9092 |
"Created: / 9.4.1998 / 17:29:48 / cg" |
|
339 | 9093 |
"Modified: / 10.4.1998 / 15:00:33 / cg" |
334 | 9094 |
! |
9095 |
||
9096 |
_WScrollPanePeer_create:nativeContext |
|
9097 |
|jScrollPanePeer jScrollPane jFrame frame scrollPane |
|
9098 |
lbl| |
|
9099 |
||
9100 |
jScrollPanePeer := nativeContext receiver. |
|
9101 |
jScrollPane := jScrollPanePeer instVarNamed:'target'. |
|
9102 |
||
9103 |
jFrame := nativeContext argAt:1. |
|
9104 |
frame := jFrame instVarNamed:'pData'. |
|
9105 |
||
9106 |
"/ create with a simple view ... |
|
337 | 9107 |
scrollPane := ScrollableView for:JavaView in:frame. |
334 | 9108 |
|
9109 |
self createdWindowsView:scrollPane for:jScrollPanePeer. |
|
9110 |
||
9111 |
WindowCreationTrace == true ifTrue:[ |
|
9112 |
'WScrollPanePeer_create: ' print. frame print. ' -> ' print. scrollPane printNL. |
|
9113 |
]. |
|
9114 |
||
9115 |
"Created: / 9.4.1998 / 17:25:08 / cg" |
|
337 | 9116 |
"Modified: / 9.4.1998 / 22:06:09 / cg" |
334 | 9117 |
! |
9118 |
||
440 | 9119 |
_WScrollPanePeer_getOffset:nativeContext |
9120 |
"/ int getOffset (int) |
|
9121 |
UnimplementedNativeMethodSignal raise |
|
9122 |
||
9123 |
"Created: / 12.11.1998 / 19:16:29 / cg" |
|
9124 |
! |
|
9125 |
||
9126 |
_WScrollPanePeer_getScrollChild:nativeContext |
|
9127 |
"/ java.awt.Component getScrollChild () |
|
9128 |
UnimplementedNativeMethodSignal raise |
|
9129 |
||
9130 |
"Created: / 12.11.1998 / 19:17:00 / cg" |
|
9131 |
! |
|
9132 |
||
334 | 9133 |
_WScrollPanePeer_setInsets:nativeContext |
9134 |
||
9135 |
"Modified: / 9.4.1998 / 17:26:11 / cg" |
|
9136 |
"Created: / 9.4.1998 / 17:29:10 / cg" |
|
9137 |
! |
|
9138 |
||
440 | 9139 |
_WScrollPanePeer_setScrollPosition:nativeContext |
9140 |
"/ void setScrollPosition (int int) |
|
9141 |
UnimplementedNativeMethodSignal raise |
|
9142 |
||
9143 |
"Created: / 12.11.1998 / 19:16:44 / cg" |
|
9144 |
! |
|
9145 |
||
334 | 9146 |
_WScrollPanePeer_setSpans:nativeContext |
9147 |
||
9148 |
"Created: / 9.4.1998 / 17:31:44 / cg" |
|
9149 |
! |
|
9150 |
||
284 | 9151 |
_WScrollbarPeer__setValues:nativeContext |
9152 |
|scrollBar value visibleAmount min max| |
|
9153 |
||
9154 |
scrollBar := self viewForWPeer:nativeContext. |
|
9155 |
||
9156 |
value := nativeContext argAt:1. |
|
9157 |
visibleAmount := nativeContext argAt:2. |
|
9158 |
min := nativeContext argAt:3. |
|
9159 |
max := nativeContext argAt:4. |
|
9160 |
||
374 | 9161 |
(min ~~ 0 or:[max ~~ 100]) ifTrue:[ |
284 | 9162 |
scrollBar thumb start:min stop:max. |
9163 |
]. |
|
9164 |
||
9165 |
scrollBar thumbOrigin:value thumbHeight:visibleAmount. |
|
9166 |
||
9167 |
"Created: / 13.1.1998 / 22:13:57 / cg" |
|
374 | 9168 |
"Modified: / 14.10.1998 / 14:53:00 / cg" |
284 | 9169 |
! |
9170 |
||
9171 |
_WScrollbarPeer_create:nativeContext |
|
9172 |
|jScrollbarPeer jScrollbar jFrame frame scrollBar |
|
334 | 9173 |
min max| |
284 | 9174 |
|
9175 |
jScrollbarPeer := nativeContext receiver. |
|
9176 |
jScrollbar := jScrollbarPeer instVarNamed:'target'. |
|
9177 |
||
9178 |
jFrame := nativeContext argAt:1. |
|
9179 |
frame := jFrame instVarNamed:'pData'. |
|
9180 |
||
9181 |
(jScrollbar instVarNamed:'orientation') == 0 "HORIZONTAL" ifTrue:[ |
|
9182 |
scrollBar := HorizontalScrollBar in:frame. |
|
9183 |
] ifFalse:[ |
|
9184 |
scrollBar := ScrollBar in:frame. |
|
9185 |
]. |
|
9186 |
min := jScrollbar instVarNamed:'minimum'. |
|
9187 |
max := jScrollbar instVarNamed:'maximum'. |
|
9188 |
||
374 | 9189 |
scrollBar scrollDownAction:[ |
9190 |
scrollBar thumbOrigin:(scrollBar thumbOrigin + ((max-min)/10) min:max). |
|
9191 |
jScrollbarPeer perform:#'dragAbsolute(I)V' with:scrollBar thumbOrigin rounded. |
|
9192 |
]. |
|
9193 |
scrollBar scrollUpAction:[ |
|
9194 |
scrollBar thumbOrigin:(scrollBar thumbOrigin - ((max-min)/10) max:min). |
|
9195 |
jScrollbarPeer perform:#'dragAbsolute(I)V' with:scrollBar thumbOrigin rounded. |
|
9196 |
]. |
|
9197 |
scrollBar scrollAction:[:org | |
|
9198 |
jScrollbarPeer perform:#'dragAbsolute(I)V' with:org rounded. |
|
9199 |
]. |
|
284 | 9200 |
self createdWindowsView:scrollBar for:jScrollbarPeer. |
9201 |
||
9202 |
WindowCreationTrace == true ifTrue:[ |
|
9203 |
'WScrollbarPeer_create: ' print. frame print. ' -> ' print. scrollBar printNL. |
|
9204 |
]. |
|
9205 |
||
9206 |
"Created: / 5.1.1998 / 01:53:30 / cg" |
|
374 | 9207 |
"Modified: / 14.10.1998 / 15:36:19 / cg" |
284 | 9208 |
! |
9209 |
||
9210 |
_WScrollbarPeer_setLineIncrement:nativeContext |
|
9211 |
|scrollBar inc| |
|
9212 |
||
374 | 9213 |
Transcript showCR:'JavaVM: WScrollbarPeer_setLineIncrement unimplemented'. |
9214 |
||
284 | 9215 |
scrollBar := self viewForWPeer:nativeContext. |
9216 |
||
9217 |
inc := nativeContext argAt:1. |
|
9218 |
"/ scrollBar thumb lineIncrement:inc. |
|
9219 |
||
9220 |
"Created: / 25.1.1998 / 11:52:19 / cg" |
|
374 | 9221 |
"Modified: / 14.10.1998 / 14:53:56 / cg" |
284 | 9222 |
! |
9223 |
||
9224 |
_WScrollbarPeer_setPageIncrement:nativeContext |
|
9225 |
|scrollBar inc| |
|
9226 |
||
374 | 9227 |
Transcript showCR:'JavaVM: WScrollbarPeer_setPageIncrement unimplemented'. |
9228 |
||
284 | 9229 |
scrollBar := self viewForWPeer:nativeContext. |
9230 |
||
9231 |
inc := nativeContext argAt:1. |
|
9232 |
"/ scrollBar thumb pageIncrement:inc. |
|
9233 |
||
9234 |
"Created: / 25.1.1998 / 11:52:01 / cg" |
|
374 | 9235 |
"Modified: / 14.10.1998 / 14:54:04 / cg" |
284 | 9236 |
! |
9237 |
||
9238 |
_WTextAreaPeer_create:nativeContext |
|
9239 |
|jTextAreaPeer jFrame frame editTextView| |
|
9240 |
||
9241 |
jTextAreaPeer := nativeContext receiver. |
|
9242 |
||
9243 |
jFrame := nativeContext argAt:1. |
|
9244 |
frame := jFrame instVarNamed:'pData'. |
|
9245 |
||
9246 |
editTextView := HVScrollableView for:EditTextView in:frame. |
|
9247 |
||
9248 |
self createdWindowsView:editTextView for:jTextAreaPeer. |
|
9249 |
||
9250 |
WindowCreationTrace == true ifTrue:[ |
|
9251 |
'WTextAreaPeer_create: ' print. frame print. ' -> ' print. editTextView printNL. |
|
9252 |
]. |
|
9253 |
||
9254 |
"Created: / 7.1.1998 / 21:49:49 / cg" |
|
9255 |
"Modified: / 15.1.1998 / 12:56:18 / cg" |
|
9256 |
! |
|
9257 |
||
9258 |
_WTextAreaPeer_insertText:nativeContext |
|
9259 |
|textView pos string jstring| |
|
9260 |
||
9261 |
textView := self viewForWPeer:nativeContext. |
|
329 | 9262 |
(textView isKindOf:ScrollableView) ifTrue:[ |
9263 |
textView := textView scrolledView |
|
9264 |
]. |
|
284 | 9265 |
|
9266 |
jstring := nativeContext argAt:1. |
|
9267 |
string := Java as_ST_String:jstring. |
|
9268 |
pos := nativeContext argAt:2. |
|
9269 |
||
9270 |
textView insert:string at:pos. |
|
329 | 9271 |
textView cursorToCharacterPosition:pos + string size. |
9272 |
textView makeCursorVisible. |
|
9273 |
"/ textView invalidateRepairNow:true. |
|
284 | 9274 |
^ nil |
9275 |
||
9276 |
"Created: / 7.1.1998 / 21:50:23 / cg" |
|
329 | 9277 |
"Modified: / 5.4.1998 / 17:37:24 / cg" |
284 | 9278 |
! |
9279 |
||
440 | 9280 |
_WTextAreaPeer_replaceText:nativeContext |
9281 |
"/ void replaceText (java.lang.String int int) |
|
9282 |
UnimplementedNativeMethodSignal raise |
|
9283 |
||
9284 |
"Created: / 12.11.1998 / 19:11:14 / cg" |
|
9285 |
! |
|
9286 |
||
284 | 9287 |
_WTextComponentPeer_enableEditing:nativeContext |
9288 |
|textView enabled| |
|
9289 |
||
9290 |
textView := self viewForWPeer:nativeContext. |
|
9291 |
enabled := (nativeContext argAt:1) ~~ 0. |
|
9292 |
||
9293 |
^ textView readOnly:enabled not |
|
9294 |
||
9295 |
"Created: / 5.1.1998 / 01:29:38 / cg" |
|
9296 |
"Modified: / 25.1.1998 / 16:29:56 / cg" |
|
9297 |
! |
|
9298 |
||
9299 |
_WTextComponentPeer_getSelectionEnd:nativeContext |
|
9300 |
|textView| |
|
9301 |
||
9302 |
textView := self viewForWPeer:nativeContext. |
|
9303 |
||
9304 |
^ textView characterPositionOfSelectionEnd |
|
9305 |
||
9306 |
"Created: / 8.1.1998 / 17:41:56 / cg" |
|
9307 |
"Modified: / 15.1.1998 / 15:47:18 / cg" |
|
9308 |
! |
|
9309 |
||
9310 |
_WTextComponentPeer_getSelectionStart:nativeContext |
|
9311 |
|textView| |
|
9312 |
||
9313 |
textView := self viewForWPeer:nativeContext. |
|
9314 |
||
9315 |
^ textView characterPositionOfSelection - 1 |
|
9316 |
||
9317 |
"Created: / 15.8.1997 / 15:45:45 / cg" |
|
9318 |
"Modified: / 15.1.1998 / 15:46:51 / cg" |
|
9319 |
! |
|
9320 |
||
9321 |
_WTextComponentPeer_getText:nativeContext |
|
9322 |
|textView string jString| |
|
9323 |
||
9324 |
textView := self viewForWPeer:nativeContext. |
|
9325 |
||
9326 |
string := textView contents asString. |
|
9327 |
jString := Java as_String:string. |
|
9328 |
^ jString |
|
9329 |
||
9330 |
"Created: / 6.1.1998 / 21:05:15 / cg" |
|
9331 |
"Modified: / 8.1.1998 / 17:36:52 / cg" |
|
9332 |
! |
|
9333 |
||
9334 |
_WTextComponentPeer_select:nativeContext |
|
9335 |
|textView selStart selEnd| |
|
9336 |
||
9337 |
textView := self viewForWPeer:nativeContext. |
|
9338 |
selStart := nativeContext argAt:1. |
|
9339 |
selEnd := nativeContext argAt:2. |
|
9340 |
||
9341 |
selStart == selEnd ifTrue:[ |
|
9342 |
"/ clear selection |
|
9343 |
textView unselect. |
|
9344 |
"/ and set caret |
|
9345 |
textView cursorToCharacterPosition:selStart + 1 |
|
9346 |
] ifFalse:[ |
|
9347 |
"/ change selection |
|
9348 |
textView selectFromCharacterPosition:selStart+1 to:selEnd |
|
9349 |
]. |
|
9350 |
||
9351 |
"Created: / 15.8.1997 / 15:45:58 / cg" |
|
9352 |
"Modified: / 15.1.1998 / 21:55:57 / cg" |
|
9353 |
! |
|
9354 |
||
9355 |
_WTextComponentPeer_setText:nativeContext |
|
9356 |
|textView string jstring| |
|
9357 |
||
9358 |
textView := self viewForWPeer:nativeContext. |
|
9359 |
||
9360 |
jstring := nativeContext argAt:1. |
|
9361 |
string := Java as_ST_String:jstring. |
|
9362 |
||
9363 |
textView contents:string. |
|
9364 |
||
9365 |
"Created: / 5.1.1998 / 01:28:23 / cg" |
|
9366 |
"Modified: / 15.1.1998 / 15:59:57 / cg" |
|
9367 |
! |
|
9368 |
||
9369 |
_WTextFieldPeer_create:nativeContext |
|
9370 |
|jTextFieldPeer jFrame frame editField| |
|
9371 |
||
9372 |
jTextFieldPeer := nativeContext receiver. |
|
9373 |
||
9374 |
jFrame := nativeContext argAt:1. |
|
9375 |
frame := jFrame instVarNamed:'pData'. |
|
9376 |
||
9377 |
editField := EditField in:frame. |
|
9378 |
||
9379 |
self createdWindowsView:editField for:jTextFieldPeer. |
|
9380 |
||
9381 |
editField crAction:[ |
|
419 | 9382 |
jTextFieldPeer perform:#handleAction. |
284 | 9383 |
]. |
9384 |
WindowCreationTrace == true ifTrue:[ |
|
9385 |
'WTextFieldPeer_create: ' print. frame print. ' -> ' print. editField printNL. |
|
9386 |
]. |
|
9387 |
||
9388 |
"Created: / 5.1.1998 / 01:27:37 / cg" |
|
419 | 9389 |
"Modified: / 4.11.1998 / 21:07:30 / cg" |
284 | 9390 |
! |
9391 |
||
9392 |
_WTextFieldPeer_setEchoCharacter:nativeContext |
|
9393 |
|editField char| |
|
9394 |
||
9395 |
editField := self viewForWPeer:nativeContext. |
|
9396 |
||
9397 |
char := nativeContext argAt:1. |
|
9398 |
editField passwordCharacter:(Character value:char). |
|
9399 |
||
9400 |
"Created: / 25.1.1998 / 16:28:30 / cg" |
|
9401 |
! |
|
9402 |
||
440 | 9403 |
_WToolkit_beep:nativeContext |
9404 |
"/ void beep () |
|
9405 |
UnimplementedNativeMethodSignal raise |
|
9406 |
||
9407 |
"Created: / 12.11.1998 / 19:09:23 / cg" |
|
9408 |
! |
|
9409 |
||
284 | 9410 |
_WToolkit_eventLoop:nativeContext |
9411 |
JavaEventThread := Processor activeProcess. |
|
9412 |
[ |
|
9413 |
[true] whileTrue:[ |
|
9414 |
AbortSignal handle:[:ex | |
|
9415 |
ex return |
|
9416 |
] do:[ |
|
9417 |
self doWindowsEventThread. |
|
9418 |
] |
|
9419 |
]. |
|
9420 |
] valueNowOrOnUnwindDo:[ |
|
9421 |
JavaEventThread := nil. |
|
9422 |
]. |
|
9423 |
||
9424 |
"Created: / 6.1.1998 / 21:01:44 / cg" |
|
9425 |
"Modified: / 15.1.1998 / 19:48:55 / cg" |
|
9426 |
! |
|
9427 |
||
405 | 9428 |
_WToolkit_getComboHeightOffset:nativeContext |
9429 |
^ 0 |
|
9430 |
||
9431 |
"Modified: / 20.3.1997 / 13:50:04 / cg" |
|
9432 |
"Created: / 22.10.1998 / 00:59:14 / cg" |
|
9433 |
! |
|
9434 |
||
284 | 9435 |
_WToolkit_getScreenHeight:nativeContext |
9436 |
^ Screen current height |
|
9437 |
||
9438 |
"Modified: / 20.3.1997 / 13:50:04 / cg" |
|
9439 |
"Created: / 13.1.1998 / 09:24:45 / cg" |
|
9440 |
! |
|
9441 |
||
9442 |
_WToolkit_getScreenResolution:nativeContext |
|
9443 |
^ Screen current resolution x rounded |
|
9444 |
||
9445 |
"Modified: / 20.3.1997 / 13:50:04 / cg" |
|
9446 |
"Created: / 17.1.1998 / 21:54:48 / cg" |
|
9447 |
! |
|
9448 |
||
9449 |
_WToolkit_getScreenWidth:nativeContext |
|
9450 |
^ Screen current width |
|
9451 |
||
9452 |
"Modified: / 20.3.1997 / 13:50:04 / cg" |
|
9453 |
"Created: / 13.1.1998 / 09:24:37 / cg" |
|
9454 |
! |
|
9455 |
||
9456 |
_WToolkit_init:nativeContext |
|
9457 |
||
9458 |
"Created: / 3.1.1998 / 02:30:57 / cg" |
|
9459 |
! |
|
9460 |
||
9461 |
_WToolkit_loadSystemColors:nativeContext |
|
9462 |
"/ self halt. |
|
9463 |
||
9464 |
"Modified: / 18.3.1997 / 18:43:26 / cg" |
|
9465 |
"Created: / 5.1.1998 / 02:19:09 / cg" |
|
9466 |
! |
|
9467 |
||
440 | 9468 |
_WToolkit_makeColorModel:nativeContext |
9469 |
"/ java.awt.image.ColorModel makeColorModel () |
|
9470 |
UnimplementedNativeMethodSignal raise |
|
9471 |
||
9472 |
"Created: / 12.11.1998 / 19:08:47 / cg" |
|
9473 |
! |
|
9474 |
||
9475 |
_WToolkit_sync:nativeContext |
|
9476 |
"/ void sync () |
|
9477 |
UnimplementedNativeMethodSignal raise |
|
9478 |
||
9479 |
"Created: / 12.11.1998 / 19:09:14 / cg" |
|
9480 |
! |
|
9481 |
||
284 | 9482 |
_WWindowPeer__setResizable:nativeContext |
9483 |
|view onOff| |
|
9484 |
||
9485 |
view := self viewForWPeer:nativeContext. |
|
9486 |
||
9487 |
onOff := (nativeContext argAt:1) == 1. |
|
9488 |
view isTopView ifTrue:[ |
|
9489 |
onOff ifTrue:[ |
|
9490 |
view minExtent:10@10. |
|
9491 |
view maxExtent:(Screen current extent). |
|
9492 |
] ifFalse:[ |
|
9493 |
view minExtent:view extent. |
|
9494 |
view maxExtent:view extent. |
|
9495 |
] |
|
9496 |
] ifFalse:[ |
|
9497 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
9498 |
self halt. |
|
9499 |
] |
|
9500 |
]. |
|
9501 |
||
9502 |
"/ 'JAVA: WWindowPeer_setResizable: ' print. view print. ' yes/no: ' print. onOff printNL. |
|
9503 |
||
9504 |
^ nil |
|
9505 |
||
9506 |
"Created: / 5.1.1998 / 00:57:59 / cg" |
|
9507 |
"Modified: / 16.1.1998 / 18:08:00 / cg" |
|
9508 |
! |
|
9509 |
||
9510 |
_WWindowPeer__setTitle:nativeContext |
|
9511 |
|view jString string| |
|
9512 |
||
9513 |
view := self viewForWPeer:nativeContext. |
|
9514 |
||
9515 |
jString := nativeContext argAt:1. |
|
9516 |
string := Java as_ST_String:jString. |
|
9517 |
||
9518 |
"/ 'JAVA: WWindowPeer_pSetTitle: ' print. string print. ' ' print. view printNL. |
|
9519 |
||
9520 |
view label:string. |
|
9521 |
^ nil |
|
9522 |
||
9523 |
"Created: / 5.1.1998 / 00:57:17 / cg" |
|
9524 |
"Modified: / 8.1.1998 / 17:37:41 / cg" |
|
9525 |
! |
|
9526 |
||
440 | 9527 |
_WWindowPeer_create:nativeContext |
9528 |
"/ void create (sun.awt.windows.WComponentPeer) |
|
9529 |
UnimplementedNativeMethodSignal raise |
|
9530 |
||
9531 |
"Created: / 12.11.1998 / 19:10:38 / cg" |
|
9532 |
! |
|
9533 |
||
9534 |
_WWindowPeer_getContainerElement:nativeContext |
|
9535 |
"/ java.awt.Component getContainerElement (java.awt.Container int) |
|
9536 |
UnimplementedNativeMethodSignal raise |
|
9537 |
||
9538 |
"Created: / 12.11.1998 / 19:10:54 / cg" |
|
9539 |
! |
|
9540 |
||
342 | 9541 |
_WWindowPeer_toBack:nativeContext |
9542 |
|view| |
|
9543 |
||
9544 |
view := self viewForWPeer:nativeContext. |
|
9545 |
view lower. |
|
9546 |
||
9547 |
"Created: / 7.5.1998 / 00:23:03 / cg" |
|
9548 |
! |
|
9549 |
||
337 | 9550 |
_WWindowPeer_toFront:nativeContext |
9551 |
|view| |
|
9552 |
||
9553 |
view := self viewForWPeer:nativeContext. |
|
9554 |
view raise. |
|
9555 |
||
9556 |
"Created: / 9.4.1998 / 22:17:28 / cg" |
|
9557 |
! |
|
9558 |
||
284 | 9559 |
_WWindowPeer_updateInsets:nativeContext |
9560 |
"/ self halt. |
|
9561 |
||
9562 |
"Modified: / 18.3.1997 / 18:43:18 / cg" |
|
9563 |
"Created: / 4.1.1998 / 18:09:04 / cg" |
|
9564 |
! ! |
|
9565 |
||
9566 |
!JavaVM class methodsFor:'native - sun.awt.windows - jdk1.2'! |
|
9567 |
||
9568 |
_WFramePeer_setTitle:nativeContext |
|
9569 |
|view jString string| |
|
9570 |
||
9571 |
view := self viewForWPeer:nativeContext. |
|
9572 |
||
9573 |
jString := nativeContext argAt:1. |
|
9574 |
string := Java as_ST_String:jString. |
|
9575 |
||
9576 |
"/ 'JAVA: WFramePeer_pSetTitle: ' print. string print. ' ' print. view printNL. |
|
9577 |
||
9578 |
view label:string. |
|
9579 |
^ nil |
|
9580 |
||
9581 |
"Modified: / 8.1.1998 / 17:37:41 / cg" |
|
9582 |
"Created: / 27.1.1998 / 21:42:57 / cg" |
|
9583 |
! |
|
9584 |
||
9585 |
_WPanelPeer_calculateInsets:nativeContext |
|
9586 |
"/ new with jdk1.2 ... |
|
9587 |
||
9588 |
"Created: / 27.1.1998 / 21:40:00 / cg" |
|
9589 |
! ! |
|
9590 |
||
457 | 9591 |
!JavaVM class methodsFor:'native - sun.awt.windows - ms'! |
9592 |
||
9593 |
_MCanvasPeer_create:nativeContext |
|
9594 |
|jCanvasPeer jFrame frame subView| |
|
9595 |
||
9596 |
jCanvasPeer := nativeContext receiver. |
|
9597 |
||
9598 |
jFrame := nativeContext argAt:1. |
|
9599 |
jFrame isNil ifTrue:[ |
|
9600 |
self halt:'no frame in canvasPeer create'. |
|
9601 |
self internalError:'no frame in canvasPeer create'. |
|
9602 |
^ self. |
|
9603 |
]. |
|
9604 |
frame := jFrame instVarNamed:'pData'. |
|
9605 |
||
9606 |
subView := JavaView in:frame. |
|
9607 |
subView delegate:self. |
|
9608 |
subView javaPeer:jCanvasPeer. |
|
9609 |
||
9610 |
self createdWindowsView:subView for:jCanvasPeer. |
|
9611 |
||
9612 |
WindowCreationTrace == true ifTrue:[ |
|
9613 |
'WCanvasPeer_create: ' print. frame print. ' -> ' print. subView printNL. |
|
9614 |
]. |
|
9615 |
||
9616 |
"Modified: / 16.1.1998 / 13:40:00 / cg" |
|
9617 |
"Created: / 18.11.1998 / 00:14:44 / cg" |
|
9618 |
! |
|
9619 |
||
9620 |
_MComponentPeer_pReshape:nativeContext |
|
9621 |
self commonReshapeComponent:nativeContext |
|
9622 |
||
9623 |
"Created: / 18.11.1998 / 00:18:17 / cg" |
|
9624 |
! |
|
9625 |
||
9626 |
_MComponentPeer_setBackground:nativeContext |
|
9627 |
|jClr rgb clr view| |
|
9628 |
||
9629 |
view := self viewForWPeer:nativeContext. |
|
9630 |
||
9631 |
jClr := nativeContext argAt:1. |
|
9632 |
rgb := jClr instVarNamed:'value'. |
|
9633 |
"/ self halt. |
|
9634 |
clr := Color rgbValue:rgb. |
|
9635 |
||
9636 |
||
9637 |
clr := clr on:(view device). |
|
9638 |
||
9639 |
(view isKindOf:ScrollableView) ifTrue:[ |
|
9640 |
view := view scrolledView |
|
9641 |
]. |
|
9642 |
view viewBackground:clr. |
|
9643 |
view backgroundPaint:clr. |
|
9644 |
||
9645 |
"Created: / 17.11.1998 / 23:49:41 / cg" |
|
9646 |
! |
|
9647 |
||
9648 |
_MComponentPeer_setFont:nativeContext |
|
9649 |
|view| |
|
9650 |
||
9651 |
view := self viewForWPeer:nativeContext. |
|
9652 |
"/ self halt. |
|
9653 |
||
9654 |
"Modified: / 25.1.1998 / 01:22:19 / cg" |
|
9655 |
"Created: / 17.11.1998 / 23:43:48 / cg" |
|
9656 |
! |
|
9657 |
||
9658 |
_MComponentPeer_setForeground:nativeContext |
|
9659 |
|jClr rgb clr view| |
|
9660 |
||
9661 |
view := self viewForWPeer:nativeContext. |
|
9662 |
||
9663 |
jClr := nativeContext argAt:1. |
|
9664 |
rgb := jClr instVarNamed:'value'. |
|
9665 |
"/ self halt. |
|
9666 |
clr := Color rgbValue:rgb. |
|
9667 |
||
9668 |
clr := clr on:(view device). |
|
9669 |
||
9670 |
view paint:clr. |
|
9671 |
||
9672 |
"Created: / 17.11.1998 / 23:50:31 / cg" |
|
9673 |
"Modified: / 17.11.1998 / 23:57:29 / cg" |
|
9674 |
! |
|
9675 |
||
9676 |
_MFramePeer_getWindowBackgroundColor:nativeContext |
|
9677 |
^ View defaultViewBackgroundColor rgbValue. |
|
9678 |
||
9679 |
"Created: / 17.11.1998 / 23:55:42 / cg" |
|
9680 |
! |
|
9681 |
||
9682 |
_MFramePeer_pShow:nativeContext |
|
9683 |
|view| |
|
9684 |
||
9685 |
view := self viewForWPeer:nativeContext. |
|
9686 |
||
9687 |
"/ frame views are under my browsers own control |
|
9688 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
9689 |
view beVisible. |
|
9690 |
view realize. |
|
9691 |
]. |
|
9692 |
||
9693 |
"/ view windowGroup notNil ifTrue:[ |
|
9694 |
"/ windowServer addGroup:(view windowGroup) |
|
9695 |
"/ ]. |
|
9696 |
||
9697 |
^ nil |
|
9698 |
||
9699 |
"/ self halt. |
|
9700 |
||
9701 |
"Modified: / 25.1.1998 / 09:54:07 / cg" |
|
9702 |
"Created: / 18.11.1998 / 00:19:59 / cg" |
|
9703 |
! |
|
9704 |
||
9705 |
_MFramePeer_setInsets:nativeContext |
|
9706 |
||
9707 |
"Created: / 17.11.1998 / 23:55:32 / cg" |
|
9708 |
! |
|
9709 |
||
9710 |
_MFramePeer_setResizable:nativeContext |
|
9711 |
|view onOff| |
|
9712 |
||
9713 |
view := self viewForWPeer:nativeContext. |
|
9714 |
||
9715 |
onOff := (nativeContext argAt:1) == 1. |
|
9716 |
view isTopView ifTrue:[ |
|
9717 |
onOff ifTrue:[ |
|
9718 |
view minExtent:10@10. |
|
9719 |
view maxExtent:(Screen current extent). |
|
9720 |
] ifFalse:[ |
|
9721 |
view minExtent:view extent. |
|
9722 |
view maxExtent:view extent. |
|
9723 |
] |
|
9724 |
] ifFalse:[ |
|
9725 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
9726 |
self halt. |
|
9727 |
] |
|
9728 |
]. |
|
9729 |
||
9730 |
"/ 'JAVA: WWindowPeer_setResizable: ' print. view print. ' yes/no: ' print. onOff printNL. |
|
9731 |
||
9732 |
^ nil |
|
9733 |
||
9734 |
"Modified: / 16.1.1998 / 18:08:00 / cg" |
|
9735 |
"Created: / 17.11.1998 / 23:51:45 / cg" |
|
9736 |
! |
|
9737 |
||
9738 |
_MToolkit_callbackLoop:nativeContext |
|
9739 |
|toolKit| |
|
9740 |
||
9741 |
toolKit := nativeContext receiver. |
|
9742 |
^ self. |
|
9743 |
self halt. |
|
9744 |
self wakeup:toolKit. |
|
9745 |
self halt. |
|
9746 |
||
9747 |
JavaEventThread := Processor activeProcess. |
|
9748 |
[ |
|
9749 |
[true] whileTrue:[ |
|
9750 |
AbortSignal handle:[:ex | |
|
9751 |
ex return |
|
9752 |
] do:[ |
|
9753 |
self doWindowsEventThread. |
|
9754 |
] |
|
9755 |
]. |
|
9756 |
] valueNowOrOnUnwindDo:[ |
|
9757 |
JavaEventThread := nil. |
|
9758 |
]. |
|
9759 |
||
9760 |
"Created: / 17.11.1998 / 23:58:33 / cg" |
|
9761 |
"Modified: / 18.11.1998 / 00:13:19 / cg" |
|
9762 |
! |
|
9763 |
||
9764 |
_MToolkit_eventLoop:nativeContext |
|
9765 |
|toolKit| |
|
9766 |
||
9767 |
toolKit := nativeContext receiver. |
|
9768 |
||
9769 |
self wakeup:toolKit. |
|
9770 |
self halt. |
|
9771 |
||
9772 |
JavaEventThread := Processor activeProcess. |
|
9773 |
[ |
|
9774 |
[true] whileTrue:[ |
|
9775 |
AbortSignal handle:[:ex | |
|
9776 |
ex return |
|
9777 |
] do:[ |
|
9778 |
self doWindowsEventThread. |
|
9779 |
] |
|
9780 |
]. |
|
9781 |
] valueNowOrOnUnwindDo:[ |
|
9782 |
JavaEventThread := nil. |
|
9783 |
]. |
|
9784 |
||
9785 |
"Created: / 17.11.1998 / 23:04:29 / cg" |
|
9786 |
"Modified: / 18.11.1998 / 00:11:29 / cg" |
|
9787 |
! ! |
|
9788 |
||
380 | 9789 |
!JavaVM class methodsFor:'native - sun.awt.windows - ns4.0'! |
9790 |
||
9791 |
_WComponentPeer_setBackground:nativeContext |
|
9792 |
|jClr rgb clr view| |
|
9793 |
||
9794 |
view := self viewForWPeer:nativeContext. |
|
9795 |
||
9796 |
jClr := nativeContext argAt:1. |
|
9797 |
rgb := jClr instVarNamed:'value'. |
|
9798 |
"/ self halt. |
|
9799 |
clr := Color rgbValue:rgb. |
|
9800 |
||
9801 |
||
9802 |
clr := clr on:(view device). |
|
9803 |
||
9804 |
"/ (view superView isMemberOf:JavaEmbeddedFrameView) ifTrue:[ |
|
9805 |
"/ view viewBackground:(view superView viewBackground). |
|
9806 |
"/ view backgroundPaint:(view superView viewBackground). |
|
9807 |
"/ ] ifFalse:[ |
|
9808 |
"/ (view isMemberOf:JavaView) ifTrue:[ |
|
9809 |
"/ view viewBackground:clr. |
|
9810 |
"/ view backgroundPaint:clr. |
|
9811 |
"/ ] |
|
9812 |
"/ ]. |
|
9813 |
||
9814 |
(view isKindOf:ScrollableView) ifTrue:[ |
|
9815 |
view := view scrolledView |
|
9816 |
]. |
|
9817 |
view viewBackground:clr. |
|
9818 |
view backgroundPaint:clr. |
|
9819 |
||
9820 |
"Created: / 16.10.1998 / 02:16:31 / cg" |
|
9821 |
"Modified: / 16.10.1998 / 02:26:29 / cg" |
|
9822 |
! |
|
9823 |
||
9824 |
_WComponentPeer_setForeground:nativeContext |
|
9825 |
|jClr rgb clr view| |
|
9826 |
||
9827 |
view := self viewForWPeer:nativeContext. |
|
9828 |
||
9829 |
jClr := nativeContext argAt:1. |
|
9830 |
rgb := jClr instVarNamed:'value'. |
|
9831 |
"/ self halt. |
|
9832 |
clr := Color rgbValue:rgb. |
|
9833 |
||
9834 |
||
9835 |
clr := clr on:(view device). |
|
9836 |
||
9837 |
(view isKindOf:ScrollableView) ifTrue:[ |
|
9838 |
view := view scrolledView |
|
9839 |
]. |
|
9840 |
view paint:clr. |
|
9841 |
||
9842 |
"Created: / 16.10.1998 / 02:18:58 / cg" |
|
9843 |
"Modified: / 16.10.1998 / 02:26:37 / cg" |
|
9844 |
! |
|
9845 |
||
9846 |
_WContainerPeer_calculateInsets:nativeContext |
|
9847 |
"/ new with ns4.0 ... |
|
9848 |
||
9849 |
"Created: / 16.10.1998 / 02:12:59 / cg" |
|
9850 |
! |
|
9851 |
||
9852 |
_WFramePeer_setResizable:nativeContext |
|
9853 |
|view onOff| |
|
9854 |
||
9855 |
view := self viewForWPeer:nativeContext. |
|
9856 |
||
9857 |
onOff := (nativeContext argAt:1) == 1. |
|
9858 |
view isTopView ifTrue:[ |
|
9859 |
onOff ifTrue:[ |
|
9860 |
view minExtent:10@10. |
|
9861 |
view maxExtent:(Screen current extent). |
|
9862 |
] ifFalse:[ |
|
9863 |
view minExtent:view extent. |
|
9864 |
view maxExtent:view extent. |
|
9865 |
] |
|
9866 |
] ifFalse:[ |
|
9867 |
(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[ |
|
9868 |
self halt. |
|
9869 |
] |
|
9870 |
]. |
|
9871 |
||
9872 |
"/ 'JAVA: WWindowPeer_setResizable: ' print. view print. ' yes/no: ' print. onOff printNL. |
|
9873 |
||
9874 |
^ nil |
|
9875 |
||
9876 |
"Modified: / 16.1.1998 / 18:08:00 / cg" |
|
9877 |
"Created: / 16.10.1998 / 02:21:34 / cg" |
|
9878 |
! ! |
|
9879 |
||
440 | 9880 |
!JavaVM class methodsFor:'native - sun.misc'! |
9881 |
||
9882 |
_VM_getState:nativeContext |
|
9883 |
"/ int getState () |
|
9884 |
UnimplementedNativeMethodSignal raise |
|
9885 |
||
9886 |
"Created: / 12.11.1998 / 19:06:44 / cg" |
|
9887 |
! |
|
9888 |
||
448 | 9889 |
_VM_resetJavaMonitor:nativeContext |
9890 |
"/ void resetJavaMonitor () |
|
9891 |
UnimplementedNativeMethodSignal raise |
|
9892 |
||
9893 |
"Created: / 14.11.1998 / 10:43:23 / cg" |
|
9894 |
! |
|
9895 |
||
9896 |
_VM_resumeJavaMonitor:nativeContext |
|
9897 |
"/ void resumeJavaMonitor () |
|
9898 |
UnimplementedNativeMethodSignal raise |
|
9899 |
||
9900 |
"Created: / 14.11.1998 / 10:42:49 / cg" |
|
9901 |
! |
|
9902 |
||
9903 |
_VM_suspendJavaMonitor:nativeContext |
|
9904 |
"/ void suspendJavaMonitor () |
|
9905 |
UnimplementedNativeMethodSignal raise |
|
9906 |
||
9907 |
"Created: / 14.11.1998 / 10:43:07 / cg" |
|
9908 |
! |
|
9909 |
||
440 | 9910 |
_VM_threadsSuspended:nativeContext |
9911 |
"/ boolean threadsSuspended () |
|
9912 |
UnimplementedNativeMethodSignal raise |
|
9913 |
||
9914 |
"Created: / 12.11.1998 / 19:07:10 / cg" |
|
9915 |
! |
|
9916 |
||
9917 |
_VM_unsuspendSomeThreads:nativeContext |
|
9918 |
"/ void unsuspendSomeThreads () |
|
9919 |
UnimplementedNativeMethodSignal raise |
|
9920 |
||
9921 |
"Created: / 12.11.1998 / 19:07:29 / cg" |
|
9922 |
! |
|
9923 |
||
9924 |
_VM_unsuspendThreads:nativeContext |
|
9925 |
"/ void unsuspendThreads () |
|
9926 |
UnimplementedNativeMethodSignal raise |
|
9927 |
||
9928 |
"Created: / 12.11.1998 / 19:07:20 / cg" |
|
448 | 9929 |
! |
9930 |
||
9931 |
_VM_writeJavaMonitorReport:nativeContext |
|
9932 |
"/ void writeJavaMonitorReport () |
|
9933 |
UnimplementedNativeMethodSignal raise |
|
9934 |
||
9935 |
"Created: / 14.11.1998 / 10:43:37 / cg" |
|
440 | 9936 |
! ! |
9937 |
||
253 | 9938 |
!JavaVM class methodsFor:'semaphores & monitors'! |
9939 |
||
9940 |
monitorFor:someObject |
|
9941 |
|mon| |
|
9942 |
||
9943 |
LockTableAccess critical:[ |
|
261 | 9944 |
mon := LockTable at:someObject ifAbsent:nil. |
9945 |
mon isNil ifTrue:[ |
|
9946 |
LockTable at:someObject put:(mon := Monitor new) |
|
9947 |
] |
|
253 | 9948 |
]. |
9949 |
^ mon |
|
9950 |
||
9951 |
"Created: / 2.1.1998 / 19:01:52 / cg" |
|
9952 |
! |
|
9953 |
||
9954 |
releaseAndSignalForAllSemaphoreFor:someObject |
|
9955 |
|sema| |
|
9956 |
||
9957 |
WaitTableAccess critical:[ |
|
306 | 9958 |
sema := WaitTable at:someObject ifAbsent:nil. |
9959 |
"/ sema notNil ifTrue:[ |
|
9960 |
"/ WaitTable removeKey:someObject |
|
9961 |
"/ ] |
|
253 | 9962 |
]. |
9963 |
||
9964 |
sema notNil ifTrue:[ |
|
306 | 9965 |
sema signalForAll |
253 | 9966 |
] |
9967 |
||
9968 |
"Created: / 2.1.1998 / 18:21:51 / cg" |
|
306 | 9969 |
"Modified: / 3.2.1998 / 16:11:58 / cg" |
253 | 9970 |
! |
9971 |
||
9972 |
releaseAndSignalSemaphoreFor:someObject |
|
9973 |
|sema| |
|
9974 |
||
9975 |
WaitTableAccess critical:[ |
|
306 | 9976 |
sema := WaitTable at:someObject ifAbsent:nil. |
9977 |
"/ sema notNil ifTrue:[ |
|
9978 |
"/ WaitTable removeKey:someObject |
|
9979 |
"/ ] |
|
253 | 9980 |
]. |
9981 |
||
9982 |
sema notNil ifTrue:[ |
|
306 | 9983 |
sema signal |
253 | 9984 |
] |
9985 |
||
9986 |
"Created: / 2.1.1998 / 18:20:20 / cg" |
|
306 | 9987 |
"Modified: / 3.2.1998 / 16:11:51 / cg" |
253 | 9988 |
! |
9989 |
||
9990 |
releaseSemaphoreFor:someObject |
|
9991 |
WaitTableAccess critical:[ |
|
261 | 9992 |
WaitTable removeKey:someObject ifAbsent:nil |
253 | 9993 |
] |
9994 |
||
9995 |
"Created: / 2.1.1998 / 18:17:14 / cg" |
|
9996 |
"Modified: / 2.1.1998 / 21:52:03 / cg" |
|
9997 |
! |
|
9998 |
||
9999 |
semaphoreFor:someObject |
|
10000 |
|sema| |
|
10001 |
||
10002 |
WaitTableAccess critical:[ |
|
261 | 10003 |
sema := WaitTable at:someObject ifAbsent:nil. |
10004 |
sema isNil ifTrue:[ |
|
10005 |
WaitTable at:someObject put:(sema := Semaphore new) |
|
10006 |
] |
|
253 | 10007 |
]. |
10008 |
^ sema |
|
10009 |
||
10010 |
"Created: / 2.1.1998 / 18:15:59 / cg" |
|
10011 |
"Modified: / 2.1.1998 / 18:20:31 / cg" |
|
10012 |
! ! |
|
10013 |
||
10014 |
!JavaVM class methodsFor:'vm support'! |
|
10015 |
||
10016 |
monitorEnter:someObject |
|
10017 |
| mon thisProcess| |
|
10018 |
||
10019 |
someObject isNil ifTrue:[ |
|
261 | 10020 |
self halt |
253 | 10021 |
]. |
10022 |
||
10023 |
mon := self monitorFor:someObject. |
|
10024 |
||
10025 |
MonitorTrace ifTrue:[ |
|
261 | 10026 |
('====> entering monitor for ' , someObject displayString , ' in ' , Processor activeProcess name , ' ...') printCR. |
253 | 10027 |
]. |
10028 |
mon enter. |
|
10029 |
MonitorTrace ifTrue:[ |
|
261 | 10030 |
('====> entered it in ' , Processor activeProcess name , ' ...') printCR. |
253 | 10031 |
]. |
10032 |
||
10033 |
self enteredMonitors add:someObject. |
|
10034 |
||
10035 |
"Created: / 2.1.1998 / 23:44:49 / cg" |
|
10036 |
"Modified: / 3.1.1998 / 03:05:02 / cg" |
|
10037 |
! |
|
10038 |
||
10039 |
monitorExit:someObject |
|
10040 |
| mon thisProcess| |
|
10041 |
||
10042 |
someObject isNil ifTrue:[ |
|
261 | 10043 |
self halt |
253 | 10044 |
]. |
10045 |
||
10046 |
mon := self monitorFor:someObject. |
|
10047 |
||
10048 |
MonitorTrace ifTrue:[ |
|
261 | 10049 |
('====> leaving monitor for ' , someObject displayString , ' in ' , Processor activeProcess name , ' ...') printCR. |
253 | 10050 |
]. |
10051 |
mon exit. |
|
10052 |
MonitorTrace ifTrue:[ |
|
261 | 10053 |
('====> left it in ' , Processor activeProcess name , ' ...') printCR. |
253 | 10054 |
]. |
10055 |
||
10056 |
"/ enteredMonitorHandles isNil ifTrue:[ |
|
10057 |
"/ self halt:'oops - no monitor entered'. |
|
10058 |
"/ ]. |
|
10059 |
||
10060 |
self enteredMonitors removeLast ~~ someObject ifTrue:[ |
|
261 | 10061 |
self halt:'oops - monitor enter/exit nesting wrong' |
253 | 10062 |
]. |
10063 |
||
10064 |
"Created: / 2.1.1998 / 23:47:28 / cg" |
|
10065 |
"Modified: / 3.1.1998 / 03:05:18 / cg" |
|
10066 |
! ! |
|
10067 |
||
255 | 10068 |
!JavaVM class methodsFor:'windows - events'! |
10069 |
||
10070 |
awtEventsForEvent:anEvent javaWindow:jWin |
|
10071 |
"given an ST/X event, create corresponding AWT event(s) for it" |
|
10072 |
||
10073 |
|jEv jEv1 jEv2 |
|
261 | 10074 |
modifiers key keyChar untranslatedKey id |
466 | 10075 |
type x y w h view menu resized moved |
255 | 10076 |
eventArgs clickCount jRect |
10077 |
jKeyEventClass jInputEventClass jMouseEventClass |
|
10078 |
jWindowEventClass jPaintEventClass jComponentEventClass| |
|
10079 |
||
10080 |
type := anEvent type. |
|
10081 |
eventArgs := anEvent arguments. |
|
10082 |
||
10083 |
key := 0. |
|
10084 |
modifiers := 0. |
|
10085 |
x := 0. |
|
10086 |
y := 0. |
|
10087 |
||
476 | 10088 |
|
10089 |
((type == #'exposeX:y:width:height:') |
|
10090 |
or:[(type == #'graphicExposeX:y:width:height:') |
|
10091 |
or:[(type == #damage)]]) ifTrue:[ |
|
10092 |
"/ jWindowEventClass := Java classForName:'java.awt.event.WindowEvent'. |
|
10093 |
"/ id := (jPaintEventClass instVarNamed:'PAINT'). |
|
10094 |
||
10095 |
jPaintEventClass := Java classForName:'java.awt.event.PaintEvent'. |
|
10096 |
id := (jPaintEventClass instVarNamed:'UPDATE'). |
|
10097 |
||
10098 |
((type == #'exposeX:y:width:height:') |
|
10099 |
or:[(type == #'graphicExposeX:y:width:height:')]) ifTrue:[ |
|
10100 |
x := eventArgs at:1. |
|
10101 |
y := eventArgs at:2. |
|
10102 |
w := eventArgs at:3. |
|
10103 |
h := eventArgs at:4. |
|
10104 |
] ifFalse:[ |
|
10105 |
x := eventArgs left. |
|
10106 |
y := eventArgs top. |
|
10107 |
w := eventArgs width. |
|
10108 |
h := eventArgs height. |
|
10109 |
]. |
|
10110 |
jRect := (Java classForName:'java.awt.Rectangle') basicNew. |
|
10111 |
jRect instVarNamed:'x' put:x. |
|
10112 |
jRect instVarNamed:'y' put:y. |
|
10113 |
jRect instVarNamed:'width' put:w. |
|
10114 |
jRect instVarNamed:'height' put:h. |
|
10115 |
||
10116 |
jEv := jPaintEventClass newCleared "basicNew". |
|
10117 |
jEv instVarNamed:'id' put:id. |
|
10118 |
jEv instVarNamed:'updateRect' put:jRect. |
|
10119 |
||
10120 |
"/ jEv instVarNamed:'g' put:jWin. |
|
10121 |
||
10122 |
^ Array with:jEv. |
|
10123 |
]. |
|
10124 |
||
255 | 10125 |
(anEvent isKeyEvent |
10126 |
or:[anEvent isButtonEvent |
|
10127 |
or:[anEvent isPointerEnterLeaveEvent]]) ifTrue:[ |
|
439 | 10128 |
jInputEventClass := Java classForName:'java.awt.event.InputEvent'. |
10129 |
||
255 | 10130 |
anEvent hasAlt ifTrue:[ |
10131 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'ALT_MASK') |
|
10132 |
]. |
|
10133 |
anEvent hasCtrl ifTrue:[ |
|
10134 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'CTRL_MASK') |
|
10135 |
]. |
|
10136 |
anEvent hasMeta ifTrue:[ |
|
10137 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'META_MASK') |
|
10138 |
]. |
|
10139 |
anEvent hasShift ifTrue:[ |
|
10140 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'SHIFT_MASK') |
|
10141 |
]. |
|
10142 |
anEvent hasButton1 ifTrue:[ |
|
10143 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'BUTTON1_MASK') |
|
10144 |
]. |
|
10145 |
anEvent hasButton2 ifTrue:[ |
|
10146 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'BUTTON2_MASK') |
|
10147 |
]. |
|
10148 |
anEvent hasButton3 ifTrue:[ |
|
10149 |
modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'BUTTON3_MASK') |
|
10150 |
]. |
|
10151 |
||
10152 |
anEvent isPointerEnterLeaveEvent ifFalse:[ |
|
10153 |
"/ ST/X does not (yet) record this information |
|
10154 |
"/ with pointerLeave events. |
|
10155 |
||
10156 |
x := anEvent x. |
|
10157 |
y := anEvent y. |
|
10158 |
]. |
|
10159 |
]. |
|
10160 |
||
10161 |
anEvent isKeyEvent ifTrue:[ |
|
10162 |
jKeyEventClass := Java classForName:'java.awt.event.KeyEvent'. |
|
10163 |
||
10164 |
key := 0. |
|
10165 |
keyChar := 0. |
|
10166 |
||
10167 |
key := anEvent key. |
|
10168 |
key isCharacter ifTrue:[ |
|
10169 |
key := keyChar := key asciiValue |
|
10170 |
] ifFalse:[ |
|
10171 |
untranslatedKey := anEvent view device keyboardMap keyAtValue:key ifAbsent:key. |
|
10172 |
untranslatedKey == #Delete ifTrue:[ |
|
10173 |
key := jKeyEventClass instVarNamed:'VK_DELETE' "/ 127 |
|
10174 |
]. |
|
10175 |
untranslatedKey == #BackSpace ifTrue:[ |
|
10176 |
key := jKeyEventClass instVarNamed:'VK_BACK_SPACE' "/ 8 |
|
10177 |
]. |
|
10178 |
untranslatedKey == #Return ifTrue:[ |
|
10179 |
key := jKeyEventClass instVarNamed:'VK_ENTER' "/ 13 |
|
10180 |
]. |
|
10181 |
untranslatedKey == #Tab ifTrue:[ |
|
10182 |
key := jKeyEventClass instVarNamed:'VK_TAB' "/ 9 |
|
10183 |
]. |
|
10184 |
untranslatedKey == #Home ifTrue:[ |
|
10185 |
key := jKeyEventClass instVarNamed:'VK_HOME' |
|
10186 |
]. |
|
10187 |
untranslatedKey == #End ifTrue:[ |
|
10188 |
key := jKeyEventClass instVarNamed:'VK_END' |
|
10189 |
]. |
|
10190 |
untranslatedKey == #Prior ifTrue:[ |
|
10191 |
key := jKeyEventClass instVarNamed:'VK_PAGE_UP' |
|
10192 |
]. |
|
10193 |
key == #EndOfText ifTrue:[ |
|
10194 |
key := jKeyEventClass instVarNamed:'VK_PAGE_DOWN' |
|
10195 |
]. |
|
10196 |
untranslatedKey == #CursorUp ifTrue:[ |
|
10197 |
key := jKeyEventClass instVarNamed:'VK_UP' |
|
10198 |
]. |
|
10199 |
untranslatedKey == #CursorDown ifTrue:[ |
|
10200 |
key := jKeyEventClass instVarNamed:'VK_DOWN' |
|
10201 |
]. |
|
10202 |
untranslatedKey == #CursorLeft ifTrue:[ |
|
10203 |
key := jKeyEventClass instVarNamed:'VK_LEFT' |
|
10204 |
]. |
|
10205 |
untranslatedKey == #CursorRight ifTrue:[ |
|
10206 |
key := jKeyEventClass instVarNamed:'VK_RIGHT' |
|
10207 |
]. |
|
10208 |
(#( F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11) |
|
10209 |
includes:untranslatedKey) ifTrue:[ |
|
10210 |
key := jKeyEventClass instVarNamed:('VK_' , untranslatedKey) |
|
10211 |
]. |
|
10212 |
]. |
|
10213 |
(type == #'keyPress:x:y:') ifTrue:[ |
|
10214 |
id := jKeyEventClass instVarNamed:'KEY_PRESSED' |
|
10215 |
] ifFalse:[ |
|
10216 |
id := jKeyEventClass instVarNamed:'KEY_RELEASED' |
|
10217 |
]. |
|
261 | 10218 |
jEv := jKeyEventClass newCleared "basicNew". |
255 | 10219 |
jEv instVarNamed:'modifiers' put:modifiers. |
10220 |
jEv instVarNamed:'keyCode' put:key. |
|
10221 |
jEv instVarNamed:'keyChar' put:keyChar. |
|
10222 |
jEv instVarNamed:'id' put:id. |
|
10223 |
"/ jEv instVarNamed:'x' put:x. |
|
10224 |
"/ jEv instVarNamed:'y' put:y. |
|
10225 |
jEv instVarNamed:'when' put:(OperatingSystem getMillisecondTime). |
|
10226 |
^ Array with:jEv |
|
10227 |
]. |
|
10228 |
||
10229 |
(anEvent isButtonEvent |
|
10230 |
or:[anEvent isPointerEnterLeaveEvent]) ifTrue:[ |
|
10231 |
jMouseEventClass := Java classForName:'java.awt.event.MouseEvent'. |
|
10232 |
clickCount := 1. |
|
10233 |
||
10234 |
(type == #'buttonPress:x:y:') ifTrue:[ |
|
270 | 10235 |
id := jMouseEventClass instVarNamed:'MOUSE_PRESSED'. |
255 | 10236 |
] ifFalse:[ |
10237 |
(type == #'buttonRelease:x:y:') ifTrue:[ |
|
270 | 10238 |
id := jMouseEventClass instVarNamed:'MOUSE_RELEASED'. |
255 | 10239 |
] ifFalse:[ |
10240 |
(type == #'buttonMotion:x:y:') ifTrue:[ |
|
439 | 10241 |
anEvent state == 0 ifTrue:[ |
270 | 10242 |
id := jMouseEventClass instVarNamed:'MOUSE_MOVED'. |
10243 |
] ifFalse:[ |
|
10244 |
id := jMouseEventClass instVarNamed:'MOUSE_DRAGGED'. |
|
10245 |
]. |
|
255 | 10246 |
] ifFalse:[ |
10247 |
"/ (type == #'pointerMotion:x:y:') ifTrue:[ |
|
270 | 10248 |
"/ id := jMouseEventClass instVarNamed:'MOUSE_MOVED'. |
255 | 10249 |
"/ ] ifFalse:[ |
10250 |
(type == #'pointerEnter:x:y:') ifTrue:[ |
|
270 | 10251 |
id := jMouseEventClass instVarNamed:'MOUSE_ENTERED'. |
255 | 10252 |
] ifFalse:[ |
10253 |
(type == #'pointerLeave:') ifTrue:[ |
|
270 | 10254 |
id := jMouseEventClass instVarNamed:'MOUSE_EXITED'. |
255 | 10255 |
] ifFalse:[ |
10256 |
(type == #'buttonMultiPress:x:y:') ifTrue:[ |
|
10257 |
id := jMouseEventClass instVarNamed:'MOUSE_PRESSED'. |
|
10258 |
clickCount := 2. |
|
10259 |
] ifFalse:[ |
|
10260 |
self halt. |
|
10261 |
] |
|
10262 |
] |
|
10263 |
"/ ] |
|
10264 |
] |
|
10265 |
] |
|
10266 |
] |
|
10267 |
]. |
|
261 | 10268 |
jEv := jMouseEventClass newCleared "basicNew". |
255 | 10269 |
jEv instVarNamed:'modifiers' put:modifiers. |
10270 |
jEv instVarNamed:'id' put:id. |
|
10271 |
jEv instVarNamed:'x' put:x. |
|
10272 |
jEv instVarNamed:'y' put:y. |
|
10273 |
jEv instVarNamed:'when' put:(OperatingSystem getMillisecondTime). |
|
10274 |
^ Array with:jEv |
|
10275 |
]. |
|
10276 |
||
10277 |
||
10278 |
(type == #'configureX:y:width:height:') ifTrue:[ |
|
261 | 10279 |
"/ x := eventArgs at:1. |
10280 |
"/ y := eventArgs at:2. |
|
10281 |
||
10282 |
view := anEvent view. |
|
466 | 10283 |
x := eventArgs at:1. |
10284 |
y := eventArgs at:2. |
|
261 | 10285 |
w := eventArgs at:3. |
10286 |
h := eventArgs at:4. |
|
10287 |
||
466 | 10288 |
resized := moved := true. |
10289 |
(w == view width and:[h == view height]) ifTrue:[ |
|
10290 |
resized := false. |
|
10291 |
]. |
|
10292 |
(x == view left and:[y == view top]) ifTrue:[ |
|
10293 |
moved := false. |
|
10294 |
]. |
|
10295 |
||
261 | 10296 |
"/ |
10297 |
"/ must change the components extent |
|
10298 |
"/ is there no cleaner way to do this ? |
|
10299 |
"/ |
|
10300 |
view isTopView ifTrue:[ |
|
466 | 10301 |
|
261 | 10302 |
"/ |
10303 |
"/ sigh - don't include the menu. |
|
10304 |
"/ |
|
10305 |
menu := self topViewsMenu:view. |
|
10306 |
menu notNil ifTrue:[ |
|
10307 |
"/ must add the menus height |
|
10308 |
h := h - menu height |
|
10309 |
] |
|
10310 |
]. |
|
466 | 10311 |
|
261 | 10312 |
jWin instVarNamed:'width' put:w. |
10313 |
jWin instVarNamed:'height' put:h. |
|
10314 |
||
255 | 10315 |
jComponentEventClass := Java classForName:'java.awt.event.ComponentEvent'. |
466 | 10316 |
moved ifTrue:[ |
10317 |
id := (jComponentEventClass instVarNamed:'COMPONENT_MOVED'). |
|
10318 |
jEv1 := jComponentEventClass newCleared "basicNew". |
|
10319 |
jEv1 instVarNamed:'id' put:id. |
|
10320 |
]. |
|
10321 |
resized ifTrue:[ |
|
10322 |
id := (jComponentEventClass instVarNamed:'COMPONENT_RESIZED'). |
|
10323 |
jEv2 := jComponentEventClass newCleared "basicNew". |
|
10324 |
jEv2 instVarNamed:'id' put:id. |
|
10325 |
]. |
|
10326 |
jEv1 isNil ifTrue:[ |
|
10327 |
jEv2 isNil ifTrue:[^ nil]. |
|
10328 |
^ Array with:jEv2 |
|
10329 |
] ifFalse:[ |
|
10330 |
jEv2 isNil ifTrue:[ |
|
10331 |
^ Array with:jEv1 |
|
10332 |
] |
|
10333 |
]. |
|
255 | 10334 |
^ Array with:jEv1 with:jEv2. |
10335 |
]. |
|
10336 |
(type == #'focusIn') ifTrue:[ |
|
318 | 10337 |
"/ 'focusIn' printCR. |
255 | 10338 |
jComponentEventClass := Java classForName:'java.awt.event.FocusEvent'. |
10339 |
id := (jComponentEventClass instVarNamed:'FOCUS_GAINED'). |
|
261 | 10340 |
jEv := jComponentEventClass newCleared "basicNew". |
255 | 10341 |
jEv instVarNamed:'id' put:id. |
10342 |
^ Array with:jEv. |
|
10343 |
]. |
|
10344 |
(type == #'focusOut') ifTrue:[ |
|
318 | 10345 |
"/ 'focusOut' printCR. |
255 | 10346 |
jComponentEventClass := Java classForName:'java.awt.event.FocusEvent'. |
10347 |
id := (jComponentEventClass instVarNamed:'FOCUS_LOST'). |
|
261 | 10348 |
jEv := jComponentEventClass newCleared "basicNew". |
255 | 10349 |
jEv instVarNamed:'id' put:id. |
10350 |
^ Array with:jEv. |
|
10351 |
]. |
|
10352 |
(type == #'mapped') ifTrue:[ |
|
318 | 10353 |
"/ 'mapped' printCR. |
255 | 10354 |
jComponentEventClass := Java classForName:'java.awt.event.ComponentEvent'. |
10355 |
id := (jComponentEventClass instVarNamed:'COMPONENT_SHOWN'). |
|
10356 |
"/ x := eventArgs at:1. |
|
10357 |
"/ y := eventArgs at:2. |
|
261 | 10358 |
jEv := jComponentEventClass newCleared "basicNew". |
255 | 10359 |
jEv instVarNamed:'id' put:id. |
10360 |
^ Array with:jEv. |
|
10361 |
]. |
|
10362 |
(type == #'unmapped') ifTrue:[ |
|
318 | 10363 |
"/ 'unmapped' printCR. |
255 | 10364 |
jComponentEventClass := Java classForName:'java.awt.event.ComponentEvent'. |
10365 |
id := (jComponentEventClass instVarNamed:'COMPONENT_HIDDEN'). |
|
10366 |
"/ x := eventArgs at:1. |
|
10367 |
"/ y := eventArgs at:2. |
|
261 | 10368 |
jEv := jComponentEventClass newCleared "basicNew". |
255 | 10369 |
jEv instVarNamed:'id' put:id. |
10370 |
^ Array with:jEv. |
|
10371 |
]. |
|
10372 |
||
10373 |
(type == #terminate) ifTrue:[ |
|
10374 |
jWindowEventClass := Java classForName:'java.awt.event.WindowEvent'. |
|
474 | 10375 |
id := (jWindowEventClass instVarNamed:'WINDOW_CLOSING'). |
10376 |
"/OLD id := (jWindowEventClass instVarNamed:'WINDOW_CLOSED'). |
|
261 | 10377 |
jEv := jWindowEventClass newCleared "basicNew". |
255 | 10378 |
jEv instVarNamed:'id' put:id. |
10379 |
^ Array with:jEv. |
|
10380 |
]. |
|
439 | 10381 |
|
319 | 10382 |
EventTrace == true ifTrue:[ |
10383 |
('JAVA: unhandled event:' , type) infoPrintCR. |
|
10384 |
]. |
|
255 | 10385 |
^ nil. |
10386 |
||
10387 |
"Created: / 6.1.1998 / 20:38:58 / cg" |
|
477 | 10388 |
"Modified: / 3.12.1998 / 13:49:31 / cg" |
255 | 10389 |
! |
10390 |
||
10391 |
doWindowsEventThread |
|
10392 |
"invoked in an endless loop by the WToolkit-eventLoop |
|
10393 |
native method." |
|
10394 |
||
270 | 10395 |
|sensor event more| |
255 | 10396 |
|
10397 |
JavaWindowGroup isNil ifTrue:[ |
|
270 | 10398 |
"/ '*** eventThread: no windowGroup ...' printCR. |
284 | 10399 |
FirstWindowCreationSemaphore wait. |
10400 |
"/ Delay waitForSeconds:0.1. |
|
270 | 10401 |
^ self |
255 | 10402 |
]. |
10403 |
||
10404 |
KnownWindows isNil ifTrue:[ |
|
270 | 10405 |
"/ '*** eventThread: no views ...' printCR. |
284 | 10406 |
FirstWindowCreationSemaphore wait. |
10407 |
"/ Delay waitForSeconds:0.1. |
|
270 | 10408 |
^ self |
255 | 10409 |
]. |
10410 |
||
10411 |
"/ wait for an event to arrive ... |
|
10412 |
||
10413 |
sensor := JavaWindowGroup sensor. |
|
329 | 10414 |
[sensor hasEvents or:[sensor damageCount ~~ 0]] whileFalse:[ |
270 | 10415 |
EventTrace ifTrue:[ |
10416 |
'*** eventThread waiting ...' printCR. |
|
10417 |
]. |
|
10418 |
Processor activeProcess state:#eventWait. |
|
10419 |
sensor eventSemaphore wait. |
|
255 | 10420 |
]. |
10421 |
||
10422 |
EventTrace ifTrue:[ |
|
270 | 10423 |
'*** eventThread event arrived ...' printCR. |
255 | 10424 |
]. |
10425 |
||
10426 |
"/ EventTrace := true |
|
270 | 10427 |
more := true. |
10428 |
[more] whileTrue:[ |
|
10429 |
sensor hasDamage ifTrue:[ |
|
10430 |
EventTrace ifTrue:[ |
|
10431 |
'*** eventThread: damage arrived ...' printCR. |
|
10432 |
]. |
|
10433 |
event := sensor nextDamage. |
|
10434 |
] ifFalse:[ |
|
10435 |
event := sensor nextEvent. |
|
10436 |
]. |
|
10437 |
event isNil ifTrue:[ |
|
319 | 10438 |
EventTrace == true ifTrue:[ |
10439 |
'*** eventThread: nil event ignored' printCR. |
|
10440 |
]. |
|
270 | 10441 |
^ self |
10442 |
]. |
|
10443 |
||
10444 |
more := self processEvent:event |
|
10445 |
] |
|
255 | 10446 |
|
10447 |
"Created: / 6.1.1998 / 21:02:40 / cg" |
|
329 | 10448 |
"Modified: / 5.4.1998 / 16:10:53 / cg" |
255 | 10449 |
! |
10450 |
||
10451 |
processEvent:event |
|
439 | 10452 |
|evQ jEvents jWToolKitClass jWToolKit jWinPeer jWin v eventConsumed| |
255 | 10453 |
|
10454 |
KnownWindows isNil ifTrue:[ |
|
270 | 10455 |
^ false |
255 | 10456 |
]. |
10457 |
||
10458 |
v := event view. |
|
261 | 10459 |
jWinPeer := self jPeerForView:v. |
255 | 10460 |
jWinPeer isNil ifTrue:[ |
474 | 10461 |
((v isKindOf:JavaView) or:[v isKindOf:JavaTopView]) ifTrue:[ |
261 | 10462 |
"/ mhmh - an event for a JavaView, |
10463 |
"/ which has no peer (anyMore ?) |
|
10464 |
"/ should not happen. |
|
10465 |
] ifFalse:[ |
|
10466 |
"/ mhmh - an event for a subcomponent of an ST widget. |
|
10467 |
"/ let it be handled normally. |
|
255 | 10468 |
EventTrace ifTrue:[ |
261 | 10469 |
('*** eventThread: ' , event type , '-event for unknown java-view - passed to view.') printCR. |
255 | 10470 |
]. |
359 | 10471 |
event view dispatchEvent:event. |
255 | 10472 |
]. |
270 | 10473 |
^ true |
261 | 10474 |
]. |
10475 |
||
10476 |
"/ change: |
|
10477 |
"/ in the previous version, events for ST/X widgets (i.e. buttons etc) |
|
10478 |
"/ where not passed to java, but instead forwarded directly to the widget |
|
10479 |
"/ by the code below. |
|
10480 |
"/ This has changed, to pass it to Java, which eventually passes it to the |
|
10481 |
"/ peer via the handleEvent native method (unless the event got consumed). |
|
10482 |
"/ This is req'd to let java keep track of keyboard/mouse input for widgets. |
|
10483 |
||
10484 |
false ifTrue:[ |
|
10485 |
"/ "/ most views handle their events themself (being ST/X views) ... |
|
10486 |
"/ |
|
10487 |
"/ v class ~~ JavaView ifTrue:[ |
|
10488 |
"/"/ v class ~~ StandardSystemView ifTrue:[ |
|
10489 |
"/"/ EventTrace ifTrue:[ |
|
10490 |
"/"/ ('*** eventThread: event handled by view itself (' , v class name , ')') printCR. |
|
10491 |
"/"/ ]. |
|
10492 |
"/"/ event sendEventWithFocusOn:nil. |
|
10493 |
"/"/ ^ self. |
|
10494 |
"/"/ ]. |
|
10495 |
"/ (event type == #'exposeX:y:width:height' |
|
10496 |
"/ or:[event type == #'graphicsExposeX:y:width:height']) ifTrue:[ |
|
10497 |
"/ "/ send to view, but also handle in JAVA |
|
10498 |
"/ event sendEventWithFocusOn:nil. |
|
10499 |
"/ ] |
|
10500 |
"/ ]. |
|
10501 |
||
10502 |
(#( |
|
10503 |
#'mapped' |
|
10504 |
#'unmapped' |
|
10505 |
#'configureX:y:width:height:' |
|
10506 |
#'exposeX:y:width:height:' |
|
10507 |
#'graphicsExposeX:y:width:height:' |
|
10508 |
) includes:event type) ifTrue:[ |
|
255 | 10509 |
event sendEventWithFocusOn:nil. |
10510 |
]. |
|
261 | 10511 |
]. |
10512 |
||
10513 |
"/ what a kludge - some events are passed back to |
|
10514 |
"/ ST via the WComponent-handleEvent native method. |
|
10515 |
"/ However, repaints are not. |
|
10516 |
"/ In order to let ST widgets do the drawing, |
|
10517 |
"/ selectively filter exposeEvents from Java ... |
|
10518 |
||
10519 |
eventConsumed := false. |
|
474 | 10520 |
(v class == JavaView or:[v class == JavaTopView]) ifTrue:[ |
261 | 10521 |
"/ all events handled by Java ... |
10522 |
] ifFalse:[ |
|
10523 |
eventConsumed := true. |
|
10524 |
||
10525 |
"/ let widget handle it. |
|
359 | 10526 |
event view dispatchEvent:event. |
261 | 10527 |
|
10528 |
"/ some are not passed to Java ... |
|
10529 |
event isDamage ifTrue:[ |
|
480 | 10530 |
(v isKindOf:Button) ifTrue:[ |
10531 |
^ true |
|
10532 |
]. |
|
261 | 10533 |
(v isKindOf:TextView) ifTrue:[ |
270 | 10534 |
^ true |
10535 |
]. |
|
10536 |
(v isKindOf:Label) ifTrue:[ |
|
10537 |
^ true |
|
10538 |
]. |
|
10539 |
(v isKindOf:ComboBoxView) ifTrue:[ |
|
10540 |
^ true |
|
10541 |
]. |
|
10542 |
(v isKindOf:ScrollBar) ifTrue:[ |
|
261 | 10543 |
^ self |
10544 |
]. |
|
270 | 10545 |
(v isKindOf:Scroller) ifTrue:[ |
261 | 10546 |
^ self |
10547 |
]. |
|
270 | 10548 |
(v isKindOf:MenuPanel) ifTrue:[ |
10549 |
^ true |
|
10550 |
]. |
|
261 | 10551 |
]. |
10552 |
]. |
|
255 | 10553 |
|
10554 |
jWin := jWinPeer instVarNamed:'target'. |
|
10555 |
||
10556 |
EventTrace ifTrue:[ |
|
10557 |
('*** eventThread: event (' , event type , ') handled by JAVA: ') infoPrint. |
|
10558 |
jWinPeer class name infoPrint. ' (' infoPrint. |
|
10559 |
jWin class name infoPrint. ')' infoPrintCR. |
|
10560 |
]. |
|
10561 |
||
10562 |
"/ create an event |
|
10563 |
||
10564 |
jEvents := self awtEventsForEvent:event javaWindow:jWin. |
|
10565 |
jEvents isNil ifTrue:[ |
|
10566 |
EventTrace ifTrue:[ |
|
10567 |
('*** eventThread: event ignored: ' , event type) printCR. |
|
10568 |
]. |
|
270 | 10569 |
^ true |
255 | 10570 |
]. |
10571 |
||
10572 |
"/ v superView isNil ifTrue:[ |
|
10573 |
"/ ('*** eventThread: event ignored for topView: ' , event type) printCR. |
|
10574 |
"/ ^ self |
|
10575 |
"/ ]. |
|
10576 |
||
439 | 10577 |
jWToolKitClass := Java classForName:'java.awt.Toolkit'. |
10578 |
"/ jWToolKit := jWToolKitClass perform:#getDefaultToolkit. |
|
10579 |
jWToolKit := jWToolKitClass performStatic:#'getDefaultToolkit()Ljava/awt/Toolkit;'. |
|
255 | 10580 |
|
10581 |
jEvents do:[:jEv | |
|
10582 |
jEv instVarNamed:'source' put:jWin. |
|
10583 |
jEv instVarNamed:'consumed' put:0. |
|
261 | 10584 |
eventConsumed ifFalse:[ |
10585 |
"/ the first gets the original event as data |
|
10586 |
jEv instVarNamed:'data' put:event. |
|
10587 |
eventConsumed := true |
|
10588 |
]. |
|
255 | 10589 |
|
10590 |
"/ post it (them) to the event queue |
|
318 | 10591 |
EventTrace == true ifTrue:[ |
10592 |
'postEvent to Java ...' printCR. |
|
10593 |
]. |
|
439 | 10594 |
jWToolKit "class" perform:#'postEvent(Ljava/awt/AWTEvent;)V' with:jEv. |
255 | 10595 |
]. |
10596 |
||
270 | 10597 |
^ false |
10598 |
||
255 | 10599 |
"Created: / 6.1.1998 / 20:36:36 / cg" |
480 | 10600 |
"Modified: / 3.12.1998 / 20:38:48 / cg" |
255 | 10601 |
! ! |
10602 |
||
253 | 10603 |
!JavaVM class methodsFor:'documentation'! |
10604 |
||
10605 |
version |
|
480 | 10606 |
^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaVM.st,v 1.89 1998/12/03 20:38:52 cg Exp $' |
253 | 10607 |
! ! |
10608 |
JavaVM initialize! |