src/JavaVM.st
author vranyj1
Sat, 10 Dec 2011 13:41:08 +0000
branchjk_new_structure
changeset 1260 754bc2f9700c
parent 1257 f0ffc3c928dd
child 1263 451695d79afa
permissions -rw-r--r--
(none)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     1
"
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 873
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1151
diff changeset
     3
1155
vranyj1
parents: 1152
diff changeset
     4
 New code and modifications done at SWING Research Group [1]:
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1151
diff changeset
     5
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 873
diff changeset
     6
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 873
diff changeset
     7
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 873
diff changeset
     8
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     9
 This software is furnished under a license and may be used
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    10
 only in accordance with the terms of that license and with the
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    12
 be provided or otherwise made available to, or used by, any
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    13
 other person.  No title to or ownership of the software is
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    14
 hereby transferred.
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 873
diff changeset
    15
1155
vranyj1
parents: 1152
diff changeset
    16
 [1] Code written at SWING Research Group contains a signature
vranyj1
parents: 1152
diff changeset
    17
     of one of the above copright owners. For exact set of such code,
vranyj1
parents: 1152
diff changeset
    18
     see the differences between this version and version stx:libjava
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1151
diff changeset
    19
     as of 1.9.2010
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    20
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    21
"{ Package: 'stx:libjava' }"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    22
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    23
Object subclass:#JavaVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    24
	instanceVariableNames:''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    25
	classVariableNames:'UnhandledJavaExceptionSignal JavaExceptionSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    26
		UnimplementedInstructionSignal UnimplementedNativeMethodSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    27
		BadMessageSignal InternalErrorSignal CallHandlerSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    28
		FullExceptionTrace StackTrace TraceHistory LockTable
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    29
		LockTableAccess LibPath SimulatedLibs LoadedLibs
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    30
		SimulatedNativeLibs LoadedNativeLibs WaitTable WaitTableAccess
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    31
		JavaWindowGroup KnownWindows DrawOPTrace WindowOPTrace
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    32
		WindowCreationTrace EventTrace ThreadTrace MonitorTrace
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    33
		ExceptionTrace InsnCount InsnCounts FileOpenTrace FileAccessTrace
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    34
		FileOpenConfirmation SocketConnectConfirmation FileIOTrace
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    35
		OpenFileTable CachedNativeMethodTable ExceptionDebug ExitDebug
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    36
		JavaConsoleStream StandardThreadGroup EnteredMonitorsPerProcess
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
    37
		AcquiredMonitorsPerProcess JavaMethods DUMMY_LONG_HIGHWORD
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
    38
		DUMMY_DOUBLE_HIGHWORD NoAudio FirstWindowCreationSemaphore
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
    39
		PermittedDirectories PermittedHostConnects SimulatedOS
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
    40
		O_WGgraphics_originX O_WGgraphics_originY O_WGgraphics_pData
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
    41
		O_FramePeer_pNativeWidget O_FramePeer_pData ImageStretchCache
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
    42
		LastGraphics LastGC EnteredMonitorObject
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
    43
		EnteredMonitorObjectCount EnteredMonitorProcess LeftMonitorObject
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
    44
		JavaEventThread JavaScreenUpdaterThread JavaEventQueueThread
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
    45
		SystemProperties ExceptionDebugPatterns NullPointerExceptionDebug
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    46
		DivisionByZeroExceptionDebug IOExceptionDebug
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    47
		StdinReplacementFileQuerySignal AssertionsEnabled
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    48
		SimulatedNativeMemory Reflection ZipCache ZipEntryCache
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
    49
		ZipLastModTimesCache ZipInflaters JavaPrivilegedAccessQuery
1109
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
    50
		ClassRegistry SystemClassLoader ExtClassLoader StartupTime
1185
f13a7d1c7385 process javaProtocol
hlopkmar
parents: 1183
diff changeset
    51
		FinalizationEnabled FinalizationLobby ParkUnparkSemaphores
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
    52
		threadInterrupts EagerResolvingEnabled'
1060
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
    53
	poolDictionaries:'JavaConstants'
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    54
	category:'Languages-Java-Support'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    55
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    56
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    57
Object subclass:#Reflection
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
    58
	instanceVariableNames:'vm constantPoolMapping javaClasses javaArrayClasses
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
    59
		javaMethodsPerMethod returnNilIfMissing realMethods'
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    60
	classVariableNames:''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    61
	poolDictionaries:''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    62
	privateIn:JavaVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    63
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    64
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    65
!JavaVM class methodsFor:'documentation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    66
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    67
copyright
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    68
"
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 873
diff changeset
    69
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1151
diff changeset
    70
1155
vranyj1
parents: 1152
diff changeset
    71
 New code and modifications done at SWING Research Group [1]:
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1151
diff changeset
    72
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 873
diff changeset
    73
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 873
diff changeset
    74
                            SWING Research Group, Czech Technical University in Prague
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 873
diff changeset
    75
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    76
 This software is furnished under a license and may be used
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    77
 only in accordance with the terms of that license and with the
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    78
 inclusion of the above copyright notice.   This software may not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    79
 be provided or otherwise made available to, or used by, any
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    80
 other person.  No title to or ownership of the software is
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    81
 hereby transferred.
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 873
diff changeset
    82
1155
vranyj1
parents: 1152
diff changeset
    83
 [1] Code written at SWING Research Group contains a signature
vranyj1
parents: 1152
diff changeset
    84
     of one of the above copright owners. For exact set of such code,
vranyj1
parents: 1152
diff changeset
    85
     see the differences between this version and version stx:libjava
1152
040cba55a7d2 Copyright fixes
vranyj1
parents: 1151
diff changeset
    86
     as of 1.9.2010
877
f5a5b93e1c78 Cleanup phase 1
vranyj1
parents: 873
diff changeset
    87
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    88
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    89
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    90
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    91
documentation
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    92
"Runtime support and environment for Java. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    93
You shouldn't communicate with JavaVM directly, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    94
use Java class instead. JavaVM is layer between
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    95
the native interpret and the rest of the system.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    96
JavaVM implements native java virtual machine 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    97
methods called by interpret, hides java primitive 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    98
types handling, and gives the ST world ways to 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    99
control class loading and reflection"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   100
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   101
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   102
nativeMethods
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   103
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   104
    all native methods:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   105
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   106
        JavaMethod allSubInstances select:[:m |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   107
            m isNative 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   108
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   109
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   110
    implemented methods:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   111
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   112
        JavaMethod allSubInstances select:[:m |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   113
            |sel|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   114
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   115
            m isNative ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   116
                sel := ('_' , m javaClass lastName , '_' , m name , ':') asSymbol.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   117
                JavaVM class implements:sel.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   118
            ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   119
                false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   120
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   121
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   122
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   123
    unimplemented methods:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   124
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   125
        JavaMethod allSubInstances select:[:m |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   126
            |sel|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   127
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   128
            m isNative ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   129
                sel := ('_' , m javaClass lastName , '_' , m name , ':') asSymbol.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   130
                (JavaVM class implements:sel) not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   131
            ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   132
                false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   133
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   134
        ]    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   135
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   136
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   137
    list of all native methods as in jdk1.1.3:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   138
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   139
      X - implemented
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   140
      * - implemented to be validated
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   141
      x - implemented with limited functionality
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   142
      o - implemented as dummy (no functionality)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   143
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   144
    X (Math::double sin (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   145
    X (Math::double cos (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   146
    X (Math::double tan (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   147
    X (Math::double asin (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   148
    X (Math::double acos (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   149
    X (Math::double atan (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   150
    X (Math::double exp (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   151
    X (Math::double log (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   152
    X (Math::double sqrt (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   153
      (Math::double IEEEremainder (double double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   154
    X (Math::double ceil (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   155
    X (Math::double floor (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   156
      (Math::double rint (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   157
      (Math::double atan2 (double double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   158
    X (Math::double pow (double double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   159
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   160
    X (Class::java.lang.Class forName (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   161
    X (Class::java.lang.Object newInstance ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   162
    * (Class::boolean isInstance (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   163
    X (Class::boolean isAssignableFrom (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   164
    X (Class::boolean isInterface ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   165
      (Class::boolean isArray ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   166
    X (Class::boolean isPrimitive ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   167
    X (Class::java.lang.String getName ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   168
    X (Class::java.lang.ClassLoader getClassLoader ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   169
    X (Class::java.lang.Class getSuperclass ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   170
      (Class::java.lang.Class[] getInterfaces ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   171
      (Class::java.lang.Class getComponentType ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   172
      (Class::int getModifiers ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   173
      (Class::java.lang.Object[] getSigners ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   174
      (Class::void setSigners (java.lang.Object[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   175
    X (Class::java.lang.Class getPrimitiveClass (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   176
      (Class::java.lang.reflect.Field getField0 (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   177
      (Class::java.lang.reflect.Field[] getFields0 (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   178
    X (Class::java.lang.reflect.Method getMethod0 (java.lang.String java.lang.Class[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   179
    X (Class::java.lang.reflect.Method[] getMethods0 (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   180
      (Class::java.lang.reflect.Constructor[] getConstructors0 (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   181
      (Class::java.lang.reflect.Constructor getConstructor0 (java.lang.Class[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   182
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   183
    X (InetAddressImpl::java.lang.String getLocalHostName ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   184
    X (InetAddressImpl::void makeAnyLocalAddress (java.net.InetAddress))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   185
    X (InetAddressImpl::byte[][] lookupAllHostAddr (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   186
      (InetAddressImpl::java.lang.String getHostByAddr (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   187
    X (InetAddressImpl::int getInetFamily ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   188
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   189
    X (ResourceBundle::java.lang.Class[] getClassContext ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   190
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   191
    X (System::void setIn0 (java.io.InputStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   192
    X (System::void setOut0 (java.io.PrintStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   193
    X (System::void setErr0 (java.io.PrintStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   194
    X (System::long currentTimeMillis ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   195
    X (System::void arraycopy (java.lang.Object int java.lang.Object int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   196
    X (System::int identityHashCode (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   197
    X (System::java.util.Properties initProperties (java.util.Properties))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   198
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   199
    X (Thread::java.lang.Thread currentThread ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   200
    X (Thread::void yield ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   201
    X (Thread::void sleep (long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   202
    X (Thread::void start ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   203
    X (Thread::boolean isInterrupted (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   204
    X (Thread::boolean isAlive ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   205
      (Thread::int countStackFrames ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   206
    X (Thread::void setPriority0 (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   207
    X (Thread::void stop0 (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   208
    X (Thread::void suspend0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   209
    X (Thread::void resume0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   210
    * (Thread::void interrupt0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   211
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   212
      (String::java.lang.String intern ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   213
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   214
    X (Float::int floatToIntBits (float))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   215
    X (Float::float intBitsToFloat (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   216
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   217
      (ObjectStreamClass::int getClassAccess (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   218
      (ObjectStreamClass::java.lang.String[] getMethodSignatures (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   219
      (ObjectStreamClass::int getMethodAccess (java.lang.Class java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   220
      (ObjectStreamClass::java.lang.String[] getFieldSignatures (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   221
      (ObjectStreamClass::int getFieldAccess (java.lang.Class java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   222
      (ObjectStreamClass::java.io.ObjectStreamField[] getFields0 (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   223
      (ObjectStreamClass::long getSerialVersionUID (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   224
      (ObjectStreamClass::boolean hasWriteObject (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   225
      (ObjectInputStream::java.lang.Class loadClass0 (java.lang.Class java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   226
      (ObjectInputStream::void inputClassFields (java.lang.Object java.lang.Class int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   227
      (ObjectInputStream::java.lang.Object allocateNewObject (java.lang.Class java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   228
      (ObjectInputStream::java.lang.Object allocateNewArray (java.lang.Class int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   229
      (ObjectInputStream::boolean invokeObjectReader (java.lang.Object java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   230
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   231
      (SecurityManager::java.lang.Class[] getClassContext ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   232
    X (SecurityManager::java.lang.ClassLoader currentClassLoader ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   233
      (SecurityManager::int classDepth (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   234
    X (SecurityManager::int classLoaderDepth ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   235
      (SecurityManager::java.lang.Class currentLoadedClass0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   236
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   237
    X (ClassLoader::void init ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   238
    X (ClassLoader::java.lang.Class defineClass0 (java.lang.String byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   239
    X (ClassLoader::void resolveClass0 (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   240
    X (ClassLoader::java.lang.Class findSystemClass0 (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   241
    X (ClassLoader::java.io.InputStream getSystemResourceAsStream0 (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   242
      (ClassLoader::java.lang.String getSystemResourceAsName0 (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   243
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   244
    X (FileDescriptor::boolean valid ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   245
      (FileDescriptor::void sync ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   246
    X (FileDescriptor::java.io.FileDescriptor initSystemFD (java.io.FileDescriptor int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   247
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   248
    X (Object::java.lang.Class getClass ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   249
    X (Object::int hashCode ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   250
    X (Object::java.lang.Object clone ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   251
    X (Object::void notify ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   252
    X (Object::void notifyAll ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   253
    X (Object::void wait (long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   254
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   255
    X (FileOutputStream::void open (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   256
    X (FileOutputStream::void openAppend (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   257
    X (FileOutputStream::void write (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   258
    X (FileOutputStream::void writeBytes (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   259
    X (FileOutputStream::void close ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   260
    X (FileInputStream::void open (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   261
    X (FileInputStream::int read ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   262
    X (FileInputStream::int readBytes (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   263
      (FileInputStream::long skip (long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   264
    X (FileInputStream::int available ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   265
    X (FileInputStream::void close ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   266
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   267
      (VM::int getState ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   268
      (VM::boolean threadsSuspended ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   269
      (VM::void unsuspendThreads ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   270
      (VM::void unsuspendSomeThreads ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   271
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   272
    X (File::boolean exists0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   273
    X (File::boolean canWrite0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   274
    X (File::boolean canRead0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   275
    X (File::boolean isFile0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   276
    X (File::boolean isDirectory0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   277
    X (File::long lastModified0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   278
    X (File::long length0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   279
    X (File::boolean mkdir0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   280
    X (File::boolean renameTo0 (java.io.File))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   281
    X (File::boolean delete0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   282
      (File::boolean rmdir0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   283
    X (File::java.lang.String[] list0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   284
      (File::java.lang.String canonPath (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   285
    X (File::boolean isAbsolute ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   286
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   287
      (ObjectOutputStream::void outputClassFields (java.lang.Object java.lang.Class int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   288
      (ObjectOutputStream::boolean invokeObjectWriter (java.lang.Object java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   289
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   290
    X (Throwable::void printStackTrace0 (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   291
    X (Throwable::java.lang.Throwable fillInStackTrace ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   292
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   293
    X (Double::long doubleToLongBits (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   294
    X (Double::double longBitsToDouble (long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   295
    X (Double::double valueOf0 (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   296
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   297
    X (Runtime::void exitInternal (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   298
    o (Runtime::void runFinalizersOnExit0 (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   299
    o (Runtime::java.lang.Process execInternal (java.lang.String[] java.lang.String[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   300
    X (Runtime::long freeMemory ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   301
    X (Runtime::long totalMemory ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   302
    X (Runtime::void gc ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   303
      (Runtime::void runFinalization ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   304
      (Runtime::void traceInstructions (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   305
      (Runtime::void traceMethodCalls (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   306
    X (Runtime::java.lang.String initializeLinkerInternal ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   307
    X (Runtime::java.lang.String buildLibName (java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   308
    X (Runtime::int loadFileInternal (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   309
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   310
      (WDrawingSurfaceInfo::int lock ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   311
      (WDrawingSurfaceInfo::void unlock ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   312
      (WDrawingSurfaceInfo::int getHWnd ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   313
      (WDrawingSurfaceInfo::int getHBitmap ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   314
      (WDrawingSurfaceInfo::int getPBits ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   315
      (WDrawingSurfaceInfo::int getHDC ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   316
      (WDrawingSurfaceInfo::int getDepth ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   317
      (WDrawingSurfaceInfo::int getHPalette ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   318
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   319
    X (WDefaultFontCharset::boolean canConvert (char))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   320
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   321
      (ColorModel::void deletepData ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   322
    X (WToolkit::void init (java.lang.Thread))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   323
    X (WToolkit::void eventLoop ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   324
      (WToolkit::java.awt.image.ColorModel makeColorModel ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   325
    X (WToolkit::int getScreenResolution ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   326
    X (WToolkit::int getScreenWidth ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   327
    X (WToolkit::int getScreenHeight ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   328
      (WToolkit::void sync ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   329
    * (WToolkit::void beep ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   330
    X (WToolkit::void loadSystemColors (int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   331
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   332
      (WPrintJob::void end ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   333
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   334
    X (WDialogPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   335
    X (WDialogPeer::void _show ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   336
    X (WDialogPeer::void _hide ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   337
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   338
    X (WWindowPeer::void toFront ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   339
    X (WWindowPeer::void toBack ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   340
    X (WWindowPeer::void _setTitle (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   341
    X (WWindowPeer::void _setResizable (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   342
    X (WWindowPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   343
    o (WWindowPeer::void updateInsets (java.awt.Insets))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   344
      (WWindowPeer::java.awt.Component getContainerElement (java.awt.Container int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   345
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   346
    X (WCanvasPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   347
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   348
    X (WTextAreaPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   349
    X (WTextAreaPeer::void insertText (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   350
      (WTextAreaPeer::void replaceText (java.lang.String int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   351
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   352
    X (WTextComponentPeer::java.lang.String getText ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   353
    X (WTextComponentPeer::void setText (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   354
    X (WTextComponentPeer::int getSelectionStart ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   355
    X (WTextComponentPeer::int getSelectionEnd ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   356
    X (WTextComponentPeer::void select (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   357
    X (WTextComponentPeer::void enableEditing (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   358
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   359
    X (WComponentPeer::void show ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   360
    X (WComponentPeer::void hide ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   361
    X (WComponentPeer::void enable ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   362
    X (WComponentPeer::void disable ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   363
    X (WComponentPeer::java.awt.Point getLocationOnScreen ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   364
    X (WComponentPeer::void reshape (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   365
    o (WComponentPeer::void handleEvent (java.awt.AWTEvent))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   366
    o (WComponentPeer::void _dispose ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   367
    X (WComponentPeer::void _setForeground (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   368
    X (WComponentPeer::void _setBackground (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   369
    o (WComponentPeer::void setFont (java.awt.Font))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   370
    o (WComponentPeer::void requestFocus ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   371
    o (WComponentPeer::void setCursor (java.awt.Cursor))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   372
    o (WComponentPeer::void start ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   373
      (WComponentPeer::void _beginValidate ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   374
      (WComponentPeer::void endValidate ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   375
    o (WComponentPeer::void setZOrderPosition (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   376
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   377
    X (WFramePeer::void setMenuBar0 (sun.awt.windows.WMenuBarPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   378
    X (WFramePeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   379
    X (WFramePeer::void _setIconImage (sun.awt.image.ImageRepresentation))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   380
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   381
    o (WFontMetrics::boolean needsConversion (java.awt.Font sun.awt.FontDescriptor))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   382
    o (WFontMetrics::int getMFCharSegmentWidth (java.awt.Font sun.awt.FontDescriptor boolean char[] int int byte[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   383
      (WFontMetrics::int bytesWidth (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   384
      (WFontMetrics::void init ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   385
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   386
    o (WChoicePeer::void select (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   387
    o (WChoicePeer::void remove (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   388
    o (WChoicePeer::void addItem (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   389
    X (WChoicePeer::void reshape (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   390
    X (WChoicePeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   391
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   392
    X (WLabelPeer::void setText (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   393
    o (WLabelPeer::void setAlignment (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   394
    X (WLabelPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   395
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   396
    X (WMenuItemPeer::void _setLabel (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   397
    X (WMenuItemPeer::void create (sun.awt.windows.WMenuPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   398
    X (WMenuItemPeer::void enable (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   399
    o (WMenuItemPeer::void _dispose ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   400
      (WMenuPeer::void addSeparator ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   401
      (WMenuPeer::void delItem (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   402
    X (WMenuPeer::void createMenu (sun.awt.windows.WMenuBarPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   403
      (WMenuPeer::void createSubMenu (sun.awt.windows.WMenuPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   404
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   405
      (WPopupMenuPeer::void createMenu (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   406
      (WPopupMenuPeer::void _show (java.awt.Event))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   407
      (WMenuBarPeer::void addMenu (java.awt.Menu))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   408
      (WMenuBarPeer::void delMenu (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   409
    X (WMenuBarPeer::void create (sun.awt.windows.WFramePeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   410
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   411
      (WCheckboxMenuItemPeer::void setState (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   412
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   413
    X (WFileDialogPeer::void show ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   414
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   415
    X (WCheckboxPeer::void setState (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   416
    X (WCheckboxPeer::void setCheckboxGroup (java.awt.CheckboxGroup))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   417
      (WCheckboxPeer::void setLabel (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   418
    X (WCheckboxPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   419
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   420
    X (WClipboard::void init ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   421
      (WClipboard::void setClipboardText (java.awt.datatransfer.StringSelection))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   422
      (WClipboard::java.lang.String getClipboardText ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   423
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   424
    X (WListPeer::void addItem (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   425
    X (WListPeer::void delItems (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   426
    X (WListPeer::void select (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   427
      (WListPeer::void deselect (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   428
      (WListPeer::void makeVisible (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   429
    X (WListPeer::void setMultipleSelections (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   430
    X (WListPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   431
    X (WListPeer::boolean isSelected (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   432
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   433
    x (WScrollbarPeer::void _setValues (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   434
    x (WScrollbarPeer::void setLineIncrement (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   435
    x (WScrollbarPeer::void setPageIncrement (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   436
    x (WScrollbarPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   437
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   438
    x (ImageRepresentation::void offscreenInit (java.awt.Color))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   439
    x (ImageRepresentation::boolean setBytePixels (int int int int java.awt.image.ColorModel byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   440
    x (ImageRepresentation::boolean setIntPixels (int int int int java.awt.image.ColorModel int[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   441
    x (ImageRepresentation::boolean finish (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   442
    X (ImageRepresentation::void imageDraw (java.awt.Graphics int int java.awt.Color))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   443
    x (ImageRepresentation::void imageStretch (java.awt.Graphics int int int int int int int int java.awt.Color))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   444
    x (ImageRepresentation::void disposeImage ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   445
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   446
    X (WTextFieldPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   447
    X (WTextFieldPeer::void setEchoCharacter (char))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   448
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   449
    X (WScrollPanePeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   450
    o (WScrollPanePeer::int getOffset (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   451
      (WScrollPanePeer::void setInsets ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   452
      (WScrollPanePeer::void setScrollPosition (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   453
    x (WScrollPanePeer::int _getHScrollbarHeight ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   454
    x (WScrollPanePeer::int _getVScrollbarWidth ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   455
    o (WScrollPanePeer::void setSpans (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   456
      (WScrollPanePeer::java.awt.Component getScrollChild ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   457
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   458
      (WEmbeddedFramePeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   459
    X (WButtonPeer::void setLabel (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   460
    X (WButtonPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   461
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   462
    x (WColor::java.awt.Color getDefaultColor (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   463
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   464
    x (GifImageDecoder::boolean parseImage (int int int int boolean int byte[] byte[] java.awt.image.IndexColorModel))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   465
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   466
    x (WGraphics::void createFromComponent (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   467
    x (WGraphics::void createFromGraphics (sun.awt.windows.WGraphics))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   468
      (WGraphics::void createFromPrintJob (sun.awt.windows.WPrintJob))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   469
      (WGraphics::void createFromHDC (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   470
    x (WGraphics::void imageCreate (sun.awt.image.ImageRepresentation))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   471
    x (WGraphics::void pSetFont (java.awt.Font))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   472
    X (WGraphics::void pSetForeground (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   473
      (WGraphics::void _dispose ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   474
    x (WGraphics::void dispose ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   475
    x (WGraphics::void setPaintMode ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   476
    x (WGraphics::void setXORMode (java.awt.Color))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   477
    o (WGraphics::java.awt.Rectangle getClipBounds ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   478
    o (WGraphics::void changeClip (int int int int boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   479
      (WGraphics::void removeClip ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   480
    X (WGraphics::void clearRect (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   481
    X (WGraphics::void fillRect (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   482
    X (WGraphics::void drawRect (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   483
      (WGraphics::void drawSFChars (char[] int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   484
    x (WGraphics::int drawMFCharsSegment (java.awt.Font sun.awt.FontDescriptor char[] int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   485
      (WGraphics::int drawMFCharsConvertedSegment (java.awt.Font sun.awt.FontDescriptor byte[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   486
      (WGraphics::void drawBytes (byte[] int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   487
    X (WGraphics::void drawLine (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   488
    X (WGraphics::void copyArea (int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   489
    o (WGraphics::void drawRoundRect (int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   490
    o (WGraphics::void fillRoundRect (int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   491
    X (WGraphics::void drawPolygon (int[] int[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   492
      (WGraphics::void drawPolyline (int[] int[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   493
    X (WGraphics::void fillPolygon (int[] int[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   494
    x (WGraphics::void drawOval (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   495
    x (WGraphics::void fillOval (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   496
    x (WGraphics::void drawArc (int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   497
    x (WGraphics::void fillArc (int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   498
      (WGraphics::void print (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   499
      (WGraphics::void close (sun.awt.windows.WPrintJob))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   500
      (JPEGImageDecoder::void readImage (java.io.InputStream byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   501
    o (OffScreenImageSource::void sendPixels ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   502
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   503
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   504
    additional native methods added by microsoft (sigh):
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   505
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   506
    X (java.lang.String::boolean equals (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   507
    X (java.lang.String::int length (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   508
    o (java.lang.Runtime::void setInputStreamLocalised (java.io.DataInputStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   509
    o (java.lang.Runtime::void setOutputStreamLocalised (java.io.DataOutputStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   510
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   511
      (java.lang.String::int compareTo (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   512
      (java.lang.String::boolean equalsIgnoreCase (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   513
      (java.lang.String::int indexOf (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   514
      (java.lang.String::boolean startsWith (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   515
      (java.lang.String::boolean regionMatches (int java.lang.String int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   516
      (java.lang.String::boolean regionMatches (boolean int java.lang.String int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   517
      (java.lang.String::int lastIndexOf (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   518
      (java.lang.ClassLoader::void resolveClass (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   519
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   520
      (java.lang.ClassLoader::java.lang.Class createArrayClass (java.lang.String java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   521
      (java.io.PrintStream::boolean isOutputStreamLocalised (java.io.DataOutputStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   522
      (java.lang.Runtime::boolean isOutputStreamLocalised (java.io.DataOutputStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   523
      (java.lang.Runtime::boolean isInputStreamLocalised (java.io.DataInputStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   524
      (java.lang.ThreadGroup::void initMainThreadGroup0 (java.lang.ThreadGroup))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   525
      (java.lang.System::void validateSecurityManager (java.lang.SecurityManager))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   526
      (java.lang.Class::java.lang.reflect.Method getMethod2 (int java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   527
      (java.io.ObjectOutputStream::void invokeDefaultWriteObject (java.lang.Object java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   528
      (java.io.ObjectOutputStream::void invokeWriteObject (java.lang.Object java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   529
      (java.io.ObjectInputStream::void invokeDefaultReadObject (java.lang.Object java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   530
      (java.io.ObjectInputStream::void invokeReadObject (java.lang.Object java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   531
      (java.util.TimeZone::java.util.TimeZone getWin32TimeZone ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   532
      (java.net.InetAddress::java.lang.Object[] lookupHostByName (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   533
      (java.net.InetAddress::java.lang.Object[] lookupHostByAddr (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   534
      (java.io.ObjectStreamClass::void doMismatchedRead (java.io.ObjectInputStream java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   535
      (java.io.ObjectStreamClass::long getClassDefinedUID (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   536
      (java.io.ObjectStreamClass::boolean findObjectMethod0 (java.lang.Class int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   537
      (java.lang.reflect.Method::java.lang.String getDescriptor ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   538
      (java.lang.reflect.Array::void setShort (java.lang.Object int unsigned short))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   539
      (java.lang.reflect.Array::char getChar (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   540
      (java.lang.reflect.Array::void setChar (java.lang.Object int char))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   541
      (java.lang.reflect.Array::void setDouble (java.lang.Object int double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   542
      (java.lang.reflect.Array::java.lang.Object get (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   543
      (java.lang.reflect.Array::void set (java.lang.Object int java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   544
      (java.lang.reflect.Array::int getInt (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   545
      (java.lang.reflect.Array::void setInt (java.lang.Object int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   546
      (java.lang.reflect.Array::java.lang.Object multiNewArray (java.lang.Class int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   547
      (java.lang.reflect.Array::boolean getBoolean (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   548
      (java.lang.reflect.Array::byte getByte (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   549
      (java.lang.reflect.Array::float getFloat (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   550
      (java.lang.reflect.Array::void setBoolean (java.lang.Object int boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   551
      (java.lang.reflect.Array::long getLong (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   552
      (java.lang.reflect.Array::void setByte (java.lang.Object int byte))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   553
      (java.lang.reflect.Array::void setLong (java.lang.Object int long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   554
      (java.lang.reflect.Array::void setFloat (java.lang.Object int float))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   555
      (java.lang.reflect.Array::java.lang.Object newArray (java.lang.Class int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   556
      (java.lang.reflect.Array::int getLength (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   557
      (java.lang.reflect.Array::unsigned short getShort (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   558
      (java.lang.reflect.Array::double getDouble (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   559
      (java.lang.reflect.Field::void setShort (java.lang.Object unsigned short))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   560
      (java.lang.reflect.Field::char getChar (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   561
      (java.lang.reflect.Field::void setChar (java.lang.Object char))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   562
      (java.lang.reflect.Field::void setDouble (java.lang.Object double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   563
      (java.lang.reflect.Field::java.lang.Object get (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   564
      (java.lang.reflect.Field::void set (java.lang.Object java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   565
      (java.lang.reflect.Field::int getInt (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   566
      (java.lang.reflect.Field::void setInt (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   567
      (java.lang.reflect.Field::boolean getBoolean (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   568
      (java.lang.reflect.Field::byte getByte (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   569
      (java.lang.reflect.Field::float getFloat (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   570
      (java.lang.reflect.Field::long getLong (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   571
      (java.lang.reflect.Field::void setBoolean (java.lang.Object boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   572
      (java.lang.reflect.Field::void setByte (java.lang.Object byte))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   573
      (java.lang.reflect.Field::void setLong (java.lang.Object long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   574
      (java.lang.reflect.Field::void setFloat (java.lang.Object float))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   575
      (java.lang.reflect.Field::int getModifiers ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   576
      (java.lang.reflect.Field::unsigned short getShort (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   577
      (java.lang.reflect.Field::double getDouble (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   578
      (java.lang.reflect.Constructor::java.lang.Object newInstance (java.lang.Object[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   579
      (java.lang.reflect.Constructor::int getModifiers ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   580
      (java.util.zip.Inflater::void setDictionary0 (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   581
      (java.util.zip.Inflater::int getTotalIn0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   582
      (java.util.zip.Inflater::void reset0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   583
      (java.util.zip.Inflater::void end0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   584
      (java.util.zip.Inflater::int inflate0 (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   585
      (java.util.zip.Inflater::int getTotalOut0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   586
      (java.util.zip.Inflater::int getAdler0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   587
      (java.util.zip.CRC32::void update1 (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   588
      (java.util.zip.CRC32::void update (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   589
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   590
      (com.ms.security.PolicyEngine::boolean isSystemClass (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   591
      (com.ms.security.PolicyEngine::void denyPermission (com.ms.security.PermissionID))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   592
      (com.ms.security.PolicyEngine::void revertPermission (com.ms.security.PermissionID))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   593
      (com.ms.security.PolicyEngine::void initPolicyEngine ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   594
      (com.ms.security.PolicyEngine::java.lang.Class _getClassOfCaller (java.lang.Class[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   595
      (com.ms.security.PolicyEngine::void internalCheckClass (java.lang.Class com.ms.security.PermissionID java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   596
      (com.ms.security.PolicyEngine::com.ms.security.PermissionDataSet getPermissionsOfClass (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   597
      (com.ms.security.PolicyEngine::void assertPermission (com.ms.security.PermissionID))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   598
      (com.ms.security.PolicyEngine::void deepCheck (com.ms.security.PermissionID java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   599
      (com.ms.security.PolicyEngine::void shallowCheck (com.ms.security.PermissionID java.lang.Object java.lang.Class[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   600
      (com.ms.security.PolicyEngine::java.security.Principal getPrincipalOfClass (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   601
      (com.ms.security.permissions.ThreadPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   602
      (com.ms.security.permissions.ThreadPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   603
      (com.ms.security.permissions.RegistryPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   604
      (com.ms.security.permissions.RegistryPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   605
      (com.ms.security.management.ZonePermissions::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   606
      (com.ms.security.management.ZonePermissions::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   607
      (com.ms.security.permissions.UIPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   608
      (com.ms.security.permissions.UIPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   609
      (com.ms.security.permissions.NetIOPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   610
      (com.ms.security.permissions.NetIOPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   611
      (com.ms.security.permissions.ReflectionPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   612
      (com.ms.security.permissions.ReflectionPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   613
      (com.ms.vm.WeakReference::void storeRef (int java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   614
      (com.ms.vm.WeakReference::int allocRef (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   615
      (com.ms.vm.WeakReference::void freeRef (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   616
      (com.ms.vm.WeakReference::java.lang.Object fetchRef (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   617
      (com.ms.dll.DllLib::void CoTaskMemFree (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   618
      (com.ms.dll.DllLib::void CopyWithDstOffset (int float[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   619
      (com.ms.dll.DllLib::void CopyWithDstOffset (int double[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   620
      (com.ms.dll.DllLib::int numParamBytes0 (java.lang.reflect.Method))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   621
      (com.ms.dll.DllLib::void CopyWithDstOffset (int java.lang.Object int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   622
      (com.ms.dll.DllLib::void write2 (java.lang.Object int unsigned short))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   623
      (com.ms.dll.DllLib::void write2 (int int unsigned short))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   624
      (com.ms.dll.DllLib::void write2 (java.lang.Object int char))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   625
      (com.ms.dll.DllLib::void write2 (int int char))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   626
      (com.ms.dll.DllLib::int GlobalAlloc (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   627
      (com.ms.dll.DllLib::void resize (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   628
      (com.ms.dll.DllLib::long read8 (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   629
      (com.ms.dll.DllLib::long read8 (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   630
      (com.ms.dll.DllLib::int lstrcpy (java.lang.StringBuffer int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   631
      (com.ms.dll.DllLib::int lstrlenA (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   632
      (com.ms.dll.DllLib::int read4 (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   633
      (com.ms.dll.DllLib::int CoTaskMemAlloc (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   634
      (com.ms.dll.DllLib::void write8 (java.lang.Object int long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   635
      (com.ms.dll.DllLib::int sizeOf0 (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   636
      (com.ms.dll.DllLib::int getSystemDefaultCharSize ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   637
      (com.ms.dll.DllLib::void write8 (int int long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   638
      (com.ms.dll.DllLib::int read4 (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   639
      (com.ms.dll.DllLib::byte read1 (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   640
      (com.ms.dll.DllLib::byte read1 (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   641
      (com.ms.dll.DllLib::int lstrlen (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   642
      (com.ms.dll.DllLib::void CopyMemoryAnsi (int java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   643
      (com.ms.dll.DllLib::void CopyMemoryAnsi (java.lang.StringBuffer int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   644
      (com.ms.dll.DllLib::boolean isStruct (java.lang.reflect.Field))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   645
      (com.ms.dll.DllLib::boolean GlobalFree (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   646
      (com.ms.dll.DllLib::void internalAttemptCopyPtrToStruct (int java.lang.Object int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   647
      (com.ms.dll.DllLib::int getLastError ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   648
      (com.ms.dll.DllLib::void write4 (java.lang.Object int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   649
      (com.ms.dll.DllLib::void write4 (int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   650
      (com.ms.dll.DllLib::unsigned short read2 (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   651
      (com.ms.dll.DllLib::unsigned short read2 (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   652
      (com.ms.dll.DllLib::void release (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   653
      (com.ms.dll.DllLib::void write1 (java.lang.Object int byte))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   654
      (com.ms.dll.DllLib::void write1 (int int byte))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   655
      (com.ms.dll.DllLib::boolean isStructCls (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   656
      (com.ms.dll.DllLib::void prelink (java.lang.reflect.Method))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   657
      (com.ms.dll.DllLib::void CopyMemoryUni (int java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   658
      (com.ms.dll.DllLib::void CopyMemoryUni (java.lang.StringBuffer int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   659
      (com.ms.dll.DllLib::void internalAttemptCopyStructToPtr (java.lang.Object int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   660
      (com.ms.dll.DllLib::void CopyWithSrcOffset (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   661
      (com.ms.dll.DllLib::void CopyWithSrcOffset (byte[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   662
      (com.ms.dll.DllLib::void CopyWithSrcOffset (char[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   663
      (com.ms.dll.DllLib::void CopyWithSrcOffset (unsigned short[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   664
      (com.ms.dll.DllLib::void CopyWithSrcOffset (int[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   665
      (com.ms.dll.DllLib::void CopyWithSrcOffset (long[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   666
      (com.ms.dll.DllLib::void CopyWithSrcOffset (float[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   667
      (com.ms.dll.DllLib::void CopyWithSrcOffset (double[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   668
      (com.ms.dll.DllLib::void CopyWithSrcOffset (java.lang.Object int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   669
      (com.ms.dll.DllLib::void CopyWithDstOffset (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   670
      (com.ms.dll.DllLib::int lstrlenW (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   671
      (com.ms.dll.DllLib::void CopyWithDstOffset (int byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   672
      (com.ms.dll.DllLib::void CopyWithDstOffset (int char[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   673
      (com.ms.dll.DllLib::void CopyWithDstOffset (int unsigned short[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   674
      (com.ms.dll.DllLib::void CopyWithDstOffset (int int[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   675
      (com.ms.dll.DllLib::void CopyWithDstOffset (int long[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   676
      (com.ms.dll.DllLib::int internalGetStructAddr (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   677
      (com.ms.dll.DllLib::int offsetOf (java.lang.reflect.Field))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   678
      (com.ms.dll.DllLib::int lstrcpy (int java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   679
      (com.ms.dll.DllLib::int sizeOf (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   680
      (com.ms.lang.RegKey::com.ms.lang.RegKeyEnumValue pRegEnumValue (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   681
      (com.ms.lang.RegKey::java.lang.String pRegQueryStringValue (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   682
      (com.ms.lang.RegKey::byte[] pRegQueryBinaryValue (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   683
      (com.ms.lang.RegKey::int pRegQueryIntValue (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   684
      (com.ms.lang.RegKey::void pRegSetStringValue (java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   685
      (com.ms.lang.RegKey::void pRegSetIntValue (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   686
      (com.ms.lang.RegKey::void pRegSetBinaryValue (java.lang.String byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   687
      (com.ms.lang.RegKey::void pRegDeleteValue (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   688
      (com.ms.lang.RegKey::void pRegFlushKey ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   689
      (com.ms.lang.RegKey::void pRegDeleteKey (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   690
      (com.ms.lang.RegKey::void pRegOpenBaseKey (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   691
      (com.ms.lang.RegKey::void pRegOpenKey (com.ms.lang.RegKey java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   692
      (com.ms.lang.RegKey::int pRegQueryInfoKey (com.ms.lang.RegQueryInfo))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   693
      (com.ms.lang.RegKey::void pRegUnLoadKey (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   694
      (com.ms.lang.RegKey::void pRegCreateKey (com.ms.lang.RegKey java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   695
      (com.ms.lang.RegKey::void pRegRestoreKey (java.lang.String boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   696
      (com.ms.lang.RegKey::void pRegLoadKey (java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   697
      (com.ms.lang.RegKey::void pRegCloseKey ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   698
      (com.ms.lang.RegKey::java.lang.String pRegEnumKey (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   699
      (com.ms.lang.RegKey::void pRegReplaceKey (java.lang.String java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   700
      (com.ms.awt.peer.NativeServices::int pGetKeyboardLayouts (int[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   701
      (com.ms.awt.peer.NativeServices::void jpegReadByte (com.ms.awt.peer.IjpegDecoderCallback byte[] int com.ms.awt.peer.jpegInfoHeader byte[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   702
      (com.ms.awt.peer.NativeServices::int getColourDataDepth ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   703
      (com.ms.awt.peer.NativeServices::java.lang.String pGetFontEnumeratedFamily (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   704
      (com.ms.awt.peer.NativeServices::int pNewFontEnumeration ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   705
      (com.ms.awt.peer.NativeServices::int getScreenClipRgn (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   706
      (com.ms.awt.peer.NativeServices::int pSetKeyboardLayout (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   707
      (com.ms.awt.peer.NativeServices::void ClipboardInit (com.ms.awt.peer.IToolkit))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   708
      (com.ms.awt.peer.NativeServices::void getDeviceCaps (int int[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   709
      (com.ms.awt.peer.NativeServices::void getAfcMetrics (int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   710
      (com.ms.awt.peer.NativeServices::void setUserLocale (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   711
      (com.ms.awt.peer.NativeServices::void getDCDI (com.ms.awt.peer.DirectColourDataInfo))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   712
      (com.ms.awt.peer.NativeServices::int pGetNumKeyboardLayouts ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   713
      (com.ms.awt.peer.NativeServices::void getIndexedColours (byte[] byte[] byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   714
      (com.ms.awt.peer.NativeServices::int getNativeFont (java.lang.String int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   715
      (com.ms.awt.peer.NativeServices::int pGetKeyboardLayout ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   716
      (com.ms.awt.peer.NativeServices::int getSystemLCID ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   717
      (com.ms.awt.peer.NativeServices::void caretSetPos (int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   718
      (com.ms.awt.peer.NativeServices::java.lang.String getLogFontFromIUnknown (com.ms.com.IUnknown com.ms.awt.peer.LogFontX))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   719
      (com.ms.awt.peer.NativeServices::java.lang.String ClipboardGetText ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   720
      (com.ms.awt.peer.NativeServices::int systemMetric (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   721
      (com.ms.awt.peer.NativeServices::void jpegInit (com.ms.awt.peer.IjpegDecoderCallback byte[] int com.ms.awt.peer.jpegInfoHeader))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   722
      (com.ms.awt.peer.NativeServices::void caretHide (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   723
      (com.ms.awt.peer.NativeServices::int chooseColor (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   724
      (com.ms.awt.peer.NativeServices::java.lang.String pGetKeyboardLayoutName (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   725
      (com.ms.awt.peer.NativeServices::int matchFontAndLanguage (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   726
      (com.ms.awt.peer.NativeServices::java.lang.String chooseFont (com.ms.awt.peer.LogFontX java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   727
      (com.ms.awt.peer.NativeServices::java.lang.String getSystemFont (int com.ms.awt.peer.LogFontX))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   728
      (com.ms.awt.peer.NativeServices::com.ms.com.IUnknown getIUnknownFromLogFont (java.lang.String com.ms.awt.peer.LogFontX))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   729
      (com.ms.awt.peer.NativeServices::void caretDispose (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   730
      (com.ms.awt.peer.NativeServices::void caretShow (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   731
      (com.ms.awt.peer.NativeServices::void deleteObject (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   732
      (com.ms.awt.peer.NativeServices::void setDebugOutput (com.ms.awt.peer.COMPrintCallback))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   733
      (com.ms.awt.peer.NativeServices::void jpegReadInt (com.ms.awt.peer.IjpegDecoderCallback byte[] int com.ms.awt.peer.jpegInfoHeader int[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   734
      (com.ms.awt.peer.NativeServices::int getSystemColourValue (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   735
      (com.ms.awt.peer.NativeServices::void caretCreate (int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   736
      (com.ms.awt.peer.NativeServices::void ClipboardSetText (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   737
      (com.ms.awt.peer.NativeServices::void println (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   738
      (com.ms.security.SecurityClassLoader::boolean getSecureState ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   739
      (com.ms.security.SecurityClassLoader::void setSecureState (java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   740
      (com.ms.security.SecurityClassLoader::java.lang.Class internalDefineClass (java.lang.String byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   741
      (com.ms.security.SecurityClassLoader::void markClass (java.lang.Class com.ms.security.PermissionSet java.security.Principal))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   742
      (com.ms.security.SecurityClassLoader::java.util.Hashtable getHashTable ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   743
      (com.ms.security.auditing.SecurityAuditor::boolean isThreadAuditingEnabled ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   744
      (com.ms.security.auditing.SecurityAuditor::void disableThreadAuditing ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   745
      (com.ms.security.auditing.SecurityAuditor::void enableThreadAuditing ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   746
      (com.ms.security.auditing.SecurityAuditor::void initSecurityAuditor ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   747
      (com.ms.security.PermissionDataSet::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   748
      (com.ms.security.PermissionDataSet::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   749
      (com.ms.lang.SystemX::int pAnsiToUnicode (byte[] char[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   750
      (com.ms.lang.SystemX::int pQueryUnicodeToAnsi (char[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   751
      (com.ms.lang.SystemX::void gc ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   752
      (com.ms.lang.SystemX::boolean arrayCompare (java.lang.Object[] int java.lang.Object[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   753
      (com.ms.lang.SystemX::int pUnicodeToAnsi (char[] byte[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   754
      (com.ms.lang.SystemX::boolean isLocalCharDBCSLeadByte (byte))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   755
      (com.ms.lang.SystemX::int pQueryAnsiToUnicode (byte[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   756
      (com.ms.lang.SystemX::boolean isBaseDBCS ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   757
      (com.ms.lang.SystemX::java.lang.reflect.Method getMethod2 (java.lang.Class int java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   758
      (com.ms.packagemanager.JavaPackage::byte[] nativeGetSigner (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   759
      (com.ms.packagemanager.JavaPackage::byte[] nativeGetCapabilities (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   760
      (com.ms.com._Guid::void IIDFromString (java.lang.String com.ms.com._Guid))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   761
      (com.ms.com._Guid::java.lang.String StringFromIID (com.ms.com._Guid))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   762
      (com.ms.security.auditing.PrintStreamAuditor::int GetModuleHandle (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   763
      (com.ms.security.auditing.PrintStreamAuditor::int FormatMessage (int int int int java.lang.StringBuffer int int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   764
      (com.ms.security.permissions.CustomPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   765
      (com.ms.security.permissions.CustomPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   766
      (com.ms.security.permissions.X509Signer::boolean pLoad (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   767
      (com.ms.packagemanager.PackageManager::java.lang.Class nativeFindClassInNamespace (java.lang.String java.lang.String java.lang.ClassLoader))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   768
      (com.ms.packagemanager.PackageManager::java.lang.Object nativeGetPackage (java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   769
      (com.ms.packagemanager.PackageManager::java.lang.String[] nativeGetBeansList ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   770
      (com.ms.packagemanager.PackageManager::com.ms.com.IStream nativeGetFileIStream (java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   771
      (com.ms.packagemanager.PackageManager::java.lang.Class nativeFindClass (java.lang.String java.lang.String java.lang.ClassLoader))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   772
      (com.ms.security.permissions.UserFileIOPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   773
      (com.ms.security.permissions.UserFileIOPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   774
      (com.ms.security.permissions.PropertyPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   775
      (com.ms.security.permissions.PropertyPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   776
      (com.ms.security.permissions.ClientStoragePermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   777
      (com.ms.security.permissions.ClientStoragePermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   778
      (com.ms.security.permissions.ExecutionPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   779
      (com.ms.security.permissions.ExecutionPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   780
      (com.ms.util.EventLog::boolean DeregisterEventSource (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   781
      (com.ms.util.EventLog::void reportEvent0 (unsigned short unsigned short int java.lang.String[] byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   782
      (com.ms.util.EventLog::int RegisterEventSource (java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   783
      (com.ms.applet.BrowserAppletFrame::void signalViewChange (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   784
      (com.ms.applet.BrowserAppletFrame::java.lang.Object newInstance (int java.lang.Class boolean com.ms.security.PermissionSet))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   785
      (com.ms.applet.BrowserAppletFrame::void showSystemStatus (int int boolean java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   786
      (com.ms.applet.BrowserAppletFrame::com.ms.security.management.SecurityPolicy getSecurityPolicy0 (int java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   787
      (com.ms.applet.BrowserAppletFrame::void setDownloadState (int boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   788
      (com.ms.applet.BrowserAppletFrame::int GetSystemDefaultLCID ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   789
      (com.ms.applet.BrowserAppletFrame::void requestResize (int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   790
      (com.ms.applet.BrowserAppletFrame::void signalObjectLoadDone (int boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   791
      (com.ms.applet.BrowserAppletFrame::com.ms.applet.BrowserAppletFrame findOfflineContext ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   792
      (com.ms.applet.BrowserAppletFrame::void showStatus0 (int java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   793
      (com.ms.applet.BrowserAppletFrame::boolean checkGlobalOfflineMode0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   794
      (com.ms.applet.BrowserAppletFrame::void showDocument0 (int java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   795
      (com.ms.security.permissions.SystemStreamsPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   796
      (com.ms.security.permissions.SystemStreamsPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   797
      (com.ms.security.permissions.FileIOPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   798
      (com.ms.security.permissions.FileIOPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   799
      (com.ms.com.ComLib::int newGCHandle (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   800
      (com.ms.com.ComLib::java.lang.Object derefGCHandle (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   801
      (com.ms.com.ComLib::void dprinthelper (char[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   802
      (com.ms.com.ComLib::void release (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   803
      (com.ms.com.ComLib::int jcdwClassSizeOf (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   804
      (com.ms.com.ComLib::int jcdwOffsetOf (java.lang.Object java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   805
      (com.ms.com.ComLib::int jcdwClassOffsetOf (java.lang.Class java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   806
      (com.ms.com.ComLib::boolean isJavaOwned (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   807
      (com.ms.com.ComLib::void brk (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   808
      (com.ms.com.ComLib::void setDataWrapperSize (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   809
      (com.ms.com.ComLib::void brk (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   810
      (com.ms.com.ComLib::void setJCDWHomeThread (java.lang.Object java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   811
      (com.ms.com.ComLib::void propagateOwnership (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   812
      (com.ms.com.ComLib::void threadStartMTA (java.lang.Thread))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   813
      (com.ms.com.ComLib::void IENVNextMarshalerJ2C (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   814
      (com.ms.com.ComLib::boolean supportsInterface (java.lang.Object com.ms.com._Guid))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   815
      (com.ms.com.ComLib::java.lang.Object ptrToStruct (java.lang.Class int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   816
      (com.ms.com.ComLib::int jcdwSizeOf (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   817
      (com.ms.com.ComLib::void declareMessagePumpThread ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   818
      (com.ms.com.ComLib::void IENVNextMarshalerC2J (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   819
      (com.ms.com.ComLib::void freeGCHandle (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   820
      (com.ms.com.ComLib::boolean isEqualUnknown (java.lang.Object java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   821
      (com.ms.com.Dispatch::boolean NIsArray (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   822
      (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[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   823
      (com.ms.com.Dispatch::void NGetIDsOfNamesReal (java.lang.Object com.ms.com._Guid int java.lang.String[] int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   824
      (com.ms.com.ComException::int FormatMessage (int int int int java.lang.StringBuffer int int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   825
      (com.ms.com.Variant::int toInt ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   826
      (com.ms.com.Variant::double toDate ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   827
      (com.ms.com.Variant::boolean toBoolean ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   828
      (com.ms.com.Variant::double toDouble ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   829
      (com.ms.com.Variant::long toCurrency ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   830
      (com.ms.com.Variant::void putVariantArray (com.ms.com.Variant[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   831
      (com.ms.com.Variant::com.ms.com.Variant[] getVariantArray ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   832
      (com.ms.com.Variant::void putByteArray (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   833
      (com.ms.com.Variant::void putShortRef (unsigned short))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   834
      (com.ms.com.Variant::void putIntRef (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   835
      (com.ms.com.Variant::void putDoubleRef (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   836
      (com.ms.com.Variant::void putDateRef (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   837
      (com.ms.com.Variant::void putStringRef (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   838
      (com.ms.com.Variant::unsigned short getShortRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   839
      (com.ms.com.Variant::int getIntRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   840
      (com.ms.com.Variant::double getDoubleRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   841
      (com.ms.com.Variant::double getDateRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   842
      (com.ms.com.Variant::java.lang.String getStringRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   843
      (com.ms.com.Variant::java.lang.String internalToString ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   844
      (com.ms.com.Variant::void initSafeArrayByRef (com.ms.com.SafeArray int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   845
      (com.ms.com.Variant::java.lang.Object toCharArray ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   846
      (com.ms.com.Variant::java.lang.Object toDispatch ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   847
      (com.ms.com.Variant::byte toByte ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   848
      (com.ms.com.Variant::java.lang.Object getDispatch ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   849
      (com.ms.com.Variant::void putDispatch (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   850
      (com.ms.com.Variant::boolean getBoolean ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   851
      (com.ms.com.Variant::int toError ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   852
      (com.ms.com.Variant::java.lang.Object toObject ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   853
      (com.ms.com.Variant::void initSafeArrayByVal (com.ms.com.SafeArray int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   854
      (com.ms.com.Variant::java.lang.Object getObject ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   855
      (com.ms.com.Variant::void putObject (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   856
      (com.ms.com.Variant::com.ms.com.SafeArray toSafeArrayHelper (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   857
      (com.ms.com.Variant::void putFloatRef (float))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   858
      (com.ms.com.Variant::void putCurrencyRef (long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   859
      (com.ms.com.Variant::void putErrorRef (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   860
      (com.ms.com.Variant::void putBooleanRef (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   861
      (com.ms.com.Variant::void putObjectRef (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   862
      (com.ms.com.Variant::void putByteRef (byte))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   863
      (com.ms.com.Variant::java.lang.String getString ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   864
      (com.ms.com.Variant::void putString (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   865
      (com.ms.com.Variant::float getFloatRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   866
      (com.ms.com.Variant::long getCurrencyRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   867
      (com.ms.com.Variant::int getErrorRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   868
      (com.ms.com.Variant::boolean getBooleanRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   869
      (com.ms.com.Variant::java.lang.Object getObjectRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   870
      (com.ms.com.Variant::byte getByteRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   871
      (com.ms.com.Variant::float toFloat ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   872
      (com.ms.com.Variant::void putCharArray (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   873
      (com.ms.com.Variant::void putDispatchRef (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   874
      (com.ms.com.Variant::java.lang.Object getDispatchRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   875
      (com.ms.com.Variant::void putVariantArrayRef (com.ms.com.Variant[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   876
      (com.ms.com.Variant::com.ms.com.Variant[] getVariantArrayRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   877
      (com.ms.com.Variant::void changeType (unsigned short))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   878
      (com.ms.com.Variant::void ncloneIndirect (com.ms.com.Variant))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   879
      (com.ms.com.Variant::void nFinalize (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   880
      (com.ms.com.Variant::void nclone (com.ms.com.Variant))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   881
      (com.ms.com.Variant::unsigned short toShort ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   882
      (com.ms.com.Variant::void putSafeArrayRefHelper (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   883
      (com.ms.com.Variant::com.ms.com.Variant[] toVariantArray ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   884
      (com.ms.com.Variant::java.lang.Object toByteArray ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   885
      (com.ms.com.Variant::void TrueVariantClear ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   886
      (com.ms.awt.WToolkit::boolean MessageBeep (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   887
      (com.ms.applet.AppletPanel::boolean StartCodeDownload (int java.lang.String java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   888
      (com.ms.applet.AppletPanel::void securedCall0 (int java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   889
      (com.ms.applet.AppletPanel::com.ms.security.PermissionSet getDefaultPermissionsFromLoader (com.ms.vm.loader.URLClassLoader))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   890
      (com.ms.dll.Win32Exception::int FormatMessage (int int int int java.lang.StringBuffer int int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   891
      (com.ms.awt.WGuiCallback::boolean SetEvent (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   892
      (com.ms.awt.WGuiCallback::int CreateSemaphore (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   893
      (com.ms.awt.WGuiCallback::int ReleaseSemaphore (int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   894
      (com.ms.awt.WGuiCallback::void userYield (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   895
      (com.ms.awt.WGuiCallback::int MsgWaitForMultipleObjects (int int[] boolean int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   896
      (com.ms.awt.WGuiCallback::int CreateEvent (int boolean boolean int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   897
      (com.ms.activeX.ActiveXToolkit::int GetSysColor (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   898
      (com.ms.awt.peer.NativeGraphics::void setPageDimension (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   899
      (com.ms.awt.peer.NativeGraphics::void setBkColour (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   900
      (com.ms.awt.peer.NativeGraphics::void getClipBounds (com.ms.awt.peer.NativeRect int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   901
      (com.ms.awt.peer.NativeGraphics::void pGetCharOutline (int byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   902
      (com.ms.awt.peer.NativeGraphics::void drawLine (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   903
      (com.ms.awt.peer.NativeGraphics::void setXORMode (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   904
      (com.ms.awt.peer.NativeGraphics::int drawString (java.lang.String int int int int int int int int[] int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   905
      (com.ms.awt.peer.NativeGraphics::int getCoClass ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   906
      (com.ms.awt.peer.NativeGraphics::void drawArc (int int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   907
      (com.ms.awt.peer.NativeGraphics::void getInitialPageDimension (com.ms.awt.peer.NativeRect))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   908
      (com.ms.awt.peer.NativeGraphics::void setVisRgn (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   909
      (com.ms.awt.peer.NativeGraphics::void pSetForeground (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   910
      (com.ms.awt.peer.NativeGraphics::int pGetDC ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   911
      (com.ms.awt.peer.NativeGraphics::void drawPixels (int[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   912
      (com.ms.awt.peer.NativeGraphics::void drawPolygon (int[] int[] int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   913
      (com.ms.awt.peer.NativeGraphics::void createFromImage (com.ms.awt.peer.INativeImage))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   914
      (com.ms.awt.peer.NativeGraphics::void endPage ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   915
      (com.ms.awt.peer.NativeGraphics::int pGetCharOutlineSize (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   916
      (com.ms.awt.peer.NativeGraphics::void pDrawBezier (int int int[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   917
      (com.ms.awt.peer.NativeGraphics::int drawBytes (byte[] int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   918
      (com.ms.awt.peer.NativeGraphics::void changeClip (int int int int boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   919
      (com.ms.awt.peer.NativeGraphics::int drawChars (char[] int int int int int int int int int int[] int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   920
      (com.ms.awt.peer.NativeGraphics::void drawT2Curve (float float float float float float int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   921
      (com.ms.awt.peer.NativeGraphics::void createFromPrintJob (java.lang.String com.ms.awt.peer.SPJData))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   922
      (com.ms.awt.peer.NativeGraphics::void endPrintJob ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   923
      (com.ms.awt.peer.NativeGraphics::void pSetOrigin (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   924
      (com.ms.awt.peer.NativeGraphics::void createFromHDC (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   925
      (com.ms.awt.peer.NativeGraphics::void drawOval (int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   926
      (com.ms.awt.peer.NativeGraphics::int pSetFont (java.lang.String int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   927
      (com.ms.awt.peer.NativeGraphics::void setPaintMode (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   928
      (com.ms.awt.peer.NativeGraphics::void startPage ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   929
      (com.ms.awt.peer.NativeGraphics::void clearClip ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   930
      (com.ms.awt.peer.NativeGraphics::void createFromCopy (com.ms.awt.peer.INativeGraphics))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   931
      (com.ms.awt.peer.NativeGraphics::void scanLines (int int[] int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   932
      (com.ms.awt.peer.NativeGraphics::void drawRoundRect (int int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   933
      (com.ms.awt.peer.NativeGraphics::void dispose ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   934
      (com.ms.awt.peer.NativeGraphics::void clearRect (int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   935
      (com.ms.awt.peer.NativeGraphics::void copyArea (int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   936
      (com.ms.awt.peer.NativeGraphics::void createFromWindow (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   937
      (com.ms.awt.peer.NativeGraphics::void drawPolyline (int[] int[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   938
      (com.ms.awt.peer.NativeGraphics::void drawRect (int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   939
      (com.ms.awt.peer.CToolkit::void callbackEventLoop (com.ms.awt.peer.IToolkitCallback))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   940
      (com.ms.awt.peer.CToolkit::int getToolkitHwnd ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   941
      (com.ms.awt.peer.CToolkit::int createCompHwnd (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   942
      (com.ms.awt.peer.CNativeSystemIME::void setCompositionFont (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   943
      (com.ms.awt.peer.CNativeSystemIME::void setCompositionPos (int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   944
      (com.ms.awt.peer.CNativeSystemIME::void setOpenStatus (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   945
      (com.ms.awt.peer.CNativeSystemIME::int getOpenStatus (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   946
      (com.ms.awt.peer.CNativeSystemIME::java.lang.String getCompositionString (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   947
      (com.ms.awt.peer.CNativeSystemIME::java.lang.String getCompositionResultString (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   948
      (com.ms.net.wininet.WininetStreamHandlerFactory::int initNative (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   949
      (com.ms.com.SafeArray::void rawGetVariantAs (int com.ms.com.Variant))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   950
      (com.ms.com.SafeArray::void NSafeArrayInit (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   951
      (com.ms.com.SafeArray::float rawGetDouble (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   952
      (com.ms.com.SafeArray::void NRawBoolCopyToJavaArray (int int boolean[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   953
      (com.ms.com.SafeArray::void validateArray (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   954
      (com.ms.com.SafeArray::void NSafeArrayCreateFromString (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   955
      (com.ms.com.SafeArray::void rawSetString (int java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   956
      (com.ms.com.SafeArray::int getInt (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   957
      (com.ms.com.SafeArray::void setInt (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   958
      (com.ms.com.SafeArray::boolean getBoolean (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   959
      (com.ms.com.SafeArray::void setBoolean (int boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   960
      (com.ms.com.SafeArray::int computeOffset (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   961
      (com.ms.com.SafeArray::void NSafeArrayNullInit ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   962
      (com.ms.com.SafeArray::void rawSetVariant (int com.ms.com.Variant))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   963
      (com.ms.com.SafeArray::float rawGetFloat (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   964
      (com.ms.com.SafeArray::float getFloat (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   965
      (com.ms.com.SafeArray::void setFloat (int float))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   966
      (com.ms.com.SafeArray::int computeOffset2 (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   967
      (com.ms.com.SafeArray::void rawSetDouble (int double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   968
      (com.ms.com.SafeArray::java.lang.String asString ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   969
      (com.ms.com.SafeArray::void NRawCopyToJavaArray (int int java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   970
      (com.ms.com.SafeArray::void NSafeArrayCreate (int int int[] int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   971
      (com.ms.com.SafeArray::void NRawBoolCopyFromJavaArray (boolean[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   972
      (com.ms.com.SafeArray::void NSafeArrayDestroy (boolean boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   973
      (com.ms.com.SafeArray::int NSafeArrayCopy ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   974
      (com.ms.com.SafeArray::int rawGetInt (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   975
      (com.ms.com.SafeArray::boolean rawGetBoolean (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   976
      (com.ms.com.SafeArray::void rawSetFloat (int float))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   977
      (com.ms.com.SafeArray::java.lang.String rawGetString (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   978
      (com.ms.com.SafeArray::int NTotalNumElems ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   979
      (com.ms.com.SafeArray::double getDouble (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   980
      (com.ms.com.SafeArray::void setDouble (int double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   981
      (com.ms.com.SafeArray::void Nreinit (com.ms.com.SafeArray))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   982
      (com.ms.com.SafeArray::int getPhysicalSafeArray ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   983
      (com.ms.com.SafeArray::int NgetdwordAt (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   984
      (com.ms.com.SafeArray::void NRawCopyFromJavaArray (java.lang.Object int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   985
      (com.ms.com.SafeArray::void rawSetBoolean (int boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   986
      (com.ms.com.SafeArray::void rawSetInt (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   987
      (com.ms.awt.peer.CNativeComponent::void invalidate (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   988
      (com.ms.awt.peer.CNativeComponent::void hideModal ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   989
      (com.ms.awt.peer.CNativeComponent::void hide ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   990
      (com.ms.awt.peer.CNativeComponent::void setOnTop (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   991
      (com.ms.awt.peer.CNativeComponent::void registerDragDrop ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   992
      (com.ms.awt.peer.CNativeComponent::void endValidate ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   993
      (com.ms.awt.peer.CNativeComponent::void enable ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   994
      (com.ms.awt.peer.CNativeComponent::void disable ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   995
      (com.ms.awt.peer.CNativeComponent::void setTitle (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   996
      (com.ms.awt.peer.CNativeComponent::void getBounds (com.ms.awt.peer.NativeRect))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   997
      (com.ms.awt.peer.CNativeComponent::int gethwnd ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   998
      (com.ms.awt.peer.CNativeComponent::void showModal ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   999
      (com.ms.awt.peer.CNativeComponent::void setCursor (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1000
      (com.ms.awt.peer.CNativeComponent::void reshape (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1001
      (com.ms.awt.peer.CNativeComponent::void requestFocus ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1002
      (com.ms.awt.peer.CNativeComponent::void callDefWindowProc (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1003
      (com.ms.awt.peer.CNativeComponent::void registerCustomDropTarget (com.ms.com.IUnknown))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1004
      (com.ms.awt.peer.CNativeComponent::void setNoActivate (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1005
      (com.ms.awt.peer.CNativeComponent::void getPlaceOnScreen (com.ms.awt.peer.NativeRect))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1006
      (com.ms.awt.peer.CNativeComponent::void beginValidate ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1007
      (com.ms.awt.peer.CNativeComponent::void clippedReshape (int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1008
      (com.ms.awt.peer.CNativeComponent::void setResizable (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1009
      (com.ms.awt.peer.CNativeComponent::void setIcon (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1010
      (com.ms.awt.peer.CNativeComponent::void toBack ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1011
      (com.ms.awt.peer.CNativeComponent::void setFrameHost (com.ms.awt.peer.IBrowserAppletFrameCallback))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1012
      (com.ms.awt.peer.CNativeComponent::void toFront ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1013
      (com.ms.awt.peer.CNativeComponent::void show ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1014
      (com.ms.awt.peer.CNativeComponent::void updateInsets (com.ms.awt.peer.NativeInsets))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1015
      (com.ms.awt.peer.CNativeComponent::void dispose ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1016
      (com.ms.awt.peer.CNativeComponent::void initFromJavaWindow (int com.ms.awt.peer.IComponentCallback com.ms.awt.peer.INativeComponent com.ms.awt.peer.IToolkit int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1017
      (com.ms.awt.peer.CNativeComponent::void init (int com.ms.awt.peer.IComponentCallback com.ms.awt.peer.INativeComponent com.ms.awt.peer.IToolkit))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1018
      (com.ms.awt.peer.CNativeComponent::void beginDrag (com.ms.awt.peer.INativeDragCallback))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1019
      (com.ms.fx.RegionConverter::int computeNativeRegion (int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1020
      (com.ms.fx.RegionConverter::int[] computeJavaRegion (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1021
      (com.ms.net.wininet.URLUtils::java.lang.String canonicalizeURL (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1022
      (com.ms.net.wininet.URLUtils::java.lang.String combineURL (java.lang.String java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1023
      (com.ms.awt.peer.NativeFontMetrics::int bytesWidth (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1024
      (com.ms.awt.peer.NativeFontMetrics::int stringWidth (java.lang.String int int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1025
      (com.ms.awt.peer.NativeFontMetrics::int charsWidth (char[] int int int int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1026
      (com.ms.awt.peer.NativeFontMetrics::java.lang.String init (com.ms.awt.peer.INativeGraphics int[] java.lang.String int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1027
      (com.ms.io.console.Console::int MessageBox (int java.lang.String java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1028
      (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))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1029
      (com.ms.security.management.SecurityZone::byte[] pLoadCustomPermissions (int int java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1030
      (com.ms.awt.peer.NativeImage::int setBytePixelsDirected (int int int int com.ms.awt.peer.DirectColourModelData byte[] int int com.ms.awt.peer.INativeImageBufferDone))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1031
      (com.ms.awt.peer.NativeImage::void create (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1032
      (com.ms.awt.peer.NativeImage::int setIntPixelsIndexed (int int int int int[] int int[] int int com.ms.awt.peer.INativeImageBufferDone))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1033
      (com.ms.awt.peer.NativeImage::int getCoClass ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1034
      (com.ms.awt.peer.NativeImage::int getIcon (int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1035
      (com.ms.awt.peer.NativeImage::int setBytePixelsIndexed (int int int int int[] int byte[] int int com.ms.awt.peer.INativeImageBufferDone))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1036
      (com.ms.awt.peer.NativeImage::void sendPixels (com.ms.awt.peer.SPData))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1037
      (com.ms.awt.peer.NativeImage::void fillPixels (com.ms.awt.peer.SPData byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1038
      (com.ms.awt.peer.NativeImage::void dispose ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1039
      (com.ms.awt.peer.NativeImage::void init (int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1040
      (com.ms.awt.peer.NativeImage::int setIntPixelsDirected (int int int int com.ms.awt.peer.DirectColourModelData int[] int int com.ms.awt.peer.INativeImageBufferDone))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1041
      (com.ms.awt.peer.NativeImage::void imageDrawStretched (com.ms.awt.peer.INativeGraphics int int int int int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1042
      (com.ms.awt.peer.NativeImage::int finish (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1043
      (com.ms.awt.peer.NativeImage::void imageDraw (int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1044
      (com.ms.awt.peer.NativeResource::java.lang.String loadString (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1045
      (com.ms.awt.peer.NativeResource::int openDialogFromID (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1046
      (com.ms.awt.peer.NativeResource::boolean attach (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1047
      (com.ms.awt.peer.NativeResource::void loadBytes (int int java.lang.String byte[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1048
      (com.ms.awt.peer.NativeResource::int getSize (int int java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1049
      (com.ms.awt.peer.NativeResource::void detach ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1050
      (com.ms.awt.peer.NativeResource::int openDialogFromName (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1051
      (com.ms.net.wininet.WininetURLConnection::com.ms.applet.BrowserAppletFrame findOfflineContext ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1052
      (com.ms.com.DispatchProxy::void finalize ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1053
      (com.ms.com.DispatchProxy::void init (com.ms.com._Guid java.lang.reflect.Method[] int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1054
      (com.ms.net.wininet.WininetInputStream::void close ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1055
      (com.ms.net.wininet.WininetInputStream::int read (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1056
      (com.ms.net.wininet.WininetInputStream::int available ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1057
      (com.ms.net.wininet.WininetInputStream::long skip (long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1058
      (com.ms.net.wininet.WininetInputStream::void connect (java.lang.String boolean boolean java.lang.SecurityManager))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1059
      (com.ms.vm.loader.CabSignatureInfo::com.ms.vm.loader.CabSignatureInfo extractFromFile0 (java.lang.String com.ms.security.management.SecurityPolicy))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1060
      (com.ms.net.wininet.http.HttpInputStream::byte[] getResponseHeaders ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1061
      (com.ms.net.wininet.http.HttpInputStream::void close0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1062
      (com.ms.net.wininet.http.HttpInputStream::void connect (java.lang.String int java.lang.String boolean boolean boolean boolean byte[] byte[] java.lang.SecurityManager))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1063
      (com.ms.vm.loader.CabCracker::int GetTempFileName (java.lang.StringBuffer java.lang.String int java.lang.StringBuffer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1064
      (com.ms.vm.loader.CabCracker::void getBytes0 (int int byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1065
      (com.ms.vm.loader.CabCracker::void cleanup ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1066
      (com.ms.vm.loader.CabCracker::int GetTempPath (int java.lang.StringBuffer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1067
      (com.ms.vm.loader.CabCracker::void load0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1068
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1069
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1070
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1071
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1072
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1073
performance
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1074
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1075
     JAVA::BenchMark new loopmark        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1076
     JAVA::BenchMark new logicmark  
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1077
     JAVA::BenchMark new sievemark       
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1078
     JAVA::BenchMark new methodmark      
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1079
     JAVA::BenchMark new stringmark  
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1080
     JAVA::BenchMark new newstringmark                
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1081
     JAVA::BenchMark new neweststringmark               
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1082
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1083
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1084
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1085
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1086
		    caffmark  loopmark  logicmark  sievemark  methodmark  stringmark  float  image  graphic dialog newstringmark  neweststringmark
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1087
 linux:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1088
   P6/233 No JIT                 84         87        90          40          22                                       17              10
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1089
		      103       133        142       137          28          73       109    167     18    140
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1090
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1091
   P6/233 JIT                   479       2459       393         649          28                                       21              12
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1092
   P6/233 JIT         473      1805       3046       439         986          28                                       21              12
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1093
		      533      1808       3382       613        1003          25       105    143      1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1094
		      668      3330       3644       740
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1095
		      793      4116       3731      1243        1365         120       103     79      2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1096
		      914      4480       4061                  2290          68       106    158     19     34
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1097
		      941      4607       4149      1238        2434          75       101    152     18     32
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1098
									     591              164
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1099
		     1087                           1836                     800       110                   35
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1100
		     1102      4592       4270      1844        2381         841       109    169     21     35
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1101
		     1177      4608       4309      1810        2432         895       532    182     20     35
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1102
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1103
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1104
 w95
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1105
   P5/200 JIT          90        95         90        95         686          18        60     54      7
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1106
		      428      1657       2385       684         957          21        61     62      9
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1107
		      541      2886       2589       823         976          18        62     55      7
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1108
		      583      3062       2635       842         861         223        65     57      8
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1109
		      616      3075       2438      1081        1324         218        64     54      8
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1110
		      718      3138       2755      1085        1200         816        63     48      9      7
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1111
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1112
		    caffmark  loopmark  logicmark  sievemark  methodmark  stringmark  float  image  graphic dialog newstringmark  neweststringmark
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1113
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1114
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1115
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1116
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1117
performance2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1118
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1119
     symantec benchmarks
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1120
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1121
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1122
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1123
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1124
		BubbleSort    BidirBubbleSort  QuickSort  Sieve   Hanoi   Dhry   Fib   Array   Tree   Total
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1125
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1126
   ST/X+J Linux         
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1127
   233Mhz P6
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1128
   No JIT          352767         354597         69585    43048  101638  28961 108839  48815
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1129
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1130
   ST/X+J Linux                  
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1131
   233Mhz P6
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1132
   JIT             128724         116810         20259    39733   83160  27613  52093  33166  43996  545554
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1133
		   124744         101428         17239    10052    8264  14004  38821  23252  33709  374660
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1134
   +IINC           120324                                  7265
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1135
   +IADD op2       100173          90737         18128     6996    7423  17093  48559  44209  57056  390374
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1136
   +ISUB op2                       90460         17547             5921                       57056  390461
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1137
   +ICMPEQ/NE       99785          90147                           5792                43482  56486  388255
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1138
   +ICMP            87398          78214         15784     7574    5628  12812  38481  24654  32252  302797
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1139
   +IFICMPLE        84198          74928         13814     5650          11674         23241         293118
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1140
   +IFICMPxx        76867          69738         12208                          37505  21973  32104  273569
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1141
   +IFICMPEQ/NE                                                    5580  11202         21723
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1142
   const IFICMPxx                                11856             5463  11032  37372                272726
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1143
   +lea for add/sub
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1144
   +BALOAD                                       11700     4600    5015   9431
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1145
   +BASTORE                                                3279
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1146
   +CALOAD/CASTORE                                                        8907
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1147
   regSave change   66119          60365          9997             4917  15386  37851  38202  50027  286497
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1148
		    64858          58360          9476             4889  15001  37211  36288  48313  278478
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1149
		    63146          55949          9302                   14899
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1150
		    62970          56085          9352     3226    4837   8779  37573  22815  33899  241297
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1151
   -O               43662          40292          7181     2530    4696   8170  34555  22116  32337  195539
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1152
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1153
   +IALOAD          39162          36347
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1154
   +IASTORE         32461          30663          4299             3667                19556  30563  166868
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1155
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1156
   -IALOAD/IASTORE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1157
										34167  19347
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1158
										       19232  29726  
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1159
										       18821
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1160
   +AALOAD/BALOAD
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1161
		    41490          39527          6776     3315    4077   8443  33895  19152  28018  184693
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1162
		    41291          37034          6593                          32682
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1163
   +ATHROW                                                                6449                       180079
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1164
   +IASTORE         38848          35601          6219             3796   6122         17869  30085  175106
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1165
   IINC delayed code
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1166
   +ANEWARRAY                                              3263
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1167
   +LADD/LSUB const 38719          35256                                  6062  27071                172859
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1168
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1169
							   2837                 22835
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1170
   +ISTORE into arg
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1171
									  3080
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1172
   quick L2I for ints                                                     2774  21184
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1173
   +*ASTORE / *ALOAD
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1174
    again                                                  1621    3654   1525
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1175
   +CHECKCAST                                                      3574                       25810
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1176
                                                                
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1177
------------------------------------------------------------------------------------------------------------
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1178
		BubbleSort    BidirBubbleSort  QuickSort  Sieve   Hanoi   Dhry   Fib   Array   Tree   Total
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1179
   ST/X+J Win95         
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1180
   200Mhz P5
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1181
   JIT              78490          77060         15220     4840    6370   9180  73160  36080         351700
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1182
				   76900         13560             5500   9010         35200         348600
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1183
										66080         69920  370750
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1184
   +IADD non consts 76620          73210         13180     3790                 63550         58880  356900
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1185
											      51740
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1186
		    77390          72450         12520     3900    6040   8950  62450  34330  57780  335810    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1187
		    77220          71950                           5270   8840                       338650
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1188
		    72390          70690                                                      48010  327370
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1189
		    74910          66740         11420                    8620  61730  33340  47350  313940
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1190
   +xALOAD/JMP_ZERO
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1191
		    71740                                  2800             
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1192
		    71460          65250         11540     2750                 62180  33840  50750  311660
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1193
   +LCMP                                                                        59100
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1194
   better abs(I)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1195
   +xALOAD/IF_ICMPx 66130          61520         12080     3300    5280   8190  56510  33830  50310  297150
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1196
   elim dummy static                                               5210                       48270
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1197
   methods                                                                                    44160
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1198
		   119020         112440         19330     3070    4560   2640  56960  37730  52790  408540
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1199
------------------------------------------------------------------------------------------------------------
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1200
		BubbleSort    BidirBubbleSort  QuickSort  Sieve   Hanoi   Dhry   Fib   Array   Tree   Total
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1201
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1202
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1203
   Sun JDK         274625         244461         52676    50653   65183  26668  78133  28572  61608  882583
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1204
   (90Mhz P5)   
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1205
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1206
   Microsoft J++     9684           8452          2874     1733    3535   3665   3836   4746  25717   64242
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1207
   (90Mhz P5)   
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1208
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1209
   Symantec Cafe    14541          12198          3686     1922    4527   3325   3425  12969  26829   83422
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1210
   JIT 1.02
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1211
   (90Mhz P5)   
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1212
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1213
   Symantec Cafe     8292           6970          2714     1613    3345   3235   2013   4516  13180   45878
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1214
   JIT 1.2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1215
   (90Mhz P5)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1216
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1217
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1218
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1219
   |b|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1220
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1221
   b := JAVA::BubbleSortAlgorithm new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1222
   b perform:#'setData(JJ)V' with:10000 with:0 with:0 with:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1223
   Time millisecondsToRun:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1224
       b performTest.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1225
   ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1226
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1227
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1228
   |b|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1229
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1230
   b := JAVA::QSortAlgorithm new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1231
   b perform:#'setData(JJ)V' with:500000 with:0 with:0 with:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1232
   Time millisecondsToRun:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1233
       b performTest.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1234
   ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1235
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1236
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1237
   |t|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1238
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1239
   t := JAVA::Tree new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1240
   t perform:#'setData(JJ)V' with:1000000 with:0 with:0 with:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1241
   Time millisecondsToRun:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1242
       t performTest.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1243
   ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1244
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1245
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1246
   |t|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1247
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1248
   t := JAVA::Array new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1249
   t perform:#'setData(JJ)V' with:1000000 with:0 with:0 with:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1250
   Time millisecondsToRun:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1251
       t performTest.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1252
   ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1253
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1254
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1255
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1256
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1257
!JavaVM class methodsFor:'initialization'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1258
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1259
compile:source selector:smalltalkSelector asJavaMethod:javaSelector fakedSource:fakedSource in:aClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1260
    "install additional java protocol in smalltalk classes, req'd for java programs"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1261
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1262
    |cloneCode|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1263
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1264
    (aClass implements:javaSelector) ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1265
        Class packageQuerySignal answer:'__temporary__'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1266
        do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1267
            aClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1268
                compile:source
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1269
                classified:'java support'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1270
                logged:false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1271
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1272
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1273
        cloneCode := aClass compiledMethodAt:smalltalkSelector.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1274
        cloneCode source:fakedSource.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1275
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1276
        Class withoutUpdatingChangesDo:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1277
            aClass removeSelector:smalltalkSelector.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1278
            aClass addSelector:javaSelector withMethod:cloneCode.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1279
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1280
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1281
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1282
    "Created: / 5.11.1998 / 19:30:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1283
    "Modified: / 5.11.1998 / 19:37:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1284
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1285
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1286
deinitialize
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1287
    StandardThreadGroup := nil.
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1288
    
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1289
    KnownWindows notNil ifTrue: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1290
        KnownWindows do: [:v | v isTopView ifTrue: [ v destroy ] ]
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1291
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1292
    JavaWindowGroup := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1293
    KnownWindows := nil.
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1294
    OpenFileTable := nil.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1295
    JavaMethods := nil.
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1296
    SystemClassLoader := nil.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1297
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1298
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1299
     JavaVM deinitialize"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1300
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1301
    "Created: / 03-01-1998 / 21:28:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1302
    "Modified: / 03-12-1998 / 20:33:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1303
    "Modified: / 28-01-2011 / 14:11:35 / Marcel Hlopko <hlopik@gmail.com>"
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1304
    "Modified: / 16-11-2011 / 09:46:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1305
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1306
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1307
deinitializeAdditionalJavaProtocol
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1308
    "deinstall additional java protocol in smalltalk classes, req'd for java programs"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1309
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1310
    #(
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1311
        #'clone()Ljava/lang/Object;'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1312
        #'equals(Ljava/lang/Object;)Z'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1313
        #'toString()Ljava/lang/String;'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1314
        #'getClass()Ljava/lang/Class;'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1315
     ) do:[:sel |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1316
        (Object implements:sel) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1317
            Class withoutUpdatingChangesDo:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1318
                Object removeSelector:sel.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1319
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1320
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1321
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1322
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1323
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1324
     self deinitializeAdditionalJavaProtocol
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1325
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1326
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1327
    "Created: / 4.2.1998 / 21:37:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1328
    "Modified: / 5.12.1998 / 15:27:39 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1329
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1330
1060
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  1331
flushClasses
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  1332
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  1333
    ClassRegistry notNil ifTrue:[
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  1334
        ClassRegistry flush
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  1335
    ].
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  1336
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  1337
    "Created: / 30-10-2011 / 16:09:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  1338
!
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  1339
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1340
initialize
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1341
    DUMMY_LONG_HIGHWORD := 1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1342
    DUMMY_DOUBLE_HIGHWORD := 2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1343
    StandardThreadGroup := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1344
    NoAudio := true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1345
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1346
    "/ NoAudio := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1347
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1348
    JavaConsoleStream := Transcript.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1349
    FullExceptionTrace := StackTrace := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1350
    WindowOPTrace := DrawOPTrace := EventTrace := ThreadTrace := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1351
    MonitorTrace := ExceptionTrace := FileOpenTrace := FileIOTrace := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1352
    ExceptionDebug := ExitDebug := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1353
    ExceptionDebugPatterns := Set new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1354
    WindowCreationTrace := false.
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1355
    FileOpenConfirmation := false.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1356
    SocketConnectConfirmation := false.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1357
    WindowOPTrace := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1358
    MonitorTrace := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1359
    ThreadTrace := false.
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1360
    UnhandledJavaExceptionSignal := (Signal new) mayProceed: true.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1361
    UnhandledJavaExceptionSignal nameClass: self
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1362
        message: #unhandledJavaExceptionSignal.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1363
    UnhandledJavaExceptionSignal notifierString: 'unhandled java exception'.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1364
    JavaExceptionSignal := (Signal new) mayProceed: false.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1365
    JavaExceptionSignal nameClass: self message: #javaExceptionSignal.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1366
    JavaExceptionSignal notifierString: 'java exception'.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1367
    UnimplementedInstructionSignal := (Signal new) mayProceed: false.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1368
    UnimplementedInstructionSignal nameClass: self
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1369
        message: #unimplementedInstructionSignal.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1370
    UnimplementedInstructionSignal notifierString: 'unimplemented instruction'.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1371
    UnimplementedNativeMethodSignal := (Signal new) mayProceed: false.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1372
    UnimplementedNativeMethodSignal nameClass: self
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1373
        message: #unimplementedNativeMethodSignal.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1374
    UnimplementedNativeMethodSignal 
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1375
        notifierString: 'unimplemented native method'.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1376
    BadMessageSignal := (Signal new) mayProceed: false.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1377
    BadMessageSignal nameClass: self message: #badMessageSignal.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1378
    BadMessageSignal notifierString: 'invalid message to JAVA object'.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1379
    InternalErrorSignal := (Signal new) mayProceed: false.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1380
    InternalErrorSignal nameClass: self message: #internalErrorSignal.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1381
    InternalErrorSignal notifierString: 'internal error'.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1382
    CallHandlerSignal := (Signal new) mayProceed: false.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1383
    CallHandlerSignal nameClass: self message: #callHandlerSignal.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1384
    CallHandlerSignal notifierString: 'internal signal'.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1385
    StdinReplacementFileQuerySignal := QuerySignal new.
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1386
    StdinReplacementFileQuerySignal nameClass: self
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1387
        message: #stdinReplacementFileQuerySignal.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1388
    StdinReplacementFileQuerySignal notifierString: 'asking for stdin stream'.
1016
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  1389
    JavaPrivilegedAccessQuery := QuerySignal new.
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1390
    JavaPrivilegedAccessQuery defaultAnswer: false.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1391
    AssertionsEnabled := true.
1069
d5d204ceb991 JavaVM: Added ClassRegistry initialization into JavaVM>>initialize
vranyj1
parents: 1063
diff changeset
  1392
    ClassRegistry := JavaClassRegistry new.
1109
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  1393
    FinalizationEnabled := true.
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  1394
    FinalizationLobby := Registry new.
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1395
    EagerResolvingEnabled := false.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1396
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1397
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1398
     JavaVM initialize"
1058
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  1399
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1400
    "Created: / 02-01-1998 / 18:02:34 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1401
    "Modified: / 02-12-1998 / 23:02:22 / cg"
1016
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  1402
    "Modified: / 09-10-2011 / 20:29:10 / Marcel Hlopko <hlopik@gmail.com>"
1109
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  1403
    "Modified: / 14-11-2011 / 21:12:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  1404
    "Modified: / 08-12-2011 / 21:06:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1405
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1406
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1407
initializeAdditionalJavaProtocol
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1408
    "install additional java protocol in smalltalk classes, req'd for java programs"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1409
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1410
    "/ since we use smalltalk Arrays for JavaArray, some
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1411
    "/ additional (java-) protocol is required.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1412
    "/ This is also useful, when Smalltalk objects are passed to
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1413
    "/ java ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1414
    "/ We should implement all of the java.lang.Object protocol in
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1415
    "/ Object, to be on the bright side of life; more of this later ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1416
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1417
    self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1418
        compile:'__clone
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1419
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1420
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1421
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1422
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1423
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1424
    ^ self shallowCopy'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1425
        selector:#'__clone' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1426
        asJavaMethod:#'clone()Ljava/lang/Object;' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1427
        fakedSource:'#''clone()Ljava/lang/Object;''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1428
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1429
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1430
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1431
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1432
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1433
    ^ self shallowCopy'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1434
        in:Object.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1435
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1436
    "/ ------------------------------------------------------------
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1437
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1438
    self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1439
        compile:'__equals:arg
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1440
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1441
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1442
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1443
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1444
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1445
    ^ (arg = self) ifTrue:[1] ifFalse:[0]'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1446
        selector:#'__equals:' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1447
        asJavaMethod:#'equals(Ljava/lang/Object;)Z' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1448
        fakedSource:'#''equals(Ljava/lang/Object;)Z''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1449
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1450
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1451
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1452
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1453
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1454
    ^ (arg = self) ifTrue:[1] ifFalse:[0]'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1455
        in:Object.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1456
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1457
    "/ ------------------------------------------------------------
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1458
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1459
    self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1460
        compile:'__toString
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1461
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1462
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1463
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1464
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1465
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1466
    ^ Java as_String:(self displayString)'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1467
        selector:#'__toString' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1468
        asJavaMethod:#'toString()Ljava/lang/String;' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1469
        fakedSource:'#''toString()Ljava/lang/String;''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1470
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1471
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1472
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1473
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1474
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1475
    ^ Java as_String:(self displayString)'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1476
        in:Object.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1477
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1478
    "/ ------------------------------------------------------------
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1479
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1480
    self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1481
        compile:'__getClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1482
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1483
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1484
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1485
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1486
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1487
    ^ JavaVM javaClassObjectForClass:self class'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1488
        selector:#'__getClass' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1489
        asJavaMethod:#'getClass()Ljava/lang/Class;' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1490
        fakedSource:'#''getClass()Ljava/lang/Class;''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1491
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1492
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1493
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1494
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1495
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1496
    ^ JavaVM javaClassObjectForClass:self class'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1497
        in:Object.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1498
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1499
    "/ ------------------------------------------------------------
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1500
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1501
    self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1502
        compile:'__hashCode
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1503
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1504
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1505
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1506
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1507
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1508
    ^ self identityHash'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1509
        selector:#'__hashCode' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1510
        asJavaMethod:#'hashCode()I' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1511
        fakedSource:'#''hashCode()I''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1512
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1513
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1514
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1515
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1516
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1517
    ^ self identityHash'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1518
        in:Object.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1519
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1520
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1521
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1522
     self initializeAdditionalJavaProtocol
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1523
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1524
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1525
    "Modified: / 28-01-1997 / 19:38:58 / stefan"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1526
    "Modified: / 22-01-1998 / 21:23:40 / av"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1527
    "Created: / 04-02-1998 / 21:35:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1528
    "Modified: / 30-12-1998 / 21:07:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1529
    "Modified: / 25-10-2010 / 16:26:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1530
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1531
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1532
initializeBaseClasses
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1533
    "load req'd base classes"
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1534
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1535
    #( 'java.lang.Object'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1536
     'java.lang.Class'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1537
     'java.lang.String'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1538
     'java.lang.System' ) 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1539
            do: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1540
                :cName | 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1541
                (self classForName: cName) isNil ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1542
                    self 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1543
                        warn: ('JavaVM: could not find required class: ' , cName asText allBold 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1544
                                , '\\Please check the Java settings (javaHome)') withCRs.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1545
                    AbortSignal raise.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1546
                    ^ self
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1547
                ]
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1548
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1549
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1550
    "
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1551
     self initializeBaseClasses"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1552
    "Created: / 3.1.1998 / 21:13:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1553
    "Modified: / 23.12.1999 / 19:27:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1554
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1555
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1556
initializeJavaResources
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1557
    LockTable := WeakIdentityDictionary new.
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1558
    LockTableAccess := Semaphore "RecursionLock" forMutualExclusion.
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1559
    LockTableAccess name: 'JavaVM lock table access mutex'.
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1560
    WaitTable := IdentityDictionary new.
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1561
    WaitTableAccess := Semaphore "RecursionLock" forMutualExclusion.
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1562
    WaitTableAccess name: 'JavaVM wait table access mutex'.
1119
0f4d4bc3d346 warning!! bug possibly fixed :) probably not but maybe ;)
hlopkmar
parents: 1118
diff changeset
  1563
    Logger 
0f4d4bc3d346 warning!! bug possibly fixed :) probably not but maybe ;)
hlopkmar
parents: 1118
diff changeset
  1564
        log: 'Initializing EnteredMonitorsPerProcess'
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
  1565
        severity: #debug
1119
0f4d4bc3d346 warning!! bug possibly fixed :) probably not but maybe ;)
hlopkmar
parents: 1118
diff changeset
  1566
        facility: #JVM.
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1567
    EnteredMonitorsPerProcess := IdentityDictionary new.
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
  1568
    Logger 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
  1569
    log: 'Initializing AcquiredMonitorsPerProcess'
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
  1570
    severity: #debug
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
  1571
    facility: #JVM.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
  1572
        AcquiredMonitorsPerProcess := IdentityDictionary new.
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1573
    self initializePrimitiveClasses.
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1574
    self initializeOpenFileTable.
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1575
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1576
    "
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1577
     JavaVM releaseAllMonitors"
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1578
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1579
    "Created: / 02-01-1998 / 18:04:05 / cg"
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1580
    "Modified: / 07-01-1998 / 22:58:10 / cg"
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1581
    "Modified: / 25-10-2010 / 19:14:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1582
    "Created: / 16-11-2011 / 14:23:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1583
!
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1584
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1585
initializeOpenFileTable
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1586
    OpenFileTable := OrderedCollection 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1587
			with:Stdin 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1588
			with:(JavaConsoleStream ? Stdout)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1589
			with:(JavaConsoleStream ? Stderr).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1590
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1591
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1592
     JavaVM initializeOpenFileTable
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1593
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1594
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1595
    "Modified: / 6.8.1997 / 00:40:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1596
    "Created: / 2.1.1998 / 18:04:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1597
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1598
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1599
initializePrimitiveClasses
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1600
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1601
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1602
    "/    #(
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1603
    "/        (#byte    'B' 1)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1604
    "/        (#short   'S' 2)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1605
    "/        (#int     'I' 4)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1606
    "/        (#long    'J' 8)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1607
    "/        (#boolean 'Z' 1)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1608
    "/        (#char    'C' 2)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1609
    "/        (#float   'F' 4)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1610
    "/        (#double  'D' 8)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1611
    "/        (#void    'V' 0)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1612
    "/    ) triplesDo:[:nm :sig :len |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1613
    "/        |jClass classInst|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1614
    "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1615
    "/        "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1616
    "/        "/ create a javaClass for it.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1617
    "/        "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1618
    "/        jClass := Java at:'java.lang.Class'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1619
    "/        jClass notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1620
    "/            classInst := jClass new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1621
    "/            JavaClasses at:nm put:classInst.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1622
    "/            JavaClasses at:classInst put:nm.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1623
    "/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1624
    "/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1625
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1626
     self initializePrimitiveClasses"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1627
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1628
    "Modified: / 22-10-1998 / 01:56:02 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1629
    "Modified: / 20-12-2010 / 23:39:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1630
    "Modified: / 28-01-2011 / 14:57:38 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1631
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1632
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1633
initializeReflection
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1634
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1635
    Reflection := JavaVM::Reflection for: self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1636
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1637
    "Created: / 21-12-2010 / 19:48:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1638
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1639
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1640
initializeSimulatedLibs
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1641
    "return a collection of native libs which are considered 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1642
     being already loaded. (used with jdk < 1.2)"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1643
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1644
    LibPath := #(
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1645
                        '__builtIn__' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1646
                        '/usr/local/lib' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1647
                        '/usr/local/lib/java'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1648
                ).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1649
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1650
    SimulatedLibs := #(
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1651
                        '__builtIn__/net' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1652
                        '__builtIn__/awt' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1653
                        '__builtIn__/tawt' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1654
                        '__builtIn__/winawt' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1655
                        '__builtIn__/jpeg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1656
                        '__builtIn__/mmedia'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1657
                        '__builtIn__/zip'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1658
                        '__builtIn__/math'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1659
                        '__builtIn__/sysresource'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1660
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1661
                        "/ KAVA ... 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1662
                        '__builtIn__/agent'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1663
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1664
                        "/ MS-java ... 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1665
                        '__builtIn__/msawt'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1666
                        '__builtIn__/javart'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1667
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1668
                        "/ 1.1.8
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1669
                        '__builtIn__/jpeg_sun' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1670
                      ).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1671
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1672
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1673
     self initializeSimulatedLibs
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1674
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1675
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1676
    "Created: / 4.1.1998 / 19:05:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1677
    "Modified: / 17.11.1998 / 23:53:02 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1678
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1679
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1680
initializeSimulatedNativeLibs
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1681
    "return a collection of native libs which are considered 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1682
     being already loaded (used with jdk >= 1.2)"
1079
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  1683
    
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  1684
    OperatingSystem isUNIXlike ifTrue: [
1251
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1685
        SimulatedNativeLibs := #( 'libawt.so' 'libnet.so' 'libcmm.so' 'libzip.so' 
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1686
                                  'libmanagement.so'        "/ Management Beans - req'd by Tomcat
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1687
                                  'libjpeg.so' 'liblcms.so' "/ Some UI stuff - req'd by Tomcat !!?!!
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1688
                                    ).
1079
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  1689
        ^ self.
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  1690
    ].
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  1691
    OperatingSystem isMSWINDOWSlike ifTrue: [
1080
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  1692
        SimulatedNativeLibs := #( 'awt.dll' 'net.dll' 'cmm.dll' 'zip.dll' ).
1079
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  1693
        ^ self.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1694
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1695
    SimulatedNativeLibs := #().
1079
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  1696
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  1697
    "
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  1698
     self initializeSimulatedNativeLibs"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1699
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1700
    "Modified: / 27-01-1998 / 18:43:10 / cg"
1080
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  1701
    "Modified: / 03-11-2011 / 19:00:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1253
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  1702
    "Modified: / 09-12-2011 / 18:58:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1703
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1704
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1705
initializeSimulatedNativeMemory
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1706
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1707
    SimulatedNativeMemory := JavaNativeMemory new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1708
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1709
    "Created: / 07-12-2010 / 21:07:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1710
    "Modified: / 07-12-2010 / 23:45:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1711
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1712
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  1713
initializeSystemClassLoader
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  1714
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  1715
    | java_lang_ClassLoader |
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  1716
    
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  1717
    java_lang_ClassLoader := JavaVM classForName: 'java.lang.ClassLoader'.
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  1718
    (SystemClassLoader := java_lang_ClassLoader instVarNamed:#scl) isNil ifTrue:[
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  1719
        SystemClassLoader := java_lang_ClassLoader perform: #'getSystemClassLoader()Ljava/lang/ClassLoader;'
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  1720
    ].
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  1721
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  1722
    "Created: / 30-10-2011 / 12:04:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  1723
!
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  1724
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1725
initializeSystemPropertiesInto: props 
1251
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1726
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1727
   | cpu  os |
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1728
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1729
    "/ use JAVA compatible cpu-name
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1730
    cpu := OperatingSystem getCPUType.
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1731
    cpu = 'i386' ifTrue: [ cpu := 'ix86' ].
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1732
    SimulatedOS notNil ifTrue: [ os := SimulatedOS ] ifFalse: [
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1733
        os := OperatingSystem getOSType.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1734
        os := os asUppercaseFirst.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1735
    ].
1251
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1736
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1737
    props addPairsFrom:
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1738
        {
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1739
            'java.runtime.name'             . 'OpenJDK Runtime Environment' .
1260
vranyj1
parents: 1257
diff changeset
  1740
            'sun.boot.library.path'         . (Java release jreHome / 'lib' / OperatingSystem getCPUType) asString.
1254
275b55df3c47 Cosmetics in properties
vranyj1
parents: 1253
diff changeset
  1741
            'java.vm.version'               . Smalltalk versionString .
1251
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1742
            'java.vm.vendor'                . 'eXept Software AG & SWING Research Group' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1743
            'java.vendor.url'               . 'http://www.exept.de & http://swing.fit.cvut.cz' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1744
            'path.separator'                .  OperatingSystem pathSeparator asString. 
1254
275b55df3c47 Cosmetics in properties
vranyj1
parents: 1253
diff changeset
  1745
            'java.vm.name'                  . 'Smalltalk/X' .
1251
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1746
            'file.encoding.pkg'             . 'sun.io' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1747
            'sun.java.launcher'             . 'SUN_STANDARD' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1748
            'user.country'                  . 'US' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1749
            'sun.os.patch.level'            . 'unknown' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1750
            'java.vm.specification.name'    . 'Java Virtual Machine Specification' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1751
            'user.dir'                      . Filename currentDirectory pathName .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1752
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1753
            'java.awt.graphicsenv'          . 'sun.awt.X11GraphicsEnvironment' .
1260
vranyj1
parents: 1257
diff changeset
  1754
            'java.endorsed.dirs'            . (Java release jreHome / 'lib' / 'endorsed') asString. 
1251
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1755
            'os.arch'                       . cpu .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1756
            'java.io.tmpdir'                . Filename tempDirectory pathName .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1757
            'line.separator'                . Character cr asString .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1758
            'java.vm.specification.vendor' . 'Sun Microsystems Inc.' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1759
            'os.name'                       . os .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1760
            'sun.jnu.encoding'              . 'UTF-8' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1761
            'java.library.path'             . self defaultJavaLibraryPath.
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1762
            'java.specification.name'       . 'Java Platform API Specification' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1763
            'java.class.version'            . '50.0' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1764
            'sun.management.compiler'       . 'Smalltalk/X jinterpreter' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1765
            'os.version'                    . OperatingSystem getSystemInfo at: #version .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1766
            'user.home'                     . Filename homeDirectory pathName .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1767
            'user.timezone'                 . '' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1768
            'java.awt.printerjob'           . 'sun.print.PSPrinterJob' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1769
            'file.encoding'                 . 'UTF-8' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1770
            'java.specification.version'    . '1.6' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1771
            'java.class.path'               . self defaultCLASSPATH.
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1772
            'user.name'                     . OperatingSystem getLoginName .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1773
            'java.vm.specification.version' . '1.0' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1774
            "'sun.java.command'            . 'SystemProperties' ."
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1775
            'java.home'                     . '/usr/lib/jvm/java-6-openjdk/jre' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1776
            'sun.arch.data.model'           . '32' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1777
            'user.language'                 . Smalltalk language .   
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1778
            'java.specification.vendor'     . 'Sun Microsystems Inc.' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1779
            'java.vm.info'                  . 'Smalltalk/X 6.2.1' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1780
            'java.version'                  . '1.6' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1781
            'java.ext.dirs'                 . self defaultExtDirs .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1782
            'sun.boot.class.path'           . self defaultSunBootLibraryPath.
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1783
            'java.vendor'                   . 'Sun Microsystems Inc.' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1784
            'file.separator'                . Filename separatorString .
1260
vranyj1
parents: 1257
diff changeset
  1785
            'java.vendor.url.bug'           . 'https://swing.fit.cvut.cz/projects/stx-libjava/newticket' .
1251
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1786
            'sun.io.unicode.encoding'       . 'UnicodeLittle' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1787
            'sun.cpu.endian'                . 'little' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1788
            'sun.desktop'                   . 'gnome' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1789
            'sun.cpu.isalist'               . '' .
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1790
        }.
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1791
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1792
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1793
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1794
    "/ props at:'user.dir'           put:(Filename currentDirectory pathName).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1795
    "/props at:'awt.toolkit'        put:(self defaultWindowingToolKit).
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1796
    
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1797
    props at: 'user.country' put: 'US'.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1798
    props at: 'hotjava.home' put: (self defaultHotJavaHome).
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1799
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1800
    "/ new with jdk 1.1.8
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1801
    "/ undocumented ?
1251
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  1802
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1803
    "/ suppress copyright view in appletViewer ...
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1804
    
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1805
    props at: 'appletviewer.version' put: '1.1'.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1806
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1807
    "/ new with jdk 1.2
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1808
    
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1809
    props at: 'java.awt.graphicsenv' put: 'sun.awt.X11GraphicsEnvironment'.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1810
    props at: 'java.awt.fonts' put: '/usr/lib/X11/fonts'.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1811
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1812
    "/ jws
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1813
    "/props at:'jws.home'             put:(self defaultJWSHome).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1814
    "/ new with jws 2.0 ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1815
    "/props at:'jws.startcmd'         put:'jws.showwin.mainide'.
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1816
    
1078
614cf5325969 tomcat junit test is running (not passing:)
hlopkmar
parents: 1075
diff changeset
  1817
    props at: 'stx.libjava.tomcat.dir'
614cf5325969 tomcat junit test is running (not passing:)
hlopkmar
parents: 1075
diff changeset
  1818
        put: (JavaLibraries directory / 'tomcat6') pathName.
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1819
    
911
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  1820
"/    props at: 'sun.misc.URLClassPath.debug' put: 'true'. 
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1821
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1822
    ^ props
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1823
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1824
    "
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  1825
     self initializeSystemPropertiesInto:(Dictionary new)"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1826
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1827
    "Created: / 03-01-1998 / 14:26:39 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1828
    "Modified: / 27-01-2000 / 02:20:18 / cg"
1078
614cf5325969 tomcat junit test is running (not passing:)
hlopkmar
parents: 1075
diff changeset
  1829
    "Modified (format): / 03-11-2011 / 12:40:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1260
vranyj1
parents: 1257
diff changeset
  1830
    "Modified: / 10-12-2011 / 14:40:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1831
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1832
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1833
initializeVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1834
    "Force off JIT compiler for Java code - it hasn't been
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1835
     updated to reflect changes in jinterpret.c.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1836
     Following >>make it working, make it fast<< rule"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1837
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1838
    ObjectMemory
1081
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  1839
        javaJustInTimeCompilation: false;
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  1840
        javaNativeCodeOptimization: false.
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  1841
     "Java requires a huge stack. Change default to 5 MB"
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  1842
    Process defaultMaximumStackSize: 1024 * 1024 * 4.
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  1843
    ClassRegistry := JavaClassRegistry for: self.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  1844
    ClassLoaderQuerySignal := Query new.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1845
    JavaObject autoload.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1846
    JavaContext autoload.
1081
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  1847
    MonitorTrace ifNil: [ self initialize ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1848
    self initializeAdditionalJavaProtocol.
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  1849
    self initializeJavaResources.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1850
    JavaConsoleStream := Transcript.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1851
    Java initAllStaticFields.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1852
    Java markAllClassesUninitialized.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  1853
    ZipCache := OrderedCollection new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  1854
    ZipEntryCache := OrderedCollection new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  1855
    ZipInflaters := OrderedCollection new.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1856
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1857
    "/ force re-resolving;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1858
    "/ otherwise, class-inits would not be called
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1859
    "/ by resolver ... (sigh)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1860
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1861
    JavaNativeMethod flushAllCachedNativeMethods.
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  1862
    JavaMethod 
1081
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  1863
        allSubInstancesDo: [
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  1864
            :m | 
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  1865
            m checked: false.
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  1866
            m code: nil.
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  1867
        ].
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  1868
    ObjectMemory flushCaches.
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  1869
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1870
    "/ sigh - must flush inline caches.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1871
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1872
    JavaClass startRememberingOrderOfClassInits.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1873
    self initializeSimulatedLibs.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1874
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1875
    "/ < jdk 1.2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1876
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1877
    self initializeSimulatedNativeLibs.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1878
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1879
    "/ >= jdk 1.2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1880
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1881
    self initializeSimulatedNativeMemory.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1882
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1883
    "/>  jdk 6
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1884
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1885
    self initializeOpenFileTable.
907
9ab15562799b JavaVM: Initialization fix
vranyj1
parents: 906
diff changeset
  1886
    self initializeReflection.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1887
    self initializeBaseClasses.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1888
    self initializePrimitiveClasses.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1889
    Java initSystemClass.
1250
3904fc7212b4 forgotten methods :)
hlopkmar
parents: 1249
diff changeset
  1890
    Java initializeCurrentThread.
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  1891
    self initializeSystemClassLoader.
1081
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  1892
    ObjectMemory addDependent: self.
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  1893
    StartupTime := OperatingSystem getOSTime.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1894
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1895
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1896
     JavaVM initialize.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1897
     JavaVM initializeVM."
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  1898
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1899
    "Created: / 03-01-1998 / 21:29:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1900
    "Modified: / 14-12-1999 / 18:58:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1901
    "Modified: / 15-10-2010 / 15:27:45 / Jan Kurs <kurs.jan@post.cz>"
1070
vranyj1
parents: 1069
diff changeset
  1902
    "Modified: / 01-11-2011 / 22:16:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1250
3904fc7212b4 forgotten methods :)
hlopkmar
parents: 1249
diff changeset
  1903
    "Modified: / 09-12-2011 / 12:22:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1904
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1905
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1906
initializeVMIfNoEventThreadRunning
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1907
    |uClass updater p|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1908
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1909
    uClass := JAVA::sun::awt::ScreenUpdater.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1910
    uClass notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1911
        updater := uClass instVarNamed:'updater'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1912
        updater notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1913
            p := self stProcessForJavaThread:updater
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1914
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1915
        (updater isNil or:[p isNil or:[p isDead]]) isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1916
            self initializeVM.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1917
            ^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1918
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1919
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1920
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1921
    (JavaEventThread isNil or:[JavaEventThread isDead]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1922
        self initializeVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1923
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1924
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1925
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1926
     JavaVM initializeVMIfNoEventThreadRunning
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1927
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1928
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1929
    "Created: / 15.1.1998 / 17:32:27 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1930
    "Modified: / 24.12.1999 / 02:18:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1931
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1932
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1933
reinitializeVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1934
    |classesToInit|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1935
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1936
    self releaseAllJavaResources.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1937
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1938
    JavaConsoleStream := Transcript.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1939
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1940
    Java initAllStaticFields.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1941
    Java markAllClassesUninitialized.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1942
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1943
    self initializeOpenFileTable.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1944
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1945
    classesToInit := JavaClass orderOfClassInits.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1946
    JavaClass startRememberingOrderOfClassInits.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1947
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1948
    self initializePrimitiveClasses.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1949
"/    Java initSystemClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1950
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1951
    classesToInit do:[:jClass |
1000
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  1952
        jClass classInit
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1953
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1954
    Java initSystemClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1955
1000
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  1956
    "Created: / 12-11-1998 / 15:37:52 / cg"
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  1957
    "Modified: / 17-11-1998 / 16:10:11 / cg"
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  1958
    "Modified: / 14-09-2011 / 22:06:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1959
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1960
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1961
reinitializeVMIfNoEventThreadRunning
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1962
    (JavaEventThread isNil or:[JavaEventThread isDead]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1963
        ^ self reinitializeVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1964
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1965
    (JavaEventQueueThread isNil or:[JavaEventQueueThread isDead]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1966
        ^ self reinitializeVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1967
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1968
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1969
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1970
     JavaVM reinitializeVMIfNoEventThreadRunning
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1971
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1972
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1973
    "Created: / 24.11.1998 / 15:45:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1974
    "Modified: / 24.12.1999 / 02:36:41 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1975
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1976
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1977
releaseAllJavaResources
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1978
    self deinitialize.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1979
    FirstWindowCreationSemaphore := Semaphore new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1980
    JavaScreenUpdaterThread := JavaEventQueueThread := nil.
1119
0f4d4bc3d346 warning!! bug possibly fixed :) probably not but maybe ;)
hlopkmar
parents: 1118
diff changeset
  1981
    LoadedLibs := nil.
0f4d4bc3d346 warning!! bug possibly fixed :) probably not but maybe ;)
hlopkmar
parents: 1118
diff changeset
  1982
    LoadedNativeLibs := nil.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1983
    ImageStretchCache := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1984
    LastGraphics := LastGC := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1985
    SimulatedNativeMemory := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1986
    self initializePrimitiveClasses.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1987
    self terminateAllThreads.
1119
0f4d4bc3d346 warning!! bug possibly fixed :) probably not but maybe ;)
hlopkmar
parents: 1118
diff changeset
  1988
    "/self releaseAllMonitors.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1989
    self releaseAllWindows.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1990
    self releaseAllStreams.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1991
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1992
    "
1119
0f4d4bc3d346 warning!! bug possibly fixed :) probably not but maybe ;)
hlopkmar
parents: 1118
diff changeset
  1993
     JavaVM releaseAllJavaResources"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1994
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1995
    "Created: / 07-01-1998 / 22:49:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1996
    "Modified: / 24-12-1999 / 02:33:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1997
    "Modified: / 17-12-2010 / 17:51:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1119
0f4d4bc3d346 warning!! bug possibly fixed :) probably not but maybe ;)
hlopkmar
parents: 1118
diff changeset
  1998
    "Modified: / 16-11-2011 / 20:27:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1999
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2000
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2001
releaseAllMonitors
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2002
    LockTable := WeakIdentityDictionary new.
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2003
    LockTableAccess := Semaphore "RecursionLock" forMutualExclusion.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2004
    LockTableAccess name: 'JavaVM lock table access mutex'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2005
    WaitTable := IdentityDictionary new.
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2006
    WaitTableAccess := Semaphore "RecursionLock" forMutualExclusion.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2007
    WaitTableAccess name: 'JavaVM wait table access mutex'.
1118
1c76866b4df4 and more fixes.. hope never dies
hlopkmar
parents: 1117
diff changeset
  2008
    EnteredMonitorsPerProcess notNil ifTrue: [
1c76866b4df4 and more fixes.. hope never dies
hlopkmar
parents: 1117
diff changeset
  2009
        EnteredMonitorsPerProcess 
1c76866b4df4 and more fixes.. hope never dies
hlopkmar
parents: 1117
diff changeset
  2010
            keysAndValuesDo: [:p :value | value size > 0 ifTrue: [ self breakPoint: #mh ] ]
1c76866b4df4 and more fixes.. hope never dies
hlopkmar
parents: 1117
diff changeset
  2011
    ].
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2012
    self releaseLeftOverMonitors.
1119
0f4d4bc3d346 warning!! bug possibly fixed :) probably not but maybe ;)
hlopkmar
parents: 1118
diff changeset
  2013
    Logger 
0f4d4bc3d346 warning!! bug possibly fixed :) probably not but maybe ;)
hlopkmar
parents: 1118
diff changeset
  2014
        log: 'Clearing EnteredMonitorsPerProcess'
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
  2015
        severity: #debug
1119
0f4d4bc3d346 warning!! bug possibly fixed :) probably not but maybe ;)
hlopkmar
parents: 1118
diff changeset
  2016
        facility: #JVM.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2017
    EnteredMonitorsPerProcess := IdentityDictionary new.
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
  2018
    Logger 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
  2019
    log: 'Clearing AcquiredMonitorsPerProcess'
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
  2020
    severity: #debug
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
  2021
    facility: #JVM.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
  2022
        EnteredMonitorsPerProcess := IdentityDictionary new.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2023
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2024
    "
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2025
     JavaVM releaseAllMonitors"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2026
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2027
    "Created: / 02-01-1998 / 18:04:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2028
    "Modified: / 07-01-1998 / 22:58:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2029
    "Modified: / 25-10-2010 / 19:14:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
  2030
    "Modified: / 17-11-2011 / 17:00:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2031
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2032
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2033
releaseAllStreams
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2034
    OpenFileTable notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2035
	OpenFileTable do:[:aStream |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2036
	    aStream notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2037
		aStream ~~ Stdin ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2038
		    aStream ~~ Stdout ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2039
			aStream ~~ Stderr ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2040
			    aStream ~~ JavaConsoleStream ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2041
				aStream isExternalStream ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2042
				    aStream shutDown
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2043
				]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2044
			    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2045
			]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2046
		    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2047
		]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2048
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2049
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2050
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2051
    self initializeOpenFileTable.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2052
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2053
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2054
     JavaVM releaseAllStreams
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2055
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2056
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2057
    "Created: / 7.1.1998 / 22:57:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2058
    "Modified: / 4.2.1998 / 19:53:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2059
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2060
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2061
releaseAllWindows
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2062
    KnownWindows notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2063
	KnownWindows do:[:aView |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2064
	    aView destroy
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2065
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2066
	KnownWindows := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2067
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2068
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2069
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2070
     self releaseAllWindows
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2071
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2072
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2073
    "Created: / 7.1.1998 / 22:58:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2074
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2075
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2076
releaseLeftOverMonitors
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2077
    "release monitors held by dead processes"
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2078
    
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2079
    | deadProcesses |
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2080
    deadProcesses := IdentitySet new.
1117
335d96c16899 fixes coming :) first of many..
hlopkmar
parents: 1116
diff changeset
  2081
    EnteredMonitorsPerProcess notNil ifTrue: [
335d96c16899 fixes coming :) first of many..
hlopkmar
parents: 1116
diff changeset
  2082
        EnteredMonitorsPerProcess keysAndValuesDo: [
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2083
            :p :monitors | 
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2084
            p isDead ifTrue: [
1177
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
  2085
 
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2086
                monitors do: [
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2087
                    :mon | 
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2088
                    Logger 
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2089
                        log: 'release leftover monitor ...'
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2090
                        severity: #info
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2091
                        facility: 'JVM'.
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2092
                    mon release
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2093
                ].
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2094
                deadProcesses add: p.
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2095
            ]
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2096
        ].
1117
335d96c16899 fixes coming :) first of many..
hlopkmar
parents: 1116
diff changeset
  2097
        ].
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2098
    deadProcesses do: [:p | EnteredMonitorsPerProcess removeKey: p ].
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2099
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2100
    "
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  2101
     JavaVM releaseLeftOverMonitors"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2102
1000
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  2103
    "Created: / 08-01-1998 / 17:29:26 / cg"
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  2104
    "Modified: / 14-09-2011 / 22:06:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1177
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
  2105
    "Modified: / 29-11-2011 / 14:26:25 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2106
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2107
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2108
systemProperties
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2109
    |props|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2110
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2111
    props := Dictionary new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2112
    self initializeSystemPropertiesInto:props.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2113
    ^ props
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2114
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2115
    "Created: / 3.1.1998 / 14:25:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2116
    "Modified: / 3.1.1998 / 14:32:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2117
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2118
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2119
terminateAllThreads
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2120
    Java terminateAllThreads.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2121
    JavaEventThread := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2122
    JavaScreenUpdaterThread := JavaEventQueueThread := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2123
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2124
    "Created: / 8.1.1998 / 17:43:54 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2125
    "Modified: / 24.12.1999 / 02:33:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2126
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2127
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2128
update:something with:aParameter from:changedObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2129
    something == #returnFromSnapshot ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2130
"/         self initializeVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2131
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2132
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2133
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2134
     JavaVM initializeVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2135
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2136
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2137
    "Created: / 9.1.1998 / 10:30:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2138
    "Modified: / 6.11.1998 / 00:40:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2139
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2140
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2141
!JavaVM class methodsFor:'Signal constants'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2142
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2143
badMessageSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2144
    ^ BadMessageSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2145
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2146
    "Created: / 2.1.1998 / 18:06:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2147
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2148
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2149
callHandlerSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2150
    ^ CallHandlerSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2151
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2152
    "Created: / 2.1.1998 / 18:07:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2153
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2154
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2155
classLoaderQuerySignal
1058
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  2156
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  2157
    <resource: #obsolete>
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  2158
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  2159
    self breakPoint: #jv.
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  2160
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  2161
    ^JavaClassReader classLoaderQuerySignal
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  2162
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  2163
    "Modified: / 28-10-2011 / 22:11:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2164
!
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2165
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2166
internalErrorSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2167
    ^ InternalErrorSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2168
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2169
    "Created: / 2.1.1998 / 18:07:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2170
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2171
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2172
javaExceptionSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2173
    "^ JavaExceptionSignal"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2174
    ^JavaError
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2175
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2176
    "Created: / 02-01-1998 / 18:05:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2177
    "Modified: / 01-03-2011 / 21:50:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2178
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2179
1016
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  2180
privilegedAccessQuery
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  2181
    ^ JavaPrivilegedAccessQuery.
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  2182
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  2183
    "Created: / 09-10-2011 / 20:24:49 / Marcel Hlopko <hlopik@gmail.com>"
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  2184
!
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  2185
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2186
stdinReplacementFileQuerySignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2187
    ^ StdinReplacementFileQuerySignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2188
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2189
    "Created: / 2.1.1998 / 18:06:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2190
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2191
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2192
unhandledJavaExceptionSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2193
    ^ UnhandledJavaExceptionSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2194
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2195
    "Created: / 2.1.1998 / 18:05:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2196
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2197
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2198
unimplementedInstructionSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2199
    ^ UnimplementedInstructionSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2200
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2201
    "Created: / 2.1.1998 / 18:06:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2202
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2203
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2204
unimplementedNativeMethodSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2205
    ^ UnimplementedNativeMethodSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2206
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2207
    "Created: / 2.1.1998 / 18:06:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2208
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2209
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2210
!JavaVM class methodsFor:'accessing'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2211
1035
712d2090e68b Small refactoring of class registry, more follows
vranyj1
parents: 1034
diff changeset
  2212
addClass:aJavaClass definedBy:aJavaClassLoader 
1037
3dc5755c5fe4 JavaClassRegistry refactored
vranyj1
parents: 1036
diff changeset
  2213
3dc5755c5fe4 JavaClassRegistry refactored
vranyj1
parents: 1036
diff changeset
  2214
    self assert: aJavaClass classLoader == aJavaClassLoader.
3dc5755c5fe4 JavaClassRegistry refactored
vranyj1
parents: 1036
diff changeset
  2215
    ^ ClassRegistry registerClass:aJavaClass
3dc5755c5fe4 JavaClassRegistry refactored
vranyj1
parents: 1036
diff changeset
  2216
3dc5755c5fe4 JavaClassRegistry refactored
vranyj1
parents: 1036
diff changeset
  2217
    "Modified: / 23-10-2011 / 11:58:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2218
!
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2219
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2220
addSelector:newSelector withMethod:newMethod 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2221
    super addSelector:newSelector withMethod:newMethod.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2222
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2223
    "/JavaNativeMethod may not be loaded..."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2224
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2225
    (Smalltalk at:#JavaNativeMethod) 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2226
        ifNotNil:[JavaNativeMethod flushAllCachedNativeMethods].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2227
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2228
    "Created: / 24-12-1999 / 03:12:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2229
    "Modified: / 02-02-2011 / 04:38:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2230
    "Modified: / 02-02-2011 / 23:38:08 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2231
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2232
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2233
assertionsEnabled: aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2234
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2235
    AssertionsEnabled := aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2236
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2237
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2238
        JavaVM assertionsEnabled: true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2239
        JavaVM assertionsEnabled: false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2240
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2241
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2242
    "Created: / 24-11-2010 / 09:02:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2243
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2244
1035
712d2090e68b Small refactoring of class registry, more follows
vranyj1
parents: 1034
diff changeset
  2245
classRegistry
712d2090e68b Small refactoring of class registry, more follows
vranyj1
parents: 1034
diff changeset
  2246
    ^ ClassRegistry.
712d2090e68b Small refactoring of class registry, more follows
vranyj1
parents: 1034
diff changeset
  2247
712d2090e68b Small refactoring of class registry, more follows
vranyj1
parents: 1034
diff changeset
  2248
    "Created: / 21-10-2011 / 11:12:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2249
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2250
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2251
extClassLoader
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2252
    ^ self systemClassLoader instVarNamed:#'parent'.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2253
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2254
    "Created: / 30-10-2011 / 12:08:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2255
    "Created: / 02-11-2011 / 13:20:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2256
!
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2257
1109
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2258
finalizationEnabled
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2259
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2260
    ^FinalizationEnabled
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2261
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2262
    "Created: / 14-11-2011 / 21:14:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2263
!
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2264
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2265
finalizationLobby
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2266
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2267
    ^FinalizationLobby
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2268
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2269
    "Created: / 14-11-2011 / 12:29:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2270
!
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2271
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2272
javaEventQueueThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2273
     ^ JavaEventQueueThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2274
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2275
    "Created: / 24.12.1999 / 02:34:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2276
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2277
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2278
javaEventThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2279
     ^ JavaEventThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2280
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2281
    "Created: / 8.1.1999 / 17:05:02 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2282
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2283
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2284
javaScreenUpdaterThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2285
     ^ JavaScreenUpdaterThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2286
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2287
    "Created: / 8.1.1999 / 17:06:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2288
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2289
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2290
reflection
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2291
    ^ Reflection.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2292
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2293
    "Created: / 28-01-2011 / 15:09:19 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2294
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2295
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2296
registry
1035
712d2090e68b Small refactoring of class registry, more follows
vranyj1
parents: 1034
diff changeset
  2297
    ^ ClassRegistry.
712d2090e68b Small refactoring of class registry, more follows
vranyj1
parents: 1034
diff changeset
  2298
712d2090e68b Small refactoring of class registry, more follows
vranyj1
parents: 1034
diff changeset
  2299
    "Modified (format): / 21-10-2011 / 11:12:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2300
!
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2301
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2302
systemClassLoader
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2303
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2304
    ^SystemClassLoader
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2305
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2306
    "Created: / 30-10-2011 / 12:08:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2307
!
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2308
1185
f13a7d1c7385 process javaProtocol
hlopkmar
parents: 1183
diff changeset
  2309
threadInterrupts
f13a7d1c7385 process javaProtocol
hlopkmar
parents: 1183
diff changeset
  2310
threadInterrupts isNil ifTrue: [threadInterrupts := WeakIdentityDictionary new].
f13a7d1c7385 process javaProtocol
hlopkmar
parents: 1183
diff changeset
  2311
^threadInterrupts.
f13a7d1c7385 process javaProtocol
hlopkmar
parents: 1183
diff changeset
  2312
f13a7d1c7385 process javaProtocol
hlopkmar
parents: 1183
diff changeset
  2313
    "Created: / 30-11-2011 / 11:44:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
f13a7d1c7385 process javaProtocol
hlopkmar
parents: 1183
diff changeset
  2314
!
f13a7d1c7385 process javaProtocol
hlopkmar
parents: 1183
diff changeset
  2315
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2316
useSmalltalkInterpreter
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2317
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2318
    JavaMethod makeMetaMethod
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2319
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2320
    "Created: / 23-02-2011 / 12:59:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2321
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2322
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2323
useVMInterpreter
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2324
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2325
    JavaMethod makeJavaMethod
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2326
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2327
    "Created: / 23-02-2011 / 12:59:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2328
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2329
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2330
!JavaVM class methodsFor:'class access'!
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2331
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2332
at: aString 
1037
3dc5755c5fe4 JavaClassRegistry refactored
vranyj1
parents: 1036
diff changeset
  2333
3dc5755c5fe4 JavaClassRegistry refactored
vranyj1
parents: 1036
diff changeset
  2334
    ^ ClassRegistry classNamed: aString asInternalJavaClassName.
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2335
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2336
    "Modified (comment): / 21-10-2011 / 12:14:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1037
3dc5755c5fe4 JavaClassRegistry refactored
vranyj1
parents: 1036
diff changeset
  2337
    "Modified: / 23-10-2011 / 12:25:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2338
!
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2339
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2340
at: aString put: aJavaClass 
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2341
    self breakPoint: #mh.
1037
3dc5755c5fe4 JavaClassRegistry refactored
vranyj1
parents: 1036
diff changeset
  2342
    self breakPoint: #jv.
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2343
    "dont use me anymore"
1037
3dc5755c5fe4 JavaClassRegistry refactored
vranyj1
parents: 1036
diff changeset
  2344
    ^ ClassRegistry registerClass: aJavaClass
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2345
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2346
    "Modified (comment): / 21-10-2011 / 12:14:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1037
3dc5755c5fe4 JavaClassRegistry refactored
vranyj1
parents: 1036
diff changeset
  2347
    "Modified: / 23-10-2011 / 11:58:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2348
!
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2349
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2350
classForName: className 
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2351
    "load class from registry - load using classLoader from query or JavaClassReader if absent"
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2352
    
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2353
    
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2354
    ^ self classForName: className asSlashedJavaClassName
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2355
        definedBy: (JavaClassReader classLoaderQuerySignal query) "? SystemClassLoader".
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2356
1060
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  2357
    "Modified: / 30-10-2011 / 17:46:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2358
    "Modified: / 02-11-2011 / 16:33:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2359
!
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2360
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2361
classForName: className definedBy: classLoader 
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2362
    "load class from registry - load using given classLoader if not nil"
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2363
    
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2364
    | result |
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2365
    result := self 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2366
                classForName: className asSlashedJavaClassName
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2367
                definedBy: classLoader
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2368
                ifAbsentPut: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2369
                    | class  classLoaderEnsured |
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2370
                    self assert: (className includes: $.) not.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2371
                    self booted ifFalse: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2372
                        "class loaders allowed after vm boot, until then, only primordial"
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2373
                        class := self usePrimordialCLToLoadClassNamed: className.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2374
                        self assert: (class notNil)
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2375
                            description: 'Couldnt load class ' , className , ' while booting Java VM'.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2376
                        class.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2377
                    ] ifTrue: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2378
                        self assert: (self booted)
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2379
                            description: 'Java VM is not booted and we are not using primordial class loader to load: ' 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2380
                                    , className.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2381
                        (Java release bootClassPathIncludesClassNamed: className) ifTrue: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2382
                            "we will use primordial class loader for classes in rt.jar etc"
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2383
                            class := self usePrimordialCLToLoadClassNamed: className.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2384
                            self assert: (class notNil)
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2385
                                description: 'Class ' , className 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2386
                                        , ' is supposed to be in boot classpath, but we couldnt load it'.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2387
                            class.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2388
                        ] ifFalse: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2389
                            (Java release extDirsIncludesClassNamed: className) ifTrue: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2390
                                class := self useExtCLToLoadClassNamed: className.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2391
                                self assert: (class notNil)
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2392
                                    description: 'Class ' , className 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2393
                                            , ' is supposed to be in java.ext,dirs, but we couldnt load it'.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2394
                                class.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2395
                            ] ifFalse: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2396
                                "at this point, nil classLoader means use system class loader,
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2397
                                 in other words, at this point, we shouldnt use primordial cl at all"
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2398
                                classLoader isNil ifTrue: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2399
                                    self assert: (self systemClassLoader notNil)
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2400
                                        description: 'We needed system class loader, but its not loaded yet'.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2401
                                    classLoaderEnsured := self systemClassLoader
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2402
                                ] ifFalse: [ classLoaderEnsured := classLoader ].
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2403
                                class := self useUserDefinedCL: classLoaderEnsured
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2404
                                            toLoadClassNamed: className.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2405
                                class isNil ifTrue: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2406
                                    Logger 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2407
                                        log: 'Even ' , classLoader printString , ' was not able to load class ' 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2408
                                                , className
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2409
                                        severity: #warn
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2410
                                        facility: 'JVM'.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2411
                                    nil
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2412
                                ] ifFalse: [ class ].
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2413
                            ]
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2414
                        ]
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2415
                    ]
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2416
                ].
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2417
    result isNil ifTrue: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2418
        Logger 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2419
            log: 'Class ' , className , ' couldnt be loaded'
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2420
            severity: #warn
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2421
            facility: 'JVM'
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2422
    ] ifFalse: [ result := self makeArrayOf: result asDescribedBy: className. ].
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2423
    ^ result.
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2424
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2425
    "Created: / 21-10-2011 / 12:01:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2426
    "Modified: / 30-10-2011 / 13:54:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2427
    "Modified: / 02-11-2011 / 16:49:45 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2428
!
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2429
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2430
classForName: className definedBy: classLoader ifAbsentPut: aBlock 
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2431
    "load class from registry - if absent evaluate given block to get loaded class"
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2432
    
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2433
    | result |
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2434
    className asJavaComponentClassName isJavaPrimitiveTypeDescriptor ifTrue: [
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2435
        ^ (JavaDescriptor fromString: className) javaClass.
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2436
    ].
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2437
    result := ClassRegistry 
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  2438
                classForName: className asSlashedJavaClassName
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2439
                loader: classLoader
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2440
                ifAbsentPut: aBlock.
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2441
    result notNil ifTrue: [
1041
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  2442
        result := self makeArrayOf: result asDescribedBy: className.
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  2443
    ].
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2444
    ^ result.
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2445
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2446
    "Created: / 21-10-2011 / 12:13:08 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  2447
    "Modified: / 30-10-2011 / 22:04:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2448
    "Modified (format): / 02-11-2011 / 16:09:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2449
!
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2450
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2451
classNamed: className 
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2452
    "Return class with given name loaded by current classloader or nil if class is not yet loaded"
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2453
    
1058
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  2454
    ^ self classNamed: className definedBy: JavaClassReader classLoaderQuerySignal query.
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2455
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2456
    "Modified: / 21-10-2011 / 12:09:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2457
    "Modified (comment): / 21-10-2011 / 13:34:46 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1058
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  2458
    "Modified: / 28-10-2011 / 22:12:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2459
!
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2460
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2461
classNamed: className definedBy: classLoader 
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2462
    "Return class with given name loaded by given classloader or nil if class is not yet loaded"
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2463
    
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2464
    | result |
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2465
    className asJavaComponentClassName isJavaPrimitiveTypeDescriptor ifTrue: [
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2466
        ^ (JavaDescriptor fromString: className) javaClass.
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2467
    ].
1037
3dc5755c5fe4 JavaClassRegistry refactored
vranyj1
parents: 1036
diff changeset
  2468
    result := ClassRegistry 
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2469
                classForName: className asSlashedJavaClassName
1037
3dc5755c5fe4 JavaClassRegistry refactored
vranyj1
parents: 1036
diff changeset
  2470
                loader: classLoader
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2471
                ifAbsent: [ ^ nil ].
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2472
    ^ self makeArrayOf: result asDescribedBy: className.
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2473
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2474
    "Created: / 21-10-2011 / 11:58:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1037
3dc5755c5fe4 JavaClassRegistry refactored
vranyj1
parents: 1036
diff changeset
  2475
    "Modified: / 23-10-2011 / 12:01:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2476
    "Modified: / 01-11-2011 / 15:36:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2477
!
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2478
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2479
loadClassesIn: directory 
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2480
"load all classes (.class files, strictly speaking) found in given directory.
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2481
The argument is string containing the name of the directory.
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2482
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2483
Returns a set of loaded classes."
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2484
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2485
^ self loadClassesIn: directory matching: '*'.
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2486
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2487
    "Modified: / 11-06-2011 / 13:35:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2488
    "Created: / 21-10-2011 / 12:40:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2489
!
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2490
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2491
loadClassesIn: directory matching: pattern 
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2492
    "load all classes (.class files, strictly speaking) found in given directory.
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2493
     The arguments are a string containing the name of the directory
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2494
     and a class name pattern. Only classes matching the pattern are loaded.
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2495
     class names are matched using String>>matches:.
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2496
     ALL CLASSES ARE INSTALLED!!
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2497
     Returns a set of loaded classes."
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2498
    
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2499
    | dir  dirString  className  loadedClasses |
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2500
    dir := directory asFilename asAbsoluteFilename.
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2501
    loadedClasses := Set new.
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2502
    Java addToClassPath: dir pathName.
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2503
    JavaClassReader classLoaderQuerySignal answer: SystemClassLoader do:[
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2504
    
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2505
    dir 
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2506
        recursiveDirectoryContentsAsFilenamesDo: [
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2507
            :filename | 
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2508
            (filename isRegularFile and: [ filename suffix = #class ]) ifTrue: [
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2509
                dirString := dir pathName.
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2510
                className := filename withoutSuffix pathName.
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2511
                className := className subString: dirString size + 2 to: className size.
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2512
                className := className copyReplaceAll: (Filename separator) with: $..
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2513
                (className matches: pattern) ifTrue: [
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2514
                    (self classNamed: className) isNil ifTrue:[
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2515
                        loadedClasses add: (self classForName:className).
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2516
                    ].
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2517
                ]
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2518
            ]
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2519
        ].
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2520
    ].
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2521
    ^ loadedClasses.
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2522
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2523
    "Modified: / 21-10-2011 / 12:52:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  2524
    "Modified: / 30-10-2011 / 14:02:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2525
! !
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2526
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2527
!JavaVM class methodsFor:'class loading'!
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2528
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2529
useExtCLToLoadClassNamed: className 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2530
    | ecl  class |
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2531
    ecl := self extClassLoader.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2532
    self assert: (ecl notNil)
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2533
        description: 'we want to use ExtClassLoader, but its not loaded yet'.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2534
    class := ecl 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2535
                perform: #'loadClassInternal(Ljava/lang/String;)Ljava/lang/Class;'
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2536
                with: (Java as_String: (className asDottedJavaClassName)).
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2537
    self assert: (class notNil)
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2538
        description: 'we tried to load class ' , className 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2539
                , ' using ExtClassLoader and we failed:)'.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2540
                class := JavaVM classForJavaClassObject: class.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2541
                class classLoader: ecl.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2542
    ^ class.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2543
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2544
    "Created: / 02-11-2011 / 13:48:02 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2545
!
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2546
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2547
usePrimordialCLToLoadClassNamed: className 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2548
    | class |
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2549
    JavaClassReader classLoaderQuerySignal answer: nil
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2550
        do: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2551
            class := JavaClassReader readClass: className.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2552
        ].
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2553
    ^ class
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2554
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2555
    "Modified: / 02-11-2011 / 17:28:08 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2556
!
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2557
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2558
useUserDefinedCL: classLoader toLoadClassNamed: className 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2559
    | classObject  class |
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2560
    classObject := classLoader 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2561
                perform: #'loadClassInternal(Ljava/lang/String;)Ljava/lang/Class;'
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2562
                with: (Java as_String: (className asDottedJavaClassName)).
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2563
    class := self classForJavaClassObject: classObject.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2564
    class classLoader ifNil: [self breakPoint:#mh].
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2565
    ^ class.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2566
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2567
    "Created: / 02-11-2011 / 16:20:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2568
! !
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  2569
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2570
!JavaVM class methodsFor:'debugging support'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2571
1145
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
  2572
disableMonitorTrace
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
  2573
    MonitorTrace := false.
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
  2574
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
  2575
    "Created: / 22-11-2011 / 10:29:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
  2576
!
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
  2577
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
  2578
enableMonitorTrace
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
  2579
MonitorTrace := true.
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
  2580
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
  2581
    "Created: / 22-11-2011 / 10:29:46 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
  2582
!
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
  2583
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2584
exceptionDebug
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2585
    ^ ExceptionDebug
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2586
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2587
    "Created: / 27.1.1999 / 20:14:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2588
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2589
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2590
exceptionDebug:aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2591
    ExceptionDebug := aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2592
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2593
    "Created: / 27.1.1999 / 20:15:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2594
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2595
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2596
exceptionDebugPatterns
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2597
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2598
    ^ ExceptionDebugPatterns
912
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  2599
    "
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  2600
    ExceptionDebug must be set in order to ExceptionDebugPatterns work
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  2601
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  2602
    ExceptionDebug := true.
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  2603
    ExceptionDebugPatterns add: 'java/lang/SecurityException*'
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  2604
    ExceptionDebugPatterns add: 'java/net/ConnectException*'
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  2605
    ExceptionDebugPatterns add: 'java/lang/IllegalArgumentException'
1216
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  2606
    ExceptionDebugPatterns add: 'java/lang/ClassNotFoundException'
1221
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  2607
    ExceptionDebugPatterns add: 'java/io/IOException'
1242
62be7670d158 Few fixes for Tomcat, new Tomcat startup script
vranyj1
parents: 1238
diff changeset
  2608
    ExceptionDebugPatterns add: 'java/lang/NoSuchMethodException'
912
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  2609
    "
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2610
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2611
    "Created: / 25-02-2011 / 08:08:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2612
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2613
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2614
!JavaVM class methodsFor:'defaults'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2615
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2616
audioEnabled
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2617
    ^ NoAudio not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2618
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2619
    "Created: / 18.7.1998 / 22:31:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2620
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2621
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2622
audioEnabled:aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2623
    NoAudio := aBoolean not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2624
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2625
    "Created: / 18.7.1998 / 22:31:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2626
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2627
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2628
defaultCLASSPATH
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2629
    |s|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2630
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2631
    s := '' writeStream.
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  2632
    Java classPath 
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  2633
        do:[:p | s nextPutAll:p ]
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  2634
        separatedBy: [s nextPut: OperatingSystem pathSeparator].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2635
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2636
    ^ s contents
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2637
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2638
    "
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  2639
     self defaultCLASSPATH      
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2640
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2641
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2642
    "Created: / 03-01-1998 / 14:27:21 / cg"
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  2643
    "Modified: / 30-10-2011 / 21:21:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2644
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2645
957
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  2646
defaultExtDirs
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  2647
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  2648
    ^String streamContents:[:s|
959
1f3342b2e728 Fixes...
vranyj1
parents: 957
diff changeset
  2649
        Java javaExtDirs do:[:dir|
957
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  2650
            s nextPutAll: dir pathName.
959
1f3342b2e728 Fixes...
vranyj1
parents: 957
diff changeset
  2651
        ] separatedBy:[
957
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  2652
            s nextPut: OperatingSystem pathSeparator.
959
1f3342b2e728 Fixes...
vranyj1
parents: 957
diff changeset
  2653
        ]
957
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  2654
    ]
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  2655
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  2656
    "
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  2657
    JavaVM defaultExtDirs
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  2658
    "
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  2659
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  2660
    "Created: / 31-08-2011 / 20:03:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  2661
!
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  2662
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2663
defaultHotJavaHome
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2664
    ^ '/usr/local/java/hotjava'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2665
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2666
    "Modified: / 5.8.1997 / 04:13:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2667
    "Created: / 3.1.1998 / 14:27:34 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2668
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2669
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2670
defaultJAVAHome
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2671
    ^ Java javaHome
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2672
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2673
    "Modified: / 6.8.1997 / 00:54:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2674
    "Created: / 3.1.1998 / 14:27:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2675
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2676
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2677
defaultJWSHome
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2678
    '/phys/idefix/home2/java/JWS2_0/Java-WorkShop2.0/JWS' asFilename exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2679
	^ '/phys/idefix/home2/java/JWS2_0/Java-WorkShop2.0/JWS'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2680
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2681
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2682
    ^ '/usr/local/java/JWS'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2683
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2684
    "Created: / 3.1.1998 / 14:27:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2685
    "Modified: / 3.12.1998 / 14:54:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2686
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2687
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2688
defaultJavaLibraryPath
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2689
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2690
    | dirs |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2691
    dirs := OrderedCollection new
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2692
            add: Java release javaHome asFilename / 'lib';
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2693
            add: Java release javaHome asFilename / 'lib' / 'amd64';
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2694
            add: Java release javaHome asFilename / 'lib' / 'i386';
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2695
            add: Java release javaHome asFilename / 'jre' / 'lib' ;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2696
            add: Java release javaHome asFilename / 'jre' / 'lib' / 'amd64'  ;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2697
            add: Java release javaHome asFilename / 'jre' / 'lib' / 'i386' ;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2698
            add: Java release javaHome asFilename / 'jre' / 'bin' ;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2699
            yourself.
919
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  2700
    OperatingSystem isMSWINDOWSlike ifTrue:[
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  2701
        dirs
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  2702
            add: Java release javaHome asFilename / 'bin'.
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  2703
    ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2704
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2705
    ^String streamContents:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2706
        [:path|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2707
        (dirs select:[:d|d exists])
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2708
            do:[:d|path nextPutAll:d pathName]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2709
            separatedBy:[path nextPut: OperatingSystem pathSeparator]]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2710
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2711
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2712
        JavaVM defaultJavaLibraryPath
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2713
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2714
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2715
    "Created: / 10-12-2010 / 14:09:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2716
    "Modified: / 01-04-2011 / 18:21:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2717
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2718
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2719
defaultSunBootLibraryPath
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2720
1251
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  2721
    |s|
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  2722
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  2723
    s := '' writeStream.
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  2724
    Java release classPath 
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  2725
        do:[:p | s nextPutAll:p ]
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  2726
        separatedBy: [s nextPut: OperatingSystem pathSeparator].
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  2727
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  2728
    ^ s contents    
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  2729
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  2730
    "    
14f94a33376d - system properties polished
vranyj1
parents: 1250
diff changeset
  2731
        JavaVM defaultSunBootLibraryPath
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2732
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2733
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2734
    "Created: / 10-12-2010 / 14:37:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2735
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2736
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2737
defaultWindowingToolKit
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2738
    "/ prefer the windows toolkit ...
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2739
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2740
    (self classForName: 'sun.awt.windows.WToolkit') notNil ifTrue: [
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2741
        ^ 'sun.awt.windows.WToolkit'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2742
    ].
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2743
    (Java classForName: 'sun.awt.motif.MToolkit') notNil ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2744
        self halt: 'MotifToolKit: this is untested code'.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2745
        ^ 'sun.awt.motif.MToolkit'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2746
    ].
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2747
    self halt: 'TinyToolKit: this is untested code'.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2748
    ^ 'sun.awt.tiny.TinyToolkit'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2749
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2750
    "/    ^ 'sun.awt.win32.MToolkit'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2751
    "/    ^ 'sun.awt.motif.MToolkit'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2752
    "
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  2753
     self defaultWindowingToolKit"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2754
    "Created: / 3.1.1998 / 14:27:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2755
    "Modified: / 27.1.1998 / 21:52:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2756
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2757
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2758
fileAccessTrace
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2759
    ^ FileAccessTrace
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2760
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2761
    "Created: / 27.1.1999 / 18:55:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2762
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2763
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2764
fileAccessTrace:aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2765
    FileAccessTrace := aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2766
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2767
    "Created: / 19.10.1998 / 16:01:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2768
    "Modified: / 27.1.1999 / 18:55:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2769
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2770
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2771
fileOpenConfirmation
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2772
    ^ FileOpenConfirmation
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2773
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2774
    "Created: / 19.10.1998 / 16:01:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2775
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2776
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2777
fileOpenConfirmation:aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2778
    FileOpenConfirmation := aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2779
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2780
    "Created: / 19.10.1998 / 16:01:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2781
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2782
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2783
javaConsole:aStream
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2784
    JavaConsoleStream := aStream
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2785
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2786
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2787
     JavaVM javaConsole:Transcript
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2788
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2789
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2790
    "Modified: / 6.8.1997 / 00:34:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2791
    "Created: / 3.1.1998 / 14:27:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2792
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2793
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2794
javaConsoleStream
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2795
    ^ JavaConsoleStream
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2796
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2797
    "Created: / 3.1.1998 / 14:32:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2798
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2799
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2800
nullPointerExceptionDebug
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2801
    ^ NullPointerExceptionDebug
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2802
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2803
    "Created: / 27.1.1999 / 20:14:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2804
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2805
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2806
nullPointerExceptionDebug:aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2807
    NullPointerExceptionDebug := aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2808
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2809
    "Created: / 27.1.1999 / 20:15:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2810
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2811
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2812
socketConnectConfirmation
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2813
    ^ SocketConnectConfirmation
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2814
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2815
    "Created: / 19.10.1998 / 16:02:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2816
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2817
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2818
socketConnectConfirmation:aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2819
    SocketConnectConfirmation := aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2820
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2821
    "Created: / 19.10.1998 / 16:02:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2822
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2823
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2824
!JavaVM class methodsFor:'eager resolving'!
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2825
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2826
disableEagerResolving
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2827
    EagerResolvingEnabled := false.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2828
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2829
    "Created: / 08-12-2011 / 21:06:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2830
!
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2831
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2832
eagerResolvingEnabled
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2833
    ^ EagerResolvingEnabled.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2834
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2835
    "Created: / 08-12-2011 / 21:05:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2836
!
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2837
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2838
enableEagerResolving
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2839
     EagerResolvingEnabled := true.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2840
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2841
    "Created: / 08-12-2011 / 21:06:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2842
! !
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  2843
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2844
!JavaVM class methodsFor:'fileIO'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2845
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2846
addOpenFile:aStream
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2847
    OpenFileTable add:aStream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2848
    ^ OpenFileTable size - 1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2849
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2850
    "Created: / 2.1.1998 / 18:32:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2851
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2852
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2853
getOpenFileAt:idx
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2854
    ^ OpenFileTable at:idx+1 ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2855
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2856
    "Created: / 2.1.1998 / 18:28:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2857
    "Modified: / 2.1.1998 / 18:33:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2858
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2859
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2860
setOpenFile:aStream at:idx
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2861
    OpenFileTable size < (idx+1) ifTrue:[
1109
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2862
        OpenFileTable grow:idx+1.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2863
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2864
    OpenFileTable at:idx+1 put:aStream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2865
1109
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2866
"/    Do not shrink OpenFileTable now, make debugging easier
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2867
"/    aStream isNil ifTrue:[
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2868
"/        [ OpenFileTable last isNil ] whileTrue:[
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2869
"/            OpenFileTable removeLast.            
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2870
"/        ]
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2871
"/    ].
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2872
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2873
    "Modified: / 02-01-1998 / 18:33:21 / cg"
9bd0544f9046 Initial version of finalize() support - may crash VM!
vranyj1
parents: 1108
diff changeset
  2874
    "Modified: / 14-11-2011 / 19:53:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2875
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2876
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2877
!JavaVM class methodsFor:'helpers'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2878
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2879
canCast: s to: t 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2880
    "Helper for _CHECKCAST:_:"
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2881
    
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2882
    | sc  tc |
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2883
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2884
    "Not specified in JVM spec, sigh"
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2885
    s isJavaPrimitiveType ifTrue: [
914
0331f83c542a Fixes for invoke0 native
vranyj1
parents: 913
diff changeset
  2886
        "FIXME"
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2887
        ^ s == t
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2888
    ].
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2889
     "
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2890
     Java VM Spec, 3rd edition, p 280:
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2891
     
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2892
     The following rules are used to determine whether an objectref that is not
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2893
     null can be cast to the resolved type: if S is the class of the object
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2894
     referred to by objectref and T is the resolved class, array, or interface type,
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2895
     checkcast determines whether objectref can be cast to type T as follows:
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2896
     
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2897
     - If S is an ordinary (nonarray) class, then:
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2898
     - If T is a class type, then S must be the same class as T, or a subclass
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2899
     of T.
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2900
     - If T is an interface type, then S must implement interface T.
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2901
    "
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2902
    (s isJavaArrayClass not and: [ s isInterface not ]) ifTrue: [
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2903
        ^ (s includesBehavior: t).
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2904
    ].
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2905
     "
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2906
     - If S is an interface type, then:
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2907
     - If T is a class type, then T must be Object.
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2908
     - If T is an interface type, then T must be the same interface as S or a
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2909
     superinterface of S.
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2910
    "
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2911
    s isInterface ifTrue: [
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2912
        ^ t isInterface not 
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2913
            ifTrue: [ t == (self classForName: 'java.lang.Object') ]
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2914
            ifFalse: [ s includesBehavior: t ]
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2915
    ].
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2916
     "
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2917
     - If S is a class representing the array type SC[], that is, an array of com-
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2918
     ponents of type SC , then:
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2919
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2920
    self assert: s isJavaArrayClass description: 'S should be array type'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2921
    sc := s javaComponentClass.
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2922
     "
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2923
     - If T is a class type, then T must be Object.
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2924
    "
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2925
    t isJavaClassType ifTrue: [ ^ (sc == t) or: [t == (self classForName: 'java.lang.Object') ]].
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2926
     "
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2927
     - If T is an array type TC[], that is, an array of components of type TC ,
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2928
     then one of the following must be true:
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2929
     - TC and SC are the same primitive type.
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2930
     - TC and SC are reference types, and type SC can be cast to TC by
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2931
     recursive application of these rules.
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2932
    "
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2933
    t isJavaArrayClass ifTrue: [
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2934
        tc := t javaComponentClass.
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2935
        ^ tc isJavaPrimitiveType 
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2936
            ifTrue: [ tc == sc ]
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2937
            ifFalse: [ self canCast: sc to: tc ]
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2938
    ].
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2939
     "
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2940
     - If T is an interface type, T must be one of the interfaces implemented
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2941
     by arrays (JLS3 4.10.3).
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2942
    "
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2943
    ((t name == #'java/lang/Cloneable') 
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2944
        or: [ t name == #'java/lang/Serializable' ]) ifTrue: [ ^ true ].
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  2945
    ^ false
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2946
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2947
    "Modified: / 09-01-1999 / 00:45:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2948
    "Created: / 11-02-2011 / 08:21:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
915
vranyj1
parents: 914
diff changeset
  2949
    "Modified: / 14-08-2011 / 23:14:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  2950
    "Modified: / 21-10-2011 / 13:50:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2951
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2952
1202
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2953
invoke: method receiver: obj arguments: args
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2954
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2955
    "Common helper for invoking methods and ctors. Performs
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2956
     (type) checks and unboxing. Return (possibly boxed) return value."
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2957
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2958
    | descriptor adescriptors bargs bargss retval retcls bi |
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2959
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2960
    (obj isNil and:[method isStatic not]) ifTrue:[
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2961
        self throwNullPointerException.
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2962
        ^nil.            
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2963
    ].
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2964
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2965
    descriptor := method descriptor.
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2966
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2967
    "Possibly box/unbox arguments"
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2968
    args notEmptyOrNil ifTrue:[
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2969
        adescriptors := descriptor parameters.
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2970
        bargs := Array new: (bargss := method numArgs).
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2971
        bi := 1.
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2972
        1 to: args size do:[:i|
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2973
            | cls |
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2974
            bi > bargss ifTrue:[
1222
4ac0b70ff26a JavaVM: yet another fix in reflection (java null/type checks, sigh)
vranyj1
parents: 1221
diff changeset
  2975
                self breakPoint: #jv.
4ac0b70ff26a JavaVM: yet another fix in reflection (java null/type checks, sigh)
vranyj1
parents: 1221
diff changeset
  2976
                self throwExceptionClassName: 'java.lang.reflect.InvocationTargetException'
1202
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2977
                                  withMessage: 'passed more arguments than expected'
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2978
            ].
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2979
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2980
            cls := (adescriptors at: i) javaClass.
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2981
            cls isJavaPrimitiveType ifTrue:[
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2982
                bargs at: bi put: (cls javaUnbox: (args at:i) onError:[
1222
4ac0b70ff26a JavaVM: yet another fix in reflection (java null/type checks, sigh)
vranyj1
parents: 1221
diff changeset
  2983
                    self breakPoint: #jv.
1202
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2984
                    self throwIllegalArgumentException:'illegal unbox'. ^nil
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2985
                ]).
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2986
                (cls == LargeInteger or:[cls == Float]) ifTrue:[bi := bi + 1].
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2987
            ] ifFalse:[
1222
4ac0b70ff26a JavaVM: yet another fix in reflection (java null/type checks, sigh)
vranyj1
parents: 1221
diff changeset
  2988
                ((args at:i) isNil or:[(self canCast: (args at:i) class to: cls)]) ifFalse:[
4ac0b70ff26a JavaVM: yet another fix in reflection (java null/type checks, sigh)
vranyj1
parents: 1221
diff changeset
  2989
                    self breakPoint: #jv.
1202
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2990
                    self throwIllegalArgumentException:'incomplatible argument types'. ^nil.
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2991
                ].
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2992
                bargs at: bi put: (args at:i).
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2993
            ].
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2994
            bi := bi + 1.
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2995
       ].
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2996
        bi <= bargss ifTrue:[
1222
4ac0b70ff26a JavaVM: yet another fix in reflection (java null/type checks, sigh)
vranyj1
parents: 1221
diff changeset
  2997
             self breakPoint: #jv.
1216
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  2998
             self throwExceptionClassName: 'java.lang.reflect.InvocationTargetException'
1202
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  2999
                              withMessage: 'not enough arguments'
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3000
        ].
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3001
    ] ifFalse:[
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3002
        bargs := #()
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3003
    ].
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3004
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3005
    "Fire the method"
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3006
    method isStatic ifTrue:[
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3007
        retval := method valueWithReceiver: method javaClass arguments: bargs.
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3008
    ] ifFalse:[
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3009
        retval := obj perform: method selector withArguments: bargs.
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3010
    ].
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3011
    retcls := descriptor return.
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3012
    retcls notNil ifTrue:[
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3013
        retval := retcls javaClass javaBox: retval.
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3014
    ].
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3015
    ^retval.
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3016
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3017
    "Created: / 01-12-2011 / 23:20:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3018
!
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
  3019
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3020
javaArrayClassFor:aClass 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3021
    ^ self reflection javaArrayClassObjectForClass:aClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3022
        ifAbsentPut:[JavaArray javaArrayClassFor:aClass]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3023
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3024
    "Created: / 17-12-2010 / 13:46:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3025
    "Modified: / 28-01-2011 / 14:59:16 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3026
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3027
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3028
javaStringObjectForString:string 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3029
    self breakPoint:#mh info:'refactor my sender to use reflection directly'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3030
    ^ self reflection javaStringObjectForString:string interned:false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3031
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3032
    "Created: / 22-11-2010 / 16:31:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3033
    "Modified: / 09-02-2011 / 00:47:49 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3034
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3035
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3036
javaStringObjectForString:string interned:intern 
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  3037
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3038
    ^self reflection javaStringObjectForString:string interned:intern.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3039
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3040
    "Created: / 22-11-2010 / 16:28:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3041
    "Modified: / 22-11-2010 / 17:57:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3042
    "Modified: / 09-02-2011 / 01:04:21 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3043
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3044
1249
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3045
javaThreadForSTProcess: stProcess 
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3046
    | result |
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3047
    result := Java threadForStProcess: stProcess ifAbsent: nil.
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3048
    result == 0 ifTrue: [ self breakPoint: #mh. ^ nil].
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3049
    ^ result.
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3050
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3051
    "Modified: / 26-08-1997 / 19:56:31 / cg"
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3052
    "Created: / 03-01-1998 / 01:53:41 / cg"
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3053
    "Modified: / 09-12-2011 / 13:12:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3054
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3055
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  3056
makeArrayOf: loadedJavaClass asDescribedBy: className 
1041
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  3057
    | arrayClass  dimensions |
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  3058
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  3059
    arrayClass := loadedJavaClass.
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  3060
    dimensions := className occurrencesOf: $[.
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  3061
        arrayClass isJavaArrayClass ifTrue: [
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  3062
        "is already array (primitive arrays case, like ByteArray etc)"
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  3063
        dimensions := dimensions - 1.
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  3064
    ].
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  3065
    dimensions timesRepeat: [ arrayClass := arrayClass javaArrayClass. ].
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  3066
        ^ arrayClass.
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  3067
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  3068
    "Created: / 21-10-2011 / 12:18:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1041
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  3069
    "Modified (format): / 23-10-2011 / 22:30:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  3070
!
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  3071
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3072
newThread: name 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3073
    | thread  threadClass  i |
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3074
    threadClass := JavaVM classForName: 'java.lang.Thread'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3075
    thread := threadClass basicNew.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3076
    thread instVarNamed: 'name' put: (Java as_String: name).
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3077
    thread instVarNamed: 'priority'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3078
        put: (threadClass instVarNamed: 'NORM_PRIORITY').
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3079
    thread instVarNamed: 'single_step' put: 0.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3080
    thread instVarNamed: 'daemon' put: 0.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3081
    thread instVarNamed: 'stillborn' put: 0.
1200
c2d29943be5a java thread status is now set
hlopkmar
parents: 1196
diff changeset
  3082
    thread instVarNamed: 'threadStatus' put: 0.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3083
    thread instVarNamed: 'target' put: nil.
1173
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  3084
    thread instVarNamed: 'blockerLock'
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  3085
        put: (JavaVM classForName: 'java.lang.Object') basicNew.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3086
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3087
    "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3088
    "/ that on was only temporarily present in JDK1.1.3 (sigh)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3089
    "/
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3090
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3091
    (i := thread class instVarOffsetOf: 'initial_stack_memory') notNil ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3092
        thread instVarAt: i put: 0.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3093
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3094
    thread instVarNamed: 'group' put: (self standardThreadGroup).
1200
c2d29943be5a java thread status is now set
hlopkmar
parents: 1196
diff changeset
  3095
    threadClass classLoader isNil ifTrue: [
c2d29943be5a java thread status is now set
hlopkmar
parents: 1196
diff changeset
  3096
        thread instVarNamed: 'contextClassLoader' put: self systemClassLoader
c2d29943be5a java thread status is now set
hlopkmar
parents: 1196
diff changeset
  3097
    ] ifFalse: [
c2d29943be5a java thread status is now set
hlopkmar
parents: 1196
diff changeset
  3098
        thread instVarNamed: 'contextClassLoader' put: threadClass classLoader
c2d29943be5a java thread status is now set
hlopkmar
parents: 1196
diff changeset
  3099
    ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3100
    ^ thread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3101
1151
vranyj1
parents: 1150
diff changeset
  3102
    "Created: / 03-01-1998 / 01:47:30 / cg"
vranyj1
parents: 1150
diff changeset
  3103
    "Modified: / 27-01-1998 / 00:54:33 / cg"
vranyj1
parents: 1150
diff changeset
  3104
    "Modified: / 21-11-2011 / 09:48:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1200
c2d29943be5a java thread status is now set
hlopkmar
parents: 1196
diff changeset
  3105
    "Modified: / 01-12-2011 / 17:43:38 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3106
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3107
1201
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
  3108
stProcessForJavaThread: jThread 
1249
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3109
    | result |
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3110
    result := Java threadsAt: jThread ifAbsent: nil.
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3111
    result == 0 ifTrue: [ self breakPoint: #mh. ^ nil ].
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3112
    ^ result.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3113
1201
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
  3114
    "Created: / 02-01-1998 / 21:48:27 / cg"
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
  3115
    "Modified: / 03-01-1998 / 01:53:55 / cg"
1249
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3116
    "Modified: / 09-12-2011 / 13:12:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3117
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3118
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3119
standardThreadGroup
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3120
    | standardGroup  threadClass |
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3121
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3122
    StandardThreadGroup isNil ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3123
        threadClass := JavaVM classForName: 'java.lang.Thread'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3124
        standardGroup := (self classForName: 'java.lang.ThreadGroup') new.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3125
        standardGroup instVarNamed: 'parent' put: nil.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3126
        standardGroup instVarNamed: 'name' put: (Java as_String: 'main').
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3127
        standardGroup instVarNamed: 'maxPriority'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3128
            put: (threadClass instVarNamed: 'MAX_PRIORITY').
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3129
        standardGroup instVarNamed: 'destroyed' put: 0.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3130
        standardGroup instVarNamed: 'daemon' put: nil.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3131
        (standardGroup class instVarOffsetOf: 'vmAllowSuspension') notNil ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3132
            standardGroup instVarNamed: 'vmAllowSuspension' put: 0.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3133
        ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3134
        standardGroup instVarNamed: 'nthreads' put: 0.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3135
        standardGroup instVarNamed: 'ngroups' put: 0.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3136
        standardGroup instVarNamed: 'groups' put: nil.
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3137
        StandardThreadGroup := standardGroup.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3138
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3139
    ^ StandardThreadGroup
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3140
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3141
    "Created: / 03-01-1998 / 01:41:54 / cg"
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3142
    "Modified: / 17-11-1998 / 22:55:30 / cg"
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3143
    "Modified: / 25-04-2011 / 20:27:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3144
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3145
1175
5575f3d296a5 one line change in threadStart makes join work smooooth :)
hlopkmar
parents: 1173
diff changeset
  3146
threadStart: nativeContext 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3147
    "start the thread"
1175
5575f3d296a5 one line change in threadStart makes join work smooooth :)
hlopkmar
parents: 1173
diff changeset
  3148
    
1195
378d34a28bd4 need more logging
hlopkmar
parents: 1194
diff changeset
  3149
    | jThread  jName  nm  stProcess  helper |
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3150
    jThread := nativeContext receiver.
1183
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
  3151
    self assert: (jThread instVarNamed: 'priority') > 0.
1175
5575f3d296a5 one line change in threadStart makes join work smooooth :)
hlopkmar
parents: 1173
diff changeset
  3152
    stProcess := JavaProcess for: (helper := JavaProcess newHelper)
5575f3d296a5 one line change in threadStart makes join work smooooth :)
hlopkmar
parents: 1173
diff changeset
  3153
                priority: (Processor activePriority).
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3154
    helper javaThreadObject: jThread.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3155
    helper javaProcess: stProcess.
1175
5575f3d296a5 one line change in threadStart makes join work smooooth :)
hlopkmar
parents: 1173
diff changeset
  3156
    jName := jThread instVarNamed: 'name'.
1195
378d34a28bd4 need more logging
hlopkmar
parents: 1194
diff changeset
  3157
    jName isString ifFalse: [ nm := Java as_ST_String: jName. ] ifTrue: [
378d34a28bd4 need more logging
hlopkmar
parents: 1194
diff changeset
  3158
        nm := jName
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3159
    ].
1175
5575f3d296a5 one line change in threadStart makes join work smooooth :)
hlopkmar
parents: 1173
diff changeset
  3160
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3161
    "/ kludge - remember the ScreenUpdater ...
1175
5575f3d296a5 one line change in threadStart makes join work smooooth :)
hlopkmar
parents: 1173
diff changeset
  3162
    
1195
378d34a28bd4 need more logging
hlopkmar
parents: 1194
diff changeset
  3163
    nm = 'Screen Updater' ifTrue: [ JavaScreenUpdaterThread := stProcess. ] ifFalse: [
378d34a28bd4 need more logging
hlopkmar
parents: 1194
diff changeset
  3164
        nm = 'AWT-Windows' ifTrue: [ JavaEventThread := stProcess. ] ifFalse: [
378d34a28bd4 need more logging
hlopkmar
parents: 1194
diff changeset
  3165
            (nm startsWith: 'AWT-EventQueue') ifTrue: [
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3166
                JavaEventQueueThread := stProcess.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3167
            ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3168
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3169
    ].
1194
9f910257b6e8 from now on joining thread does not block after threads death
hlopkmar
parents: 1193
diff changeset
  3170
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3171
    "/ when that process terminates, wakup any waiters
1175
5575f3d296a5 one line change in threadStart makes join work smooooth :)
hlopkmar
parents: 1173
diff changeset
  3172
    "/mh 29.11.11 this makes join work
1194
9f910257b6e8 from now on joining thread does not block after threads death
hlopkmar
parents: 1193
diff changeset
  3173
    "/mh 30.11.11 disable wait is to ensure that join can be called on thread after its finished and dont wait forever"
9f910257b6e8 from now on joining thread does not block after threads death
hlopkmar
parents: 1193
diff changeset
  3174
    
9f910257b6e8 from now on joining thread does not block after threads death
hlopkmar
parents: 1193
diff changeset
  3175
    stProcess 
9f910257b6e8 from now on joining thread does not block after threads death
hlopkmar
parents: 1193
diff changeset
  3176
        addExitAction: [
1195
378d34a28bd4 need more logging
hlopkmar
parents: 1194
diff changeset
  3177
            Logger 
378d34a28bd4 need more logging
hlopkmar
parents: 1194
diff changeset
  3178
                log: ('%1 is going to die, notifying all waiters and disabling waiting on its monitor' 
378d34a28bd4 need more logging
hlopkmar
parents: 1194
diff changeset
  3179
                        bindWith: jThread printString)
378d34a28bd4 need more logging
hlopkmar
parents: 1194
diff changeset
  3180
                severity: #debug
378d34a28bd4 need more logging
hlopkmar
parents: 1194
diff changeset
  3181
                facility: #JVM.
1249
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3182
            jThread instVarNamed: 'threadStatus' put: 0.
1195
378d34a28bd4 need more logging
hlopkmar
parents: 1194
diff changeset
  3183
            (self monitorFor: jThread) disableWait.
1194
9f910257b6e8 from now on joining thread does not block after threads death
hlopkmar
parents: 1193
diff changeset
  3184
            self acquireMonitorAndNotifyAll: jThread.
1195
378d34a28bd4 need more logging
hlopkmar
parents: 1194
diff changeset
  3185
        ].
378d34a28bd4 need more logging
hlopkmar
parents: 1194
diff changeset
  3186
    stProcess name: 'JAVA-' , nm.
1175
5575f3d296a5 one line change in threadStart makes join work smooooth :)
hlopkmar
parents: 1173
diff changeset
  3187
    stProcess restartable: true.
1200
c2d29943be5a java thread status is now set
hlopkmar
parents: 1196
diff changeset
  3188
    jThread instVarNamed: 'threadStatus' put: 1.
1249
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3189
    Java addThread: jThread for: stProcess.
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3190
    stProcess resume.    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3191
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3192
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3193
    "Modified: / 24-12-1999 / 03:14:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3194
    "Created: / 14-12-2010 / 21:31:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3195
    "Modified: / 15-12-2010 / 11:19:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1249
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  3196
    "Modified: / 09-12-2011 / 12:58:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3197
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3198
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3199
!JavaVM class methodsFor:'helpers - awt'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3200
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3201
commonReshapeComponent:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3202
    |view x y width height ext menu|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3203
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3204
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3205
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3206
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3207
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3208
    width := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3209
    height := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3210
    ext := width@height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3211
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3212
"/    'pReshape ' print. view print. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3213
"/    ' ' print. x print. '/' print. y print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3214
"/    ' extent: ' print. ext printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3215
    view isPopUpView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3216
	view origin:x@y extent:ext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3217
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3218
	(view isTopView 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3219
	or:[view isMemberOf:JavaEmbeddedFrameView]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3220
	    "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3221
	    "/ dont allow setting the origin
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3222
	    "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3223
	    menu := self topViewsMenu:view.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3224
	    menu notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3225
		"/ must add the menus height
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3226
		height := height + menu height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3227
		ext := width@height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3228
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3229
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3230
	    "/ to prevent a view from not being visible/closable
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3231
	    "/ in case Java goes mad ..
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3232
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3233
	    (width < 30
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3234
	    or:[height < 10]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3235
		"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3236
		width := 30.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3237
		height := 20.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3238
		ext := width@height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3239
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3240
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3241
	    view extent:ext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3242
	    (view isKindOf:ModalBox) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3243
		view preferredExtent:ext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3244
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3245
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3246
	    "/ adjust non-resizable views min/max
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3247
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3248
	    view isTopView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3249
		view minExtent notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3250
		    view minExtent:ext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3251
		    view maxExtent:ext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3252
		].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3253
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3254
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3255
	    (view superView notNil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3256
	    and:[view superView isTopView]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3257
		menu := self topViewsMenu:view superView.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3258
		menu notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3259
		    "/ must add menus height to yPos
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3260
		    y := y + menu height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3261
		]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3262
	    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3263
		"/ post a configuration event
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3264
		EventTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3265
		    'JAVA: configure: need event' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3266
		]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3267
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3268
	    (x isNil or:[y isNil]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3269
		Transcript showCR:'bad args to reshape'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3270
	    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3271
		view origin:x@y extent:ext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3272
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3273
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3274
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3275
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3276
    view isJavaView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3277
	view invalidate.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3278
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3279
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3280
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3281
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3282
    "Created: / 4.1.1998 / 18:00:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3283
    "Modified: / 5.12.1998 / 13:34:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3284
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3285
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3286
createdWindowsView:aView for:aJavaPeer
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3287
    "this is only sent with the sun.awt.windows toolkit"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3288
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3289
    aJavaPeer instVarNamed:'pData' put:aView.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3290
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3291
    JavaWindowGroup isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3292
	JavaWindowGroup := WindowGroup new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3293
	JavaWindowGroup isForModalSubview:true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3294
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3295
    aView windowGroup:JavaWindowGroup.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3296
    JavaWindowGroup addView:aView.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3297
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3298
    KnownWindows isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3299
	KnownWindows := IdentityDictionary new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3300
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3301
    KnownWindows at:aJavaPeer put:aView.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3302
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3303
    FirstWindowCreationSemaphore signalIf.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3304
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3305
"/'*** ' print. aJavaPeer print. ' -> ' print. aView printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3306
"/(aView isKindOf:ModalBox) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3307
"/    self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3308
"/].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3309
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3310
    "Created: / 4.1.1998 / 17:57:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3311
    "Modified: / 28.1.1998 / 22:40:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3312
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3313
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3314
gcForWGraphics:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3315
    |jGraphics gc orgX orgY trans tX tY|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3316
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3317
    jGraphics := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3318
    O_WGgraphics_pData isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3319
	O_WGgraphics_pData := (jGraphics class instVarOffsetOf:'pData').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3320
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3321
    O_WGgraphics_originX isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3322
	O_WGgraphics_originX := (jGraphics class instVarOffsetOf:'originX').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3323
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3324
    O_WGgraphics_originY isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3325
	O_WGgraphics_originY := (jGraphics class instVarOffsetOf:'originY').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3326
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3327
    gc := jGraphics instVarAt:O_WGgraphics_pData.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3328
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3329
    trans := gc translation.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3330
    tX := trans x.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3331
    tY := trans y.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3332
"/    tX := gc translationX.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3333
"/    tY := gc translationY.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3334
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3335
    orgX := jGraphics instVarAt:O_WGgraphics_originX.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3336
    orgY := jGraphics instVarAt:O_WGgraphics_originY.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3337
    ((orgX ~~ tX) or:[orgY ~~ tY]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3338
	gc translation:orgX@orgY
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3339
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3340
    ^ gc
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3341
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3342
    "Created: / 8.1.1998 / 00:16:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3343
    "Modified: / 23.12.1998 / 20:27:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3344
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3345
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3346
jPeerForView:aView
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3347
    ^ KnownWindows keyAtValue:aView ifAbsent:nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3348
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3349
    "Created: / 15.1.1998 / 13:48:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3350
    "Modified: / 15.1.1998 / 13:48:43 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3351
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3352
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3353
pReshape:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3354
    |jFramePeer view x y width height menu|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3355
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3356
    jFramePeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3357
    view := jFramePeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3358
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3359
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3360
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3361
    width := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3362
    height := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3363
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3364
"/    'pReshape ' print. view print. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3365
"/    ' ' print. x print. '/' print. y print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3366
"/    ' extent: ' print. width print. '/' print. height printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3367
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3368
    view isPopUpView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3369
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3370
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3371
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3372
    (view isTopView 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3373
    or:[view isMemberOf:JavaEmbeddedFrameView]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3374
	"/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3375
	"/ dont allow setting the origin
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3376
	"/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3377
	menu := self topViewsMenu:view.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3378
	menu notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3379
	    "/ must add the menus height
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3380
	    height := height + menu height
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3381
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3382
	view extent:width@height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3383
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3384
	(view superView notNil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3385
	and:[view superView isTopView]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3386
	    menu := self topViewsMenu:view superView.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3387
	    menu notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3388
		"/ must add menus height to yPos
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3389
		y := y + menu height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3390
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3391
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3392
	view origin:x@y extent:width@height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3393
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3394
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3395
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3396
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3397
    "Created: / 7.1.1998 / 21:47:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3398
    "Modified: / 5.12.1998 / 13:47:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3399
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3400
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3401
replacementFontFor:name style:styleNr size:size
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3402
    |font family style|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3403
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3404
    style := 'roman'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3405
    styleNr = 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3406
        style := 'roman'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3407
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3408
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3409
    font := Font family:name style:style size:size.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3410
    font notNil ifTrue:[^ font].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3411
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3412
    name = 'Dialog' ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3413
        family := 'helvetica'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3414
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3415
        family := 'courier'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3416
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3417
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3418
    ^ Font family:name style:style size:size.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3419
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3420
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3421
topViewsMenu:view
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3422
    |idx|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3423
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3424
    view isTopView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3425
	view subViews size > 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3426
	    (idx := view subViews findFirst:[:v | v isMemberOf:MenuPanel]) ~~ 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3427
		"/ must add the menus height
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3428
		^ view subViews at:idx
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3429
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3430
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3431
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3432
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3433
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3434
    "Modified: / 4.8.1997 / 01:23:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3435
    "Created: / 4.1.1998 / 18:01:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3436
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3437
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3438
viewForWPeer:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3439
    |jPeer|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3440
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3441
    jPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3442
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3443
    "/ sigh; pData was renamed to pNativeWidget in jdk1.2 ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3444
    O_FramePeer_pNativeWidget isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3445
	O_FramePeer_pNativeWidget := (jPeer class instVarOffsetOf:'pNativeWidget').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3446
	O_FramePeer_pNativeWidget isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3447
	    O_FramePeer_pNativeWidget := 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3448
	    O_FramePeer_pData isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3449
		O_FramePeer_pData := (jPeer class instVarOffsetOf:'pData').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3450
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3451
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3452
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3453
    O_FramePeer_pNativeWidget > 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3454
	"/ ok, we are < 1.2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3455
	^ jPeer instVarAt:O_FramePeer_pNativeWidget.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3456
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3457
    ^ jPeer instVarAt:O_FramePeer_pData.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3458
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3459
    "Modified: / 19.11.1998 / 01:43:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3460
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3461
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3462
!JavaVM class methodsFor:'helpers - exceptions'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3463
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3464
throwAbstractMethodError
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3465
    ^ self throwExceptionClassName: 'java.lang.AbstractMethodError'
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3466
        withMessage: 'resolving a method ref failed'.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3467
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3468
    "Created: / 11-04-2011 / 20:32:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3469
!
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3470
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3471
throwArrayIndexOutOfBoundsException: badIndex 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3472
    | exClass  ex |
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3473
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3474
    exClass := self classForName: 'java.lang.ArrayIndexOutOfBoundsException'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3475
    ex := exClass newWith_int: badIndex.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3476
    ^ self throwException: ex
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3477
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3478
    "Created: / 14.1.1998 / 21:36:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3479
    "Modified: / 20.11.1998 / 13:27:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3480
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3481
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3482
throwArrayIndexOutOfBoundsException: theArray _: badIndex 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3483
    | exClass  ex |
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3484
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3485
    exClass := self classForName: 'java.lang.ArrayIndexOutOfBoundsException'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3486
    ex := exClass newWith_int: badIndex.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3487
    ^ self throwException: ex
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3488
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3489
    "Modified: / 20.11.1998 / 13:27:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3490
    "Created: / 8.1.1999 / 15:03:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3491
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3492
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3493
throwArrayStoreException:badArray
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3494
    ^ self
864
45d54ed8b273 JavaVM: improvements in java.lang.System.arraycopy native
vranyj1
parents: 859
diff changeset
  3495
        throwExceptionClassName:'java.lang.ArrayStoreException'
45d54ed8b273 JavaVM: improvements in java.lang.System.arraycopy native
vranyj1
parents: 859
diff changeset
  3496
         withMessage:('bad array store: ' , badArray class printString)
45d54ed8b273 JavaVM: improvements in java.lang.System.arraycopy native
vranyj1
parents: 859
diff changeset
  3497
45d54ed8b273 JavaVM: improvements in java.lang.System.arraycopy native
vranyj1
parents: 859
diff changeset
  3498
    "Modified: / 23-06-2011 / 09:19:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3499
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3500
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3501
throwClassCastException
1041
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  3502
1169
8f727dc66647 monitor fix.. many to come :)
hlopkmar
parents: 1159
diff changeset
  3503
    
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  3504
    ^ self throwExceptionClassName: 'java.lang.ClassCastException'
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  3505
        withMessage: 'cast failed'
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3506
1041
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  3507
    "Modified: / 07-01-1998 / 15:25:35 / cg"
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  3508
    "Created: / 08-01-1999 / 18:55:31 / cg"
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  3509
    "Modified (format): / 23-10-2011 / 22:33:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3510
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3511
892
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  3512
throwClassFormatError
1053
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  3513
    ^ self throwClassFormatError: 'Invalid class format'
892
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  3514
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  3515
    "Created: / 04-01-1998 / 22:26:09 / cg"
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  3516
    "Modified: / 10-11-1998 / 13:20:31 / cg"
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  3517
    "Created: / 08-08-2011 / 17:57:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  3518
!
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  3519
1053
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  3520
throwClassFormatError: message
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  3521
    ^ self 
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  3522
        throwExceptionClassName:'java.lang.ClassFormatError' 
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  3523
        withMessage: message
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  3524
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  3525
    "Created: / 04-01-1998 / 22:26:09 / cg"
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  3526
    "Modified: / 10-11-1998 / 13:20:31 / cg"
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  3527
    "Created: / 27-10-2011 / 16:20:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  3528
!
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  3529
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3530
throwClassNotFoundException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3531
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3532
	throwExceptionClassName:'java.lang.ClassNotFoundException' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3533
	withMessage:'no such class'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3534
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3535
    "Created: / 4.1.1998 / 22:25:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3536
    "Modified: / 7.1.1998 / 15:25:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3537
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3538
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  3539
throwClassNotFoundException: className 
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  3540
    ^ self throwExceptionClassName: 'java.lang.ClassNotFoundException'
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  3541
        withMessage: 'no such class: ' , className
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3542
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3543
    "Created: / 4.1.1998 / 22:26:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3544
    "Modified: / 10.11.1998 / 13:20:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3545
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3546
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3547
throwDivisionByZeroException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3548
    DivisionByZeroExceptionDebug == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3549
	self halt:'division by zero'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3550
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3551
    ^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3552
	throwExceptionClassName:'java.lang.ArithmeticException'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3553
	withMessage:'division by zero'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3554
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3555
    "Created: / 8.1.1999 / 14:28:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3556
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3557
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3558
throwException: aJavaException 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3559
    <resource: #skipInDebuggersWalkBack>
1098
vranyj1
parents: 1097
diff changeset
  3560
    | con  jMsg  msg  exClass  srchCon  handlerContext  handlerPC  method  pc  hPC |
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3561
    ExceptionTrace ifTrue: [
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3562
        | tmpMessage |
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3563
        tmpMessage := aJavaException instVarNamed: 'detailMessage'.
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3564
        tmpMessage isNil ifTrue: [ tmpMessage := '' ] ifFalse: [
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3565
            tmpMessage := Java as_ST_String: tmpMessage
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3566
        ].
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3567
        Logger 
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3568
            log: 'JAVA: exception: ' , aJavaException class fullName , ' (' 
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3569
                    , tmpMessage , ')'
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3570
            severity: #debug
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3571
            facility: 'JVM'
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3572
    ].
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3573
    ExceptionDebug ifTrue: [
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3574
        "/        self internalError:('JAVA: exception: ' , aJavaException class fullName).        
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3575
        (ExceptionDebugPatterns isNilOrEmptyCollection 
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3576
            or: [
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3577
                ExceptionDebugPatterns 
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3578
                    anySatisfy: [:pattern | pattern match: aJavaException class fullName ]
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3579
            ]) 
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3580
                ifTrue: [
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3581
                    self halt: ('JAVA: exceptionDebug: ' , aJavaException class fullName)
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3582
                ]
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3583
    ].
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3584
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3585
    "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3586
    "/ search stack for a javaContext which handles that exception
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3587
    "/
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3588
    
1201
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
  3589
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3590
    srchCon := thisContext sender.
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3591
    [ handlerContext isNil and: [ srchCon notNil ] ] whileTrue: [
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3592
        (srchCon isJavaContext) ifTrue: [
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3593
            method := srchCon method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3594
            pc := srchCon pc.
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3595
            (hPC := method handlerFor: aJavaException at: pc) notNil ifTrue: [
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3596
                "JV@2011-02-25: Another crap in JVM and Java VM Spec?
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3597
                 Or theri proxu generator? Assume that if athrow's pc
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3598
                 is same as the handler's pc it means rethrow to
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3599
                 handling context - so DO NOT HANDLE IT!!"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3600
                "Hack disabled for now"
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3601
                "pc ~~ hPC"
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3602
                true ifTrue: [
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3603
                    handlerPC := hPC.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3604
                    handlerContext := srchCon
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3605
                ].
1098
vranyj1
parents: 1097
diff changeset
  3606
            ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3607
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3608
        srchCon := srchCon sender.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3609
    ].
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3610
    handlerContext isNil ifTrue: [
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3611
        "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3612
        "/ no JavaHandler ... let smalltalk handle it
1201
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
  3613
        "/                
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3614
        exClass := aJavaException class.
1201
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
  3615
        exClass == (self classNamed: 'java/lang/ThreadDeath') ifTrue: [
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
  3616
            "/mh 1.12.11 uncaught threadDeaths are not delegated out.. Thread.stop javadoc
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
  3617
            ^ self
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
  3618
        ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3619
        msg := 'Java ' , exClass name.
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3620
        jMsg := aJavaException instVarNamed: 'detailMessage'.
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3621
        jMsg notNil ifTrue: [ msg := msg , ': ' , (Java as_ST_String: jMsg). ].
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3622
        
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3623
        "/ for our convenience: skip ST contexts 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3624
        "/ (i.e. the handler or debugger will see the javaContext first )
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3625
        
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3626
        con := thisContext sender.
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3627
        [ con isNil or: [ con isJavaContext ] ] whileFalse: [ con := con sender ].
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3628
        con isNil ifTrue: [ con := thisContext sender ].
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3629
        JavaUnhandledExceptionError 
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3630
            raiseWith: aJavaException
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3631
            errorString: msg
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3632
            in: con.
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3633
    ] ifFalse: [
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3634
        "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3635
        "/ found a java exceptionHandler
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3636
        "/
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3637
        handlerContext setPC: handlerPC.
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3638
        handlerContext exceptionArg: aJavaException pc: handlerPC.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3639
        handlerContext markForException.
1098
vranyj1
parents: 1097
diff changeset
  3640
        handlerContext unwindAndRestartForJavaException.
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3641
        self halt: 'should not be reached'.
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3642
    ].
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3643
    Processor activeProcess == JavaScreenUpdaterThread ifTrue: [ self halt ].
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3644
    Processor activeProcess == JavaEventQueueThread ifTrue: [ self halt ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3645
    Processor activeProcess terminate.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3646
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3647
    "
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3648
     ExceptionTrace := true"
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  3649
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3650
    "Created: / 07-01-1998 / 15:28:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3651
    "Modified: / 24-12-1999 / 02:33:25 / cg"
1098
vranyj1
parents: 1097
diff changeset
  3652
    "Modified: / 08-11-2011 / 22:16:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1201
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
  3653
    "Modified: / 01-12-2011 / 18:32:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3654
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3655
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3656
throwExceptionClassName: aJavaExceptionClassName withMessage: someMessage 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3657
    | exClass  ex |
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3658
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3659
    exClass := self classForName: aJavaExceptionClassName asSlashedJavaClassName definedBy: nil.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3660
    ex := exClass newWith_String: someMessage.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  3661
    ^ self throwException: ex
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3662
1060
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  3663
    "Created: / 07-01-1998 / 15:25:09 / cg"
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  3664
    "Modified: / 14-01-1998 / 23:38:30 / cg"
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  3665
    "Modified: / 30-10-2011 / 17:44:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3666
    "Modified: / 02-11-2011 / 16:54:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3667
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3668
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3669
throwExceptionInInitializerError:className
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3670
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3671
        throwExceptionClassName:'java.lang.ExceptionInInitializerError' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3672
        withMessage:'error when initializing class: ' , className
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3673
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3674
    "Created: / 24-11-2010 / 09:23:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3675
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3676
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  3677
throwFileNotFoundException: message
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  3678
    ^ self 
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  3679
        throwExceptionClassName:'java.io.FileNotFoundException' 
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  3680
        withMessage: message
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  3681
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  3682
    "Created: / 04-01-1998 / 22:26:09 / cg"
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  3683
    "Modified: / 10-11-1998 / 13:20:31 / cg"
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  3684
    "Created: / 10-08-2011 / 14:19:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  3685
!
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  3686
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3687
throwIOExceptionWithMessage:message
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3688
    IOExceptionDebug == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3689
	self halt:'IO Exception'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3690
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3691
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3692
	throwExceptionClassName:'java.io.IOException' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3693
	withMessage:message
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3694
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3695
    "Created: / 7.1.1998 / 10:34:24 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3696
    "Modified: / 7.1.1998 / 15:26:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3697
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3698
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3699
throwIllegalAccessError
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3700
    ^ self throwExceptionClassName: 'java.lang.IllegalAccessError'
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3701
        withMessage: 'illegal access'
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3702
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3703
    "Created: / 13-04-2011 / 23:07:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3704
!
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3705
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3706
throwIllegalAccessException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3707
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3708
	throwExceptionClassName:'java.lang.IllegalAccessException' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3709
	withMessage:'illegal access'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3710
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3711
    "Modified: / 7.1.1998 / 15:25:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3712
    "Created: / 14.1.1998 / 23:13:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3713
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3714
985
8d63abcb4308 Few fixes...
vranyj1
parents: 981
diff changeset
  3715
throwIllegalArgumentException: message
8d63abcb4308 Few fixes...
vranyj1
parents: 981
diff changeset
  3716
    ^ self 
8d63abcb4308 Few fixes...
vranyj1
parents: 981
diff changeset
  3717
        throwExceptionClassName:'java.lang.IllegalArgumentException' 
1151
vranyj1
parents: 1150
diff changeset
  3718
        withMessage: 'illegal argument: ', message
985
8d63abcb4308 Few fixes...
vranyj1
parents: 981
diff changeset
  3719
8d63abcb4308 Few fixes...
vranyj1
parents: 981
diff changeset
  3720
    "Modified: / 07-01-1998 / 15:25:35 / cg"
8d63abcb4308 Few fixes...
vranyj1
parents: 981
diff changeset
  3721
    "Created: / 14-01-1998 / 23:13:44 / cg"
8d63abcb4308 Few fixes...
vranyj1
parents: 981
diff changeset
  3722
    "Created: / 07-09-2011 / 14:18:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8d63abcb4308 Few fixes...
vranyj1
parents: 981
diff changeset
  3723
!
8d63abcb4308 Few fixes...
vranyj1
parents: 981
diff changeset
  3724
1177
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
  3725
throwIllegalMonitorStateException: message 
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
  3726
    self throwExceptionClassName: 'java.lang.IllegalMonitorStateException'
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
  3727
            withMessage: message.
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
  3728
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
  3729
    "Created: / 29-11-2011 / 14:21:31 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
  3730
!
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
  3731
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3732
throwIncompatibleClassChangeError
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3733
        ^ self throwExceptionClassName: 'java.lang.IncompatibleClassChangeError'
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3734
                withMessage: 'illegal change'.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3735
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3736
    "Created: / 11-04-2011 / 20:03:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3737
!
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3738
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3739
throwInstantiationException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3740
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3741
	throwExceptionClassName:'java.lang.InstantiationException' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3742
	withMessage:'cannot instantiate'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3743
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3744
    "Modified: / 7.1.1998 / 15:25:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3745
    "Created: / 14.1.1998 / 23:15:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3746
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3747
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3748
throwInstantiationExceptionFor:aJavaClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3749
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3750
        throwExceptionClassName:'java.lang.InstantiationException' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3751
        withMessage:('cannot instantiate: ' , aJavaClass javaName)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3753
    "Modified: / 7.1.1998 / 15:25:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3754
    "Created: / 14.1.1998 / 23:17:02 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3755
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3756
1188
1460e12fc954 interrupt test passes
hlopkmar
parents: 1185
diff changeset
  3757
throwInterruptedException: message 
1460e12fc954 interrupt test passes
hlopkmar
parents: 1185
diff changeset
  3758
    ^ self throwExceptionClassName: 'java.lang.InterruptedException'
1460e12fc954 interrupt test passes
hlopkmar
parents: 1185
diff changeset
  3759
        withMessage:message
1460e12fc954 interrupt test passes
hlopkmar
parents: 1185
diff changeset
  3760
1460e12fc954 interrupt test passes
hlopkmar
parents: 1185
diff changeset
  3761
    "Created: / 30-11-2011 / 12:23:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1460e12fc954 interrupt test passes
hlopkmar
parents: 1185
diff changeset
  3762
!
1460e12fc954 interrupt test passes
hlopkmar
parents: 1185
diff changeset
  3763
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3764
throwLinkageError: message
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3765
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3766
        throwExceptionClassName:'java.lang.LinkageError' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3767
        withMessage: message
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3768
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3769
    "Modified: / 10-11-1998 / 13:20:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3770
    "Created: / 26-11-2010 / 11:26:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3771
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3772
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3773
throwNoSuchFieldException
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3774
  ^ self throwExceptionClassName: 'java.lang.NoSuchFieldError'
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3775
        withMessage: 'looking up a field failed'.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3776
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3777
    "Created: / 13-04-2011 / 12:16:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3778
!
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3779
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3780
throwNoSuchMethodError
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3781
      ^ self throwExceptionClassName: 'java.lang.NoSuchMethodError'
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3782
              withMessage: 'looking up a method failed'.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3783
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3784
    "Created: / 11-04-2011 / 20:33:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3785
!
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3786
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3787
throwNullPointerException
912
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  3788
    NullPointerExceptionDebug == true ifTrue:[
908
d990d0d520d9 ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents: 907
diff changeset
  3789
        self halt:'Null Pointer exception'.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3790
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3791
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3792
    ^ self 
908
d990d0d520d9 ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents: 907
diff changeset
  3793
        throwExceptionClassName:'java.lang.NullPointerException' 
d990d0d520d9 ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents: 907
diff changeset
  3794
        withMessage:'null pointer'
d990d0d520d9 ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents: 907
diff changeset
  3795
d990d0d520d9 ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents: 907
diff changeset
  3796
    "Created: / 09-01-1998 / 02:26:08 / cg"
d990d0d520d9 ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents: 907
diff changeset
  3797
    "Modified: / 28-01-1998 / 02:30:09 / cg"
912
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  3798
    "Modified: / 13-08-2011 / 01:10:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3799
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3800
1248
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  3801
throwNullPointerException:message
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  3802
    NullPointerExceptionDebug == true ifTrue: [
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  3803
        self halt: 'Null Pointer exception'.
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  3804
    ].
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  3805
    ^ self throwExceptionClassName: 'java.lang.NullPointerException'
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  3806
        withMessage: message
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  3807
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  3808
    "Created: / 09-01-1998 / 02:26:08 / cg"
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  3809
    "Modified: / 28-01-1998 / 02:30:09 / cg"
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  3810
    "Modified: / 13-08-2011 / 01:10:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  3811
    "Created: / 09-12-2011 / 11:13:40 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  3812
!
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  3813
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3814
throwNumberFormatException 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3815
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3816
	throwExceptionClassName:'java.lang.NumberFormatException' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3817
	withMessage:'bad number format'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3818
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3819
    "Modified: / 7.1.1998 / 15:25:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3820
    "Created: / 11.1.1998 / 16:08:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3821
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3822
943
35fe635719f9 JavaZipSupport refactoring
vranyj1
parents: 942
diff changeset
  3823
throwOutOfMemoryError
35fe635719f9 JavaZipSupport refactoring
vranyj1
parents: 942
diff changeset
  3824
    ^ self 
35fe635719f9 JavaZipSupport refactoring
vranyj1
parents: 942
diff changeset
  3825
        throwExceptionClassName:'java.lang.OutOfMemoryError' 
35fe635719f9 JavaZipSupport refactoring
vranyj1
parents: 942
diff changeset
  3826
        withMessage:'Oops, out of memory!!'
35fe635719f9 JavaZipSupport refactoring
vranyj1
parents: 942
diff changeset
  3827
35fe635719f9 JavaZipSupport refactoring
vranyj1
parents: 942
diff changeset
  3828
    "Created: / 04-01-1998 / 22:26:09 / cg"
35fe635719f9 JavaZipSupport refactoring
vranyj1
parents: 942
diff changeset
  3829
    "Modified: / 10-11-1998 / 13:20:31 / cg"
35fe635719f9 JavaZipSupport refactoring
vranyj1
parents: 942
diff changeset
  3830
    "Created: / 30-08-2011 / 09:23:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
35fe635719f9 JavaZipSupport refactoring
vranyj1
parents: 942
diff changeset
  3831
!
35fe635719f9 JavaZipSupport refactoring
vranyj1
parents: 942
diff changeset
  3832
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3833
throwSecurityException
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3834
    JavaClassReader classLoaderQuerySignal 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3835
        answer:  nil
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3836
        do: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3837
            ^ self throwExceptionClassName: 'java.lang.SecurityException'
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3838
                withMessage: 'trying to load class from java.lang using different class loader?'
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3839
        ].
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3840
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3841
    "Created: / 01-11-2011 / 15:55:45 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3842
!
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3843
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3844
throwSecurityExceptionWith: message 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3845
    JavaClassReader classLoaderQuerySignal answer: nil
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3846
        do: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3847
            ^ self throwExceptionClassName: 'java.lang.SecurityException'
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3848
                withMessage: 'trying to load class from java.lang: ' , message.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3849
        ].
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3850
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3851
    "Created: / 01-11-2011 / 16:28:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3852
!
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  3853
1084
vranyj1
parents: 1083
diff changeset
  3854
throwSocketException: message 
vranyj1
parents: 1083
diff changeset
  3855
    JavaClassReader classLoaderQuerySignal answer: nil
vranyj1
parents: 1083
diff changeset
  3856
        do: [
vranyj1
parents: 1083
diff changeset
  3857
            ^ self throwExceptionClassName: 'java.net.SocketException'
vranyj1
parents: 1083
diff changeset
  3858
                withMessage: message
vranyj1
parents: 1083
diff changeset
  3859
        ].
vranyj1
parents: 1083
diff changeset
  3860
vranyj1
parents: 1083
diff changeset
  3861
    "Created: / 01-11-2011 / 16:28:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
vranyj1
parents: 1083
diff changeset
  3862
    "Created: / 03-11-2011 / 23:31:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vranyj1
parents: 1083
diff changeset
  3863
!
vranyj1
parents: 1083
diff changeset
  3864
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3865
throwZipException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3866
    ^ self throwExceptionClassName: 'java.util.zip.ZipException'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3867
        withMessage: 'error in opening zip file'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3868
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3869
    "Created: / 27-03-2011 / 16:25:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3870
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3871
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3872
!JavaVM class methodsFor:'helpers - io'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3873
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3874
anyStream_close:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3875
    |jStream fileNo file|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3876
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3877
    jStream := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3878
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3879
    fileNo := self validateFileNo:jStream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3880
    fileNo == 0 ifTrue:[
1000
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3881
        Logger log: 'JAVA: file is already closed'severity: #info facility: 'JVM'.
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3882
        ^ self    "/ already closed
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3883
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3884
    file := self getOpenFileAt:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3885
    file isNil ifTrue:[
1000
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3886
        self halt:'invalid fileNo in close'.
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3887
        self internalError:'invalid fileNo in close'.
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3888
        ^ self
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3889
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3890
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3891
    file == Stdin ifTrue:[
1000
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3892
        file := StdinReplacementFileQuerySignal raiseRequest.
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3893
        file isNil ifTrue:[
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3894
            file := Stdin
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3895
        ]
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3896
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3897
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3898
    "/ should always be bytes
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3899
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3900
    (file ~~ Stdin
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3901
    and:[file ~~ Stdout
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3902
    and:[file ~~ Stderr
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3903
    and:[file ~~ Transcript]]]) ifTrue:[
1000
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3904
        file close.
1238
c7cddd513da6 Few fixes for Tomcat
vranyj1
parents: 1222
diff changeset
  3905
    ] ifFalse:[
c7cddd513da6 Few fixes for Tomcat
vranyj1
parents: 1222
diff changeset
  3906
        self breakPoint: #jv.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3907
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3908
    self setOpenFile:nil at:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3909
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3910
    fileNo := jStream instVarNamed:'fd'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3911
    fileNo isInteger ifFalse:[
1000
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3912
        "/ JDK 1.1.3
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3913
        fileNo instVarNamed:'fd' put:0.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3914
    ] ifTrue:[
1000
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3915
        "/ JDK 1.0
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3916
        jStream instVarNamed:'fd' put:0
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3917
    ].
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3918
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3919
    "Created: / 04-02-1998 / 15:22:03 / cg"
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3920
    "Modified: / 14-10-1998 / 15:10:07 / cg"
1238
c7cddd513da6 Few fixes for Tomcat
vranyj1
parents: 1222
diff changeset
  3921
    "Modified: / 07-12-2011 / 21:20:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3922
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3923
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3924
anyStream_readBytes:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3925
    |bytes offset count stream nRead|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3926
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3927
    bytes := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3928
    offset := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3929
    count := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3930
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3931
    stream := self validateFile:(nativeContext receiver).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3932
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3933
    "/ should always be bytes
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3934
    bytes class isBytes ifFalse:[
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3935
        self halt.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3936
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3937
    stream == Stdin ifTrue:[
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3938
        stream := StdinReplacementFileQuerySignal raiseRequest.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3939
        stream isNil ifTrue:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3940
            ^ -1 "/ 0  EOF
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3941
        ]
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3942
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3943
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3944
    FileIOTrace ifTrue:[
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3945
        ('JAVA: read ' , count printString , ' bytes from ' , stream pathName) infoPrintCR.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3946
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3947
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3948
    stream isPositionable ifFalse:[
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3949
        "/ mhmh - some kind of socket or pipe
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3950
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3951
        stream readWait.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3952
    ].
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3953
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3954
    count == 0 ifTrue:[^0].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3955
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3956
    Stream readErrorSignal handle:[:ex |
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3957
        nRead := -1
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3958
    ] do:[
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3959
        nRead := stream nextAvailableBytes:count into:bytes startingAt:offset+1.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3960
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3961
    nRead == 0 ifTrue:[
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3962
        stream atEnd ifTrue:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3963
            FileIOTrace ifTrue:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3964
                ('JAVA: at EOF ' , nRead printString) infoPrintCR.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3965
            ].
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3966
            ^ -1
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3967
        ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3968
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3969
    count ~~ nRead ifTrue:[
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3970
        FileIOTrace ifTrue:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3971
            ('JAVA: only got ' , nRead printString) infoPrintCR.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3972
        ]
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3973
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3974
    ^ nRead
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3975
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3976
    "Created: / 04-02-1998 / 15:20:00 / cg"
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3977
    "Modified: / 10-11-1998 / 19:56:47 / cg"
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  3978
    "Modified: / 10-08-2011 / 21:35:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3979
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3980
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3981
anyStream_writeBytes:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3982
    |bytes offset count stream|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3983
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3984
    bytes := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3985
    offset := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3986
    count := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3987
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3988
    stream := self validateFile:(nativeContext receiver).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3989
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3990
    FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3991
        stream isFileStream ifTrue:[
1000
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3992
            Logger log: ('write ' , count printString , ' bytes to ' , stream pathName) severity: #info facility: 'JVM'.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3993
        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3994
            stream ~~ Stdout ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3995
                stream ~~ Stderr ifTrue:[
1000
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  3996
                    Logger log: ('write ' , count printString , ' bytes to ' , stream displayString) severity: #info facility: 'JVM'.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3997
                ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3998
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3999
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4000
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4001
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4002
    "/ should always be bytes
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4003
    Stream writeErrorSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4004
        ex return
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4005
    ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4006
        Socket brokenConnectionSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4007
            ex return
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4008
        ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4009
            stream isBinary ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4010
                stream nextPutBytes:count from:bytes startingAt:offset+1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4011
            ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4012
                stream nextPutAll: (bytes asString copyFrom: offset + 1 to: offset + count).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4013
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4014
            
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4015
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4016
        stream == Transcript ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4017
            Transcript endEntry
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4018
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4019
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4020
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4021
    "Created: / 04-02-1998 / 15:23:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4022
    "Modified: / 16-02-1999 / 11:32:45 / cg"
1000
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  4023
    "Modified: / 14-09-2011 / 22:05:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4024
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4025
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4026
checkWritePermissionOfDirectory:dir message:msg
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4027
    |answer|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4028
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4029
    (PermittedDirectories notNil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4030
    and:[PermittedDirectories includes:dir]) ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4031
	FileOpenConfirmation ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4032
	    answer := Dialog 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4033
		    confirmWithCancel:msg withCRs
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4034
			       labels:#('no' 'grant')
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4035
			       values:#(false true)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4036
			      default:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4037
	    answer == false ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4038
		^ false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4039
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4040
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4041
	    (self confirm:('JAVA Security check\\Always permit writes in this directory (''' , dir pathName , ''') ?') withCRs)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4042
	    ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4043
		PermittedDirectories isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4044
		    PermittedDirectories := Set new
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4045
		].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4046
		PermittedDirectories add:dir.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4047
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4048
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4049
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4050
    ^ true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4051
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4052
    "Created: / 3.12.1998 / 15:07:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4053
    "Modified: / 3.12.1998 / 15:16:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4054
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4055
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4056
commonClose:nativeContext
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4057
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4058
    | fdobj fd stream |
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4059
    fdobj := (nativeContext receiver instVarNamed: #fd).
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4060
    fd    := fdobj instVarNamed: #fd.
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  4061
    fd == -1 ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  4062
        "Never opened or already closed"
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  4063
        ^self.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  4064
    ].
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4065
    stream := self getOpenFileAt:fd.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4066
    stream notNil ifTrue:[
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  4067
        stream isView ifTrue:[
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  4068
            self breakPoint: #jv. 
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  4069
        ] ifFalse:[
1257
f0ffc3c928dd Fixes to make it compilable
vranyj1
parents: 1254
diff changeset
  4070
	    (stream ~~ Stdout and:[stream ~~ Stderr and:[stream ~~ Stdin]]) ifTrue:[
f0ffc3c928dd Fixes to make it compilable
vranyj1
parents: 1254
diff changeset
  4071
	        stream close.
f0ffc3c928dd Fixes to make it compilable
vranyj1
parents: 1254
diff changeset
  4072
	    ]
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  4073
        ]
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4074
    ] ifFalse:[
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4075
        self breakPoint: #jv.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4076
    ].
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4077
    self setOpenFile: nil at: fd.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4078
    fdobj instVarNamed:#fd put: -1.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4079
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4080
    "Created: / 10-08-2011 / 14:02:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4081
!
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4082
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4083
commonOpen:nativeContext forAppend:forAppend
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4084
    |fs fd fn name dir stream fileNo answer readonly|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4085
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4086
    fs := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4087
    fd := fs instVarNamed:'fd'.
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4088
    (fd instVarNamed:'fd') ~~ -1 ifTrue:[
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4089
        "/self halt:'file already open'.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4090
        self internalError:'file already open'.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4091
        ^ self.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4092
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4093
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4094
    name := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4095
    name := Java as_ST_String:name.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4096
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4097
    FileOpenTrace ifTrue:[
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4098
        ('JAVA: opening ' , name) infoPrintCR.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4099
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4100
906
fea23aa2b228 Few more fixes and workarounds for Saxon 6.5.5: the Othello example works fine...
vranyj1
parents: 905
diff changeset
  4101
    fn := name utf8Decoded asFilename.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4102
    dir := fn directory pathName.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4103
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4104
    readonly := false.
904
vranyj1
parents: 903
diff changeset
  4105
"/    (PermittedDirectories notNil
vranyj1
parents: 903
diff changeset
  4106
"/    and:[PermittedDirectories includes:dir]) ifFalse:[
vranyj1
parents: 903
diff changeset
  4107
"/        FileOpenConfirmation ifTrue:[
vranyj1
parents: 903
diff changeset
  4108
"/            answer := Dialog 
vranyj1
parents: 903
diff changeset
  4109
"/                    confirmWithCancel:('JAVA Security check\\Opening ''' , name , ''' for read/write.\Grant permission ?') withCRs
vranyj1
parents: 903
diff changeset
  4110
"/                               labels:#('no' 'grant' 'readonly')
vranyj1
parents: 903
diff changeset
  4111
"/                               values:#(false true #readonly)
vranyj1
parents: 903
diff changeset
  4112
"/                              default:3.
vranyj1
parents: 903
diff changeset
  4113
"/            answer == false ifTrue:[
vranyj1
parents: 903
diff changeset
  4114
"/                self throwIOExceptionWithMessage:('no permission to open ' , name , ' for writing').
vranyj1
parents: 903
diff changeset
  4115
"/                ^ self
vranyj1
parents: 903
diff changeset
  4116
"/            ].
vranyj1
parents: 903
diff changeset
  4117
"/            readonly := (answer == #readonly).
vranyj1
parents: 903
diff changeset
  4118
"/
vranyj1
parents: 903
diff changeset
  4119
"/            readonly ifFalse:[
vranyj1
parents: 903
diff changeset
  4120
"/                (self confirm:('JAVA Security check\\Always permit writes in this directory (''' , dir , ''') ?') withCRs)
vranyj1
parents: 903
diff changeset
  4121
"/                ifTrue:[
vranyj1
parents: 903
diff changeset
  4122
"/                    PermittedDirectories isNil ifTrue:[
vranyj1
parents: 903
diff changeset
  4123
"/                        PermittedDirectories := Set new
vranyj1
parents: 903
diff changeset
  4124
"/                    ].
vranyj1
parents: 903
diff changeset
  4125
"/                    PermittedDirectories add:dir.
vranyj1
parents: 903
diff changeset
  4126
"/                ]
vranyj1
parents: 903
diff changeset
  4127
"/            ]
vranyj1
parents: 903
diff changeset
  4128
"/        ]
vranyj1
parents: 903
diff changeset
  4129
"/    ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4130
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4131
    readonly ifTrue:[
904
vranyj1
parents: 903
diff changeset
  4132
        (fn exists and:[fn isReadable not]) ifTrue:[
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4133
            ^self throwFileNotFoundException: 'File is not readable'    
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4134
        ].
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4135
        stream := fn readStream.
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4136
    ] ifFalse:[    
1221
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  4137
"/        fn exists ifFalse:[
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  4138
"/            ^self throwFileNotFoundException: 'File does not exist'
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  4139
"/        ].
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4140
        fn isDirectory ifTrue:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4141
             ^self throwFileNotFoundException: 'File is directory'
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4142
        ].
1221
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  4143
        (fn exists and:[fn isWritable not]) ifTrue:[
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4144
            ^self throwFileNotFoundException: 'File does not writable'    
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4145
        ].
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4146
        forAppend ifTrue:[
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4147
            stream := fn appendingWriteStream.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4148
        ] ifFalse:[
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4149
            stream := fn writeStream.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4150
        ]
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4151
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4152
    stream isNil ifTrue:[
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4153
        self throwIOExceptionWithMessage:('cannot open ' , name , ' for writing').
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4154
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4155
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4156
    fileNo := self addOpenFile:stream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4157
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4158
    FileOpenTrace ifTrue:[
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4159
        ('JAVA: opened ' , name , ' as FD ' , fileNo printString , ' for writing') infoPrintCR.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4160
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4161
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4162
    fd instVarNamed:'fd' put:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4163
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4164
    "Created: / 07-04-1998 / 19:14:09 / cg"
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4165
    "Modified: / 04-01-1999 / 14:34:42 / cg"
1221
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  4166
    "Modified: / 05-12-2011 / 23:15:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4167
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4168
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4169
fileStreamForReading:name
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4170
    |fn stream tryAlongClassPath|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4171
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4172
    FileOpenTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4173
        ('JAVA: opening for read:' , name) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4174
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4175
    fn := name asFilename.
904
vranyj1
parents: 903
diff changeset
  4176
    fn exists  ifFalse:[
vranyj1
parents: 903
diff changeset
  4177
        ^self throwFileNotFoundException: 'File does not exists'
vranyj1
parents: 903
diff changeset
  4178
    ].
vranyj1
parents: 903
diff changeset
  4179
    fn isDirectory ifTrue:[
vranyj1
parents: 903
diff changeset
  4180
        ^self throwFileNotFoundException: 'File is directory'
vranyj1
parents: 903
diff changeset
  4181
    ].
vranyj1
parents: 903
diff changeset
  4182
    fn isReadable  ifFalse:[
vranyj1
parents: 903
diff changeset
  4183
        ^self throwFileNotFoundException: 'File is not readable'
vranyj1
parents: 903
diff changeset
  4184
    ].
vranyj1
parents: 903
diff changeset
  4185
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4186
    stream := fn readStream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4187
    stream notNil ifTrue:[^ stream].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4188
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4189
    fn isAbsolute ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4190
        "/ if not absolute, try along classPath
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4191
        "/ This allows classes to open local files (JEdit)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4192
        "/ even if they have NOT been loaded by a Java classLoader.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4193
        "/ Only do this for image files 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4194
        "/ (and maybe some other config files in the future),
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4195
        "/ to avoid security holes.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4196
        tryAlongClassPath := true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4197
"/        tryAlongClassPath := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4198
"/        (fn hasSuffix:'gif') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4199
"/            tryAlongClassPath := true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4200
"/        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4201
"/        (fn hasSuffix:'jpg') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4202
"/            tryAlongClassPath := true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4203
"/        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4204
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4205
        tryAlongClassPath ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4206
            Java effectiveClassPath do:[:dirName |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4207
                |fn|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4208
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4209
                (fn := dirName asFilename construct:name) exists ifTrue:[
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4210
                    fn isReadable ifFalse:[
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4211
                        self throwFileNotFoundException: 'File is not readable'.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4212
                        ^nil
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4213
                    ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4214
                    stream := fn readStream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4215
                    stream notNil ifTrue:[^ stream].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4216
                ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4217
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4218
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4219
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4220
    ^ nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4221
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4222
    "Modified: / 27-01-1999 / 18:54:46 / cg"
904
vranyj1
parents: 903
diff changeset
  4223
    "Modified: / 10-08-2011 / 19:22:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4224
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4225
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4226
fixFilename:path
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4227
    OperatingSystem isMSDOSlike ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4228
	(#($/ $\) includes:(path at:1)) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4229
	    (path at:3) == $: ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4230
		^ path copyFrom:2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4231
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4232
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4233
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4234
    ^ path
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4235
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4236
    "Created: / 20.10.1998 / 20:58:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4237
    "Modified: / 20.10.1998 / 21:06:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4238
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4239
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4240
validateFile:javaStream
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4241
    |fileNo file descriptor|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4242
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4243
    fileNo := self validateFileNo:javaStream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4244
    fileNo isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4245
"/        self halt:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4246
"/        self internalError:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4247
	self throwIOExceptionWithMessage:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4248
	^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4249
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4250
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4251
    file := self getOpenFileAt:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4252
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4253
    file isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4254
"/        self halt:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4255
"/        self internalError:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4256
	self throwIOExceptionWithMessage:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4257
	^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4258
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4259
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4260
    ^ file
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4261
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4262
    "Created: / 4.1.1998 / 16:50:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4263
    "Modified: / 4.1.1998 / 17:50:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4264
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4265
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4266
validateFileNo:javaStream
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4267
    |fileNo file descriptor|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4268
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4269
    "/ JDK 1.1.3 has fileDescriptor wrapped
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4270
    "/ JDK 1.0 has it directly as integer
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4271
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4272
    fileNo := javaStream instVarNamed:'fd'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4273
    fileNo isInteger ifFalse:[
921
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  4274
        descriptor := fileNo.
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  4275
        descriptor notNil ifTrue:[
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  4276
            fileNo := descriptor instVarNamed:'fd'.
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  4277
            ((fileNo == -1) and:[OperatingSystem isMSWINDOWSlike]) ifTrue:[
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  4278
                fileNo := descriptor instVarNamed:'handle'.
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  4279
            ]
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  4280
        ]
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4281
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4282
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4283
    fileNo isInteger ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4284
"/        self halt:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4285
"/        self internalError:'invalid fileNo in read'.
921
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  4286
        self throwIOExceptionWithMessage:'invalid fileNo in read'.
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  4287
        ^ nil
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4288
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4289
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4290
    ^ fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4291
921
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  4292
    "Created: / 04-01-1998 / 17:49:08 / cg"
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  4293
    "Modified: / 13-01-1998 / 14:07:47 / cg"
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  4294
    "Modified: / 18-08-2011 / 20:03:37 / jv"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4295
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4296
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4297
!JavaVM class methodsFor:'helpers - reflection'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4298
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4299
classForJavaClassObject:aJavaClassObject 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4300
    "given java.lang.class instance, return the real class for it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4301
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4302
    ^ self reflection classForJavaClassObject:aJavaClassObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4303
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4304
    "Created: / 23-01-1998 / 17:44:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4305
    "Modified: / 03-02-2011 / 21:33:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4306
    "Modified: / 09-02-2011 / 01:02:17 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4307
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4308
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  4309
javaClassObjectForClass: aClass 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4310
    "given a real class, return the corresponding java.lang.class
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4311
     instance for it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4312
    
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  4313
    | class |
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4314
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4315
    "find reflection of StClass in the Java World"
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  4316
    (JavaObjectDictionary new hasReflection: aClass name) ifTrue: [
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  4317
        class := JavaObjectDictionary new reflectionOf: aClass name
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  4318
    ] ifFalse: [ class := aClass. ].
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  4319
    ^ self reflection javaClassObjectForClass: class.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4320
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4321
    "Created: / 23-01-1998 / 17:43:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4322
    "Modified: / 05-12-1998 / 15:29:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4323
    "Modified: / 17-01-2011 / 19:24:22 / kursjan <kursjan@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4324
    "Modified: / 28-01-2011 / 14:31:25 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4325
    "Modified: / 03-02-2011 / 21:31:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4326
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4327
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4328
javaConstructorObjectForMethod:method 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4329
    "given a real method, return the corresponding java.lang.reflect.Constructor
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4330
     instance for it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4331
    self breakPoint:#mh info:'refactor my sender to call reflection directly'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4332
    ^ self reflection javaConstructorObjectForMethod: method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4333
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4334
    "Modified: / 09-02-2011 / 00:58:09 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4335
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4336
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4337
javaFieldObjectForField: aJavaField in: aJavaLangClass 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4338
    "given a java field, return the corresponding java.lang.Field
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4339
     instance for it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4340
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4341
        See OpenJDK7 source:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4342
        jdk7/hotspot/src/share/vm/runtime/reflection.cpp,
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4343
        oop Reflection::new_field"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4344
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4345
    | field  clazz  name  slot  type  modifiers |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4346
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4347
    clazz := aJavaLangClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4348
    name := self reflection javaStringObjectForString: aJavaField name
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4349
                interned: true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4350
    slot := aJavaField index.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4351
    type := self javaClassObjectForClass: aJavaField typeClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4352
    modifiers := aJavaField accessFlags.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  4353
    field := (self classForName: 'java.lang.reflect.Field') new.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4354
    field
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4355
        instVarNamed: #clazz put: clazz;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4356
        instVarNamed: #name put: name;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4357
        instVarNamed: #slot put: slot;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4358
        instVarNamed: #type put: type;
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  4359
        instVarNamed: #modifiers put: modifiers;
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4360
        yourself.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  4361
    aJavaField annotations 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  4362
        ifNotNil: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  4363
            field instVarNamed: #annotations
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  4364
                put: aJavaField annotations runtimeVisible rawAnnotations
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  4365
        ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4366
    ^ field.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4367
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4368
    "Modified: / 05-12-1998 / 15:29:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4369
    "Created: / 22-11-2010 / 17:01:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4370
    "Modified: / 09-02-2011 / 01:06:20 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4371
    "Modified: / 01-04-2011 / 12:11:11 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  4372
    "Modified: / 25-04-2011 / 20:23:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4373
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4374
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4375
javaMethodObjectForMethod:method 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4376
    "given a real method, return the corresponding java.lang.reflect.Constructor
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4377
     instance for it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4378
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4379
    ^ self reflection javaMethodObjectForMethod:method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4380
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4381
    "Modified: / 28-02-2011 / 17:08:36 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4382
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4383
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4384
methodForJavaConstructorObject:constructor 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4385
    "given a java.lang.reflect.Constructor, return the corresponding method
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4386
     it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4387
    self breakPoint:#mh info: 'refactor my sender to call reflection directly'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4388
    ^ self reflection methodForJavaConstructorObject: constructor.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4389
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4390
    "Modified: / 09-02-2011 / 00:59:43 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4391
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4392
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4393
methodForJavaMethodObject:aJavaMethodObject 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4394
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4395
        Given an instance of java.lang.reflect.Method, answers
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4396
        real method associated with it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4397
   ^ self reflection methodForJavaMethodObject:aJavaMethodObject.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4398
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4399
    "Modified: / 07-02-2011 / 09:50:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4400
    "Modified: / 28-02-2011 / 16:58:05 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4401
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  4402
1080
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  4403
!JavaVM class methodsFor:'native - com.sun.management'!
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  4404
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  4405
_com_sun_management_UnixOperatingSystem_initialize: nativeContext
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  4406
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  4407
    <javanative: 'com/sun/management/UnixOperatingSystem' name: 'initialize()V'>
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  4408
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  4409
Logger log: 'mh did not set page_size here, which he should :)' severity:#info facility:#JVM.
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  4410
^self.
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  4411
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  4412
    "Modified: / 03-11-2011 / 18:59:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  4413
! !
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  4414
911
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4415
!JavaVM class methodsFor:'native - java.awt'!
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4416
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4417
_java_awt_AWTEvent_initIDs: nativeContext
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4418
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4419
    <javanative: 'java/awt/AWTEvent' name: 'initIDs'>
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4420
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4421
    "Intentionally left blank"
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4422
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4423
    "Modified: / 12-08-2011 / 19:08:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4424
!
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4425
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  4426
_java_awt_Color_initIDs: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  4427
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  4428
    <javanative: 'java/awt/Color' name: 'initIDs()V'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  4429
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  4430
        "/ new with jdk1.2 ...
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  4431
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  4432
    "Created: / 28.1.1998 / 22:19:23 / cg"
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  4433
!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  4434
911
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4435
_java_awt_Component_initIDs: nativeContext
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4436
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4437
    <javanative: 'java/awt/Component' name: 'initIDs'>
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4438
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4439
        "/ introduced with jdk1.2 ... (sigh)
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4440
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4441
    "Created: / 27.1.1998 / 19:53:29 / cg"
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4442
!
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4443
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4444
_java_awt_Container_initIDs: nativeContext
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4445
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4446
    <javanative: 'java/awt/Container' name: 'initIDs'>
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4447
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4448
    "Intentionally left blank"
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4449
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4450
    "Modified: / 12-08-2011 / 19:09:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4451
!
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4452
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4453
_java_awt_Dimension_initIDs: nativeContext
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4454
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4455
    <javanative: 'java/awt/Dimension' name: 'initIDs'>
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4456
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4457
    "Intentionally left blank"
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4458
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4459
    "Modified: / 12-08-2011 / 19:08:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4460
!
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4461
1247
59574ba88702 making eager resolving less eager - not calling classInit on each class (because then it does not boot :P)
hlopkmar
parents: 1246
diff changeset
  4462
_java_awt_Event_initIDs: nativeContext
59574ba88702 making eager resolving less eager - not calling classInit on each class (because then it does not boot :P)
hlopkmar
parents: 1246
diff changeset
  4463
59574ba88702 making eager resolving less eager - not calling classInit on each class (because then it does not boot :P)
hlopkmar
parents: 1246
diff changeset
  4464
    <javanative: 'java/awt/Event' name: 'initIDs()V'>
59574ba88702 making eager resolving less eager - not calling classInit on each class (because then it does not boot :P)
hlopkmar
parents: 1246
diff changeset
  4465
59574ba88702 making eager resolving less eager - not calling classInit on each class (because then it does not boot :P)
hlopkmar
parents: 1246
diff changeset
  4466
    ^ UnimplementedNativeMethodSignal raise
59574ba88702 making eager resolving less eager - not calling classInit on each class (because then it does not boot :P)
hlopkmar
parents: 1246
diff changeset
  4467
!
59574ba88702 making eager resolving less eager - not calling classInit on each class (because then it does not boot :P)
hlopkmar
parents: 1246
diff changeset
  4468
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  4469
_java_awt_Rectangle_initIDs: nativeContext
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  4470
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  4471
    <javanative: 'java/awt/Rectangle' name: 'initIDs()V'>
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  4472
1053
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  4473
    "Intentionally left blank"
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  4474
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  4475
    "Modified: / 27-10-2011 / 15:07:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  4476
!
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  4477
911
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4478
_java_awt_Toolkit_initIDs: nativeContext
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4479
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4480
    <javanative: 'java/awt/Toolkit' name: 'initIDs'>
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4481
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4482
        "/ introduced with jdk1.2 ... (sigh)
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4483
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4484
    "Created: / 27.1.1998 / 19:53:50 / cg"
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4485
! !
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  4486
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4487
!JavaVM class methodsFor:'native - java.io'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4488
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4489
_java_io_FileDescriptor_initIDs: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4490
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4491
    <javanative: 'java/io/FileDescriptor' name: 'initIDs'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4492
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4493
        "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4494
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4495
    "Created: / 27.1.1998 / 18:16:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4496
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4497
919
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  4498
_java_io_FileDescriptor_set: nativeContext
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  4499
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  4500
    <javanative: 'java/io/FileDescriptor' name: 'set(I)J'>
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  4501
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  4502
    "SunJDK Speciofic method, we don't need handles, so return
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  4503
     FD instead"
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  4504
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  4505
    ^nativeContext argAt:1
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  4506
921
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  4507
    "Modified: / 18-08-2011 / 19:54:36 / jv"
919
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  4508
!
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  4509
904
vranyj1
parents: 903
diff changeset
  4510
_java_io_FileDescriptor_sync: nativeContext
vranyj1
parents: 903
diff changeset
  4511
vranyj1
parents: 903
diff changeset
  4512
    <javanative: 'java/io/FileDescriptor' name: 'sync'>
vranyj1
parents: 903
diff changeset
  4513
    "
vranyj1
parents: 903
diff changeset
  4514
    /**
vranyj1
parents: 903
diff changeset
  4515
    * Force all system buffers to synchronize with the underlying
vranyj1
parents: 903
diff changeset
  4516
    * device.  This method returns after all modified data and
vranyj1
parents: 903
diff changeset
  4517
    * attributes of this FileDescriptor have been written to the
vranyj1
parents: 903
diff changeset
  4518
    * relevant device(s).  In particular, if this FileDescriptor
vranyj1
parents: 903
diff changeset
  4519
    * refers to a physical storage medium, such as a file in a file
vranyj1
parents: 903
diff changeset
  4520
    * system, sync will not return until all in-memory modified copies
vranyj1
parents: 903
diff changeset
  4521
    * of buffers associated with this FileDescriptor have been
vranyj1
parents: 903
diff changeset
  4522
    * written to the physical medium.
vranyj1
parents: 903
diff changeset
  4523
    *
vranyj1
parents: 903
diff changeset
  4524
    * sync is meant to be used by code that requires physical
vranyj1
parents: 903
diff changeset
  4525
    * storage (such as a file) to be in a known state  For
vranyj1
parents: 903
diff changeset
  4526
    * example, a class that provided a simple transaction facility
vranyj1
parents: 903
diff changeset
  4527
    * might use sync to ensure that all changes to a file caused
vranyj1
parents: 903
diff changeset
  4528
    * by a given transaction were recorded on a storage medium.
vranyj1
parents: 903
diff changeset
  4529
    *
vranyj1
parents: 903
diff changeset
  4530
    * sync only affects buffers downstream of this FileDescriptor.  If
vranyj1
parents: 903
diff changeset
  4531
    * any in-memory buffering is being done by the application (for
vranyj1
parents: 903
diff changeset
  4532
    * example, by a BufferedOutputStream object), those buffers must
vranyj1
parents: 903
diff changeset
  4533
    * be flushed into the FileDescriptor (for example, by invoking
vranyj1
parents: 903
diff changeset
  4534
    * OutputStream.flush) before that data will be affected by sync.
vranyj1
parents: 903
diff changeset
  4535
    *
vranyj1
parents: 903
diff changeset
  4536
    * @exception SyncFailedException
vranyj1
parents: 903
diff changeset
  4537
    *        Thrown when the buffers cannot be flushed,
vranyj1
parents: 903
diff changeset
  4538
    *        or because the system cannot guarantee that all the
vranyj1
parents: 903
diff changeset
  4539
    *        buffers have been synchronized with physical media.
vranyj1
parents: 903
diff changeset
  4540
    * @since     JDK1.1
vranyj1
parents: 903
diff changeset
  4541
    */
vranyj1
parents: 903
diff changeset
  4542
    public native void sync() throws SyncFailedException;
vranyj1
parents: 903
diff changeset
  4543
    "
vranyj1
parents: 903
diff changeset
  4544
vranyj1
parents: 903
diff changeset
  4545
    OpenFileTable do:[:stream|
vranyj1
parents: 903
diff changeset
  4546
        stream notNil ifTrue:[stream flush].
vranyj1
parents: 903
diff changeset
  4547
    ].
vranyj1
parents: 903
diff changeset
  4548
vranyj1
parents: 903
diff changeset
  4549
    "Created: / 12-11-1998 / 19:26:25 / cg"
vranyj1
parents: 903
diff changeset
  4550
    "Modified (format): / 10-08-2011 / 19:04:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vranyj1
parents: 903
diff changeset
  4551
!
vranyj1
parents: 903
diff changeset
  4552
883
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4553
_java_io_FileInputStream_available: nativeContext
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4554
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4555
    <javanative: 'java/io/FileInputStream' name: 'available'>
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4556
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4557
        |file|
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4558
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4559
    file := self validateFile:(nativeContext receiver).
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4560
    file isNil ifTrue:[
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4561
	self throwIOExceptionWithMessage:'invalid fileNo in available'.
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4562
	^ self
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4563
    ].
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4564
    file == Stdin ifTrue:[
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4565
	file := StdinReplacementFileQuerySignal raiseRequest.
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4566
	file isNil ifTrue:[
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4567
	    ^ 1
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4568
	]
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4569
    ].
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4570
    file isFileStream ifTrue:[
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4571
	^ file size - file position + 1
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4572
    ].
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4573
    file atEnd ifTrue:[
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4574
	^ 0.
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4575
    ].
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4576
    self halt.
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4577
    ^ 1
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4578
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4579
    "Modified: / 14.1.1998 / 15:12:52 / cg"
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4580
!
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4581
898
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  4582
_java_io_FileInputStream_close0: nativeContext
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  4583
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  4584
    <javanative: 'java/io/FileInputStream' name: 'close0'>
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  4585
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4586
    ^self commonClose: nativeContext
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4587
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4588
    "Modified: / 10-08-2011 / 14:03:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
898
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  4589
!
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  4590
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4591
_java_io_FileInputStream_initIDs: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4592
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4593
    <javanative: 'java/io/FileInputStream' name: 'initIDs'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4594
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4595
        "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4596
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4597
    "Created: / 27.1.1998 / 18:15:51 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4598
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4599
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4600
_java_io_FileInputStream_open: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4601
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4602
    <javanative: 'java/io/FileInputStream' name: 'open'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4603
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4604
        |fs fd fn name stream fileNo|
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4605
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4606
    fs := nativeContext receiver.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4607
    fd := fs instVarNamed:'fd'.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4608
    (fileNo := fd instVarNamed:'fd') ~~ 0 ifTrue:[
904
vranyj1
parents: 903
diff changeset
  4609
        fileNo ~~ -1 ifTrue:[
vranyj1
parents: 903
diff changeset
  4610
            self halt:'file already open'.
vranyj1
parents: 903
diff changeset
  4611
            self internalError:'file already open'.
vranyj1
parents: 903
diff changeset
  4612
            ^ self.
vranyj1
parents: 903
diff changeset
  4613
        ]
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4614
    ].
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4615
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4616
    name := nativeContext argAt:1.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4617
    name := Java as_ST_String:name.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4618
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4619
    name := self fixFilename:name.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4620
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4621
    FileOpenTrace ifTrue:[
904
vranyj1
parents: 903
diff changeset
  4622
        ('JAVA: opening ' , name) infoPrintCR.
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4623
    ].
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4624
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4625
    stream := self fileStreamForReading:name.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4626
    stream isNil ifTrue:[
904
vranyj1
parents: 903
diff changeset
  4627
        ^ self.
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4628
    ].
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4629
    stream buffered:false.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4630
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4631
"/    FileOpenConfirmation ifTrue:[
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4632
"/        (self confirm:('JAVA Security check\\Opening ''' , name , ''' for reading.\Grant permission ?') withCRs)
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4633
"/        ifFalse:[
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4634
"/            self throwIOExceptionWithMessage:('no permission to open ' , name , ' for reading').
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4635
"/            ^ self
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4636
"/        ]
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4637
"/    ].
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4638
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4639
    fileNo := self addOpenFile:stream.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4640
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4641
    FileOpenTrace ifTrue:[
904
vranyj1
parents: 903
diff changeset
  4642
        ('JAVA: opened ' , name , ' as FD ' , fileNo printString) infoPrintCR.
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4643
    ].
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4644
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4645
    fd instVarNamed:'fd' put:fileNo.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4646
904
vranyj1
parents: 903
diff changeset
  4647
    "Created: / 04-01-1998 / 16:47:12 / cg"
vranyj1
parents: 903
diff changeset
  4648
    "Modified: / 28-01-1999 / 17:24:07 / cg"
vranyj1
parents: 903
diff changeset
  4649
    "Modified: / 10-08-2011 / 19:21:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4650
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4651
948
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4652
_java_io_FileInputStream_read: nativeContext
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4653
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4654
    <javanative: 'java/io/FileInputStream' name: 'read()I'>
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4655
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4656
        |file byte|
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4657
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4658
    file := self validateFile:(nativeContext receiver).
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4659
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4660
    file == Stdin ifTrue:[
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4661
	file := StdinReplacementFileQuerySignal raiseRequest.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4662
	file isNil ifTrue:[
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4663
	    ^ -1
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4664
	]
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4665
    ].
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4666
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4667
    FileIOTrace ifTrue:[
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4668
	('JAVA: read 1 byte from ' , file pathName) infoPrintCR.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4669
    ].
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4670
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4671
    byte := file nextByte.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4672
    byte isNil ifTrue:[
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4673
	^ -1
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4674
    ].
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4675
    ^ byte
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4676
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4677
    "Created: / 5.1.1998 / 02:17:08 / cg"
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4678
    "Modified: / 5.1.1998 / 02:17:25 / cg"
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4679
!
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4680
883
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4681
_java_io_FileInputStream_readBytes: nativeContext
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4682
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4683
    <javanative: 'java/io/FileInputStream' name: 'readBytes'>
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4684
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4685
    ^ self anyStream_readBytes:nativeContext
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4686
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4687
    "Modified: / 04-02-1998 / 15:23:08 / cg"
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4688
    "Modified (format): / 10-08-2011 / 21:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
883
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4689
!
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  4690
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4691
_java_io_FileOutputStream_close0: nativeContext
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4692
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4693
    <javanative: 'java/io/FileOutputStream' name: 'close0'>
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4694
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4695
    ^self commonClose: nativeContext
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4696
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4697
    "Modified: / 10-08-2011 / 14:03:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4698
!
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4699
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4700
_java_io_FileOutputStream_initIDs: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4701
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4702
    <javanative: 'java/io/FileOutputStream' name: 'initIDs'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4703
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4704
        "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4705
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4706
    "Created: / 27.1.1998 / 18:16:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4707
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4708
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4709
_java_io_FileOutputStream_open: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4710
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4711
    <javanative: 'java/io/FileOutputStream' name: 'open'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4712
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4713
    ^ self commonOpen:nativeContext forAppend:false
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4714
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4715
    "Modified: / 07-04-1998 / 19:14:31 / cg"
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4716
    "Modified (format): / 10-08-2011 / 14:25:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4717
!
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4718
903
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  4719
_java_io_FileOutputStream_openAppend: nativeContext
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  4720
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  4721
    <javanative: 'java/io/FileOutputStream' name: 'openAppend'>
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  4722
906
fea23aa2b228 Few more fixes and workarounds for Saxon 6.5.5: the Othello example works fine...
vranyj1
parents: 905
diff changeset
  4723
    ^ self commonOpen:nativeContext forAppend:true
fea23aa2b228 Few more fixes and workarounds for Saxon 6.5.5: the Othello example works fine...
vranyj1
parents: 905
diff changeset
  4724
fea23aa2b228 Few more fixes and workarounds for Saxon 6.5.5: the Othello example works fine...
vranyj1
parents: 905
diff changeset
  4725
    "Modified: / 07-04-1998 / 19:13:42 / cg"
fea23aa2b228 Few more fixes and workarounds for Saxon 6.5.5: the Othello example works fine...
vranyj1
parents: 905
diff changeset
  4726
    "Modified (format): / 10-08-2011 / 23:48:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
903
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  4727
!
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  4728
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4729
_java_io_FileOutputStream_write: nativeContext
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4730
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4731
    <javanative: 'java/io/FileOutputStream' name: 'write'>
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4732
    "
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4733
     /**
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4734
     * Writes the specified byte to this file output stream. Implements
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4735
     * the <code>write</code> method of <code>OutputStream</code>.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4736
     *
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4737
     * @param      b   the byte to be written.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4738
     * @exception  IOException  if an I/O error occurs.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4739
     */
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4740
     public native void write(int b) throws IOException;
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4741
    "
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4742
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4743
    | fdobj fd stream b |
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4744
    b := nativeContext argAt:1.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4745
    fdobj := (nativeContext receiver instVarNamed: #fd).
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4746
    fd    := fdobj instVarNamed: #fd.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4747
    stream := self getOpenFileAt:fd.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4748
    [
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4749
        stream nextPut: b asCharacter
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4750
    ] on: Error do:[:ex|
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4751
        self throwIOExceptionWithMessage: ex description
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4752
    ]
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4753
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4754
    "Modified: / 10-08-2011 / 14:15:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4755
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4756
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4757
_java_io_FileOutputStream_writeBytes: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4758
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4759
    <javanative: 'java/io/FileOutputStream' name: 'writeBytes'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4760
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4761
        ^ self anyStream_writeBytes:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4762
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4763
    "Modified: / 4.2.1998 / 15:24:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4764
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4765
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  4766
_java_io_FileSystem_getFileSystem: aJavaContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4767
    <javanative: 'java/io/FileSystem' name: 'getFileSystem'>
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  4768
    OperatingSystem isUNIXlike ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  4769
        ^ (self classForName: 'java.io.UnixFileSystem') new
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  4770
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  4771
    OperatingSystem isMSWINDOWSlike ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  4772
        ^ (Java classForName: 'java.io.WinNTFileSystem') new
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  4773
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  4774
    self error: 'Unknown/Unsupported platform'
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4775
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4776
    "Created: / 09-12-2010 / 17:58:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4777
    "Modified: / 01-04-2011 / 18:09:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4778
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4779
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4780
_java_io_ObjectInputStream_latestUserDefinedLoader: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4781
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4782
    <javanative: 'java/io/ObjectInputStream' name: 'latestUserDefinedLoader'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4783
900
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4784
    "
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4785
    /**
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4786
    * Returns the first non-null class loader (not counting class loaders of
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4787
    * generated reflection implementation classes) up the execution stack, or
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4788
    * null if only code from the null class loader is on the stack.  This
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4789
    * method is also called via reflection by the following RMI-IIOP class:
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4790
    *
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4791
    *     com.sun.corba.se.internal.util.JDKClassLoader
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4792
    *
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4793
    * This method should not be removed or its signature changed without
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4794
    * corresponding modifications to the above class.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4795
    */
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4796
    // REMIND: change name to something more accurate?
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4797
    private static native ClassLoader latestUserDefinedLoader();
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4798
    "
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4799
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4800
    | ctx cl |
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4801
    ctx := nativeContext.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4802
    [ ctx notNil ] whileTrue:[
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4803
        ctx receiver isJavaObject ifTrue:[
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4804
            (cl := ctx receiver class classLoader) notNil ifTrue:[
948
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4805
                "/self breakPoint: #jv info: 'Should not count class loaders of generated reflection implementation classes'.
900
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4806
                "/Please check"
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4807
                ^cl.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4808
            ]                    
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4809
        ].
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4810
        ctx := ctx sender.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4811
    ].
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4812
    ^nil
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4813
948
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
  4814
    "Modified: / 30-08-2011 / 16:00:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4815
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4816
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4817
_java_io_ObjectStreamClass_hasStaticInitializer: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4818
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4819
    <javanative: 'java/io/ObjectStreamClass' name: 'hasStaticInitializer'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4820
900
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4821
    | cls |
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4822
    cls := self reflection classForJavaClassObject: (nativeContext argAt:1).
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4823
    ^(cls includesSelector: #'<clinit>()V') ifTrue:[1] ifFalse:[0]
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4824
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
  4825
    "Modified: / 10-08-2011 / 01:13:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4826
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4827
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4828
_java_io_ObjectStreamClass_initNative: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4829
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4830
    <javanative: 'java/io/ObjectStreamClass' name: 'initNative'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4831
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4832
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4833
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4834
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4835
     * Initializes native code.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4836
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4837
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4838
    "Nothing to do"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4839
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4840
    "Created: / 20-12-2010 / 17:43:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4841
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4842
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4843
_java_io_RandomAccessFile_initIDs: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4844
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4845
    <javanative: 'java/io/RandomAccessFile' name: 'initIDs'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4846
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4847
    "Nothing to do"
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4848
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4849
    "Modified: / 10-08-2011 / 21:49:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4850
!
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4851
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4852
_java_io_RandomAccessFile_open: nativeContext
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4853
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4854
    <javanative: 'java/io/RandomAccessFile' name: 'open'>
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4855
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4856
        |fs fd name dir stream fileNo answer readonly|
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4857
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4858
    readonly := false.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4859
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4860
    fs := nativeContext receiver.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4861
    fd := fs instVarNamed:'fd'.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4862
    (fd instVarNamed:'fd') ~~ 0 ifTrue:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4863
	self halt:'file already open'.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4864
	self internalError:'file already open'.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4865
	^ self.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4866
    ].
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4867
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4868
    name := nativeContext argAt:1.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4869
    name := Java as_ST_String:name.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4870
    name := self fixFilename:name.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4871
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4872
    FileOpenTrace ifTrue:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4873
	('JAVA: opening ' , name) infoPrintCR.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4874
    ].
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4875
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4876
    dir := name asFilename directory pathName.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4877
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4878
    (PermittedDirectories notNil
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4879
    and:[PermittedDirectories includes:dir]) ifFalse:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4880
	FileOpenConfirmation ifTrue:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4881
	    answer := Dialog 
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4882
		    confirmWithCancel:('JAVA Security check\\Opening ''' , name , ''' for read/write.\Grant permission ?') withCRs
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4883
			       labels:#('no' 'grant' 'readonly')
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4884
			       values:#(false true #readonly)
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4885
			      default:3.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4886
	    answer == false ifTrue:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4887
		self throwIOExceptionWithMessage:('no permission to open ' , name , ' for writing').
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4888
		^ self
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4889
	    ].
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4890
	    readonly := (answer == #readonly).
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4891
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4892
	    readonly ifFalse:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4893
		(self confirm:('JAVA Security check\\Always permit writes in this directory (''' , dir , ''') ?') withCRs)
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4894
		ifTrue:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4895
		    PermittedDirectories isNil ifTrue:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4896
			PermittedDirectories := Set new
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4897
		    ].
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4898
		    PermittedDirectories add:dir.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4899
		]
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4900
	    ]
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4901
	]
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4902
    ].
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4903
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4904
    readonly ifTrue:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4905
	stream := name asFilename readStream.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4906
    ] ifFalse:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4907
	stream := name asFilename readWriteStream.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4908
    ].
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4909
    stream isNil ifTrue:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4910
	self throwIOExceptionWithMessage:('cannot open ' , name , ' for writing').
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4911
    ].
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4912
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4913
    fileNo := self addOpenFile:stream.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4914
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4915
    FileOpenTrace ifTrue:[
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4916
	('JAVA: opened ' , name , ' as FD ' , fileNo printString , ' for writing') infoPrintCR.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4917
    ].
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4918
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4919
    fd instVarNamed:'fd' put:fileNo.
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4920
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4921
    "Created: / 4.2.1998 / 00:14:48 / cg"
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  4922
    "Modified: / 12.11.1998 / 21:29:46 / cg"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4923
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4924
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4925
_java_io_UnixFileSystem_canonicalize0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4926
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4927
    <javanative: 'java/io/UnixFileSystem' name: 'canonicalize0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4928
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4929
    |  path |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4930
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4931
    path := Java as_ST_String: (aJavaContext argAt: 1).
906
fea23aa2b228 Few more fixes and workarounds for Saxon 6.5.5: the Othello example works fine...
vranyj1
parents: 905
diff changeset
  4932
    ^(Java as_String: path utf8Encoded asFilename asAbsoluteFilename pathName utf8Decoded)
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4933
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4934
    "Created: / 10-12-2010 / 14:40:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4935
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4936
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4937
_java_io_UnixFileSystem_checkAccess: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4938
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4939
    <javanative: 'java/io/UnixFileSystem' name: 'checkAccess'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4940
899
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4941
    "
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4942
     public static final int ACCESS_READ    = 0x04;
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4943
     public static final int ACCESS_WRITE   = 0x02;
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4944
     public static final int ACCESS_EXECUTE = 0x01;
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4945
    "
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4946
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4947
    | fileobj file access result |
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4948
    fileobj := nativeContext argAt:1.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4949
    file := (Java as_ST_String:(fileobj instVarNamed:#path)) asFilename.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4950
    access := nativeContext argAt:2.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4951
    [
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4952
        access == 16r01 ifTrue:[result := file isExecutable].
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4953
        access == 16r02 ifTrue:[result := file isWritable].
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4954
        access == 16r04 ifTrue:[result := file isReadable].
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4955
    ] on: Error do:[
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4956
        result := false.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4957
    ].
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4958
    ^result ifTrue:[1] ifFalse:[0].
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4959
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4960
    "Modified: / 09-08-2011 / 17:09:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4961
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4962
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4963
_java_io_UnixFileSystem_createDirectory: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4964
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4965
    <javanative: 'java/io/UnixFileSystem' name: 'createDirectory'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4966
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4967
    | fileobj file |
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4968
    fileobj := (nativeContext argAt:1).
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4969
    file := Java as_ST_String: (fileobj instVarNamed:#path).
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4970
    file := file asFilename.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4971
    file exists ifFalse:[
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4972
        [
1221
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  4973
            file recursiveMakeDirectory.
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4974
            ^1.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4975
        ] on: Error do:[:ex|
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4976
            self throwIOExceptionWithMessage:ex description.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4977
        ].
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4978
    ].
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4979
    ^0
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4980
1221
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  4981
    "Modified: / 05-12-2011 / 23:04:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4982
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4983
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4984
_java_io_UnixFileSystem_createFileExclusively: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4985
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4986
    <javanative: 'java/io/UnixFileSystem' name: 'createFileExclusively'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  4987
899
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4988
    | file |
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4989
    file := Java as_ST_String: (nativeContext argAt:1).
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4990
    file := file asFilename.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4991
    file exists ifFalse:[
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4992
        [
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4993
            file createAsEmptyFile
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4994
        ] on: Error do:[:ex|
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4995
            self throwIOExceptionWithMessage:ex description.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  4996
        ].
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4997
        ^1
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4998
    ].
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  4999
    ^0
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5000
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5001
    "Modified: / 10-08-2011 / 13:42:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5002
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5003
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5004
_java_io_UnixFileSystem_delete0: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5005
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5006
    <javanative: 'java/io/UnixFileSystem' name: 'delete0'>
899
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5007
    "
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5008
      /**
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5009
      * Delete the file or directory denoted by the given abstract pathname,
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5010
      * returning <code>true</code> if and only if the operation succeeds.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5011
      */
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5012
      public abstract boolean delete(File f);
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5013
    "
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5014
    | file |
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5015
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5016
    file := (Java as_ST_String: ((nativeContext argAt:1) instVarNamed: #path)) asFilename.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5017
    file exists ifFalse:[^0].
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5018
    ^[
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5019
        file remove.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5020
        true
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5021
    ] on: Error do:[
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5022
        false
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5023
    ]
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5024
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5025
    "Modified: / 09-08-2011 / 17:09:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5026
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5027
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5028
_java_io_UnixFileSystem_getBooleanAttributes0: aJavaContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5029
    <javanative: 'java/io/UnixFileSystem' name: 'getBooleanAttributes0'>
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5030
    | file  path  retval  fileSystemClass |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5031
    retval := 0.
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  5032
    file := (aJavaContext argAt: 1).
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  5033
    path := Java as_ST_String: ((aJavaContext argAt: 1) perform: #'getAbsolutePath()Ljava/lang/String;').
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5034
    fileSystemClass := (self classForName: 'java.io.FileSystem').
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5035
    path asFilename exists ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5036
        retval := retval bitOr: (fileSystemClass instVarNamed: #'BA_EXISTS')
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5037
    ] ifFalse: [ ^ 0. ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5038
    path asFilename isDirectory ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5039
        retval := retval bitOr: (fileSystemClass instVarNamed: #'BA_DIRECTORY')
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5040
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5041
    path asFilename isRegularFile ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5042
        retval := retval bitOr: (fileSystemClass instVarNamed: #'BA_REGULAR')
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5043
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5044
    path asFilename isHidden ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5045
        retval := retval bitOr: (fileSystemClass instVarNamed: #'BA_HIDDEN')
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5046
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5047
    ^ retval
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5048
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5049
    "Modified: / 10-12-2010 / 14:43:31 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5050
    "Created: / 10-12-2010 / 14:46:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5051
    "Modified: / 11-12-2010 / 19:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1075
927aeb3649fc Fix in native method imp -> class loading java tests all pass.. I'm getting drunk tonight :)
hlopkmar
parents: 1073
diff changeset
  5052
    "Modified: / 03-11-2011 / 11:03:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5053
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5054
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5055
_java_io_UnixFileSystem_getLastModifiedTime: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5056
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5057
    <javanative: 'java/io/UnixFileSystem' name: 'getLastModifiedTime'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5058
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5059
        | file  path  retval |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5060
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5061
    retval := 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5062
    file := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5063
    path := Java as_ST_String: (file instVarNamed: #path).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5064
    retval := path asFilename modificationTime asMilliseconds.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5065
    ^ retval
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5066
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5067
    "Modified: / 10-12-2010 / 14:43:31 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5068
    "Modified: / 11-12-2010 / 19:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5069
    "Created: / 27-03-2011 / 15:32:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5070
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5071
898
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  5072
_java_io_UnixFileSystem_getLength: nativeContext
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  5073
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  5074
    <javanative: 'java/io/UnixFileSystem' name: 'getLength'>
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  5075
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  5076
    | file |
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  5077
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  5078
    file := (Java as_ST_String: ((nativeContext argAt:1) instVarNamed: #path)) asFilename.
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  5079
    file exists ifFalse:[^0].
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  5080
    ^file fileSize
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  5081
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  5082
    "Modified: / 09-08-2011 / 15:38:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  5083
!
94eb1038a323 - add native to close InputFileStream
vranyj1
parents: 895
diff changeset
  5084
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5085
_java_io_UnixFileSystem_initIDs: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5086
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5087
    <javanative: 'java/io/UnixFileSystem' name: 'initIDs'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5088
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5089
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5090
    self breakPoint: #libjava
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5091
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5092
    "Created: / 10-12-2010 / 14:47:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5093
    "Modified: / 10-12-2010 / 20:58:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
899
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5094
!
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5095
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5096
_java_io_UnixFileSystem_list: nativeContext
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5097
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5098
    <javanative: 'java/io/UnixFileSystem' name: 'list'>
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5099
    "
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5100
    /**
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5101
    * Returns an array of strings naming the files and directories in the
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5102
    * directory denoted by this abstract pathname.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5103
    *
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5104
    * <p> If this abstract pathname does not denote a directory, then this
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5105
    * method returns {@code null}.  Otherwise an array of strings is
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5106
    * returned, one for each file or directory in the directory.  Names
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5107
    * denoting the directory itself and the directory's parent directory are
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5108
    * not included in the result.  Each string is a file name rather than a
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5109
    * complete path.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5110
    *
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5111
    * <p> There is no guarantee that the name strings in the resulting array
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5112
    * will appear in any specific order; they are not, in particular,
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5113
    * guaranteed to appear in alphabetical order.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5114
    *
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5115
    * @return  An array of strings naming the files and directories in the
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5116
    *          directory denoted by this abstract pathname.  The array will be
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5117
    *          empty if the directory is empty.  Returns {@code null} if
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5118
    *          this abstract pathname does not denote a directory, or if an
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5119
    *          I/O error occurs.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5120
    */
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5121
   "
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5122
    | fileobj file names jnames |
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5123
    fileobj := (nativeContext argAt:1).
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5124
    file := Java as_ST_String: (fileobj instVarNamed:#path).
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5125
    file := file asFilename.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5126
    file exists ifFalse:[^nil].
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5127
    file isDirectory ifFalse:[^nil].
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5128
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5129
    names := file directoryContents.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5130
    jnames := String javaArrayClass new: names size.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5131
    1 to: names size do:[:i|
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5132
        jnames at: i put: (Java as_String:(names at: i))
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5133
    ].
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5134
    ^jnames
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5135
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5136
    "Modified: / 10-08-2011 / 13:28:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5137
!
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5138
1253
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5139
_java_io_UnixFileSystem_rename0: nativeContext
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5140
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5141
    <javanative: 'java/io/UnixFileSystem' name: 'rename0(Ljava/io/File;Ljava/io/File;)Z'>
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5142
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5143
    | file1 file2 |
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5144
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5145
    file1 := (Java as_ST_String: ((nativeContext argAt:1) instVarNamed: #path)) asFilename.
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5146
    file2 := (Java as_ST_String: ((nativeContext argAt:2) instVarNamed: #path)) asFilename.
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5147
    file1 exists ifFalse:[^0].
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5148
    ^[
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5149
        file1 moveTo: file2.
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5150
        true
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5151
    ] on: Error do:[
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5152
        false
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5153
    ]
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5154
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5155
    "Modified: / 09-12-2011 / 20:01:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5156
!
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
  5157
1221
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  5158
_java_io_UnixFileSystem_setLastModifiedTime: nativeContext
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  5159
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  5160
    <javanative: 'java/io/UnixFileSystem' name: 'setLastModifiedTime(Ljava/io/File;J)Z'>
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  5161
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  5162
    | f mtime file |
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  5163
    f := nativeContext argAt: 1.
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  5164
    mtime := nativeContext argAt: 2.
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  5165
    file := (Java as_ST_String: (f instVarNamed: #path)) asFilename.
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  5166
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  5167
    self breakPoint: #jv. "There is no interface for that in St/X"
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  5168
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  5169
    "Modified: / 05-12-2011 / 23:42:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  5170
!
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  5171
899
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5172
_java_io_UnixFileSystem_setPermission: nativeContext
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5173
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5174
    <javanative: 'java/io/UnixFileSystem' name: 'setPermission'>
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5175
    "
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5176
    /**
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5177
     * Set on or off the access permission (to owner only or to all) to the file
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5178
     * or directory denoted by the given abstract pathname, based on the parameters
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5179
     * enable, access and oweronly.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5180
     */
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5181
    public abstract boolean setPermission(File f, int access, boolean enable, boolean owneronly);
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5182
    "
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5183
    | f access enable owneronly file perms |
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5184
    f := nativeContext argAt: 1.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5185
    access := nativeContext argAt: 2.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5186
    enable := (nativeContext argAt: 3) == 1.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5187
    owneronly := (nativeContext argAt: 4) == 1.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5188
    file := (Java as_ST_String: (f instVarNamed: #path)) asFilename.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5189
    "
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5190
    public static final int ACCESS_READ    = 0x04;
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5191
    public static final int ACCESS_WRITE   = 0x02;
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5192
    public static final int ACCESS_EXECUTE = 0x01;
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5193
    "
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5194
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5195
    access == 16r04 ifTrue:[
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5196
        perms := owneronly ifFalse:[#(readUser readGroup readOthers)] ifTrue:[#(readUser)].
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5197
    ].
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5198
    access == 16r02 ifTrue:[
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5199
        perms := owneronly ifFalse:[#(writeUser writeGroup writeOthers)] ifTrue:[#(writeUser)].
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5200
    ].
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5201
    access == 16r01 ifTrue:[
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5202
        perms := owneronly ifFalse:[#(executeUser executeGroup executeOthers)] ifTrue:[#(executeUser)].
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5203
    ].
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5204
    [
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5205
        enable ifTrue:[
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5206
            file addAccessRights: perms
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5207
        ] ifFalse:[
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5208
            file removeAccessRights: perms
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5209
        ].
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5210
        ^ 1.
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5211
    ] on: Error do:[
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5212
        ^ 0
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5213
    ].
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5214
    ^0
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5215
ac6820bae6ff - fixes in TestletTestCaseProxy
vranyj1
parents: 898
diff changeset
  5216
    "Modified: / 09-08-2011 / 17:18:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
901
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5217
!
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5218
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5219
_java_io_UnixFileSystem_setReadOnly: nativeContext
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5220
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5221
    <javanative: 'java/io/UnixFileSystem' name: 'setReadOnly'>
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5222
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5223
    | fileobj file |
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5224
    fileobj := (nativeContext argAt:1).
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5225
    file := Java as_ST_String: (fileobj instVarNamed:#path).
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5226
    file := file asFilename.
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5227
    file exists ifFalse:[^0].
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5228
    [
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5229
        file  removeAccessRights: #(writeUser writeGroup writeOthers).
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5230
        ^1
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5231
    ] on: Error do:[
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5232
        ^0
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5233
    ].
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5234
    ^0
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5235
64a889b68bef - JavaVM: more natives
vranyj1
parents: 900
diff changeset
  5236
    "Modified: / 10-08-2011 / 13:40:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
919
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5237
!
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5238
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5239
_java_io_Win32FileSystem_initIDs: nativeContext
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5240
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5241
    <javanative: 'java/io/Win32FileSystem' name: 'initIDs()V'>
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5242
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5243
    "Intentionally left blank"
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5244
!
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5245
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5246
_java_io_WinNTFileSystem_canonicalize0: aJavaContext
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5247
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5248
    <javanative: 'java/io/WinNTFileSystem' name: 'canonicalize0(Ljava/lang/String;)Ljava/lang/String;'>
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5249
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5250
    
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5251
    |  path |
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5252
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5253
    path := Java as_ST_String: (aJavaContext argAt: 1).
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5254
    ^(Java as_String: path asFilename asAbsoluteFilename pathName)
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5255
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5256
    "Created: / 01-04-2011 / 23:00:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5257
!
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5258
964
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5259
_java_io_WinNTFileSystem_canonicalizeWithPrefix0: nativeContext
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5260
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5261
    <javanative: 'java/io/WinNTFileSystem' name: 'canonicalizeWithPrefix0(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;'>
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5262
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5263
    |  path |
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5264
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5265
    path := Java as_ST_String: (nativeContext argAt: 2).
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5266
    ^(Java as_String: path utf8Encoded asFilename asAbsoluteFilename pathName utf8Decoded)
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5267
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5268
    "Modified: / 01-09-2011 / 21:50:47 / jv"
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5269
!
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5270
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5271
_java_io_WinNTFileSystem_checkAccess: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5272
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5273
    <javanative: 'java/io/WinNTFileSystem' name: 'checkAccess(Ljava/io/File;I)Z'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5274
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5275
    ^ UnimplementedNativeMethodSignal raise
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5276
!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5277
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5278
_java_io_WinNTFileSystem_createDirectory: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5279
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5280
    <javanative: 'java/io/WinNTFileSystem' name: 'createDirectory(Ljava/io/File;)Z'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5281
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5282
    ^ UnimplementedNativeMethodSignal raise
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5283
!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5284
920
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5285
_java_io_WinNTFileSystem_createFileExclusively: nativeContext
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5286
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5287
    <javanative: 'java/io/WinNTFileSystem' name: 'createFileExclusively(Ljava/lang/String;)Z'>
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5288
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5289
    ^ self _java_io_UnixFileSystem_createFileExclusively: nativeContext
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5290
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5291
    "Modified: / 18-08-2011 / 17:26:11 / jv"
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5292
!
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5293
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5294
_java_io_WinNTFileSystem_delete0: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5295
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5296
    <javanative: 'java/io/WinNTFileSystem' name: 'delete0(Ljava/io/File;)Z'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5297
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5298
    ^ UnimplementedNativeMethodSignal raise
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5299
!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  5300
919
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5301
_java_io_WinNTFileSystem_getBooleanAttributes: aJavaContext
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5302
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5303
    <javanative: 'java/io/WinNTFileSystem' name: 'getBooleanAttributes(Ljava/io/File;)I'>
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5304
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5305
    ^ self _java_io_UnixFileSystem_getBooleanAttributes0:aJavaContext
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5306
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
  5307
    "Created: / 01-04-2011 / 18:10:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
920
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5308
!
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5309
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5310
_java_io_WinNTFileSystem_getLastModifiedTime: nativeContext
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5311
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5312
    <javanative: 'java/io/WinNTFileSystem' name: 'getLastModifiedTime(Ljava/io/File;)J'>
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5313
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5314
    ^ self _java_io_UnixFileSystem_getLastModifiedTime: nativeContext
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5315
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5316
    "Modified: / 18-08-2011 / 14:12:07 / jv"
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5317
!
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5318
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5319
_java_io_WinNTFileSystem_getLength: nativeContext
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5320
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5321
    <javanative: 'java/io/WinNTFileSystem' name: 'getLength(Ljava/io/File;)J'>
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5322
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5323
    ^ self _java_io_UnixFileSystem_getLength: nativeContext
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5324
e6e8a96b217c Fixes for Groovy and Saxon
vranyj1
parents: 919
diff changeset
  5325
    "Modified: / 18-08-2011 / 14:15:36 / jv"
964
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5326
!
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5327
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5328
_java_io_WinNTFileSystem_list: nativeContext
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5329
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5330
    <javanative: 'java/io/WinNTFileSystem' name: 'list(Ljava/io/File;)[Ljava/lang/String;'>
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5331
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5332
    ^ self _java_io_UnixFileSystem_list: nativeContext
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5333
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
  5334
    "Modified: / 01-09-2011 / 21:46:37 / jv"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  5335
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  5336
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5337
!JavaVM class methodsFor:'native - java.lang'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5338
1079
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5339
_java_lang_ClassLoader_NativeLibrary_load: nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5340
    <javanative: 'java/lang/ClassLoader$NativeLibrary' name: 'load'>
1079
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5341
    "/ introduced with jdk1.2 ... (sigh)
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5342
    
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5343
    | nativeLoader  jLibName  libName  libHandle  index |
1080
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  5344
  
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5345
    nativeLoader := nativeContext receiver.
1079
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5346
    jLibName := nativeContext argAt: 1.
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5347
    libName := (Java as_ST_String: jLibName) asFilename baseName.
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5348
    (index := SimulatedNativeLibs indexOf: libName) ~~ 0 ifTrue: [
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5349
        "/        ('JAVA: builtIn nativeLibLoad simulated: ' , libName) printNL.
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5350
        nativeLoader instVarNamed: 'handle' put: index.
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5351
        ^ self
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5352
        "/ void
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5353
    ].
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5354
    (LoadedNativeLibs notNil and: [ LoadedNativeLibs includesKey: libName ]) ifTrue: [
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5355
        "/        ('JAVA: native library already loaded: ' , libName) printNL.
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5356
        nativeLoader instVarNamed: 'handle' put: (LoadedNativeLibs at: libName).
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5357
        ^ self
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5358
        "/ void
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5359
    ].
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5360
    (self confirm: 'permission to load native library: ' , libName , ' ?') ifFalse: [
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5361
        ^ self
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5362
    ].
1079
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5363
    self halt.
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5364
    libName asFilename exists ifFalse: [
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5365
        ('JAVA: no file to load nativeLib: ' , libName) printNL.
1079
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5366
        ^ self
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5367
        "/ void
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5368
    ].
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5369
    libHandle := ObjectFileLoader loadLibrary: libName.
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5370
    libHandle isNil ifTrue: [
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5371
        ('JAVA: failed to load nativeLib: ' , libName) printNL.
1079
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5372
        ^ self
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5373
        "/ void
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5374
    ].
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5375
    LoadedNativeLibs isNil ifTrue: [ LoadedNativeLibs := Dictionary new. ].
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5376
    LoadedNativeLibs at: libName put: libHandle.
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5377
    nativeLoader instVarNamed: 'handle' put: (LoadedNativeLibs at: libName).
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5378
    ^ self
0bab665c1e54 simulating libmanagement.so for tomcat
hlopkmar
parents: 1078
diff changeset
  5379
    "/ void
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5380
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5381
    "Modified: / 06-02-1998 / 03:12:17 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5382
    "Created: / 10-12-2010 / 15:11:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1080
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
  5383
    "Modified: / 03-11-2011 / 18:25:08 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5384
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5385
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  5386
_java_lang_ClassLoader_defineClass1: nativeContext 
912
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5387
    <javanative: 'java/lang/ClassLoader' name: 'defineClass1'>
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5388
    "
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  5389
     private native Class defineClass1(String name, byte[] b, int off, int len,
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  5390
                                      ProtectionDomain pd, String source);"
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  5391
    
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  5392
    | className  b  off  len  pd  source  bs  cls |
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  5393
    className := Java as_ST_String: (nativeContext argAt: 1).
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  5394
     "if name starts with java.* or package is signed by something else and we are not signed, throw security exception" "ClassLoadersTest>>testEyeOpeningClassLoaderLoadObject" "18.11. mh revised - they really test it against java., totally ignoring boot class path.. That surpsised me"
1135
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5395
    (className startsWith: 'java.') ifTrue: [
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5396
        self throwSecurityExceptionWith: 'className=' , className
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5397
    ].
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5398
    cls := ClassRegistry 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5399
                classForName: className asSlashedJavaClassName
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5400
                loader: nativeContext receiver
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5401
                ifAbsentPut: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5402
                    b := nativeContext argAt: 2.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5403
                    off := nativeContext argAt: 3.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5404
                    len := nativeContext argAt: 4.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5405
                    pd := nativeContext argAt: 5.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5406
                    source := Java as_ST_String: (nativeContext argAt: 6).
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5407
                    (off = 0 and: [ len = b size ]) ifTrue: [ bs := b readStream ] ifFalse: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5408
                        bs := (b copyFrom: off + 1 to: off + len) readStream
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5409
                    ].
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5410
                    [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5411
                        JavaClassReader classLoaderQuerySignal answer: nativeContext receiver
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5412
                            do: [ cls := JavaClassReader readStream: bs. ]
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5413
                    ] on: JavaClassReader invalidClassFormatSignal
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5414
                            do: [
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5415
                        :ex | 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5416
                        self throwClassFormatError: ex description.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5417
                        ^ nil.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5418
                    ].
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5419
                    self assert: cls classLoader == nativeContext receiver.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5420
                     "FIXME: What to do with source?"
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5421
                    cls.
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5422
                ].
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  5423
    "JavaClassReader classLoaderQuerySignal answer: nativeContext receiver
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  5424
        do: [ cls resolveAll. ]."
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  5425
    ^ self reflection javaClassObjectForClass: cls.
912
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5426
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  5427
    "Modified: / 30-10-2011 / 21:46:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  5428
    "Modified: / 08-12-2011 / 20:56:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
912
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5429
!
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5430
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5431
_java_lang_ClassLoader_findBootstrapClass: nativeContext 
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  5432
    <javanative: 'java/lang/ClassLoader' name: 'findBootstrapClass'>
1053
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  5433
    "Return class loaded by bootstrap (primordial) classloader or null.
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  5434
     See OpenJDK, file src/jdk7/hostspot/src/share/vm/prims/jvm.cpp"
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5435
    
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5436
    | nm  class |
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5437
    nm := Java as_ST_String: (nativeContext argAt: 1).
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5438
    class := ClassRegistry 
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5439
                classForName: nm asSlashedJavaClassName
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5440
                loader: nil
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5441
                ifAbsentPut: [ class := JavaVM usePrimordialCLToLoadClassNamed: nm. ].
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5442
         
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5443
    ^ class notNil 
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5444
        ifTrue: [ self reflection javaClassObjectForClass: class ]
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  5445
        ifFalse: [ self throwClassNotFoundException: nm ].
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  5446
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  5447
    "Modified: / 30-10-2011 / 21:45:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5448
    "Modified: / 02-11-2011 / 20:13:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  5449
!
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  5450
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5451
_java_lang_ClassLoader_findLoadedClass0: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5452
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5453
    <javanative: 'java/lang/ClassLoader' name: 'findLoadedClass0'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5454
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  5455
    "
1053
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  5456
    Return java class object for class with given name
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  5457
    loaded by the receiver or null if not found.
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  5458
    See OpenJDK:
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  5459
        src/jdk7/hostspot/src/share/vm/classfile/systemDictionary.cpp
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  5460
        src/jdk7/hostspot/src/share/vm/prims/jvm.cpp
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  5461
        
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  5462
    "        
1053
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  5463
    | nm class |
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  5464
    nm := Java as_ST_String: (nativeContext argAt:1).
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  5465
    class := ClassRegistry classNamed: nm asSlashedJavaClassName loader: nativeContext receiver.
1053
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  5466
    
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
  5467
    ^class notNil ifTrue: [
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  5468
        self reflection javaClassObjectForClass:class
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  5469
    ] ifFalse:[
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  5470
        nil
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  5471
    ]
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  5472
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  5473
    "Modified: / 30-10-2011 / 21:48:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5474
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5475
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5476
_java_lang_ClassLoader_registerNatives: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5477
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5478
    <javanative: 'java/lang/ClassLoader' name: 'registerNatives'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5479
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5480
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5481
    "Nothing to do"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5482
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5483
    "Created: / 09-11-2010 / 20:55:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5484
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5485
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  5486
_java_lang_ClassLoader_resolveClass0: nativeContext 
913
1781f130b005 signature instvars renamed to descriptor
vranyj1
parents: 912
diff changeset
  5487
    <javanative: 'java/lang/ClassLoader' name: 'resolveClass0'>
1000
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  5488
    "resolve a new class as previously created by defineClass0"
1135
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5489
    "or to be more precise - link class"
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5490
    
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5491
    | jClassLoader  jCls  cls |
913
1781f130b005 signature instvars renamed to descriptor
vranyj1
parents: 912
diff changeset
  5492
    jClassLoader := nativeContext receiver.
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  5493
    jCls := nativeContext argAt: 1.
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  5494
    jCls isNil ifTrue: [
1135
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5495
        self throwNullPointerException.
913
1781f130b005 signature instvars renamed to descriptor
vranyj1
parents: 912
diff changeset
  5496
        ^ nil
1781f130b005 signature instvars renamed to descriptor
vranyj1
parents: 912
diff changeset
  5497
    ].
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  5498
    cls := self reflection classForJavaClassObject: jCls.
1135
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5499
    self assert: cls notNil.
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  5500
    JavaClassReader classLoaderQuerySignal answer: jClassLoader
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  5501
     do: [ cls resolveAll. ].
1150
c583252c8df9 deleted not valid logging
hlopkmar
parents: 1149
diff changeset
  5502
    ^ cls.
c583252c8df9 deleted not valid logging
hlopkmar
parents: 1149
diff changeset
  5503
1135
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5504
    "
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5505
        Links the specified class.  This (misleadingly named) method may be
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5506
        * used by a class loader to link a class.  If the class <tt>c</tt> has
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5507
        * already been linked, then this method simply returns. Otherwise, the
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5508
        * class is linked as described in the Execution chapter of the <a
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5509
        * href=http://java.sun.com/docs/books/jls/>Java Language
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5510
        * Specification</a>.
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5511
        * </p>
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5512
        *
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5513
        * @param  c
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5514
        *         The class to link
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5515
        *
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5516
        * @throws  NullPointerException
79bdd1501934 java.lang.ClassLoader>>resolveClass0 native method now resolves whole constant pool
hlopkmar
parents: 1131
diff changeset
  5517
         *          If <tt>c</tt> is <tt>null</tt>."
913
1781f130b005 signature instvars renamed to descriptor
vranyj1
parents: 912
diff changeset
  5518
1781f130b005 signature instvars renamed to descriptor
vranyj1
parents: 912
diff changeset
  5519
    "Created: / 07-01-1998 / 13:12:27 / cg"
1781f130b005 signature instvars renamed to descriptor
vranyj1
parents: 912
diff changeset
  5520
    "Modified: / 20-10-1998 / 19:01:57 / cg"
1781f130b005 signature instvars renamed to descriptor
vranyj1
parents: 912
diff changeset
  5521
    "Modified: / 28-01-2011 / 15:28:18 / Marcel Hlopko <hlopik@gmail.com>"
1000
cfa982260238 Lot of debug/info prints rewritten to use Logger
vranyj1
parents: 998
diff changeset
  5522
    "Modified: / 14-09-2011 / 22:14:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  5523
    "Modified: / 08-12-2011 / 20:52:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
913
1781f130b005 signature instvars renamed to descriptor
vranyj1
parents: 912
diff changeset
  5524
!
1781f130b005 signature instvars renamed to descriptor
vranyj1
parents: 912
diff changeset
  5525
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5526
_java_lang_Class_desiredAssertionStatus0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5527
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5528
    <javanative: 'java/lang/Class' name: 'desiredAssertionStatus0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5529
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5530
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5531
    ^AssertionsEnabled == true
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5532
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5533
    "Created: / 24-11-2010 / 08:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5534
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5535
1205
vranyj1
parents: 1204
diff changeset
  5536
_java_lang_Class_forName0:aJavaContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5537
    <javanative: 'java/lang/Class' name: 'forName0'>
1205
vranyj1
parents: 1204
diff changeset
  5538
    |nm initialize loader class descriptor|
vranyj1
parents: 1204
diff changeset
  5539
vranyj1
parents: 1204
diff changeset
  5540
    nm := Java as_ST_String:(aJavaContext argAt:1).
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5541
     "Using Class.forName() to get a primitive type is not allowed"
1205
vranyj1
parents: 1204
diff changeset
  5542
    (nm size == 1 and:[JavaDescriptor baseTypes includesKey:nm first]) ifTrue:[
vranyj1
parents: 1204
diff changeset
  5543
        ^ self throwClassNotFoundException:nm.
vranyj1
parents: 1204
diff changeset
  5544
    ].
vranyj1
parents: 1204
diff changeset
  5545
    (JavaDescriptor baseTypesByTypeName includesKey:nm) ifTrue:[
vranyj1
parents: 1204
diff changeset
  5546
        ^ self throwClassNotFoundException:nm.
vranyj1
parents: 1204
diff changeset
  5547
    ].
vranyj1
parents: 1204
diff changeset
  5548
    initialize := aJavaContext argAt:2.
vranyj1
parents: 1204
diff changeset
  5549
    loader := aJavaContext argAt:3.
vranyj1
parents: 1204
diff changeset
  5550
    JavaClassReader classLoaderQuerySignal answer:loader do:[
vranyj1
parents: 1204
diff changeset
  5551
        (nm first == $[) ifTrue:[
vranyj1
parents: 1204
diff changeset
  5552
            |nms|
vranyj1
parents: 1204
diff changeset
  5553
vranyj1
parents: 1204
diff changeset
  5554
            nms := nm readStream.
vranyj1
parents: 1204
diff changeset
  5555
            descriptor := JavaDescriptor readFrom:nms
vranyj1
parents: 1204
diff changeset
  5556
                        onError:[^ self throwClassNotFoundException:nm].
vranyj1
parents: 1204
diff changeset
  5557
            nms atEnd ifFalse:[
vranyj1
parents: 1204
diff changeset
  5558
                ^ self throwClassNotFoundException:nm
vranyj1
parents: 1204
diff changeset
  5559
            ].
vranyj1
parents: 1204
diff changeset
  5560
            class := descriptor javaClass.
vranyj1
parents: 1204
diff changeset
  5561
        ] ifFalse:[
vranyj1
parents: 1204
diff changeset
  5562
            class := self classForName:nm
vranyj1
parents: 1204
diff changeset
  5563
        ]
vranyj1
parents: 1204
diff changeset
  5564
    ].
vranyj1
parents: 1204
diff changeset
  5565
    class isNil ifTrue:[
vranyj1
parents: 1204
diff changeset
  5566
        ^ self throwClassNotFoundException:nm
vranyj1
parents: 1204
diff changeset
  5567
    ].
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5568
    ((initialize ~~ 0) 
1205
vranyj1
parents: 1204
diff changeset
  5569
        and:[class isJavaArrayClass not and:[class isJavaPrimitiveType not]]) 
vranyj1
parents: 1204
diff changeset
  5570
            ifTrue:[
vranyj1
parents: 1204
diff changeset
  5571
                [class classInit] on:Error do:[self throwExceptionInInitializerError:nm]
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5572
            ].
1205
vranyj1
parents: 1204
diff changeset
  5573
    ^ JavaVM javaClassObjectForClass:class.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5574
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5575
    "Created: / 24-11-2010 / 09:03:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1063
vranyj1
parents: 1062
diff changeset
  5576
    "Modified: / 30-10-2011 / 23:30:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
  5577
    "Modified: / 02-11-2011 / 19:12:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1205
vranyj1
parents: 1204
diff changeset
  5578
    "Modified (format): / 03-12-2011 / 10:49:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5579
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5580
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5581
_java_lang_Class_getClassLoader0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5582
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5583
    <javanative: 'java/lang/Class' name: 'getClassLoader0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5584
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5585
        "get a classes loader"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5586
    
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  5587
    |jClass cls clc loader |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5588
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5589
    jClass := aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5590
    cls := self reflection classForJavaClassObject:jClass.
914
0331f83c542a Fixes for invoke0 native
vranyj1
parents: 913
diff changeset
  5591
    cls isJavaPrimitiveType ifTrue:[^nil].
915
vranyj1
parents: 914
diff changeset
  5592
    [ cls isJavaArrayClass ] whileTrue:[cls := cls javaComponentClass].
1063
vranyj1
parents: 1062
diff changeset
  5593
    cls isJavaPrimitiveType ifTrue:[^nil].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5594
    loader := cls classLoader.
914
0331f83c542a Fixes for invoke0 native
vranyj1
parents: 913
diff changeset
  5595
"/    loader isNil ifTrue:[
0331f83c542a Fixes for invoke0 native
vranyj1
parents: 913
diff changeset
  5596
"/        cls := (Java at:'java/lang/ClassLoader').
0331f83c542a Fixes for invoke0 native
vranyj1
parents: 913
diff changeset
  5597
"/        clc notNil ifTrue:[loader := clc instVarNamed: #scl].
0331f83c542a Fixes for invoke0 native
vranyj1
parents: 913
diff changeset
  5598
"/    ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5599
    ^ loader
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5600
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5601
    "Created: / 25-10-2010 / 22:49:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5602
    "Modified: / 28-01-2011 / 15:18:54 / Marcel Hlopko <hlopik@gmail.com>"
1063
vranyj1
parents: 1062
diff changeset
  5603
    "Modified: / 30-10-2011 / 23:24:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5604
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5605
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5606
_java_lang_Class_getComponentType: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5607
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5608
    <javanative: 'java/lang/Class' name: 'getComponentType'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5609
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5610
        |cls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5611
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5612
    cls := self reflection classForJavaClassObject:(nativeContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5613
    cls isJavaPrimitiveType ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5614
        self breakPoint:#jv.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5615
        ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5616
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5617
    ^ self javaClassObjectForClass:cls javaComponentClass
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5618
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5619
    "Created: / 12-11-1998 / 18:54:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5620
    "Modified: / 20-12-2010 / 22:56:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5621
    "Modified: / 28-01-2011 / 15:18:59 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5622
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5623
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5624
_java_lang_Class_getConstantPool: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5625
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5626
    <javanative: 'java/lang/Class' name: 'getConstantPool'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5627
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5628
        | class |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5629
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5630
    class := self reflection classForJavaClassObject:aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5631
    ^ self reflection javaConstantPoolObjectFor:class constantPool.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5632
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5633
    "Created: / 21-12-2010 / 20:00:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5634
    "Modified: / 28-02-2011 / 18:05:13 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5635
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5636
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5637
_java_lang_Class_getDeclaredClasses0: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5638
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5639
    <javanative: 'java/lang/Class' name: 'getDeclaredClasses0'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5640
960
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5641
    | class innerPrefix inners |
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5642
    class := self reflection classForJavaClassObject: nativeContext receiver.
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5643
    innerPrefix := class name , '$'.                
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5644
    inners := Set new.
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5645
    JAVA allClassesDo:[:cls|
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5646
        (cls name startsWith: innerPrefix) ifTrue:[
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5647
            inners add: (self reflection javaClassObjectForClass: cls)
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5648
        ].
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5649
    ].
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5650
    ^(Java at: 'java.lang.Class') javaArrayClass withAll: inners
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5651
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5652
    "Modified: / 01-09-2011 / 00:09:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5653
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5654
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5655
_java_lang_Class_getDeclaredConstructors0:aJavaContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5656
    <javanative: 'java/lang/Class' name: 'getDeclaredConstructors0'>
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5657
    |class publicOnly constructors|
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5658
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5659
    class := self reflection classForJavaClassObject:(aJavaContext receiver).
960
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5660
    (class isJavaPrimitiveType or:[class isJavaArrayClass]) ifTrue:[
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5661
        ^ (self classForName:'java.lang.reflect.Constructor') javaArrayClass new:0
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5662
    ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5663
    publicOnly := (aJavaContext argAt:1) == 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5664
    constructors := OrderedCollection new.
957
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  5665
    JavaClassReader classLoaderQuerySignal answer: class classLoader do:[
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5666
    class selectorsAndMethodsDo:
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5667
            [:selector :method | 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5668
            (method isJavaMethod and:
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5669
                    [ (selector at:1) == $< and:
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5670
                            [ (selector startsWith:'<init>(') 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5671
                                and:[ publicOnly not or:[ method isPublic ] ] ] ]) 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5672
                ifTrue:
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5673
                    [ constructors add:(self reflection javaConstructorObjectForMethod:method) ] ].
957
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  5674
    ].
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5675
    ^ (self classForName:'java.lang.reflect.Constructor') javaArrayClass 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5676
        withAll:constructors
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5677
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5678
    "Created: / 24-11-2010 / 09:25:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5679
    "Modified: / 09-02-2011 / 01:24:03 / Marcel Hlopko <hlopik@gmail.com>"
960
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5680
    "Modified: / 01-09-2011 / 09:37:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5681
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5682
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5683
_java_lang_Class_getDeclaredFields0:aJavaContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5684
    <javanative: 'java/lang/Class' name: 'getDeclaredFields0'>
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5685
    |javaClassObject class fields publicOnly|
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5686
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5687
    class := self reflection 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5688
                classForJavaClassObject:(javaClassObject := aJavaContext argAt:0).
914
0331f83c542a Fixes for invoke0 native
vranyj1
parents: 913
diff changeset
  5689
    (class isJavaPrimitiveType or:[class isJavaArrayClass]) ifTrue:[
0331f83c542a Fixes for invoke0 native
vranyj1
parents: 913
diff changeset
  5690
        ^(self classForName:'java.lang.reflect.Field') javaArrayClass new:0.
0331f83c542a Fixes for invoke0 native
vranyj1
parents: 913
diff changeset
  5691
    ].
0331f83c542a Fixes for invoke0 native
vranyj1
parents: 913
diff changeset
  5692
    
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5693
    publicOnly := (aJavaContext argAt:1) == 1.
918
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
  5694
    fields := class fields , class staticFields.
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5695
    publicOnly ifTrue:[ fields := fields select:[:f | f isPublic ] ].
957
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  5696
    JavaClassReader classLoaderQuerySignal answer: class classLoader do:[
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5697
    fields := fields 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5698
                collect:[:f | self javaFieldObjectForField:f in:javaClassObject ].
957
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  5699
    ].
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5700
    ^ (self classForName:'java.lang.reflect.Field') javaArrayClass 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5701
        withAll:fields
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5702
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5703
    "Created: / 10-11-2010 / 16:22:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5704
    "Modified: / 28-01-2011 / 15:19:06 / Marcel Hlopko <hlopik@gmail.com>"
957
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  5705
    "Modified: / 31-08-2011 / 22:21:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5706
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5707
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5708
_java_lang_Class_getDeclaredMethods0:aJavaContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5709
    <javanative: 'java/lang/Class' name: 'getDeclaredMethods0'>
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5710
    |class publicOnly methods|
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5711
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5712
    class := self reflection classForJavaClassObject:(aJavaContext receiver).
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5713
    publicOnly := (aJavaContext argAt:1) == 1.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5714
    methods := OrderedCollection new.
960
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5715
    (class isJavaPrimitiveType or:[class isJavaArrayClass]) ifTrue:[
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5716
        ^(self classForName:'java.lang.reflect.Method') javaArrayClass new:0
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5717
    ].
957
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  5718
    JavaClassReader classLoaderQuerySignal answer: class classLoader do:[
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5719
    class selectorsAndMethodsDo:
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5720
            [:selector :method | 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5721
            (method isJavaMethod and:
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5722
                    [ (selector at:1) ~~ $< and:
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5723
                            [ (selector startsWith:'<init>(') not 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5724
                                and:[ publicOnly not or:[ method isPublic ] ] ] ]) 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5725
                ifTrue:[ methods add:(self javaMethodObjectForMethod:method) ] ].
957
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  5726
    ].
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5727
    ^ (self classForName:'java.lang.reflect.Method') javaArrayClass 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5728
        withAll:methods asArray
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5729
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5730
    "Created: / 21-12-2010 / 22:39:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5731
    "Modified: / 28-01-2011 / 15:19:09 / Marcel Hlopko <hlopik@gmail.com>"
837
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
  5732
    "Modified: / 04-06-2011 / 17:07:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
960
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
  5733
    "Modified: / 01-09-2011 / 09:40:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5734
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5735
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5736
_java_lang_Class_getDeclaringClass: nativeContext 
912
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5737
    <javanative: 'java/lang/Class' name: 'getDeclaringClass'>
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5738
    "
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5739
     /**
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5740
     * If the class or interface represented by this {@code Class} object
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5741
     * is a member of another class, returns the {@code Class} object
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5742
     * representing the class in which it was declared.  This method returns
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5743
     * null if this class or interface is not a member of any other class.  If
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5744
     * this {@code Class} object represents an array class, a primitive
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5745
     * type, or void,then this method returns null.
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5746
     *
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5747
     * @return the declaring class for this class
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5748
     * @since JDK1.1
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5749
     */"
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5750
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5751
    | cls  enclosingClsName  enclosingCls |
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5752
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5753
    cls := self reflection classForJavaClassObject: (nativeContext receiver).
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5754
    (cls isJavaPrimitiveType or: [ cls isJavaArrayClass ]) ifTrue: [ ^ nil ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5755
    (cls name includes: $$) ifFalse: [ ^ nil ].
912
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5756
    enclosingClsName := cls name copyTo: (cls name lastIndexOf: $$) - 1.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5757
    enclosingCls := self classForName: enclosingClsName.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5758
    enclosingCls isNil ifTrue: [ self error: 'Cannot fins declaring class' ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  5759
    ^ self reflection javaClassObjectForClass: enclosingCls
912
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5760
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5761
    "Modified: / 13-08-2011 / 02:01:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5762
!
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5763
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5764
_java_lang_Class_getEnclosingMethod0: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5765
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5766
    <javanative: 'java/lang/Class' name: 'getEnclosingMethod0'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5767
914
0331f83c542a Fixes for invoke0 native
vranyj1
parents: 913
diff changeset
  5768
    ^nil "/Not true"
0331f83c542a Fixes for invoke0 native
vranyj1
parents: 913
diff changeset
  5769
0331f83c542a Fixes for invoke0 native
vranyj1
parents: 913
diff changeset
  5770
    "Modified: / 14-08-2011 / 20:05:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5771
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5772
912
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5773
_java_lang_Class_getGenericSignature: nativeContext
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5774
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5775
    <javanative: 'java/lang/Class' name: 'getGenericSignature'>
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5776
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5777
    |cls sig |
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5778
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5779
    cls := self reflection classForJavaClassObject:(nativeContext receiver).
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5780
    (cls isJavaPrimitiveType or:[cls isJavaArrayClass]) ifTrue:[^nil].
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5781
    sig := cls signatureJ.
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5782
    ^sig notNil ifTrue:[
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5783
        Java as_String: sig
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5784
    ] ifFalse:[
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5785
        nil
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5786
    ]
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5787
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5788
    "Modified: / 13-08-2011 / 02:19:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5789
!
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5790
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5791
_java_lang_Class_getInterfaces:nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5792
    <javanative: 'java/lang/Class' name: 'getInterfaces'>
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5793
    |jClass cls interfaces jInterfaces|
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5794
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5795
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5796
    cls := self reflection classForJavaClassObject:jClass.
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  5797
    cls isJavaPrimitiveType ifTrue:[
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  5798
        ^ (self classForName:'java.lang.Class') javaArrayClass new 
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  5799
    ].
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  5800
    cls isJavaArrayClass ifTrue:[
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  5801
        ^ (self classForName:'java.lang.Class') javaArrayClass        
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  5802
            with:(self javaClassObjectForClass:(self classForName: 'java.lang.Cloneable'))
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  5803
            with:(self javaClassObjectForClass:(self classForName: 'java.io.Serializable'))            
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  5804
    ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5805
    interfaces := cls interfaces.
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5806
    interfaces 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5807
        ifNil:[ ^ (self classForName:'java.lang.Class') javaArrayClass new ].
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5808
    jInterfaces := (self classForName:'java.lang.Class') javaArrayClass 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5809
                new:interfaces size.
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5810
    interfaces 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  5811
        withIndexDo:[:iface :idx | jInterfaces at:idx put:(self javaClassObjectForClass:iface) ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5812
    ^ jInterfaces
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5813
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5814
    "Modified: / 28-01-2011 / 15:19:11 / Marcel Hlopko <hlopik@gmail.com>"
1062
69aac7194016 Fixes in classloaders to make Groovy running (again)
vranyj1
parents: 1060
diff changeset
  5815
    "Modified: / 30-10-2011 / 20:04:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5816
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5817
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5818
_java_lang_Class_getModifiers: aJavaContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5819
    <javanative: 'java/lang/Class' name: 'getModifiers'>
1060
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  5820
    | cls modifiers |
912
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
  5821
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5822
    cls := (self reflection classForJavaClassObject: aJavaContext receiver).
1060
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  5823
    (cls isJavaPrimitiveType or: [ cls isJavaArrayClass ]) ifTrue: [ 
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  5824
        modifiers := ACC_ABSTRACT | ACC_FINAL | ACC_PUBLIC 
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  5825
    ] ifFalse: [ 
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  5826
        "According to OpenJDK JVM, strip ACC_SUPER"
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  5827
        modifiers := (cls accessFlags & ACC_SUPER bitInvert) & 16r7FFF.
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  5828
        "JV@2011-10-30: It seems that private inner classes has no
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  5829
         private bit set, sigh"
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  5830
        (modifiers & 16r0007) == 0 ifTrue:[
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  5831
            modifiers := modifiers | ACC_PRIVATE.
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  5832
        ].
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  5833
    ].
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  5834
    ^modifiers
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5835
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5836
    "Created: / 12-11-1998 / 18:54:53 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5837
    "Modified: / 28-01-2011 / 15:19:14 / Marcel Hlopko <hlopik@gmail.com>"
1060
c3ac98001802 Yet another set of hacks for classloaders
vranyj1
parents: 1059
diff changeset
  5838
    "Modified: / 30-10-2011 / 17:26:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5839
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5840
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5841
_java_lang_Class_getName0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5842
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5843
    <javanative: 'java/lang/Class' name: 'getName0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5844
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5845
        |class|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5846
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5847
    class := aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5848
    class := self reflection classForJavaClassObject:aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5849
    ^ self reflection 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5850
        javaStringObjectForString:class javaName
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5851
        interned:true.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5852
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5853
    "Created: / 22-11-2010 / 17:50:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5854
    "Modified: / 09-02-2011 / 01:06:53 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5855
    "Modified: / 25-02-2011 / 19:00:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5856
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5857
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5858
_java_lang_Class_getPrimitiveClass: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5859
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5860
    <javanative: 'java/lang/Class' name: 'getPrimitiveClass'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5861
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5862
        "get a primitive class by name"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5863
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5864
    |jClassName className|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5865
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5866
    jClassName := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5867
    className := Java as_ST_String:jClassName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5868
    (JavaDescriptor baseTypesByTypeName keys includes: className)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5869
        ifFalse:[self throwClassNotFoundException:className].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5870
    ^self reflection javaClassObjectForClassNamed: className
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5871
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5872
    "Created: / 04-01-1998 / 00:46:03 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5873
    "Modified: / 28-01-2011 / 15:30:45 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5874
    "Modified: / 03-02-2011 / 21:43:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5875
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5876
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5877
_java_lang_Class_getProtectionDomain0: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5878
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5879
    <javanative: 'java/lang/Class' name: 'getProtectionDomain0'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5880
903
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  5881
    ^(self reflection classForJavaClassObject: nativeContext receiver)
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  5882
        protectionDomain
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  5883
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  5884
    "Modified: / 10-08-2011 / 15:19:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5885
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5886
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5887
_java_lang_Class_getRawAnnotations: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5888
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5889
    <javanative: 'java/lang/Class' name: 'getRawAnnotations'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5890
1216
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  5891
    |class |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5892
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5893
    class := self reflection classForJavaClassObject:aJavaContext receiver.
1216
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  5894
    class isJavaArrayClass ifTrue:[
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  5895
        ^nil
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  5896
    ].
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  5897
    class isJavaPrimitiveType ifTrue:[
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  5898
        ^nil
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  5899
    ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5900
    ^ class runtimeVisibleAnnotationsAsBytesOrNil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5901
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5902
    "Created: / 21-12-2010 / 19:35:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5903
    "Modified: / 28-01-2011 / 15:19:20 / Marcel Hlopko <hlopik@gmail.com>"
1216
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  5904
    "Modified: / 05-12-2011 / 00:50:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5905
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5906
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5907
_java_lang_Class_getSuperclass: nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5908
    <javanative: 'java/lang/Class' name: 'getSuperclass'>
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5909
    "return a classes superclass"
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5910
    
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5911
    | jClass  cls  superCls |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5912
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5913
    jClass := nativeContext receiver.
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5914
    cls := self reflection classForJavaClassObject: jClass.
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5915
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5916
    cls isJavaPrimitiveType ifTrue: [ ^ nil ].
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5917
    cls isJavaArrayClass ifTrue: [
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5918
        ^ self javaClassObjectForClass: (Java at: 'java.lang.Object')
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5919
    ].
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5920
    cls isInterface ifTrue: [ ^ nil ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5921
    superCls := cls superclass.
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5922
    superCls == JavaObject ifTrue: [ ^ nil. ].
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  5923
    ^ self javaClassObjectForClass: superCls
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5924
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5925
    "Created: / 12-01-1998 / 12:38:36 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5926
    "Modified: / 04-02-1998 / 14:51:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5927
    "Modified: / 28-01-2011 / 14:12:47 / Marcel Hlopko <hlopik@gmail.com>"
915
vranyj1
parents: 914
diff changeset
  5928
    "Modified: / 15-08-2011 / 09:09:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5929
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5930
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5931
_java_lang_Class_isArray: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5932
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5933
    <javanative: 'java/lang/Class' name: 'isArray'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5934
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5935
        ^ (self reflection classForJavaClassObject:nativeContext receiver) isJavaArrayClass 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5936
        ifTrue:[1]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5937
        ifFalse:[0]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5938
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5939
    "Created: / 12-11-1998 / 18:54:24 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5940
    "Modified: / 20-12-2010 / 23:20:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5941
    "Modified: / 28-01-2011 / 15:19:24 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5942
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5943
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5944
_java_lang_Class_isAssignableFrom: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5945
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5946
    <javanative: 'java/lang/Class' name: 'isAssignableFrom'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5947
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5948
        "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5949
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5950
     * Determines if the class or interface represented by this
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5951
     * {@code Class} object is either the same as, or is a superclass or
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5952
     * superinterface of, the class or interface represented by the specified
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5953
     * {@code Class} parameter. It returns {@code true} if so;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5954
     * otherwise it returns {@code false}. If this {@code Class}
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5955
     * object represents a primitive type, this method returns
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5956
     * {@code true} if the specified {@code Class} parameter is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5957
     * exactly this {@code Class} object; otherwise it returns
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5958
     * {@code false}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5959
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5960
     * <p> Specifically, this method tests whether the type represented by the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5961
     * specified {@code Class} parameter can be converted to the type
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5962
     * represented by this {@code Class} object via an identity conversion
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5963
     * or via a widening reference conversion. See <em>The Java Language
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5964
     * Specification</em>, sections 5.1.1 and 5.1.4 , for details.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5965
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5966
     * @param cls the {@code Class} object to be checked
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5967
     * @return the {@code boolean} value indicating whether objects of the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5968
     * type {@code cls} can be assigned to objects of this class
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5969
     * @exception NullPointerException if the specified Class parameter is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5970
     *            null.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5971
     * @since JDK1.1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5972
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5973
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5974
    | clsObj me other |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5975
    clsObj := nativeContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5976
    clsObj ifNil:[^self throwNullPointerException].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5977
    me := self reflection classForJavaClassObject: nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5978
    other := self reflection classForJavaClassObject: clsObj.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5979
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5980
    "/    Determines if the class or interface represented by this
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5981
    "/    @code Class} object is either the same as, or is a superclass or
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5982
    "/    superinterface of, the class or interface represented by the specified
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5983
    "/    {@code Class} parameter.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5984
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5985
    ^(other includesBehavior: me)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5986
        ifTrue:[1]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5987
        ifFalse:[0]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5988
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5989
    "Created: / 12-11-1998 / 18:54:16 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5990
    "Modified: / 05-02-2011 / 23:38:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5991
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5992
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5993
_java_lang_Class_isInstance: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5994
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5995
    <javanative: 'java/lang/Class' name: 'isInstance'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5996
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5997
        "
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5998
    /**
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  5999
     * Determines if the specified {@code Object} is assignment-compatible
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6000
     * with the object represented by this {@code Class}.  This method is
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6001
     * the dynamic equivalent of the Java language {@code instanceof}
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6002
     * operator. The method returns {@code true} if the specified
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6003
     * {@code Object} argument is non-null and can be cast to the
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6004
     * reference type represented by this {@code Class} object without
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6005
     * raising a {@code ClassCastException.} It returns {@code false}
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6006
     * otherwise.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6007
     *
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6008
     * <p> Specifically, if this {@code Class} object represents a
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6009
     * declared class, this method returns {@code true} if the specified
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6010
     * {@code Object} argument is an instance of the represented class (or
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6011
     * of any of its subclasses); it returns {@code false} otherwise. If
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6012
     * this {@code Class} object represents an array class, this method
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6013
     * returns {@code true} if the specified {@code Object} argument
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6014
     * can be converted to an object of the array class by an identity
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6015
     * conversion or by a widening reference conversion; it returns
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6016
     * {@code false} otherwise. If this {@code Class} object
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6017
     * represents an interface, this method returns {@code true} if the
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6018
     * class or any superclass of the specified {@code Object} argument
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6019
     * implements this interface; it returns {@code false} otherwise. If
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6020
     * this {@code Class} object represents a primitive type, this method
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6021
     * returns {@code false}.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6022
     *
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6023
     * @param   obj the object to check
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6024
     * @return  true if {@code obj} is an instance of this class
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6025
     *
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6026
     * @since JDK1.1
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6027
     */
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6028
    public native boolean isInstance(Object obj);
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6029
    "
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6030
    
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6031
    |jClass cls obj|
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6032
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6033
    obj := nativeContext argAt:1.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6034
    obj isNil ifTrue:[^ 0].
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6035
    jClass := nativeContext receiver.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6036
    cls := self reflection classForJavaClassObject:jClass.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6037
    ^self _INSTANCEOF:obj _:cls
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6038
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6039
    "Modified: / 09-02-1998 / 14:56:23 / cg"
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6040
    "Modified: / 28-01-2011 / 14:12:42 / Marcel Hlopko <hlopik@gmail.com>"
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6041
    "Modified: / 25-02-2011 / 18:37:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6042
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6043
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6044
_java_lang_Class_isInterface: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6045
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6046
    <javanative: 'java/lang/Class' name: 'isInterface'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6047
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6048
        "return true, if this class is an interface"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6049
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6050
    |jClass cls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6051
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6052
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6053
    cls := self reflection classForJavaClassObject:jClass. 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6054
    cls isJavaClass ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6055
        ^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6056
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6057
    cls isInterface ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6058
        ^ 1 "TRUE"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6059
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6060
    ^ 0 "FALSE"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6061
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6062
    "Created: / 12-01-1998 / 12:37:02 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6063
    "Modified: / 28-01-2011 / 14:12:35 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6064
    "Modified: / 03-02-2011 / 21:50:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6065
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6066
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6067
_java_lang_Class_isPrimitive: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6068
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6069
    <javanative: 'java/lang/Class' name: 'isPrimitive'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6070
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6071
        "return true, if this class is builtin primitive class
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6072
     (i.e. byteArray, array, string etc."
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6073
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6074
    |jClass cls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6075
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6076
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6077
    cls := self reflection classForJavaClassObject:jClass. 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6078
    ^cls isJavaPrimitiveType 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6079
        ifTrue:[1"true"]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6080
        ifFalse:[0"false"].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6081
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6082
    "Created: / 09-02-1998 / 14:46:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6083
    "Modified: / 28-01-2011 / 14:12:30 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6084
    "Modified: / 04-02-2011 / 11:56:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6085
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6086
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6087
_java_lang_Class_registerNatives: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6088
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6089
    <javanative: 'java/lang/Class' name: 'registerNatives'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6090
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6091
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6092
     "Nothing to do, native method are bound lazily"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6093
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6094
    "Created: / 20-10-2010 / 11:13:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6095
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6096
903
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  6097
_java_lang_Class_setProtectionDomain0: nativeContext
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  6098
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  6099
    <javanative: 'java/lang/Class' name: 'getProtectionDomain0'>
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  6100
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  6101
    (self reflection classForJavaClassObject: nativeContext receiver)
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  6102
        protectionDomain: (nativeContext argAt:1)
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  6103
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  6104
    "Created: / 10-08-2011 / 15:20:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  6105
!
0c989d6972bc TestletTestCaseProxy: refactored
vranyj1
parents: 901
diff changeset
  6106
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6107
_java_lang_Double_doubleToRawLongBits: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6108
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6109
    <javanative: 'java/lang/Double' name: 'doubleToRawLongBits'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6110
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6111
        "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6112
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6113
     * Returns a representation of the specified floating-point value
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6114
     * according to the IEEE 754 floating-point 'double
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6115
     * format' bit layout, preserving Not-a-Number (NaN) values.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6116
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6117
     * <p>Bit 63 (the bit that is selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6118
     * {@code 0x8000000000000000L}) represents the sign of the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6119
     * floating-point number. Bits
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6120
     * 62-52 (the bits that are selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6121
     * {@code 0x7ff0000000000000L}) represent the exponent. Bits 51-0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6122
     * (the bits that are selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6123
     * {@code 0x000fffffffffffffL}) represent the significand
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6124
     * (sometimes called the mantissa) of the floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6125
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6126
     * <p>If the argument is positive infinity, the result is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6127
     * {@code 0x7ff0000000000000L}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6128
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6129
     * <p>If the argument is negative infinity, the result is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6130
     * {@code 0xfff0000000000000L}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6131
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6132
     * <p>If the argument is NaN, the result is the {@code long}
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6133
     * integer representing the actual NaN value.  Unlike the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6134
     * {@code doubleToLongBits} method,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6135
     * {@code doubleToRawLongBits} does not collapse all the bit
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6136
     * patterns encoding a NaN to a single 'canonical' NaN
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6137
     * value.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6138
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6139
     * <p>In all cases, the result is a {@code long} integer that,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6140
     * when given to the {@link #longBitsToDouble(long)} method, will
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6141
     * produce a floating-point value the same as the argument to
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6142
     * {@code doubleToRawLongBits}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6143
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6144
     * @param   value   a {@code double} precision floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6145
     * @return the bits that represent the floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6146
     * @since 1.3
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6147
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6148
    "
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6149
    | f b |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6150
    f := aJavaContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6151
    (f =  0.0) ifTrue:[^0].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6152
    (f = -0.0) ifTrue:[^(1 bitShift: 63)].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6153
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6154
    b := ByteArray streamContents:[:s|Float storeBinaryIEEEDouble:f on:s].
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6155
    ^ LargeInteger digitBytes: b MSB: UninterpretedBytes isBigEndian not.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6156
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6157
    "Created: / 10-11-2010 / 14:48:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6158
    "Modified: / 07-08-2011 / 21:43:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6159
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6160
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6161
_java_lang_Double_longBitsToDouble: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6162
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6163
    <javanative: 'java/lang/Double' name: 'longBitsToDouble'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6164
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6165
        |i aFloat|
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6166
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6167
    i := nativeContext argAt:1.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6168
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6169
    aFloat := Float new.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6170
    UninterpretedBytes isBigEndian ifTrue:[
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6171
	aFloat basicAt:1 put:((i bitShift:-56) bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6172
	aFloat basicAt:2 put:((i bitShift:-48) bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6173
	aFloat basicAt:3 put:((i bitShift:-40) bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6174
	aFloat basicAt:4 put:((i bitShift:-32) bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6175
	aFloat basicAt:5 put:((i bitShift:-24) bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6176
	aFloat basicAt:6 put:((i bitShift:-16) bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6177
	aFloat basicAt:7 put:((i bitShift:-8) bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6178
	aFloat basicAt:8 put:(i bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6179
    ] ifFalse:[
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6180
	aFloat basicAt:1 put:(i bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6181
	aFloat basicAt:2 put:((i bitShift:-8) bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6182
	aFloat basicAt:3 put:((i bitShift:-16) bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6183
	aFloat basicAt:4 put:((i bitShift:-24) bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6184
	aFloat basicAt:5 put:((i bitShift:-32) bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6185
	aFloat basicAt:6 put:((i bitShift:-40) bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6186
	aFloat basicAt:7 put:((i bitShift:-48) bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6187
	aFloat basicAt:8 put:((i bitShift:-56) bitAnd:16rFF).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6188
    ].
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6189
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6190
    ^ aFloat.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6191
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6192
    "Created: / 4.1.1998 / 01:45:00 / cg"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6193
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6194
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6195
_java_lang_Float_floatToRawIntBits: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6196
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6197
    <javanative: 'java/lang/Float' name: 'floatToRawIntBits'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6198
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6199
        "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6200
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6201
     * Returns a representation of the specified floating-point value
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6202
     * according to the IEEE 754 floating-point 'single format' bit
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6203
     * layout, preserving Not-a-Number (NaN) values.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6204
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6205
     * <p>Bit 31 (the bit that is selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6206
     * {@code 0x80000000}) represents the sign of the floating-point
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6207
     * number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6208
     * Bits 30-23 (the bits that are selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6209
     * {@code 0x7f800000}) represent the exponent.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6210
     * Bits 22-0 (the bits that are selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6211
     * {@code 0x007fffff}) represent the significand (sometimes called
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6212
     * the mantissa) of the floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6213
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6214
     * <p>If the argument is positive infinity, the result is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6215
     * {@code 0x7f800000}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6216
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6217
     * <p>If the argument is negative infinity, the result is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6218
     * {@code 0xff800000}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6219
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6220
     * <p>If the argument is NaN, the result is the integer representing
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6221
     * the actual NaN value.  Unlike the {@code floatToIntBits}
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6222
     * method, {@code floatToRawIntBits} does not collapse all the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6223
     * bit patterns encoding a NaN to a single 'canonical'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6224
     * NaN value.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6225
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6226
     * <p>In all cases, the result is an integer that, when given to the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6227
     * {@link #intBitsToFloat(int)} method, will produce a
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6228
     * floating-point value the same as the argument to
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6229
     * {@code floatToRawIntBits}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6230
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6231
     * @param   value   a floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6232
     * @return the bits that represent the floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6233
     * @since 1.3
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6234
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6235
    "
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6236
    | f b |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6237
    f := aJavaContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6238
    (f =  0.0) ifTrue:[^0].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6239
    (f = -0.0) ifTrue:[^(1 bitShift: 31) ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6240
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6241
    b := ByteArray streamContents:[:s|ShortFloat storeBinaryIEEESingle:f on:s].
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6242
    ^ (LargeInteger digitBytes: b MSB: UninterpretedBytes isBigEndian not) compressed
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6243
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6244
    "Created: / 09-11-2010 / 20:59:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6245
    "Modified: / 07-08-2011 / 21:45:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6246
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6247
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6248
_java_lang_Float_intBitsToFloat: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6249
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6250
    <javanative: 'java/lang/Float' name: 'intBitsToFloat(I)F'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6251
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6252
    |i aFloat|
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6253
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6254
    i := nativeContext argAt:1.
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6255
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6256
    aFloat := ShortFloat basicNew.
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6257
    UninterpretedBytes isBigEndian ifTrue:[
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6258
        aFloat basicAt:1 put:((i bitShift:-24) bitAnd:16rFF).
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6259
        aFloat basicAt:2 put:((i bitShift:-16) bitAnd:16rFF).
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6260
        aFloat basicAt:3 put:((i bitShift:-8) bitAnd:16rFF).
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6261
        aFloat basicAt:4 put:(i bitAnd:16rFF).
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6262
    ] ifFalse:[
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6263
        aFloat basicAt:1 put:(i bitAnd:16rFF).
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6264
        aFloat basicAt:2 put:((i bitShift:-8) bitAnd:16rFF).
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6265
        aFloat basicAt:3 put:((i bitShift:-16) bitAnd:16rFF).
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6266
        aFloat basicAt:4 put:((i bitShift:-24) bitAnd:16rFF).
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6267
    ].
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6268
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6269
    ^ aFloat.
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6270
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6271
    "Modified: / 13-09-2011 / 20:05:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6272
!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6273
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6274
_java_lang_Object_clone: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6275
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6276
    <javanative: 'java/lang/Object' name: 'clone'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6277
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6278
        "clone an object"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6279
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6280
    |o rslt|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6281
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6282
    o := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6283
    rslt := o shallowCopy.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6284
    ^ rslt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6285
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6286
    "Created: / 4.1.1998 / 19:39:26 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6287
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6288
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  6289
_java_lang_Object_getClass: nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6290
    <javanative: 'java/lang/Object' name: 'getClass'>
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  6291
    "return an objects class"
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  6292
    
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  6293
    | o  cls  jClass |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6294
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6295
    o := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6296
    cls := o class.
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
  6297
    jClass := self javaClassObjectForClass: cls.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6298
    ^ jClass
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6299
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6300
    "Created: / 6.1.1998 / 18:28:27 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6301
    "Modified: / 23.1.1998 / 17:48:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6302
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6303
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6304
_java_lang_Object_hashCode: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6305
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6306
    <javanative: 'java/lang/Object' name: 'hashCode'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6307
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6308
        "identityHash"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6309
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6310
    |o rslt|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6311
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6312
    o := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6313
    rslt := o identityHash.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6314
    ^ rslt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6315
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6316
    "Created: / 4.1.1998 / 19:40:26 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6317
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6318
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6319
_java_lang_Object_notify: nativeContext 
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6320
    <javanative: 'java/lang/Object' name: 'notify'>
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6321
    "wakeup"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6322
    
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6323
    self notify: (nativeContext receiver).
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6324
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6325
    "Created: / 06-01-1998 / 21:09:26 / cg"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6326
    "Modified: / 22-11-2011 / 13:24:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6327
!
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6328
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6329
_java_lang_Object_notifyAll: nativeContext 
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6330
    <javanative: 'java/lang/Object' name: 'notifyAll'>
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6331
    self notifyAll: (nativeContext receiver).
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6332
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6333
    "Created: / 03-01-1998 / 03:06:56 / cg"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6334
    "Modified: / 22-11-2011 / 13:27:17 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6335
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6336
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6337
_java_lang_Object_registerNatives: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6338
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6339
    <javanative: 'java/lang/Object' name: 'registerNatives'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6340
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6341
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6342
    "Nothing to do, native method are bound lazily"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6343
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6344
    "Created: / 19-10-2010 / 12:42:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6345
    "Modified: / 20-10-2010 / 10:57:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6346
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6347
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6348
_java_lang_Object_wait: nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6349
    <javanative: 'java/lang/Object' name: 'wait'>
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6350
    | tmo  handle |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6351
    handle := nativeContext receiver.
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6352
    tmo := nativeContext argAt: 1.    
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6353
        self 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6354
            waitOn: handle forTimeout: tmo
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6355
            state: #javaWait.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6356
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6357
    "Modified: / 30-12-1998 / 19:20:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6358
    "Modified: / 01-05-2011 / 13:26:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6359
    "Modified: / 22-11-2011 / 13:17:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6360
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6361
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6362
_java_lang_Package_getSystemPackage0: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6363
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6364
    <javanative: 'java/lang/Package' name: 'getSystemPackage0'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6365
909
4b1bac2cccfb One more native
vranyj1
parents: 908
diff changeset
  6366
    "Based on code on OpenJDK, it is ok to return nil here:"
4b1bac2cccfb One more native
vranyj1
parents: 908
diff changeset
  6367
4b1bac2cccfb One more native
vranyj1
parents: 908
diff changeset
  6368
    ^nil
4b1bac2cccfb One more native
vranyj1
parents: 908
diff changeset
  6369
4b1bac2cccfb One more native
vranyj1
parents: 908
diff changeset
  6370
    "Modified: / 12-08-2011 / 16:00:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6371
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6372
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6373
_java_lang_ProcessEnvironment_environ: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6374
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6375
    <javanative: 'java/lang/ProcessEnvironment' name: 'environ'>
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6376
866
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  6377
    | env jenv i|
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  6378
    env := OperatingSystem getEnvironment.
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  6379
    jenv :=  ByteArray javaArrayClass new: env size * 2.
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  6380
    i := 1.
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  6381
    env keysAndValuesDo:
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  6382
        [:name :value|
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  6383
        jenv 
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  6384
            at: i   put: name  asByteArray;
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  6385
            at: i+1 put: value asByteArray.
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  6386
        i := i + 2].
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  6387
    ^jenv
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  6388
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  6389
    "Modified: / 25-06-2011 / 08:57:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6390
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6391
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6392
_java_lang_ProcessEnvironment_environmentBlock: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6393
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6394
    <javanative: 'java/lang/ProcessEnvironment' name: 'environmentBlock()Ljava/lang/String;'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6395
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6396
    ^ UnimplementedNativeMethodSignal raise
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6397
!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6398
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6399
_java_lang_Runtime_gc: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6400
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6401
    <javanative: 'java/lang/Runtime' name: 'gc'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6402
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6403
        "Runs the garbage collector.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6404
     Ignored, since the ST-gc runs all the time."
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6405
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6406
    ^ self
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6407
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6408
    "Modified: / 12.1.1998 / 12:58:32 / cg"
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6409
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6410
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6411
_java_lang_Runtime_runFinalization0: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6412
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6413
    <javanative: 'java/lang/Runtime' name: 'runFinalization0'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6414
892
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  6415
    Smalltalk garbageCollect
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  6416
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  6417
    "Modified: / 08-08-2011 / 17:48:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6418
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6419
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6420
_java_lang_SecurityManager_getClassContext: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6421
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6422
    <javanative: 'java/lang/SecurityManager' name: 'getClassContext'>
1112
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6423
    "
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6424
    /**
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6425
     * Returns the current execution stack as an array of classes.
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6426
     * <p>
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6427
     * The length of the array is the number of methods on the execution
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6428
     * stack. The element at index <code>0</code> is the class of the
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6429
     * currently executing method, the element at index <code>1</code> is
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6430
     * the class of that method's caller, and so on.
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6431
     *
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6432
     * @return  the execution stack.
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6433
     */
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6434
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6435
    "
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6436
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6437
    | classes ctx jclasses |
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6438
    classes := OrderedCollection new.
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6439
    ctx := thisContext.
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6440
    [ ctx notNil ] whileTrue: [
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6441
        ctx isJavaContext ifTrue:[
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6442
            classes add: ctx method javaClass.
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6443
        ].
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6444
        ctx := ctx sender.
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6445
    ].
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6446
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6447
    jclasses := (self classForName:'java.lang.Class') javaArrayClass new: classes size.
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6448
    1 to: classes size do:[:i|
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6449
        jclasses at: i put: (self reflection javaClassObjectForClass: (classes at: i)).
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6450
    ].
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6451
    ^jclasses
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6452
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6453
    "Created: / 12-11-1998 / 18:56:06 / cg"
1112
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  6454
    "Modified: / 15-11-2011 / 00:27:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6455
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6456
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  6457
_java_lang_Shutdown_halt0: nativeContext
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  6458
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  6459
    <javanative: 'java/lang/Shutdown' name: 'halt0'>
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  6460
1209
vranyj1
parents: 1205
diff changeset
  6461
    self breakPoint: #jv.
1204
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
  6462
    AbortOperationRequest raise
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
  6463
1209
vranyj1
parents: 1205
diff changeset
  6464
    "Modified: / 04-12-2011 / 09:57:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  6465
!
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
  6466
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6467
_java_lang_StrictMath_cbrt: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6468
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6469
    <javanative: 'java/lang/StrictMath' name: 'cbrt'>
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6470
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6471
    ^ JavaMathSupport cbrt: (nativeContext argAt:1)
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6472
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6473
    "Modified: / 07-09-2011 / 17:34:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6474
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6475
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6476
_java_lang_StrictMath_cos: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6477
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6478
    <javanative: 'java/lang/StrictMath' name: 'cos'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6479
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6480
    ^ JavaMathSupport cos: (nativeContext argAt:1)
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6481
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6482
    "Modified: / 07-09-2011 / 17:34:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6483
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6484
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6485
_java_lang_StrictMath_cosh: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6486
981
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6487
    <javanative: 'java/lang/StrictMath' name: 'cosh'>
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6488
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6489
    "
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6490
    /**
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6491
     * Returns the hyperbolic cosine of a {@code double} value.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6492
     * The hyperbolic cosine of <i>x</i> is defined to be
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6493
     * (<i>e<sup>x</sup>&nbsp;+&nbsp;e<sup>-x</sup></i>)/2
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6494
     * where <i>e</i> is {@linkplain Math#E Euler's number}.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6495
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6496
     * <p>Special cases:
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6497
     * <ul>
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6498
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6499
     * <li>If the argument is NaN, then the result is NaN.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6500
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6501
     * <li>If the argument is infinite, then the result is positive
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6502
     * infinity.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6503
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6504
     * <li>If the argument is zero, then the result is {@code 1.0}.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6505
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6506
     * </ul>
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6507
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6508
     * @param   x The number whose hyperbolic cosine is to be returned.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6509
     * @return  The hyperbolic cosine of {@code x}.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6510
     * @since 1.5
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6511
     */
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6512
    public static native double cosh(double x);
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6513
    "
892
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  6514
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6515
    ^JavaMathSupport cosh: (nativeContext argAt:1)
892
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  6516
981
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6517
    "Modified: / 06-09-2011 / 19:25:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6518
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6519
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6520
_java_lang_StrictMath_expm1: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6521
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6522
    <javanative: 'java/lang/StrictMath' name: 'expm1'>
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6523
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6524
    ^ JavaMathSupport expm1: (nativeContext argAt:1)
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6525
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6526
    "Modified: / 07-09-2011 / 17:34:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6527
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6528
895
ddeff39cfdb9 TestletProxy refactored
vranyj1
parents: 892
diff changeset
  6529
_java_lang_StrictMath_floor: nativeContext
ddeff39cfdb9 TestletProxy refactored
vranyj1
parents: 892
diff changeset
  6530
ddeff39cfdb9 TestletProxy refactored
vranyj1
parents: 892
diff changeset
  6531
    <javanative: 'java/lang/StrictMath' name: 'floor'>
ddeff39cfdb9 TestletProxy refactored
vranyj1
parents: 892
diff changeset
  6532
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6533
   ^ JavaMathSupport floor: (nativeContext argAt:1)
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6534
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6535
    "Modified: / 07-09-2011 / 17:33:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6536
!
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6537
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6538
_java_lang_StrictMath_pow: nativeContext
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6539
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6540
    <javanative: 'java/lang/StrictMath' name: 'pow(DD)D'>
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6541
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6542
    ^JavaMathSupport pow: (nativeContext argAt:1) to: (nativeContext argAt:3)
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6543
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6544
    "Modified: / 07-09-2011 / 17:33:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
892
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  6545
!
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  6546
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6547
_java_lang_StrictMath_sin: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6548
892
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  6549
    <javanative: 'java/lang/StrictMath' name: 'cos'>
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  6550
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6551
    ^ JavaMathSupport sin: (nativeContext argAt:1)
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6552
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6553
    "Modified: / 07-09-2011 / 17:32:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6554
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6555
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6556
_java_lang_StrictMath_sinh: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6557
981
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6558
    <javanative: 'java/lang/StrictMath' name: 'sinh'>
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6559
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6560
    "
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6561
    /**
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6562
     * Returns the hyperbolic sine of a {@code double} value.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6563
     * The hyperbolic sine of <i>x</i> is defined to be
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6564
     * (<i>e<sup>x</sup>&nbsp;-&nbsp;e<sup>-x</sup></i>)/2
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6565
     * where <i>e</i> is {@linkplain Math#E Euler's number}.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6566
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6567
     * <p>Special cases:
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6568
     * <ul>
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6569
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6570
     * <li>If the argument is NaN, then the result is NaN.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6571
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6572
     * <li>If the argument is infinite, then the result is an infinity
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6573
     * with the same sign as the argument.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6574
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6575
     * <li>If the argument is zero, then the result is a zero with the
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6576
     * same sign as the argument.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6577
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6578
     * </ul>
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6579
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6580
     * @param   x The number whose hyperbolic sine is to be returned.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6581
     * @return  The hyperbolic sine of {@code x}.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6582
     * @since 1.5
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6583
     */
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6584
    public static native double sinh(double x);
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6585
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6586
    "
892
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  6587
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6588
    ^ JavaMathSupport sinh: (nativeContext argAt:1)
892
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  6589
981
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6590
    "Modified: / 06-09-2011 / 19:36:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6591
    "Modified (format): / 07-09-2011 / 17:31:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6592
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6593
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6594
_java_lang_StrictMath_tanh: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6595
981
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6596
    <javanative: 'java/lang/StrictMath' name: 'tanh'>
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6597
    "
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6598
    /**
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6599
     * Returns the hyperbolic tangent of a {@code double} value.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6600
     * The hyperbolic tangent of <i>x</i> is defined to be
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6601
     * (<i>e<sup>x</sup>&nbsp;-&nbsp;e<sup>-x</sup></i>)/(<i>e<sup>x</sup>&nbsp;+&nbsp;e<sup>-x</sup></i>),
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6602
     * in other words, {@linkplain Math#sinh
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6603
     * sinh(<i>x</i>)}/{@linkplain Math#cosh cosh(<i>x</i>)}.  Note
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6604
     * that the absolute value of the exact tanh is always less than
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6605
     * 1.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6606
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6607
     * <p>Special cases:
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6608
     * <ul>
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6609
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6610
     * <li>If the argument is NaN, then the result is NaN.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6611
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6612
     * <li>If the argument is zero, then the result is a zero with the
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6613
     * same sign as the argument.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6614
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6615
     * <li>If the argument is positive infinity, then the result is
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6616
     * {@code +1.0}.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6617
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6618
     * <li>If the argument is negative infinity, then the result is
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6619
     * {@code -1.0}.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6620
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6621
     * </ul>
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6622
     *
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6623
     * @param   x The number whose hyperbolic tangent is to be returned.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6624
     * @return  The hyperbolic tangent of {@code x}.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6625
     * @since 1.5
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6626
     */
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6627
    public static native double tanh(double x);
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6628
    "
892
d09b90bc4998 Few more primitives
vranyj1
parents: 888
diff changeset
  6629
988
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6630
    ^ JavaMathSupport tanh: (nativeContext argAt:1)
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6631
414a2c9a6a9e Java-style FP math natives and support methods
vranyj1
parents: 985
diff changeset
  6632
    "Modified: / 07-09-2011 / 17:32:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6633
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6634
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6635
_java_lang_String_intern: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6636
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6637
    <javanative: 'java/lang/String' name: 'intern'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6638
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6639
        |jString|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6640
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6641
    jString := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6642
    ^ Java intern:jString
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6643
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6644
1173
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6645
_java_lang_System_arraycopy: nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6646
    <javanative: 'java/lang/System' name: 'arraycopy'>
1173
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6647
    | srcArray  srcIdx  dstArray  dstIdx  srcArrayCC  dstArrayCC  count  dstEndIdx |
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6648
    srcArray := nativeContext argAt: 1.
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6649
    srcArray isNil ifTrue: [ ^ self throwNullPointerException ].     
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6650
    srcArray isJavaArray ifFalse: [ "mh 29.11.11 dirty ugly hack, pretend that java string is char array"
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6651
    (self canCast:srcArray class to: (self classNamed:'java/lang/String')) ifTrue: [srcArray := srcArray instVarNamed: #value] ifFalse: [
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6652
    ^ self throwArrayStoreException: srcArray] ].
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6653
    srcIdx := nativeContext argAt: 2.
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6654
    dstArray := nativeContext argAt: 3.
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6655
    dstArray isNil ifTrue: [ ^ self throwNullPointerException ].
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6656
    dstArray isJavaArray ifFalse: [ ^ self throwArrayStoreException: dstArray ].
864
45d54ed8b273 JavaVM: improvements in java.lang.System.arraycopy native
vranyj1
parents: 859
diff changeset
  6657
    srcArrayCC := srcArray class javaComponentClass.
45d54ed8b273 JavaVM: improvements in java.lang.System.arraycopy native
vranyj1
parents: 859
diff changeset
  6658
    dstArrayCC := dstArray class javaComponentClass.
1173
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6659
    srcArrayCC isJavaPrimitiveType == dstArrayCC isJavaPrimitiveType ifTrue: [
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6660
        srcArrayCC isJavaPrimitiveType ifTrue: [
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6661
            srcArrayCC ~~ dstArrayCC ifTrue: [ ^ self throwArrayStoreException: dstArray ]
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6662
        ].
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6663
    ] ifFalse: [ ^ self throwArrayStoreException: dstArray ].
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6664
    dstIdx := nativeContext argAt: 4.
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6665
    count := nativeContext argAt: 5.
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6666
    count < 0 ifTrue: [
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6667
        ^ self throwArrayIndexOutOfBoundsException: (srcIdx + count - 1)
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6668
    ].
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6669
    ((srcIdx < 0) or: [ srcIdx + count > srcArray size ]) ifTrue: [
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6670
        srcArray size == 0 ifTrue: [
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6671
            srcArray isVariable ifFalse: [ ^ self throwArrayStoreException: srcArray ]
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6672
        ].
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6673
        ^ self throwArrayIndexOutOfBoundsException: (srcIdx + count - 1)
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6674
    ].
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6675
    ((dstIdx < 0) or: [ dstIdx + count > dstArray size ]) ifTrue: [
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6676
        dstArray size == 0 ifTrue: [
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6677
            dstArray isVariable ifFalse: [ ^ self throwArrayStoreException: dstArray ]
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6678
        ].
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6679
        ^ self throwArrayIndexOutOfBoundsException: (dstIdx + count - 1)
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6680
    ].
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6681
    dstEndIdx := dstIdx + count.
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6682
    dstIdx := dstIdx + 1.
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6683
    srcIdx := srcIdx + 1.
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6684
    (srcArray class isBytes and: [ dstArray class isBytes ]) ifTrue: [
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6685
        dstArray 
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6686
            replaceBytesFrom: dstIdx
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6687
            to: dstEndIdx
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6688
            with: srcArray
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6689
            startingAt: srcIdx.
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6690
    ] ifFalse: [
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6691
        dstArrayCC isJavaPrimitiveType ifFalse: [
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6692
            "Copy from array iff src=dst to avoid overwriting a data when copying"
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6693
            srcArray == dstArray ifTrue: [ srcArray := srcArray copy ].
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6694
            1 to: count do: [
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6695
                :i | 
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6696
                | obj |
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6697
                obj := srcArray at: srcIdx + i - 1.
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6698
                (obj notNil and: [ (self canCast: obj class to: dstArrayCC) not ]) ifTrue: [
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6699
                    ^ self throwArrayStoreException: dstArray
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6700
                ].
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6701
                dstArray at: dstIdx + i - 1 put: (srcArray at: srcIdx + i - 1)
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6702
            ]
1173
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6703
        ] ifTrue: [
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6704
            dstArray 
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6705
                replaceFrom: dstIdx
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6706
                to: dstEndIdx
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6707
                with: srcArray
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6708
                startingAt: srcIdx.
981
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
  6709
        ]
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6710
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6711
    ^ nil.
864
45d54ed8b273 JavaVM: improvements in java.lang.System.arraycopy native
vranyj1
parents: 859
diff changeset
  6712
992
6d3e3d937fda Class loader mess cleanup, more will come later...
vranyj1
parents: 988
diff changeset
  6713
    "Modified: / 08-09-2011 / 15:25:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1173
5eefc8f414bd thread>>name mauve test passes
hlopkmar
parents: 1170
diff changeset
  6714
    "Modified: / 29-11-2011 / 12:17:17 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6715
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6716
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6717
_java_lang_System_currentTimeMillis: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6718
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6719
    <javanative: 'java/lang/System' name: 'currentTimeMillis'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6720
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6721
        "return the milliseconds since 1.jan.1970"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6722
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6723
    |delta|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6724
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6725
    "/ workaround win32 bug (use 01:01:01 as base)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6726
    delta := Timestamp now millisecondDeltaFrom:(AbsoluteTime day:1 month:1 year:1970 hour:1 minutes:1 seconds:1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6727
    delta := delta - 3600 - 60 - 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6728
"/    "/ make certain, it fits 64 signed bits
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6729
"/    delta := delta bitAnd:16r7FFFFFFFFFFFFFFF.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6730
"/    ^ delta max:0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6731
    ^ delta
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6732
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6733
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6734
     JavaVM _System_currentTimeMillis:nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6735
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6736
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6737
    "Modified: / 23.12.1998 / 21:54:50 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6738
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6739
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6740
_java_lang_System_identityHashCode: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6741
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6742
    <javanative: 'java/lang/System' name: 'identityHashCode'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6743
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6744
        |obj|
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6745
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6746
    obj := nativeContext argAt:1.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6747
    ^ obj identityHash
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6748
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6749
    "Modified: / 12.11.1998 / 18:52:07 / cg"
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6750
    "Created: / 12.11.1998 / 18:54:00 / cg"
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6751
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6752
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6753
_java_lang_System_initProperties: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6754
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6755
    <javanative: 'java/lang/System' name: 'initProperties'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6756
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6757
        |props stProps|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6758
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6759
    props := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6760
    stProps := self systemProperties.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6762
    "/ recursively invoke myself on the Java HashTable.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6763
    "/ calling 'put' to stuff in the values ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6764
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6765
    stProps keysAndValuesDo:[:key :value |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6766
	|keyObj valueObj|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6767
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6768
	keyObj := Java as_String:key.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6769
	valueObj := Java as_String:value.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6770
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6771
	props 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6772
	    perform:#'put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6773
	    with:keyObj 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6774
	    with:valueObj.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6775
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6776
    ^ props
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6777
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6778
    "Created: / 3.1.1998 / 14:25:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6779
    "Modified: / 4.1.1998 / 14:23:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6780
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6781
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6782
_java_lang_System_mapLibraryName: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6783
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6784
    <javanative: 'java/lang/System' name: 'mapLibraryName'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6785
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6786
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6787
    | name |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6788
    name := Java as_ST_String: (aJavaContext argAt: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6789
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6790
    OperatingSystem isUNIXlike ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6791
        ^Java as_String: ('lib' , name , '.so').
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6792
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6793
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6794
    OperatingSystem isMSWINDOWSlike ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6795
        ^Java as_String: ( name , '.dll').
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6796
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6797
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6798
    self error:'Unknown/Unsupported platform'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6799
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6800
    "Created: / 09-12-2010 / 18:16:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6801
    "Modified: / 01-04-2011 / 18:14:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6802
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6803
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6804
_java_lang_System_nanoTime: nativeContext
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6805
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6806
    <javanative: 'java/lang/System' name: 'nanoTime'>
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6807
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6808
    ^ OperatingSystem getMicrosecondTime * 1000
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6809
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6810
    "Modified: / 07-08-2011 / 21:47:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6811
!
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  6812
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6813
_java_lang_System_registerNatives: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6814
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6815
    <javanative: 'java/lang/System' name: 'registerNatives'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6816
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6817
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6818
    "Nothing to do, native method are bound lazily"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6819
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6820
    "Created: / 20-10-2010 / 10:56:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6821
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6822
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6823
_java_lang_System_setErr0: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6824
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6825
    <javanative: 'java/lang/System' name: 'setErr0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6826
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6827
        |stream|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6828
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6829
    stream := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6830
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6831
    self setOpenFile:(self javaConsoleStream ? Stderr) at:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6832
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6833
    nativeContext receiver instVarNamed:'err' put:stream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6834
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6835
    "Created: / 18.3.1997 / 15:02:05 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6836
    "Modified: / 4.1.1998 / 16:21:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6837
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6838
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6839
_java_lang_System_setIn0: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6840
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6841
    <javanative: 'java/lang/System' name: 'setIn0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6842
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6843
        |stream|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6844
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6845
    stream := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6846
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6847
    self setOpenFile:Stdin at:0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6848
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6849
    nativeContext receiver instVarNamed:'in' put:stream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6850
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6851
    "Created: / 4.1.1998 / 16:16:38 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6852
    "Modified: / 4.1.1998 / 16:20:44 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6853
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6854
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6855
_java_lang_System_setOut0: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6856
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6857
    <javanative: 'java/lang/System' name: 'setOut0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6858
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6859
        |stream|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6860
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6861
    stream := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6862
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6863
    self setOpenFile:(self javaConsoleStream ? Stdout) at:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6864
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6865
    nativeContext receiver instVarNamed:'out' put:stream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6866
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6867
    "Created: / 4.1.1998 / 16:18:26 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6868
    "Modified: / 4.1.1998 / 16:20:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6869
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6870
1249
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  6871
_java_lang_Thread_currentThread: nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6872
    <javanative: 'java/lang/Thread' name: 'currentThread'>
1249
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  6873
    | t  p |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6874
    p := Processor activeProcess.
1249
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  6875
    t := self javaThreadForSTProcess: p.
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  6876
    nativeContext sender receiver class name 
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  6877
        = 'java/util/concurrent/locks/ReentrantLock$NonfairSync' 
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  6878
            ifTrue: [
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  6879
                | owner |
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  6880
                owner := (nativeContext sender receiver 
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  6881
                            perform: #'getExclusiveOwnerThread()Ljava/lang/Thread;').
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  6882
                (owner notNil and: [ owner ~= t ]) ifTrue: [ self breakPoint: #mh. ]
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  6883
            ].
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  6884
    t notNil ifTrue: [ ^ t ].
1213
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
  6885
    t := self newThread: p name.
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
  6886
    t instVarNamed: 'tid' put: p id.
1249
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  6887
    Java addThread: t for: p.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6888
    ^ t
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6889
1213
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
  6890
    "Modified: / 04-12-2011 / 20:11:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1249
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
  6891
    "Modified: / 09-12-2011 / 12:52:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6892
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6893
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
  6894
_java_lang_Thread_holdsLock: aJavaContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6895
    <javanative: 'java/lang/Thread' name: 'holdsLock'>
1248
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  6896
    | obj  mon  thisProcess |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6897
    obj := aJavaContext argAt: 1.
1248
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  6898
    obj isNil ifTrue: [self throwNullPointerException:'null given to _java_lang_Thread_holdsLock'].
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  6899
    mon := self monitorFor: obj.
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  6900
    thisProcess := Processor activeProcess.
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  6901
    (mon isOwnedBy: thisProcess) ifTrue: [ ^ 1 ] ifFalse: [ ^ 0 ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6902
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6903
    "Created: / 30-04-2011 / 22:06:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1248
a9583765fa58 stupid monitor bug fixed, still not enough :/
hlopkmar
parents: 1247
diff changeset
  6904
    "Modified: / 09-12-2011 / 11:13:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6905
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6906
1170
b467c1e2a83f tiny fix for monitors
hlopkmar
parents: 1169
diff changeset
  6907
_java_lang_Thread_interrupt0: nativeContext 
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6908
    <javanative: 'java/lang/Thread' name: 'interrupt0()V'>
1170
b467c1e2a83f tiny fix for monitors
hlopkmar
parents: 1169
diff changeset
  6909
    | jThread  stProcess |
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6910
    jThread := nativeContext receiver.
1170
b467c1e2a83f tiny fix for monitors
hlopkmar
parents: 1169
diff changeset
  6911
    stProcess := self stProcessForJavaThread: jThread.
1183
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
  6912
    self assert: stProcess notNil.
1190
00e22b8b2652 interrupts work much better
hlopkmar
parents: 1189
diff changeset
  6913
    stProcess javaInterrupt.
1170
b467c1e2a83f tiny fix for monitors
hlopkmar
parents: 1169
diff changeset
  6914
b467c1e2a83f tiny fix for monitors
hlopkmar
parents: 1169
diff changeset
  6915
    "Modified: / 02-01-1998 / 21:49:06 / cg"
b467c1e2a83f tiny fix for monitors
hlopkmar
parents: 1169
diff changeset
  6916
    "Created: / 10-04-1998 / 15:21:43 / cg"
1190
00e22b8b2652 interrupts work much better
hlopkmar
parents: 1189
diff changeset
  6917
    "Modified: / 30-11-2011 / 13:36:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6918
!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  6919
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6920
_java_lang_Thread_isAlive: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6921
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6922
    <javanative: 'java/lang/Thread' name: 'isAlive'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6923
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6924
        "is it alive ?"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6925
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6926
    |jThread stProcess|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6927
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6928
    jThread := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6929
    stProcess := JavaVM stProcessForJavaThread:jThread.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6930
    stProcess isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6931
	ThreadTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6932
	    ('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6933
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6934
	^ 0 "FALSE"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6935
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6936
    stProcess isDead ifTrue:[^ 0 "FALSE"].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6937
    ^ 1 "TRUE"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6938
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6939
    "Created: / 5.1.1998 / 02:03:51 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6940
    "Modified: / 6.2.1998 / 02:15:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6941
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6942
1183
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
  6943
_java_lang_Thread_isInterrupted: nativeContext 
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6944
    <javanative: 'java/lang/Thread' name: 'isInterrupted'>
1183
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
  6945
    "ask if a thread is interrupted (clear interruptState if arg is true)"
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
  6946
    
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
  6947
    | jThread  stProcess  clearInterrupt  wasInterrupted |
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6948
    jThread := nativeContext receiver.
1183
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
  6949
    stProcess := self stProcessForJavaThread: jThread.
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
  6950
    self assert: stProcess notNil.
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
  6951
    clearInterrupt := nativeContext argAt: 1.
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
  6952
    wasInterrupted := stProcess isInterrupted.
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
  6953
    clearInterrupt ~~ 0 ifTrue: [ stProcess clearInterrupted ].
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
  6954
    stProcess isDead ifTrue: [ ^ 0 ].
1188
1460e12fc954 interrupt test passes
hlopkmar
parents: 1185
diff changeset
  6955
    wasInterrupted ifTrue: [ ^ 1 ] ifFalse: [ ^ 0 ].
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6956
881
e45c36ff74fc Fixes in primitives
vranyj1
parents: 880
diff changeset
  6957
    "Modified: / 02-01-1998 / 21:49:06 / cg"
e45c36ff74fc Fixes in primitives
vranyj1
parents: 880
diff changeset
  6958
    "Created: / 07-01-1998 / 18:50:26 / cg"
e45c36ff74fc Fixes in primitives
vranyj1
parents: 880
diff changeset
  6959
    "Modified: / 05-08-2011 / 22:21:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1188
1460e12fc954 interrupt test passes
hlopkmar
parents: 1185
diff changeset
  6960
    "Modified: / 30-11-2011 / 12:22:34 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6961
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  6962
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6963
_java_lang_Thread_registerNatives: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6964
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6965
    <javanative: 'java/lang/Thread' name: 'registerNatives'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6966
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6967
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6968
    "Nothing to do, native method are bound lazily"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6969
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6970
    "Created: / 20-10-2010 / 11:12:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6971
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6972
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6973
_java_lang_Thread_setPriority0: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6974
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6975
    <javanative: 'java/lang/Thread' name: 'setPriority0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6976
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6977
   |t p prio|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6978
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6979
    t := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6980
    p := JavaVM stProcessForJavaThread:t.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6981
    prio := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6982
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6983
    p isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6984
        ThreadTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6985
            'JAVA [info]: no process yet (in setPriority)' infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6986
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6987
        ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6988
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6989
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6990
    "Modified: / 01-05-2011 / 13:25:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6991
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6992
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6993
_java_lang_Thread_sleep: nativeContext 
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  6994
    <javanative: 'java/lang/Thread' name: 'sleep'>
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6995
    "sleep for some milliseconds "
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6996
    
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6997
    | millis |
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  6998
    millis := nativeContext argAt: 1.
1190
00e22b8b2652 interrupts work much better
hlopkmar
parents: 1189
diff changeset
  6999
    millis < 0 ifTrue: [
00e22b8b2652 interrupts work much better
hlopkmar
parents: 1189
diff changeset
  7000
        self throwIllegalArgumentException: ('negative timeout: %1 in Thread.sleep' bindWith: millis)
00e22b8b2652 interrupts work much better
hlopkmar
parents: 1189
diff changeset
  7001
    ].
00e22b8b2652 interrupts work much better
hlopkmar
parents: 1189
diff changeset
  7002
    Logger 
00e22b8b2652 interrupts work much better
hlopkmar
parents: 1189
diff changeset
  7003
        log: ('%1 going to sleep for %2' 
00e22b8b2652 interrupts work much better
hlopkmar
parents: 1189
diff changeset
  7004
                bindWith: Processor activeProcess printString
00e22b8b2652 interrupts work much better
hlopkmar
parents: 1189
diff changeset
  7005
                with: millis)
00e22b8b2652 interrupts work much better
hlopkmar
parents: 1189
diff changeset
  7006
        severity: #debug
00e22b8b2652 interrupts work much better
hlopkmar
parents: 1189
diff changeset
  7007
        facility: #JVM.
00e22b8b2652 interrupts work much better
hlopkmar
parents: 1189
diff changeset
  7008
    self sleepForTimeout: millis state: #sleep.
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  7009
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
  7010
    "Modified: / 08-01-1999 / 16:42:52 / cg"
1190
00e22b8b2652 interrupts work much better
hlopkmar
parents: 1189
diff changeset
  7011
    "Modified: / 30-11-2011 / 13:58:36 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7012
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7013
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7014
_java_lang_Thread_start0: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7015
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7016
    <javanative: 'java/lang/Thread' name: 'start0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7017
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7018
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7019
    ^self threadStart: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7020
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7021
    "Modified: / 24-12-1999 / 03:14:33 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7022
    "Created: / 22-11-2010 / 17:48:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7023
    "Modified: / 14-12-2010 / 21:31:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7024
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7025
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7026
_java_lang_Thread_yield: nativeContext
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7027
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7028
    <javanative: 'java/lang/Thread' name: 'yield()V'>
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7029
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7030
        "yield"
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7031
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7032
    |jThread stProcess|
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7033
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7034
    Processor yield.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7035
"/    jThread := nativeContext receiver.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7036
"/    stProcess := JavaVM stProcessForJavaThread:jThread.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7037
"/    stProcess isNil ifTrue:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7038
"/        ThreadTrace == true ifTrue:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7039
"/            ('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7040
"/        ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7041
"/        ^ nil "void"
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7042
"/    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7043
"/    stProcess == Processor activeProcess ifTrue:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7044
"/        Processor yield.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7045
"/    ] ifFalse:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7046
"/        self halt.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7047
"/    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7048
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7049
    "Created: / 5.1.1998 / 02:03:51 / cg"
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7050
    "Modified: / 23.12.1998 / 19:19:17 / cg"
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7051
!
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7052
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  7053
_java_lang_Throwable_fillInStackTrace: nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7054
    <javanative: 'java/lang/Throwable' name: 'fillInStackTrace'>
1058
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  7055
    | java_lang_Throwable  exceptionObject  list  con |
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  7056
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  7057
    java_lang_Throwable := Java classNamed: 'java/lang/Throwable'.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7058
    exceptionObject := nativeContext receiver.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  7059
    
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7060
    "/
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7061
    "/ debugging only
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7062
    "/
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  7063
    
1058
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  7064
    (java_lang_Throwable notNil and:[(exceptionObject isKindOf: java_lang_Throwable) not]) ifTrue: [
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  7065
        self error:'Thrown object is not a java.lang.Throwable'.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7066
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7067
    con := thisContext sender.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  7068
    
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7069
    "/
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7070
    "/ we are not interrested in all intermediate Exception frames ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7071
    "/
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  7072
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  7073
    FullExceptionTrace ifFalse: [
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  7074
        "/ first, skip any JavaVM contexts
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  7075
        [ con receiver == exceptionObject ] whileFalse: [ con := con sender ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  7076
        
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  7077
        "/ then, all exception-init contexts
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  7078
        
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  7079
        [ con receiver == exceptionObject ] whileTrue: [ con := con sender ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  7080
    ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7081
    list := OrderedCollection new.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  7082
    [ con notNil ] whileTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  7083
        (con isJavaContext) ifTrue: [
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  7084
            "/ add a copy, in case the context continues with some
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  7085
            "/ cleanup ...
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  7086
            list add: con shallowCopy
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  7087
        ].
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  7088
        con := con sender
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7089
    ].
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  7090
    exceptionObject instVarNamed: 'backtrace' put: (list asArray).
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7091
    ^ nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7092
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  7093
    "Created: / 04-01-1998 / 14:27:40 / cg"
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  7094
    "Modified: / 08-05-1998 / 21:29:53 / cg"
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
  7095
    "Modified: / 21-10-2011 / 13:41:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1058
1db06119bf3e Temporary commit (fixing class loaders - classes gets registered twice)
vranyj1
parents: 1053
diff changeset
  7096
    "Modified: / 28-10-2011 / 22:15:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7097
!
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7098
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7099
_java_lang_Throwable_getStackTraceDepth: nativeContext
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7100
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7101
    <javanative: 'java/lang/Throwable' name: 'getStackTraceDepth'>
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7102
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7103
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7104
    ^(nativeContext receiver instVarNamed: #backtrace) size
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7105
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7106
    "Modified: / 01-05-2011 / 20:25:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7107
!
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7108
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7109
_java_lang_Throwable_getStackTraceElement: nativeContext
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7110
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7111
    <javanative: 'java/lang/Throwable' name: 'getStackTraceElement'>
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7112
883
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7113
    | throwable index ctx stackTraceElement |
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7114
    throwable := nativeContext receiver.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7115
    index :=  nativeContext argAt: 1.
883
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7116
    ctx := (throwable instVarNamed:#backtrace) at: index + 1.
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7117
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7118
    stackTraceElement := (self classForName: 'java.lang.StackTraceElement') new.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  7119
883
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7120
    stackTraceElement 
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7121
        instVarNamed: #declaringClass 
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7122
        put: (Java as_String:(ctx method javaClass javaName));
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7123
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7124
        instVarNamed: #methodName 
1204
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
  7125
        put: (Java as_String:"(ctx method printStringForBrowserWithSelector:ctx method selector inClass: ctx method javaClass) asString"ctx method selector);
883
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7126
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7127
        instVarNamed: #lineNumber 
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7128
        put: ctx lineNumber.
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7129
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7130
    ctx method javaClass sourceFile notNil ifTrue:[                
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7131
        stackTraceElement        
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7132
            instVarNamed: #fileName 
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7133
            put: (Java as_String:(ctx method javaClass sourceFile))
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7134
    ].
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7135
    ^ stackTraceElement
b0eecab8d572 - JavaResolver: fixes in class resolving
vranyj1
parents: 881
diff changeset
  7136
1204
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
  7137
    "Modified: / 02-12-2011 / 23:36:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
866
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7138
!
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7139
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7140
_java_lang_UNIXProcess_forkAndExec: nativeContext
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7141
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7142
    <javanative: 'java/lang/UNIXProcess' name: 'forkAndExec'>
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7143
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7144
    ^ UnimplementedNativeMethodSignal raise
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7145
!
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7146
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7147
_java_lang_UNIXProcess_initIDs: nativeContext
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7148
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7149
    <javanative: 'java/lang/UNIXProcess' name: 'initIDs'>
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7150
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7151
    "Nothing to do"
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7152
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  7153
    "Modified: / 25-06-2011 / 10:05:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7154
! !
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7155
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7156
!JavaVM class methodsFor:'native - java.lang.reflect'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7157
918
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
  7158
_java_lang_reflect_Array_getLength: nativeContext
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
  7159
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
  7160
    <javanative: 'java/lang/reflect/Array' name: 'getLength(Ljava/lang/Object;)I'>
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
  7161
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
  7162
    ^(nativeContext argAt: 1) size
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
  7163
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
  7164
    "Modified: / 17-08-2011 / 09:02:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
  7165
!
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
  7166
1151
vranyj1
parents: 1150
diff changeset
  7167
_java_lang_reflect_Array_multiNewArray: nativeContext
vranyj1
parents: 1150
diff changeset
  7168
vranyj1
parents: 1150
diff changeset
  7169
    <javanative: 'java/lang/reflect/Array' name: 'multiNewArray(Ljava/lang/Class;[I)Ljava/lang/Object;'>
vranyj1
parents: 1150
diff changeset
  7170
vranyj1
parents: 1150
diff changeset
  7171
    |componentClass sizes cls array |
vranyj1
parents: 1150
diff changeset
  7172
vranyj1
parents: 1150
diff changeset
  7173
    (nativeContext argAt:1) isNil ifTrue:[
vranyj1
parents: 1150
diff changeset
  7174
        self throwNullPointerException.
vranyj1
parents: 1150
diff changeset
  7175
        ^nil.
vranyj1
parents: 1150
diff changeset
  7176
    ].
vranyj1
parents: 1150
diff changeset
  7177
    (nativeContext argAt:2) isNil ifTrue:[
vranyj1
parents: 1150
diff changeset
  7178
        self throwNullPointerException.
vranyj1
parents: 1150
diff changeset
  7179
        ^nil.
vranyj1
parents: 1150
diff changeset
  7180
    ].
vranyj1
parents: 1150
diff changeset
  7181
vranyj1
parents: 1150
diff changeset
  7182
    componentClass := self reflection 
vranyj1
parents: 1150
diff changeset
  7183
                classForJavaClassObject:(nativeContext argAt:1).
vranyj1
parents: 1150
diff changeset
  7184
    componentClass == UndefinedObject ifTrue:[
vranyj1
parents: 1150
diff changeset
  7185
        self throwIllegalArgumentException:'invalid class: void'.
vranyj1
parents: 1150
diff changeset
  7186
        ^nil
vranyj1
parents: 1150
diff changeset
  7187
    ].    
vranyj1
parents: 1150
diff changeset
  7188
    sizes := nativeContext argAt:2.
vranyj1
parents: 1150
diff changeset
  7189
    sizes class == SignedIntegerArray ifFalse:[
vranyj1
parents: 1150
diff changeset
  7190
        self throwIllegalArgumentException:('sizes arguments not instance of int[] (is: %1)' bindWith: sizes class).
vranyj1
parents: 1150
diff changeset
  7191
        ^nil
vranyj1
parents: 1150
diff changeset
  7192
    ].
vranyj1
parents: 1150
diff changeset
  7193
    sizes size == 0 ifTrue:[
vranyj1
parents: 1150
diff changeset
  7194
        self throwIllegalArgumentException:('sizes argument has no elements').
vranyj1
parents: 1150
diff changeset
  7195
        ^nil
vranyj1
parents: 1150
diff changeset
  7196
    ].
vranyj1
parents: 1150
diff changeset
  7197
    array := nil.
vranyj1
parents: 1150
diff changeset
  7198
    cls := componentClass.
vranyj1
parents: 1150
diff changeset
  7199
    sizes do:[:size|
vranyj1
parents: 1150
diff changeset
  7200
        | newArray |
vranyj1
parents: 1150
diff changeset
  7201
        size > SmallInteger maxVal ifTrue:[
vranyj1
parents: 1150
diff changeset
  7202
            "This is just for Mauve tests"
vranyj1
parents: 1150
diff changeset
  7203
            self throwExceptionClassName:'java.lang.OutOfMemoryError'
vranyj1
parents: 1150
diff changeset
  7204
                             withMessage:'array size too big'.
vranyj1
parents: 1150
diff changeset
  7205
            ^nil.            
vranyj1
parents: 1150
diff changeset
  7206
        ].
vranyj1
parents: 1150
diff changeset
  7207
        size <  0 ifTrue:[
vranyj1
parents: 1150
diff changeset
  7208
            self throwExceptionClassName:'java.lang.NegativeArraySizeException'
vranyj1
parents: 1150
diff changeset
  7209
                             withMessage:'negative array size not allowed'.
vranyj1
parents: 1150
diff changeset
  7210
            ^nil
vranyj1
parents: 1150
diff changeset
  7211
        ].
vranyj1
parents: 1150
diff changeset
  7212
        cls := cls javaArrayClass.
vranyj1
parents: 1150
diff changeset
  7213
        newArray := cls new: size.
vranyj1
parents: 1150
diff changeset
  7214
        1 to: size do:[:i|
vranyj1
parents: 1150
diff changeset
  7215
            newArray at:i put: array copy.
vranyj1
parents: 1150
diff changeset
  7216
        ].
vranyj1
parents: 1150
diff changeset
  7217
        array := newArray.
vranyj1
parents: 1150
diff changeset
  7218
    ].
vranyj1
parents: 1150
diff changeset
  7219
    ^array.
vranyj1
parents: 1150
diff changeset
  7220
vranyj1
parents: 1150
diff changeset
  7221
    "Modified: / 22-11-2011 / 10:42:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vranyj1
parents: 1150
diff changeset
  7222
!
vranyj1
parents: 1150
diff changeset
  7223
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  7224
_java_lang_reflect_Array_newArray:aJavaContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7225
    <javanative: 'java/lang/reflect/Array' name: 'newArray'>
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  7226
    |componentClass size|
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  7227
1151
vranyj1
parents: 1150
diff changeset
  7228
    (aJavaContext argAt:1) isNil ifTrue:[
vranyj1
parents: 1150
diff changeset
  7229
        self throwNullPointerException.
vranyj1
parents: 1150
diff changeset
  7230
        ^nil.
vranyj1
parents: 1150
diff changeset
  7231
    ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7232
    componentClass := self reflection 
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  7233
                classForJavaClassObject:(aJavaContext argAt:1).
1151
vranyj1
parents: 1150
diff changeset
  7234
    componentClass == UndefinedObject ifTrue:[
vranyj1
parents: 1150
diff changeset
  7235
        self throwIllegalArgumentException:'invalid class: void'.
vranyj1
parents: 1150
diff changeset
  7236
        ^nil
vranyj1
parents: 1150
diff changeset
  7237
    ].
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  7238
    size := aJavaContext argAt:2.
1151
vranyj1
parents: 1150
diff changeset
  7239
    size < 0 ifTrue:[
vranyj1
parents: 1150
diff changeset
  7240
        self throwExceptionClassName:'java.lang.NegativeArraySizeException'
vranyj1
parents: 1150
diff changeset
  7241
                         withMessage:'negative array size not allowed'.
vranyj1
parents: 1150
diff changeset
  7242
        ^nil
vranyj1
parents: 1150
diff changeset
  7243
    ].
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
  7244
    ^ componentClass javaArrayClass new:size
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7245
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7246
    "Created: / 17-12-2010 / 14:49:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7247
    "Modified: / 28-01-2011 / 15:18:50 / Marcel Hlopko <hlopik@gmail.com>"
837
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
  7248
    "Modified: / 04-06-2011 / 17:06:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1151
vranyj1
parents: 1150
diff changeset
  7249
    "Modified: / 22-11-2011 / 09:13:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7250
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7251
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7252
_java_lang_reflect_Array_set: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7253
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7254
    <javanative: 'java/lang/reflect/Array' name: 'set'>
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7255
1151
vranyj1
parents: 1150
diff changeset
  7256
    | array index value |
vranyj1
parents: 1150
diff changeset
  7257
    array :=  nativeContext at:1.
vranyj1
parents: 1150
diff changeset
  7258
    index := (nativeContext at:2) + 1.    
vranyj1
parents: 1150
diff changeset
  7259
    value :=  nativeContext at:3.    
vranyj1
parents: 1150
diff changeset
  7260
vranyj1
parents: 1150
diff changeset
  7261
    array isJavaArray ifFalse:[
vranyj1
parents: 1150
diff changeset
  7262
        self throwIllegalArgumentException:'passed object is not an array'.
vranyj1
parents: 1150
diff changeset
  7263
        ^nil.
vranyj1
parents: 1150
diff changeset
  7264
    ].
vranyj1
parents: 1150
diff changeset
  7265
    index < 1 ifTrue:[
vranyj1
parents: 1150
diff changeset
  7266
        self throwIllegalArgumentException:'index is negative'.
vranyj1
parents: 1150
diff changeset
  7267
        ^nil.
vranyj1
parents: 1150
diff changeset
  7268
    ].
vranyj1
parents: 1150
diff changeset
  7269
    index > array size ifTrue:[
vranyj1
parents: 1150
diff changeset
  7270
        self throwArrayIndexOutOfBoundsException: index.
vranyj1
parents: 1150
diff changeset
  7271
        ^nil.
vranyj1
parents: 1150
diff changeset
  7272
    ].
vranyj1
parents: 1150
diff changeset
  7273
    value isNil ifTrue:[
vranyj1
parents: 1150
diff changeset
  7274
        array at: index put: nil.
vranyj1
parents: 1150
diff changeset
  7275
        ^nil
vranyj1
parents: 1150
diff changeset
  7276
    ].    
vranyj1
parents: 1150
diff changeset
  7277
    (self canCast: value class to: array class javaComponentClass) ifFalse:[
vranyj1
parents: 1150
diff changeset
  7278
        self throwIllegalArgumentException:'type-incompatible value'.
vranyj1
parents: 1150
diff changeset
  7279
        ^nil.
vranyj1
parents: 1150
diff changeset
  7280
    ].
vranyj1
parents: 1150
diff changeset
  7281
    array at: index put: value.
vranyj1
parents: 1150
diff changeset
  7282
vranyj1
parents: 1150
diff changeset
  7283
    "Modified: / 22-11-2011 / 11:06:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7284
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7285
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7286
_java_lang_reflect_Proxy_defineClass0: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7287
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7288
    <javanative: 'java/lang/reflect/Proxy' name: 'defineClass0'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7289
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7290
        "
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7291
    private static native Class defineClass0(ClassLoader loader, String name,
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7292
                                             byte[] b, int off, int len);
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7293
    "
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7294
    | loader name b off len  bs cls |
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7295
    loader := nativeContext argAt: 1.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7296
    name := nativeContext argAt: 2.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7297
    b := nativeContext argAt: 3.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7298
    off := nativeContext argAt: 4.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7299
    len := nativeContext argAt: 5.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7300
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7301
    bs := (off = 0 and: [len = b size]) 
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7302
            ifTrue:[b readStream]
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7303
            ifFalse:[(b copyFrom: off + 1 to: off + len) readStream].
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7304
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7305
    cls := JavaClassReader readStream: bs.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7306
    cls classLoader: loader.
1041
d5ff8885b19f ClassLoader refactoring - loads groovy but funny
vranyj1
parents: 1037
diff changeset
  7307
    self classRegistry registerClass: cls.
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7308
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7309
    ^self reflection javaClassObjectForClass: cls.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7310
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  7311
    "Created: / 06-02-2011 / 16:55:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7312
! !
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7313
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7314
!JavaVM class methodsFor:'native - java.net'!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7315
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7316
_java_net_DatagramPacket_init: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7317
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7318
    <javanative: 'java/net/DatagramPacket' name: 'init'>
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7319
997
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7320
    "Nothing to do"
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7321
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7322
    "Modified: / 13-09-2011 / 22:33:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7323
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7324
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7325
_java_net_Inet4AddressImpl_getHostByAddr: nativeContext
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7326
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7327
    <javanative: 'java/net/Inet4AddressImpl' name: 'getHostByAddr([B)Ljava/lang/String;'>
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7328
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7329
    ^ UnimplementedNativeMethodSignal raise
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7330
!
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7331
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7332
_java_net_Inet4AddressImpl_getLocalHostName: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7333
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7334
    <javanative: 'java/net/Inet4AddressImpl' name: 'getLocalHostName()Ljava/lang/String;'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7335
997
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7336
    ^Java as_String: OperatingSystem getHostName
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7337
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7338
    "Modified: / 13-09-2011 / 22:36:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7339
!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7340
1084
vranyj1
parents: 1083
diff changeset
  7341
_java_net_Inet4AddressImpl_lookupAllHostAddr: nativeContext
vranyj1
parents: 1083
diff changeset
  7342
vranyj1
parents: 1083
diff changeset
  7343
    <javanative: 'java/net/Inet4AddressImpl' name: 'lookupAllHostAddr(Ljava/lang/String;)[Ljava/net/InetAddress;'>
vranyj1
parents: 1083
diff changeset
  7344
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7345
    | hostname sockaddr inet4Address |
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7346
    hostname := Java as_ST_String: (nativeContext argAt:1).
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7347
    [
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7348
        sockaddr := IPSocketAddress hostName: hostname.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7349
    ] on: HostNameLookupError do: [:ex|
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7350
        self throwExceptionClassName: 'java.net.UnknownHostException' withMessage: (ex description , '(' , hostname , ')').         
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7351
        ^nil.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7352
    ].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7353
    "Bad, here we have an access to just one inet address,
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7354
     that's fine for now, however"
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7355
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7356
    inet4Address := (self classForName:'java.net.Inet4Address') newCleared.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7357
    inet4Address 
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7358
        instVarNamed: #family put: 1; "/IPv4
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7359
        instVarNamed: #address put: (sockaddr address doubleWordAt: 1 MSB: true);
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7360
        instVarNamed: #hostName put: (nativeContext argAt:1);
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7361
        instVarNamed: #canonicalHostName put: (nativeContext argAt:1).
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7362
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7363
    ^(self classForName:'java.net.InetAddress') javaArrayClass with: inet4Address.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7364
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7365
    "Modified: / 08-11-2011 / 10:10:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1084
vranyj1
parents: 1083
diff changeset
  7366
!
vranyj1
parents: 1083
diff changeset
  7367
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7368
_java_net_Inet4Address_init: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7369
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7370
    <javanative: 'java/net/Inet4Address' name: 'init()V'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7371
997
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7372
    "Nothing to do"
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7373
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7374
    "Modified: / 13-09-2011 / 22:31:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7375
!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7376
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7377
_java_net_Inet6Address_init: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7378
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7379
    <javanative: 'java/net/Inet6Address' name: 'init()V'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7380
997
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7381
    "Nothing to do"
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7382
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7383
    "Modified: / 13-09-2011 / 22:32:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7384
!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7385
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7386
_java_net_InetAddressImplFactory_isIPv6Supported: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7387
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7388
    <javanative: 'java/net/InetAddressImplFactory' name: 'isIPv6Supported'>
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7389
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7390
    ^ 0 "IPv6 is not supported!!"
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7391
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7392
    "Modified: / 13-09-2011 / 19:43:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7393
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7394
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7395
_java_net_InetAddress_init: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7396
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7397
    <javanative: 'java/net/InetAddress' name: 'init'>
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7398
997
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7399
    "Nothing to do"
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7400
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7401
    "Created: / 27-01-1998 / 18:16:40 / cg"
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7402
    "Modified (comment): / 13-09-2011 / 22:32:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7403
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7404
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7405
_java_net_NetworkInterface_getAll: nativeContext
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7406
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7407
    <javanative: 'java/net/NetworkInterface' name: 'getAll()[Ljava/net/NetworkInterface;'>
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7408
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7409
    ^ UnimplementedNativeMethodSignal raise
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7410
!
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7411
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7412
_java_net_NetworkInterface_getByName0: nativeContext
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7413
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7414
    <javanative: 'java/net/NetworkInterface' name: 'getByName0(Ljava/lang/String;)Ljava/net/NetworkInterface;'>
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7415
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7416
    ^ UnimplementedNativeMethodSignal raise
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7417
!
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7418
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7419
_java_net_NetworkInterface_init: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7420
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7421
    <javanative: 'java/net/NetworkInterface' name: 'init'>
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7422
997
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7423
    "Nothing to do"
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7424
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7425
    "Modified: / 13-09-2011 / 22:33:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7426
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7427
1084
vranyj1
parents: 1083
diff changeset
  7428
_java_net_PlainDatagramSocketImpl_bind0: nativeContext
vranyj1
parents: 1083
diff changeset
  7429
vranyj1
parents: 1083
diff changeset
  7430
    <javanative: 'java/net/PlainDatagramSocketImpl' name: 'bind0(ILjava/net/InetAddress;)V'>
vranyj1
parents: 1083
diff changeset
  7431
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7432
    | port addr sock fd |
1084
vranyj1
parents: 1083
diff changeset
  7433
vranyj1
parents: 1083
diff changeset
  7434
    port := nativeContext argAt: 1.
vranyj1
parents: 1083
diff changeset
  7435
    addr := nativeContext argAt: 2.
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7436
    addr isNil ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7437
        self throwSocketException: 'Passed InetAddress object is null'.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7438
        ^nil.    
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7439
    ].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7440
    fd := nativeContext receiver instVarNamed: #fd.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7441
    fd isNil ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7442
        self throwSocketException: 'Socket closed'.        
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7443
        ^nil.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7444
    ].
1084
vranyj1
parents: 1083
diff changeset
  7445
    sock := self validateFile: nativeContext receiver.
vranyj1
parents: 1083
diff changeset
  7446
vranyj1
parents: 1083
diff changeset
  7447
    addr := addr perform: #'getAddress()[B'.
vranyj1
parents: 1083
diff changeset
  7448
    addr = #[0 0 0 0] ifTrue:[
vranyj1
parents: 1083
diff changeset
  7449
        addr := nil
vranyj1
parents: 1083
diff changeset
  7450
    ] ifFalse:[
vranyj1
parents: 1083
diff changeset
  7451
        self throwSocketException: 'Only all-interface bind is supported by underlaing socket implementation, sorry'.
vranyj1
parents: 1083
diff changeset
  7452
        ^nil
vranyj1
parents: 1083
diff changeset
  7453
    ].
vranyj1
parents: 1083
diff changeset
  7454
    [
vranyj1
parents: 1083
diff changeset
  7455
        sock bindTo: port address: addr reuseAddress: true.
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7456
        nativeContext receiver instVarNamed: #localPort put: sock port.
1084
vranyj1
parents: 1083
diff changeset
  7457
    ] on: Error do:[:ex|
vranyj1
parents: 1083
diff changeset
  7458
        self throwSocketException: 'bind0() failed: ', ex description        
vranyj1
parents: 1083
diff changeset
  7459
    ]
vranyj1
parents: 1083
diff changeset
  7460
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7461
    "Modified: / 07-11-2011 / 21:45:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1084
vranyj1
parents: 1083
diff changeset
  7462
!
vranyj1
parents: 1083
diff changeset
  7463
vranyj1
parents: 1083
diff changeset
  7464
_java_net_PlainDatagramSocketImpl_datagramSocketClose: nativeContext
vranyj1
parents: 1083
diff changeset
  7465
vranyj1
parents: 1083
diff changeset
  7466
    <javanative: 'java/net/PlainDatagramSocketImpl' name: 'datagramSocketClose()V'>
vranyj1
parents: 1083
diff changeset
  7467
vranyj1
parents: 1083
diff changeset
  7468
        |jsock sock|
vranyj1
parents: 1083
diff changeset
  7469
vranyj1
parents: 1083
diff changeset
  7470
    jsock := nativeContext receiver.
vranyj1
parents: 1083
diff changeset
  7471
vranyj1
parents: 1083
diff changeset
  7472
    sock := self validateFile:jsock.
vranyj1
parents: 1083
diff changeset
  7473
    sock notNil ifTrue:[
vranyj1
parents: 1083
diff changeset
  7474
	FileIOTrace ifTrue:[
vranyj1
parents: 1083
diff changeset
  7475
	    'JAVA: datagram close socket' infoPrintCR
vranyj1
parents: 1083
diff changeset
  7476
	].
vranyj1
parents: 1083
diff changeset
  7477
	sock close.
vranyj1
parents: 1083
diff changeset
  7478
    ].
vranyj1
parents: 1083
diff changeset
  7479
vranyj1
parents: 1083
diff changeset
  7480
    "Modified: / 21.8.1997 / 17:09:40 / cg"
vranyj1
parents: 1083
diff changeset
  7481
    "Created: / 25.1.1998 / 20:04:24 / cg"
vranyj1
parents: 1083
diff changeset
  7482
!
vranyj1
parents: 1083
diff changeset
  7483
vranyj1
parents: 1083
diff changeset
  7484
_java_net_PlainDatagramSocketImpl_datagramSocketCreate: nativeContext
vranyj1
parents: 1083
diff changeset
  7485
vranyj1
parents: 1083
diff changeset
  7486
    <javanative: 'java/net/PlainDatagramSocketImpl' name: 'datagramSocketCreate()V'>
vranyj1
parents: 1083
diff changeset
  7487
vranyj1
parents: 1083
diff changeset
  7488
        |jsock fd sock fileNo|
vranyj1
parents: 1083
diff changeset
  7489
vranyj1
parents: 1083
diff changeset
  7490
    jsock := nativeContext receiver.
vranyj1
parents: 1083
diff changeset
  7491
vranyj1
parents: 1083
diff changeset
  7492
    fd := jsock instVarNamed:'fd'.
vranyj1
parents: 1083
diff changeset
  7493
    (fd instVarNamed:'fd') ~~ -1 ifTrue:[
vranyj1
parents: 1083
diff changeset
  7494
        self halt:'file already open'.
vranyj1
parents: 1083
diff changeset
  7495
        self internalError:'file already open'.
vranyj1
parents: 1083
diff changeset
  7496
        self throwIOExceptionWithMessage:'file already open in socketCreate'.
vranyj1
parents: 1083
diff changeset
  7497
        ^ self.
vranyj1
parents: 1083
diff changeset
  7498
    ].
vranyj1
parents: 1083
diff changeset
  7499
vranyj1
parents: 1083
diff changeset
  7500
    FileOpenTrace ifTrue:[
vranyj1
parents: 1083
diff changeset
  7501
        ('JAVA: create datagram socket') infoPrintCR.
vranyj1
parents: 1083
diff changeset
  7502
    ].
vranyj1
parents: 1083
diff changeset
  7503
vranyj1
parents: 1083
diff changeset
  7504
    sock := Socket newUDP.
vranyj1
parents: 1083
diff changeset
  7505
    sock isNil ifTrue:[
vranyj1
parents: 1083
diff changeset
  7506
        self throwIOExceptionWithMessage:'socketCreate failed'.
vranyj1
parents: 1083
diff changeset
  7507
    ].
vranyj1
parents: 1083
diff changeset
  7508
vranyj1
parents: 1083
diff changeset
  7509
    fileNo := self addOpenFile:sock.
vranyj1
parents: 1083
diff changeset
  7510
    fd instVarNamed:'fd' put:fileNo.
vranyj1
parents: 1083
diff changeset
  7511
vranyj1
parents: 1083
diff changeset
  7512
    "Created: / 25-01-1998 / 19:59:25 / cg"
vranyj1
parents: 1083
diff changeset
  7513
    "Modified: / 30-12-1998 / 20:10:38 / cg"
vranyj1
parents: 1083
diff changeset
  7514
    "Modified: / 03-11-2011 / 23:13:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vranyj1
parents: 1083
diff changeset
  7515
!
vranyj1
parents: 1083
diff changeset
  7516
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7517
_java_net_PlainDatagramSocketImpl_init: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7518
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7519
    <javanative: 'java/net/PlainDatagramSocketImpl' name: 'init'>
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7520
997
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7521
    "Nothing to do"
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7522
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7523
    "Modified: / 13-09-2011 / 22:36:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7524
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7525
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7526
_java_net_PlainDatagramSocketImpl_receive0: nativeContext
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7527
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7528
    <javanative: 'java/net/PlainDatagramSocketImpl' name: 'receive0(Ljava/net/DatagramPacket;)V'>
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7529
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7530
    ^ UnimplementedNativeMethodSignal raise
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7531
!
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7532
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7533
_java_net_PlainDatagramSocketImpl_send: nativeContext
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7534
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7535
    <javanative: 'java/net/PlainDatagramSocketImpl' name: 'send(Ljava/net/DatagramPacket;)V'>
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7536
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7537
        |jsock jdatagramPacket sock ok|
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7538
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7539
    jsock := nativeContext receiver.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7540
    jdatagramPacket := nativeContext argAt:1.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7541
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7542
    sock := self validateFile:jsock.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7543
    sock notNil ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7544
	FileIOTrace ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7545
	    ('JAVA: socket send') infoPrintCR
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7546
	].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7547
	^ -1.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7548
    ].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7549
    ^ -1
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7550
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7551
    "Created: / 4.2.1998 / 15:06:20 / cg"
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7552
    "Modified: / 30.12.1998 / 20:10:16 / cg"
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7553
!
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7554
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7555
_java_net_PlainSocketImpl_initProto: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7556
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7557
    <javanative: 'java/net/PlainSocketImpl' name: 'initProto'>
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  7558
997
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7559
    "Nothing to do"
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7560
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7561
    "Created: / 12-01-1998 / 12:56:52 / cg"
c87f3a1cbeba Few more natives for Windows
vranyj1
parents: 995
diff changeset
  7562
    "Modified (comment): / 13-09-2011 / 22:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7563
!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7564
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7565
_java_net_PlainSocketImpl_socketAccept: nativeContext
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7566
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7567
    <javanative: 'java/net/PlainSocketImpl' name: 'socketAccept(Ljava/net/SocketImpl;)V'>
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7568
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7569
    |jsock fd newJSock sock newSock fileNo|
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7570
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7571
    jsock := nativeContext receiver.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7572
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7573
    sock := self validateFile:jsock.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7574
    sock isNil ifTrue:[
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7575
        self throwIOExceptionWithMessage:'nil socket in accept'.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7576
        ^ self.
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7577
    ].
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7578
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7579
    newJSock := nativeContext argAt:1.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7580
    fd := newJSock instVarNamed:'fd'.
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7581
    (fd instVarNamed:'fd') ~~ -1 ifTrue:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7582
        self halt:'file already open'.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7583
        self internalError:'file already open'.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7584
        self throwIOExceptionWithMessage:'socket already open in socketAccept'.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7585
        ^ self.
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7586
    ].
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7587
    FileIOTrace ifTrue:[
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7588
        'JAVA: socket accept' infoPrintCR
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7589
    ].
1137
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7590
    [
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7591
        newSock := sock accept.
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7592
    ] on: Error do:[:ex|
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7593
        self throwSocketException:'accept failed: ' , ex description.        
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7594
        ^nil.
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7595
    ].
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7596
    newSock isNil ifTrue:[
1137
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7597
        self throwSocketException:'accept failed'.
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7598
        ^nil.
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7599
    ].
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7600
    fileNo := self addOpenFile:newSock.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7601
    fd instVarNamed:'fd' put:fileNo.
1137
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7602
    newJSock instVarNamed:'localport' put: newSock port.
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7603
    newJSock instVarNamed:'port' put: newSock getPeer port
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7604
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7605
    "Created: / 04-02-1998 / 15:26:49 / cg"
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7606
    "Modified: / 30-12-1998 / 20:10:01 / cg"
1137
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7607
    "Modified: / 19-11-2011 / 00:40:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7608
!
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7609
1110
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7610
_java_net_PlainSocketImpl_socketAvailable: nativeContext
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7611
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7612
    <javanative: 'java/net/PlainSocketImpl' name: 'socketAvailable()I'>
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7613
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7614
        |jSock sock n|
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7615
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7616
    jSock := nativeContext receiver.
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7617
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7618
    sock := self validateFile:jSock.
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7619
    sock isNil ifTrue:[
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7620
	self throwIOExceptionWithMessage:'socketAvailable on closed socket'.
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7621
	^ self.
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7622
    ].
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7623
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7624
    n := sock numAvailable.
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7625
    ^ n
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7626
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7627
    "Created: / 4.2.1998 / 16:58:49 / cg"
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7628
    "Modified: / 30.12.1998 / 20:10:08 / cg"
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7629
!
7413fa7769ec - call Thread.exit() even if thread is aborted by user (or Smalltalk code)
vranyj1
parents: 1109
diff changeset
  7630
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7631
_java_net_PlainSocketImpl_socketBind: nativeContext
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7632
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7633
    <javanative: 'java/net/PlainSocketImpl' name: 'socketBind(Ljava/net/InetAddress;I)V'>
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7634
1112
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  7635
    |jsock jaddr port sock hostName ok err|
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7636
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7637
    jsock := nativeContext receiver.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7638
    jaddr := nativeContext argAt:1.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7639
    port := nativeContext argAt:2.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7640
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7641
    hostName := jaddr instVarNamed:'hostName'.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7642
    hostName isNil ifTrue:[
1112
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  7643
        self halt.
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7644
    ] ifFalse:[
1112
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  7645
        hostName := Java as_ST_String:hostName
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7646
    ].
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7647
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7648
    sock := self validateFile:jsock.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7649
    sock notNil ifTrue:[
1112
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  7650
        FileIOTrace ifTrue:[
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  7651
            ('JAVA: socket bind to ' , hostName printString, ' port ' , port printString) infoPrintCR
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  7652
        ].
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  7653
1137
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7654
        [
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7655
            ok := sock bindTo:port address:nil "hostName".
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7656
        ] on: Error do: [:ex|
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7657
            self  
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7658
                throwExceptionClassName: 'java.net.BindException' 
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7659
                withMessage:'bind failed: ' , ex description.                                                            
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7660
        ].
1112
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  7661
        ok ifFalse:[
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  7662
            err := OperatingSystem lastErrorString.
1137
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7663
            self  
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7664
                throwExceptionClassName: 'java.net.BindException' 
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7665
                withMessage:'bind failed: ' , err.                                                            
1112
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  7666
        ].
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  7667
       jsock instVarNamed: #localport put: sock port.
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  7668
       jsock instVarNamed: #address put: jaddr.
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  7669
    ].
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  7670
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  7671
    "Created: / 04-02-1998 / 15:06:20 / cg"
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
  7672
    "Modified: / 30-12-1998 / 20:10:16 / cg"
1137
b4aee4f41489 Fixes in socket accept/bind natives
vranyj1
parents: 1136
diff changeset
  7673
    "Modified: / 19-11-2011 / 00:43:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7674
!
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7675
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7676
_java_net_PlainSocketImpl_socketClose0: nativeContext
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7677
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7678
    <javanative: 'java/net/PlainSocketImpl' name: 'socketClose0(Z)V'>
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7679
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7680
    ^self commonClose: nativeContext
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7681
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7682
    "Modified: / 07-11-2011 / 23:21:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7683
!
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7684
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7685
_java_net_PlainSocketImpl_socketConnect: nativeContext
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7686
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7687
    <javanative: 'java/net/PlainSocketImpl' name: 'socketConnect(Ljava/net/InetAddress;II)V'>
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7688
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7689
    |jsock jaddr port sock addr hostName ok|
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7690
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7691
    jsock := nativeContext receiver.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7692
    jaddr := nativeContext argAt:1.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7693
    port := nativeContext argAt:2.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7694
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7695
    hostName := jaddr instVarNamed:'hostName'.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7696
    hostName notNil ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7697
        hostName := Java as_ST_String:hostName
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7698
    ] ifFalse:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7699
        addr := jaddr instVarNamed:'address'.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7700
        addr notNil ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7701
            hostName := ByteArray new:4.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7702
            hostName at:4 put:(addr bitAnd:16rFF).
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7703
            addr := addr bitShift:-8.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7704
            hostName at:3 put:(addr bitAnd:16rFF).
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7705
            addr := addr bitShift:-8.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7706
            hostName at:2 put:(addr bitAnd:16rFF).
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7707
            addr := addr bitShift:-8.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7708
            hostName at:1 put:(addr bitAnd:16rFF).
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7709
        ].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7710
    ].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7711
    hostName isNil ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7712
        self halt.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7713
    ].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7714
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7715
    sock := self validateFile:jsock.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7716
    sock notNil ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7717
        FileIOTrace ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7718
            Logger log: ('socket connect to ' , hostName printString , ' port ' , port printString) severity: #trace facility: #JVM.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7719
        ].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7720
        SocketConnectConfirmation ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7721
            (PermittedHostConnects isNil 
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7722
            or:[(PermittedHostConnects includes:hostName) not]) ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7723
                (self confirm:'connect to host: ' , hostName printString , ' - ok ?')
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7724
                ifFalse:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7725
                    self throwIOExceptionWithMessage:'connect permission denied'.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7726
                ].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7727
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7728
                (self confirm:('JAVA Security check\\Always permit connects to this host (''' , hostName printString , ''') ?') withCRs)
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7729
                ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7730
                    PermittedHostConnects isNil ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7731
                        PermittedHostConnects := Set new
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7732
                    ].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7733
                    PermittedHostConnects add:hostName.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7734
                ]
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7735
            ]
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7736
        ].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7737
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7738
        [
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7739
            ok := sock connectTo:hostName port:port.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7740
            ok ifFalse:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7741
                self throwExceptionClassName:'java.net.ConnectException' withMessage:'connect failed'.
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7742
            ].
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7743
            jsock instVarNamed: #localport put: sock port.
1108
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7744
            jsock instVarNamed: #address put: jaddr.
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7745
        ] on: Error do:[:ex|
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7746
            self throwExceptionClassName:'java.net.ConnectException' withMessage:'connect failed: ', ex description
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7747
        ].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7748
        
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7749
    ].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7750
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7751
    "Created: / 25-01-1998 / 20:02:27 / cg"
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7752
    "Modified: / 30-12-1998 / 20:10:28 / cg"
1108
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7753
    "Modified: / 13-11-2011 / 23:16:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7754
!
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7755
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7756
_java_net_PlainSocketImpl_socketCreate: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7757
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7758
    <javanative: 'java/net/PlainSocketImpl' name: 'socketCreate(Z)V'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7759
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7760
    |jsock isStream fd sock fileNo|
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7761
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7762
    jsock := nativeContext receiver.
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7763
    isStream := (nativeContext argAt:1) == 1.
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7764
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7765
    fd := jsock instVarNamed:'fd'.
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7766
    fd isNil ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7767
        self throwSocketException: 'null fd object'.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7768
    ].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7769
    (fd instVarNamed:'fd') ~~ -1 ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7770
        self halt:'file already open'.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7771
        self internalError:'file already open'.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7772
        self throwSocketException:'socket already open in socketCreate'.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7773
        ^ self.
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7774
    ].
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7775
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7776
    FileOpenTrace ifTrue:[
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7777
        ('JAVA: create socket') infoPrintCR.
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7778
    ].
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7779
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7780
    isStream ifTrue:[
1108
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7781
        sock := JavaSocket newTCP
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7782
    ] ifFalse:[
1108
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7783
        sock := JavaSocket newUDP
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7784
    ].
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7785
    sock isNil ifTrue:[
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7786
        self throwIOExceptionWithMessage:'socketCreate failed'.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7787
    ].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7788
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7789
    (jsock instVarNamed: #serverSocket) notNil ifTrue:[
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7790
        "/If this is a server socket then enable SO_REUSEADDR
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7791
        [
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7792
            Object primitiveFailureSignal
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7793
        ] on: Object primitiveFailureSignal do:[:ex|
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7794
            self throwIOExceptionWithMessage:'cannot set SO_REUSEADDR: ' , ex description.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7795
            ^nil.
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7796
        ]
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7797
    ].
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7798
    
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7799
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7800
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7801
    fileNo := self addOpenFile:sock.
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7802
    fd instVarNamed:'fd' put:fileNo.
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  7803
1091
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7804
    "Created: / 25-01-1998 / 19:59:25 / cg"
215f8fe6687b - few more primitives for java.net.* (working on Tomcat :-)
vranyj1
parents: 1090
diff changeset
  7805
    "Modified: / 30-12-1998 / 20:10:38 / cg"
1108
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7806
    "Modified: / 13-11-2011 / 20:46:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7807
!
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7808
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7809
_java_net_PlainSocketImpl_socketGetOption: nativeContext
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7810
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7811
    <javanative: 'java/net/PlainSocketImpl' name: 'socketGetOption(ILjava/lang/Object;)I'>
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7812
1108
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7813
    | opt arg sock ret |
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7814
    opt := nativeContext argAt: 1.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7815
    arg := nativeContext argAt: 2.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7816
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7817
    sock := self validateFile: nativeContext receiver.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7818
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7819
"/  TCP_NODELAY = 1;
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7820
    opt = 1 ifTrue:[
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7821
        ret := sock getSocketOption: #TCP_NODELAY.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7822
        ^ret ifTrue:[1] ifFalse:[-1].
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7823
    ].
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7824
"/  SO_BINDADDR = 15;
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7825
    opt = 15 ifTrue:[
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7826
        self breakPoint: #jv.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7827
        ^-1 "/Unsupported
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7828
    ].
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7829
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7830
"/  SO_REUSEADDR = 4;
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7831
    opt = 4 ifTrue:[
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7832
        ret := sock getSocketOption: #SO_REUSEADDR.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7833
        ^ret ifTrue:[1] ifFalse:[-1].
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7834
    ].
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7835
"/  IP_TOS = 3;
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7836
    opt = 3 ifTrue:[
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7837
        self breakPoint: #jv.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7838
        ^-1 "/Unsupported
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7839
    ].
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7840
"/  SO_LINGER = 128;
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7841
    opt = 128 ifTrue:[
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7842
        ret := sock getSocketOption:#SO_LINGER.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7843
        ^ret
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7844
    ].
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7845
"/  SO_TIMEOUT = 4102;
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7846
    opt = 4102 ifTrue:[
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7847
        self breakPoint: #jv.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7848
        ^-1 "/Unsupported                   .
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7849
    ].
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7850
"/  SO_SNDBUF = 4097;
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7851
    opt = 4097 ifTrue:[
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7852
        ret := sock getSocketOption: #SO_SNDBUF.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7853
        ^ret
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7854
    ].
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7855
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7856
"/  SO_RCVBUF = 4098;
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7857
    opt = 4098 ifTrue:[
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7858
        ret := sock getSocketOption: #SO_RCVBUF.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7859
        ^ret
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7860
    ].
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7861
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7862
"/  SO_KEEPALIVE = 8;
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7863
    opt = 8 ifTrue:[
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7864
        ret := sock getSocketOption: #SO_KEEPALIVE.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7865
        ^ret ifTrue:[1] ifFalse:[-1].
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7866
    ].
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7867
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7868
"/  SO_OOBINLINE = 4099;
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7869
    opt = 4099 ifTrue:[
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7870
        ret := sock getSocketOption: #SO_OOBINLINE.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7871
        ^ret ifTrue:[1] ifFalse:[-1].
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7872
    ]
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7873
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7874
    "Modified: / 13-11-2011 / 23:06:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7875
!
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7876
1092
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7877
_java_net_PlainSocketImpl_socketListen: nativeContext
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7878
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7879
    <javanative: 'java/net/PlainSocketImpl' name: 'socketListen(I)V'>
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7880
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7881
        |jSock time sock ok|
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7882
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7883
    jSock := nativeContext receiver.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7884
    time := nativeContext argAt:1.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7885
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7886
    sock := self validateFile:jSock.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7887
    sock notNil ifTrue:[
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7888
	FileIOTrace ifTrue:[
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7889
	    ('JAVA: socket listen with timeout ' , time printString) infoPrintCR.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7890
	].
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7891
	ok := sock listenWithBacklog:5.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7892
	ok ifFalse:[
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7893
	    self throwIOExceptionWithMessage:'listen failed'.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7894
	    ^ self.
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7895
	].
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7896
	time ~~ 0 ifTrue:[
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7897
	    sock readWaitWithTimeoutMs:time
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7898
	]
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7899
    ].
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7900
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7901
    "Created: / 4.2.1998 / 15:17:48 / cg"
224cb55e1ab0 More java.net.* natives & fixes
vranyj1
parents: 1091
diff changeset
  7902
    "Modified: / 30.12.1998 / 20:10:46 / cg"
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7903
!
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7904
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7905
_java_net_PlainSocketImpl_socketSetOption: nativeContext
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7906
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7907
    <javanative: 'java/net/PlainSocketImpl' name: 'socketSetOption(IZLjava/lang/Object;)V'>
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7908
1108
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7909
    | opt on val sock o arg1 arg2 |
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7910
    opt := nativeContext argAt: 1.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7911
    on  := nativeContext argAt: 2.
1108
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7912
    val := nativeContext argAt: 3.
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7913
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7914
    sock := self validateFile: nativeContext receiver.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7915
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7916
"/  TCP_NODELAY = 1;
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7917
    opt = 1 ifTrue:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7918
        o := #TCP_NODELAY.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7919
        arg1 := (on == 1)
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7920
    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7921
"/  SO_BINDADDR = 15;
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7922
    opt = 15 ifTrue:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7923
        ^self "/Unsupported
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7924
    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7925
            
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7926
"/  SO_REUSEADDR = 4;
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7927
    opt = 4 ifTrue:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7928
        o := #SO_REUSEADDR.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7929
        arg1 := (on == 1)
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7930
    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7931
"/  IP_TOS = 3;
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7932
    opt = 3 ifTrue:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7933
        ^self "/Unssuported
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7934
    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7935
"/  SO_LINGER = 128;
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7936
    opt = 128 ifTrue:[
1108
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7937
        o := #SO_LINGER.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7938
        arg1 := (on == 1).
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7939
        arg2 := val instVarNamed: #value.
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7940
    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7941
"/  SO_TIMEOUT = 4102;
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7942
    opt = 4102 ifTrue:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7943
        ^self "/Unssuported
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7944
                   .
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7945
    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7946
"/  SO_SNDBUF = 4097;
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7947
    opt = 4097 ifTrue:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7948
        o := #SO_SNDBUF.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7949
        arg1 := val instVarNamed: #value.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7950
    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7951
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7952
"/  SO_RCVBUF = 4098;
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7953
    opt = 4098 ifTrue:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7954
        o := #SO_RCVBUF.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7955
        arg1 := val instVarNamed: #value.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7956
    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7957
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7958
"/  SO_KEEPALIVE = 8;
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7959
    opt = 8 ifTrue:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7960
        o := #SO_KEEPALIVE.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7961
        arg1 := (on == 1)
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7962
    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7963
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7964
"/  SO_OOBINLINE = 4099;
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7965
    opt = 4099 ifTrue:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7966
        o := #SO_OOBINLINE.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7967
        arg1 := (on == 1)
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7968
    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7969
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7970
    [
1108
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7971
        sock setSocketOption: o argument: arg1 argument: arg2.   
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7972
    ] on: Error do:[:ex|
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7973
        self throwSocketException: 'Error setting socket option: ', ex description.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7974
    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7975
1108
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  7976
    "Modified: / 13-11-2011 / 23:05:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7977
!
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7978
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7979
_java_net_SocketInputStream_init: nativeContext
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7980
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7981
    <javanative: 'java/net/SocketInputStream' name: 'init()V'>
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7982
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7983
    "Nothing to do"
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7984
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7985
    "Modified: / 09-11-2011 / 22:27:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7986
!
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7987
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7988
_java_net_SocketInputStream_socketRead0: nativeContext
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7989
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7990
    <javanative: 'java/net/SocketInputStream' name: 'socketRead0(Ljava/io/FileDescriptor;[BIII)I'>
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7991
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7992
    | fdObj data off len timeout sock nread |
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7993
    fdObj   := nativeContext argAt:1.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7994
    data    := nativeContext argAt:2.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7995
    off     := nativeContext argAt:3.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7996
    len     := nativeContext argAt:4.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7997
    timeout := nativeContext argAt:5.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7998
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  7999
    fdObj isNil ifTrue:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8000
        self throwSocketException: 'Socket closed (null fdObj passed to socketRead0)'.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8001
        ^ -1.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8002
    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8003
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8004
    sock := self validateFile: fdObj.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8005
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8006
    timeout ~~ 0 ifTrue:[            
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8007
        [
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8008
            (sock readWaitWithTimeout: timeout) ifTrue:[
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8009
                self throwExceptionClassName:'java.net.SocketTimeoutException' withMessage: 'Read timed out'.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8010
                ^ -1.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8011
            ].          
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8012
        ] on: Error do:[:ex|
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8013
            self throwSocketException: 'Error when reading: ', ex description.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8014
        ]
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8015
    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8016
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8017
    [
1213
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
  8018
        nread := sock nextAvailableBytes: len into: data startingAt: off + 1
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8019
    ] on: Error do:[:ex|
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8020
        self throwSocketException: 'Error when reading: ', ex description.
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8021
    ].
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8022
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8023
    ^nread
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8024
1213
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
  8025
    "Modified: / 04-12-2011 / 20:24:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1104
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8026
!
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8027
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8028
_java_net_SocketOutputStream_init: nativeContext
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8029
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8030
    <javanative: 'java/net/SocketOutputStream' name: 'init()V'>
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8031
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8032
    "Nothing to do"
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8033
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8034
    "Modified: / 09-11-2011 / 23:44:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8035
!
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8036
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8037
_java_net_SocketOutputStream_socketWrite0: nativeContext
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8038
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8039
    <javanative: 'java/net/SocketOutputStream' name: 'socketWrite0(Ljava/io/FileDescriptor;[BII)V'>
cf1e4f41b8b2 More java.net.* native methods
vranyj1
parents: 1103
diff changeset
  8040
1108
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8041
    | fdObj data off len  sock |
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8042
    fdObj   := nativeContext argAt:1.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8043
    data    := nativeContext argAt:2.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8044
    off     := nativeContext argAt:3.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8045
    len     := nativeContext argAt:4.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8046
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8047
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8048
    fdObj isNil ifTrue:[
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8049
        self throwSocketException: 'Socket closed (null fdObj passed to socketRead0)'.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8050
        ^ -1.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8051
    ].
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8052
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8053
    sock := self validateFile: fdObj.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8054
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8055
    [
1136
2a94c9946e7e Fixes in socket read/write
vranyj1
parents: 1135
diff changeset
  8056
        sock nextPutBytes: len from: data startingAt: off + 1.
1108
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8057
    ] on: Error do:[:ex|
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8058
        self throwIOExceptionWithMessage: 'Error when writing: ', ex description.
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8059
    ].
847291fc77d7 More java.net.* primitives
vranyj1
parents: 1104
diff changeset
  8060
1116
3d108134cd76 in-the-middle-of-the-work commit, may break stuff, fixes to come soon :)
hlopkmar
parents: 1115
diff changeset
  8061
    "Modified: / 13-11-2011 / 23:53:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8062
! !
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8063
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8064
!JavaVM class methodsFor:'native - java.security'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8065
1016
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  8066
_java_security_AccessController_doPrivileged: aJavaContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8067
    <javanative: 'java/security/AccessController' name: 'doPrivileged'>
1016
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  8068
    "we don't care about permissions, we will just allow this. Now it's guaranteed that called code will not perform access permission checks"
1023
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
  8069
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
  8070
    | retval |
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
  8071
    
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
  8072
    JavaVM privilegedAccessQuery answer: true do: [
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
  8073
        retval := (aJavaContext argAt: 1) perform: #'run()Ljava/lang/Object;'.
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
  8074
    ].
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
  8075
    ^retval
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8076
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8077
    "Created: / 20-10-2010 / 12:31:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1017
23971b5214d8 removed useless infoPrintCR
hlopkmar
parents: 1016
diff changeset
  8078
    "Modified: / 09-10-2011 / 23:56:31 / Marcel Hlopko <hlopik@gmail.com>"
1023
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
  8079
    "Modified: / 18-10-2011 / 23:28:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1016
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  8080
!
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  8081
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  8082
_java_security_AccessController_getStackAccessControlContext: nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8083
    <javanative: 'java/security/AccessController' name: 'getStackAccessControlContext'>
1016
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  8084
    "/ introduced with jdk1.2
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8085
    "/ supposed to do more here ...
1016
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  8086
    
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  8087
    ^nil.
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  8088
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  8089
    "Created: / 27-01-1998 / 18:22:15 / cg"
2b20730b8717 work on ticket #28(illegal access after evaluating expresion in workspace).
hlopkmar
parents: 1000
diff changeset
  8090
    "Modified: / 09-10-2011 / 23:40:46 / Marcel Hlopko <hlopik@gmail.com>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8091
! !
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8092
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8093
!JavaVM class methodsFor:'native - java.sql'!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8094
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8095
_java_sql_DriverManager_getCallerClassLoader: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8096
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8097
    <javanative: 'java/sql/DriverManager' name: 'getCallerClassLoader()Ljava/lang/ClassLoader;'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8098
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8099
    ^nativeContext 
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8100
        sender sender 
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8101
        receiver class theNonMetaclass
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8102
        classLoader
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8103
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8104
    "Modified: / 05-12-2011 / 11:34:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8105
! !
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8106
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8107
!JavaVM class methodsFor:'native - java.text'!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8108
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8109
_java_text_Bidi_nativeBidiChars: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8110
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8111
    <javanative: 'java/text/Bidi' name: 'nativeBidiChars(Ljava/text/Bidi;[CI[BIII)V'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8112
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8113
    ^ UnimplementedNativeMethodSignal raise
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8114
! !
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
  8115
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8116
!JavaVM class methodsFor:'native - java.util'!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8117
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8118
_java_util_ResourceBundle_getClassContext: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8119
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8120
    <javanative: 'java/util/ResourceBundle' name: 'getClassContext'>
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8121
1242
62be7670d158 Few fixes for Tomcat, new Tomcat startup script
vranyj1
parents: 1238
diff changeset
  8122
    "returns an array filled with the contextChain receivers classes.
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8123
     What an ugly, messy interface."
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8124
    
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8125
    |chain con cls jClass|
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8126
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8127
    chain := OrderedCollection new.
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8128
    con := thisContext sender.
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8129
    [
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8130
        con notNil 
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8131
            and:[con receiver isMethod not or:[con receiver isJavaMethod not]]
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8132
    ] whileTrue:[con := con sender.].
1242
62be7670d158 Few fixes for Tomcat, new Tomcat startup script
vranyj1
parents: 1238
diff changeset
  8133
    con := con sender sender.
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8134
    [con notNil] whileTrue:[
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8135
        (true) "con isJavaContext" ifTrue:[
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8136
            cls := con receiver class.
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8137
            cls isMeta ifTrue:[
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8138
                "/ t'was a static method
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8139
                cls := cls soleInstance
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8140
            ].
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8141
            cls isJavaClass ifTrue:[
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8142
                jClass := self reflection javaClassObjectForClass:cls.
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8143
                chain add:jClass.
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8144
            ]
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8145
        ].
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8146
        con := con sender.
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8147
    ].
1242
62be7670d158 Few fixes for Tomcat, new Tomcat startup script
vranyj1
parents: 1238
diff changeset
  8148
    ^(self classForName:'java.lang.Class') javaArrayClass withAll: chain
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8149
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8150
    "Created: / 05-01-1998 / 02:47:00 / cg"
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8151
    "Modified: / 24-12-1998 / 00:34:57 / cg"
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8152
    "Modified: / 28-01-2011 / 15:31:28 / Marcel Hlopko <hlopik@gmail.com>"
1242
62be7670d158 Few fixes for Tomcat, new Tomcat startup script
vranyj1
parents: 1238
diff changeset
  8153
    "Modified: / 08-12-2011 / 01:13:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8154
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8155
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8156
_java_util_TimeZone_getSystemTimeZoneID: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8157
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8158
    <javanative: 'java/util/TimeZone' name: 'getSystemTimeZoneID'>
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8159
866
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  8160
    "JV@2011-06-25: TODO: finish, returning nil here means GMT"
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  8161
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  8162
    ^ nil
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  8163
10d1f47af6d9 Few fixes for Mauve...
vranyj1
parents: 864
diff changeset
  8164
    "Modified: / 25-06-2011 / 08:26:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8165
! !
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8166
846
cec92244091c fixed bug in resolving
hlopkmar
parents: 837
diff changeset
  8167
!JavaVM class methodsFor:'native - java.util.concurrent.atomic'!
cec92244091c fixed bug in resolving
hlopkmar
parents: 837
diff changeset
  8168
cec92244091c fixed bug in resolving
hlopkmar
parents: 837
diff changeset
  8169
_java_util_concurrent_atomic_AtomicLong_VMSupportsCS8: nativeContext
cec92244091c fixed bug in resolving
hlopkmar
parents: 837
diff changeset
  8170
cec92244091c fixed bug in resolving
hlopkmar
parents: 837
diff changeset
  8171
    <javanative: 'java/util/concurrent/atomic/AtomicLong' name: 'VMSupportsCS8'>
cec92244091c fixed bug in resolving
hlopkmar
parents: 837
diff changeset
  8172
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  8173
    "Should be safe - say we don't support lockless updates"        
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  8174
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  8175
    ^ 0
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  8176
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
  8177
    "Modified: / 07-08-2011 / 20:53:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
846
cec92244091c fixed bug in resolving
hlopkmar
parents: 837
diff changeset
  8178
! !
cec92244091c fixed bug in resolving
hlopkmar
parents: 837
diff changeset
  8179
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  8180
!JavaVM class methodsFor:'native - java.util.jar'!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  8181
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  8182
_java_util_jar_JarFile_getMetaInfEntryNames: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  8183
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  8184
    <javanative: 'java/util/jar/JarFile' name: 'getMetaInfEntryNames'>
880
a9171dcee2b0 Fix in sun.reflect.NativeMethodAccessorImpl.invoke0(): unboxes
vranyj1
parents: 877
diff changeset
  8185
    "
a9171dcee2b0 Fix in sun.reflect.NativeMethodAccessorImpl.invoke0(): unboxes
vranyj1
parents: 877
diff changeset
  8186
    private native String[] getMetaInfEntryNames();
a9171dcee2b0 Fix in sun.reflect.NativeMethodAccessorImpl.invoke0(): unboxes
vranyj1
parents: 877
diff changeset
  8187
    "
881
e45c36ff74fc Fixes in primitives
vranyj1
parents: 880
diff changeset
  8188
    | zipArchive entries jentries |
880
a9171dcee2b0 Fix in sun.reflect.NativeMethodAccessorImpl.invoke0(): unboxes
vranyj1
parents: 877
diff changeset
  8189
a9171dcee2b0 Fix in sun.reflect.NativeMethodAccessorImpl.invoke0(): unboxes
vranyj1
parents: 877
diff changeset
  8190
    zipArchive := ZipCache at: (nativeContext receiver instVarNamed: #jzfile).
881
e45c36ff74fc Fixes in primitives
vranyj1
parents: 880
diff changeset
  8191
    entries := zipArchive entries select:[:entry|entry size > 9 and:[entry startsWith: 'META-INF/']].    
e45c36ff74fc Fixes in primitives
vranyj1
parents: 880
diff changeset
  8192
    jentries := Java java_lang_String javaArrayClass new: entries size.
e45c36ff74fc Fixes in primitives
vranyj1
parents: 880
diff changeset
  8193
    1 to: entries size do:[:i|
e45c36ff74fc Fixes in primitives
vranyj1
parents: 880
diff changeset
  8194
        jentries at: i put: (Java as_String: (entries at: i))
e45c36ff74fc Fixes in primitives
vranyj1
parents: 880
diff changeset
  8195
    ].
e45c36ff74fc Fixes in primitives
vranyj1
parents: 880
diff changeset
  8196
    ^jentries
e45c36ff74fc Fixes in primitives
vranyj1
parents: 880
diff changeset
  8197
e45c36ff74fc Fixes in primitives
vranyj1
parents: 880
diff changeset
  8198
    "Modified: / 05-08-2011 / 20:18:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  8199
! !
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
  8200
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8201
!JavaVM class methodsFor:'native - java.util.zip'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8202
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8203
_java_util_zip_Adler32_updateBytes: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8204
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8205
    <javanative: 'java/util/zip/Adler32' name: 'updateBytes'>
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8206
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8207
    ^ UnimplementedNativeMethodSignal raise
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8208
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8209
1216
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8210
_java_util_zip_CRC32_updateBytes: nativeContext
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8211
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8212
    <javanative: 'java/util/zip/CRC32' name: 'updateBytes(I[BII)I'>
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8213
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8214
    | crc b off len |
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8215
    crc := nativeContext argAt: 1.
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8216
    b   := nativeContext argAt: 2.
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8217
    off := nativeContext argAt: 3.
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8218
    len := nativeContext argAt: 4.
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8219
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8220
    ^ZipStream crc32BytesIn:b from:off + 1  to: off + len crc:crc
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8221
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8222
    "Modified: / 05-12-2011 / 00:41:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8223
!
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8224
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  8225
_java_util_zip_Deflater_initIDs: nativeContext 
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8226
    <javanative: 'java/util/zip/Deflater' name: 'initIDs'>
1246
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  8227
Logger log: '_java_util_zip_Deflater_initIDs unnimplemented' severity:#info facility:#JVM.
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  8228
2e7d85df01f8 resolveClass native resolves whole CP, for even more eager resolving, run JavaVM enableEagerResolving :)
hlopkmar
parents: 1242
diff changeset
  8229
    "Modified: / 08-12-2011 / 21:11:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8230
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
  8231
1083
vranyj1
parents: 1081
diff changeset
  8232
_java_util_zip_Inflater_end: nativeContext
vranyj1
parents: 1081
diff changeset
  8233
vranyj1
parents: 1081
diff changeset
  8234
    <javanative: 'java/util/zip/Inflater' name: 'end(J)V'>
vranyj1
parents: 1081
diff changeset
  8235
vranyj1
parents: 1081
diff changeset
  8236
     "
vranyj1
parents: 1081
diff changeset
  8237
    private native static void reset(long addr);
vranyj1
parents: 1081
diff changeset
  8238
    "
vranyj1
parents: 1081
diff changeset
  8239
    | addr inflater |
vranyj1
parents: 1081
diff changeset
  8240
    addr := nativeContext argAt: 1.
vranyj1
parents: 1081
diff changeset
  8241
    inflater := ZipInflaters at: addr.
vranyj1
parents: 1081
diff changeset
  8242
    inflater end.
vranyj1
parents: 1081
diff changeset
  8243
vranyj1
parents: 1081
diff changeset
  8244
    "Modified: / 03-11-2011 / 22:51:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vranyj1
parents: 1081
diff changeset
  8245
!
vranyj1
parents: 1081
diff changeset
  8246
1216
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8247
_java_util_zip_Inflater_getBytesRead: nativeContext
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8248
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8249
    <javanative: 'java/util/zip/Inflater' name: 'getBytesRead(J)J'>
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8250
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8251
    | addr inflater |
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8252
    addr := nativeContext argAt: 1.
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8253
    inflater := ZipInflaters at: addr.
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8254
    ^inflater bytesRead.
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8255
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8256
    "Modified: / 05-12-2011 / 00:56:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8257
!
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
  8258
911
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  8259
_java_util_zip_Inflater_getBytesWritten: nativeContext
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  8260
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  8261
    <javanative: 'java/util/zip/Inflater' name: 'getBytesWritten'>
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  8262
952
7afd3529b9fa More natives for java.util.zip.Inflater
vranyj1
parents: 948
diff changeset
  8263
    | addr inflater |
7afd3529b9fa More natives for java.util.zip.Inflater
vranyj1
parents: 948
diff changeset
  8264
    addr := nativeContext argAt: 1.
7afd3529b9fa More natives for java.util.zip.Inflater
vranyj1
parents: 948
diff changeset
  8265
    inflater := ZipInflaters at: addr.
7afd3529b9fa More natives for java.util.zip.Inflater
vranyj1
parents: 948
diff changeset
  8266
    ^inflater bytesWritten.
7afd3529b9fa More natives for java.util.zip.Inflater
vranyj1
parents: 948
diff changeset
  8267
7afd3529b9fa More natives for java.util.zip.Inflater
vranyj1
parents: 948
diff changeset
  8268
    "Modified: / 31-08-2011 / 10:01:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
911
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  8269
!
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  8270
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8271
_java_util_zip_Inflater_inflateBytes: nativeContext
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8272
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8273
    <javanative: 'java/util/zip/Inflater' name: 'inflateBytes'>
911
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  8274
    "
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  8275
    private native int inflateBytes(long addr, byte[] b, int off, int len)
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  8276
    "
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  8277
945
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8278
    | addr b off len inflater ret |
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8279
    addr := nativeContext argAt: 1."long takes 2 slots"
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8280
    b := nativeContext argAt: 3.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8281
    off := nativeContext argAt: 4.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8282
    len := nativeContext argAt: 5.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8283
945
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8284
    inflater := ZipInflaters at: addr.
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8285
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8286
    ret := inflater inflate: b offset: off length: len inflater: nativeContext receiver.
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8287
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8288
    ^ret.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8289
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8290
    "Created: / 30-04-2011 / 23:02:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
945
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8291
    "Modified: / 30-08-2011 / 12:39:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8292
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8293
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8294
_java_util_zip_Inflater_init: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8295
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8296
    <javanative: 'java/util/zip/Inflater' name: 'init'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8297
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8298
    
945
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8299
    | nowrap inflater |
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8300
    nowrap := nativeContext argAt:1.
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8301
    inflater := JavaZipSupport inflaterFor: self.
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8302
    inflater init: nowrap.
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8303
    ZipInflaters add: inflater.
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8304
    ^ZipInflaters size.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8305
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8306
    "Created: / 01-02-1998 / 20:14:01 / cg"
945
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8307
    "Modified: / 30-08-2011 / 12:38:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8308
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8309
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8310
_java_util_zip_Inflater_initIDs: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8311
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8312
    <javanative: 'java/util/zip/Inflater' name: 'initIDs'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8313
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8314
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8315
    "Nothing to do, used only to register natives"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8316
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8317
    "Created: / 30-04-2011 / 21:55:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8318
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8319
908
d990d0d520d9 ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents: 907
diff changeset
  8320
_java_util_zip_Inflater_reset: nativeContext
d990d0d520d9 ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents: 907
diff changeset
  8321
d990d0d520d9 ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents: 907
diff changeset
  8322
    <javanative: 'java/util/zip/Inflater' name: 'reset'>
911
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  8323
    "
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  8324
    private native static void reset(long addr);
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  8325
    "
945
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8326
    | addr inflater |
911
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
  8327
    addr := nativeContext argAt: 1.
945
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8328
    inflater := ZipInflaters at: addr.
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8329
    inflater reset.
908
d990d0d520d9 ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents: 907
diff changeset
  8330
d990d0d520d9 ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents: 907
diff changeset
  8331
    "Created: / 01-02-1998 / 20:14:13 / cg"
945
84d75b6d090d Native method fixes
vranyj1
parents: 943
diff changeset
  8332
    "Modified: / 30-08-2011 / 12:43:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
908
d990d0d520d9 ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents: 907
diff changeset
  8333
!
d990d0d520d9 ClassLoader trickery, maybe not a good idea, we will see.
vranyj1
parents: 907
diff changeset
  8334
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8335
_java_util_zip_ZipEntry_initFields: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8336
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8337
    <javanative: 'java/util/zip/ZipEntry' name: 'initFields'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8338
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8339
        | entry jzentry zmember |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8340
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8341
    entry := aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8342
    jzentry := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8343
    zmember := ZipEntryCache at: jzentry.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8344
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8345
    entry 
1221
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  8346
        instVarNamed: #name     put: (Java as_String: zmember fileName);
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  8347
        instVarNamed: #time     put: -1"zmember lastModFileTime";
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8348
        instVarNamed: #crc      put: zmember crc32;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8349
        instVarNamed: #size     put: zmember uncompressedSize;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8350
        instVarNamed: #csize    put: zmember compressedSize;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8351
        instVarNamed: #method   put: zmember compressionMethod;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8352
        instVarNamed: #extra    put: zmember extraField;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8353
        instVarNamed: #comment  put: (zmember fileComment ifNotNil:[Java as_String: zmember fileComment]).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8354
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8355
    "Created: / 01-04-2011 / 13:04:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1221
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  8356
    "Modified: / 05-12-2011 / 23:42:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8357
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8358
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8359
_java_util_zip_ZipEntry_initIDs: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8360
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8361
    <javanative: 'java/util/zip/ZipEntry' name: 'initIDs'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8362
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8363
        "hopefully nothing to do"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8364
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8365
    "Created: / 01-04-2011 / 13:02:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8366
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8367
1081
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  8368
_java_util_zip_ZipFile_close: nativeContext
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  8369
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  8370
    <javanative: 'java/util/zip/ZipFile' name: 'close(J)V'>
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  8371
1083
vranyj1
parents: 1081
diff changeset
  8372
    | jzfile zar |
vranyj1
parents: 1081
diff changeset
  8373
    jzfile := nativeContext argAt: 1.
vranyj1
parents: 1081
diff changeset
  8374
    zar := ZipCache at: jzfile.
vranyj1
parents: 1081
diff changeset
  8375
    zar close.
vranyj1
parents: 1081
diff changeset
  8376
    ZipCache at: jzfile put: nil.
vranyj1
parents: 1081
diff changeset
  8377
vranyj1
parents: 1081
diff changeset
  8378
    "Modified: / 03-11-2011 / 22:22:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1081
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  8379
!
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
  8380
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8381
_java_util_zip_ZipFile_freeEntry: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8382
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8383
    <javanative: 'java/util/zip/ZipFile' name: 'freeEntry'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8384
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8385
    | zipArchiveIndex  zipEntryIndex |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8386
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8387
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8388
    zipArchiveIndex := nativeContext at: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8389
    zipEntryIndex := nativeContext at: 3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8390
    zipEntryIndex = 0 ifFalse: [ ZipEntryCache at: zipEntryIndex put: nil ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8391
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8392
    "Modified: / 01-05-2011 / 13:33:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8393
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8394
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8395
_java_util_zip_ZipFile_getCSize: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8396
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8397
    <javanative: 'java/util/zip/ZipFile' name: 'getCSize'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8398
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8399
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8400
    | jzentry zmember |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8401
    jzentry := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8402
    zmember := ZipEntryCache at: jzentry.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8403
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8404
    ^zmember compressedSize
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8405
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8406
    "Created: / 30-04-2011 / 21:50:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8407
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8408
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8409
_java_util_zip_ZipFile_getEntry: nativeContext
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8410
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8411
    <javanative: 'java/util/zip/ZipFile' name: 'getEntry'>
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8412
921
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  8413
    | zipArchive  filename  member |
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8414
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8415
    zipArchive := ZipCache at: (nativeContext at: 1).
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8416
    filename := Java as_ST_String: (nativeContext at: 3).
921
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  8417
    member := (zipArchive findMember: filename).
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8418
    member isNil ifTrue: [ 
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8419
        ^ 0 
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8420
    ] ifFalse: [ 
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8421
        ^ ZipEntryCache indexOf: member ifAbsent:[
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8422
            ZipEntryCache add: member.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8423
            ZipEntryCache size.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8424
        ]
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8425
    ]
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8426
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8427
    "Created: / 27-03-2011 / 16:59:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8428
    "Modified: / 01-04-2011 / 16:03:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
921
cf21839e2346 Fixes for System.in, System.out, System.err on Windows/SunJDK6
vranyj1
parents: 920
diff changeset
  8429
    "Modified: / 18-08-2011 / 19:44:56 / jv"
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8430
    "Modified: / 05-12-2011 / 11:18:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8431
!
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8432
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8433
_java_util_zip_ZipFile_getMethod: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8434
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8435
    <javanative: 'java/util/zip/ZipFile' name: 'getMethod'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8436
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8437
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8438
    | jzentry zmember |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8439
    jzentry := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8440
    zmember := ZipEntryCache at: jzentry.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8441
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8442
    ^zmember compressionMethod
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8443
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8444
    "Created: / 30-04-2011 / 21:53:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8445
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8446
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8447
_java_util_zip_ZipFile_getNextEntry: nativeContext
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8448
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8449
    <javanative: 'java/util/zip/ZipFile' name: 'getNextEntry(JI)J'>
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8450
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8451
    | zipArchive  index i |
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8452
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8453
    zipArchive := ZipCache at: (nativeContext at: 1).
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8454
    index := nativeContext at: 3.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8455
    i := 0.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8456
    zipArchive zipMembersDo:[:member |
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8457
        index == i ifTrue:[
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8458
            ^ ZipEntryCache indexOf: member ifAbsent:[
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8459
                ZipEntryCache add: member.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8460
                ZipEntryCache size.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8461
            ]
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8462
        ].
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8463
        i := i + 1.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8464
    ].
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8465
    ^0
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8466
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8467
    "Modified: / 05-12-2011 / 11:19:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8468
!
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
  8469
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8470
_java_util_zip_ZipFile_getSize: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8471
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8472
    <javanative: 'java/util/zip/ZipFile' name: 'getSize'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8473
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8474
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8475
    | jzentry zmember |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8476
    jzentry := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8477
    zmember := ZipEntryCache at: jzentry.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8478
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8479
    ^zmember uncompressedSize
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8480
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8481
    "Created: / 30-04-2011 / 21:53:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8482
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8483
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8484
_java_util_zip_ZipFile_getTotal: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8485
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8486
    <javanative: 'java/util/zip/ZipFile' name: 'getTotal'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8487
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8488
    | zar |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8489
    zar := ZipCache at: (nativeContext at: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8490
    ^ zar entries size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8491
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8492
    "Modified: / 01-05-2011 / 13:31:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8493
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8494
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8495
_java_util_zip_ZipFile_initIDs: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8496
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8497
    <javanative: 'java/util/zip/ZipFile' name: 'initIDs'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8498
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8499
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8500
    "Nothing to do"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8501
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8502
    "Created: / 23-03-2011 / 19:37:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8503
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8504
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8505
_java_util_zip_ZipFile_open: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8506
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8507
    <javanative: 'java/util/zip/ZipFile' name: 'open'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8508
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8509
    | path  mode  lastModTime  result |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8510
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8511
    path := Java as_ST_String: (nativeContext at: 1).
1221
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  8512
    (path endsWith:'.jar') ifFalse:[self breakPoint: #jv]. 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8513
    mode := nativeContext at: 2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8514
    lastModTime := nativeContext at: 3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8515
    result := path asFilename.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8516
    result ifNil: [ JavaVM throwZipException ].
957
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  8517
    ^[ 
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  8518
        ZipCache indexOf: ( ZipCache add: (ZipArchive readingFrom: result readStream) ) 
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  8519
    ] on: Error do:[:ex|
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  8520
        self throwIOExceptionWithMessage: 'Cannot open zip file: ', ex description
84a9553aa486 Fixes for ExtClassLoader
vranyj1
parents: 952
diff changeset
  8521
    ]
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8522
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8523
    "Modified: / 01-04-2011 / 15:35:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1221
2a6660fdb81d fixes in natives
vranyj1
parents: 1220
diff changeset
  8524
    "Modified: / 05-12-2011 / 22:44:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8525
!
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8526
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8527
_java_util_zip_ZipFile_read: aJavaContext
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8528
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8529
    <javanative: 'java/util/zip/ZipFile' name: 'read'>
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8530
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8531
    
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8532
    | jzfile jzentry pos b off len zar zmember bytesToRead |
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8533
    jzfile := aJavaContext argAt: 1.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8534
    jzentry := aJavaContext argAt: 3. "first arg is long!!!!!!"
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8535
    pos := aJavaContext argAt: 5. "jzentry arg is long!!!!!!"
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8536
    b := aJavaContext argAt: 7.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8537
    off := aJavaContext argAt: 8.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8538
    len := aJavaContext argAt: 9.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8539
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8540
    zar := ZipCache at: jzfile.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8541
    zmember := ZipEntryCache at: jzentry.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8542
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8543
    bytesToRead := len min: (zmember compressedSize - pos).
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8544
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8545
    ^zar nextBytes: bytesToRead of: zmember startingAt: pos into: b startingAt: off + 1.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8546
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8547
    "Created: / 30-04-2011 / 22:15:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  8548
    "Modified: / 01-05-2011 / 16:22:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8549
! !
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8550
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8551
!JavaVM class methodsFor:'native - old-style'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8552
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8553
_AccessController_beginPrivileged:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8554
    "/ introduced with jdk1.2
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8555
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8556
    "Created: / 27.1.1998 / 18:18:11 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8557
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8558
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8559
_AccessController_endPrivileged:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8560
    "/ introduced with jdk1.2
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8561
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8562
    "Created: / 27.1.1998 / 18:18:32 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8563
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8564
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8565
_AudioDevice_audioClose:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8566
    |device fd stream|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8567
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8568
    device := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8569
    device notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8570
	fd := device instVarNamed:'dev'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8571
	(fd notNil and:[fd > 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8572
	    stream := self getOpenFileAt:fd.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8573
	    stream notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8574
		stream close.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8575
		device instVarNamed:'dev' put:0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8576
	    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8577
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8578
    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8579
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8580
    "Created: / 10.1.1998 / 15:45:16 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8581
    "Modified: / 13.1.1998 / 18:08:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8582
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8583
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8584
_AudioDevice_audioOpen:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8585
    |f stream fileNo|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8586
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8587
    NoAudio ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8588
	Transcript showCR:'JAVA: audio disabled'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8589
	^ -1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8590
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8591
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8592
    Stream streamErrorSignal handle:[:ex |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8593
	Stream streamErrorSignal handle:[:ex |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8594
	    stream := nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8595
	    ex return.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8596
	] do:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8597
	    stream := SoundStream writing.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8598
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8599
    ] do:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8600
	stream := SoundStream writing.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8601
	stream notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8602
	    stream setSampleRate:8000.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8603
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8604
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8605
    stream isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8606
"/        ^ -1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8607
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8608
	f := '/dev/audio' asFilename.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8609
	f exists ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8610
	    Transcript showCR:'JAVA: neither SoundStream nor /dev/audio available'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8611
	    ^ -1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8612
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8613
	stream := f readWriteStream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8614
	stream isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8615
	    Transcript showCR:'JAVA: /dev/audio exists, but cannot be opened'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8616
	    ^ -1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8617
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8618
	fileNo := self addOpenFile:stream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8619
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8620
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8621
    fileNo := self addOpenFile:stream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8622
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8623
    FileOpenTrace ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8624
	('JAVA: opened audioDevice as FD ' , fileNo printString) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8625
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8626
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8627
    ^ fileNo
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8628
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8629
    "Created: / 10.1.1998 / 15:45:30 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8630
    "Modified: / 14.10.1998 / 15:20:52 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8631
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8632
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8633
_AudioDevice_audioWrite:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8634
    |device fd stream bytes count|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8635
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8636
    device := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8637
    device notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8638
	fd := device instVarNamed:'dev'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8639
	(fd notNil and:[fd > 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8640
	    stream := self getOpenFileAt:fd.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8641
	    stream notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8642
		bytes := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8643
		count := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8644
		stream nextPutBytes:count from:bytes startingAt:1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8645
	    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8646
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8647
    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8648
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8649
    "Created: / 10.1.1998 / 15:45:16 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8650
    "Modified: / 13.1.1998 / 18:07:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8651
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8652
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8653
_BigInteger_plumbInit:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8654
    UnimplementedNativeMethodSignal raiseRequest
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8655
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8656
    "Modified: / 12.11.1998 / 19:23:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8657
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8658
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8659
_CMM_cmmGetTagSize:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8660
    "/ public static native synchronized int cmmGetTagSize (long arg1, int arg2, int[] arg3)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8661
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8662
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8663
    UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8664
    ^ -1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8665
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8666
    "Created: / 27.1.1998 / 21:43:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8667
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8668
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8669
_CMM_cmmInit:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8670
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8671
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8672
    "Created: / 27.1.1998 / 21:43:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8673
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8674
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8675
_CMM_cmmLoadProfile:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8676
    "/ public static native synchronized int cmmLoadProfile (byte[] arg1, long[] arg2)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8677
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8678
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8679
    UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8680
    ^ -1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8681
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8682
    "Created: / 27.1.1998 / 21:43:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8683
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8684
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8685
_CRC32_update1:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8686
    "/ void update1 (int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8687
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8688
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8689
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8690
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8691
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8692
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8693
_CRC32_update:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8694
    "/ void update (byte[] int int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8695
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8696
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8697
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8698
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8699
    "Created: / 27.1.2000 / 03:09:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8700
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8701
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8702
_ClassLoader_createArrayClass:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8703
    "java.lang.Class createArrayClass (java.lang.String java.lang.Class)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8704
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8705
    "resolve a new class as previously created by defineClass0"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8706
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8707
    |jClassLoader name elCls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8708
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8709
    jClassLoader := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8710
    name := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8711
    elCls := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8712
    elCls isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8713
        self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8714
        ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8715
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8716
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8717
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8718
    "Modified: / 27.1.2000 / 02:36:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8719
    "Created: / 27.1.2000 / 02:56:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8720
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8721
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8722
_ClassLoader_defineClass0: nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8723
    "create a new class from a given byteArray.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8724
     Here, construct a stream on it and pass the work to the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8725
     JavaClassReader."
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8726
    
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8727
    | jClassLoader  jName  data  offset  length  inStream  newClass  jClass |
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  8728
    self breakPoint: #mh.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8729
    jClassLoader := nativeContext receiver.
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8730
    jName := nativeContext argAt: 1.
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8731
    data := nativeContext argAt: 2.
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8732
    offset := nativeContext argAt: 3.
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8733
    length := nativeContext argAt: 4.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8734
    inStream := data readStream.
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8735
    inStream position: offset + 1.
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8736
    inStream readLimit: (offset + length).
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  8737
    "Q: Is this method ever called in JDK 6? Isn't it just
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  8738
     a leftover?"
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  8739
    self breakPoint: #jv info: 'Code below is obsolete...'.
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  8740
    self breakPoint: #mh info: 'Code below is obsolete...'.
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8741
    newClass := JavaClassRegistry loadStream: inStream loader: jClassLoader.
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8742
    newClass isNil ifTrue: [
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8743
        Logger 
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8744
            log: '_ClassLoader_defineClass0: was not able to read given class'
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  8745
            severity: #warn
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  8746
            facility: #JVM.
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8747
        self breakPoint: #mh.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8748
        ^ nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8749
    ].
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8750
    newClass classLoader: jClassLoader.
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8751
    jClass := self javaClassObjectForClass: newClass.
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8752
    ^ jClass.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8753
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  8754
    "Created: / 07-01-1998 / 12:35:10 / cg"
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  8755
    "Modified: / 24-01-1998 / 15:26:21 / cg"
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  8756
    "Modified: / 30-10-2011 / 12:10:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8757
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8758
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8759
_ClassLoader_findSystemClass:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8760
    ^ self _ClassLoader_findSystemClass0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8762
    "Created: / 18.11.1998 / 00:00:14 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8763
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8764
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8765
_ClassLoader_getSystemResource: nativeContext asStream0: returnAsStream 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8766
    "common code for
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8767
        getSystemResourceAsStream0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8768
        getSystemResourceAsName0"
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8769
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8770
    | jString  rString  dir  file  text  inStream  url |
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8771
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8772
    jString := nativeContext argAt: 1.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8773
    rString := Java as_ST_String: jString.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8774
    Java effectiveClassPath 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8775
        keysAndValuesDo: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8776
            :classPathIndex :aPath | 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8777
            | f  zipFile  zar  data |
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8778
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8779
            f := aPath asFilename.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8780
            ((zipFile := f withSuffix: 'jar') exists 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8781
                or: [ (zipFile := f withSuffix: 'zip') exists ]) 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8782
                    ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8783
                        zar := ZipArchive oldFileNamed: zipFile.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8784
                        (Array 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8785
                            with: rString
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8786
                            with: rString asLowercase
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8787
                            with: rString asUppercase) 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8788
                                do: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8789
                                    :tryName | 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8790
                                    | entry |
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8791
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8792
                                    entry := zar findMember: tryName.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8793
                                    entry notNil ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8794
                                        returnAsStream ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8795
                                            data := zar extract: tryName.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8796
                                            inStream := (self classForName: 'java.io.ByteArrayInputStream') 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8797
                                                        newCleared.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8798
                                            inStream perform: #'<init>([B)V' with: data.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8799
                                            ^ inStream.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8800
                                        ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8801
                                        url := 'systemResource:/ZIP' , (classPathIndex - 1) printString , '/+/' 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8802
                                                    , tryName.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8803
                                        ^ Java as_String: url.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8804
                                    ]
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8805
                                ]
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8806
                    ]
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8807
                    ifFalse: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8808
                        f exists ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8809
                            (file := f construct: rString) exists ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8810
                                (Java isExcludedFromClassPath: file) ifFalse: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8811
                                    "/ Copy data from returned buffer into Java byte array. 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8812
                                    "/ self halt.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8813
                                    returnAsStream ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8814
                                        text := file contents asString.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8815
                                        data := text asByteArray.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8816
                                        
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8817
                                        "/ Create input stream using byte array 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8818
                                        
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8819
                                        inStream := (Java classForName: 'java.io.ByteArrayInputStream') newCleared.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8820
                                        inStream perform: #'<init>([B)V' with: data.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8821
                                        ^ inStream.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8822
                                    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8823
                                    url := 'systemResource:/FILE/' , file pathName.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8824
                                    self halt.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8825
                                    ^ Java as_String: url
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8826
                                ]
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8827
                            ]
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8828
                        ]
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8829
                    ]
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
  8830
        ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8831
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8832
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8833
    "Created: / 08-01-1998 / 16:06:56 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8834
    "Modified: / 26-12-1998 / 17:14:52 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8835
    "Modified: / 22-11-2010 / 13:44:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8836
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8837
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8838
_ClassLoader_getSystemResourceAsName0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8839
    "/ java.lang.String getSystemResourceAsName0 (java.lang.String)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8840
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8841
    ^ self
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8842
	_ClassLoader_getSystemResource:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8843
	asStream0:false.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8844
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8845
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8846
_ClassLoader_getSystemResourceAsStream0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8847
    "/ java.lang.InputStream getSystemResourceAsStream0 (java.lang.String)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8848
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8849
    ^ self
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8850
	_ClassLoader_getSystemResource:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8851
	asStream0:true.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8852
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8853
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8854
_ClassLoader_init:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8855
     ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8856
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8857
    "Created: / 5.1.1998 / 02:04:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8858
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8859
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8860
_ClassLoader_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8861
    "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8862
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8863
    "Created: / 27.1.1998 / 18:37:08 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8864
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8865
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8866
_ClassLoader_resolveClass0: nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8867
    "resolve a new class as previously created by defineClass0"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8868
    
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  8869
    | jClassLoader  jCls  cls  anyUnresolved |
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  8870
self breakPoint:#mh.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8871
    jClassLoader := nativeContext receiver.
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8872
    jCls := nativeContext argAt: 1.
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8873
    jCls isNil ifTrue: [
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8874
        self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8875
        ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8876
    ].
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8877
    cls := self reflection javaClassObjectForClass: jCls.
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8878
    cls isNil ifTrue: [
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8879
        self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8880
        ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8881
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8882
    ('JavaVM [info]: resolving class ' , cls fullName , ' ...') infoPrintCR.
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8883
    JavaClassReader classLoaderQuerySignal answer: jClassLoader
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8884
        do: [
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  8885
            "correct this so it works with new resolving"
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  8886
            self breakPoint: #mh.
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8887
            JavaClassReader resolveClass: cls.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8888
            
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8889
"/        JavaClassReader postLoadActions:true.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8890
            
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8891
            anyUnresolved := false.
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8892
            cls constantPool do: [
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8893
                :entry | 
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8894
                (entry isMemberOf: JavaUnresolvedClassConstant) ifTrue: [
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8895
                    self halt: 'debugHalt'.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8896
                    entry preResolve.
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8897
                    self halt: 'debugHalt'.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8898
                    anyUnresolved := true.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8899
                ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8900
            ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8901
        ].
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8902
    anyUnresolved ifTrue: [
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8903
        jClassLoader notNil ifTrue: [
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8904
            "/ any unresolved left -> try resolving with standard loader
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8905
            JavaClassReader classLoaderQuerySignal answer: nil
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8906
                do: [
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8907
                    cls constantPool do: [
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8908
                        :entry | 
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8909
                        (entry isMemberOf: JavaUnresolvedClassConstant) ifTrue: [
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8910
                            self halt: 'debugHalt'.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8911
                            entry preResolve.
1026
5badd1d31864 introduced JavaClassRegistry, taken loading responsibilities from JavaClassReader, got rid of stringConstants and started using StringRefs.. Bugs very likely :)
hlopkmar
parents: 1024
diff changeset
  8912
                            self halt: 'debugHalt'.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8913
                        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8914
                    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8915
                ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8916
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8917
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8918
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8919
    "Created: / 07-01-1998 / 13:12:27 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8920
    "Modified: / 20-10-1998 / 19:01:57 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8921
    "Modified: / 28-01-2011 / 15:28:18 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8922
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8923
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  8924
_ClassLoader_resolveClass: nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8925
    "void resolveClass (java.lang.Class)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8926
    "resolve a new class as previously created by defineClass0"
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  8927
    
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  8928
    | jClassLoader  jCls  cls  loaderStub  anyUnresolved |
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  8929
    self breakPoint: #mh.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8930
    jClassLoader := nativeContext receiver.
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  8931
    jCls := nativeContext argAt: 1.
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  8932
    jCls isNil ifTrue: [
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8933
        self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8934
        ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8935
    ].
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
  8936
    UnimplementedNativeMethodSignal raiseRequest.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8937
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8938
    "Modified: / 27.1.2000 / 02:36:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8939
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8940
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8941
_Class_getClassLoader:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8942
    "get a classes loader"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8943
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8944
    |jClass cls loader|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8945
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8946
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8947
    cls := self reflection classForJavaClassObject:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8948
    loader := cls classLoader.
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  8949
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  8950
    "JV@2011-10-30: Is code below OK?"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8951
    cls isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8952
        loader := JavaClassReader classLoaderQuerySignal query.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8953
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8954
    ^ loader
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8955
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8956
    "Created: / 05-01-1998 / 02:51:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8957
    "Modified: / 04-01-1999 / 17:50:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8958
    "Modified: / 28-01-2011 / 15:18:57 / Marcel Hlopko <hlopik@gmail.com>"
1059
22fe06c9e367 Fixes in classloaders
vranyj1
parents: 1058
diff changeset
  8959
    "Modified (format): / 30-10-2011 / 12:23:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8960
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8961
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8962
_Class_getConstructor0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8963
    UnimplementedNativeMethodSignal raiseRequest
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8964
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8965
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8966
    "Created: / 12.11.1998 / 18:55:42 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8967
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8968
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8969
_Class_getConstructors0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8970
    UnimplementedNativeMethodSignal raiseRequest
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8971
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8972
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8973
    "Created: / 12.11.1998 / 18:55:26 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8974
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8975
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8976
_Class_getField0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8977
    UnimplementedNativeMethodSignal raiseRequest
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8978
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8979
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8980
    "Created: / 12.11.1998 / 18:55:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8981
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8982
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8983
_Class_getFields0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8984
    UnimplementedNativeMethodSignal raiseRequest
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8985
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8986
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8987
    "Created: / 12.11.1998 / 18:55:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8988
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8989
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8990
_Class_getMethod0:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8991
    "get a method, given a name and type spec"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8992
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8993
    |jClass cls jmName mName mTypes whichAccess argSig sel|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8994
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8995
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8996
    cls := self reflection javaClassObjectForClass:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8997
    jmName := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8998
    mName := Java as_ST_String:jmName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8999
    mTypes := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9000
    whichAccess := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9001
    argSig := JavaMethod argSignatureFromArgTypeArray:mTypes.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9002
    cls methodDictionary 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9003
        keysAndValuesDo:[:sel :mthd | 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9004
            |i1 i2 jMethod retTypeClass argTypes|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9005
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9006
            JavaMethods notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9007
                (jMethod := JavaMethods at:mthd ifAbsent:nil) notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9008
                    ^ jMethod
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9009
                ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9010
            ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9011
            mthd name printCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9012
            mName printCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9013
            mthd name = mName ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9014
                i1 := mthd signature indexOf:$(.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9015
                i2 := mthd signature indexOf:$) startingAt:(i1 + 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9016
                (mthd signature copyFrom:i1 + 1 to:i2 - 1) = argSig ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9017
                    "/ found it - create a java.lang.reflect.Method for it.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9018
                    jMethod := (Java at:'java.lang.reflect.Method') new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9019
                    jMethod instVarNamed:'clazz' put:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9020
                    jMethod instVarNamed:'slot' put:sel.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9021
                    jMethod instVarNamed:'name' put:jmName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9022
                    retTypeClass := mthd returnTypeClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9023
                    retTypeClass isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9024
                        retTypeClass := #void
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9025
                    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9026
                    argTypes := mthd argSignature.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9027
                    argTypes := argTypes 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9028
                                collect:[:s | 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9029
                                    |c|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9030
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9031
                                    c := Java at:s.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9032
                                    self javaClassObjectForClass:(c ? s asSymbol)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9033
                                ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9034
                    jMethod instVarNamed:'returnType'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9035
                        put:(self javaClassObjectForClass:retTypeClass).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9036
                    jMethod instVarNamed:'parameterTypes' put:argTypes.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9037
                    JavaMethods isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9038
                        JavaMethods := IdentityDictionary new
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9039
                    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9040
                    JavaMethods at:jMethod put:mthd.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9041
                    JavaMethods at:mthd put:jMethod.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9042
                    ^ jMethod.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9043
                ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9044
            ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9045
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9046
    self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9047
    self throwExceptionClassName:'java.lang.NoSuchMethodException'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9048
        withMessage:'not yet implemented'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9049
    ^ nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9050
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9051
    "Modified: / 22-10-1998 / 01:54:38 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9052
    "Modified: / 28-01-2011 / 14:36:26 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9053
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9054
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9055
_Class_getMethods0:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9056
    "get a method, given a name and type spec"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9057
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9058
    |jClass cls jmName mTypes whichAccess argSig sel methods|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9059
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9060
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9061
    cls := self reflection javaClassObjectForClass:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9062
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9063
    "/ 0 = PUBLIC (i.e. includes inherited) / 1 = DECLARED here
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9064
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9065
    whichAccess := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9066
    methods := OrderedCollection new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9067
    [cls isJavaClass] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9068
        cls methodDictionary 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9069
            keysAndValuesDo:[:sel :mthd | 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9070
                |i1 i2 jMethod argTypes retTypeClass|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9071
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9072
                mthd name printCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9073
                i1 := mthd signature indexOf:$(.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9074
                i2 := mthd signature indexOf:$) startingAt:(i1 + 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9075
                
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9076
                "/ create a java.lang.reflect.Method for it.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9077
                
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9078
                jMethod := (Java at:'java.lang.reflect.Method') new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9079
                jMethod instVarNamed:'clazz' put:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9080
                jMethod instVarNamed:'slot' put:sel.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9081
                jMethod instVarNamed:'name' put:(Java as_String:mthd name).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9082
                retTypeClass := mthd returnTypeClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9083
                retTypeClass isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9084
                    retTypeClass := #void
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9085
                ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9086
                argTypes := mthd argSignature.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9087
                argTypes := argTypes 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9088
                            collect:[:s | 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9089
                                |c|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9090
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9091
                                c := Java at:s.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9092
                                self javaClassObjectForClass:(c ? s asSymbol)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9093
                            ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9094
                jMethod instVarNamed:'returnType'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9095
                    put:(self javaClassObjectForClass:retTypeClass).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9096
                jMethod instVarNamed:'parameterTypes' put:argTypes.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9097
                
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9098
"/ (mthd name includesString:'setName') ifTrue:[self halt].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9099
                
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9100
                JavaMethods isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9101
                    JavaMethods := IdentityDictionary new
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9102
                ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9103
                JavaMethods at:jMethod put:mthd.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9104
                JavaMethods at:mthd put:jMethod.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9105
                methods add:jMethod.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9106
            ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9107
        whichAccess == 1 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9108
            "/ local methods only
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9109
            cls := nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9110
        ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9111
            cls := cls superclass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9112
        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9113
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9114
    methods := methods asArray.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9115
    ^ methods.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9116
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9117
    "Modified: / 22-10-1998 / 01:53:58 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9118
    "Modified: / 28-01-2011 / 14:36:58 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9119
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9120
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9121
_Class_getName:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9122
    "get a classes name"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9123
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9124
    |jClass cls nm|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9125
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9126
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9127
    cls := self reflection javaClassObjectForClass:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9128
    cls isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9129
        self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9130
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9131
    cls isJavaClass ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9132
        nm := (cls fullName copyReplaceAll:$/ with:$.)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9133
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9134
        cls isSymbol ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9135
            nm := cls
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9136
        ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9137
            nm := cls name
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9138
        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9139
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9140
    ^ Java as_String:nm.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9141
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9142
    "Modified: / 30-12-1998 / 21:13:50 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9143
    "Modified: / 28-01-2011 / 15:30:34 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9144
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9145
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9146
_Class_getSigners:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9147
    UnimplementedNativeMethodSignal raiseRequest
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9148
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9149
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9150
    "Created: / 12.11.1998 / 18:55:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9151
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9152
1028
d30cabc12354 fixed problem with classInit cycle.. still not booting :)
hlopkmar
parents: 1027
diff changeset
  9153
_Class_newInstance: nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9154
    "get an instance for a java.lang.Class"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9155
    
1028
d30cabc12354 fixed problem with classInit cycle.. still not booting :)
hlopkmar
parents: 1027
diff changeset
  9156
    | jClass  cls  newInst |
d30cabc12354 fixed problem with classInit cycle.. still not booting :)
hlopkmar
parents: 1027
diff changeset
  9157
self breakPoint:#mh.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9158
    jClass := nativeContext receiver.
1028
d30cabc12354 fixed problem with classInit cycle.. still not booting :)
hlopkmar
parents: 1027
diff changeset
  9159
    cls := self reflection javaClassObjectForClass: jClass.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9160
    cls classInit.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9161
    newInst := cls newCleared.
1028
d30cabc12354 fixed problem with classInit cycle.. still not booting :)
hlopkmar
parents: 1027
diff changeset
  9162
    newInst perform: #'<init>()V'.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9163
    ^ newInst
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9164
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9165
    "Created: / 02-01-1998 / 22:41:38 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9166
    "Modified: / 15-01-1998 / 00:57:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9167
    "Modified: / 28-01-2011 / 14:12:25 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9168
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9169
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9170
_Class_setSigners:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9171
    UnimplementedNativeMethodSignal raiseRequest
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9172
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9173
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9174
    "Created: / 12.11.1998 / 18:55:08 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9175
!
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9176
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9177
_ColorModel_deletepData:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9178
    "/ void deletepData ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9179
    UnimplementedNativeMethodSignal raiseRequest
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9180
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9181
    "Created: / 12.11.1998 / 19:22:05 / cg"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9182
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9183
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9184
_ColorModel_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9185
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9186
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9187
    "Created: / 28.1.1998 / 22:19:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9188
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9189
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9190
_Constructor_getModifiers:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9191
    "/ int getModifiers ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9192
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9193
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9194
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9195
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9196
    "Created: / 27.1.2000 / 02:54:38 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9197
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9198
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9199
_Constructor_newInstance:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9200
    "/ java.lang.Object newInstance (java.lang.Object[])
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9201
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9202
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9203
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9204
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9205
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9206
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9207
_Double_doubleToLongBits:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9208
    |f i|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9209
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9210
    f := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9211
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9212
    UninterpretedBytes isBigEndian ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9213
	i := f basicAt:8. 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9214
	i := i bitOr:((f basicAt:7) bitShift:8).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9215
	i := i bitOr:((f basicAt:6) bitShift:16).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9216
	i := i bitOr:((f basicAt:5) bitShift:24).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9217
	i := i bitOr:((f basicAt:4) bitShift:32).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9218
	i := i bitOr:((f basicAt:3) bitShift:40).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9219
	i := i bitOr:((f basicAt:2) bitShift:48).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9220
	i := i bitOr:((f basicAt:1) bitShift:56).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9221
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9222
	i := f basicAt:1. 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9223
	i := i bitOr:((f basicAt:2) bitShift:8).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9224
	i := i bitOr:((f basicAt:3) bitShift:16).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9225
	i := i bitOr:((f basicAt:4) bitShift:24).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9226
	i := i bitOr:((f basicAt:5) bitShift:32).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9227
	i := i bitOr:((f basicAt:6) bitShift:40).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9228
	i := i bitOr:((f basicAt:7) bitShift:48).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9229
	i := i bitOr:((f basicAt:8) bitShift:56).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9230
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9231
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9232
    ^ i.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9233
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9234
    "Created: / 4.1.1998 / 01:39:12 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9235
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9236
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9237
_Double_valueOf0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9238
    |s d|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9239
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9240
    s := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9241
    s notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9242
	s := Java as_ST_String:s.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9243
	d := Float readFrom:s onError:nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9244
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9245
    d isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9246
	self throwNumberFormatException.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9247
	"/ not reached
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9248
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9249
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9250
    ^ d
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9251
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9252
    "Modified: / 8.8.1997 / 12:03:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9253
    "Created: / 7.1.1998 / 11:09:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9254
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9255
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9256
_Field_get:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9257
    "/ java.lang.Object get (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9258
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9259
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9260
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9261
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9262
    "Created: / 27.1.2000 / 03:04:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9263
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9264
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9265
_Field_getBoolean:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9266
    "/ boolean getBoolean (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9267
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9268
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9269
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9270
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9271
    "Created: / 27.1.2000 / 03:05:16 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9272
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9273
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9274
_Field_getByte:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9275
    "/ byte getByte (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9276
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9277
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9278
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9279
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9280
    "Created: / 27.1.2000 / 03:05:30 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9281
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9282
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9283
_Field_getChar:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9284
    "/ char getChar (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9285
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9286
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9287
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9288
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9289
    "Created: / 27.1.2000 / 03:03:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9290
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9291
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9292
_Field_getDouble:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9293
    "/ double getDouble (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9294
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9295
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9296
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9297
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9298
    "Created: / 27.1.2000 / 03:07:49 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9299
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9300
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9301
_Field_getFloat:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9302
    "/ float getFloat (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9303
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9304
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9305
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9306
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9307
    "Created: / 27.1.2000 / 03:05:41 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9308
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9309
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9310
_Field_getInt:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9311
    "/ int getInt (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9312
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9313
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9314
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9315
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9316
    "Created: / 27.1.2000 / 03:04:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9317
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9318
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9319
_Field_getLong:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9320
    "/ long getLong (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9321
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9322
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9323
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9324
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9325
    "Created: / 27.1.2000 / 03:05:54 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9326
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9327
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9328
_Field_getModifiers:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9329
    "/ int getModifiers ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9330
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9331
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9332
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9333
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9334
    "Created: / 27.1.2000 / 03:07:03 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9335
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9336
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9337
_Field_getShort:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9338
    "/ unsigned short getShort (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9339
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9340
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9341
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9342
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9343
    "Created: / 27.1.2000 / 03:07:35 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9344
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9345
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9346
_Field_set:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9347
    "/ void set (java.lang.Object java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9348
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9349
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9350
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9351
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9352
    "Created: / 27.1.2000 / 03:04:33 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9353
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9354
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9355
_Field_setBoolean:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9356
    "/ void setBoolean (java.lang.Object boolean)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9357
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9358
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9359
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9360
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9361
    "Created: / 27.1.2000 / 03:06:06 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9362
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9363
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9364
_Field_setByte:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9365
    "/ void setByte (java.lang.Object byte)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9366
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9367
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9368
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9369
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9370
    "Created: / 27.1.2000 / 03:06:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9371
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9372
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9373
_Field_setChar:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9374
    "/ void setChar (java.lang.Object char)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9375
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9376
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9377
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9378
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9379
    "Created: / 27.1.2000 / 03:03:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9380
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9381
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9382
_Field_setDouble:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9383
    "/ void setDouble (java.lang.Object double)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9384
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9385
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9386
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9387
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9388
    "Created: / 27.1.2000 / 03:04:02 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9389
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9390
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9391
_Field_setFloat:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9392
    "/ void setFloat (java.lang.Object float)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9393
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9394
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9395
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9396
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9397
    "Created: / 27.1.2000 / 03:06:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9398
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9399
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9400
_Field_setInt:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9401
    "/ void setInt (java.lang.Object int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9402
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9403
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9404
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9405
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9406
    "Created: / 27.1.2000 / 03:05:04 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9407
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9408
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9409
_Field_setLong:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9410
    "/ void setLong (java.lang.Object long)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9411
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9412
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9413
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9414
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9415
    "Created: / 27.1.2000 / 03:06:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9416
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9417
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9418
_Field_setShort:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9419
    "/ void setShort (java.lang.Object unsigned short)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9420
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9421
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9422
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9423
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9424
    "Created: / 27.1.2000 / 03:03:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9425
!
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9426
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9427
_FileDescriptor_initSystemFD:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9428
    |descriptor fileNo idx myStream|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9429
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9430
    descriptor := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9431
    fileNo := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9432
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9433
    fileNo == 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9434
	myStream := Stdin
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9435
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9436
	fileNo == 1 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9437
	   myStream := JavaConsoleStream ? Stdout
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9438
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9439
	    fileNo == 2 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9440
		myStream := JavaConsoleStream ? Stderr
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9441
	    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9442
		self halt:'invalid fileNo given'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9443
		self internalError:'invalid fileNo given'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9444
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9445
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9446
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9447
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9448
    self setOpenFile:myStream at:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9449
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9450
    descriptor instVarNamed:'fd' put:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9451
    ^ descriptor
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9452
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9453
    "Modified: / 27.1.1998 / 18:15:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9454
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9455
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9456
_FileDescriptor_valid:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9457
    "/ boolean valid ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9458
    |descriptor fileNo stream|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9459
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9460
    descriptor := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9461
    fileNo := descriptor instVarNamed:'fd'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9462
    stream := self getOpenFileAt:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9463
    stream isNil ifTrue:[^ 0]. "/ FALSE 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9464
    stream isOpen ifFalse:[^ 0].  "/ FALSE 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9465
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9466
    ^ 1 "/ TRUE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9467
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9468
    "Modified: / 11.12.1998 / 13:02:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9469
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9470
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9471
_FileInputStream_close:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9472
    ^ self anyStream_close:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9473
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9474
    "Created: / 4.1.1998 / 17:45:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9475
    "Modified: / 4.2.1998 / 15:20:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9476
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9477
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9478
_FileInputStream_skip:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9479
    "/ long skip (long)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9480
    |file nSkip nSkipped|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9481
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9482
    file := self validateFile:(nativeContext receiver).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9483
    nSkip := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9484
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9485
    file == Stdin ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9486
	file := StdinReplacementFileQuerySignal raiseRequest.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9487
	file isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9488
	    ^ -1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9489
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9490
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9491
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9492
    FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9493
	(('JAVA: skip %1 byte(s) from ' bindWith:nSkip printString) , file pathName) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9494
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9495
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9496
    file skip:nSkip.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9497
    ^ nSkip
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9498
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9499
    "Modified: / 27.1.1999 / 20:36:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9500
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9501
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9502
_FileOutputStream_close:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9503
    ^ self anyStream_close:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9504
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9505
    "Created: / 13.1.1998 / 09:33:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9506
    "Modified: / 4.2.1998 / 15:20:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9507
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9508
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9509
_File_canRead0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9510
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9511
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9512
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9513
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9514
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9515
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9516
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9517
	FileAccessTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9518
	    path storeString print. ' ' print. thisContext printCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9519
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9520
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9521
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9522
	(f := path asFilename) isReadable ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9523
	    ^ 1 "/ TRUE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9524
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9525
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9526
    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9527
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9528
    "Created: / 4.1.1998 / 18:09:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9529
    "Modified: / 27.1.1999 / 18:57:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9530
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9531
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9532
_File_canWrite0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9533
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9534
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9535
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9536
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9537
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9538
	FileAccessTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9539
	    path storeString print. ' ' print. thisContext printCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9540
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9541
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9542
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9543
	(f := path asFilename) isWritable ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9544
	    ^ 1 "/ TRUE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9545
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9546
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9547
    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9548
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9549
    "Created: / 4.2.1998 / 00:19:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9550
    "Modified: / 27.1.1999 / 18:57:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9551
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9552
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9553
_File_canonPath:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9554
    "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9555
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9556
    |jPath path realPath|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9557
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9558
    jPath := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9559
    jPath isNil ifTrue:[^ jPath].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9560
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9561
    path := Java as_ST_String:jPath.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9562
    realPath := path asFilename pathName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9563
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9564
    ^ Java as_String:realPath
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9565
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9566
    "Created: / 27.1.1998 / 18:35:58 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9567
    "Modified: / 27.1.1998 / 21:36:03 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9568
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9569
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9570
_File_delete0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9571
    "/ boolean delete0 ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9572
    |oldFile oldPath oldF|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9573
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9574
    oldFile := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9575
    oldPath := oldFile instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9576
    oldPath isNil ifTrue:[^ 0].    "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9577
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9578
    oldPath := Java as_ST_String:oldPath.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9579
    oldF := oldPath asFilename.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9580
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9581
    oldF exists ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9582
	^ 1 "/ TRUE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9583
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9584
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9585
    (self checkWritePermissionOfDirectory:oldF directory message:('JAVA Security check\\Delete of ''' , oldPath , '''.\Grant permission ?'))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9586
    ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9587
	^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9588
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9589
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9590
    OperatingSystem accessDeniedErrorSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9591
	^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9592
    ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9593
	oldF delete.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9594
	^ 1 "/ TRUE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9595
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9596
    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9597
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9598
    "Modified: / 30.12.1998 / 20:15:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9599
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9600
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9601
_File_exists0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9602
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9603
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9604
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9605
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9606
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9607
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9608
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9609
	FileAccessTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9610
	    path storeString print. ' ' print. thisContext printCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9611
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9612
	(f := path asFilename) exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9613
	    ^ 1 "TRUE"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9614
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9615
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9616
    ^ 0 "FALSE"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9617
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9618
    "Created: / 5.1.1998 / 02:07:48 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9619
    "Modified: / 27.1.1999 / 18:57:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9620
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9621
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9622
_File_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9623
    "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9624
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9625
    "Created: / 27.1.1998 / 18:25:19 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9626
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9627
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9628
_File_isAbsolute:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9629
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9630
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9631
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9632
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9633
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9634
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9635
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9636
	(f := path asFilename) isAbsolute ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9637
	    ^ 1 "/ TRUE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9638
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9639
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9640
    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9641
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9642
    "Created: / 11.1.1998 / 09:54:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9643
    "Modified: / 20.10.1998 / 20:59:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9644
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9645
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9646
_File_isDirectory0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9647
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9648
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9649
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9650
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9651
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9652
	FileAccessTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9653
	    path storeString print. ' ' print. thisContext printCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9654
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9655
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9656
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9657
	(f := path asFilename) exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9658
	    f isDirectory ifTrue:[^ 1 "TRUE"]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9659
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9660
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9661
    ^ 0 "FALSE"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9662
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9663
    "Created: / 7.1.1998 / 10:31:37 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9664
    "Modified: / 27.1.1999 / 18:58:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9665
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9666
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9667
_File_isFile0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9668
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9669
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9670
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9671
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9672
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9673
	FileAccessTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9674
	    path storeString print. ' ' print. thisContext printCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9675
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9676
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9677
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9678
	(f := path asFilename) exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9679
	    f isDirectory ifFalse:[^ 1 "TRUE"]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9680
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9681
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9682
    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9683
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9684
    "Created: / 11.1.1998 / 11:40:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9685
    "Modified: / 27.1.1999 / 18:58:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9686
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9687
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9688
_File_lastModified0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9689
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9690
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9691
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9692
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9693
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9694
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9695
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9696
	(f := path asFilename) exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9697
	    ^ f modificationTime getMilliseconds.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9698
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9699
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9700
    ^ 0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9701
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9702
    "Created: / 4.2.1998 / 16:50:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9703
    "Modified: / 20.10.1998 / 21:00:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9704
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9705
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9706
_File_length0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9707
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9708
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9709
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9710
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9711
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9712
	FileAccessTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9713
	    thisContext printCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9714
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9715
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9716
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9717
	(f := path asFilename) exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9718
	    ^ f fileSize
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9719
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9720
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9721
    ^ -1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9722
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9723
    "Created: / 7.1.1998 / 12:18:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9724
    "Modified: / 27.1.1999 / 18:57:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9725
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9726
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9727
_File_list0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9728
    |file path f files|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9729
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9730
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9731
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9732
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9733
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9734
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9735
	(f := path asFilename) exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9736
	    f isDirectory ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9737
		files := f directoryContents asArray.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9738
		files := files collect:[:nm | Java as_String:nm].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9739
		^ files
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9740
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9741
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9742
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9743
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9744
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9745
    "Created: / 14.1.1998 / 21:30:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9746
    "Modified: / 20.10.1998 / 21:00:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9747
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9748
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9749
_File_mkdir0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9750
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9751
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9752
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9753
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9754
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9755
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9756
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9757
	f := path asFilename.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9758
	(f exists and:[f isDirectory]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9759
	    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9760
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9761
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9762
	FileOpenConfirmation ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9763
	    (self confirm:('JAVA Security check\\Create directory ''' , path , '''.\Grant permission ?') withCRs)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9764
	    ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9765
		^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9766
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9767
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9768
	OperatingSystem accessDeniedErrorSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9769
	    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9770
	] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9771
	    f makeDirectory.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9772
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9773
	f  exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9774
	    f isDirectory ifTrue:[^ 1 "TRUE"]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9775
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9776
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9777
    ^ 0 "FALSE"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9778
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9779
    "Created: / 4.2.1998 / 00:19:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9780
    "Modified: / 4.12.1998 / 14:04:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9781
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9782
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9783
_File_renameTo0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9784
    "/ void renameTo0 (java.io.File)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9785
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9786
    |oldFile newFile oldPath newPath oldF newF|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9787
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9788
    oldFile := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9789
    oldPath := oldFile instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9790
    oldPath isNil ifTrue:[^ 0].    "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9791
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9792
    oldPath := Java as_ST_String:oldPath.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9793
    oldF := oldPath asFilename.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9794
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9795
    newFile := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9796
    newPath := newFile instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9797
    newPath isNil ifTrue:[^ 0].    "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9798
    newPath := Java as_ST_String:newPath.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9799
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9800
    newF := newPath asFilename.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9801
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9802
    (self checkWritePermissionOfDirectory:oldF directory message:('JAVA Security check\\Rename of ''' , oldPath , ''' to ''' , newPath , '''.\Grant permission ?'))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9803
    ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9804
	^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9805
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9806
    oldF directory pathName ~= newF directory pathName ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9807
	(self checkWritePermissionOfDirectory:newF directory message:('JAVA Security check\\Rename of ''' , oldPath , ''' to ''' , newPath , '''.\Grant permission ?'))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9808
	ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9809
	    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9810
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9811
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9812
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9813
    OperatingSystem accessDeniedErrorSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9814
	^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9815
    ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9816
	oldF renameTo:newF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9817
	^ 1 "/ TRUE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9818
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9819
    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9820
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9821
    "Modified: / 3.12.1998 / 21:01:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9822
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9823
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9824
_File_rmdir0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9825
    "/ boolean rmdir0 ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9826
    UnimplementedNativeMethodSignal raiseRequest
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9827
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9828
    "Modified: / 12.11.1998 / 19:01:48 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9829
    "Created: / 12.11.1998 / 19:03:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9830
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9831
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9832
_Float_floatToIntBits:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9833
    |f i|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9834
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9835
    f := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9836
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9837
    UninterpretedBytes isBigEndian ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9838
	i := f basicAt:4. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9839
	i := i bitOr:((f basicAt:3) bitShift:8).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9840
	i := i bitOr:((f basicAt:2) bitShift:16).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9841
	i := i bitOr:((f basicAt:1) bitShift:24).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9842
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9843
	i := f basicAt:1. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9844
	i := i bitOr:((f basicAt:2) bitShift:8).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9845
	i := i bitOr:((f basicAt:3) bitShift:16).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9846
	i := i bitOr:((f basicAt:4) bitShift:24).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9847
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9848
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9849
    ^ i.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9850
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9851
    "Created: / 4.1.1998 / 01:25:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9852
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9853
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9854
_FontDescriptor_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9855
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9856
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9857
    "Created: / 28.1.1998 / 22:30:52 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9858
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9859
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9860
_Font_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9861
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9862
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9863
    "Created: / 27.1.1998 / 21:43:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9864
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9865
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9866
_GifImageDecoder_parseImage:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9867
    |decoder width height bool1 depth subHdrBytes dstBytes i1 i2 colorModel
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9868
     stream byte compressedData compressedSize index count data 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9869
     leftOffs topOffs codeLen flags pixelStore clrModel t buffSize 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9870
     countGot countGot2|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9871
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9872
    decoder := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9873
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9874
    i1 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9875
    i2 := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9876
    width := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9877
    height := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9878
    bool1 := nativeContext argAt:5.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9879
    depth := nativeContext argAt:6.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9880
    subHdrBytes := nativeContext argAt:7.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9881
    dstBytes := nativeContext argAt:8.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9882
    colorModel := nativeContext argAt:9.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9883
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9884
    leftOffs := subHdrBytes wordAt:1 MSB:false.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9885
    topOffs := subHdrBytes wordAt:3 MSB:false.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9886
    width := subHdrBytes wordAt:5 MSB:false.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9887
    height := subHdrBytes wordAt:7 MSB:false.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9888
    flags := subHdrBytes at:9.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9889
    codeLen := subHdrBytes at:10.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9890
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9891
    stream := decoder instVarNamed:'input'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9892
    pixelStore := decoder instVarNamed:'store'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9893
    pixelStore isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9894
	^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9895
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9896
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9897
    buffSize := (width * height // 2) max:4096.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9898
    compressedData := ByteArray uninitializedNew:buffSize.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9899
    "get compressed data"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9900
    index := 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9901
    count := stream perform:#'read()I'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9902
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9903
    [count notNil and:[count > 0]] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9904
	(index + count) > buffSize ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9905
	    t := ByteArray uninitializedNew:(buffSize * 2).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9906
	    t replaceFrom:1 to:buffSize with:compressedData startingAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9907
	    compressedData := t.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9908
	    buffSize := buffSize * 2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9909
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9910
	[count ~~ 0] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9911
	    countGot := stream 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9912
			perform:#'read([BII)I' 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9913
			with:compressedData
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9914
			with:index-1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9915
			with:count.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9916
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9917
	    countGot > 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9918
		count := count - countGot.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9919
		index := index + countGot.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9920
	    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9921
		count := -1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9922
	    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9923
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9924
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9925
	count >= 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9926
	    count := stream perform:#read.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9927
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9928
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9929
    compressedSize := index - 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9930
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9931
    data := pixelStore perform:#'allocateLines(I)Ljava/lang/Object;' with:height.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9932
    (data isMemberOf:ByteArray) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9933
	self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9934
	^ 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9935
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9936
"/    'GIFReader: decompressing ...' infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9937
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9938
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9939
    GIFReader 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9940
	decompressGIFFrom:compressedData
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9941
	count:compressedSize
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9942
	into:data
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9943
	startingAt:1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9944
	codeLen:(codeLen + 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9945
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9946
    clrModel := pixelStore instVarNamed:'colormodel'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9947
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9948
    pixelStore 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9949
	perform:#'setPixels(IIII[BII)Z'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9950
	withArguments:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9951
	    (Array 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9952
		with:0        "/ x
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9953
		with:0        "/ y
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9954
		with:width    "/ w
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9955
		with:height   "/ h
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9956
		with:data
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9957
		with:0        "/ offs
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9958
		with:width).   "/ scanSize
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9959
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9960
    pixelStore  perform:#'imageComplete()V'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9961
"/        perform:#'imageComplete(I)V' 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9962
"/        with:((Java at:'java.awt.image.ImageConsumer') instVarNamed:'STATICIMAGEDONE').
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9963
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9964
"/ self internalError:'breakPoint'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9965
    ^ 1 "/ true
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9966
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9967
    "Modified: / 10.4.1998 / 14:31:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9968
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9969
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9970
_ImageRepresentation_disposeImage:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9971
    |imgRep img|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9972
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9973
    imgRep := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9974
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9975
    img := imgRep instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9976
    (img notNil and:[img ~~ 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9977
	ImageStretchCache notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9978
	    ImageStretchCache removeKey:img ifAbsent:nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9979
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9980
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9981
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9982
    imgRep instVarNamed:'pData' put:0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9983
"/    self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9984
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9985
    "Created: / 7.1.1998 / 22:31:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9986
    "Modified: / 17.1.1998 / 13:26:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9987
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9988
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9989
_ImageRepresentation_finish:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9990
    |imgRep bool|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9991
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9992
    imgRep := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9993
    bool := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9994
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9995
"/    'JAVA: ImageRepresentation_finish ignored for now' infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9996
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9997
    ^ 1 "/ true
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9998
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9999
    "Created: / 8.1.1998 / 00:11:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10000
    "Modified: / 6.2.1998 / 02:12:54 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10001
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10002
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10003
_ImageRepresentation_imageDraw:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10004
    |imgRep x y img deviceImage jGraphics gc clr|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10005
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10006
    imgRep := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10007
    img := imgRep instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10008
    (img isNil or:[img == 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10009
	"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10010
	^ self.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10011
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10012
    jGraphics := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10013
    gc := jGraphics instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10014
    gc realized ifFalse:[^ self].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10015
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10016
    x := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10017
    y := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10018
    clr := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10019
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10020
    deviceImage := img onDevice:gc device.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10021
    deviceImage ~~ img ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10022
	imgRep instVarNamed:'pData' put:deviceImage.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10023
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10024
    gc realized ifFalse:[^ self].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10025
    deviceImage displayOn:gc x:x y:y.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10026
    ^ 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10027
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10028
    "Created: / 13.1.1998 / 13:32:28 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10029
    "Modified: / 25.11.1998 / 15:36:38 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10030
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10031
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10032
_ImageRepresentation_imageStretch:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10033
    |imgRep x1 y1 x2 y2 srcX1 srcY1 w h 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10034
     img deviceImage jGraphics gc clr stretchWidth stretchHeight|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10035
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10036
    imgRep := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10037
    img := imgRep instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10038
    (img isNil or:[img == 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10039
	"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10040
	^ self.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10041
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10042
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10043
    jGraphics := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10044
    gc := jGraphics instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10045
    gc realized ifFalse:[^ self].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10046
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10047
    x1 := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10048
    y1 := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10049
    x2 := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10050
    y2:= nativeContext argAt:5.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10051
    srcX1 := nativeContext argAt:6.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10052
    srcY1 := nativeContext argAt:7.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10053
    w := nativeContext argAt:8.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10054
    h := nativeContext argAt:9.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10055
    clr := nativeContext argAt:10.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10056
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10057
    (srcX1 ~~ 0 or:[srcY1 ~~ 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10058
	self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10059
	^ self.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10060
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10061
    (w ~~ img width or:[h ~~ img height]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10062
	self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10063
	^ self
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10064
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10065
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10066
    "/ TODO: remember magnified images somewhere for a while,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10067
    "/ to avoid repeated action ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10068
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10069
    stretchWidth := (x2-x1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10070
    stretchHeight := (y2-y1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10071
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10072
    (stretchWidth == img width
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10073
    and:[stretchHeight == img height]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10074
	deviceImage := img onDevice:gc device.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10075
	deviceImage ~~ img ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10076
	    imgRep instVarNamed:'pData' put:deviceImage.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10077
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10078
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10079
	ImageStretchCache notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10080
	    deviceImage := ImageStretchCache at:img ifAbsent:nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10081
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10082
	(deviceImage isNil 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10083
	or:[deviceImage width ~~ stretchWidth
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10084
	or:[deviceImage height ~~ stretchHeight]]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10085
	    deviceImage := (img magnifiedTo:stretchWidth@stretchHeight) onDevice:gc device.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10086
	    ImageStretchCache isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10087
		ImageStretchCache := WeakIdentityDictionary new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10088
	    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10089
	    ImageStretchCache at:img put:deviceImage
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10090
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10091
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10092
    deviceImage displayOn:gc x:x1 y:y1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10093
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10094
    "Created: / 13.1.1998 / 13:32:28 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10095
    "Modified: / 15.1.1998 / 13:14:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10096
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10097
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10098
_ImageRepresentation_offscreenInit:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10099
    |imgRep jclr w h form screenDevice|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10100
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10101
    imgRep := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10102
    jclr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10103
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10104
    w := imgRep instVarNamed:'width'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10105
    h := imgRep instVarNamed:'height'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10106
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10107
    screenDevice := Screen current.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10108
    form := Form width:w height:h depth:(screenDevice depth) on:screenDevice.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10109
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10110
    imgRep instVarNamed:'pData' put:form.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10111
    "/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10112
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10113
    "Created: / 7.1.1998 / 22:31:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10114
    "Modified: / 17.1.1998 / 12:36:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10115
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10116
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10117
_ImageRepresentation_setBytePixels:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10118
    |imgRep x y w h clrModel bytes offs i2
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10119
     img depth cmap rgbMap opaque transparentColorIndex
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10120
     scanLineWidth nBytes srcIdx dstIdx|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10121
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10122
    imgRep := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10123
    x := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10124
    y := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10125
    w := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10126
    h := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10127
    clrModel := nativeContext argAt:5.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10128
    bytes := nativeContext argAt:6.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10129
    offs := nativeContext argAt:7.  "/ offset ??
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10130
    scanLineWidth := nativeContext argAt:8.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10131
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10132
    depth := clrModel instVarNamed:'pixel_bits'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10133
    (clrModel instVarNamed:'map_size') ~~ 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10134
	rgbMap := clrModel instVarNamed:'rgb'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10135
	cmap := Array new:rgbMap size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10136
	rgbMap 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10137
	    keysAndValuesDo:[:idx :rgb |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10138
		cmap at:idx put:(Color rgbValue:(rgb bitAnd:16rFFFFFF))
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10139
	    ].        
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10140
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10141
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10142
    opaque := (clrModel instVarNamed:'opaque') ~~ 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10143
    opaque ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10144
	transparentColorIndex := clrModel instVarNamed:'transparent_index'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10145
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10146
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10147
    img := imgRep instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10148
    (img isNil or:[img == 0]) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10149
"/        self halt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10150
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10151
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10152
    (offs ~~ 0 or:[scanLineWidth ~~ w]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10153
	nBytes := ByteArray new:w*h.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10154
	srcIdx := offs+1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10155
	dstIdx := 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10156
	1 to:h do:[:y |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10157
	    nBytes replaceFrom:dstIdx to:(dstIdx+w-1) with:bytes startingAt:srcIdx.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10158
	    srcIdx := srcIdx + scanLineWidth.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10159
	    dstIdx := dstIdx + w.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10160
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10161
	bytes := nBytes.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10162
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10163
    img := Image width:w height:h depth:depth fromArray:bytes.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10164
    cmap notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10165
	img colorMap:cmap.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10166
	img photometric:#palette
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10167
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10168
    opaque ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10169
	img mask:(ImageReader 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10170
		    buildMaskFromColor:transparentColorIndex 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10171
		    for:bytes
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10172
		    width:w
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10173
		    height:h)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10174
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10175
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10176
    imgRep instVarNamed:'pData' put:img.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10177
    ^ 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10178
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10179
    "Created: / 7.1.1998 / 22:31:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10180
    "Modified: / 21.10.1998 / 00:35:45 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10181
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10182
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10183
_ImageRepresentation_setIntPixels:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10184
    |imgRep x y w h clrModel ints offs scanLineWidth
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10185
     img depth cmap rgbMap opaque transparentColorIndex
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10186
     bytes srcIdx dstIdx val red green blue
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10187
     redMask greenMask blueMask redShift greenShift blueShift|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10188
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10189
    imgRep := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10190
    x := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10191
    y := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10192
    w := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10193
    h := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10194
    clrModel := nativeContext argAt:5.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10195
    ints := nativeContext argAt:6.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10196
    offs := nativeContext argAt:7.  "/ offset ??
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10197
    scanLineWidth := nativeContext argAt:8.  "/ scanLineWidth ??
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10198
    opaque := false.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10199
offs ~~ 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10200
 self halt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10201
].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10202
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10203
    depth := clrModel instVarNamed:'pixel_bits'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10204
    clrModel class == (Java at:'java.awt.image.DirectColorModel') ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10205
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10206
	(clrModel instVarNamed:'map_size') ~~ 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10207
	    rgbMap := clrModel instVarNamed:'rgb'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10208
	    cmap := Array new:rgbMap size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10209
	    rgbMap 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10210
		keysAndValuesDo:[:idx :rgb |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10211
		    cmap at:idx put:(Color rgbValue:(rgb bitAnd:16rFFFFFF))
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10212
		].        
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10213
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10214
	opaque := (clrModel instVarNamed:'opaque') ~~ 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10215
	opaque ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10216
	    transparentColorIndex := clrModel instVarNamed:'transparent_index'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10217
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10218
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10219
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10220
    img := imgRep instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10221
    (img isNil or:[img == 0]) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10222
"/        self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10223
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10224
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10225
    depth == 32 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10226
	"/ temporary kludge - ony use 24 bits/pixel
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10227
	bytes := ByteArray new:w*h*3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10228
	srcIdx := 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10229
	dstIdx := 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10230
	redMask := clrModel instVarNamed:'red_mask'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10231
	greenMask := clrModel instVarNamed:'green_mask'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10232
	blueMask := clrModel instVarNamed:'blue_mask'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10233
	redShift := (clrModel instVarNamed:'red_offset') negated.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10234
	greenShift := (clrModel instVarNamed:'green_offset') negated.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10235
	blueShift := (clrModel instVarNamed:'blue_offset') negated.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10236
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10237
	1 to:h do:[:y |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10238
	    1 to:w do:[:x |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10239
		val := ints at:srcIdx.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10240
		red := (val bitAnd:redMask) bitShift:redShift.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10241
		green := (val bitAnd:greenMask) bitShift:greenShift.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10242
		blue := (val bitAnd:blueMask) bitShift:blueShift.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10243
		bytes at:dstIdx put:red.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10244
		bytes at:dstIdx+1 put:green.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10245
		bytes at:dstIdx+2 put:blue.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10246
		dstIdx := dstIdx + 3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10247
		srcIdx := srcIdx + 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10248
	    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10249
	    srcIdx := srcIdx + (scanLineWidth - w).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10250
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10251
	img := Depth24Image width:w height:h depth:24 fromArray:bytes.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10252
	img photometric:#rgb.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10253
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10254
	scanLineWidth ~~ w ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10255
	    self halt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10256
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10257
	img := Image width:w height:h depth:depth fromArray:ints.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10258
	cmap notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10259
	    img colorMap:cmap.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10260
	    img photometric:#palette
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10261
	] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10262
	    img photometric:#rgb
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10263
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10264
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10265
    opaque ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10266
	img mask:(ImageReader 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10267
		    buildMaskFromColor:transparentColorIndex 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10268
		    for:ints
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10269
		    width:w
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10270
		    height:h)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10271
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10272
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10273
    imgRep instVarNamed:'pData' put:img.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10274
    ^ 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10275
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10276
    "Created: / 1.2.1998 / 17:38:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10277
    "Modified: / 21.10.1998 / 00:35:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10278
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10279
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10280
_InetAddressImpl_getHostByAddr:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10281
    "/ java.lang.String getHostByAddr (int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10282
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10283
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10284
    "Created: / 12.11.1998 / 19:08:04 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10285
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10286
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10287
_InetAddressImpl_getInetFamily:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10288
    "/ self unimplementedNativeMethod.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10289
    ^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10290
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10291
    "Modified: / 15.8.1997 / 17:04:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10292
    "Created: / 5.1.1998 / 02:05:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10293
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10294
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10295
_InetAddressImpl_getLocalHostName:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10296
    ""
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10297
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10298
    |hostName|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10299
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10300
    hostName := OperatingSystem getHostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10301
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10302
    ^ (Java as_String:hostName).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10303
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10304
    "Modified: / 7.8.1997 / 21:16:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10305
    "Created: / 5.1.1998 / 02:07:03 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10306
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10307
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10308
_InetAddressImpl_lookupAllHostAddr:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10309
    ""
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10310
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10311
    |jAddrImpl jHostName hostName addrBytes|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10312
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10313
    jAddrImpl := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10314
    jHostName := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10315
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10316
    hostName := Java as_ST_String:jHostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10317
    addrBytes := Socket ipAddressOfHost:hostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10318
    addrBytes isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10319
	addrBytes := #[0 0 0 0] copy
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10320
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10321
    ^ Array with:addrBytes
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10322
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10323
    "Modified: / 8.8.1997 / 12:04:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10324
    "Created: / 7.1.1998 / 18:51:31 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10325
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10326
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10327
_InetAddressImpl_makeAnyLocalAddress:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10328
    ""
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10329
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10330
    |jAddrImpl jAddr hostName addrBytes address|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10331
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10332
    jAddrImpl := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10333
    jAddr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10334
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10335
    hostName := OperatingSystem getHostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10336
    addrBytes := Socket ipAddressOfHost:hostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10337
    addrBytes isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10338
	addrBytes := #[127 0 0 0].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10339
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10340
    "/ MSB first into an integer.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10341
    address := (addrBytes at:1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10342
    address := (address bitShift:8) bitOr:(addrBytes at:2).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10343
    address := (address bitShift:8) bitOr:(addrBytes at:3).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10344
    address := (address bitShift:8) bitOr:(addrBytes at:4).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10345
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10346
    jAddr instVarNamed:'hostName' put:(Java as_String:hostName).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10347
    jAddr instVarNamed:'address' put:address.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10348
    jAddr instVarNamed:'family' put:0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10349
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10350
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10351
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10352
    "Created: / 5.1.1998 / 02:06:27 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10353
    "Modified: / 21.10.1998 / 03:30:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10354
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10355
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10356
_InetAddress_getInetFamily:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10357
    "/ self unimplementedNativeMethod.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10358
    ^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10359
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10360
    "Modified: / 15.8.1997 / 17:04:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10361
    "Created: / 17.11.1998 / 23:54:38 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10362
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10363
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10364
_InetAddress_getLocalHostName:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10365
    ""
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10366
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10367
    |hostName|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10368
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10369
    hostName := OperatingSystem getHostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10370
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10371
    ^ Java as_String:hostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10372
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10373
    "Modified: / 7.8.1997 / 21:16:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10374
    "Created: / 17.11.1998 / 23:54:54 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10375
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10376
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10377
_InetAddress_lookupAllHostAddr:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10378
    ""
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10379
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10380
    |jAddrImpl jHostName hostName addrBytes|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10381
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10382
    jAddrImpl := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10383
    jHostName := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10384
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10385
    hostName := Java as_ST_String:jHostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10386
    addrBytes := Socket ipAddressOfHost:hostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10387
    addrBytes isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10388
	addrBytes := #[0 0 0 0] copy
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10389
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10390
    ^ Array with:addrBytes
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10391
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10392
    "Modified: / 8.8.1997 / 12:04:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10393
    "Created: / 17.11.1998 / 23:56:10 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10394
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10395
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10396
_InetAddress_lookupHostByAddr:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10397
    "java.lang.Object[] lookupHostByAddr (int)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10398
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10399
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10400
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10401
    "Created: / 27.1.2000 / 02:59:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10402
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10403
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10404
_InetAddress_lookupHostByName:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10405
    "java.lang.Object[] lookupHostByName (java.lang.String)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10406
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10407
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10408
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10409
    "Modified: / 27.1.2000 / 02:58:53 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10410
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10411
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10412
_InetAddress_makeAnyLocalAddress:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10413
    ""
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10414
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10415
    |jAddrImpl jAddr hostName addrBytes address|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10416
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10417
    jAddrImpl := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10418
    jAddr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10419
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10420
    hostName := OperatingSystem getHostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10421
    addrBytes := Socket ipAddressOfHost:hostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10422
    addrBytes isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10423
	addrBytes := #[127 0 0 0].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10424
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10425
    "/ MSB first into an integer.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10426
    address := (addrBytes at:1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10427
    address := (address bitShift:8) bitOr:(addrBytes at:2).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10428
    address := (address bitShift:8) bitOr:(addrBytes at:3).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10429
    address := (address bitShift:8) bitOr:(addrBytes at:4).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10430
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10431
    jAddr instVarNamed:'hostName' put:(Java as_String:hostName).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10432
    jAddr instVarNamed:'address' put:address.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10433
    jAddr instVarNamed:'family' put:0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10434
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10435
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10436
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10437
    "Modified: / 21.10.1998 / 03:30:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10438
    "Created: / 17.11.1998 / 23:54:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10439
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10440
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10441
_Inflater_end0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10442
    "/ void end0 ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10443
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10444
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10445
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10446
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10447
    "Created: / 27.1.2000 / 03:11:21 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10448
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10449
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10450
_Inflater_getAdler0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10451
    "/ int getAdler0 ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10452
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10453
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10454
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10455
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10456
    "Created: / 27.1.2000 / 03:12:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10457
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10458
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10459
_Inflater_getTotalIn0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10460
    "/ int getTotalIn0 ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10461
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10462
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10463
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10464
    "Created: / 27.1.2000 / 03:10:50 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10465
    "Modified: / 27.1.2000 / 03:11:08 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10466
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10467
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10468
_Inflater_getTotalOut0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10469
    "/ int getTotalOut0 ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10470
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10471
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10472
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10473
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10474
    "Created: / 27.1.2000 / 03:12:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10475
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10476
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10477
_Inflater_inflate0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10478
    "/ int inflate0 (byte[] int int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10479
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10480
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10481
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10482
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10483
    "Created: / 27.1.2000 / 03:11:39 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10484
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10485
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10486
_Inflater_reset0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10487
    "/ void reset0 ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10488
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10489
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10490
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10491
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10492
    "Created: / 27.1.2000 / 03:11:02 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10493
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10494
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10495
_Inflater_setDictionary0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10496
    "/ void setDictionary0 (byte[] int int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10497
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10498
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10499
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10500
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10501
    "Created: / 27.1.2000 / 03:10:33 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10502
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10503
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10504
_InputThread_run:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10505
    self _WToolkit_eventLoop:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10506
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10507
    "Created: / 28.1.1998 / 22:34:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10508
    "Modified: / 28.1.1998 / 22:35:16 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10509
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10510
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10511
_Introspector_getMethodDescriptor:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10512
    "java.lang.String getMethodDescriptor (java.lang.reflect.Method)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10513
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10514
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10515
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10516
    "Created: / 27.1.2000 / 02:47:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10517
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10518
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10519
_Introspector_getMethodParameterCount:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10520
    "int getMethodParameterCount (java.lang.reflect.Method)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10521
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10522
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10523
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10524
    "Created: / 27.1.2000 / 02:49:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10525
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10526
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10527
_Introspector_getPublicDeclaredMethods0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10528
    "java.lang.reflect.Method[] getPublicDeclaredMethods0 (java.lang.Class)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10529
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10530
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10531
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10532
    "Created: / 27.1.2000 / 02:48:49 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10533
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10534
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10535
_JPEGImageDecoder_readImage:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10536
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10537
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10538
    "Created: / 12.11.1998 / 18:53:30 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10539
    "Modified: / 12.11.1998 / 18:53:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10540
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10541
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10542
_MButtonPeer_create:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10543
    ^ self _WButtonPeer_create:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10544
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10545
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10546
_MCanvasPeer_create:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10547
    |jCanvasPeer jFrame frame subView|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10548
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10549
    jCanvasPeer := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10550
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10551
    jFrame := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10552
    jFrame isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10553
	self halt:'no frame in canvasPeer create'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10554
	self internalError:'no frame in canvasPeer create'.     
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10555
	^ self.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10556
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10557
    frame := jFrame instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10558
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10559
    subView := JavaView in:frame.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10560
    subView delegate:self.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10561
    subView javaPeer:jCanvasPeer.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10562
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10563
    self createdWindowsView:subView for:jCanvasPeer.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10564
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10565
    WindowCreationTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10566
	'WCanvasPeer_create: ' print. frame print. ' -> ' print. subView printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10567
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10568
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10569
    "Modified: / 16.1.1998 / 13:40:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10570
    "Created: / 18.11.1998 / 00:14:44 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10571
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10572
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10573
_MComponentPeer_cacheInit:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10574
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10575
    "Created: / 28.1.1998 / 22:22:30 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10576
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10577
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10578
_MComponentPeer_handleEvent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10579
    ^ self _WComponentPeer_handleEvent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10580
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10581
    "Created: / 18.11.1998 / 00:21:17 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10582
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10583
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10584
_MComponentPeer_nativeHandleEvent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10585
    ^ self _WComponentPeer_nativeHandleEvent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10586
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10587
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10588
_MComponentPeer_pHide:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10589
    ^ self _WComponentPeer_hide:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10590
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10591
    "Created: / 18.11.1998 / 00:15:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10592
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10593
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10594
_MComponentPeer_pInitialize:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10595
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10596
    "Created: / 28.1.1998 / 22:27:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10597
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10598
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10599
_MComponentPeer_pReshape:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10600
    self commonReshapeComponent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10601
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10602
    "Created: / 18.11.1998 / 00:18:17 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10603
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10604
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10605
_MComponentPeer_pSetBackground:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10606
    |view jClr rgb clr|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10607
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10608
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10609
    jClr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10610
    rgb := jClr instVarNamed:'value'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10611
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10612
    clr := Color rgbValue:rgb.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10613
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10614
    clr := clr on:(view device).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10615
    (view isKindOf:ScrollableView) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10616
        view := view scrolledView
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10617
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10618
    view viewBackground:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10619
    view backgroundPaint:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10620
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10621
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10622
_MComponentPeer_pSetFont:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10623
    |view jFont stFont name style size|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10624
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10625
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10626
    jFont := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10627
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10628
    stFont := jFont instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10629
    (stFont isNil or:[stFont == 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10630
        name := jFont instVarNamed:'name'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10631
        style := jFont instVarNamed:'style'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10632
        size := jFont instVarNamed:'size'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10633
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10634
        stFont := self replacementFontFor:(Java as_ST_String:name) style:style size:size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10635
        jFont instVarNamed:'pData' put:stFont.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10636
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10637
    view font:stFont.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10638
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10639
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10640
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10641
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10642
_MComponentPeer_pSetForeground:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10643
    |view jClr rgb clr|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10644
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10645
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10646
    jClr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10647
    rgb := jClr instVarNamed:'value'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10648
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10649
    clr := Color rgbValue:rgb.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10650
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10651
    clr := clr on:(view device).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10652
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10653
    (view isKindOf:ScrollableView) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10654
        view := view scrolledView
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10655
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10656
    view foregroundColor:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10657
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10658
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10659
_MComponentPeer_pShow:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10660
    |view|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10661
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10662
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10663
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10664
    "/ frame views are under my browsers own control
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10665
    (view isMemberOf:JavaEmbeddedFrameView) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10666
	view beVisible.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10667
	view realize.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10668
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10669
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10670
"/    view windowGroup notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10671
"/        windowServer addGroup:(view windowGroup)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10672
"/    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10673
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10674
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10675
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10676
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10677
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10678
    "Modified: / 25.1.1998 / 09:54:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10679
    "Created: / 18.11.1998 / 00:21:51 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10680
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10681
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10682
_MComponentPeer_setBackground:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10683
    |jClr rgb clr view|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10684
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10685
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10686
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10687
    jClr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10688
    rgb := jClr instVarNamed:'value'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10689
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10690
    clr := Color rgbValue:rgb.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10691
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10692
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10693
    clr := clr on:(view device).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10694
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10695
    (view isKindOf:ScrollableView) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10696
	view := view scrolledView
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10697
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10698
    view viewBackground:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10699
    view backgroundPaint:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10700
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10701
    "Created: / 17.11.1998 / 23:49:41 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10702
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10703
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10704
_MComponentPeer_setCursor:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10705
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10706
    "Created: / 28.1.1998 / 22:27:35 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10707
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10708
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10709
_MComponentPeer_setFont:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10710
    |view|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10711
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10712
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10713
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10714
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10715
    "Modified: / 25.1.1998 / 01:22:19 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10716
    "Created: / 17.11.1998 / 23:43:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10717
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10718
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10719
_MComponentPeer_setForeground:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10720
    |jClr rgb clr view|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10721
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10722
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10723
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10724
    jClr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10725
    rgb := jClr instVarNamed:'value'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10726
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10727
    clr := Color rgbValue:rgb.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10728
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10729
    clr := clr on:(view device).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10730
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10731
    view paint:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10732
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10733
    "Created: / 17.11.1998 / 23:50:31 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10734
    "Modified: / 17.11.1998 / 23:57:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10735
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10736
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10737
_MFramePeer_create:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10738
    ^ self _WFramePeer_create:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10739
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10740
    "Created: / 28.1.1998 / 22:25:44 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10741
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10742
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10743
_MFramePeer_getWindowBackgroundColor:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10744
    ^ View defaultViewBackgroundColor rgbValue.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10745
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10746
    "Created: / 17.11.1998 / 23:55:42 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10747
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10748
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10749
_MFramePeer_pHide:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10750
    ^ self _WComponentPeer_hide:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10751
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10752
    "Created: / 28.1.1998 / 22:27:04 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10753
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10754
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10755
_MFramePeer_pReshape:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10756
    self commonReshapeComponent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10757
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10758
    "Created: / 28.1.1998 / 22:28:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10759
    "Modified: / 28.1.1998 / 22:29:34 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10760
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10762
_MFramePeer_pSetTitle:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10763
    self _WWindowPeer__setTitle:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10764
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10765
    "Created: / 28.1.1998 / 22:30:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10766
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10767
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10768
_MFramePeer_pShow:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10769
    |view|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10770
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10771
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10772
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10773
    "/ frame views are under my browsers own control
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10774
    (view isMemberOf:JavaEmbeddedFrameView) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10775
	view beVisible.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10776
	view realize.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10777
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10778
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10779
"/    view windowGroup notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10780
"/        windowServer addGroup:(view windowGroup)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10781
"/    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10782
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10783
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10784
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10785
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10786
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10787
    "Modified: / 25.1.1998 / 09:54:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10788
    "Created: / 18.11.1998 / 00:19:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10789
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10790
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10791
_MFramePeer_setInsets:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10792
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10793
    "Created: / 17.11.1998 / 23:55:32 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10794
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10795
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10796
_MFramePeer_setResizable:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10797
    |view onOff|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10798
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10799
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10800
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10801
    onOff := (nativeContext argAt:1) == 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10802
    view isTopView ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10803
	onOff ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10804
	    view minExtent:10@10.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10805
	    view maxExtent:(Screen current extent).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10806
	] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10807
	    view minExtent:view extent.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10808
	    view maxExtent:view extent.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10809
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10810
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10811
	(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10812
	    self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10813
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10814
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10815
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10816
"/ 'JAVA: WWindowPeer_setResizable: ' print. view print. ' yes/no: ' print. onOff printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10817
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10818
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10819
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10820
    "Modified: / 16.1.1998 / 18:08:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10821
    "Created: / 17.11.1998 / 23:51:45 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10822
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10823
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10824
_MToolkit_callbackLoop: nativeContext 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10825
    | toolKit |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10826
    toolKit := nativeContext receiver.
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10827
    ^ self.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10828
    self halt.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10829
        self halt: 'monitors has changer, update me if you know how and why'.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10830
    "self wakeup: toolKit."
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10831
    self halt.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10832
    (JavaEventThread notNil and: [ JavaEventThread isDead not ]) ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10833
        'JavaVM [warning]: oops - two threads executing eventLoop' errorPrintCR.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10834
    ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10835
    JavaEventThread := Processor activeProcess.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10836
    [
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10837
        [ true ] whileTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10838
            AbortSignal handle: [:ex | ex return ] do: [ self doWindowsEventThread. ]
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10839
        ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10840
    ] valueNowOrOnUnwindDo: [ JavaEventThread := nil. ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10841
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10842
    "Created: / 17-11-1998 / 23:58:33 / cg"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10843
    "Modified: / 08-01-1999 / 17:08:35 / cg"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10844
    "Modified: / 22-11-2011 / 13:25:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10845
!
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10846
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10847
_MToolkit_eventLoop: nativeContext 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10848
    | toolKit |
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10849
    (JavaEventThread notNil and: [ JavaEventThread isDead not ]) ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10850
        'JavaVM [warning]: oops - two threads executing eventLoop' errorPrintCR.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10851
    ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10852
    toolKit := nativeContext receiver.
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10853
    self halt: 'monitors has changer, update me if you know how and why'.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10854
    "self wakeup: toolKit."
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10855
    self halt.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10856
    JavaEventThread := Processor activeProcess.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10857
    [
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10858
        [ true ] whileTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10859
            AbortSignal handle: [:ex | ex return ] do: [ self doWindowsEventThread. ]
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10860
        ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10861
    ] valueNowOrOnUnwindDo: [ JavaEventThread := nil. ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10862
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10863
    "Created: / 17-11-1998 / 23:04:29 / cg"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10864
    "Modified: / 08-01-1999 / 17:08:21 / cg"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 10865
    "Modified: / 22-11-2011 / 13:24:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10866
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10867
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10868
_MToolkit_init:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10869
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10870
    "Created: / 28.1.1998 / 22:21:54 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10871
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10872
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10873
_MToolkit_loadSystemColors:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10874
    ^ self _WToolkit_loadSystemColors:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10875
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10876
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10877
_MToolkit_run:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10878
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10879
    "Created: / 28.1.1998 / 22:22:10 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10880
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10881
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10882
_Math_IEEEremainder:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10883
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10884
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10885
    "Created: / 12.11.1998 / 18:52:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10886
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10887
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10888
_Math_acos:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10889
    "arc cosine"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10890
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10891
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10892
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10893
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10894
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10895
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10896
"/            'JAVAVM [info]: missing double flag in Math>>acos' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10897
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10898
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10899
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10900
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10901
    ^ dVal arcCos
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10902
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10903
    "Created: / 7.5.1998 / 00:34:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10904
    "Modified: / 11.11.1998 / 15:08:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10905
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10906
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10907
_Math_asin:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10908
    "arc sine"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10909
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10910
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10911
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10912
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10913
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10914
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10915
"/            'JAVAVM [info]: missing double flag in Math>>asin' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10916
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10917
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10918
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10919
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10920
    ^ dVal arcSin
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10921
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10922
    "Created: / 7.5.1998 / 00:34:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10923
    "Modified: / 11.11.1998 / 15:08:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10924
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10925
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10926
_Math_atan2:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10927
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10928
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10929
    "Created: / 12.11.1998 / 18:52:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10930
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10931
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10932
_Math_atan:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10933
    "arc tangens"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10934
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10935
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10936
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10937
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10938
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10939
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10940
"/            'JAVAVM [info]: missing double flag in Math>>atan' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10941
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10942
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10943
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10944
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10945
    ^ dVal arcTan
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10946
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10947
    "Created: / 6.2.1998 / 01:24:12 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10948
    "Modified: / 11.11.1998 / 15:08:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10949
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10950
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10951
_Math_ceil:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10952
    "ceiling"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10953
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10954
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10955
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10956
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10957
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10958
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10959
"/            'JAVAVM [info]: missing double flag in Math>>ceil' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10960
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10961
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10962
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10963
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10964
    ^ dVal ceilingAsFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10965
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10966
    "Created: / 7.1.1998 / 15:43:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10967
    "Modified: / 11.11.1998 / 15:08:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10968
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10969
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10970
_Math_cos:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10971
    "cosine"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10972
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10973
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10974
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10975
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10976
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10977
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10978
"/            'JAVAVM [info]: missing double flag in Math>>cos' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10979
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10980
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10981
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10982
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10983
    ^ dVal cos
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10984
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10985
    "Created: / 7.1.1998 / 15:41:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10986
    "Modified: / 11.11.1998 / 15:07:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10987
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10988
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10989
_Math_exp:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10990
    "exponential"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10991
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10992
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10993
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10994
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10995
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10996
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10997
"/            'JAVAVM [info]: missing double flag in Math>>exp' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10998
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10999
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11000
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11001
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11002
    ^ dVal exp
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11003
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11004
    "Created: / 7.5.1998 / 00:36:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11005
    "Modified: / 11.11.1998 / 15:07:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11006
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11007
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11008
_Math_floor:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11009
    "floor"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11010
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11011
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11012
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11013
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11014
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11015
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11016
"/            'JAVAVM [info]: missing double flag in Math>>floor' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11017
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11018
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11019
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11020
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11021
    ^ dVal floorAsFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11022
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11023
    "Created: / 7.1.1998 / 19:09:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11024
    "Modified: / 11.11.1998 / 15:07:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11025
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11026
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11027
_Math_log:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11028
    "natural logarithm"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11029
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11030
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11031
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11032
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11033
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11034
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11035
"/            'JAVAVM [info]: missing double flag in Math>>log' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11036
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11037
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11038
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11039
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11040
    ^ dVal ln
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11041
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11042
    "Created: / 7.1.1998 / 15:42:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11043
    "Modified: / 30.12.1998 / 17:41:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11044
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11045
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11046
_Math_pow:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11047
    "power"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11048
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11049
    |dVal1 dVal2|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11050
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11051
    dVal1 := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11052
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11053
"/        dVal1 isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11054
"/            'JAVAVM [info]: missing double flag in Math>>pow' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11055
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11056
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11057
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11058
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11059
    dVal2 := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11060
"/    (nativeContext argAt:4) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11061
"/        dVal2 isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11062
"/            'JAVAVM [info]: missing double flag in Math>>pow' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11063
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11064
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11065
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11066
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11067
    ^ dVal1 raisedTo:dVal2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11068
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11069
    "Created: / 7.1.1998 / 15:44:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11070
    "Modified: / 11.11.1998 / 15:07:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11071
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11072
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11073
_Math_rint:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11074
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11075
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11076
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11077
    ^ dVal rounded asFloat.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11078
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11079
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11080
_Math_sin:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11081
    "sine"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11082
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11083
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11084
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11085
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11086
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11087
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11088
"/            'JAVAVM [info]: missing double flag in Math>>sin' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11089
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11090
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11091
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11092
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11093
    ^ dVal sin
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11094
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11095
    "Created: / 7.1.1998 / 15:41:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11096
    "Modified: / 11.11.1998 / 15:07:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11097
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11098
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11099
_Math_sqrt:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11100
    "square root"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11101
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11102
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11103
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11104
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11105
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11106
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11107
"/            'JAVAVM [info]: missing double flag in Math>>sqrt' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11108
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11109
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11110
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11111
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11112
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11113
    "/ how about domain errors ?
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11114
    dVal < 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11115
	^ 0.0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11116
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11117
    ^ dVal sqrt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11118
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11119
    "Created: / 7.1.1998 / 15:42:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11120
    "Modified: / 29.12.1998 / 13:22:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11121
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11122
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11123
_Math_tan:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11124
    "tangent"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11125
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11126
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11127
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11128
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11129
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11130
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11131
"/            'JAVAVM [info]: missing double flag in Math>>tan' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11132
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11133
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11134
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11135
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11136
    ^ dVal tan
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11137
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11138
    "Created: / 7.5.1998 / 00:34:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11139
    "Modified: / 11.11.1998 / 15:07:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11140
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11141
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11142
_MemoryAdvice_register0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11143
    "private native void register0()"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11144
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11145
    "/ UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11146
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11147
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11148
_Method_getModifiers:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11149
    |jMethod mthd retVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11150
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11151
    jMethod := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11152
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11153
    mthd := JavaMethods at:jMethod ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11154
    mthd isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11155
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11156
	^ 0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11157
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11158
    ^ mthd accessFlags
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11159
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11160
    "Modified: / 9.4.1998 / 17:50:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11161
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11162
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11163
_Method_invoke:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11164
    "invoke a javaMethod"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11165
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11166
    |jMethod mthd rec args retVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11167
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11168
    jMethod := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11169
    rec := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11170
    args := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11171
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11172
    mthd := JavaMethods at:jMethod ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11173
    mthd isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11174
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11175
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11176
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11177
    "/ check for arguments to match the expected types ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11178
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11179
    mthd argSignature keysAndValuesDo:[:index :argSig |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11180
	|cls arg|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11181
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11182
	cls := Java at:argSig.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11183
	arg := args at:index.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11184
	(arg isKindOf:cls) ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11185
	    self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11186
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11187
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11188
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11189
    mthd isStatic ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11190
	retVal := mthd valueWithReceiver:(mthd javaClass) arguments:args selector:mthd selector.        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11191
	^ retVal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11192
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11193
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11194
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11195
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11196
    self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11197
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11198
    "Created: / 13.2.1998 / 15:15:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11199
    "Modified: / 13.2.1998 / 15:35:54 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11200
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11201
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11202
_MozillaAppletContext_pMochaOnLoad:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11203
    |id|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11204
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11205
    id := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11206
"/ 'JAVA: MozillaAppletContext_pMochaOnLoad: ' print. id printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11207
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11208
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11209
    "Created: / 6.1.1998 / 20:37:13 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11210
    "Modified: / 6.2.1998 / 02:13:09 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11211
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11212
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11213
_MozillaAppletContext_pShowDocument:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11214
    |jAppletContext s1 s2 s3 js|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11215
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11216
    jAppletContext := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11217
    js := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11218
    s1 := Java as_ST_String:js.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11219
    js := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11220
    s2 := Java as_ST_String:js.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11221
    js := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11222
    s2 := Java as_ST_String:js.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11223
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11224
    "/ somehow pass it to the html browser ....
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11225
Transcript show:'pShowDocument: '; show:s1; show:' / '; 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11226
	   show:s2; show:' / '; showCR:s3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11227
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11228
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11229
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11230
    "Created: / 29.3.1998 / 15:53:17 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11231
    "Modified: / 29.12.1998 / 13:32:41 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11232
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11233
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11234
_MozillaAppletContext_pShowStatus:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11235
    |s js|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11236
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11237
    js := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11238
    js isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11239
	s := ''
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11240
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11241
	s := Java as_ST_String:js.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11242
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11243
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11244
    self activityNotification:s.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11245
"/ Transcript showCR:s.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11246
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11247
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11248
    "Created: / 6.1.1998 / 18:31:34 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11249
    "Modified: / 22.10.1998 / 01:17:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11250
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11251
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11252
_MozillaAppletContext_setConsoleState0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11253
    "/ void setConsoleState0 (int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11254
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11255
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11256
    "Created: / 12.11.1998 / 19:23:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11257
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11258
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11259
_ObjectInputStream_allocateNewArray:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11260
    "/ java.lang.Object allocateNewArray (java.lang.Class int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11261
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11262
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11263
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11264
    "Created: / 12.11.1998 / 19:02:52 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11265
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11266
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11267
_ObjectInputStream_allocateNewObject:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11268
    "/ java.lang.Object allocateNewObject (java.lang.Class java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11269
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11270
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11271
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11272
    "Created: / 12.11.1998 / 19:02:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11273
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11274
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11275
_ObjectInputStream_inputClassFields:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11276
    "/ void inputClassFields (java.lang.Object java.lang.Class int[])
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11277
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11278
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11279
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11280
    "Created: / 12.11.1998 / 19:02:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11281
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11282
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11283
_ObjectInputStream_invokeDefaultReadObject:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11284
    "/ void invokeDefaultReadObject (java.lang.Object java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11285
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11286
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11287
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11288
    "Created: / 27.1.2000 / 03:00:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11289
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11290
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11291
_ObjectInputStream_invokeObjectReader:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11292
    "/ boolean invokeObjectReader (java.lang.Object java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11293
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11294
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11295
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11296
    "Created: / 12.11.1998 / 19:03:06 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11297
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11298
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11299
_ObjectInputStream_invokeReadObject:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11300
    "/ void invokeReadObject (java.lang.Object java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11301
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11302
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11303
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11304
    "Created: / 27.1.2000 / 03:01:02 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11305
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11306
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11307
_ObjectInputStream_loadClass0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11308
    "/ java.lang.Class loadClass0 (java.lang.Class java.lang.String)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11309
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11310
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11311
    "Created: / 12.11.1998 / 19:01:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11312
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11313
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11314
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11315
_ObjectOutputStream_invokeDefaultWriteObject:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11316
    "/ void invokeDefaultWriteObject (java.lang.Object java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11317
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11318
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11319
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11320
    "Created: / 27.1.2000 / 03:01:36 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11321
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11322
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11323
_ObjectOutputStream_invokeObjectWriter:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11324
    "/ boolean invokeObjectWriter (java.lang.Object java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11325
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11326
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11327
    "Created: / 12.11.1998 / 19:00:36 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11328
    "Modified: / 12.11.1998 / 19:01:45 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11329
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11330
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11331
_ObjectOutputStream_invokeWriteObject:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11332
    "/ void invokeWriteObject (java.lang.Object java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11333
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11334
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11335
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11336
    "Created: / 27.1.2000 / 03:01:52 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11337
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11338
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11339
_ObjectOutputStream_outputClassFields:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11340
    "/ void outputClassFields (java.lang.Object java.lang.Class int[])
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11341
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11342
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11343
    "Created: / 12.11.1998 / 19:00:09 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11344
    "Modified: / 12.11.1998 / 19:01:42 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11345
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11346
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11347
_ObjectStreamClass_doMismatchedRead:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11348
    "/ void doMismatchedRead (java.io.ObjectInputStream java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11349
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11350
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11351
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11352
    "Created: / 27.1.2000 / 02:50:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11353
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11354
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11355
_ObjectStreamClass_findObjectMethod0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11356
    "/ boolean findObjectMethod0 (java.lang.Class int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11357
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11358
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11359
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11360
    "Created: / 27.1.2000 / 02:51:50 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11361
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11362
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11363
_ObjectStreamClass_getClassAccess:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11364
    "/ int getClassAccess (java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11365
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11366
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11367
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11368
    "Created: / 12.11.1998 / 19:04:19 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11369
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11370
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11371
_ObjectStreamClass_getClassDefinedUID:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11372
    "/ long getClassDefinedUID (java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11373
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11374
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11375
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11376
    "Created: / 27.1.2000 / 02:51:33 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11377
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11378
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11379
_ObjectStreamClass_getFieldAccess:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11380
    "/ int getFieldAccess (java.lang.Class java.lang.String)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11381
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11382
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11383
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11384
    "Created: / 12.11.1998 / 19:05:19 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11385
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11386
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11387
_ObjectStreamClass_getFieldSignatures:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11388
    "/ java.lang.String[] getFieldSignatures (java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11389
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11390
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11391
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11392
    "Created: / 12.11.1998 / 19:05:04 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11393
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11394
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11395
_ObjectStreamClass_getFields0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11396
    "/ java.io.ObjectStreamField[] getFields0 (java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11397
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11398
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11399
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11400
    "Created: / 12.11.1998 / 19:05:32 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11401
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11402
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11403
_ObjectStreamClass_getMethodAccess:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11404
    "/ int getMethodAccess (java.lang.Class java.lang.String)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11405
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11406
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11407
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11408
    "Created: / 12.11.1998 / 19:04:51 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11409
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11410
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11411
_ObjectStreamClass_getMethodSignatures:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11412
    "/ java.lang.String[] getMethodSignatures (java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11413
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11414
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11415
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11416
    "Created: / 12.11.1998 / 19:04:34 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11417
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11418
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11419
_ObjectStreamClass_getSerialVersionUID:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11420
    "/ long getSerialVersionUID (java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11421
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11422
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11423
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11424
    "Created: / 12.11.1998 / 19:05:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11425
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11426
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11427
_ObjectStreamClass_hasWriteObject:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11428
    "/ boolean hasWriteObject (java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11429
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11430
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11431
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11432
    "Created: / 12.11.1998 / 19:05:53 / cg"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11433
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11434
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11435
_OffScreenImageSource_sendPixels:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11436
    "/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11437
    "/ UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11438
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11439
    "Modified: / 16.1.1998 / 18:22:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11440
    "Created: / 17.1.1998 / 12:36:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11441
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11442
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11443
_PackedColorModel_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11444
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11445
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11446
    "Created: / 28.1.1998 / 22:19:35 / cg"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11447
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11448
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11449
_PlainDatagramSocketImpl_bind:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11450
    |jsock jaddr port sock hostName ok err|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11451
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11452
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11453
    port := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11454
    jaddr := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11455
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11456
    hostName := jaddr instVarNamed:'hostName'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11457
    hostName isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11458
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11459
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11460
	hostName := Java as_ST_String:hostName
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11461
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11462
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11463
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11464
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11465
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11466
	    ('JAVA: socket bind to ' , hostName printString, ' port ' , port printString) infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11467
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11468
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11469
	ok := sock bindTo:port address:nil "hostName".
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11470
	ok ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11471
	    err := OperatingSystem lastErrorString.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11472
	    Transcript showCR:'sock err: ' , err printString.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11473
	    self throwIOExceptionWithMessage:'bind failed'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11474
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11475
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11476
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11477
    "Created: / 4.2.1998 / 15:06:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11478
    "Modified: / 30.12.1998 / 20:10:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11479
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11480
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11481
_PlainDatagramSocketImpl_join:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11482
    "/ native void join (InetAddress arg1)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11483
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11484
    |jsock addr sock ok err|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11485
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11486
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11487
    addr := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11488
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11489
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11490
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11491
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11492
	    ('JAVA: socket join ' , addr printString) infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11493
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11494
	self throwIOExceptionWithMessage:'unimplemented: join'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11495
self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11496
	^ nil.  "/ void
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11497
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11498
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11499
    "Created: / 4.2.1998 / 15:06:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11500
    "Modified: / 30.12.1998 / 20:10:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11501
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11502
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11503
_PlainDatagramSocketImpl_receive:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11504
    |jsock jdatagramPacket sock ok|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11505
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11506
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11507
    jdatagramPacket := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11508
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11509
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11510
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11511
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11512
	    ('JAVA: socket receive') infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11513
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11514
	^ -1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11515
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11516
    ^ -1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11517
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11518
    "Created: / 4.2.1998 / 15:06:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11519
    "Modified: / 30.12.1998 / 20:10:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11520
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11521
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11522
_PlainDatagramSocketImpl_socketGetOption:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11523
    |jsock opt port sock hostName ok err|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11524
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11525
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11526
    opt := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11527
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11528
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11529
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11530
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11531
	    ('JAVA: socket getOption ' , opt printString) infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11532
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11533
	self throwIOExceptionWithMessage:'unimplemented: getOption'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11534
self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11535
	^ -1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11536
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11537
    ^ -1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11538
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11539
    "Created: / 4.2.1998 / 15:06:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11540
    "Modified: / 30.12.1998 / 20:10:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11541
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11542
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11543
_PlainDatagramSocketImpl_socketSetOption:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11544
    "/ native void socketSetOption (int arg1, java.lang.Object arg2)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11545
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11546
    |jsock opt optVal sock ok err jSocketOptions|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11547
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11548
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11549
    opt := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11550
    optVal := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11551
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11552
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11553
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11554
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11555
	    ('JAVA: socket setOption ' , opt printString) infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11556
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11557
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11558
	jSocketOptions := Java at:'java.net.SocketOptions'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11559
	(opt == (jSocketOptions instVarNamed:'TCP_NODELAY')) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11560
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11561
	    (opt == (jSocketOptions instVarNamed:'SO_BINDADDR')) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11562
	    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11563
		(opt == (jSocketOptions instVarNamed:'SO_REUSEADDR')) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11564
		] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11565
		    (opt == (jSocketOptions instVarNamed:'IP_MULTICAST_IF')) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11566
		    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11567
			(opt == (jSocketOptions instVarNamed:'SO_LINGER')) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11568
			] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11569
			    (opt == (jSocketOptions instVarNamed:'SO_TIMEOUT')) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11570
			    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11571
				self throwIOExceptionWithMessage:'bad arg to setOption'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11572
			    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11573
			]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11574
		    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11575
		]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11576
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11577
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11578
	self throwIOExceptionWithMessage:'unimplemented: setOption'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11579
self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11580
	^ nil.  "/ void
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11581
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11582
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11583
    "Created: / 4.2.1998 / 15:06:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11584
    "Modified: / 30.12.1998 / 20:10:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11585
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11586
1112
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11587
_PlainSocketImpl_socketAvailable:nativeContext
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11588
    |jSock sock n|
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11589
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11590
    jSock := nativeContext receiver.
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11591
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11592
    sock := self validateFile:jSock.
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11593
    sock isNil ifTrue:[
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11594
	self throwIOExceptionWithMessage:'socketAvailable on closed socket'.
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11595
	^ self.
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11596
    ].
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11597
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11598
    n := sock numAvailable.
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11599
    ^ n
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11600
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11601
    "Created: / 4.2.1998 / 16:58:49 / cg"
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11602
    "Modified: / 30.12.1998 / 20:10:08 / cg"
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11603
!
bcacdf94b551 Few fixes in natives.
vranyj1
parents: 1110
diff changeset
 11604
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11605
_PlainSocketImpl_socketClose:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11606
    |jsock sock|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11607
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11608
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11609
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11610
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11611
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11612
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11613
	    'JAVA: close socket' infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11614
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11615
	sock close.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11616
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11617
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11618
    "Modified: / 21.8.1997 / 17:09:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11619
    "Created: / 25.1.1998 / 20:04:24 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11620
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11621
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11622
_PlatformFont_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11623
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11624
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11625
    "Created: / 28.1.1998 / 22:30:41 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11626
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11627
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11628
_PrintStream_isOutputStreamLocalised:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11629
    "/ boolean isOutputStreamLocalised (java.io.DataOutputStream)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11630
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11631
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11632
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11633
    "Created: / 27.1.2000 / 03:00:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11634
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11635
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11636
_RandomAccessFile_close:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11637
    ^ self anyStream_close:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11638
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11639
    "Created: / 4.2.1998 / 13:26:53 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11640
    "Modified: / 4.2.1998 / 15:21:08 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11641
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11642
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11643
_RandomAccessFile_length:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11644
    |file sz|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11645
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11646
    file := self validateFile:(nativeContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11647
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11648
    FileIOTrace ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11649
	('JAVA: length of ' , file pathName) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11650
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11651
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11652
    sz := file size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11653
    ^ sz.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11654
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11655
    "Created: / 4.2.1998 / 13:27:58 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11656
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11657
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11658
_RandomAccessFile_read:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11659
    |file byte|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11660
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11661
    file := self validateFile:(nativeContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11662
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11663
    FileIOTrace ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11664
	('JAVA: read 1 byte from ' , file pathName) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11665
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11666
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11667
    byte := file nextByte.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11668
    byte isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11669
	^ -1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11670
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11671
    ^ byte
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11672
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11673
    "Modified: / 5.1.1998 / 02:17:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11674
    "Created: / 27.1.1999 / 19:01:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11675
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11676
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11677
_RandomAccessFile_readBytes:nativeContext
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11678
    ^ self anyStream_readBytes:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11679
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11680
    "Modified: / 4.2.1998 / 15:23:27 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11681
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11682
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11683
_RandomAccessFile_seek:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11684
    |file pos|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11685
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11686
    file := self validateFile:(nativeContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11687
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11688
    FileIOTrace ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11689
	('JAVA: seek on ' , file pathName) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11690
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11691
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11692
    pos := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11693
    file position:pos+1 "/ ST/X position starts at 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11694
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11695
    "Created: / 4.2.1998 / 13:25:38 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11696
    "Modified: / 4.2.1998 / 13:28:12 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11697
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11698
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11699
_RandomAccessFile_writeBytes:nativeContext
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11700
    ^ self anyStream_writeBytes:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11701
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11702
    "Modified: / 4.2.1998 / 15:24:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11703
    "Created: / 4.2.1998 / 15:24:35 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11704
!
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11705
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11706
_Runtime_buildLibName:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11707
    |jPath jFileName path fileName libName|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11708
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11709
    jPath := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11710
    jFileName := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11711
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11712
    path := Java as_ST_String:jPath.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11713
    fileName := Java as_ST_String:jFileName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11714
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11715
    path = '__builtIn__' ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11716
	libName := path , '/' , fileName
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11717
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11718
	libName := path , '/lib' , fileName , '.so'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11719
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11720
    ^ Java as_String:libName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11721
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11722
    "Modified: / 8.8.1997 / 12:05:05 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11723
    "Created: / 4.1.1998 / 19:07:14 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11724
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11725
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11726
_Runtime_execInternal: nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11727
    "Run a unix-command; return a process object."
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11728
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11729
    | cmdAndArgArray  envArray  cmd  jProcessClass  jProcess |
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11730
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11731
    cmdAndArgArray := nativeContext argAt: 1.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11732
    envArray := nativeContext argAt: 2.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11733
    cmd := cmdAndArgArray at: 1.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11734
    OperatingSystem isUNIXlike ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11735
        jProcessClass := self classForName: 'java.lang.UNIXProcess'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11736
    ] ifFalse: [ jProcessClass := Java classForName: 'java.lang.Win32Process'. ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11737
    
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11738
"/
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11739
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11740
    jProcessClass notNil ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11741
        self halt.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11742
        jProcess := jProcessClass newCleared.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11743
        jProcess 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11744
            perform: #'<init>([Ljava/lang/String;[Ljava/lang/String;)V'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11745
            with: cmdAndArgArray
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11746
            with: envArray.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11747
        ^ jProcess
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11748
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11749
    self halt.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11750
    self 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 11751
        throwIOExceptionWithMessage: 'Process execution disabled/unimplemented'.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11752
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11753
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11754
    "Created: / 15.1.1998 / 01:50:31 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11755
    "Modified: / 11.12.1998 / 13:09:36 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11756
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11757
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11758
_Runtime_freeMemory:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11759
    "free memory - Returns the number of free bytes"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11760
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11761
    ^ ObjectMemory freeListSpace + ObjectMemory freeSpace
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11762
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11763
    "Created: / 12.1.1998 / 12:59:53 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11764
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11765
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11766
_Runtime_initializeLinkerInternal:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11767
    "init sharedLib linker, return searchPath as javaString"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11768
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11769
    |path|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11770
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11771
    "/ mhmh - what is done here ?
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11772
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11773
    path := ''.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11774
    LibPath do:[:comp | path size == 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11775
			    path := path , comp
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11776
			] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11777
			    path := path , ':' , comp
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11778
			]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11779
	       ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11780
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11781
    ^ Java as_String:path
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11782
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11783
    "Modified: / 7.8.1997 / 21:17:03 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11784
    "Created: / 4.1.1998 / 17:53:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11785
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11786
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11787
_Runtime_isInputStreamLocalised:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11788
    "/ boolean isInputStreamLocalised (java.io.DataInputStream)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11789
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11790
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11791
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11792
    "Created: / 27.1.2000 / 03:03:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11793
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11794
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11795
_Runtime_isOutputStreamLocalised:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11796
    "/ boolean isOutputStreamLocalised (java.io.DataOutputStream)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11797
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11798
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11799
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11800
    "Created: / 27.1.2000 / 03:02:49 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11801
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11802
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11803
_Runtime_loadFileInternal:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11804
    "load a sharedLib, return boolean 0 (false) if fail; 1 (true) if ok"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11805
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11806
    |ret|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11807
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11808
    ret := self _Runtime_loadFileInternalI:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11809
    ret < 0 ifTrue:[ ret := 0 ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11810
    ^ ret
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11811
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11812
    "Created: / 4.1.1998 / 19:10:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11813
    "Modified: / 4.1.1998 / 19:11:04 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11814
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11815
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11816
_Runtime_loadFileInternalI:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11817
    "1.1b3 change; load a sharedLib like 'loadFileInternal',
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11818
     but return integer:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11819
	-1   outOfMemory error
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11820
	0    failed to load
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11821
	1    loaded or already loaded (i.e. ok)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11822
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11823
    |jLibName libName libHandle|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11824
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11825
    jLibName := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11826
    libName := Java as_ST_String:jLibName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11827
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11828
    (SimulatedLibs includes:libName) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11829
"/        ('JAVA: builtIn libLoad simulated: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11830
	^ 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11831
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11832
    (LoadedLibs notNil and:[LoadedLibs includesKey:libName]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11833
"/        ('JAVA: already loaded: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11834
	^ 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11835
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11836
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11837
    libName asFilename exists ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11838
	('JAVA: no file to load: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11839
	^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11840
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11841
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11842
    (self confirm:'permission to load native library: ' , libName , ' ?') ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11843
	^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11844
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11845
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11846
    libHandle := ObjectFileLoader loadLibrary:libName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11847
    libHandle isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11848
	('JAVA: failed to load: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11849
	^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11850
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11851
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11852
    LoadedLibs isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11853
	LoadedLibs := Dictionary new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11854
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11855
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11856
    LoadedLibs at:libName put:libHandle.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11857
    ^ 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11858
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11859
    "Created: / 4.1.1998 / 19:10:54 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11860
    "Modified: / 6.2.1998 / 03:11:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11861
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11862
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11863
_Runtime_runFinalization:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11864
    "/ void runFinalization ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11865
"/    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11866
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11867
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11868
    "Created: / 12.11.1998 / 18:59:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11869
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11870
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11871
_Runtime_runFinalizersOnExit0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11872
    ""
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11873
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11874
    |onOff|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11875
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11876
    onOff := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11877
    ^ 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11878
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11879
    "Modified: / 6.2.1998 / 03:11:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11880
    "Created: / 15.10.1998 / 23:34:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11881
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11882
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11883
_Runtime_setInputStreamLocalised:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11884
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11885
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11886
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11887
    "Modified: / 27.1.2000 / 03:02:27 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11888
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11889
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11890
_Runtime_setOutputStreamLocalised:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11891
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11892
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11893
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11894
    "Modified: / 27.1.2000 / 03:02:32 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11895
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11896
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11897
_Runtime_totalMemory:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11898
    "free memory - Returns the total number of bytes"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11899
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11900
    ^ ObjectMemory oldSpaceSize + ObjectMemory newSpaceSize
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11901
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11902
    "Created: / 12.1.1998 / 12:59:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11903
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11904
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11905
_Runtime_traceInstructions:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11906
    "/ void traceInstructions (boolean)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11907
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11908
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11909
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11910
    "Created: / 12.11.1998 / 18:59:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11911
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11912
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11913
_Runtime_traceMethodCalls:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11914
    "/ void traceMethodCalls (boolean)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11915
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11916
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11917
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11918
    "Created: / 12.11.1998 / 18:59:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11919
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11920
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11921
_ScrollPane_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11922
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11923
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11924
    "Created: / 28.1.1998 / 22:19:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11925
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11926
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11927
_SecurityManager_classDepth:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11928
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11929
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11930
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11931
    "Created: / 12.11.1998 / 18:56:27 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11932
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11933
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11934
_SecurityManager_classLoaderDepth:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11935
    |con depth|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11936
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11937
    con := thisContext sender.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11938
    depth := 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11939
    [con notNil] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11940
	con receiver == JavaClassReader classLoaderQuerySignal ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11941
	    con selector == #handle:do: ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11942
		depth := depth + 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11943
	    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11944
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11945
	con := con sender.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11946
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11947
'JAVA: classLoaderDepth -> ' infoPrint. depth infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11948
    ^ depth.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11949
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11950
    "Created: / 13.1.1998 / 09:21:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11951
    "Modified: / 13.1.1998 / 09:33:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11952
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11953
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11954
_SecurityManager_currentClassLoader:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11955
    |loader|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11956
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11957
    loader := JavaClassReader classLoaderQuerySignal query.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11958
"/ 'JAVA: currentClassLoader -> ' infoPrint. loader displayString infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11959
    ^ loader.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11960
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11961
    "Created: / 13.1.1998 / 09:23:28 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11962
    "Modified: / 11.12.1998 / 12:39:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11963
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11964
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11965
_SecurityManager_currentLoadedClass0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11966
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11967
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11968
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11969
    "Created: / 12.11.1998 / 18:56:41 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11970
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11971
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11972
_SocketInputStream_socketRead:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11973
    ^ self anyStream_readBytes:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11974
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11975
    "Created: / 25.1.1998 / 20:56:53 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11976
    "Modified: / 4.2.1998 / 15:52:31 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11977
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11978
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11979
_SocketOutputStream_socketWrite:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11980
    ^ self anyStream_writeBytes:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11981
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11982
    "Created: / 25.1.1998 / 21:06:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11983
    "Modified: / 4.2.1998 / 15:52:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11984
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11985
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11986
_String_compareTo:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11987
    "int compareTo (java.lang.String)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11988
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11989
    |jString1 jString2|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11990
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11991
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11992
    jString2 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11993
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11994
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11995
    "Created: / 27.1.2000 / 02:28:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11996
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11997
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11998
_String_equals:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11999
    |jString1 jString2|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12000
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12001
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12002
    jString2 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12003
    ^ (jString1 instVarAt:1) = (jString2 instVarAt:1)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12004
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12005
    "Created: / 18.11.1998 / 00:52:03 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12006
    "Modified: / 18.11.1998 / 00:53:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12007
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12008
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12009
_String_equalsIgnoreCase:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12010
    "boolean equalsIgnoreCase (java.lang.String)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12011
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12012
    |jString1 jString2|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12013
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12014
self halt:'untested'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12015
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12016
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12017
    jString2 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12018
    ^ (jString1 instVarAt:1) sameAs: (jString2 instVarAt:1)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12019
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12020
    "Modified: / 18.11.1998 / 00:53:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12021
    "Created: / 27.1.2000 / 02:27:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12022
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12023
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12024
_String_indexOf:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12025
    "int indexOf (java.lang.String int)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12026
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12027
    |jString1 jString2 idx|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12028
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12029
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12030
    jString2 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12031
    idx := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12032
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12033
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12034
    "Created: / 27.1.2000 / 02:30:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12035
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12036
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12037
_String_lastIndexOf:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12038
    "int lastIndexOf (java.lang.String int)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12039
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12040
    |jString1 jString2 idx|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12041
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12042
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12043
    jString2 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12044
    idx := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12045
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12046
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12047
    "Created: / 27.1.2000 / 02:33:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12048
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12049
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12050
_String_length:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12051
    |jString|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12052
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12053
    jString := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12054
    ^ (jString instVarAt:3)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12055
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12056
    "Created: / 18.11.1998 / 00:53:50 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12057
    "Modified: / 18.11.1998 / 00:54:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12058
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12059
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12060
_String_regionMatches2:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12061
    "boolean regionMatches (boolean int java.lang.String int int)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12062
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12063
    |jString1 bool jString2 idx1 idx2|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12064
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12065
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12066
    bool := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12067
    jString2 := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12068
    idx1 := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12069
    idx2 := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12070
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12071
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12072
    "Created: / 27.1.2000 / 02:33:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12073
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12074
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12075
_String_regionMatches:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12076
    "boolean regionMatches (int java.lang.String int int)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12077
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12078
    |jString1 jString2 idx1 idx2|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12079
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12080
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12081
    jString2 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12082
    idx1 := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12083
    idx2 := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12084
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12085
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12086
    "Created: / 27.1.2000 / 02:32:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12087
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12088
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12089
_String_startsWith:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12090
    "boolean startsWith (java.lang.String int)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12091
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12092
    |jString1 jString2 idx|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12093
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12094
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12095
    jString2 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12096
    idx := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12097
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12098
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12099
    "Created: / 27.1.2000 / 02:31:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12100
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12101
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12102
_SystemColor_GetSysColor:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12103
    "/ int GetSysColor (int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12104
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12105
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12106
    "Created: / 27.1.2000 / 02:44:41 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12107
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12108
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12109
_SystemResourceManager_getEntryFromKey:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12110
    "get a resource by name"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12111
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12112
    |key s|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12113
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12114
    key := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12115
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12116
    s := Java effectiveClassPath at:(key+1) ifAbsent:nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12117
    s isNil ifTrue:[^ nil].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12118
    ^ Java as_String:s
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12119
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12120
    "Modified: / 22-11-2010 / 13:44:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12121
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12122
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12123
_SystemResourceManager_validateSystemResource:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12124
    "check a resource"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12125
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12126
    |bool str1 str2|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12127
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12128
    bool := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12129
    str1 := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12130
    str2 := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12131
    ^ 1 "/ true
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12132
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12133
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12134
_System_getCallerClass:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12135
    "/ introduced with jdk1.2
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12136
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12137
    |senderContext cls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12138
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12139
    senderContext := nativeContext sender.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12140
    [senderContext receiver == (Java at:'java.lang.System')] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12141
	senderContext := senderContext sender.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12142
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12143
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12144
    senderContext method isStatic ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12145
	cls := senderContext receiver
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12146
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12147
	cls := senderContext receiver class
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12148
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12149
    cls isJavaClass ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12150
	^ self javaClassObjectForClass:cls
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12151
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12152
    (cls isMemberOf:(Java at:'java.lang.Class')) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12153
	^ Java at:'java.lang.Class'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12154
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12155
    self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12156
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12157
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12158
    "Modified: / 27.1.1998 / 18:33:13 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12159
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12160
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12161
_System_validateSecurityManager:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12162
    "void validateSecurityManager (java.lang.SecurityManager)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12163
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12164
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12165
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12166
    "Created: / 27.1.2000 / 02:43:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12167
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12168
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12169
_ThreadGroup_initMainThreadGroup0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12170
    "void initMainThreadGroup0 (java.lang.ThreadGroup)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12171
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12172
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12173
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12174
    "Created: / 27.1.2000 / 02:45:52 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12175
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12176
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12177
_Thread_countStackFrames:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12178
    "/ int countStackFrames ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12179
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12180
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12181
    "Created: / 12.11.1998 / 19:06:21 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12182
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12183
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12184
_Thread_resume0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12185
    "yield"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12186
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12187
    |jThread stProcess|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12188
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12189
    jThread := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12190
    stProcess := JavaVM stProcessForJavaThread:jThread.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12191
    stProcess isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12192
	ThreadTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12193
	    ('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12194
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12195
	^ nil "void"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12196
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12197
    stProcess resume
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12198
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12199
    "Created: / 8.1.1998 / 01:06:27 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12200
    "Modified: / 6.2.1998 / 02:15:08 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12201
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12202
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12203
_Thread_start: nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12204
    "start the thread"
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12205
    
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12206
    | jThread  jName  name  stProcess |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12207
    jThread := nativeContext receiver.
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12208
    (jThread instVarNamed: 'priority') < 1 ifTrue: [
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12209
        self halt.
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12210
        jThread instVarNamed: 'priority' put: 1.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12211
    ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12212
    stProcess := JavaProcess 
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12213
                for: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12214
                    | procName |
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12215
                    Object abortSignal 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12216
                        handle: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12217
                            :ex | 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12218
                            procName := stProcess name.
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12219
                            (procName startsWith: 'JAVA-AWT-EventQueue') ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12220
                                ('JAVA [info]: thread ' , procName , ' aborted - restarting process.') 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12221
                                    infoPrintCR.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12222
                                ex restart.
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12223
                            ] ifFalse: [
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12224
                                (stProcess == JavaScreenUpdaterThread 
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12225
                                    or: [ stProcess == JavaEventQueueThread ]) 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12226
                                        ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12227
                                            ('JAVA [info]: thread ' , procName , ' aborted - restarting process.') 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12228
                                                infoPrintCR.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12229
                                            ex restart
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12230
                                        ]
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12231
                                        ifFalse: [ ('JAVA [info]: thread ' , procName , ' aborted.') infoPrintCR. ]
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12232
                            ].
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12233
                        ]
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12234
                        do: [
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12235
                            [
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12236
                                JavaVM javaExceptionSignal 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12237
                                    handle: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12238
                                        :ex | 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12239
                                        | exClass |
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12240
                                        procName := stProcess name.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12241
                                        exClass := ex parameter class.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12242
                                        exClass == (Java at: 'java.lang.ThreadDeath') ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12243
                                            ('JAVA: thread ' , procName , ' terminated') infoPrintCR.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12244
                                        ] ifFalse: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12245
                                            Transcript 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12246
                                                showCR: ('JAVA: thread ''' , procName , ''' terminated with exception: ' 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12247
                                                        , exClass name).
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12248
                                        ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12249
                                        ex return.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12250
                                    ]
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12251
                                    do: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12252
                                        Object messageNotUnderstoodSignal 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12253
                                            handle: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12254
                                                :ex | 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12255
                                                | 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12256
                                                "/ remap doesNotUnderstand with nil-receiver to
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12257
                                                "/ a nullPointerException ...
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12258
                                                 con  m |
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12259
                                                con := ex suspendedContext.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12260
                                                con receiver isNil ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12261
                                                    ((m := con sender method) notNil and: [ m isJavaMethod ]) ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12262
                                                        self throwNullPointerException.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12263
                                                        AbortSignal raise.
1249
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
 12264
                                                        
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12265
                                                        "/ ex proceed.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12266
                                                    ]
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12267
                                                ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12268
                                                ex reject.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12269
                                            ]
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12270
                                            do: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12271
                                                "/ Transcript showCR:(Timestamp now printString , 'start thread: ', stProcess name).
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12272
                                                jThread perform: #'run()V'.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12273
                                                ThreadTrace == true ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12274
                                                    ('JAVA: thread ' , stProcess name , ' terminated') infoPrintCR.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12275
                                                ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12276
                                                jThread perform: #'exit()V'.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12277
                                                ThreadTrace == true ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12278
                                                    ('JAVA: after exit of thread ' , stProcess name) infoPrintCR.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12279
                                                ]
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12280
                                            ]
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12281
                                    ]
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12282
                            ] ensure: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12283
                                | monitors |
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12284
                                monitors := EnteredMonitorsPerProcess at: stProcess ifAbsent: nil.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12285
                                monitors notNil ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12286
                                    monitors do: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12287
                                        :obj | 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12288
                                        | mon |
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12289
                                        mon := self monitorFor: obj.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12290
                                        mon notNil ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12291
                                            mon owningProcess == stProcess ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12292
                                                ('JAVA: release monitor owned by dying thread: ' , stProcess name) 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12293
                                                    infoPrintCR.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12294
                                                mon exit
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12295
                                            ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12296
                                        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12297
                                    ].
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12298
                                    EnteredMonitorsPerProcess removeKey: stProcess.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12299
                                    stProcess == JavaScreenUpdaterThread ifTrue: [
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12300
                                        JavaScreenUpdaterThread := nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12301
                                    ].
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12302
                                    stProcess == JavaEventQueueThread ifTrue: [ JavaEventQueueThread := nil. ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12303
                                    
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12304
"/                                    screenUpdaterClass := Java at:'sun.awt.ScreenUpdater'.    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12305
"/                                    screenUpdaterClass notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12306
"/                                        screenUpdaterClass instVarNamed:'updater' put:nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12307
"/                                    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12308
                                ].
1249
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
 12309
                                Java removeThread: jThread ifAbsent: [].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12310
                            ]
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12311
                        ]
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12312
                ]
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12313
                priority: (Processor activePriority).
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12314
    jName := jThread instVarNamed: 'name'.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12315
    jName isString ifFalse: [ name := Java as_ST_String: jName. ] ifTrue: [
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12316
        name := jName
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12317
    ].
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12318
    
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12319
    "/ kludge - remember the ScreenUpdater ...
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12320
    
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12321
    name = 'Screen Updater' ifTrue: [ JavaScreenUpdaterThread := stProcess. ] ifFalse: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12322
        name = 'AWT-Windows' ifTrue: [ JavaEventThread := stProcess. ] ifFalse: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12323
            (name startsWith: 'AWT-EventQueue') ifTrue: [
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12324
                JavaEventQueueThread := stProcess.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12325
            ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12326
        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12327
    ].
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12328
    
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12329
"/name = 'UserDialogShowThread' ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12330
"/self halt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12331
"/].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12332
    "/ when that process terminates, wakup any waiters
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12333
    
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12334
    stProcess addExitAction: [ self notify: jThread ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12335
    stProcess name: 'JAVA-' , name.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12336
    stProcess restartable: true.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12337
    stProcess resume.
1249
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
 12338
    Java addThread: jThread for: stProcess.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12339
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12340
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12341
    "Created: / 03-01-1998 / 02:05:52 / cg"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 12342
    "Modified: / 24-12-1999 / 03:14:33 / cg"
1249
3c82fe50483c IllegalMonitorStateException bug FIXED :)
hlopkmar
parents: 1248
diff changeset
 12343
    "Modified: / 09-12-2011 / 12:52:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12344
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12345
1201
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12346
_Thread_stop0: nativeContext 
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12347
    "terminate a thread"
1201
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12348
    
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12349
    | jThread  stProcess  death |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12350
    jThread := nativeContext receiver.
1201
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12351
    stProcess := JavaVM stProcessForJavaThread: jThread.
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12352
    stProcess isNil ifTrue: [
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12353
        ThreadTrace == true ifTrue: [
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12354
            ('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12355
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12356
        ^ nil "void"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12357
    ].
1201
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12358
    stProcess == JavaScreenUpdaterThread ifTrue: [ self halt ].
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12359
    stProcess == JavaEventQueueThread ifTrue: [ self halt ].
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12360
    death := nativeContext argAt: 1.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12361
    stProcess 
1201
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12362
        interruptWith: [
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12363
            JavaVM javaExceptionSignal 
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12364
                handle: [
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12365
                    :ex | 
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12366
                    Processor activeProcess == JavaScreenUpdaterThread ifTrue: [ self halt ].
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12367
                    Processor activeProcess == JavaEventQueueThread ifTrue: [ self halt ].
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12368
                    Processor activeProcess terminate
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12369
                ]
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12370
                do: [
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12371
                    ThreadTrace == true ifTrue: [
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12372
                        ('JAVA: thread exit: ' , jThread displayString) infoPrintNL.
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12373
                    ].
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12374
                    
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12375
                    jThread perform: #'exit()V'.
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12376
                    
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12377
                    self throwException: death.
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12378
                ]
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12379
        ].
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12380
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12381
    "Created: / 08-01-1998 / 13:11:17 / cg"
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12382
    "Modified: / 24-12-1999 / 02:32:45 / cg"
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 12383
    "Modified: / 01-12-2011 / 18:26:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12384
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12385
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12386
_Thread_suspend0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12387
    "yield"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12388
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12389
    |jThread stProcess|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12390
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12391
    jThread := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12392
    stProcess := JavaVM stProcessForJavaThread:jThread.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12393
    stProcess isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12394
	ThreadTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12395
	    ('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12396
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12397
	^ nil "void"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12398
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12399
    stProcess suspend
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12400
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12401
    "Created: / 8.1.1998 / 01:05:49 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12402
    "Modified: / 6.2.1998 / 02:15:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12403
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12404
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12405
_Throwable_printStackTrace0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12406
    |out outStream exceptionObject contextList|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12407
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12408
    outStream := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12409
    exceptionObject := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12410
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12411
    contextList := exceptionObject instVarNamed:'backtrace'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12412
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12413
    out := self javaConsoleStream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12414
    out cr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12415
    out nextPutLine:'JAVA: stackTrace:'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12416
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12417
    contextList do:[:con |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12418
	out 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12419
	    nextPutAll:'  '; 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12420
	    nextPutAll:(con method javaClass fullName);
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12421
	    nextPutAll:'.';
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12422
	    nextPutAll:(con method selector);
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12423
	    nextPutAll:' ['; 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12424
	    nextPutAll:(con method javaClass sourceFile); 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12425
	    nextPutAll:' '; 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12426
	    nextPutAll:(con quickLineNumber displayString); 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12427
	    nextPutAll:']'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12428
	out cr
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12429
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12430
    out nextPutLine:'----------------------------------------------------'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12431
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12432
    "Created: / 4.1.1998 / 14:27:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12433
    "Modified: / 10.11.1998 / 14:19:32 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12434
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12435
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12436
_URLConnection_close:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12437
    "/ void close ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12438
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12439
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12440
    "Created: / 12.11.1998 / 19:26:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12441
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12442
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12443
_URLConnection_finalize:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12444
    "/ void finalize ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12445
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12446
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12447
    "Created: / 12.11.1998 / 19:25:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12448
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12449
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12450
_URLConnection_getContentLength0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12451
    "/ int getContentLength0 ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12452
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12453
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12454
    "Created: / 12.11.1998 / 19:25:34 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12455
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12456
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12457
_URLConnection_getContentType0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12458
    "/ java.lang.String getContentType0 ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12459
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12460
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12461
    "Created: / 12.11.1998 / 19:25:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12462
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12463
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12464
_URLConnection_getHeaderField0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12465
    "/ java.lang.String getHeaderField0 (java.lang.String)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12466
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12467
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12468
    "Created: / 12.11.1998 / 19:25:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12469
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12470
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12471
_URLConnection_pCreate:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12472
    "/ void pCreate (java.lang.String java.lang.String)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12473
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12474
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12475
    "Created: / 12.11.1998 / 19:25:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12476
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12477
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12478
_URLInputStream_available:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12479
    "/ int available ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12480
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12481
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12482
    "Created: / 12.11.1998 / 19:24:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12483
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12484
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12485
_URLInputStream_open:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12486
    "/ void open ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12487
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12488
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12489
    "Created: / 12.11.1998 / 19:24:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12490
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12491
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12492
_URLInputStream_read:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12493
    "/ int read (byte[] int int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12494
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12495
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12496
    "Created: / 12.11.1998 / 19:24:12 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12497
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12498
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12499
_URLOutputStream_open:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12500
    "/ void open ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12501
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12502
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12503
    "Created: / 12.11.1998 / 19:24:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12504
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12505
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12506
_URLOutputStream_pClose:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12507
    "/ void pClose ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12508
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12509
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12510
    "Created: / 12.11.1998 / 19:25:02 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12511
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12512
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12513
_URLOutputStream_write:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12514
    "/ void write (int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12515
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12516
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12517
    "Created: / 12.11.1998 / 19:24:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12518
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12519
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12520
_URLOutputStream_writeBytes:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12521
    "/ void writeBytes (byte[] int int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12522
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12523
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12524
    "Created: / 12.11.1998 / 19:24:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12525
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12526
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12527
_URLStreamHandlerFactory_pInit:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12528
    "/ self unimplementedNativeMethod.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12529
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12530
    "Created: / 10.1.1998 / 15:47:24 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12531
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12532
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12533
_URLStreamHandlerFactory_pSupportsProtocol:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12534
    "/ boolean pSupportsProtocol (java.lang.String)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12535
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12536
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12537
    "Created: / 12.11.1998 / 19:23:43 / cg"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12538
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12539
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12540
_VM_getState:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12541
    "/ int getState ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12542
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12543
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12544
    "Created: / 12.11.1998 / 19:06:44 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12545
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12546
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12547
_VM_resetJavaMonitor:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12548
    "/ void resetJavaMonitor ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12549
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12550
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12551
    "Created: / 14.11.1998 / 10:43:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12552
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12553
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12554
_VM_resumeJavaMonitor:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12555
    "/ void resumeJavaMonitor ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12556
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12557
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12558
    "Created: / 14.11.1998 / 10:42:49 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12559
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12560
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12561
_VM_suspendJavaMonitor:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12562
    "/ void suspendJavaMonitor ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12563
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12564
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12565
    "Created: / 14.11.1998 / 10:43:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12566
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12567
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12568
_VM_threadsSuspended:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12569
    "/ boolean threadsSuspended ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12570
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12571
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12572
    "Created: / 12.11.1998 / 19:07:10 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12573
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12574
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12575
_VM_unsuspendSomeThreads:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12576
    "/ void unsuspendSomeThreads ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12577
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12578
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12579
    "Created: / 12.11.1998 / 19:07:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12580
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12581
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12582
_VM_unsuspendThreads:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12583
    "/ void unsuspendThreads ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12584
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12585
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12586
    "Created: / 12.11.1998 / 19:07:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12587
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12588
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12589
_VM_writeJavaMonitorReport:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12590
    "/ void writeJavaMonitorReport ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12591
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12592
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12593
    "Created: / 14.11.1998 / 10:43:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12594
!
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12595
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12596
_WButtonPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12597
    |jButtonPeer jButton jFrame frame button
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12598
     lbl|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12599
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12600
    jButtonPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12601
    jButton := jButtonPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12602
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12603
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12604
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12605
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12606
    button := Button in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12607
    button sizeFixed:true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12608
    button action:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12609
			jButtonPeer perform:#'handleAction()V'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12610
		  ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12611
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12612
    lbl := jButton instVarNamed:'label'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12613
    lbl notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12614
	lbl := Java as_ST_String:lbl.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12615
	button label:lbl
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12616
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12617
    self createdWindowsView:button for:jButtonPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12618
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12619
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12620
	'WButtonPeer_create: ' print. frame print. ' -> ' print. button printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12621
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12622
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12623
    "Created: / 5.1.1998 / 01:53:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12624
    "Modified: / 11.12.1998 / 00:19:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12625
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12626
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12627
_WButtonPeer_setLabel:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12628
    |label jString|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12629
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12630
    jString := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12631
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12632
    label := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12633
    label label:(Java as_ST_String:jString)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12634
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12635
    "Modified: / 8.1.1998 / 17:35:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12636
    "Created: / 1.2.1998 / 17:05:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12637
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12638
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12639
_WCanvasPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12640
    |jCanvasPeer jFrame frame subView|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12641
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12642
    jCanvasPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12643
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12644
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12645
    jFrame isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12646
	self halt:'no frame in canvasPeer create'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12647
	subView := JavaView new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12648
"/        self internalError:'no frame in canvasPeer create'.     
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12649
"/        ^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12650
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12651
	frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12652
	subView := JavaView in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12653
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12654
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12655
    subView delegate:self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12656
    subView javaPeer:jCanvasPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12657
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12658
    self createdWindowsView:subView for:jCanvasPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12659
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12660
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12661
	'WCanvasPeer_create: ' print. frame print. ' -> ' print. subView printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12662
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12663
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12664
    "Created: / 5.1.1998 / 00:59:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12665
    "Modified: / 16.1.1998 / 13:40:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12666
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12667
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12668
_WCheckboxMenuItemPeer_setState:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12669
    "/ void setState (boolean)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12670
"/    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12671
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12672
    "Created: / 12.11.1998 / 19:14:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12673
    "Modified: / 3.12.1998 / 21:41:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12674
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12675
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12676
_WCheckboxPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12677
    |jCheckboxPeer jCheckbox jFrame frame checkBox lbl|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12678
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12679
    jCheckboxPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12680
    jCheckbox := jCheckboxPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12681
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12682
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12683
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12684
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12685
    checkBox := CheckBox in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12686
    checkBox action:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12687
			jCheckboxPeer 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12688
			    perform:#'handleAction(Z)V' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12689
			    with:(checkBox isOn ifTrue:[1] ifFalse:[0])
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12690
		    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12691
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12692
    lbl := jCheckbox instVarNamed:'label'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12693
    lbl notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12694
	lbl := Java as_ST_String:lbl.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12695
	checkBox label:lbl
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12696
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12697
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12698
    self createdWindowsView:checkBox for:jCheckboxPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12699
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12700
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12701
	'WCheckboxPeer_create: ' print. frame print. ' -> ' print. checkBox printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12702
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12703
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12704
    "Created: / 7.1.1998 / 21:48:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12705
    "Modified: / 15.1.1998 / 12:27:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12706
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12707
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12708
_WCheckboxPeer_setCheckboxGroup:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12709
    |checkBox jGroup|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12710
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12711
    checkBox := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12712
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12713
    jGroup := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12714
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12715
    "Created: / 7.1.1998 / 21:48:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12716
    "Modified: / 25.1.1998 / 01:20:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12717
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12718
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12719
_WCheckboxPeer_setLabel:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12720
    "/ void setLabel (java.lang.String)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12721
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12722
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12723
    "Created: / 12.11.1998 / 19:14:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12724
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12725
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12726
_WCheckboxPeer_setState:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12727
    |checkBox state|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12728
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12729
    checkBox := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12730
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12731
    state := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12732
    state ~~ 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12733
	checkBox turnOn
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12734
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12735
	checkBox turnOff
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12736
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12737
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12738
    "Created: / 7.1.1998 / 21:49:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12739
    "Modified: / 25.1.1998 / 01:26:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12740
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12741
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12742
_WChoicePeer_addItem:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12743
    |jString index comboBox|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12744
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12745
    comboBox := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12746
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12747
    jString := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12748
    index := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12749
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12750
    comboBox model list addLast:(Java as_ST_String:jString).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12751
    comboBox model changed:#list.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12753
    "Created: / 7.1.1998 / 21:45:12 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12754
    "Modified: / 24.1.1998 / 18:51:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12755
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12756
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12757
_WChoicePeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12758
    |jChoicePeer jChoice jFrame frame comboBox|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12759
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12760
    jChoicePeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12761
    jChoice := jChoicePeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12762
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12763
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12764
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12765
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12766
    comboBox := ComboListView in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12767
    comboBox model:(SelectionInList new list:(OrderedCollection new)).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12768
    comboBox action:[:index | 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12769
			jChoicePeer 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12770
			    perform:#'handleAction(I)V' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12771
			    with:(comboBox model selectionIndex - 1)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12772
		    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12773
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12774
    self createdWindowsView:comboBox for:jChoicePeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12775
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12776
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12777
	'WChoicePeer_create: ' print. frame print. ' -> ' print. comboBox printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12778
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12779
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12780
    "Created: / 7.1.1998 / 21:44:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12781
    "Modified: / 28.1.1998 / 23:19:17 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12782
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12783
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12784
_WChoicePeer_remove:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12785
    "/ void remove (int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12786
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12787
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12788
    "Created: / 12.11.1998 / 19:12:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12789
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12790
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12791
_WChoicePeer_reshape:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12792
    self commonReshapeComponent:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12793
"/    self pReshape:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12794
    ^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12795
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12796
    "Created: / 7.1.1998 / 21:46:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12797
    "Modified: / 23.12.1998 / 19:08:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12798
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12799
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12800
_WChoicePeer_select:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12801
    |comboBox index|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12802
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12803
    comboBox := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12804
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12805
    index := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12806
    comboBox model selectionIndex:(index + 1).  "/ JAVA indexing starts at 0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12807
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12808
    "Created: / 7.1.1998 / 21:45:43 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12809
    "Modified: / 25.1.1998 / 09:55:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12810
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12811
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12812
_WClipboard_getClipboardText:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12813
    "/ java.lang.String getClipboardText ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12814
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12815
    |str|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12816
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12817
    str := Screen current rootView getTextSelection.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12818
    str isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12819
	str := ''.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12820
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12821
    ^ Java as_String:''.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12822
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12823
    "Modified: / 10.12.1998 / 21:28:29 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12824
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12825
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12826
_WClipboard_init:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12827
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12828
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12829
    "Modified: / 18.3.1997 / 18:43:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12830
    "Created: / 4.1.1998 / 19:03:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12831
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12832
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12833
_WClipboard_setClipboardText:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12834
    "/ void setClipboardText (java.awt.datatransfer.StringSelection)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12835
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12836
    |strSel data|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12837
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12838
    strSel := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12839
    data := strSel instVarNamed:'data'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12840
    data class == (Java at:'java.lang.String') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12841
	Screen current rootView setTextSelection:(Java as_ST_String:data)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12842
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12843
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12844
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12845
    "Created: / 12.11.1998 / 19:15:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12846
    "Modified: / 10.12.1998 / 21:25:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12847
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12848
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12849
_WColor_getDefaultColor: nativeContext 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12850
    | clrIndex  jClr  clr |
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12851
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12852
    clrIndex := nativeContext argAt: 1.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12853
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12854
    "/ windows defaults:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12855
    "/  1: view background
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12856
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12857
    clrIndex == 1 ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12858
        clr := View defaultViewBackgroundColor.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12859
        clr isColor ifFalse: [ clr := Color gray: 50. ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12860
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12861
    clrIndex == 2 ifTrue: [ clr := Color black. ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12862
    clr isNil ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12863
        self halt.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12864
        self internalError: 'breakpoint'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12865
        ^ nil.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12866
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12867
    clr := clr on: (Screen current).
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12868
    jClr := (self classForName: 'java.awt.Color') new.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12869
    jClr instVarNamed: 'pData' put: clr.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12870
    jClr instVarNamed: 'value' put: (clr rgbValue).
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12871
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12872
"/ self halt.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12873
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12874
    ^ jClr.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12875
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12876
    "Created: / 15.8.1997 / 15:38:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12877
    "Modified: / 4.1.1998 / 18:06:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12878
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12879
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12880
_WComponentPeer__beginValidate:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12881
    "/ void _beginValidate ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12882
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12883
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12884
    "Created: / 12.11.1998 / 19:10:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12885
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12886
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12887
_WComponentPeer__dispose:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12888
    |view jPeer|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12889
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12890
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12891
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12892
    Object errorSignal catch:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12893
	view destroy.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12894
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12895
    JavaWindowGroup removeView:view.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12896
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12897
    jPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12898
    jPeer instVarNamed:'pData' put:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12899
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12900
    "Created: / 7.1.1998 / 22:36:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12901
    "Modified: / 25.1.1998 / 16:43:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12902
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12903
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12904
_WComponentPeer__setBackground:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12905
    |rgb clr view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12906
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12907
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12908
    view isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12909
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12910
    rgb := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12911
    clr := Color rgbValue:rgb.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12912
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12913
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12914
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12915
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12916
    clr := clr on:(view device).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12917
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12918
"/    (view superView isMemberOf:JavaEmbeddedFrameView) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12919
"/        view viewBackground:(view superView viewBackground).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12920
"/        view backgroundPaint:(view superView viewBackground).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12921
"/    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12922
"/        (view isMemberOf:JavaView) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12923
"/            view viewBackground:clr.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12924
"/            view backgroundPaint:clr.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12925
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12926
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12927
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12928
    (view isKindOf:ScrollableView) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12929
	view := view scrolledView
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12930
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12931
    view viewBackground:clr.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12932
    view backgroundPaint:clr.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12933
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12934
    "Created: / 4.1.1998 / 18:07:39 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12935
    "Modified: / 4.12.1998 / 17:26:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12936
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12937
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12938
_WComponentPeer__setForeground:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12939
    |rgb clr view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12940
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12941
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12942
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12943
    rgb := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12944
    clr := Color rgbValue:rgb.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12945
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12946
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12947
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12948
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12949
    clr := clr on:(view device).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12950
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12951
    view paint:clr.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12952
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12953
    "Created: / 4.1.1998 / 18:08:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12954
    "Modified: / 8.1.1998 / 17:32:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12955
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12956
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12957
_WComponentPeer_disable:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12958
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12959
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12960
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12961
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12962
    Object errorSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12963
    ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12964
	view disable
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12965
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12966
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12967
    "Created: / 6.1.1998 / 18:26:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12968
    "Modified: / 8.1.1998 / 17:32:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12969
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12970
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12971
_WComponentPeer_enable:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12972
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12973
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12974
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12975
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12976
    Object errorSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12977
    ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12978
	view enable
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12979
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12980
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12981
    "Modified: / 8.1.1998 / 17:32:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12982
    "Created: / 13.1.1998 / 23:08:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12983
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12984
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12985
_WComponentPeer_endValidate:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12986
    "/ void endValidate ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12987
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12988
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12989
    "Created: / 12.11.1998 / 19:10:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12990
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12991
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12992
_WComponentPeer_getLocationOnScreen: nativeContext 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12993
    "/ java.awt.Point getLocationOnScreen ()
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12994
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12995
    | view  p  jP |
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12996
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12997
    view := self viewForWPeer: nativeContext.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12998
    view isNil ifTrue: [ ^ nil ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 12999
    p := view originRelativeTo: nil.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 13000
    jP := (self classForName: 'java.awt.Point') basicNew.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 13001
    jP instVarNamed: 'x' put: p x.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 13002
    jP instVarNamed: 'y' put: p y.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13003
    ^ jP
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13004
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13005
    "Modified: / 5.12.1998 / 14:44:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13006
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13007
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13008
_WComponentPeer_handleEvent:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13009
    "this is invoked by java, to let a widget handle any event which
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13010
     was not consumed (eaten) by java.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13011
     If the view in question is some ST-widget, forward it.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13012
     Ignore for JavaViews."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13013
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13014
    |view jEv stEv ignore|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13015
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13016
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13017
    view notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13018
	jEv := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13019
	stEv := jEv instVarNamed:'data'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13020
	(stEv notNil and:[stEv ~~ 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13021
	    ignore := true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13022
	    view isJavaView ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13023
		ignore := false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13024
	    ] ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13025
		view isTopView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13026
		    stEv type == #terminate ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13027
			ignore := false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13028
		    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13029
		]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13030
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13031
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13032
	    ignore ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13033
		EventTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13034
		    ('JAVA: WComponent - handleEvent: ' , stEv type , ' for ' , view printString) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13035
		].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13036
		view dispatchEvent:stEv. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13037
		^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13038
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13039
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13040
	    EventTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13041
		('JAVA: WComponent - handleEvent ignored:' , stEv type) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13042
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13043
	    ^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13044
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13045
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13046
    EventTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13047
	('JAVA: WComponent - handleEvent ignored') infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13048
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13049
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13050
    "Created: / 6.1.1998 / 21:10:17 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13051
    "Modified: / 11.12.1998 / 01:04:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13052
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13053
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13054
_WComponentPeer_hide:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13055
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13056
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13057
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13058
"/ view isPopUpView ifTrue:[self halt].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13059
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13060
    Object errorSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13061
    ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13062
	view beInvisible
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13063
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13064
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13065
    "Created: / 7.1.1998 / 22:35:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13066
    "Modified: / 4.12.1998 / 17:53:41 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13067
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13068
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13069
_WComponentPeer_nativeHandleEvent:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13070
    "this is invoked by java, to let a widget handle any event which
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13071
     was not consumed (eaten) by java.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13072
     If the view in question is some ST-widget, forward it.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13073
     Ignore for JavaViews."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13074
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13075
    |view jEv stEv|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13076
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13077
^self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13078
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13079
    view notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13080
	(view isKindOf:JavaView) ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13081
	    jEv := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13082
	    stEv := jEv instVarNamed:'data'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13083
	    (stEv notNil and:[stEv ~~ 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13084
		EventTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13085
		    ('JAVA: WComponent - handleEvent: ' , stEv type , ' for ' , view printString) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13086
		].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13087
		stEv sendEventWithFocusOn:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13088
		^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13089
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13090
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13091
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13092
    EventTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13093
	('JAVA: WComponent - handleEvent ignored') infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13094
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13095
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13096
    "Created: / 19.10.1998 / 21:26:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13097
    "Modified: / 19.10.1998 / 23:26:37 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13098
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13099
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13100
_WComponentPeer_requestFocus:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13101
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13102
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13103
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13104
"/ 'getFocus - ' print. view displayString printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13105
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13106
"/    view getKeyboardFocus
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13107
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13108
    "Created: / 7.1.1998 / 22:30:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13109
    "Modified: / 4.12.1998 / 19:42:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13110
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13111
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13112
_WComponentPeer_reshape:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13113
    self commonReshapeComponent:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13114
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13115
    "Modified: / 18.3.1997 / 19:30:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13116
    "Created: / 4.1.1998 / 18:01:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13117
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13118
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13119
_WComponentPeer_setBackground:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13120
    |jClr rgb clr view|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13121
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13122
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13123
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13124
    jClr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13125
    rgb := jClr instVarNamed:'value'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13126
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13127
    clr := Color rgbValue:rgb.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13128
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13129
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13130
    clr := clr on:(view device).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13131
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13132
"/    (view superView isMemberOf:JavaEmbeddedFrameView) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13133
"/        view viewBackground:(view superView viewBackground).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13134
"/        view backgroundPaint:(view superView viewBackground).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13135
"/    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13136
"/        (view isMemberOf:JavaView) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13137
"/            view viewBackground:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13138
"/            view backgroundPaint:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13139
"/        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13140
"/    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13141
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13142
    (view isKindOf:ScrollableView) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13143
	view := view scrolledView
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13144
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13145
    view viewBackground:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13146
    view backgroundPaint:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13147
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13148
    "Created: / 16.10.1998 / 02:16:31 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13149
    "Modified: / 16.10.1998 / 02:26:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13150
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13151
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13152
_WComponentPeer_setCursor:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13153
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13154
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13155
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13156
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13157
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13158
    "Created: / 5.1.1998 / 01:52:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13159
    "Modified: / 25.1.1998 / 01:21:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13160
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13161
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13162
_WComponentPeer_setFont:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13163
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13164
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13165
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13166
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13167
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13168
    "Created: / 5.1.1998 / 00:55:17 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13169
    "Modified: / 25.1.1998 / 01:22:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13170
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13171
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13172
_WComponentPeer_setForeground:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13173
    |jClr rgb clr view|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13174
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13175
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13176
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13177
    jClr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13178
    rgb := jClr instVarNamed:'value'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13179
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13180
    clr := Color rgbValue:rgb.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13181
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13182
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13183
    clr := clr on:(view device).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13184
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13185
    (view isKindOf:ScrollableView) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13186
	view := view scrolledView
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13187
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13188
    view paint:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13189
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13190
    "Created: / 16.10.1998 / 02:18:58 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13191
    "Modified: / 16.10.1998 / 02:26:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13192
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13193
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13194
_WComponentPeer_setZOrderPosition:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13195
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13196
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13197
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13198
"/    self unimplementedNativeMethod.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13199
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13200
"/ self internalError:'breakPoint'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13201
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13202
    "Created: / 4.1.1998 / 17:59:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13203
    "Modified: / 25.1.1998 / 01:22:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13204
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13205
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13206
_WComponentPeer_show:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13207
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13208
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13209
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13210
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13211
    "/ frame views are under my browsers own control
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13212
    (view isMemberOf:JavaEmbeddedFrameView) ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13213
	view beVisible.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13214
	view realize.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13215
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13216
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13217
"/    view windowGroup notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13218
"/        windowServer addGroup:(view windowGroup)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13219
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13220
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13221
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13222
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13223
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13224
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13225
    "Created: / 5.1.1998 / 01:26:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13226
    "Modified: / 4.12.1998 / 17:43:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13227
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13228
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13229
_WComponentPeer_start:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13230
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13231
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13232
    "Modified: / 18.3.1997 / 18:43:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13233
    "Created: / 5.1.1998 / 00:58:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13234
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13235
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13236
_WContainerPeer_calculateInsets:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13237
    "/ new with ns4.0 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13238
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13239
    "Created: / 16.10.1998 / 02:12:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13240
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13241
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13242
_WDefaultFontCharset_canConvert:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13243
    ^ 1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13244
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13245
    "Modified: / 21.8.1997 / 15:56:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13246
    "Created: / 5.1.1998 / 01:55:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13247
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13248
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13249
_WDialogPeer__hide:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13250
    |dialog|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13251
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13252
    dialog := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13253
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13254
    dialog hide.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13255
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13256
    "Created: / 7.1.1998 / 22:34:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13257
    "Modified: / 8.1.1998 / 17:34:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13258
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13259
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13260
_WDialogPeer__show:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13261
    |dialog|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13262
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13263
    dialog := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13264
"/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13265
"/ show does not work (yet); must setup windowgroup
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13266
"/ for it to get events ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13267
"/    dialog realize.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13268
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13269
dialog show.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13270
"/dialog fixSize.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13271
"/dialog makeFullyVisible.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13272
"/dialog openModal:[true] inGroup:JavaWindowGroup
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13273
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13274
    "Created: / 7.1.1998 / 21:52:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13275
    "Modified: / 11.12.1998 / 14:43:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13276
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13277
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13278
_WDialogPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13279
    |jDialogPeer dialog|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13280
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13281
    jDialogPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13282
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13283
    dialog := ModalBox new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13284
    jDialogPeer instVarNamed:'pData' put:dialog.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13285
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13286
    self createdWindowsView:dialog for:jDialogPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13287
    dialog windowGroup:JavaWindowGroup.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13288
    JavaWindowGroup addTopView:dialog.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13289
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13290
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13291
	'WDialogPeer_create: ' print. dialog printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13292
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13293
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13294
    "Created: / 7.1.1998 / 21:51:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13295
    "Modified: / 15.1.1998 / 16:12:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13296
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13297
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13298
_WDrawingSurfaceInfo_getDepth:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13299
    "/ int getDepth ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13300
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13301
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13302
    "Created: / 12.11.1998 / 19:21:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13303
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13304
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13305
_WDrawingSurfaceInfo_getHBitmap:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13306
    "/ int getHBitmap ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13307
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13308
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13309
    "Created: / 12.11.1998 / 19:20:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13310
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13311
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13312
_WDrawingSurfaceInfo_getHDC:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13313
    "/ int getHDC ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13314
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13315
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13316
    "Created: / 12.11.1998 / 19:20:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13317
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13318
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13319
_WDrawingSurfaceInfo_getHPalette:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13320
    "/ int getHPalette ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13321
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13322
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13323
    "Created: / 12.11.1998 / 19:21:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13324
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13325
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13326
_WDrawingSurfaceInfo_getHWnd:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13327
    "/ int getHWnd ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13328
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13329
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13330
    "Created: / 12.11.1998 / 19:20:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13331
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13332
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13333
_WDrawingSurfaceInfo_getPBits:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13334
    "/ int getPBits ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13335
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13336
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13337
    "Created: / 12.11.1998 / 19:20:41 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13338
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13339
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13340
_WDrawingSurfaceInfo_lock:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13341
    "/ int lock ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13342
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13343
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13344
    "Created: / 12.11.1998 / 19:20:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13345
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13346
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13347
_WDrawingSurfaceInfo_unlock:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13348
    "/ void unlock ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13349
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13350
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13351
    "Created: / 12.11.1998 / 19:20:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13352
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13353
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13354
_WEmbeddedFramePeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13355
    "/ void create (sun.awt.windows.WComponentPeer)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13356
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13357
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13358
    "Created: / 12.11.1998 / 19:16:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13359
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13360
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13361
_WFileDialogPeer_show:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13362
    |jDialogPeer jDialog dialogView stDialog 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13363
     title dir pattern f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13364
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13365
    jDialogPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13366
    jDialog := jDialogPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13367
    dialogView := jDialogPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13368
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13369
    stDialog := FileSelectionBox new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13370
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13371
    dir := jDialog instVarNamed:'dir'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13372
    dir notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13373
	stDialog directory:(Java as_ST_String:dir).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13374
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13375
    pattern := jDialog instVarNamed:'file'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13376
    pattern notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13377
	stDialog pattern:(Java as_ST_String:pattern).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13378
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13379
    title := jDialog instVarNamed:'title'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13380
    title notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13381
	stDialog title:(Java as_ST_String:title).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13382
	stDialog label:(Java as_ST_String:title).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13383
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13384
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13385
    stDialog show.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13386
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13387
    stDialog accepted ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13388
	f := stDialog pathName.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13389
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13390
	"/ cannot use the one below - it has a builtIn fileSeparator if '\' (sigh)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13391
	"/ jDialogPeer perform:#'handleSelected(Ljava/lang/String;)V' with:(Java as_String:f).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13392
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13393
	jDialog 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13394
	    perform:#'setFile(Ljava/lang/String;)V' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13395
	    with:(Java as_String:(f asFilename baseName)).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13396
	jDialog 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13397
	    perform:#'setDirectory(Ljava/lang/String;)V'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13398
	    with:(Java as_String:(f asFilename directoryName , Filename separator asString)).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13399
	jDialog 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13400
	    perform:#'setVisible(Z)V'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13401
	    with:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13402
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13403
	jDialogPeer 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13404
	    perform:#'handleCancel()V'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13405
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13406
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13407
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13408
    "Created: / 7.1.1998 / 22:38:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13409
    "Modified: / 15.1.1998 / 13:04:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13410
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13411
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13412
_WFontMetrics_bytesWidth:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13413
    "/ int bytesWidth (byte[] int int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13414
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13415
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13416
    "Created: / 12.11.1998 / 19:11:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13417
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13418
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13419
_WFontMetrics_getMFCharSegmentWidth:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13420
    "get multi-font string-segment width.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13421
     Not yet supported - use standard strings width"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13422
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13423
    |jMetrics jFont jFontDescr stFont w
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13424
     bool1 cp offs lenght bp int1|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13425
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13426
    jMetrics := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13427
    jFont := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13428
    jFontDescr := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13429
    bool1 := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13430
    cp := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13431
    offs := nativeContext argAt:5.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13432
    lenght := nativeContext argAt:6.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13433
    bp := nativeContext argAt:7.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13434
    int1 := nativeContext argAt:8.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13435
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13436
    stFont := jFont instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13437
    (stFont isNil or:[stFont == 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13438
	self halt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13439
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13440
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13441
    stFont device isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13442
	stFont := stFont on:Display.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13443
	jFont instVarNamed:'pData' put:stFont.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13444
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13445
    w := stFont widthOf:cp from:offs+1 to:offs+lenght.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13446
    ^ w.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13447
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13448
    "Created: / 5.1.1998 / 01:57:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13449
    "Modified: / 13.1.1998 / 23:44:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13450
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13451
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13452
_WFontMetrics_init:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13453
    |jMetrics jFont stFont widths family name style size|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13454
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13455
    jMetrics := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13456
    jFont := jMetrics instVarNamed:'font'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13457
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13458
    family := jFont instVarNamed:'family'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13459
    family := Java as_ST_String:family.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13460
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13461
    name := jFont instVarNamed:'name'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13462
    name := Java as_ST_String:name.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13463
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13464
    style := jFont instVarNamed:'style'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13465
    size := jFont instVarNamed:'size'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13466
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13467
    stFont := Font family:family size:size.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13468
    stFont isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13469
        stFont := Font family:'helvetica' size:size.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13470
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13471
    stFont := stFont on:Display.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13472
self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13473
"/    stFont := jFont instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13474
"/    stFont isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13475
"/        self halt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13476
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13477
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13478
    stFont := stFont on:Display.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13479
    jFont instVarNamed:'pData' put:stFont.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13480
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13481
    jMetrics instVarNamed:'ascent'     put:stFont ascent.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13482
    jMetrics instVarNamed:'descent'    put:stFont descent.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13483
    jMetrics instVarNamed:'leading'    put:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13484
    jMetrics instVarNamed:'height'     put:stFont height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13485
    jMetrics instVarNamed:'maxAscent'  put:stFont maxAscent.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13486
    jMetrics instVarNamed:'maxDescent' put:stFont maxDescent.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13487
    jMetrics instVarNamed:'maxHeight'  put:stFont maxHeight.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13488
    jMetrics instVarNamed:'maxAdvance' put:stFont maxWidth.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13489
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13490
    widths := Array new:256.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13491
    0 to:255 do:[:i |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13492
        widths at:(i+1) put:(stFont widthOf:(Character value:i))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13493
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13494
    jMetrics instVarNamed:'widths' put:widths.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13495
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13496
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13497
    "Modified: / 8.8.1997 / 12:06:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13498
    "Created: / 5.1.1998 / 01:54:29 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13499
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13500
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13501
_WFontMetrics_needsConversion:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13502
    |jFont jFontDescr stFont|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13503
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13504
    jFont := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13505
    jFontDescr := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13506
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13507
    stFont := jFont instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13508
"/    stFont isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13509
"/        self halt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13510
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13511
"/    stFont device isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13512
"/        stFont := stFont on:Display.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13513
"/        jFont instVarNamed:'pData' put:stFont.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13514
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13515
"/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13516
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13517
    ^ 0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13518
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13519
    "Modified: / 17.8.1997 / 17:16:29 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13520
    "Created: / 5.1.1998 / 01:56:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13521
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13522
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13523
_WFramePeer__setIconImage:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13524
    |frame imgRep image|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13525
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13526
    frame := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13527
    imgRep := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13528
    imgRep notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13529
	image := imgRep instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13530
	(image notNil and:[image ~~ 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13531
	    frame icon:image.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13532
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13533
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13534
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13535
    "Created: / 27.4.1998 / 17:15:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13536
    "Modified: / 27.4.1998 / 17:18:24 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13537
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13538
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13539
_WFramePeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13540
    |jFramePeer jFrame top frame pDataIdx|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13541
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13542
    jFramePeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13543
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13544
    "/ for now: a kludge to create an embedded frame for
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13545
    "/ mozillaFrames
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13546
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13547
    jFrame := jFramePeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13548
    (jFrame notNil 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13549
    and:[(pDataIdx := jFrame class instVarOffsetOf:'pData') notNil])
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13550
    ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13551
	((frame := jFrame instVarAt:pDataIdx) notNil 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13552
	and:[frame ~~ 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13553
	    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13554
		'JAVA: targetFrame view already created: ' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13555
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13556
	    "/ sigh; pData was renamed to pNativeWidget in jdk1.2 ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13557
	    pDataIdx := jFramePeer class instVarOffsetOf:'pNativeWidget'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13558
	    pDataIdx isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13559
		"/ ok, we are < 1.2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13560
		pDataIdx := jFramePeer class instVarOffsetOf:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13561
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13562
	    jFramePeer instVarAt:pDataIdx put:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13563
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13564
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13565
	frame := jFramePeer instVarNamed:'pData'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13566
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13567
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13568
    (frame notNil and:[frame ~~ 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13569
	WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13570
	    'JAVA: frame view already created: ' infoPrint.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13571
	    jFramePeer class name infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13572
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13573
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13574
"/ OLD
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13575
"/        frame := StandardSystemView new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13576
"/        self createdWindowsView:frame for:jFramePeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13577
"/        JavaWindowGroup addTopView:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13578
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13579
	frame := JavaTopView new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13580
	frame delegate:self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13581
	frame javaPeer:jFramePeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13582
	self createdWindowsView:frame for:jFramePeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13583
	JavaWindowGroup addTopView:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13584
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13585
"/        top := StandardSystemView new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13586
"/        frame := JavaView origin:0.0@0.0 corner:1.0@1.0 in:top.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13587
"/        frame delegate:self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13588
"/        frame javaPeer:jFramePeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13589
"/        self createdWindowsView:frame for:jFramePeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13590
"/        JavaWindowGroup addTopView:top.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13591
        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13592
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13593
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13594
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13595
	'JAVA: WFramePeer_create: ' print. jFramePeer displayString print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13596
	' frame: ' print. frame printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13597
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13598
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13599
    "Created: / 4.1.1998 / 17:56:39 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13600
    "Modified: / 3.12.1998 / 00:10:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13601
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13602
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13603
_WFramePeer_setMenuBar0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13604
    |frame jMenuBarPeer menuPanel|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13605
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13606
    frame := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13607
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13608
    jMenuBarPeer := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13609
    jMenuBarPeer isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13610
	"/ mhmh - JAVA wants to remove the frames menuPanel.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13611
	"/ but I have no handle on it (for destroy).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13612
	"/ search it in subViews of the frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13613
	frame subViews copy do:[:v |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13614
	    (v isKindOf:MenuPanel) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13615
		v destroy
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13616
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13617
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13618
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13619
	menuPanel := jMenuBarPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13620
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13621
	menuPanel origin:0.0@0.0 corner:1.0@(menuPanel preferredExtent y).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13622
	frame addSubView:menuPanel.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13623
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13624
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13625
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13626
    "Created: / 7.1.1998 / 21:41:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13627
    "Modified: / 8.1.1998 / 17:35:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13628
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13629
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13630
_WFramePeer_setResizable:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13631
    |view onOff|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13632
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13633
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13634
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13635
    onOff := (nativeContext argAt:1) == 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13636
    view isTopView ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13637
	onOff ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13638
	    view minExtent:10@10.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13639
	    view maxExtent:(Screen current extent).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13640
	] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13641
	    view minExtent:view extent.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13642
	    view maxExtent:view extent.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13643
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13644
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13645
	(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13646
	    self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13647
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13648
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13649
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13650
"/ 'JAVA: WWindowPeer_setResizable: ' print. view print. ' yes/no: ' print. onOff printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13651
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13652
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13653
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13654
    "Modified: / 16.1.1998 / 18:08:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13655
    "Created: / 16.10.1998 / 02:21:34 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13656
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13657
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13658
_WFramePeer_setTitle:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13659
    |view jString string|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13660
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13661
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13662
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13663
    jString := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13664
    string := Java as_ST_String:jString.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13665
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13666
"/ 'JAVA: WFramePeer_pSetTitle: ' print. string print. ' ' print. view printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13667
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13668
    view label:string.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13669
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13670
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13671
    "Modified: / 8.1.1998 / 17:37:41 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13672
    "Created: / 27.1.1998 / 21:42:57 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13673
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13674
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13675
_WGraphics__dispose:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13676
    "/ void _dispose()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13677
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13678
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13679
    "Created: / 12.11.1998 / 19:17:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13680
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13681
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13682
_WGraphics_changeClip:nativeContext        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13683
    |gc x y w h r bool|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13684
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13685
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13686
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13687
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13688
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13689
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13690
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13691
    bool := (nativeContext argAt:5) ~~ 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13692
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13693
    r := Rectangle left:x top:y width:w height:h.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13694
"/ 'WGraphics_changeClip: ' infoPrint. r infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13695
    gc clippingRectangle:r.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13696
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13697
    "Created: / 6.1.1998 / 20:57:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13698
    "Modified: / 20.10.1998 / 19:40:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13699
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13700
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13701
_WGraphics_clearRect:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13702
    |gc x y w h|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13703
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13704
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13705
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13706
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13707
    gc realized ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13708
	'JAVA: drawing on unrealized gc - ignored' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13709
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13710
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13711
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13712
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13713
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13714
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13715
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13716
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13717
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13718
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13719
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13720
    gc clearRectangleX:x y:y width:w height:h.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13721
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13722
    "Created: / 8.1.1998 / 00:16:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13723
    "Modified: / 8.1.1998 / 00:21:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13724
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13725
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13726
_WGraphics_close:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13727
    "/ void close (sun.awt.windows.WPrintJob)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13728
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13729
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13730
    "Created: / 12.11.1998 / 19:19:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13731
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13732
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13733
_WGraphics_copyArea:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13734
    |gc srcX srcY w h deltaX deltaY|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13735
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13736
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13737
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13738
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13739
    gc realized ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13740
	'JAVA: copyArea on unrealized gc - ignored' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13741
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13742
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13743
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13744
    srcX := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13745
    srcY := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13746
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13747
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13748
    deltaX := nativeContext argAt:5.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13749
    deltaY := nativeContext argAt:6.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13750
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13751
    gc
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13752
	copyFrom:gc
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13753
	x:srcX y:srcY 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13754
	toX:srcX+deltaX y:srcY+deltaY 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13755
	width:w height:h
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13756
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13757
    "Created: / 8.1.1998 / 00:16:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13758
    "Modified: / 9.4.1998 / 22:01:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13759
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13760
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13761
_WGraphics_createFromComponent:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13762
    |jGraphics jWin view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13763
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13764
    jGraphics := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13765
    jWin := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13766
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13767
    view := KnownWindows at:jWin ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13768
    view isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13769
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13770
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13771
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13772
    view clippingRectangle:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13773
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13774
"/    "/ just a consistency check ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13775
"/    (jWin instVarNamed:'xid') ~~ view ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13776
"/        self halt:'consistency check'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13777
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13778
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13779
    jGraphics instVarNamed:'pData' put:view.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13780
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13781
    "Created: / 6.1.1998 / 20:55:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13782
    "Modified: / 20.10.1998 / 19:38:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13783
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13784
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13785
_WGraphics_createFromGraphics:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13786
    |jGraphics graphics gc|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13787
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13788
    jGraphics := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13789
    graphics := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13790
    gc := graphics instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13791
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13792
    jGraphics instVarNamed:'pData' put:gc.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13793
    gc clippingRectangle:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13794
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13795
    "Created: / 8.1.1998 / 00:47:39 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13796
    "Modified: / 20.10.1998 / 19:37:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13797
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13798
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13799
_WGraphics_createFromHDC:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13800
    "/ void createFromHDC (int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13801
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13802
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13803
    "Created: / 12.11.1998 / 19:17:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13804
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13805
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13806
_WGraphics_createFromPrintJob:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13807
    "/ void createFromPrintJob (sun.awt.windows.WPrintJob)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13808
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13809
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13810
    "Created: / 12.11.1998 / 19:17:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13811
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13812
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13813
_WGraphics_dispose:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13814
    |gc|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13815
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13816
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13817
    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13818
    gc clippingRectangle:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13819
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13820
    "Created: / 6.1.1998 / 20:58:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13821
    "Modified: / 20.10.1998 / 19:35:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13822
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13823
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13824
_WGraphics_drawArc:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13825
    |gc x y w h startAngle endAngle|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13826
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13827
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13828
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13829
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13830
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13831
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13832
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13833
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13834
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13835
    startAngle := nativeContext argAt:5.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13836
    endAngle := nativeContext argAt:6.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13837
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13838
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13839
	'drawArc x/y= ' print. x print. '@' print. y print. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13840
	       ' w/h= ' print. w print. '@' print. h print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13841
	       ' startAngle= ' print. startAngle print. ' endAngle= ' print. endAngle printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13842
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13843
    gc 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13844
	displayArcX:x y:y 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13845
	width:w height:h 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13846
	from:startAngle angle:(endAngle - startAngle).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13847
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13848
    "Created: / 6.1.1998 / 21:00:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13849
    "Modified: / 28.1.1999 / 17:38:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13850
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13851
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13852
_WGraphics_drawBytes:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13853
    "/ void drawBytes (byte[] int int int int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13854
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13855
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13856
    "Created: / 12.11.1998 / 19:18:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13857
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13858
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13859
_WGraphics_drawLine:nativeContext        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13860
    |gc x y x2 y2|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13861
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13862
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13863
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13864
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13865
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13866
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13867
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13868
    x2 := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13869
    y2 := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13870
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13871
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13872
	'drawLine x/y= ' print. x print. '@' print. y print. ' x2/y2= ' print. x2 print. '@' print. y2 printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13873
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13874
    gc displayLineFromX:x y:y toX:x2 y:y2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13875
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13876
    "Created: / 6.1.1998 / 20:59:27 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13877
    "Modified: / 8.1.1998 / 00:34:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13878
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13879
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13880
_WGraphics_drawMFCharsConvertedSegment:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13881
    "/ int drawMFCharsConvertedSegment (java.awt.Font sun.awt.FontDescriptor byte[] int int int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13882
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13883
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13884
    "Created: / 12.11.1998 / 19:18:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13885
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13886
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13887
_WGraphics_drawMFCharsSegment:nativeContext       
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13888
    |jFont jFontDescr s gc x y offs len|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13889
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13890
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13891
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13892
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13893
    jFont := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13894
    jFontDescr := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13895
    s := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13896
    offs := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13897
    len := nativeContext argAt:5.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13898
    x := nativeContext argAt:6.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13899
    y := nativeContext argAt:7.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13900
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13901
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13902
	'drawMFCharsSegment x/y= ' print. x print. '@' print. y print. ' s= ' print. s printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13903
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13904
    gc displayString:s from:offs+1 to:offs+len x:x y:y.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13905
    ^ (gc font onDevice:(gc graphicsDevice)) widthOf:s.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13906
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13907
    "Created: / 6.1.1998 / 21:01:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13908
    "Modified: / 25.1.1998 / 20:45:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13909
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13910
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13911
_WGraphics_drawOval:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13912
    |gc x y w h|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13913
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13914
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13915
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13916
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13917
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13918
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13919
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13920
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13921
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13922
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13923
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13924
	'drawOval x/y= ' print. x print. '@' print. y print. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13925
		' w/h= ' print. w print. '@' print. h printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13926
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13927
    gc displayArcX:x y:y width:w height:h from:0 angle:360.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13928
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13929
    "Created: / 8.1.1998 / 00:44:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13930
    "Modified: / 9.4.1998 / 22:10:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13931
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13932
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13933
_WGraphics_drawPolygon:nativeContext        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13934
    |gc xVector yVector count points|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13935
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13936
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13937
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13938
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13939
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13940
    xVector := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13941
    yVector := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13942
    count := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13943
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13944
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13945
	'drawPolgon' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13946
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13947
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13948
    points := (1 to:count) collect:[:i | (xVector at:i) @ (yVector at:i)].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13949
    gc displayPolygon:points
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13950
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13951
    "Created: / 8.1.1998 / 00:57:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13952
    "Modified: / 8.1.1998 / 00:57:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13953
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13954
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13955
_WGraphics_drawPolyline:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13956
    "/ void drawPolyline (int[] int[] int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13957
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13958
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13959
    "Created: / 12.11.1998 / 19:19:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13960
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13961
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13962
_WGraphics_drawRect:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13963
    |gc x y w h|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13964
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13965
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13966
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13967
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13968
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13969
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13970
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13971
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13972
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13973
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13974
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13975
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13976
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13977
    gc displayRectangleX:x y:y width:w height:h.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13978
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13979
    "Modified: / 8.1.1998 / 00:34:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13980
    "Created: / 8.1.1998 / 00:59:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13981
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13982
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13983
_WGraphics_drawRoundRect:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13984
    |gc x y w h|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13985
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13986
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13987
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13988
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13989
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13990
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13991
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13992
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13993
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13994
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13995
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13996
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13997
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13998
    gc displayRectangleX:x y:y width:w height:h.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13999
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14000
    "Modified: / 8.1.1998 / 00:34:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14001
    "Created: / 8.1.1998 / 00:59:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14002
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14003
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14004
_WGraphics_drawSFChars:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14005
    "/ void drawSFChars (char[]s, int pos1, int len, int x, int y)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14006
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14007
    |gc str x y idx1 nChars|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14008
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14009
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14010
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14011
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14012
    str := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14013
    idx1 := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14014
    nChars := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14015
    x := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14016
    y := nativeContext argAt:5.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14017
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14018
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14019
	'drawSFChars x/y= ' print. x print. '@' print. y print. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14020
	       ' s= ' print. str printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14021
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14022
    gc displayString:str from:idx1+1 to:idx1+nChars x:x y:y
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14023
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14024
    "Created: / 6.1.1998 / 21:11:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14025
    "Modified: / 8.1.1998 / 00:33:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14026
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14027
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14028
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14029
_WGraphics_fillArc:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14030
    |gc x y w h startAngle endAngle|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14031
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14032
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14033
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14034
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14035
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14036
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14037
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14038
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14039
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14040
    startAngle := nativeContext argAt:5.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14041
    endAngle := nativeContext argAt:6.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14042
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14043
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14044
	'fillArc x/y= ' print. x print. '@' print. y print. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14045
	       ' w/h= ' print. w print. '@' print. h print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14046
	       ' startAngle= ' print. startAngle print. ' endAngle= ' print. endAngle printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14047
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14048
    gc fillArcX:x y:y width:w height:h from:startAngle angle:(endAngle - startAngle)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14049
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14050
    "Created: / 6.1.1998 / 21:11:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14051
    "Modified: / 8.1.1998 / 00:33:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14052
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14053
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14054
_WGraphics_fillOval:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14055
    |gc x y w h|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14056
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14057
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14058
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14059
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14060
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14061
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14062
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14063
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14064
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14065
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14066
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14067
	'drawOval x/y= ' print. x print. '@' print. y print. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14068
		' w/h= ' print. w print. '@' print. h printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14069
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14070
    gc fillArcX:x y:y width:w height:h from:0 angle:360
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14071
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14072
    "Created: / 8.1.1998 / 00:46:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14073
    "Modified: / 8.1.1998 / 00:46:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14074
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14075
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14076
_WGraphics_fillPolygon:nativeContext        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14077
    |gc xVector yVector count points|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14078
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14079
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14080
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14081
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14082
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14083
    xVector := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14084
    yVector := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14085
    count := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14086
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14087
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14088
	'fillPolgon' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14089
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14090
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14091
    points := (1 to:count) collect:[:i | (xVector at:i) @ (yVector at:i)].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14092
    gc fillPolygon:points
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14093
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14094
    "Created: / 8.1.1998 / 00:58:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14095
    "Modified: / 25.1.1998 / 11:03:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14096
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14097
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14098
_WGraphics_fillRect:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14099
    |gc x y w h|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14100
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14101
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14102
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14103
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14104
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14105
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14106
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14107
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14108
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14109
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14110
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14111
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14112
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14113
    gc fillRectangleX:x y:y width:w height:h.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14114
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14115
    "Created: / 15.8.1997 / 15:43:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14116
    "Modified: / 8.1.1998 / 00:34:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14117
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14118
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14119
_WGraphics_fillRoundRect:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14120
    |gc x y w h|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14121
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14122
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14123
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14124
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14125
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14126
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14127
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14128
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14129
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14130
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14131
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14132
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14133
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14134
    gc displayRectangleX:x y:y width:w height:h.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14135
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14136
    "Modified: / 8.1.1998 / 00:34:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14137
    "Created: / 8.1.1998 / 00:59:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14138
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14139
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14140
_WGraphics_getClipBounds: nativeContext 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14141
    | gc  rect  r  x  y  w  h |
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14142
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14143
    gc := self gcForWGraphics: nativeContext.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14144
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14145
"/    gc isNil ifTrue:[^ nil].
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14146
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14147
    rect := (self classForName: 'java.awt.Rectangle') basicNew.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14148
    (gc isMemberOf: JavaView) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14149
        "/ r := gc clippingRectangleOrNil. 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14150
        r := gc getNextUpdateRectangle.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14151
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14152
    r isNil ifTrue: [ r := gc clippingRectangleOrNil. ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14153
    r isNil ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14154
        x := y := 0.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14155
        w := (gc width).
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14156
        h := (gc height).
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14157
    ] ifFalse: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14158
        x := (r left).
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14159
        y := (r top).
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14160
        w := (r width).
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14161
        h := (r height).
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14162
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14163
    rect instVarNamed: 'x' put: x.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14164
    rect instVarNamed: 'y' put: y.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14165
    rect instVarNamed: 'width' put: w.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14166
    rect instVarNamed: 'height' put: h.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14167
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14168
"/ 'WGraphics__getClipBounds ' infoPrint. (x@y extent:w@h) infoPrintCR.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 14169
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14170
    ^ rect
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14171
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14172
    "Created: / 6.1.1998 / 20:58:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14173
    "Modified: / 23.12.1998 / 20:14:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14174
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14175
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14176
_WGraphics_imageCreate:nativeContext        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14177
    |jGraphics imgRep|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14178
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14179
    jGraphics := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14180
    imgRep := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14181
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14182
    jGraphics instVarNamed:'pData' put:(imgRep instVarNamed:'pData').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14183
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14184
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14185
    "Created: / 11.1.1998 / 16:34:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14186
    "Modified: / 17.1.1998 / 12:37:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14187
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14188
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14189
_WGraphics_pSetFont:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14190
    |gc jFont stFont|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14191
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14192
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14193
    jFont := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14194
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14195
    stFont := jFont instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14196
    (stFont isNil or:[stFont == 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14197
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14198
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14199
	gc font:stFont
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14200
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14201
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14202
    "Created: / 6.1.1998 / 20:56:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14203
    "Modified: / 15.1.1998 / 12:31:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14204
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14205
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14206
_WGraphics_pSetForeground:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14207
    |gc rgb clr|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14208
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14209
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14210
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14211
    rgb := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14212
    rgb isInteger ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14213
        "/ its a java.awt.Color
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14214
        rgb := rgb instVarNamed:'value'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14215
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14216
    clr := Color rgbValue:rgb.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14217
    gc paint:(clr nearestOn:gc device).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14218
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14219
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14220
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14221
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14222
    "Created: / 6.1.1998 / 20:56:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14223
    "Modified: / 23.12.1998 / 20:10:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14224
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14225
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14226
_WGraphics_print:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14227
    "/ void print (sun.awt.windows.WComponentPeer)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14228
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14229
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14230
    "Created: / 12.11.1998 / 19:19:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14231
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14232
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14233
_WGraphics_removeClip:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14234
    "/ void removeClip ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14235
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14236
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14237
    "Created: / 12.11.1998 / 19:18:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14238
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14239
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14240
_WGraphics_setPaintMode:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14241
    |gc|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14242
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14243
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14244
    gc function:#copy.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14245
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14246
    true "DrawOPTrace" ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14247
	'copyMode' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14248
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14249
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14250
    "Created: / 8.1.1998 / 00:33:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14251
    "Modified: / 28.1.1998 / 23:25:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14252
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14253
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14254
_WGraphics_setXORMode:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14255
    |gc jColor rgb invColor device|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14256
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14257
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14258
    jColor := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14259
    device := gc graphicsDevice.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14260
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14261
"/    "/ on trueColor systems, use the provided
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14262
"/    "/ rgb value for inverting.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14263
"/    "/ on palette systems, use white ^ black
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14264
"/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14265
"/    device visualType == #TrueColor ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14266
"/        rgb := jColor instVarNamed:'value'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14267
"/        rgb := rgb bitAnd:16rFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14268
"/        rgb == 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14269
"/            rgb := 16rFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14270
"/        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14271
"/        invColor := rgb
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14272
"/    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14273
"/        invColor := device blackpixel bitXor:device whitepixel.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14274
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14275
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14276
    invColor := device blackpixel bitXor:device whitepixel.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14277
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14278
"/    gc foreground:(Color colorId:invColor)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14279
"/       background:device blackColor.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14280
    device 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14281
	setForeground:invColor background:0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14282
	in:gc gcId.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14283
    gc function:#xor.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14284
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14285
    true "DrawOPTrace" ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14286
	'xorMode' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14287
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14288
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14289
    "Created: / 8.1.1998 / 00:36:17 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14290
    "Modified: / 28.1.1998 / 23:45:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14291
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14292
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14293
_WLabelPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14294
    |jLabelPeer jLabel jFrame frame label
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14295
     lbl|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14296
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14297
    jLabelPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14298
    jLabel := jLabelPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14299
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14300
    lbl := jLabel instVarNamed:'text'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14301
    lbl notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14302
	lbl := Java as_ST_String:lbl
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14303
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14304
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14305
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14306
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14307
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14308
    label := Label in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14309
    label sizeFixed:true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14310
    lbl notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14311
	label label:lbl
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14312
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14313
    self createdWindowsView:label for:jLabelPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14314
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14315
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14316
	'WLabelPeer_create: ' print. frame print. ' -> ' print. label printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14317
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14318
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14319
    "Created: / 7.1.1998 / 21:42:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14320
    "Modified: / 13.1.1998 / 22:10:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14321
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14322
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14323
_WLabelPeer_setAlignment:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14324
    |label alignNr|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14325
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14326
    alignNr := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14327
    label := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14328
    label notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14329
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14330
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14331
    "Created: / 7.1.1998 / 21:43:12 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14332
    "Modified: / 8.1.1998 / 17:35:29 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14333
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14334
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14335
_WLabelPeer_setText:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14336
    |label jString str|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14337
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14338
    jString := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14339
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14340
    label := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14341
    jString notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14342
	str := Java as_ST_String:jString
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14343
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14344
    label label:str
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14345
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14346
    "Created: / 7.1.1998 / 21:43:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14347
    "Modified: / 3.12.1998 / 14:59:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14348
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14349
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14350
_WListPeer__addItem:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14351
    |jString index1 length selListView m|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14352
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14353
    selListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14354
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14355
    jString := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14356
    index1 := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14357
    length := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14358
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14359
    (m := selListView model) notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14360
	m list addLast:(Java as_ST_String:jString).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14361
	m changed:#list.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14362
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14363
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14364
    "Created: / 26.10.1998 / 20:11:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14365
    "Modified: / 14.11.1998 / 01:21:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14366
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14367
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14368
_WListPeer_addItem:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14369
    |jString index selListView m|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14370
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14371
    selListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14372
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14373
    jString := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14374
    index := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14375
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14376
    m := selListView model.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14377
    m isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14378
	Transcript showCR:'JAVA: access to listModel of closed view'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14379
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14380
	m list addLast:(Java as_ST_String:jString).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14381
	m changed:#list.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14382
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14383
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14384
    "Created: / 24.1.1998 / 21:10:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14385
    "Modified: / 2.11.1998 / 17:12:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14386
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14387
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14388
_WListPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14389
    |jListPeer jFrame frame selectionInListView|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14390
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14391
    jListPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14392
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14393
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14394
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14395
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14396
    selectionInListView := ScrollableView for:SelectionInListView in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14397
    selectionInListView action:[:index | jListPeer perform:#'handleListChanged(I)V' with:(index - 1)].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14398
    selectionInListView doubleClickAction:[:index | jListPeer perform:#'handleAction(I)V' with:(index - 1)].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14399
    selectionInListView model:(SelectionInList new list:(List new)).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14400
    selectionInListView useIndex:true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14401
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14402
    self createdWindowsView:selectionInListView for:jListPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14403
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14404
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14405
	'WTextAreaPeer_create: ' print. frame print. ' -> ' print. selectionInListView printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14406
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14407
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14408
    "Created: / 24.1.1998 / 19:58:54 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14409
    "Modified: / 9.4.1998 / 22:19:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14410
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14411
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14412
_WListPeer_delItems:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14413
    |jString index1 index2 selListView model list|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14414
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14415
    selListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14416
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14417
    index1 := (nativeContext argAt:1) + 1. "/ java indices are 0-based.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14418
    index2 := (nativeContext argAt:2) + 1. "/ st indices are 1-based.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14419
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14420
    model := selListView model.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14421
    model isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14422
    list := model list.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14423
    list size >= index1 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14424
	list removeFromIndex:index1 toIndex:(index2 min:list size).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14425
	model changed:#list.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14426
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14427
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14428
    "Created: / 9.4.1998 / 22:19:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14429
    "Modified: / 30.12.1998 / 20:00:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14430
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14431
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14432
_WListPeer_deselect:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14433
    "/ void deselect (int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14434
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14435
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14436
    "Created: / 12.11.1998 / 19:15:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14437
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14438
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14439
_WListPeer_getMaxWidth:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14440
    "/ int getMaxWidth ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14441
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14442
    ^ 1000 "/ a dummy value
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14443
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14444
"/    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14445
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14446
    "Created: / 14.11.1998 / 10:44:29 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14447
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14448
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14449
_WListPeer_isSelected:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14450
    |selectionInListView index model|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14451
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14452
    selectionInListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14453
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14454
    index := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14455
    (model := selectionInListView model) notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14456
	(model selectionIndex == (index + 1))  "/ JAVA indexing starts at 0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14457
	ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14458
	    ^ 1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14459
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14460
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14461
    ^ 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14462
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14463
    "Created: / 24.1.1998 / 22:42:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14464
    "Modified: / 25.1.1998 / 01:35:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14465
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14466
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14467
_WListPeer_makeVisible:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14468
    |selectionInListView lineNr|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14469
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14470
    selectionInListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14471
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14472
    lineNr := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14473
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14474
    selectionInListView makeLineVisible:(lineNr + 1)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14475
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14476
    "Modified: / 24.1.1998 / 20:01:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14477
    "Created: / 20.10.1998 / 14:14:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14478
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14479
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14480
_WListPeer_select:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14481
    |selectionInListView index model|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14482
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14483
    selectionInListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14484
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14485
    index := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14486
    (model := selectionInListView model) notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14487
	model selectionIndex:(index + 1).  "/ JAVA indexing starts at 0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14488
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14489
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14490
    "Created: / 24.1.1998 / 22:32:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14491
    "Modified: / 25.1.1998 / 01:28:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14492
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14493
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14494
_WListPeer_setMultipleSelections:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14495
    |selectionInListView onOff|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14496
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14497
    selectionInListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14498
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14499
    onOff := (nativeContext argAt:1) ~~ 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14500
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14501
    selectionInListView multipleSelectOk:onOff.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14502
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14503
    "Modified: / 24.1.1998 / 20:01:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14504
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14505
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14506
_WListPeer_updateMaxItemWidth:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14507
    |selectionInListView lineNr|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14508
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14509
    selectionInListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14510
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14511
    "Created: / 26.10.1998 / 20:09:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14512
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14513
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14514
_WMenuBarPeer_addMenu:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14515
    "/ void addMenu (java.awt.Menu)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14516
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14517
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14518
    "Created: / 12.11.1998 / 19:14:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14519
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14520
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14521
_WMenuBarPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14522
    |jMenuBarPeer jMenuBar jFrame frame menuBar|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14523
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14524
    jMenuBarPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14525
    jMenuBar := jMenuBarPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14526
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14527
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14528
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14529
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14530
    menuBar := MenuPanel in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14531
    menuBar verticalLayout:false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14532
    menuBar realize.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14533
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14534
    self createdWindowsView:menuBar for:jMenuBarPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14535
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14536
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14537
	'WMenuBarPeer_create: ' print. frame print. ' -> ' print. menuBar printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14538
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14539
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14540
    "Created: / 7.1.1998 / 21:38:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14541
    "Modified: / 25.1.1998 / 13:19:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14542
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14543
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14544
_WMenuBarPeer_delMenu:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14545
    "/ void delMenu (int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14546
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14547
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14548
    "Created: / 12.11.1998 / 19:14:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14549
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14550
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14551
_WMenuItemPeer__dispose:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14552
    |jMenuItemPeer item|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14553
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14554
    jMenuItemPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14555
    item := jMenuItemPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14556
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14557
"/ what should be done here ?
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14558
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14559
    "Created: / 29.3.1998 / 17:16:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14560
    "Modified: / 29.3.1998 / 17:16:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14561
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14562
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14563
_WMenuItemPeer__setLabel:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14564
    "/ void _setLabel (java.lang.String)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14565
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14566
    |jMenuItemPeer item label|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14567
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14568
    jMenuItemPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14569
    item := jMenuItemPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14570
    (item isNil or:[item == 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14571
	'JAVA [warning]: NULL menu item in setLabel' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14572
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14573
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14574
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14575
    label := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14576
    label isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14577
	label := ''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14578
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14579
	label := Java as_ST_String:label
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14580
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14581
    item label:label.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14582
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14583
    "Modified: / 11.12.1998 / 16:40:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14584
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14585
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14586
_WMenuItemPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14587
    |jMenuItemPeer jMenuItem jMenuPeer menu item lbl|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14588
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14589
    jMenuItemPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14590
    jMenuItem := jMenuItemPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14591
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14592
    jMenuPeer := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14593
    menu := jMenuPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14594
    (menu isNil or:[menu == 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14595
	'JAVA: no menu to create item in' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14596
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14597
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14598
    item := menu createAtIndex:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14599
    item value:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14600
		jMenuItemPeer perform:#'handleAction(I)V' with:0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14601
	       ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14602
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14603
    lbl := jMenuItem instVarNamed:'label'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14604
    lbl notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14605
	lbl := Java as_ST_String:lbl.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14606
	item label:lbl
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14607
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14608
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14609
    jMenuItemPeer instVarNamed:'pData' put:item.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14610
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14611
    WindowOPTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14612
	'WMenuItem_create: ' print. menu print. ' -> ' print. item printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14613
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14614
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14615
    "Created: / 7.1.1998 / 21:40:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14616
    "Modified: / 3.12.1998 / 20:43:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14617
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14618
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14619
_WMenuItemPeer_enable:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14620
    |jMenuItemPeer item state|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14621
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14622
    jMenuItemPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14623
    item := jMenuItemPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14624
    (item isNil or:[item == 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14625
	'JAVA [warning]: NULL menu item in enable' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14626
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14627
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14628
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14629
    state := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14630
    item enabled:(state ~~ 0)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14631
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14632
    "Created: / 7.1.1998 / 22:41:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14633
    "Modified: / 11.12.1998 / 16:40:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14634
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14635
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14636
_WMenuPeer_addSeparator:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14637
    "/ void addSeparator ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14638
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14639
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14640
    "Created: / 12.11.1998 / 19:13:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14641
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14642
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14643
_WMenuPeer_createMenu:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14644
    |jMenuPeer jMenu jMenuBarPeer menuPanel menu
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14645
     lbl item|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14646
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14647
    jMenuPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14648
    jMenu := jMenuPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14649
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14650
    jMenuBarPeer := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14651
    menuPanel := jMenuBarPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14652
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14653
    item := menuPanel createAtIndex:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14654
    lbl := jMenu instVarNamed:'label'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14655
    lbl notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14656
	lbl := Java as_ST_String:lbl.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14657
	item label:lbl
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14658
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14659
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14660
    menu := MenuPanel new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14661
    item submenu:menu.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14662
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14663
    jMenuPeer instVarNamed:'pData' put:menu.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14664
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14665
'createMenuPeer: ' print. menuPanel print. ' -> ' print. menu printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14666
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14667
    "Created: / 7.1.1998 / 21:39:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14668
    "Modified: / 13.1.1998 / 22:11:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14669
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14670
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14671
_WMenuPeer_createSubMenu:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14672
    "/ void createSubMenu (sun.awt.windows.WMenuPeer)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14673
"/    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14674
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14675
    "Created: / 12.11.1998 / 19:13:43 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14676
    "Modified: / 3.12.1998 / 21:41:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14677
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14678
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14679
_WMenuPeer_delItem:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14680
    "/ void delItem (int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14681
    |jMenuPeer jMenu menuPanel itemIndex|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14682
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14683
    jMenuPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14684
    menuPanel := jMenuPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14685
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14686
    itemIndex := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14687
    menuPanel remove:itemIndex.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14688
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14689
"/    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14690
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14691
    "Created: / 12.11.1998 / 19:13:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14692
    "Modified: / 10.12.1998 / 21:12:29 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14693
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14694
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14695
_WPanelPeer_calculateInsets:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14696
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14697
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14698
    "Created: / 27.1.1998 / 21:40:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14699
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14700
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14701
_WPopupMenuPeer__show:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14702
    "/ void _show (java.awt.Event)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14703
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14704
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14705
    "Created: / 12.11.1998 / 19:12:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14706
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14707
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14708
_WPopupMenuPeer_createMenu:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14709
    "/ void createMenu (sun.awt.windows.WComponentPeer)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14710
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14711
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14712
    "Created: / 12.11.1998 / 19:12:43 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14713
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14714
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14715
_WPrintJob_end:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14716
    "/ void end ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14717
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14718
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14719
    "Created: / 12.11.1998 / 19:11:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14720
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14721
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14722
_WScrollPanePeer__getHScrollbarHeight:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14723
    |scrollPane|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14724
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14725
    scrollPane := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14726
    ^ HorizontalScrollBar new preferredExtent y.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14727
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14728
    "Created: / 9.4.1998 / 17:30:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14729
    "Modified: / 10.4.1998 / 14:59:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14730
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14731
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14732
_WScrollPanePeer__getVScrollbarWidth:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14733
    |scrollPane|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14734
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14735
    scrollPane := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14736
    ^ ScrollBar new preferredExtent x.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14737
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14738
    "Created: / 9.4.1998 / 17:29:48 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14739
    "Modified: / 10.4.1998 / 15:00:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14740
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14741
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14742
_WScrollPanePeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14743
    |jScrollPanePeer jScrollPane jFrame frame scrollPane
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14744
     lbl|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14745
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14746
    jScrollPanePeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14747
    jScrollPane := jScrollPanePeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14748
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14749
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14750
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14751
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14752
    "/ create with a simple view ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14753
    scrollPane := ScrollableView for:JavaView in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14754
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14755
    self createdWindowsView:scrollPane for:jScrollPanePeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14756
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14757
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14758
	'WScrollPanePeer_create: ' print. frame print. ' -> ' print. scrollPane printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14759
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14760
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14761
    "Created: / 9.4.1998 / 17:25:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14762
    "Modified: / 9.4.1998 / 22:06:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14763
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14764
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14765
_WScrollPanePeer_getOffset:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14766
    "/ int getOffset (int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14767
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14768
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14769
    "Created: / 12.11.1998 / 19:16:29 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14770
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14771
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14772
_WScrollPanePeer_getScrollChild:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14773
    "/ java.awt.Component getScrollChild ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14774
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14775
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14776
    "Created: / 12.11.1998 / 19:17:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14777
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14778
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14779
_WScrollPanePeer_setInsets:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14780
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14781
    "Modified: / 9.4.1998 / 17:26:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14782
    "Created: / 9.4.1998 / 17:29:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14783
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14784
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14785
_WScrollPanePeer_setScrollPosition:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14786
    "/ void setScrollPosition (int int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14787
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14788
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14789
    "Created: / 12.11.1998 / 19:16:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14790
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14791
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14792
_WScrollPanePeer_setSpans:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14793
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14794
    "Created: / 9.4.1998 / 17:31:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14795
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14796
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14797
_WScrollbarPeer__setValues:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14798
    |scrollBar value visibleAmount min max|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14799
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14800
    scrollBar := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14801
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14802
    value := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14803
    visibleAmount := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14804
    min := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14805
    max := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14806
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14807
    (min ~~ 0 or:[max ~~ 100]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14808
	scrollBar thumb start:min stop:max.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14809
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14810
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14811
    scrollBar thumbOrigin:value thumbHeight:visibleAmount.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14812
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14813
    "Created: / 13.1.1998 / 22:13:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14814
    "Modified: / 14.10.1998 / 14:53:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14815
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14816
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14817
_WScrollbarPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14818
    |jScrollbarPeer jScrollbar jFrame frame scrollBar
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14819
     min max|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14820
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14821
    jScrollbarPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14822
    jScrollbar := jScrollbarPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14823
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14824
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14825
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14826
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14827
    (jScrollbar instVarNamed:'orientation') == 0 "HORIZONTAL" ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14828
	scrollBar := HorizontalScrollBar in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14829
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14830
	scrollBar := ScrollBar in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14831
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14832
    min := jScrollbar instVarNamed:'minimum'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14833
    max := jScrollbar instVarNamed:'maximum'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14834
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14835
    scrollBar scrollDownAction:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14836
			scrollBar thumbOrigin:(scrollBar thumbOrigin + ((max-min)/10) min:max).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14837
			jScrollbarPeer perform:#'dragAbsolute(I)V' with:scrollBar thumbOrigin rounded.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14838
		     ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14839
    scrollBar scrollUpAction:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14840
			scrollBar thumbOrigin:(scrollBar thumbOrigin - ((max-min)/10) max:min).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14841
			jScrollbarPeer perform:#'dragAbsolute(I)V' with:scrollBar thumbOrigin rounded.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14842
		     ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14843
    scrollBar scrollAction:[:org |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14844
			jScrollbarPeer perform:#'dragAbsolute(I)V' with:org rounded.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14845
		     ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14846
    self createdWindowsView:scrollBar for:jScrollbarPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14847
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14848
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14849
	'WScrollbarPeer_create: ' print. frame print. ' -> ' print. scrollBar printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14850
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14851
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14852
    "Created: / 5.1.1998 / 01:53:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14853
    "Modified: / 14.10.1998 / 15:36:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14854
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14855
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14856
_WScrollbarPeer_setLineIncrement:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14857
    |scrollBar inc|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14858
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14859
Transcript showCR:'JavaVM: WScrollbarPeer_setLineIncrement unimplemented'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14860
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14861
    scrollBar := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14862
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14863
    inc := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14864
"/    scrollBar thumb lineIncrement:inc.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14865
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14866
    "Created: / 25.1.1998 / 11:52:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14867
    "Modified: / 14.10.1998 / 14:53:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14868
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14869
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14870
_WScrollbarPeer_setPageIncrement:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14871
    |scrollBar inc|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14872
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14873
Transcript showCR:'JavaVM: WScrollbarPeer_setPageIncrement unimplemented'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14874
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14875
    scrollBar := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14876
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14877
    inc := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14878
"/    scrollBar thumb pageIncrement:inc.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14879
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14880
    "Created: / 25.1.1998 / 11:52:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14881
    "Modified: / 14.10.1998 / 14:54:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14882
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14883
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14884
_WTextAreaPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14885
    |jTextAreaPeer jFrame frame editTextView|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14886
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14887
    jTextAreaPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14888
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14889
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14890
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14891
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14892
    editTextView := HVScrollableView for:EditTextView in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14893
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14894
    self createdWindowsView:editTextView for:jTextAreaPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14895
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14896
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14897
	'WTextAreaPeer_create: ' print. frame print. ' -> ' print. editTextView printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14898
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14899
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14900
    "Created: / 7.1.1998 / 21:49:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14901
    "Modified: / 15.1.1998 / 12:56:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14902
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14903
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14904
_WTextAreaPeer_insertText:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14905
    |textView pos string jstring|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14906
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14907
    textView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14908
    (textView isKindOf:ScrollableView) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14909
	textView := textView scrolledView
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14910
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14911
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14912
    jstring := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14913
    string := Java as_ST_String:jstring.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14914
    pos := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14915
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14916
    textView insert:string at:pos.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14917
    textView cursorToCharacterPosition:pos + string size.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14918
    textView makeCursorVisible.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14919
"/ textView invalidateRepairNow:true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14920
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14921
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14922
    "Created: / 7.1.1998 / 21:50:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14923
    "Modified: / 5.4.1998 / 17:37:24 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14924
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14925
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14926
_WTextAreaPeer_replaceText:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14927
    "/ void replaceText (java.lang.String int int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14928
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14929
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14930
    "Created: / 12.11.1998 / 19:11:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14931
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14932
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14933
_WTextComponentPeer_enableEditing:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14934
    |textView enabled|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14935
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14936
    textView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14937
    enabled := (nativeContext argAt:1) ~~ 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14938
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14939
    ^ textView readOnly:enabled not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14940
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14941
    "Created: / 5.1.1998 / 01:29:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14942
    "Modified: / 25.1.1998 / 16:29:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14943
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14944
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14945
_WTextComponentPeer_getSelectionEnd:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14946
    |textView|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14947
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14948
    textView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14949
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14950
    ^ textView characterPositionOfSelectionEnd
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14951
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14952
    "Created: / 8.1.1998 / 17:41:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14953
    "Modified: / 15.1.1998 / 15:47:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14954
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14955
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14956
_WTextComponentPeer_getSelectionStart:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14957
    |textView|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14958
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14959
    textView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14960
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14961
    ^ textView characterPositionOfSelection - 1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14962
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14963
    "Created: / 15.8.1997 / 15:45:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14964
    "Modified: / 15.1.1998 / 15:46:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14965
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14966
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14967
_WTextComponentPeer_getText:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14968
    |textView string jString|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14969
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14970
    textView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14971
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14972
    string := textView contents asString.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14973
    jString := Java as_String:string.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14974
    ^ jString
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14975
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14976
    "Created: / 6.1.1998 / 21:05:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14977
    "Modified: / 8.1.1998 / 17:36:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14978
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14979
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14980
_WTextComponentPeer_select:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14981
    |textView selStart selEnd|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14982
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14983
    textView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14984
    selStart := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14985
    selEnd := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14986
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14987
    selStart == selEnd ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14988
	"/ clear selection
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14989
	textView unselect.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14990
	"/ and set caret
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14991
	textView cursorToCharacterPosition:selStart + 1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14992
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14993
	"/ change selection
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14994
	textView selectFromCharacterPosition:selStart+1 to:selEnd
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14995
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14996
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14997
    "Created: / 15.8.1997 / 15:45:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14998
    "Modified: / 15.1.1998 / 21:55:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14999
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15000
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15001
_WTextComponentPeer_setText:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15002
    |textView string jstring|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15003
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15004
    textView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15005
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15006
    jstring := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15007
    jstring notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15008
	string := Java as_ST_String:jstring
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15009
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15010
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15011
    textView contents:string.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15012
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15013
    "Created: / 5.1.1998 / 01:28:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15014
    "Modified: / 11.12.1998 / 12:16:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15015
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15016
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15017
_WTextFieldPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15018
    |jTextFieldPeer jFrame frame editField|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15019
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15020
    jTextFieldPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15021
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15022
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15023
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15024
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15025
    editField := EditField in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15026
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15027
    self createdWindowsView:editField for:jTextFieldPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15028
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15029
    editField crAction:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15030
			jTextFieldPeer perform:#handleAction.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15031
		  ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15032
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15033
	'WTextFieldPeer_create: ' print. frame print. ' -> ' print. editField printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15034
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15035
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15036
    "Created: / 5.1.1998 / 01:27:37 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15037
    "Modified: / 4.11.1998 / 21:07:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15038
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15039
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15040
_WTextFieldPeer_setEchoCharacter:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15041
    |editField char|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15042
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15043
    editField := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15044
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15045
    char := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15046
    editField passwordCharacter:(Character value:char).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15047
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15048
    "Created: / 25.1.1998 / 16:28:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15049
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15050
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15051
_WToolkit_beep:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15052
    "/ void beep ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15053
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15054
    Screen current beep
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15055
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15056
    "Created: / 12.11.1998 / 19:09:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15057
    "Modified: / 11.12.1998 / 12:15:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15058
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15059
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15060
_WToolkit_eventLoop:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15061
    (JavaEventThread notNil and:[JavaEventThread isDead not]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15062
	'JavaVM [warning]: oops - two threads executing eventLoop' errorPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15063
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15064
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15065
    JavaEventThread := Processor activeProcess.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15066
    [
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15067
	[true] whileTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15068
	    AbortSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15069
		ex return
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15070
	    ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15071
		self doWindowsEventThread.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15072
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15073
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15074
    ] valueNowOrOnUnwindDo:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15075
	JavaEventThread := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15076
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15077
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15078
    "Created: / 6.1.1998 / 21:01:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15079
    "Modified: / 8.1.1999 / 17:08:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15080
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15081
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15082
_WToolkit_getComboHeightOffset:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15083
    ^ 0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15084
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15085
    "Modified: / 20.3.1997 / 13:50:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15086
    "Created: / 22.10.1998 / 00:59:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15087
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15088
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15089
_WToolkit_getScreenHeight:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15090
    ^ Screen current height
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15091
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15092
    "Modified: / 20.3.1997 / 13:50:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15093
    "Created: / 13.1.1998 / 09:24:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15094
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15095
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15096
_WToolkit_getScreenResolution:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15097
    ^ Screen current resolution x rounded
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15098
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15099
    "Modified: / 20.3.1997 / 13:50:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15100
    "Created: / 17.1.1998 / 21:54:48 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15101
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15102
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15103
_WToolkit_getScreenWidth:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15104
    ^ Screen current width
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15105
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15106
    "Modified: / 20.3.1997 / 13:50:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15107
    "Created: / 13.1.1998 / 09:24:37 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15108
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15109
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15110
_WToolkit_init:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15111
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15112
    "Created: / 3.1.1998 / 02:30:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15113
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15114
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15115
_WToolkit_loadSystemColors:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15116
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15117
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15118
    "Modified: / 18.3.1997 / 18:43:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15119
    "Created: / 5.1.1998 / 02:19:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15120
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15121
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15122
_WToolkit_makeColorModel:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15123
    "/ java.awt.image.ColorModel makeColorModel ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15124
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15125
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15126
    "Created: / 12.11.1998 / 19:08:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15127
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15128
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15129
_WToolkit_sync:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15130
    "/ void sync ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15131
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15132
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15133
    "Created: / 12.11.1998 / 19:09:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15134
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15135
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15136
_WWindowPeer__setResizable:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15137
    |view onOff|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15138
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15139
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15140
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15141
    onOff := (nativeContext argAt:1) == 1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15142
    view isTopView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15143
	onOff ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15144
	    view minExtent:10@10.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15145
	    view maxExtent:(Screen current extent).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15146
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15147
	    view minExtent:view extent.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15148
	    view maxExtent:view extent.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15149
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15150
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15151
	(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15152
	    self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15153
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15154
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15155
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15156
"/ 'JAVA: WWindowPeer_setResizable: ' print. view print. ' yes/no: ' print. onOff printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15157
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15158
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15159
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15160
    "Created: / 5.1.1998 / 00:57:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15161
    "Modified: / 16.1.1998 / 18:08:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15162
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15163
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15164
_WWindowPeer__setTitle:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15165
    |view jString string|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15166
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15167
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15168
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15169
    jString := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15170
    string := Java as_ST_String:jString.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15171
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15172
"/ 'JAVA: WWindowPeer_pSetTitle: ' print. string print. ' ' print. view printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15173
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15174
    view label:string.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15175
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15176
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15177
    "Created: / 5.1.1998 / 00:57:17 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15178
    "Modified: / 8.1.1998 / 17:37:41 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15179
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15180
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15181
_WWindowPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15182
    "/ void create (sun.awt.windows.WComponentPeer)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15183
    |jWindowPeer jWindow top window pDataIdx|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15184
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15185
    jWindowPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15186
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15187
    jWindow := jWindowPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15188
    window := jWindowPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15189
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15190
    (window notNil and:[window ~~ 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15191
	WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15192
	    'JAVA: window view already created: ' infoPrint.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15193
	    jWindowPeer class name infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15194
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15195
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15196
"/ OLD
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15197
"/        window := StandardSystemView new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15198
"/        self createdWindowsView:window for:jWindowPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15199
"/        JavaWindowGroup addTopView:window.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15200
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15201
	window := JavaPopUpView new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15202
	window borderWidth:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15203
	window level:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15204
	window delegate:self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15205
	window javaPeer:jWindowPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15206
	self createdWindowsView:window for:jWindowPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15207
	JavaWindowGroup addTopView:window.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15208
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15209
"/        top := StandardSystemView new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15210
"/        window := JavaView origin:0.0@0.0 corner:1.0@1.0 in:top.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15211
"/        window delegate:self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15212
"/        window javaPeer:jWindowPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15213
"/        self createdWindowsView:window for:jWindowPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15214
"/        JavaWindowGroup addTopView:top.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15215
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15216
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15217
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15218
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15219
	'JAVA: WWindowPeer_create: ' print. jWindowPeer displayString print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15220
	' window: ' print. window printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15221
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15222
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15223
    "Created: / 4.1.1998 / 17:56:39 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15224
    "Modified: / 4.12.1998 / 17:37:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15225
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15226
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15227
_WWindowPeer_getContainerElement:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15228
    "/ java.awt.Component getContainerElement (java.awt.Container int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15229
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15230
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15231
    "Created: / 12.11.1998 / 19:10:54 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15232
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15233
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15234
_WWindowPeer_toBack:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15235
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15236
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15237
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15238
    view lower.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15239
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15240
    "Created: / 7.5.1998 / 00:23:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15241
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15242
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15243
_WWindowPeer_toFront:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15244
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15245
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15246
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15247
    view raise.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15248
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15249
    "Created: / 9.4.1998 / 22:17:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15250
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15251
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15252
_WWindowPeer_updateInsets:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15253
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15254
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15255
    "Modified: / 18.3.1997 / 18:43:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15256
    "Created: / 4.1.1998 / 18:09:04 / cg"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15257
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15258
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15259
_Win32Process_create:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15260
    "really create a win32 process"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15261
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15262
    |env cmd jProcess p inPipe outPipe errorPipe|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15263
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15264
    jProcess := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15265
    cmd := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15266
    cmd := Java as_ST_String:cmd.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15267
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15268
    env := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15269
    env notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15270
	self halt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15271
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15272
self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15273
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15274
    p := Win32Process new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15275
    p command:cmd.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15276
    p environment:env.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15277
    p inStream:inPipe.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15278
    p outStream:outPipe.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15279
    p errorStream:errorPipe.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15280
    p directory:nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15281
    p startProcess.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15282
self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15283
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15284
    jProcess instVarNamed:'handle' put:p.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15285
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15286
    "Created: / 10.11.1998 / 19:50:31 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15287
    "Modified: / 10.11.1998 / 21:34:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15288
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15289
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15290
_X11FontMetrics_getMFCharSegmentWidth:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15291
    "get multi-font string-segment width.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15292
     Not yet supported - use standard strings width"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15293
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15294
    |jMetrics jFont jFontDescr stFont w
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15295
     bool1 cp offs lenght bp int1|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15296
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15297
    jMetrics := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15298
    jFont := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15299
    jFontDescr := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15300
    cp := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15301
    lenght := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15302
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15303
    stFont := jFont instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15304
    (stFont isNil or:[stFont == 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15305
        self halt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15306
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15307
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15308
    stFont device isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15309
        stFont := stFont on:Display.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15310
        jFont instVarNamed:'pData' put:stFont.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15311
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15312
    w := stFont widthOf:cp from:1 to:lenght.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15313
    ^ w.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15314
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15315
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15316
_X11FontMetrics_init:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15317
    ^ self _WFontMetrics_init:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15318
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15319
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15320
_X11GraphicsDevice_getConfigType:nativeContext
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15321
    "/ new with jdk1.2 ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15322
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15323
    |configNr cls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15324
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15325
    "/ for now, only one config.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15326
    configNr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15327
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15328
    cls := Java classNamed:'java.awt.GraphicsDevice'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15329
    ^ cls instVarNamed:'TYPE_RASTER_SCREEN'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15330
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15331
    "Created: / 28.1.1998 / 22:19:05 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15332
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15333
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15334
_X11GraphicsDevice_getNumConfigs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15335
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15336
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15337
    ^ 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15338
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15339
    "Created: / 28.1.1998 / 22:13:26 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15340
    "Modified: / 28.1.1998 / 22:14:33 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15341
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15342
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15343
_X11GraphicsEnvironment_getNumScreens:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15344
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15345
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15346
    "/ could return the actual number of screens ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15347
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15348
    ^ 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15349
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15350
    "Created: / 28.1.1998 / 01:50:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15351
    "Modified: / 28.1.1998 / 22:12:32 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15352
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15353
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15354
_X11GraphicsEnvironment_initDisplay:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15355
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15356
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15357
    "Created: / 28.1.1998 / 01:50:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15358
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15359
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15360
_X11Graphics_changeClip:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15361
    ^ self _WGraphics_changeClip:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15362
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15363
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15364
_X11Graphics_createFromComponent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15365
    ^ self _WGraphics_createFromComponent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15366
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15367
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15368
_X11Graphics_disposeImpl:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15369
    ^ self _WGraphics_dispose:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15370
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15371
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15372
_X11Graphics_drawMFCharsSegment:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15373
    ^ self _WGraphics_drawMFCharsSegment:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15374
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15375
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15376
_X11Graphics_drawRect:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15377
    ^ self _WGraphics_drawRect:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15378
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15379
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15380
_X11Graphics_fillOval:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15381
    ^ self _WGraphics_fillOval:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15382
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15383
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15384
_X11Graphics_fillRect:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15385
    ^ self _WGraphics_fillRect:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15386
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15387
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15388
_X11Graphics_pSetFont:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15389
    ^ self _WGraphics_pSetFont:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15390
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15391
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15392
_X11Graphics_pSetForeground:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15393
    ^ self _WGraphics_pSetForeground:nativeContext
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15394
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15395
1090
0b9c332d367c Few workarounds for monitors
vranyj1
parents: 1084
diff changeset
 15396
!JavaVM class methodsFor:'native - stx.libjava.tests'!
0b9c332d367c Few workarounds for monitors
vranyj1
parents: 1084
diff changeset
 15397
0b9c332d367c Few workarounds for monitors
vranyj1
parents: 1084
diff changeset
 15398
_stx_libjava_tests_MonitorTests_abort: nativeContext
0b9c332d367c Few workarounds for monitors
vranyj1
parents: 1084
diff changeset
 15399
0b9c332d367c Few workarounds for monitors
vranyj1
parents: 1084
diff changeset
 15400
    <javanative: 'stx/libjava/tests/MonitorTests' name: 'abort()V'>
0b9c332d367c Few workarounds for monitors
vranyj1
parents: 1084
diff changeset
 15401
0b9c332d367c Few workarounds for monitors
vranyj1
parents: 1084
diff changeset
 15402
    AbortOperationRequest raiseRequest.
0b9c332d367c Few workarounds for monitors
vranyj1
parents: 1084
diff changeset
 15403
0b9c332d367c Few workarounds for monitors
vranyj1
parents: 1084
diff changeset
 15404
    "Modified: / 04-11-2011 / 21:50:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0b9c332d367c Few workarounds for monitors
vranyj1
parents: 1084
diff changeset
 15405
! !
0b9c332d367c Few workarounds for monitors
vranyj1
parents: 1084
diff changeset
 15406
919
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15407
!JavaVM class methodsFor:'native - sun.io'!
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15408
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15409
_sun_io_Win32ErrorMode_setErrorMode: nativeContext
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15410
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15411
    <javanative: 'sun/io/Win32ErrorMode' name: 'setErrorMode(J)J'>
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15412
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15413
    "FIXME: Ignored for now"
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15414
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15415
    ^0
911
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
 15416
! !
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
 15417
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15418
!JavaVM class methodsFor:'native - sun.java2d'!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15419
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15420
_sun_java2d_Disposer_initIDs: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15421
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15422
    <javanative: 'sun/java2d/Disposer' name: 'initIDs()V'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15423
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15424
    ^ UnimplementedNativeMethodSignal raise
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15425
! !
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15426
1253
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15427
!JavaVM class methodsFor:'native - sun.java2d.cmm.lcms'!
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15428
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15429
_sun_java2d_cmm_lcms_LCMS_getTagData: nativeContext
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15430
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15431
    <javanative: 'sun/java2d/cmm/lcms/LCMS' name: 'getTagData(JI[B)V'>
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15432
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15433
    | profileId tag data |
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15434
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15435
    profileId := nativeContext argAt: 1.
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15436
    tag := nativeContext argAt: 3.
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15437
    data := nativeContext argAt: 4.
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15438
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15439
    self assert: (nativeContext argAt: 1) = 12344321.
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15440
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15441
    tag == 1751474532 ifTrue:[
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15442
        data replaceBytesFrom:1 
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15443
                with:#[0  3  146  96  108  99  109  115  4  0  0  0  115  112  97  99  51  67  76  82  88  89  90  32  7  216  0  4  0  10  0  10  0  24  0  22  97  99  115  112  65  80  80  76  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  1  0  0  246  214  0  1  0  0  0  0  211  45  108  99  109  115  240  231  92  85  210  30  77  140  137  67  22  250  239  246  146  191  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0]
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15444
                startingAt: 1.
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15445
        ^self.
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15446
    ].
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15447
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15448
    self breakPoint: #jv.
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15449
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15450
    "Modified: / 09-12-2011 / 19:26:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15451
!
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15452
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15453
_sun_java2d_cmm_lcms_LCMS_getTagSize: nativeContext
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15454
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15455
    <javanative: 'sun/java2d/cmm/lcms/LCMS' name: 'getTagSize(JI)I'>
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15456
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15457
    | profileId tag |
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15458
    profileId := nativeContext argAt: 1.
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15459
    tag := nativeContext argAt: 3.
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15460
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15461
    self assert: (nativeContext argAt: 1) = 12344321.
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15462
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15463
    "Magic numbers based on trace of real Java code"
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15464
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15465
    tag == 1751474532 ifTrue:[ ^ 128 ].
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15466
    
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15467
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15468
    self breakPoint: #jv.
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15469
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15470
    ^128 "Some magic default"
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15471
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15472
    "Modified: / 09-12-2011 / 19:10:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15473
!
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15474
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15475
_sun_java2d_cmm_lcms_LCMS_initLCMS: nativeContext
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15476
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15477
    <javanative: 'sun/java2d/cmm/lcms/LCMS' name: 'initLCMS(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;)V'>
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15478
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15479
    "Nothing to do"
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15480
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15481
    "Modified: / 09-12-2011 / 18:25:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15482
!
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15483
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15484
_sun_java2d_cmm_lcms_LCMS_loadProfile: nativeContext
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15485
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15486
    <javanative: 'sun/java2d/cmm/lcms/LCMS' name: 'loadProfile([B)J'>
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15487
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15488
    "FAKE, return some magic"
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15489
    ^12344321
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15490
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15491
    "Modified: / 09-12-2011 / 18:56:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15492
! !
0ce45e884e08 Few more fixes in native methods
vranyj1
parents: 1251
diff changeset
 15493
850
160c389771a6 Fixes in resolving methodrefs for array methods
vranyj1
parents: 846
diff changeset
 15494
!JavaVM class methodsFor:'native - sun.management'!
160c389771a6 Fixes in resolving methodrefs for array methods
vranyj1
parents: 846
diff changeset
 15495
1213
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15496
_sun_management_MemoryImpl_getMemoryManagers0: nativeContext
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15497
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15498
    <javanative: 'sun/management/MemoryImpl' name: 'getMemoryManagers0()[Ljava/lang/management/MemoryManagerMXBean;'>
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15499
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15500
    "HACK, we'll see"
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15501
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15502
    | beanCls |
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15503
    beanCls := self classForName: 'java.lang.management.MemoryManagerMXBean'.
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15504
    ^beanCls javaArrayClass new:0.
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15505
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15506
    "Modified: / 04-12-2011 / 19:57:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15507
!
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15508
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15509
_sun_management_MemoryImpl_getMemoryPools0: nativeContext
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15510
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15511
    <javanative: 'sun/management/MemoryImpl' name: 'getMemoryPools0()[Ljava/lang/management/MemoryPoolMXBean;'>
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15512
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15513
    "HACK, we'll see"
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15514
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15515
    | beanCls |
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15516
    beanCls := self classForName: 'java.lang.management.MemoryPoolMXBean'.
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15517
    ^beanCls javaArrayClass new:0.
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15518
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15519
    "Modified: / 04-12-2011 / 19:58:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15520
!
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 15521
1081
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15522
_sun_management_VMManagementImpl_getStartupTime: nativeContext 
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15523
    <javanative: 'sun/management/VMManagementImpl' name: 'getStartupTime()J'>
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15524
    ^ StartupTime.
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15525
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15526
    "Modified: / 03-11-2011 / 19:17:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15527
!
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15528
1080
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
 15529
_sun_management_VMManagementImpl_getVersion0: nativeContext 
850
160c389771a6 Fixes in resolving methodrefs for array methods
vranyj1
parents: 846
diff changeset
 15530
    <javanative: 'sun/management/VMManagementImpl' name: 'getVersion0'>
1080
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
 15531
    ^ Java as_String: '1.2'.
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
 15532
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
 15533
    "Modified: / 03-11-2011 / 18:42:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
 15534
!
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
 15535
1081
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15536
_sun_management_VMManagementImpl_initOptionalSupportFields: nativeContext 
1080
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
 15537
    <javanative: 'sun/management/VMManagementImpl' name: 'initOptionalSupportFields()V'>
1081
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15538
    | cls |
1080
f842a3bac28a playing with tomcat natives
hlopkmar
parents: 1079
diff changeset
 15539
    cls := nativeContext receiver.
1081
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15540
    self breakPoint:#mh.
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15541
    cls instVarNamed: #compTimeMonitoringSupport put: 0.
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15542
    cls instVarNamed: #threadContentionMonitoringSupport put: 0.
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15543
    cls instVarNamed: #currentThreadCpuTimeSupport put: 0.
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15544
    cls instVarNamed: #otherThreadCpuTimeSupport put: 0.
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15545
    cls instVarNamed: #bootClassPathSupport put: 0.
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15546
    cls instVarNamed: #synchronizerUsageSupport put: 0.
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15547
    cls instVarNamed: #objectMonitorUsageSupport put: 0.
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15548
    ^ self.
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15549
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15550
    "Modified: / 03-11-2011 / 19:29:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15551
!
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15552
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15553
_sun_management_VMManagementImpl_isThreadCpuTimeEnabled: nativeContext
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15554
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15555
    <javanative: 'sun/management/VMManagementImpl' name: 'isThreadCpuTimeEnabled()Z'>
0c91ffb1ef21 few more natives.. pls review I have bad feelings about that
hlopkmar
parents: 1080
diff changeset
 15556
1083
vranyj1
parents: 1081
diff changeset
 15557
    ^ 0 "/false should be safe, we'll see...
vranyj1
parents: 1081
diff changeset
 15558
vranyj1
parents: 1081
diff changeset
 15559
    "Modified: / 03-11-2011 / 22:45:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
850
160c389771a6 Fixes in resolving methodrefs for array methods
vranyj1
parents: 846
diff changeset
 15560
! !
160c389771a6 Fixes in resolving methodrefs for array methods
vranyj1
parents: 846
diff changeset
 15561
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15562
!JavaVM class methodsFor:'native - sun.misc'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15563
1204
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15564
_sun_misc_GC_maxObjectInspectionAge: nativeContext
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15565
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15566
    <javanative: 'sun/misc/GC' name: 'maxObjectInspectionAge()J'>
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15567
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15568
    "
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15569
    /**
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15570
     * Returns the maximum <em>object-inspection age</em>, which is the number
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15571
     * of real-time milliseconds that have elapsed since the
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15572
     * least-recently-inspected heap object was last inspected by the garbage
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15573
     * collector.
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15574
     *
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15575
     * <p> For simple stop-the-world collectors this value is just the time
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15576
     * since the most recent collection.  For generational collectors it is the
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15577
     * time since the oldest generation was most recently collected.  Other
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15578
     * collectors are free to return a pessimistic estimate of the elapsed
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15579
     * time, or simply the time since the last full collection was performed.
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15580
     *
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15581
     * <p> Note that in the presence of reference objects, a given object that
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15582
     * is no longer strongly reachable may have to be inspected multiple times
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15583
     * before it can be reclaimed.
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15584
     */
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15585
    public static native long maxObjectInspectionAge();
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15586
    "
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15587
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15588
    ^Random nextIntegerBetween: 0 and: 3600. "Just return some number"
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15589
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15590
    "Modified: / 02-12-2011 / 21:56:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15591
!
6c2b887399e8 Few small fixes
vranyj1
parents: 1202
diff changeset
 15592
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15593
_sun_misc_Signal_findSignal: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15594
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15595
    <javanative: 'sun/misc/Signal' name: 'findSignal'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15596
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15597
        | input signame |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15598
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15599
    input := Java as_ST_String: (aJavaContext argAt: 1).
919
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15600
    OperatingSystem isUNIXlike ifTrue:[
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15601
        signame := 'SIG', (input asUppercase).
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15602
        ^UnixOperatingSystem signalNamed: signame asSymbol.
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15603
    ].
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15604
    OperatingSystem isMSWINDOWSlike ifTrue:[
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15605
        signame := 'sig', (input asUppercase).
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15606
        ^Win32OperatingSystem perform: signame asSymbol.
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15607
    ].
11237e0d58e5 Fixes to boot on Windows using SunJDK6 rt.jar
vranyj1
parents: 918
diff changeset
 15608
    self error: 'Unsupported OS'
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15609
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15610
    "Created: / 11-12-2010 / 15:22:07 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15611
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15612
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15613
_sun_misc_Signal_handle0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15614
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15615
    <javanative: 'sun/misc/Signal' name: 'handle0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15616
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15617
        self breakPoint: #libjava.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15618
    ^ 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15619
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15620
    "Created: / 11-12-2010 / 16:33:38 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15621
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15622
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15623
_sun_misc_Unsafe_allocateInstance: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15624
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15625
    <javanative: 'sun/misc/Unsafe' name: 'allocateInstance'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15626
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15627
        "
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15628
    /** Allocate an instance but do not run any constructor.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15629
        Initializes the class if it has not yet been. */
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15630
    public native Object allocateInstance(Class cls)
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15631
        throws InstantiationException;
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15632
    "
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15633
    | cls |
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15634
    cls := self reflection classForJavaClassObject: (nativeContext argAt:1).
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15635
    cls classInit.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15636
    ^cls newCleared
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15637
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15638
    "Created: / 05-02-2011 / 23:10:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15639
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15640
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15641
_sun_misc_Unsafe_allocateMemory: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15642
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15643
    <javanative: 'sun/misc/Unsafe' name: 'allocateMemory'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15644
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15645
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15646
    | size |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15647
    size := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15648
    ^SimulatedNativeMemory malloc: size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15649
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15650
    "Created: / 07-12-2010 / 21:04:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15651
    "Modified: / 07-12-2010 / 23:46:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15652
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15653
900
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15654
_sun_misc_Unsafe_arrayBaseOffset: nativeContext
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15655
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15656
    <javanative: 'sun/misc/Unsafe' name: 'arrayBaseOffset'>
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15657
    "
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15658
    /**
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15659
    * Report the offset of the first element in the storage allocation of a
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15660
    * given array class.  If {@link #arrayIndexScale} returns a non-zero value
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15661
    * for the same class, you may use that scale factor, together with this
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15662
    * base offset, to form new offsets to access elements of arrays of the
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15663
    * given class.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15664
    *
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15665
    * @see #getInt(Object, long)
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15666
    * @see #putInt(Object, long, int)
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15667
    */
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15668
    public native int arrayBaseOffset(Class arrayClass);
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15669
    "
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15670
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15671
    ^ 1
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15672
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15673
    "Modified (comment): / 10-08-2011 / 01:22:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15674
!
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15675
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15676
_sun_misc_Unsafe_arrayIndexScale: nativeContext
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15677
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15678
    <javanative: 'sun/misc/Unsafe' name: 'arrayIndexScale'>
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15679
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15680
    "
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15681
      /**
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15682
      * Report the scale factor for addressing elements in the storage
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15683
      * allocation of a given array class.  However, arrays of 'narrow' types
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15684
      * will generally not work properly with accessors like {@link
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15685
      * #getByte(Object, int)}, so the scale factor for such classes is reported
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15686
      * as zero.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15687
      *
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15688
      * @see #arrayBaseOffset
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15689
      * @see #getInt(Object, long)
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15690
      * @see #putInt(Object, long, int)
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15691
      */
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15692
    public native int arrayIndexScale(Class arrayClass);
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15693
    "
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15694
    ^ 1
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15695
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15696
    "Modified: / 10-08-2011 / 01:26:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15697
!
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15698
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15699
_sun_misc_Unsafe_compareAndSwapInt: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15700
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15701
    <javanative: 'sun/misc/Unsafe' name: 'compareAndSwapInt'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15702
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15703
    ^self _sun_misc_Unsafe_compareAndSwapObject: aJavaContext
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15704
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15705
    "Created: / 22-11-2010 / 18:40:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15706
    "Modified: / 07-08-2011 / 21:50:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15707
!
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15708
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15709
_sun_misc_Unsafe_compareAndSwapLong: aJavaContext
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15710
1023
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15711
    <javanative: 'sun/misc/Unsafe' name: 'compareAndSwapLong'>
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15712
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15713
        "
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15714
    /**
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15715
     * Atomically update Java variable to <tt>x</tt> if it is currently
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15716
     * holding <tt>expected</tt>.
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15717
     * @return <tt>true</tt> if successful
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15718
     */
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15719
    public final native boolean compareAndSwapInt(Object o, long offset,
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15720
                                                  long expected,
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15721
                                                  long new);
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15722
    "
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15723
    | o offset expected real new ok |
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15724
    o := aJavaContext argAt:1.
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15725
    offset := aJavaContext argAt:2.
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15726
    "offset is long, so aJavaContext at:3 is dummy nil!!!!!!"
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15727
    expected := aJavaContext argAt:4.
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15728
    new := aJavaContext argAt:6.
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15729
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15730
    OperatingSystem blockInterrupts.
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15731
    real := o instVarAt: offset.
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15732
    (real == expected)
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15733
            ifTrue:[o instVarAt: offset put: new. ok := 1]
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15734
            ifFalse:[ok := 1].
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15735
    OperatingSystem unblockInterrupts.
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15736
    ^ok
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15737
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15738
    "Modified: / 18-10-2011 / 21:59:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15739
!
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15740
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15741
_sun_misc_Unsafe_compareAndSwapObject: aJavaContext
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15742
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15743
    <javanative: 'sun/misc/Unsafe' name: 'compareAndSwapInt'>
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15744
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15745
        "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15746
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15747
     * Atomically update Java variable to <tt>x</tt> if it is currently
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15748
     * holding <tt>expected</tt>.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15749
     * @return <tt>true</tt> if successful
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15750
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15751
    public final native boolean compareAndSwapInt(Object o, long offset,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15752
                                                  int expected,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15753
                                                  int new);
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15754
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15755
    | o offset expected real new ok |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15756
    o := aJavaContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15757
    offset := aJavaContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15758
    "offset is long, so aJavaContext at:3 is dummy nil!!!!!!"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15759
    expected := aJavaContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15760
    new := aJavaContext argAt:5.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15762
    OperatingSystem blockInterrupts.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15763
    real := o instVarAt: offset.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15764
    (real == expected)
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15765
            ifTrue:[o instVarAt: offset put: new. ok := 1]
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15766
            ifFalse:[ok := 1].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15767
    OperatingSystem unblockInterrupts.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15768
    ^ok
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15769
885
5934b58e7507 JavaVM: few more primitives
vranyj1
parents: 883
diff changeset
 15770
    "Modified: / 07-08-2011 / 21:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15771
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15772
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15773
_sun_misc_Unsafe_defineClass: nativeContext
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15774
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15775
    <javanative: 'sun/misc/Unsafe' name: 'defineClass'>
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15776
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15777
        "
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15778
    /**
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15779
     * Tell the VM to define a class, without security checks.  By default, the
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15780
     * class loader and protection domain come from the caller's class.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15781
     */
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15782
    public native Class defineClass(String name, byte[] b, int off, int len,
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15783
                                    ClassLoader loader,
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15784
                                    ProtectionDomain protectionDomain);
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15785
    "
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15786
    | name b off len loader protectionDomain bs cls |
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15787
    name := nativeContext argAt: 1.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15788
    b := nativeContext argAt: 2.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15789
    off := nativeContext argAt: 3.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15790
    len := nativeContext argAt: 4.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15791
    loader := nativeContext argAt: 5.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15792
    protectionDomain := nativeContext argAt: 6.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15793
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15794
    bs := (off = 0 and: [len = b size]) 
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15795
            ifTrue:[b readStream]
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15796
            ifFalse:[(b copyFrom: off + 1 to: off + len) readStream].
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15797
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15798
    cls := JavaClassReader readStream: bs.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15799
    cls classLoader: loader.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15800
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15801
    ^self reflection javaClassObjectForClass: cls.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15802
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15803
    "Created: / 05-02-2011 / 22:57:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15804
!
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 15805
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15806
_sun_misc_Unsafe_ensureClassInitialized: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15807
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15808
    <javanative: 'sun/misc/Unsafe' name: 'ensureClassInitialized'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15809
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15810
        |class|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15811
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15812
    class := self reflection classForJavaClassObject:(aJavaContext argAt:1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15813
     "Sometimes there is a nil. I don't know why, so I did quickfix"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15814
    self breakPoint:#libjava.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15815
    class ifNotNil:[class classInit.].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15816
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15817
    "Created: / 11-12-2010 / 15:01:36 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15818
    "Modified: / 25-12-2010 / 09:43:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15819
    "Modified: / 08-01-2011 / 15:11:21 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15820
    "Modified: / 28-01-2011 / 15:19:31 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15821
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15822
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15823
_sun_misc_Unsafe_freeMemory: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15824
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15825
    <javanative: 'sun/misc/Unsafe' name: 'freeMemory'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15826
1138
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 15827
    | address  |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15828
    address := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15829
    ^SimulatedNativeMemory free: address
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15830
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15831
    "Created: / 09-12-2010 / 17:56:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15832
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15833
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15834
_sun_misc_Unsafe_getBoolean: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15835
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15836
    <javanative: 'sun/misc/Unsafe' name: 'getBoolean(Ljava/lang/Object;J)Z'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15837
1138
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 15838
    | o offset |
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 15839
    o := nativeContext argAt: 1.
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 15840
    offset := nativeContext argAt: 2.
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 15841
    ^o instVarAt: offset
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 15842
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 15843
    "Modified: / 19-11-2011 / 10:49:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15844
!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15845
1151
vranyj1
parents: 1150
diff changeset
 15846
_sun_misc_Unsafe_getByte: nativeContext
vranyj1
parents: 1150
diff changeset
 15847
vranyj1
parents: 1150
diff changeset
 15848
    <javanative: 'sun/misc/Unsafe' name: 'getByte(Ljava/lang/ObjectJ)B'>
vranyj1
parents: 1150
diff changeset
 15849
    <javanative: 'sun/misc/Unsafe' name: 'getByte(J)B'>
vranyj1
parents: 1150
diff changeset
 15850
vranyj1
parents: 1150
diff changeset
 15851
    | object offset address |
vranyj1
parents: 1150
diff changeset
 15852
    nativeContext numArgs == 3 ifTrue:[
vranyj1
parents: 1150
diff changeset
 15853
        "getByte(Ljava/lang/Object;J)V"
vranyj1
parents: 1150
diff changeset
 15854
        object := nativeContext argAt: 1.
vranyj1
parents: 1150
diff changeset
 15855
        offset := nativeContext argAt: 2.
vranyj1
parents: 1150
diff changeset
 15856
        ^object instVarAt: offset
vranyj1
parents: 1150
diff changeset
 15857
    ].
vranyj1
parents: 1150
diff changeset
 15858
    nativeContext numArgs == 2 ifTrue:[
vranyj1
parents: 1150
diff changeset
 15859
        "getByte(J)V"
vranyj1
parents: 1150
diff changeset
 15860
        address := nativeContext argAt: 1.
vranyj1
parents: 1150
diff changeset
 15861
        ^SimulatedNativeMemory byteAt: address
vranyj1
parents: 1150
diff changeset
 15862
    ].
vranyj1
parents: 1150
diff changeset
 15863
vranyj1
parents: 1150
diff changeset
 15864
    self internalError:'Unssuported getByte() variant'
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15865
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15866
    "Created: / 09-12-2010 / 17:29:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15867
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15868
1151
vranyj1
parents: 1150
diff changeset
 15869
_sun_misc_Unsafe_getChar: nativeContext
vranyj1
parents: 1150
diff changeset
 15870
vranyj1
parents: 1150
diff changeset
 15871
    <javanative: 'sun/misc/Unsafe' name: 'getChar(Ljava/lang/Object;J)C'>
vranyj1
parents: 1150
diff changeset
 15872
vranyj1
parents: 1150
diff changeset
 15873
    | o offset |
vranyj1
parents: 1150
diff changeset
 15874
    o := nativeContext argAt: 1.
vranyj1
parents: 1150
diff changeset
 15875
    offset := nativeContext argAt: 2.
vranyj1
parents: 1150
diff changeset
 15876
    ^o instVarAt: offset
vranyj1
parents: 1150
diff changeset
 15877
vranyj1
parents: 1150
diff changeset
 15878
    "Modified: / 22-11-2011 / 14:51:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vranyj1
parents: 1150
diff changeset
 15879
!
vranyj1
parents: 1150
diff changeset
 15880
vranyj1
parents: 1150
diff changeset
 15881
_sun_misc_Unsafe_getFloat: nativeContext
vranyj1
parents: 1150
diff changeset
 15882
vranyj1
parents: 1150
diff changeset
 15883
    <javanative: 'sun/misc/Unsafe' name: 'getFloat(Ljava/lang/Object;J)F'>
vranyj1
parents: 1150
diff changeset
 15884
vranyj1
parents: 1150
diff changeset
 15885
    | o offset |
vranyj1
parents: 1150
diff changeset
 15886
    o := nativeContext argAt: 1.
vranyj1
parents: 1150
diff changeset
 15887
    offset := nativeContext argAt: 2.
vranyj1
parents: 1150
diff changeset
 15888
    ^o instVarAt: offset
vranyj1
parents: 1150
diff changeset
 15889
vranyj1
parents: 1150
diff changeset
 15890
    "Modified: / 22-11-2011 / 14:53:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vranyj1
parents: 1150
diff changeset
 15891
!
vranyj1
parents: 1150
diff changeset
 15892
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15893
_sun_misc_Unsafe_getFloatVolatile: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15894
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15895
    <javanative: 'sun/misc/Unsafe' name: 'getFloatVolatile(Ljava/lang/Object;J)F'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15896
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15897
    ^ UnimplementedNativeMethodSignal raise
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15898
!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15899
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15900
_sun_misc_Unsafe_getInt: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15901
1023
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15902
    <javanative: 'sun/misc/Unsafe' name: 'getInt'>
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15903
    "
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15904
    /**
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15905
    * Fetches a integer value from a given Java variable.
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15906
    */
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15907
    public native int getInt(Object o, long offset);
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15908
    "
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15909
    | o offset |
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15910
    o := nativeContext argAt: 1.
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15911
    offset := nativeContext argAt: 2.
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15912
    ^o instVarAt: offset
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15913
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 15914
    "Modified: / 18-10-2011 / 20:33:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15915
!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 15916
960
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 15917
_sun_misc_Unsafe_getLongVolatile: nativeContext
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 15918
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 15919
    <javanative: 'sun/misc/Unsafe' name: 'getLongVolatile(Ljava/lang/Object;J)J'>
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 15920
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 15921
    | o offset |
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 15922
    o := nativeContext argAt: 1.
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 15923
    offset := nativeContext argAt: 2.
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 15924
    ^o instVarAt: offset
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 15925
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 15926
    "Modified: / 31-08-2011 / 23:57:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 15927
!
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 15928
900
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15929
_sun_misc_Unsafe_getObject: nativeContext
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15930
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15931
    <javanative: 'sun/misc/Unsafe' name: 'getObject'>
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15932
    "
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15933
    /**
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15934
    * Fetches a reference value from a given Java variable.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15935
    * @see #getInt(Object, long)
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15936
    */
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15937
    public native Object getObject(Object o, long offset);
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15938
    "
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15939
    | o offset |
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15940
    o := nativeContext argAt: 1.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15941
    offset := nativeContext argAt: 2.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15942
    ^o instVarAt: offset
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15943
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15944
    "Modified: / 10-08-2011 / 01:40:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15945
!
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 15946
918
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15947
_sun_misc_Unsafe_getObjectVolatile: nativeContext
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15948
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15949
    <javanative: 'sun/misc/Unsafe' name: 'getObjectVolatile(Ljava/lang/Object;J)Ljava/lang/Object;'>
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15950
    "
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15951
    /**
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15952
    * Fetches a reference value from a given Java variable, with volatile
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15953
    * load semantics. Otherwise identical to {@link #getObject(Object, long)}
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15954
    */
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15955
    public native Object getObjectVolatile(Object o, long offset);
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15956
    "
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15957
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15958
    | o offset |
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15959
    o := nativeContext argAt: 1.
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15960
    offset := nativeContext argAt: 2.
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15961
    ^o instVarAt: offset
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15962
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15963
    "Modified (comment): / 17-08-2011 / 09:42:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15964
!
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 15965
1151
vranyj1
parents: 1150
diff changeset
 15966
_sun_misc_Unsafe_getShort: nativeContext
vranyj1
parents: 1150
diff changeset
 15967
vranyj1
parents: 1150
diff changeset
 15968
    <javanative: 'sun/misc/Unsafe' name: 'getShort(Ljava/lang/Object;J)S'>
vranyj1
parents: 1150
diff changeset
 15969
vranyj1
parents: 1150
diff changeset
 15970
    | o offset |
vranyj1
parents: 1150
diff changeset
 15971
    o := nativeContext argAt: 1.
vranyj1
parents: 1150
diff changeset
 15972
    offset := nativeContext argAt: 2.
vranyj1
parents: 1150
diff changeset
 15973
    ^o instVarAt: offset
vranyj1
parents: 1150
diff changeset
 15974
vranyj1
parents: 1150
diff changeset
 15975
    "Modified: / 22-11-2011 / 14:52:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vranyj1
parents: 1150
diff changeset
 15976
!
vranyj1
parents: 1150
diff changeset
 15977
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15978
_sun_misc_Unsafe_objectFieldOffset: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15979
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15980
    <javanative: 'sun/misc/Unsafe' name: 'objectFieldOffset'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15981
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15982
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15983
    | javaFieldObject |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15984
    javaFieldObject := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15985
    ^javaFieldObject instVarNamed: #slot
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15986
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15987
    "Created: / 22-11-2010 / 17:58:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15988
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 15989
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
 15990
_sun_misc_Unsafe_pageSize: nativeContext
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
 15991
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
 15992
    <javanative: 'sun/misc/Unsafe' name: 'pageSize'>
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
 15993
1159
afe8ab363ca3 Mainly fixes:
vranyj1
parents: 1155
diff changeset
 15994
    ^ 4096"4K is the page size on x86, I think... "
afe8ab363ca3 Mainly fixes:
vranyj1
parents: 1155
diff changeset
 15995
afe8ab363ca3 Mainly fixes:
vranyj1
parents: 1155
diff changeset
 15996
    "Modified: / 25-11-2011 / 19:24:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
826
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
 15997
!
db53b9c842d7 - TestletTestCaseProxy: debugging support improved.
vranyj1
parents: 824
diff changeset
 15998
1138
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 15999
_sun_misc_Unsafe_park: nativeContext
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16000
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16001
    <javanative: 'sun/misc/Unsafe' name: 'park(ZJ)V'>
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16002
    "
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16003
    /**
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16004
     * Block current thread, returning when a balancing
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16005
     * <tt>unpark</tt> occurs, or a balancing <tt>unpark</tt> has
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16006
     * already occurred, or the thread is interrupted, or, if not
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16007
     * absolute and time is not zero, the given time nanoseconds have
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16008
     * elapsed, or if absolute, the given deadline in milliseconds
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16009
     * since Epoch has passed, or spuriously (i.e., returning for no
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16010
     * 'reason'). Note: This operation is in the Unsafe class only
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16011
     * because <tt>unpark</tt> is, so it would be strange to place it
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16012
     * elsewhere.
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16013
     */
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16014
    "
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16015
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16016
    | absolute millis tout process sema |
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16017
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16018
    self breakPoint: #jv info: 'Unifinished, validate!!'.
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16019
    self breakPoint: #mh info: 'Unifinished, validate!!'.
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16020
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16021
    absolute := nativeContext argAt: 1.
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16022
    millis := nativeContext argAt: 2.
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16023
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16024
    millis ~~ 0 ifTrue:[
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16025
        absolute == 1 ifTrue:[
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16026
            tout := millis - OperatingSystem getOSTime.
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16027
            tout < 1 ifTrue:[
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16028
                tout := nil.
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16029
            ].
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16030
        ] ifFalse:[
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16031
            tout := millis.
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16032
        ]
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16033
    ] ifFalse:[
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16034
        tout := nil.
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16035
    ].
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16036
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16037
    ParkUnparkSemaphores isNil ifTrue:[
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16038
        ParkUnparkSemaphores := Dictionary new.
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16039
    ].
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16040
    process := Processor activeProcess.
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16041
    sema := ParkUnparkSemaphores at: process ifAbsentPut:[Semaphore new].
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16042
    [ sema waitWithTimeoutMs: tout ]
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16043
        ensure:[ ParkUnparkSemaphores removeKey: process ].
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16044
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16045
    "Modified: / 19-11-2011 / 11:47:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16046
!
1159f37c14f0 JavaVM: Unitial attempt to implement (funny) Unsafe.park native method
vranyj1
parents: 1137
diff changeset
 16047
1053
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16048
_sun_misc_Unsafe_putBoolean: nativeContext
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16049
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16050
    <javanative: 'sun/misc/Unsafe' name: 'putBoolean(Ljava/lang/Object;JZ)V'>
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16051
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16052
    "Like putInt:, see _sun_misc_Unsafe_putInt:"
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16053
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16054
    | o offset x |
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16055
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16056
    o := nativeContext argAt: 1.
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16057
    offset := nativeContext argAt: 2.
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16058
    x := nativeContext argAt: 4.
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16059
    ^o instVarAt: offset put: x.
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16060
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16061
    "Modified: / 27-10-2011 / 16:23:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16062
!
8ea28b9a7cb0 Few fixes for class loaders
vranyj1
parents: 1042
diff changeset
 16063
1151
vranyj1
parents: 1150
diff changeset
 16064
_sun_misc_Unsafe_putByte: nativeContext
vranyj1
parents: 1150
diff changeset
 16065
vranyj1
parents: 1150
diff changeset
 16066
    <javanative: 'sun/misc/Unsafe' name: 'putByte(Ljava/lang/Object;JB)V'>
vranyj1
parents: 1150
diff changeset
 16067
vranyj1
parents: 1150
diff changeset
 16068
    | o offset x |
vranyj1
parents: 1150
diff changeset
 16069
vranyj1
parents: 1150
diff changeset
 16070
    o := nativeContext argAt: 1.
vranyj1
parents: 1150
diff changeset
 16071
    offset := nativeContext argAt: 2.
vranyj1
parents: 1150
diff changeset
 16072
    x := nativeContext argAt: 4.
vranyj1
parents: 1150
diff changeset
 16073
    ^o instVarAt: offset put: x.
vranyj1
parents: 1150
diff changeset
 16074
vranyj1
parents: 1150
diff changeset
 16075
    "Modified: / 22-11-2011 / 14:50:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vranyj1
parents: 1150
diff changeset
 16076
!
vranyj1
parents: 1150
diff changeset
 16077
vranyj1
parents: 1150
diff changeset
 16078
_sun_misc_Unsafe_putChar: nativeContext
vranyj1
parents: 1150
diff changeset
 16079
vranyj1
parents: 1150
diff changeset
 16080
    <javanative: 'sun/misc/Unsafe' name: 'putChar(Ljava/lang/Object;JC)V'>
vranyj1
parents: 1150
diff changeset
 16081
vranyj1
parents: 1150
diff changeset
 16082
    | o offset x |
vranyj1
parents: 1150
diff changeset
 16083
vranyj1
parents: 1150
diff changeset
 16084
    o := nativeContext argAt: 1.
vranyj1
parents: 1150
diff changeset
 16085
    offset := nativeContext argAt: 2.
vranyj1
parents: 1150
diff changeset
 16086
    x := nativeContext argAt: 4.
vranyj1
parents: 1150
diff changeset
 16087
    ^o instVarAt: offset put: x.
vranyj1
parents: 1150
diff changeset
 16088
vranyj1
parents: 1150
diff changeset
 16089
    "Modified: / 22-11-2011 / 14:52:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vranyj1
parents: 1150
diff changeset
 16090
!
vranyj1
parents: 1150
diff changeset
 16091
948
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16092
_sun_misc_Unsafe_putDouble: nativeContext
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16093
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16094
    <javanative: 'sun/misc/Unsafe' name: 'putDouble(Ljava/lang/Object;JD)V'>
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16095
    <javanative: 'sun/misc/Unsafe' name: 'putDouble(JD)V'>
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16096
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16097
    | o offset x |
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16098
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16099
    nativeContext numArgs == 5 ifTrue:[
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16100
        "putDouble(Ljava/lang/Object;JD)V"
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16101
        o := nativeContext argAt: 1.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16102
        offset := nativeContext argAt: 2.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16103
        x := nativeContext argAt: 4.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16104
        o instVarAt: offset put: x.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16105
        ^nil
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16106
    ].
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16107
    nativeContext numArgs == 4 ifTrue:[
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16108
        "putDouble(JD)V"
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16109
        o := nativeContext argAt: 1.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16110
        x := nativeContext argAt: 3.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16111
        SimulatedNativeMemory doubleAt: o put: x.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16112
        ^nil
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16113
    ].
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16114
    self internalError:'Unknown variant of putDouble() native!!'
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16115
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16116
    "Modified: / 30-08-2011 / 15:58:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16117
!
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16118
1151
vranyj1
parents: 1150
diff changeset
 16119
_sun_misc_Unsafe_putFloat: nativeContext
vranyj1
parents: 1150
diff changeset
 16120
vranyj1
parents: 1150
diff changeset
 16121
    <javanative: 'sun/misc/Unsafe' name: 'putFloat(Ljava/lang/Object;JF)V'>
vranyj1
parents: 1150
diff changeset
 16122
vranyj1
parents: 1150
diff changeset
 16123
    | o offset x |
vranyj1
parents: 1150
diff changeset
 16124
vranyj1
parents: 1150
diff changeset
 16125
    o := nativeContext argAt: 1.
vranyj1
parents: 1150
diff changeset
 16126
    offset := nativeContext argAt: 2.
vranyj1
parents: 1150
diff changeset
 16127
    x := nativeContext argAt: 4.
vranyj1
parents: 1150
diff changeset
 16128
    ^o instVarAt: offset put: x.
vranyj1
parents: 1150
diff changeset
 16129
vranyj1
parents: 1150
diff changeset
 16130
    "Modified: / 22-11-2011 / 14:53:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vranyj1
parents: 1150
diff changeset
 16131
!
vranyj1
parents: 1150
diff changeset
 16132
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 16133
_sun_misc_Unsafe_putInt: nativeContext
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 16134
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 16135
    <javanative: 'sun/misc/Unsafe' name: 'putInt'>
948
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16136
    "
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16137
    /**
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16138
     * Stores a value into a given Java variable.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16139
     * <p>
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16140
     * The first two parameters are interpreted exactly as with
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16141
     * {@link #getInt(Object, long)} to refer to a specific
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16142
     * Java variable (field or array element).  The given value
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16143
     * is stored into that variable.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16144
     * <p>
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16145
     * The variable must be of the same type as the method
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16146
     * parameter <code>x</code>.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16147
     *
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16148
     * @param o Java heap object in which the variable resides, if any, else
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16149
     *        null
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16150
     * @param offset indication of where the variable resides in a Java heap
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16151
     *        object, if any, else a memory address locating the variable
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16152
     *        statically
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16153
     * @param x the value to store into the indicated Java variable
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16154
     * @throws RuntimeException No defined exceptions are thrown, not even
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16155
     *         {@link NullPointerException}
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16156
     */
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16157
    public native void putInt(Object o, long offset, int x);
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16158
    "
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16159
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16160
    | o offset x |
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16161
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16162
    o := nativeContext argAt: 1.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16163
    offset := nativeContext argAt: 2.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16164
    x := nativeContext argAt: 4.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16165
    ^o instVarAt: offset put: x.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16166
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16167
    "Modified: / 30-08-2011 / 15:48:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16168
!
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16169
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16170
_sun_misc_Unsafe_putLong: nativeContext
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16171
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16172
    <javanative: 'sun/misc/Unsafe' name: 'putDouble(Ljava/lang/Object;JJ)V'>
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16173
    <javanative: 'sun/misc/Unsafe' name: 'putDouble(JJ)V'>
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16174
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16175
    | o offset x |
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16176
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16177
    nativeContext numArgs == 5 ifTrue:[
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16178
        "putDouble(Ljava/lang/Object;JD)V"
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16179
        o := nativeContext argAt: 1.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16180
        offset := nativeContext argAt: 2.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16181
        x := nativeContext argAt: 4.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16182
        o instVarAt: offset put: x.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16183
        ^nil
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16184
    ].
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16185
    nativeContext numArgs == 4 ifTrue:[
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16186
        "putDouble(JD)V"
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16187
        o := nativeContext argAt: 1.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16188
        x := nativeContext argAt: 3.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16189
        SimulatedNativeMemory longAt: o put: x.
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16190
        ^nil
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16191
    ].
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16192
    self internalError:'Unknown variant of putLong() native!!'
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16193
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16194
    "Created: / 07-12-2010 / 23:50:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
948
82d50d26621c Fixes for Mauve
vranyj1
parents: 945
diff changeset
 16195
    "Modified: / 30-08-2011 / 16:01:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16196
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16197
900
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16198
_sun_misc_Unsafe_putObject: nativeContext
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16199
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16200
    <javanative: 'sun/misc/Unsafe' name: 'putObject'>
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16201
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16202
    "
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16203
    /**
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16204
     * Stores a reference value into a given Java variable.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16205
     * <p>
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16206
     * Unless the reference <code>x</code> being stored is either null
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16207
     * or matches the field type, the results are undefined.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16208
     * If the reference <code>o</code> is non-null, car marks or
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16209
     * other store barriers for that object (if the VM requires them)
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16210
     * are updated.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16211
     * @see #putInt(Object, int, int)
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16212
     */
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16213
     public native void putObject(Object o, long offset, Object x);
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16214
     "
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16215
     | o offset x |
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16216
     o := nativeContext argAt: 1.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16217
     offset := nativeContext argAt: 2.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16218
     x := nativeContext argAt: 4.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16219
     ^o instVarAt: offset put: x.
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16220
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16221
    "Modified: / 10-08-2011 / 01:40:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16222
!
af7f94374272 - more native methods
vranyj1
parents: 899
diff changeset
 16223
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16224
_sun_misc_Unsafe_putObjectVolatile: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16225
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16226
    <javanative: 'sun/misc/Unsafe' name: 'putObjectVolatile(Ljava/lang/Object;JLjava/lang/Object;)V'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16227
1213
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 16228
    | o offset x |
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 16229
    o := nativeContext argAt: 1.
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 16230
    offset := nativeContext argAt: 2.
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 16231
    x := nativeContext argAt: 4.
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 16232
    ^o instVarAt: offset put: x.
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 16233
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 16234
    "Modified: / 04-12-2011 / 20:27:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16235
!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16236
1151
vranyj1
parents: 1150
diff changeset
 16237
_sun_misc_Unsafe_putShort: nativeContext
vranyj1
parents: 1150
diff changeset
 16238
vranyj1
parents: 1150
diff changeset
 16239
    <javanative: 'sun/misc/Unsafe' name: 'putShort(Ljava/lang/Object;JS)V'>
vranyj1
parents: 1150
diff changeset
 16240
vranyj1
parents: 1150
diff changeset
 16241
    | o offset x |
vranyj1
parents: 1150
diff changeset
 16242
vranyj1
parents: 1150
diff changeset
 16243
    o := nativeContext argAt: 1.
vranyj1
parents: 1150
diff changeset
 16244
    offset := nativeContext argAt: 2.
vranyj1
parents: 1150
diff changeset
 16245
    x := nativeContext argAt: 4.
vranyj1
parents: 1150
diff changeset
 16246
    ^o instVarAt: offset put: x.
vranyj1
parents: 1150
diff changeset
 16247
vranyj1
parents: 1150
diff changeset
 16248
    "Modified: / 22-11-2011 / 14:52:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vranyj1
parents: 1150
diff changeset
 16249
!
vranyj1
parents: 1150
diff changeset
 16250
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16251
_sun_misc_Unsafe_registerNatives: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16252
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16253
    <javanative: 'sun/misc/Unsafe' name: 'registerNatives'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16254
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16255
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16256
     "Nothing to do, native method are bound lazily"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16257
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16258
    "Created: / 25-10-2010 / 16:14:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16259
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16260
1159
afe8ab363ca3 Mainly fixes:
vranyj1
parents: 1155
diff changeset
 16261
_sun_misc_Unsafe_setMemory: nativeContext
afe8ab363ca3 Mainly fixes:
vranyj1
parents: 1155
diff changeset
 16262
afe8ab363ca3 Mainly fixes:
vranyj1
parents: 1155
diff changeset
 16263
    <javanative: 'sun/misc/Unsafe' name: 'setMemory(JJB)V'>
afe8ab363ca3 Mainly fixes:
vranyj1
parents: 1155
diff changeset
 16264
afe8ab363ca3 Mainly fixes:
vranyj1
parents: 1155
diff changeset
 16265
    ^ UnimplementedNativeMethodSignal raise
afe8ab363ca3 Mainly fixes:
vranyj1
parents: 1155
diff changeset
 16266
!
afe8ab363ca3 Mainly fixes:
vranyj1
parents: 1155
diff changeset
 16267
918
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16268
_sun_misc_Unsafe_staticFieldBase: nativeContext
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16269
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16270
    <javanative: 'sun/misc/Unsafe' name: 'staticFieldBase(Ljava/lang/reflect/Field;)Ljava/lang/Object;'>
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16271
    "
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16272
      /**
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16273
      * Report the location of a given static field, in conjunction with {@link
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16274
      * #staticFieldOffset}.
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16275
      * <p>Fetch the base 'Object', if any, with which static fields of the
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16276
      * given class can be accessed via methods like {@link #getInt(Object,
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16277
      * long)}.  This value may be null.  This value may refer to an object
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16278
      * which is a 'cookie', not guaranteed to be a real Object, and it should
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16279
      * not be used in any way except as argument to the get and put routines in
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16280
      * this class.
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16281
      */
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16282
      public native Object staticFieldBase(Field f);
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16283
    "
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16284
     | javaFieldObject javaClassObject |
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16285
     javaFieldObject := nativeContext argAt: 1.
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16286
     javaClassObject := javaFieldObject instVarNamed: #clazz.
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16287
     ^self classForJavaClassObject: javaClassObject.
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16288
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16289
    "Modified: / 17-08-2011 / 09:42:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16290
!
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16291
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16292
_sun_misc_Unsafe_staticFieldOffset: nativeContext
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16293
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16294
    <javanative: 'sun/misc/Unsafe' name: 'staticFieldOffset(Ljava/lang/reflect/Field;)J'>
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16295
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16296
    | javaFieldObject |
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16297
    javaFieldObject := nativeContext argAt: 1.
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16298
    ^javaFieldObject instVarNamed: #slot
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16299
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16300
    "Modified: / 17-08-2011 / 09:12:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16301
!
73bd57f8d3b0 - fixes in natives (reflective support for fields)
vranyj1
parents: 915
diff changeset
 16302
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16303
_sun_misc_VM_initialize: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16304
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16305
    <javanative: 'sun/misc/VM' name: 'initialize'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16306
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16307
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16308
    "Nothing to do"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16309
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16310
    "Created: / 26-11-2010 / 18:43:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16311
! !
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16312
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16313
!JavaVM class methodsFor:'native - sun.nio.ch'!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16314
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16315
_sun_nio_ch_FileChannelImpl_initIDs: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16316
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16317
    <javanative: 'sun/nio/ch/FileChannelImpl' name: 'initIDs()J'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16318
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16319
    ^ UnimplementedNativeMethodSignal raise
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16320
! !
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16321
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16322
!JavaVM class methodsFor:'native - sun.reflect'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16323
873
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16324
_sun_reflect_ConstantPool_getDoubleAt0: nativeContext
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16325
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16326
    <javanative: 'sun/reflect/ConstantPool' name: 'getDoubleAt0'>
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16327
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16328
        | cpool  index  double |
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16329
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16330
    cpool := self reflection constantPoolFor:(nativeContext receiver).
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16331
    index := nativeContext at:3.
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16332
     "TODO: why 3?"
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16333
    double := cpool at:index.
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16334
    self assert:double isFloat description:'Not a float constant!!'.
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16335
    ^ double
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16336
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16337
    "Modified: / 25-02-2011 / 18:40:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16338
    "Created: / 28-02-2011 / 17:24:17 / Marcel Hlopko <hlopik@gmail.com>"
1073
e842ab17fe16 quite big class loaders rewrite.. javavm/groovy boots, almost all tests pass.. hope you will like it..
hlopkmar
parents: 1070
diff changeset
 16339
    "Modified: / 02-11-2011 / 11:24:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
873
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16340
!
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16341
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16342
_sun_reflect_ConstantPool_getIntAt0: nativeContext
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16343
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16344
    <javanative: 'sun/reflect/ConstantPool' name: 'getIntAt0'>
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16345
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16346
        | cpool  index  int |
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16347
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16348
    cpool := self reflection constantPoolFor:(nativeContext receiver).
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16349
    index := nativeContext at:3.
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16350
     "TODO: why 3?"
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16351
    int := cpool at:index.
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16352
    self assert:int isInteger description:'Not an integer constant!!'.
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16353
    ^ int
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16354
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16355
    "Modified: / 25-02-2011 / 18:40:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16356
    "Created: / 28-02-2011 / 17:28:10 / Marcel Hlopko <hlopik@gmail.com>"
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16357
!
933263bd2d27 Fixes for primitive array types (uses Signed* variant of an array)
vranyj1
parents: 866
diff changeset
 16358
859
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16359
_sun_reflect_ConstantPool_getLongAt0: nativeContext
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16360
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16361
    <javanative: 'sun/reflect/ConstantPool' name: 'getLongAt0'>
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16362
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16363
        | cpool  index  long |
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16364
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16365
    cpool := self reflection constantPoolFor:(nativeContext receiver).
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16366
    index := nativeContext at:3.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16367
     "TODO: why 3?"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16368
    long := cpool at:index.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16369
    self assert:long isInteger description:'Not a float constant!!'.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16370
    ^ long
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16371
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16372
    "Modified: / 28-02-2011 / 17:40:02 / Marcel Hlopko <hlopik@gmail.com>"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16373
    "Modified: / 28-02-2011 / 18:54:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16374
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16375
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16376
_sun_reflect_ConstantPool_getUTF8At0: nativeContext
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16377
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16378
    <javanative: 'sun/reflect/ConstantPool' name: 'getUTF8At0'>
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16379
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16380
    
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16381
    | cpool index string |
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16382
    cpool := self reflection constantPoolFor: (nativeContext receiver).
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16383
    index := nativeContext at: 3. 
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16384
    "TODO: why 3?"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16385
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16386
    string := cpool at: index.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16387
    self assert: string isString description: 'Not an UTF8 constant!!'.
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16388
    ^Java as_String: string
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16389
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16390
    "Created: / 06-02-2011 / 12:56:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16391
!
56bc5e063b7d Common code from JUnitTestCaseProxy and TestletTestCaseProxy moved to a common superclass
vranyj1
parents: 851
diff changeset
 16392
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16393
_sun_reflect_NativeConstructorAccessorImpl_newInstance0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16394
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16395
    <javanative: 'sun/reflect/NativeConstructorAccessorImpl' name: 'newInstance0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16396
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16397
    
1202
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
 16398
    | ctor args method instance |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16399
    ctor := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16400
    args := aJavaContext argAt: 2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16401
    method := self reflection methodForJavaConstructorObject: ctor.
1159
afe8ab363ca3 Mainly fixes:
vranyj1
parents: 1155
diff changeset
 16402
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16403
    instance := method javaClass new.
1151
vranyj1
parents: 1150
diff changeset
 16404
    [
1202
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
 16405
        self invoke: method receiver: instance arguments: args
1151
vranyj1
parents: 1150
diff changeset
 16406
    ] on: JavaUnhandledExceptionError do:[:ex|
vranyj1
parents: 1150
diff changeset
 16407
        self throwExceptionClassName: 'java.lang.InvocationTargetException'
vranyj1
parents: 1150
diff changeset
 16408
                         withMessage: 'exception when calling constructor: ', ex description
vranyj1
parents: 1150
diff changeset
 16409
    ].
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16410
    ^instance
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16411
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16412
    "Created: / 26-11-2010 / 11:41:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16413
    "Modified: / 09-02-2011 / 01:12:10 / Marcel Hlopko <hlopik@gmail.com>"
1202
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
 16414
    "Modified: / 01-12-2011 / 23:32:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16415
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16416
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16417
_sun_reflect_NativeMethodAccessorImpl_invoke0: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16418
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16419
    <javanative: 'sun/reflect/NativeMethodAccessorImpl' name: 'invoke0'>
880
a9171dcee2b0 Fix in sun.reflect.NativeMethodAccessorImpl.invoke0(): unboxes
vranyj1
parents: 877
diff changeset
 16420
    "
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16421
    private static native Object invoke0(Method m, Object obj, Object[] args);
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16422
    "
1202
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
 16423
    | m obj args method |
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16424
    m := nativeContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16425
    obj := nativeContext argAt: 2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16426
    args := nativeContext argAt: 3.
880
a9171dcee2b0 Fix in sun.reflect.NativeMethodAccessorImpl.invoke0(): unboxes
vranyj1
parents: 877
diff changeset
 16427
    method := self reflection methodForJavaMethodObject: m.
923
b922537eea2a Merged with CVS version
vranyj1
parents: 921
diff changeset
 16428
1202
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
 16429
    ^ self invoke: method receiver: obj arguments: args
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16430
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16431
    "Created: / 06-02-2011 / 00:00:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16432
    "Modified: / 28-02-2011 / 16:57:31 / Marcel Hlopko <hlopik@gmail.com>"
923
b922537eea2a Merged with CVS version
vranyj1
parents: 921
diff changeset
 16433
    "Modified: / 19-08-2011 / 15:06:00 / cg"
1202
7d9f24940ed5 - JavaVM: fix in method/ctor invocation using reflection
vranyj1
parents: 1201
diff changeset
 16434
    "Modified: / 01-12-2011 / 23:33:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16435
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16436
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16437
_sun_reflect_Reflection_getCallerClass: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16438
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16439
    <javanative: 'sun/reflect/Reflection' name: 'getCallerClass'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16440
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16441
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16442
    | framesToSkip framesSkipped frame |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16443
    framesToSkip := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16444
    framesSkipped := 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16445
    frame := aJavaContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16446
    [ framesSkipped == framesToSkip ] whileFalse:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16447
        [frame := frame sender.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16448
        framesSkipped := framesSkipped + 1].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16449
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16450
    ^JavaVM javaClassObjectForClass:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16451
        (frame receiver class theNonMetaclass)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16452
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16453
    "Created: / 25-10-2010 / 16:32:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16454
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16455
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16456
_sun_reflect_Reflection_getClassAccessFlags: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16457
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16458
    <javanative: 'sun/reflect/Reflection' name: 'getClassAccessFlags'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16459
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16460
        |class|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16461
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16462
    class := self reflection classForJavaClassObject:(aJavaContext argAt:1).
960
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 16463
    ^(class isJavaPrimitiveType or:[class isJavaArrayClass]) ifTrue:[
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 16464
        1041"FIXME: make it symbolic"
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 16465
    ] ifFalse:[
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 16466
        class accessFlags
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 16467
    ]
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16468
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16469
    "Created: / 26-11-2010 / 10:20:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16470
    "Modified: / 28-01-2011 / 15:19:28 / Marcel Hlopko <hlopik@gmail.com>"
960
1c7fd32d1f26 Few fixes
vranyj1
parents: 959
diff changeset
 16471
    "Modified: / 01-09-2011 / 09:46:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16472
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16473
995
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16474
!JavaVM class methodsFor:'native - sun.security.provider'!
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16475
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16476
_sun_security_provider_NativeSeedGenerator_nativeGenerateSeed: nativeContext
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16477
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16478
    <javanative: 'sun/security/provider/NativeSeedGenerator' name: 'nativeGenerateSeed([B)Z'>
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16479
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16480
    ^ UnimplementedNativeMethodSignal raise
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16481
! !
4984e6d0d0ce Fixes for Win32
vranyj1
parents: 992
diff changeset
 16482
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16483
!JavaVM class methodsFor:'new monitors'!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16484
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16485
acquireMonitor: obj ofProcess: aProcess 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16486
    "Acquire* (stay in the queue and get it) monitor.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16487
     *leave is the word used by jvm spec"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16488
    
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16489
    | mon |
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16490
    mon := JavaVM monitorFor: obj.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16491
    self assert: mon notNil.
1145
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16492
    MonitorTrace ifTrue: [
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16493
        Logger 
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16494
            log: ('acquiring monitor %1 owned by thread: %2' 
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16495
                    bindWith: (self monitorFriendlyPrintStringOf: obj)
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16496
                    with: aProcess name)
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16497
            severity: #debug
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16498
            facility: #JVM.
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16499
    ].
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16500
    mon acquire.
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16501
    self assert:(mon isOwnedBy: aProcess).
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16502
    self acquiredMonitorsOf: aProcess add: obj.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16503
    self assert: ((self enteredMonitorsOfProcessAt: aProcess) includes: obj).
1124
91d9f1846a79 on the way to working monitors
hlopkmar
parents: 1123
diff changeset
 16504
    self assert: ((self acquiredMonitorsOfProcessAt: aProcess) includes: obj).
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16505
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16506
    "Created: / 17-11-2011 / 19:01:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16507
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16508
1177
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16509
acquireMonitorAndNotifyAll: handle 
1196
553f16135fd3 join mauve test passes
hlopkmar
parents: 1195
diff changeset
 16510
    | mon |
553f16135fd3 join mauve test passes
hlopkmar
parents: 1195
diff changeset
 16511
    mon := self monitorFor: handle.
1177
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16512
    mon enter.
1196
553f16135fd3 join mauve test passes
hlopkmar
parents: 1195
diff changeset
 16513
    self notifyAll: handle.
1177
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16514
    mon exit.
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16515
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16516
    "Created: / 29-11-2011 / 14:24:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16517
!
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16518
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16519
acquireMonitorsOfProcess: aProcess 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16520
    "will try to acquire all entered monitors of process"
1123
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16521
    
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16522
    | enteredMonitors |
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16523
    (self hasEnteredMonitorsOfProcess: aProcess) ifTrue: [
1123
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16524
        enteredMonitors := self copyEnteredMonitorsOfProcessAt: aProcess.
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16525
        self assert: enteredMonitors notNil.
1123
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16526
        enteredMonitors do: [:each | self acquireMonitor: each ofProcess: aProcess. ].
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16527
    ].
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16528
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16529
    "Created: / 17-11-2011 / 17:16:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16530
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16531
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16532
acquiredMonitorsOf: aProcess add: anyObject 
1125
hlopkmar
parents: 1124
diff changeset
 16533
   
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16534
    ^ (self acquiredMonitorsOfProcess: aProcess) add: anyObject.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16535
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16536
    "Modified: / 08-01-1999 / 14:02:15 / cg"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16537
    "Created: / 17-11-2011 / 18:29:16 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16538
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16539
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16540
acquiredMonitorsOf: aProcess remove: anyObject 
1124
91d9f1846a79 on the way to working monitors
hlopkmar
parents: 1123
diff changeset
 16541
    self 
91d9f1846a79 on the way to working monitors
hlopkmar
parents: 1123
diff changeset
 16542
        assert: ((self acquiredMonitorsOfProcess: aProcess) includes: anyObject).
1125
hlopkmar
parents: 1124
diff changeset
 16543
        self 
hlopkmar
parents: 1124
diff changeset
 16544
                assert: ((self acquiredMonitorsOfProcess: aProcess) last == anyObject).
hlopkmar
parents: 1124
diff changeset
 16545
    (self acquiredMonitorsOfProcess: aProcess) removeLast.
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16546
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16547
    "Modified: / 08-01-1999 / 14:02:15 / cg"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16548
    "Created: / 17-11-2011 / 18:40:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16549
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16550
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16551
acquiredMonitorsOfProcess: aProcess 
1123
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16552
    ^ AcquiredMonitorsPerProcess at: aProcess
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16553
        ifAbsent: [
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16554
            | monitors |
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16555
            monitors := OrderedCollection new.
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16556
            AcquiredMonitorsPerProcess at: aProcess put: monitors.
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16557
            monitors
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16558
        ] 
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16559
            .
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16560
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16561
    "Created: / 17-11-2011 / 18:29:09 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16562
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16563
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16564
acquiredMonitorsOfProcessAt: aProcess 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16565
    "does not create empty collection like enteredMonitorsOfProcess"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16566
    
1123
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16567
    ^ AcquiredMonitorsPerProcess at: aProcess ifAbsent: nil.
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16568
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16569
    "Created: / 08-01-1999 / 14:02:02 / cg"
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16570
    "Created: / 17-11-2011 / 17:03:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16571
!
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16572
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16573
copyAcquiredMonitorsOfProcess: aProcess 
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16574
    ^ (AcquiredMonitorsPerProcess at: aProcess
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16575
        ifAbsent: [
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16576
            | monitors |
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16577
            monitors := OrderedCollection new.
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16578
            AcquiredMonitorsPerProcess at: aProcess put: monitors.
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16579
            monitors
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16580
        ]) 
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16581
            copy.
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16582
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16583
    "Created: / 17-11-2011 / 19:23:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16584
!
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16585
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16586
copyAcquiredMonitorsOfProcessAt: aProcess 
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16587
    "does not create empty collection like enteredMonitorsOfProcess"
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16588
    
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16589
    ^ (AcquiredMonitorsPerProcess at: aProcess ifAbsent: nil) copy.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16590
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16591
    "Created: / 08-01-1999 / 14:02:02 / cg"
1123
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16592
    "Created: / 17-11-2011 / 19:23:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16593
!
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16594
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16595
copyEnteredMonitorsOfProcess: aProcess 
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16596
    ^ (EnteredMonitorsPerProcess at: aProcess
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16597
        ifAbsent: [
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16598
            | monitors |
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16599
            monitors := OrderedCollection new.
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16600
            EnteredMonitorsPerProcess at: aProcess put: monitors.
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16601
            monitors
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16602
        ]) 
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16603
            copy.
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16604
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16605
    "Created: / 08-01-1999 / 14:02:02 / cg"
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16606
    "Created: / 17-11-2011 / 19:22:13 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16607
!
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16608
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16609
copyEnteredMonitorsOfProcessAt: aProcess 
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16610
    "does not create empty collection like enteredMonitorsOfProcess"
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16611
    
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16612
    ^ (EnteredMonitorsPerProcess at: aProcess ifAbsent: nil) copy.
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16613
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16614
    "Created: / 08-01-1999 / 14:02:02 / cg"
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16615
    "Created: / 17-11-2011 / 19:22:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16616
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16617
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16618
countAcquiredMonitorsOfProcess: aProcess 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16619
    | acquiredMonitors |
1123
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16620
    acquiredMonitors := self acquiredMonitorsOfProcessAt: aProcess.
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16621
    ^ acquiredMonitors isNil ifTrue: [ 0 ] ifFalse: [ acquiredMonitors size ].
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16622
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16623
    "Created: / 17-11-2011 / 18:23:49 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16624
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16625
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16626
countEnteredMonitorsOfProcess: aProcess 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16627
    | enteredMonitors |
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16628
    enteredMonitors := self enteredMonitorsOfProcessAt: aProcess.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16629
    ^ enteredMonitors isNil ifTrue: [ 0 ] ifFalse: [ enteredMonitors size ].
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16630
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16631
    "Created: / 17-11-2011 / 17:14:14 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16632
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16633
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16634
enterMonitor: obj ofProcess: aProcess 
1145
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16635
    "registers itself as one of processes wanting monitor and then tries to acquire it."
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16636
    
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16637
    | mon |
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16638
    self enteredMonitorsOf: aProcess add: obj.
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16639
    mon := JavaVM monitorFor: obj.
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16640
    self assert: mon notNil.
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16641
    MonitorTrace ifTrue: [
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16642
        Logger 
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16643
            log: ('entering monitor %1 owned by thread: %2' 
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16644
                    bindWith: (self monitorFriendlyPrintStringOf: obj)
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16645
                    with: aProcess name)
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16646
            severity: #debug
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16647
            facility: #JVM.
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16648
    ].
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16649
    mon enter.
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16650
    self assert: (mon isOwnedBy: aProcess).
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16651
    self acquiredMonitorsOf: aProcess add: obj.
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16652
    self assert: ((self enteredMonitorsOfProcessAt: aProcess) includes: obj).
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16653
        self assert: ((self acquiredMonitorsOfProcessAt: aProcess) includes: obj).
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16654
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16655
    "Created: / 17-11-2011 / 19:03:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16656
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16657
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16658
enteredMonitorsOf: aProcess add: anyObject 
1125
hlopkmar
parents: 1124
diff changeset
 16659
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16660
    ^ (self enteredMonitorsOfProcess: aProcess) add: anyObject.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16661
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16662
    "Modified: / 08-01-1999 / 14:02:15 / cg"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16663
    "Created: / 17-11-2011 / 16:25:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16664
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16665
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16666
enteredMonitorsOf: aProcess remove: anyObject 
1124
91d9f1846a79 on the way to working monitors
hlopkmar
parents: 1123
diff changeset
 16667
    self 
91d9f1846a79 on the way to working monitors
hlopkmar
parents: 1123
diff changeset
 16668
        assert: ((self enteredMonitorsOfProcess: aProcess) includes: anyObject).
1125
hlopkmar
parents: 1124
diff changeset
 16669
         self 
hlopkmar
parents: 1124
diff changeset
 16670
                 assert: ((self enteredMonitorsOfProcess: aProcess) last == anyObject).
hlopkmar
parents: 1124
diff changeset
 16671
    (self enteredMonitorsOfProcess: aProcess) removeLast.
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16672
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16673
    "Modified: / 08-01-1999 / 14:02:15 / cg"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16674
    "Created: / 17-11-2011 / 18:40:45 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16675
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16676
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16677
enteredMonitorsOfProcess: aProcess 
1123
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16678
    ^ EnteredMonitorsPerProcess at: aProcess
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16679
        ifAbsent: [
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16680
            | monitors |
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16681
            monitors := OrderedCollection new.
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16682
            EnteredMonitorsPerProcess at: aProcess put: monitors.
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16683
            monitors
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16684
        ]
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16685
            .
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16686
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16687
    "Created: / 08-01-1999 / 14:02:02 / cg"
1123
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16688
    "Modified: / 17-11-2011 / 19:22:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16689
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16690
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16691
enteredMonitorsOfProcessAt: aProcess 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16692
    "does not create empty collection like enteredMonitorsOfProcess"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16693
    
1123
c1b099703294 stupid me
hlopkmar
parents: 1122
diff changeset
 16694
    ^ EnteredMonitorsPerProcess at: aProcess ifAbsent: nil.
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16695
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16696
    "Created: / 08-01-1999 / 14:02:02 / cg"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16697
    "Created: / 16-11-2011 / 15:37:58 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16698
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16699
1220
d96b97c1b4a5 many mauve tests will be happier after this fix :) corrected releasing monitors after test
hlopkmar
parents: 1217
diff changeset
 16700
exitOwnedMonitorsOfProcess
d96b97c1b4a5 many mauve tests will be happier after this fix :) corrected releasing monitors after test
hlopkmar
parents: 1217
diff changeset
 16701
   |thisProcess monitors|
d96b97c1b4a5 many mauve tests will be happier after this fix :) corrected releasing monitors after test
hlopkmar
parents: 1217
diff changeset
 16702
   thisProcess := Processor activeProcess.
d96b97c1b4a5 many mauve tests will be happier after this fix :) corrected releasing monitors after test
hlopkmar
parents: 1217
diff changeset
 16703
   monitors := self acquiredMonitorsOfProcess: thisProcess.
d96b97c1b4a5 many mauve tests will be happier after this fix :) corrected releasing monitors after test
hlopkmar
parents: 1217
diff changeset
 16704
   monitors do: [:each | self assert: (each isOwnedBy:thisProcess).
d96b97c1b4a5 many mauve tests will be happier after this fix :) corrected releasing monitors after test
hlopkmar
parents: 1217
diff changeset
 16705
    each exit.
d96b97c1b4a5 many mauve tests will be happier after this fix :) corrected releasing monitors after test
hlopkmar
parents: 1217
diff changeset
 16706
    ]
d96b97c1b4a5 many mauve tests will be happier after this fix :) corrected releasing monitors after test
hlopkmar
parents: 1217
diff changeset
 16707
d96b97c1b4a5 many mauve tests will be happier after this fix :) corrected releasing monitors after test
hlopkmar
parents: 1217
diff changeset
 16708
    "Created: / 05-12-2011 / 21:15:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
d96b97c1b4a5 many mauve tests will be happier after this fix :) corrected releasing monitors after test
hlopkmar
parents: 1217
diff changeset
 16709
!
d96b97c1b4a5 many mauve tests will be happier after this fix :) corrected releasing monitors after test
hlopkmar
parents: 1217
diff changeset
 16710
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16711
has: aProcess enteredMonitorFor: anyObject 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16712
    ^ (self enteredMonitorsOfProcess: aProcess) includes: anyObject.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16713
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16714
    "Created: / 17-11-2011 / 16:28:44 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16715
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16716
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16717
hasAcquiredMonitorsOfProcess: aProcess 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16718
   | acquiredMonitors |
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16719
   acquiredMonitors := self acquiredMonitorsOfProcessAt: aProcess.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16720
   ^ acquiredMonitors isNil 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16721
   ifTrue: [ false ]
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16722
           ifFalse: [ acquiredMonitors size > 0 ].
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16723
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16724
    "Created: / 17-11-2011 / 17:07:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16725
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16726
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16727
hasEnteredMonitorsOfProcess: aProcess 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16728
   | enteredMonitors |
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16729
   enteredMonitors := self enteredMonitorsOfProcessAt: aProcess.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16730
   ^ enteredMonitors isNil ifTrue: [ false ] ifFalse: [ enteredMonitors size > 0].
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16731
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16732
    "Created: / 17-11-2011 / 17:09:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16733
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16734
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16735
leaveMonitor: obj ofProcess: aProcess 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16736
    "Leave* (release and never come back, exit) monitor owned by given project.     
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16737
     *leave is the word used by jvm spec"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16738
    
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16739
    | mon |
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16740
    mon := JavaVM monitorFor: obj.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16741
    self assert: mon notNil.
1201
326987885b9b one step closer to mauve thread stop test
hlopkmar
parents: 1200
diff changeset
 16742
    "/self assert: (mon isOwnedBy: aProcess).
1129
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16743
    MonitorTrace ifTrue: [Logger 
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16744
        log: ('leaving monitor %1 owned by thread: %2' 
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16745
                bindWith: (self monitorFriendlyPrintStringOf: obj)
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16746
                with: aProcess name)
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16747
        severity: #debug
1129
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16748
        facility: #JVM.].
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16749
    mon exit.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16750
    self acquiredMonitorsOf: aProcess remove: obj.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16751
    self enteredMonitorsOf: aProcess remove: obj.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16752
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16753
    "Created: / 17-11-2011 / 18:46:33 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16754
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16755
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16756
leaveMonitorsOfProcess: aProcess 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16757
    "Leave* (release and never come back, exit) all monitors owned by given project.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16758
     Called when cleaning up after process death or when handling smalltalk (non-java) exceptions
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16759
     (such an exception in native method)
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16760
     *leave is the word used by jvm spec"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16761
    
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16762
    | monitors |
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16763
    monitors := EnteredMonitorsPerProcess at: aProcess ifAbsent: nil.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16764
    monitors notNil ifTrue: [
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16765
        monitors do: [
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16766
            :obj | 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16767
            | mon |
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16768
            mon := JavaVM monitorFor: obj.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16769
            mon notNil ifTrue: [
1145
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16770
                (mon isOwnedBy: aProcess) ifTrue: [
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16771
                    Logger 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16772
                        log: ('leaving monitor owned by dying thread: ' , aProcess name)
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16773
                        severity: #info
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16774
                        facility: #JVM.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16775
                    self breakPoint: #jv.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16776
                    mon exit
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16777
                ].
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16778
            ].
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16779
        ].
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16780
        EnteredMonitorsPerProcess removeKey: aProcess.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16781
    ].
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16782
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16783
    "Created: / 17-11-2011 / 16:51:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16784
!
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16785
1094
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16786
monitorEnter: someObject in: aJavaContext 
1125
hlopkmar
parents: 1124
diff changeset
 16787
    | thisProcess |
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 16788
    self assert: (aJavaContext isJavaContext).
1094
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16789
    someObject isNil ifTrue: [
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16790
        self throwNullPointerException.
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 16791
        self breakPoint: #mh.
1094
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16792
        ^ self
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16793
    ].
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16794
    thisProcess := Processor activeProcess.
1129
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16795
    MonitorTrace ifTrue: [
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16796
        Logger 
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16797
            log: ('MONENTER: entering monitor for %1 in %2' 
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16798
                    bindWith: (self monitorFriendlyPrintStringOf: someObject)
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16799
                    with: thisProcess name)
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16800
            severity: #debug
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16801
            facility: #JVM.
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16802
    ].
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16803
    self enterMonitor: someObject ofProcess: thisProcess.
1094
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16804
    aJavaContext addMonitor: someObject.
1129
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16805
    MonitorTrace ifTrue: [Logger 
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16806
        log: 'MONENTER: monitor entered in ' , thisProcess name
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16807
        severity: #debug
1129
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16808
        facility: #JVM.].
1094
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16809
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16810
    "Created: / 08-11-2011 / 15:15:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16811
!
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16812
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16813
monitorExit: someObject in: aJavaContext 
1125
hlopkmar
parents: 1124
diff changeset
 16814
    | thisProcess |
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 16815
    self assert: (aJavaContext isJavaContext).
1094
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16816
    someObject isNil ifTrue: [
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16817
        self throwNullPointerException.
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 16818
        self breakPoint: #mh.
1094
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16819
        ^ self
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16820
    ].
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 16821
    thisProcess := Processor activeProcess.
1129
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16822
    MonitorTrace ifTrue: [
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16823
        Logger 
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16824
            log: ('MONEXIT: leaving monitor for %1 in %2' 
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16825
                    bindWith: (self monitorFriendlyPrintStringOf: someObject)
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16826
                    with: thisProcess name) , thisProcess name
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16827
            severity: #info
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16828
            facility: #JVM.
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16829
    ].
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16830
    self leaveMonitor: someObject ofProcess: thisProcess.
1102
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
 16831
    aJavaContext removeMonitor: someObject.
1129
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16832
    MonitorTrace ifTrue: [Logger 
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16833
        log: 'MONEXIT: monitor left in ' , thisProcess name
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 16834
        severity: #info
1129
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16835
        facility: #JVM.].
1094
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16836
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16837
    "Created: / 08-11-2011 / 15:17:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16838
!
68b154263d74 fixes in monitors, still not working
hlopkmar
parents: 1093
diff changeset
 16839
1129
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16840
monitorExit: someObject in: aJavaContext ifOwnedBy: aProcess 
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16841
    | monitor |
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16842
    monitor := self monitorFor: someObject.
1145
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16843
    (monitor isOwnedBy: aProcess) ifTrue: [
1129
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16844
        self monitorExit: someObject in: aJavaContext
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16845
    ] ifFalse: [
1145
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16846
        MonitorTrace ifTrue: [
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16847
            Logger 
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16848
                log: ('%1 trying to exit monitor for %2, but it does not own it. Ignoring' 
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16849
                        bindWith: aProcess name
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16850
                        with: (self monitorFriendlyPrintStringOf: someObject))
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16851
                severity: #debug
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16852
                facility: #JVM
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16853
        ]
1129
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 16854
    ].
1127
d48072ada374 next time I will try to keep my excitement low and will think more :) second try
hlopkmar
parents: 1126
diff changeset
 16855
d48072ada374 next time I will try to keep my excitement low and will think more :) second try
hlopkmar
parents: 1126
diff changeset
 16856
    "Created: / 17-11-2011 / 21:17:57 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
d48072ada374 next time I will try to keep my excitement low and will think more :) second try
hlopkmar
parents: 1126
diff changeset
 16857
!
d48072ada374 next time I will try to keep my excitement low and will think more :) second try
hlopkmar
parents: 1126
diff changeset
 16858
1145
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16859
monitorFor: someObject 
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16860
    | mon |
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16861
    LockTableAccess 
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16862
        critical: [
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16863
            mon := LockTable at: someObject ifAbsent: nil.
1194
9f910257b6e8 from now on joining thread does not block after threads death
hlopkmar
parents: 1193
diff changeset
 16864
            mon isNil ifTrue: [ LockTable at: someObject put: (mon := JavaMonitor for: someObject) ]
1145
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16865
        ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16866
    ^ mon
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16867
1145
8728f5373a48 end of the old monitors has come, new monitors plugged in, not yet bugfree I'm sure
hlopkmar
parents: 1142
diff changeset
 16868
    "Created: / 02-01-1998 / 19:01:52 / cg"
1194
9f910257b6e8 from now on joining thread does not block after threads death
hlopkmar
parents: 1193
diff changeset
 16869
    "Modified: / 30-11-2011 / 20:40:26 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16870
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16871
1125
hlopkmar
parents: 1124
diff changeset
 16872
monitorFriendlyPrintStringOf: someObject 
hlopkmar
parents: 1124
diff changeset
 16873
    | objString |
hlopkmar
parents: 1124
diff changeset
 16874
    someObject isJavaClass ifTrue: [ objString := someObject name ] ifFalse: [
hlopkmar
parents: 1124
diff changeset
 16875
        objString := someObject class name , '@' 
hlopkmar
parents: 1124
diff changeset
 16876
                    , someObject identityHash printString.
hlopkmar
parents: 1124
diff changeset
 16877
    ].
hlopkmar
parents: 1124
diff changeset
 16878
    ^ objString
hlopkmar
parents: 1124
diff changeset
 16879
!
hlopkmar
parents: 1124
diff changeset
 16880
1169
8f727dc66647 monitor fix.. many to come :)
hlopkmar
parents: 1159
diff changeset
 16881
notify: handle 
1177
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16882
    | mon  thisProcess |
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16883
    thisProcess := Processor activeProcess.
1169
8f727dc66647 monitor fix.. many to come :)
hlopkmar
parents: 1159
diff changeset
 16884
    mon := self monitorFor: handle.
1177
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16885
    (mon isOwnedBy: thisProcess) ifFalse: [
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16886
        self 
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16887
            throwIllegalMonitorStateException: 'monitor was not owned when called notify'
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16888
    ].
1169
8f727dc66647 monitor fix.. many to come :)
hlopkmar
parents: 1159
diff changeset
 16889
    mon notify.
8f727dc66647 monitor fix.. many to come :)
hlopkmar
parents: 1159
diff changeset
 16890
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16891
    "Created: / 22-11-2011 / 13:26:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16892
!
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16893
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16894
notifyAll: handle 
1177
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16895
    | mon  thisProcess |
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16896
    thisProcess := Processor activeProcess.
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16897
    mon := self monitorFor: handle.
1177
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16898
    (mon isOwnedBy: thisProcess) ifFalse: [
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16899
        self 
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16900
            throwIllegalMonitorStateException: 'monitor was not owned when called notify'
c41be1c0ed55 monitor fixes
hlopkmar
parents: 1175
diff changeset
 16901
    ].
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16902
    mon notifyAll.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16903
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16904
    "Created: / 22-11-2011 / 13:26:30 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16905
!
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16906
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16907
releaseMonitor: obj ofProcess: aProcess 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16908
    "Release* (let go and wait for it again) monitor owned by given project.     
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16909
     *word used by jvm spec"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16910
    
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16911
    | mon |
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16912
    mon := JavaVM monitorFor: obj.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16913
    self assert: mon notNil.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16914
    self assert: (mon isOwnedBy: aProcess).
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16915
    MonitorTrace ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16916
        Logger 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16917
            log: ('releasing monitor %1 owned by thread: %2' 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16918
                    bindWith: (self monitorFriendlyPrintStringOf: obj)
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16919
                    with: aProcess name)
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16920
            severity: #debug
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16921
            facility: #JVM.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16922
    ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16923
    mon release.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16924
    self acquiredMonitorsOf: aProcess remove: obj.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16925
    self assert: ((self enteredMonitorsOfProcessAt: aProcess) includes: obj).
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16926
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16927
    "Created: / 17-11-2011 / 18:51:00 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16928
!
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16929
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16930
releaseMonitorsOfProcess
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16931
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16932
    self releaseMonitorsOfProcess: Processor activeProcess
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16933
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16934
    "Created: / 04-11-2011 / 22:15:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16935
!
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16936
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16937
releaseMonitorsOfProcess: aProcess 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16938
    "Releases* all monitors owned by given project.
1220
d96b97c1b4a5 many mauve tests will be happier after this fix :) corrected releasing monitors after test
hlopkmar
parents: 1217
diff changeset
 16939
     Monitor can be acquired again, (aProcess going into WAIT)
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16940
     *word used by jvm spec"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16941
    
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16942
    | monitors |
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16943
    monitors := self copyAcquiredMonitorsOfProcessAt: aProcess.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16944
    monitors notNil ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16945
        monitors do: [:obj | self releaseMonitor: obj ofProcess: aProcess. ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16946
    ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16947
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16948
    "Created: / 04-11-2011 / 22:15:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16949
    "Modified: / 17-11-2011 / 21:29:17 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1220
d96b97c1b4a5 many mauve tests will be happier after this fix :) corrected releasing monitors after test
hlopkmar
parents: 1217
diff changeset
 16950
    "Modified (comment): / 05-12-2011 / 21:13:29 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16951
!
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16952
1183
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16953
sleepForTimeout: tmo state: state 
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16954
    "wait"
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16955
    
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16956
    | thisProcess |
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16957
    thisProcess := Processor activeProcess.
1192
525a3aeb0dcf sleep mauve test passes
hlopkmar
parents: 1190
diff changeset
 16958
    thisProcess isInterrupted ifTrue: [
525a3aeb0dcf sleep mauve test passes
hlopkmar
parents: 1190
diff changeset
 16959
        thisProcess clearInterrupted.
525a3aeb0dcf sleep mauve test passes
hlopkmar
parents: 1190
diff changeset
 16960
        self 
525a3aeb0dcf sleep mauve test passes
hlopkmar
parents: 1190
diff changeset
 16961
                    throwInterruptedException: 'process was interrupted before/during sleep !!?'
525a3aeb0dcf sleep mauve test passes
hlopkmar
parents: 1190
diff changeset
 16962
    ].
525a3aeb0dcf sleep mauve test passes
hlopkmar
parents: 1190
diff changeset
 16963
    thisProcess state: state.
1190
00e22b8b2652 interrupts work much better
hlopkmar
parents: 1189
diff changeset
 16964
    (Delay forMilliseconds: tmo) waitWithState: state.
1183
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16965
    thisProcess isInterrupted ifTrue: [
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16966
        thisProcess clearInterrupted.
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16967
        self 
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16968
            throwInterruptedException: 'process was interrupted before/during sleep !!?'
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16969
    ].
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16970
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16971
    "Created: / 30-12-1998 / 19:19:35 / cg"
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16972
    "Modified: / 08-01-1999 / 17:29:24 / cg"
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16973
    "Created: / 30-11-2011 / 11:04:27 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16974
!
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 16975
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16976
unwindHandlerForJavaContext: aJavaContext 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16977
    "given a context which has been marked for unwind,
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16978
     retrieve the handler block. This method is called when ST
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16979
     exception raises and stack is unwinding. JavaClass instance
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16980
     has an opportunity to clean up monitors"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16981
    
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16982
    ^ [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16983
    | thisProcess |
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16984
    MonitorTrace ifTrue: [Logger 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16985
        log: ('java context is about to unwind, force-exit entered monitors')
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16986
        severity: #info
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16987
        facility: #JVM.].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16988
    thisProcess := Processor activeProcess.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16989
    aJavaContext 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16990
        acquiredMonitorsDo: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16991
            :each | 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16992
            JavaVM 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16993
                monitorExit: each
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16994
                in: aJavaContext
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16995
                ifOwnedBy: thisProcess.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16996
        ]
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16997
].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16998
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 16999
    "Created: / 08-11-2011 / 12:30:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17000
    "Modified: / 09-11-2011 / 22:25:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17001
    "Modified: / 17-11-2011 / 21:33:17 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17002
!
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17003
1179
26fa6829e4d7 small changes is monitors + more logging
hlopkmar
parents: 1177
diff changeset
 17004
waitOn: handle forTimeout: tmo state: state 
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17005
    "wait"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17006
    
1179
26fa6829e4d7 small changes is monitors + more logging
hlopkmar
parents: 1177
diff changeset
 17007
    | wasBlocked  thisProcess  mon |
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17008
    thisProcess := Processor activeProcess.
1193
6bf32b0f6fad fixing wait the same way as fixed sleep (interrupts)
hlopkmar
parents: 1192
diff changeset
 17009
    thisProcess isInterrupted ifTrue: [
6bf32b0f6fad fixing wait the same way as fixed sleep (interrupts)
hlopkmar
parents: 1192
diff changeset
 17010
    thisProcess clearInterrupted.
6bf32b0f6fad fixing wait the same way as fixed sleep (interrupts)
hlopkmar
parents: 1192
diff changeset
 17011
    self 
6bf32b0f6fad fixing wait the same way as fixed sleep (interrupts)
hlopkmar
parents: 1192
diff changeset
 17012
    throwInterruptedException: 'process was interrupted before/during wait !!?'
6bf32b0f6fad fixing wait the same way as fixed sleep (interrupts)
hlopkmar
parents: 1192
diff changeset
 17013
        ].
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17014
    wasBlocked := OperatingSystem blockInterrupts.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17015
    mon := self monitorFor: handle.
1183
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 17016
    (mon isOwnedBy: thisProcess) ifFalse: [
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 17017
        self 
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 17018
            throwIllegalMonitorStateException: 'monitor was not owned on wait by ' 
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 17019
                    , thisProcess printString
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 17020
    ].
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17021
    state notNil ifTrue: [ thisProcess state: state ].
1179
26fa6829e4d7 small changes is monitors + more logging
hlopkmar
parents: 1177
diff changeset
 17022
    mon waitForMilliseconds: tmo.
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17023
    wasBlocked ifFalse: [ OperatingSystem unblockInterrupts ].
1183
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 17024
    thisProcess isInterrupted ifTrue: [
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 17025
        thisProcess clearInterrupted.
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 17026
        self 
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 17027
            throwInterruptedException: 'process was interrupted before/during wait !!?'
4db27693ce84 interrupt and sleep fixes
hlopkmar
parents: 1179
diff changeset
 17028
    ].
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17029
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17030
    "Created: / 30-12-1998 / 19:19:35 / cg"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17031
    "Modified: / 08-01-1999 / 17:29:24 / cg"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17032
    "Created: / 22-11-2011 / 13:20:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17033
! !
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17034
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17035
!JavaVM class methodsFor:'queries'!
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17036
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17037
booted
1209
vranyj1
parents: 1205
diff changeset
 17038
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17039
    | jVM |
1209
vranyj1
parents: 1205
diff changeset
 17040
vranyj1
parents: 1205
diff changeset
 17041
    "/Slightly faster variant of the code below
vranyj1
parents: 1205
diff changeset
 17042
    ^SystemClassLoader notNil and:[
vranyj1
parents: 1205
diff changeset
 17043
        jVM := JavaVM classNamed: 'sun.misc.VM'.
vranyj1
parents: 1205
diff changeset
 17044
        jVM notNil and: [ (jVM instVarNamed: #booted) == 1 ]
vranyj1
parents: 1205
diff changeset
 17045
    ].
vranyj1
parents: 1205
diff changeset
 17046
vranyj1
parents: 1205
diff changeset
 17047
"/    jVM := JavaVM classNamed: 'sun.misc.VM'.
vranyj1
parents: 1205
diff changeset
 17048
"/    ^ jVM notNil and: [ (jVM instVarNamed: #booted) == 1 ] and: [self systemClassLoader notNil].
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17049
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17050
    "
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17051
     JavaVM booted"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17052
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17053
    "Created: / 08-08-2011 / 10:04:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17054
    "Modified: / 02-11-2011 / 22:08:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1209
vranyj1
parents: 1205
diff changeset
 17055
    "Modified: / 04-12-2011 / 10:32:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17056
! !
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17057
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17058
!JavaVM class methodsFor:'semaphores & monitors'!
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 17059
1142
1a1ce9fd0a16 java monitors (not plugged in yet)
hlopkmar
parents: 1138
diff changeset
 17060
releaseAndSignalForAllSemaphoreFor: someObject 
1a1ce9fd0a16 java monitors (not plugged in yet)
hlopkmar
parents: 1138
diff changeset
 17061
    | sema |
1a1ce9fd0a16 java monitors (not plugged in yet)
hlopkmar
parents: 1138
diff changeset
 17062
    WaitTableAccess 
1a1ce9fd0a16 java monitors (not plugged in yet)
hlopkmar
parents: 1138
diff changeset
 17063
        critical: [
1a1ce9fd0a16 java monitors (not plugged in yet)
hlopkmar
parents: 1138
diff changeset
 17064
            sema := WaitTable at: someObject ifAbsent: nil.
1a1ce9fd0a16 java monitors (not plugged in yet)
hlopkmar
parents: 1138
diff changeset
 17065
        ].
1a1ce9fd0a16 java monitors (not plugged in yet)
hlopkmar
parents: 1138
diff changeset
 17066
    sema notNil ifTrue: [ sema signalForAll ]
1a1ce9fd0a16 java monitors (not plugged in yet)
hlopkmar
parents: 1138
diff changeset
 17067
1a1ce9fd0a16 java monitors (not plugged in yet)
hlopkmar
parents: 1138
diff changeset
 17068
    "Created: / 02-01-1998 / 18:21:51 / cg"
1a1ce9fd0a16 java monitors (not plugged in yet)
hlopkmar
parents: 1138
diff changeset
 17069
    "Modified: / 03-02-1998 / 16:11:58 / cg"
1a1ce9fd0a16 java monitors (not plugged in yet)
hlopkmar
parents: 1138
diff changeset
 17070
    "Modified (comment): / 20-11-2011 / 12:33:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17071
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17072
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17073
releaseAndSignalSemaphoreFor:someObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17074
    |sema|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17075
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17076
    WaitTableAccess critical:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17077
	sema := WaitTable at:someObject ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17078
"/        sema notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17079
"/            WaitTable removeKey:someObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17080
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17081
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17082
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17083
    sema notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17084
	sema signal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17085
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17086
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17087
    "Created: / 2.1.1998 / 18:20:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17088
    "Modified: / 3.2.1998 / 16:11:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17089
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17090
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17091
releaseSemaphoreFor:someObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17092
    WaitTableAccess critical:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17093
	WaitTable removeKey:someObject ifAbsent:nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17094
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17095
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17096
    "Created: / 2.1.1998 / 18:17:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17097
    "Modified: / 2.1.1998 / 21:52:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17098
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17099
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17100
semaphoreFor:someObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17101
    |sema|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17102
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17103
    WaitTableAccess critical:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17104
	sema := WaitTable at:someObject ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17105
	sema isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17106
	    WaitTable at:someObject put:(sema := Semaphore new)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17107
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17108
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17109
    ^ sema
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17110
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17111
    "Created: / 2.1.1998 / 18:15:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17112
    "Modified: / 2.1.1998 / 18:20:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17113
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17114
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17115
waitFor: sema state: pState timeOut: tmo 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17116
    "wait"
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17117
    
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 17118
    | wasBlocked  thisProcess  releasedCount  acquiredCount |
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17119
    thisProcess := Processor activeProcess.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17120
    wasBlocked := OperatingSystem blockInterrupts.
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 17121
    releasedCount := self countAcquiredMonitorsOfProcess: thisProcess.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 17122
    (self hasAcquiredMonitorsOfProcess: thisProcess) ifTrue: [
1129
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 17123
        MonitorTrace ifTrue: [
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 17124
            Logger 
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 17125
                log: thisProcess name , ' going into WAIT - releasing ' 
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 17126
                        , (self countAcquiredMonitorsOfProcess: thisProcess) printString 
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 17127
                            , ' monitors'
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 17128
                severity: #debug
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 17129
                facility: #JVM.
085eb3d2d932 logging monitor stuff only if MonitorTrace = true
hlopkmar
parents: 1128
diff changeset
 17130
        ].
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 17131
        self releaseMonitorsOfProcess: thisProcess.
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17132
    ].
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17133
    wasBlocked ifFalse: [ OperatingSystem unblockInterrupts ].
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17134
    pState notNil ifTrue: [ thisProcess state: pState ].
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17135
    sema isNil ifTrue: [ Delay waitForMilliseconds: tmo ] ifFalse: [
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17136
        (tmo isNil or: [ tmo = 0 ]) ifTrue: [ sema wait. ] ifFalse: [
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17137
            sema waitWithTimeout: tmo / 1000.
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17138
        ].
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17139
    ].
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17140
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17141
    "/ re-enter monitors.
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17142
    
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 17143
    (self hasEnteredMonitorsOfProcess: thisProcess) ifTrue: [
1023
6eea44b0da09 JavaVM: Few fixes in native methods
vranyj1
parents: 1022
diff changeset
 17144
        wasBlocked := OperatingSystem blockInterrupts.
1122
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 17145
        Logger 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 17146
            log: thisProcess name , ' has been notified - trying to acquire ' 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 17147
                    , (self countEnteredMonitorsOfProcess: thisProcess) printString 
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 17148
                        , ' monitors'
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 17149
            severity: #debug
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 17150
            facility: #JVM.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 17151
        self acquireMonitorsOfProcess: thisProcess.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 17152
        acquiredCount := self countAcquiredMonitorsOfProcess: thisProcess.
2f8e947cfda2 in-the-middle-of-work commit
hlopkmar
parents: 1119
diff changeset
 17153
        self assert: acquiredCount = releasedCount.
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17154
        wasBlocked ifFalse: [ OperatingSystem unblockInterrupts ].
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17155
    ].
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17156
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17157
    "Created: / 30-12-1998 / 19:19:35 / cg"
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17158
    "Modified: / 08-01-1999 / 17:29:24 / cg"
1142
1a1ce9fd0a16 java monitors (not plugged in yet)
hlopkmar
parents: 1138
diff changeset
 17159
    "Modified: / 20-11-2011 / 12:36:47 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17160
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17161
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17162
!JavaVM class methodsFor:'vm support'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17163
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17164
_ANEWARRAY2:classRef _:size 
801
80c511097f3c added JavaVM class>>_ANEWARRAY2:_: for new resolving
hlopkmar
parents: 772
diff changeset
 17165
    "vm helper method for new resolving - creates new array of class identified by classRef"
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17166
    
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17167
    |javaClass|
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17168
1151
vranyj1
parents: 1150
diff changeset
 17169
    size <  0 ifTrue:[
vranyj1
parents: 1150
diff changeset
 17170
        self throwExceptionClassName:'java.lang.NegativeArraySizeException'
vranyj1
parents: 1150
diff changeset
 17171
                         withMessage:'negative array size not allowed'.
vranyj1
parents: 1150
diff changeset
 17172
        ^nil
vranyj1
parents: 1150
diff changeset
 17173
    ].
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17174
    classRef ifNil:[ self halt:'cant create array from nil ref' ].
801
80c511097f3c added JavaVM class>>_ANEWARRAY2:_: for new resolving
hlopkmar
parents: 772
diff changeset
 17175
    javaClass := classRef resolve.
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17176
    javaClass ifNil:[ self halt:'cant create array from nil javaClass' ].
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17177
    self assert:javaClass javaArrayClass isJavaArrayClass. 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17178
    ^ javaClass javaArrayClass new:size
801
80c511097f3c added JavaVM class>>_ANEWARRAY2:_: for new resolving
hlopkmar
parents: 772
diff changeset
 17179
80c511097f3c added JavaVM class>>_ANEWARRAY2:_: for new resolving
hlopkmar
parents: 772
diff changeset
 17180
    "Created: / 18-05-2011 / 21:04:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1151
vranyj1
parents: 1150
diff changeset
 17181
    "Modified: / 22-11-2011 / 09:46:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17182
!
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17183
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17184
_ANEWARRAY:classRef _:size 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17185
    |ref|
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17186
1151
vranyj1
parents: 1150
diff changeset
 17187
    size <  0 ifTrue:[
vranyj1
parents: 1150
diff changeset
 17188
        self throwExceptionClassName:'java.lang.NegativeArraySizeException'
vranyj1
parents: 1150
diff changeset
 17189
                         withMessage:'negative array size not allowed'.
vranyj1
parents: 1150
diff changeset
 17190
        ^nil
vranyj1
parents: 1150
diff changeset
 17191
    ].
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 17192
    ref := classRef.
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17193
    ref isUnresolved ifTrue:[ ref := ref javaClass ].
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17194
    self assert:ref javaArrayClass isJavaArrayClass.
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17195
    ^ ref javaArrayClass new:size
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17196
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17197
    "Created: / 17-12-2010 / 14:28:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1151
vranyj1
parents: 1150
diff changeset
 17198
    "Modified: / 22-11-2011 / 09:46:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17199
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17200
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17201
_ARRAYLENGTH:arr
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17202
    arr isNil ifTrue:[
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 17203
        "/self halt:'should not happen'.
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 17204
        self throwNullPointerException.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17205
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17206
    ^ arr size
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17207
824
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 17208
    "Created: / 08-01-1999 / 14:38:27 / cg"
26e719a7e88c Few fixes and native methods
vranyj1
parents: 804
diff changeset
 17209
    "Modified: / 31-05-2011 / 10:09:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17210
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17211
1102
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
 17212
_ATHROW:aJavaException
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
 17213
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17214
    <resource: #skipInDebuggersWalkBack>
1102
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
 17215
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
 17216
    aJavaException isNil ifTrue:[
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
 17217
        self halt:'cannot happen'
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
 17218
    ].
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
 17219
    self throwException:aJavaException
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17220
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17221
    "Created: / 08-01-1999 / 14:15:36 / cg"
1102
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
 17222
    "Modified: / 08-11-2011 / 16:32:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
df54d5b34c6b i broke something important in last commit - quickly reverting back :)
hlopkmar
parents: 1101
diff changeset
 17223
    "Modified: / 08-11-2011 / 22:16:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17224
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17225
802
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17226
_CHECKCAST2: object _: aJavaClassRef 
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17227
    "Trampouline for unhandled cases ..."
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17228
    
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17229
    | class |
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17230
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17231
    aJavaClassRef isJavaRef ifTrue: [ class := aJavaClassRef resolve ] ifFalse: [
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17232
        self halt: 'I expected classRefs only - maybe I was wrong'
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17233
    ].
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17234
    (object isNil or: [ (self canCast: object class to: class) not ]) ifTrue: [
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17235
        self breakPoint: #mh.
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17236
        self throwClassCastException.
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17237
        ^ false
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17238
    ].
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17239
        
802
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17240
    ^ true.
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17241
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17242
    "Created: / 19-05-2011 / 10:12:23 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
912
e651488f5741 Many fixes in reflection, expecially for generic types support
vranyj1
parents: 911
diff changeset
 17243
    "Modified: / 13-08-2011 / 01:33:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
802
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17244
!
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17245
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17246
_CHECKCAST: object _: classOrClassRef 
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 17247
    "Trampouline for unhandled cases ..."
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17248
    
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 17249
    | class |
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 17250
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17251
    self breakPoint: #mh.
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 17252
    class := classOrClassRef javaClass.
1027
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17253
     "
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17254
     Java VM Spec, 3rd edition, p 280:
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17255
     
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17256
     If objectref is null, the checkcast instruction throws a ClassCastException.
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17257
    " "object isNil"
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17258
    (false or: [ (self canCast: object class to: class) not ]) ifTrue: [
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17259
        self throwClassCastException.
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17260
        ^ false
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17261
    ].
43dc608e14aa another dose of fixes, still not able to boot javavm
hlopkmar
parents: 1026
diff changeset
 17262
    ^ true
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17263
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17264
    "Created: / 08-01-1999 / 14:53:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17265
    "Modified: / 09-01-1999 / 00:45:21 / cg"
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 17266
    "Modified: / 25-04-2011 / 20:26:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17267
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17268
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17269
_D2I:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17270
    |v|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17271
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17272
    v := op1 asInteger.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17273
    v > 16r7FFFFFFF ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17274
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17275
	v := 16r7FFFFFFF
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17276
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17277
	v < 16r80000000 negated ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17278
	    self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17279
	    v := 16r80000000 negated
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17280
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17281
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17282
    ^ v
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17283
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17284
    "Modified: / 17.10.1998 / 21:55:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17285
    "Created: / 8.1.1999 / 14:47:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17286
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17287
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17288
_D2L:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17289
    |v|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17290
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17291
    v := op1 asInteger.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17292
    v > 16r7FFFFFFFFFFFFFFF ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17293
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17294
	v := 16r7FFFFFFFFFFFFFFF
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17295
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17296
	v < 16r8000000000000000 negated ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17297
	    self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17298
	    v := 16r8000000000000000 negated
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17299
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17300
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17301
    ^ v
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17302
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17303
    "Modified: / 17.10.1998 / 21:55:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17304
    "Created: / 8.1.1999 / 14:46:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17305
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17306
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17307
_DADD:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17308
    ^ op1 asFloat + op2 asFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17309
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17310
    "Created: / 8.1.1999 / 15:11:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17311
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17312
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17313
_DDIV:op1 _:op2
981
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
 17314
    ^ op1 asFloat uncheckedDivide: op2 asFloat.
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
 17315
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
 17316
    "Created: / 08-01-1999 / 15:09:10 / cg"
03ded8a12bb9 Fixes in arraycopy native
vranyj1
parents: 964
diff changeset
 17317
    "Modified: / 06-09-2011 / 19:31:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17318
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17319
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17320
_DMUL:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17321
    ^ op1 asFloat * op2 asFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17322
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17323
    "Created: / 8.1.1999 / 14:49:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17324
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17325
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17326
_DNEG:op
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17327
    ^ op asFloat negated
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17328
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17329
    "Created: / 8.1.1999 / 15:06:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17330
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17331
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17332
_DSUB:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17333
    ^ op1 asFloat - op2 asFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17334
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17335
    "Created: / 8.1.1999 / 15:10:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17336
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17337
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17338
_F2I:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17339
    ^ self _D2I:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17340
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17341
    "Created: / 8.1.1999 / 14:47:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17342
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17343
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17344
_F2L:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17345
    ^ self _D2L:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17346
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17347
    "Created: / 8.1.1999 / 14:47:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17348
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17349
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17350
_FADD:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17351
    ^ op1 asShortFloat + op2 asShortFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17352
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17353
    "Created: / 8.1.1999 / 15:11:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17354
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17355
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17356
_FDIV:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17357
    ^ op1 asShortFloat / op2 asShortFloat.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17358
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17359
    "Created: / 8.1.1999 / 15:09:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17360
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17361
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17362
_FMUL:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17363
    ^ op1 asShortFloat * op2 asShortFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17364
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17365
    "Created: / 8.1.1999 / 14:50:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17366
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17367
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17368
_FNEG:op
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17369
    ^ op asShortFloat negated
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17370
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17371
    "Created: / 8.1.1999 / 15:06:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17372
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17373
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17374
_FSUB:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17375
    ^ op1 asShortFloat - op2 asShortFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17376
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17377
    "Created: / 8.1.1999 / 15:08:17 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17378
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17379
802
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17380
_INSTANCEOF2: object _: classRef 
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17381
    |class|
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17382
    classRef isJavaRef ifFalse: [self halt: 'expected only classRefs - maybe I was wrong'].
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17383
    class := classRef resolve.
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17384
    object ifNil: [ ^ 0 ].
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17385
    ^ (self canCast: object class to: class) ifTrue: [ 1 ] ifFalse: [ 0 ].
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17386
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17387
    "Created: / 19-05-2011 / 10:14:18 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17388
!
dc61c3abc940 added _CHECKCAST2 and _INSTANCEOF2 to JavaVM
hlopkmar
parents: 801
diff changeset
 17389
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17390
_INSTANCEOF:object _:class
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17391
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17392
    object ifNil:[^0].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17393
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17394
    ^(self canCast: object class to: class)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17395
        ifTrue:[1]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17396
        ifFalse:[0]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17397
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17398
    "Created: / 08-01-1999 / 14:52:54 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17399
    "Modified: / 27-01-1999 / 20:56:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17400
    "Modified: / 25-02-2011 / 18:31:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17401
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17402
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17403
_L2D:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17404
    ^ op1 asFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17405
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17406
    "Created: / 8.1.1999 / 14:46:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17407
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17408
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17409
_L2F:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17410
    ^ op1 asShortFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17411
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17412
    "Created: / 8.1.1999 / 14:46:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17413
    "Modified: / 8.1.1999 / 14:50:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17414
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17415
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17416
_LADD:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17417
    |sum|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17418
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17419
    sum := (op1 + op2) bitAnd:16rFFFFFFFFFFFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17420
    ^ sum
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17421
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17422
    "Created: / 8.1.1999 / 15:07:39 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17423
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17424
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17425
_LAND:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17426
    |rslt|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17427
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17428
    (op1 < 0 or:[op2 < 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17429
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17430
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17431
    rslt := op1 bitAnd: op2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17432
    ^ rslt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17433
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17434
    "Modified: / 7.1.1998 / 21:21:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17435
    "Created: / 8.1.1999 / 14:54:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17436
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17437
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17438
_LDIV:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17439
    |quo|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17440
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17441
    quo := op1 quo: op2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17442
    ^ quo
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17443
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17444
    "Created: / 8.1.1999 / 15:04:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17445
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17446
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17447
_LMUL:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17448
    |prod o1 o2 sign|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17449
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17450
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17451
    "/ ST's largeIntegers compute a correct result;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17452
    "/ but here, we want the overflow to flow into the
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17453
    "/ sign bit ... (sigh)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17454
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17455
    sign := 1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17456
    (o1 := op1) < 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17457
	sign := -1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17458
	o1 := o1 negated.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17459
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17460
    (o2 := op2) < 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17461
	sign := sign negated.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17462
	o2 := o2 negated.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17463
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17464
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17465
    prod := (o1 * o2) bitAnd:16rFFFFFFFFFFFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17466
    (prod bitAnd:16r8000000000000000) ~~ 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17467
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17468
    sign == -1 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17469
	prod := prod negated
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17470
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17471
    ^ prod
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17472
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17473
    "Created: / 8.1.1999 / 15:10:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17474
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17475
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17476
_LNEG:op
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17477
    ^ op asInteger negated
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17478
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17479
    "Created: / 8.1.1999 / 15:06:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17480
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17481
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17482
_LOR:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17483
    |rslt|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17484
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17485
    (op1 < 0 or:[op2 < 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17486
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17487
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17488
    rslt := op1 bitOr: op2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17489
    ^ rslt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17490
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17491
    "Created: / 8.1.1999 / 15:05:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17492
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17493
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17494
_LREM:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17495
    |rem|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17496
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17497
    rem := op1 rem: op2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17498
    ^ rem
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17499
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17500
    "Modified: / 7.1.1998 / 00:23:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17501
    "Created: / 8.1.1999 / 15:04:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17502
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17503
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17504
_LSHL:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17505
    |rslt|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17506
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17507
    (op1 < 0) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17508
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17509
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17510
    rslt := (op1 bitShift:op2) bitAnd:16rFFFFFFFFFFFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17511
    ^ rslt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17512
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17513
    "Created: / 8.1.1999 / 14:51:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17514
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17515
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17516
_LSHR:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17517
    |rslt|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17518
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17519
    op1 < 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17520
	self halt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17521
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17522
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17523
    (op1 < 0) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17524
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17525
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17526
    rslt := (op1 bitShift:op2 negated) bitAnd:16rFFFFFFFFFFFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17527
    ^ rslt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17528
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17529
    "Created: / 8.1.1999 / 14:51:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17530
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17531
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17532
_LSUB:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17533
    |diff|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17534
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17535
    diff := (op1 - op2) bitAnd:16rFFFFFFFFFFFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17536
    ^ diff
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17537
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17538
    "Created: / 8.1.1999 / 15:10:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17539
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17540
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17541
_LUSHR:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17542
    |rslt|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17543
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17544
    op1 < 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17545
	self halt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17546
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17547
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17548
    (op1 < 0) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17549
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17550
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17551
    rslt := (op1 bitShift:op2 negated) bitAnd:16rFFFFFFFFFFFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17552
    ^ rslt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17553
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17554
    "Modified: / 7.1.1998 / 21:22:17 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17555
    "Created: / 8.1.1999 / 14:51:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17556
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17557
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17558
_LXOR:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17559
    |rslt|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17560
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17561
    (op1 < 0 or:[op2 < 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17562
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17563
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17564
    rslt := op1 bitXor: op2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17565
    ^ rslt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17566
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17567
    "Created: / 8.1.1999 / 15:12:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17568
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17569
1093
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1092
diff changeset
 17570
_MONITORENTER: someObject 
1103
bf4c6f5bc68e just assert
hlopkmar
parents: 1102
diff changeset
 17571
    self assert: (thisContext sender isJavaContext).
bf4c6f5bc68e just assert
hlopkmar
parents: 1102
diff changeset
 17572
    self assert: (thisContext sender isMarkedForUnwind).
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17573
    self monitorEnter: someObject in: thisContext sender.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17574
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
 17575
    "Created: / 08-01-1999 / 14:23:10 / cg"
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
 17576
    "Modified: / 08-01-1999 / 18:47:26 / cg"
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
 17577
    "Modified: / 10-08-2011 / 20:19:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1103
bf4c6f5bc68e just assert
hlopkmar
parents: 1102
diff changeset
 17578
    "Modified: / 09-11-2011 / 19:23:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1093
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1092
diff changeset
 17579
!
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1092
diff changeset
 17580
255c230a1c55 hacking monitors, not working yet :P
hlopkmar
parents: 1092
diff changeset
 17581
_MONITOREXIT: someObject 
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17582
self assert: (thisContext sender isJavaContext).
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17583
    self monitorExit: someObject in: thisContext sender.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17584
905
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
 17585
    "Created: / 08-01-1999 / 14:23:19 / cg"
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
 17586
    "Modified: / 08-01-1999 / 18:47:08 / cg"
d03d9e05c581 Temporary commit. method resolving fixed
vranyj1
parents: 904
diff changeset
 17587
    "Modified: / 10-08-2011 / 20:20:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1100
1405b1485a66 fixes and guards for monitors
hlopkmar
parents: 1098
diff changeset
 17588
    "Modified: / 09-11-2011 / 12:42:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17589
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17590
804
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17591
_MULTINEW2: classRef _: dim1 
927
vranyj1
parents: 926
diff changeset
 17592
vranyj1
parents: 926
diff changeset
 17593
    | arrCls arr |
vranyj1
parents: 926
diff changeset
 17594
1151
vranyj1
parents: 1150
diff changeset
 17595
    dim1 <  0 ifTrue:[
vranyj1
parents: 1150
diff changeset
 17596
        self throwExceptionClassName:'java.lang.NegativeArraySizeException'
vranyj1
parents: 1150
diff changeset
 17597
                         withMessage:'negative array size not allowed'.
vranyj1
parents: 1150
diff changeset
 17598
        ^nil
vranyj1
parents: 1150
diff changeset
 17599
    ].
927
vranyj1
parents: 926
diff changeset
 17600
    self assert: classRef isJavaClassRef.
vranyj1
parents: 926
diff changeset
 17601
    arrCls := classRef resolve.
vranyj1
parents: 926
diff changeset
 17602
    arr := arrCls new: dim1.
804
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17603
    ^ arr.
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17604
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17605
    "Created: / 19-05-2011 / 10:46:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1151
vranyj1
parents: 1150
diff changeset
 17606
    "Modified: / 22-11-2011 / 09:45:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
927
vranyj1
parents: 926
diff changeset
 17607
!
vranyj1
parents: 926
diff changeset
 17608
vranyj1
parents: 926
diff changeset
 17609
_MULTINEW2: classRef _: dim1 _: dim2
vranyj1
parents: 926
diff changeset
 17610
vranyj1
parents: 926
diff changeset
 17611
    | arrCls arr |
vranyj1
parents: 926
diff changeset
 17612
1151
vranyj1
parents: 1150
diff changeset
 17613
    dim1 <  0 ifTrue:[
vranyj1
parents: 1150
diff changeset
 17614
        self throwExceptionClassName:'java.lang.NegativeArraySizeException'
vranyj1
parents: 1150
diff changeset
 17615
                         withMessage:'negative array size not allowed'.
vranyj1
parents: 1150
diff changeset
 17616
        ^nil
vranyj1
parents: 1150
diff changeset
 17617
    ].
vranyj1
parents: 1150
diff changeset
 17618
    dim2 <  0 ifTrue:[
vranyj1
parents: 1150
diff changeset
 17619
        self throwExceptionClassName:'java.lang.NegativeArraySizeException'
vranyj1
parents: 1150
diff changeset
 17620
                         withMessage:'negative array size not allowed'.
vranyj1
parents: 1150
diff changeset
 17621
        ^nil
vranyj1
parents: 1150
diff changeset
 17622
    ].
vranyj1
parents: 1150
diff changeset
 17623
vranyj1
parents: 1150
diff changeset
 17624
927
vranyj1
parents: 926
diff changeset
 17625
    self assert: classRef isJavaClassRef.
vranyj1
parents: 926
diff changeset
 17626
    arrCls := classRef resolve.
928
c999ae3593e3 JavaVM: fixes in MULTINEWARRAY
vranyj1
parents: 927
diff changeset
 17627
    arr := arrCls new: dim2.
c999ae3593e3 JavaVM: fixes in MULTINEWARRAY
vranyj1
parents: 927
diff changeset
 17628
    1 to: dim2 do:[:i|
c999ae3593e3 JavaVM: fixes in MULTINEWARRAY
vranyj1
parents: 927
diff changeset
 17629
        arr at: i put: (arrCls javaComponentClass new: dim1)
927
vranyj1
parents: 926
diff changeset
 17630
    ].
804
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17631
    ^ arr.
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17632
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17633
    "Created: / 19-05-2011 / 10:47:42 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1151
vranyj1
parents: 1150
diff changeset
 17634
    "Modified: / 22-11-2011 / 09:45:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
927
vranyj1
parents: 926
diff changeset
 17635
!
vranyj1
parents: 926
diff changeset
 17636
vranyj1
parents: 926
diff changeset
 17637
_MULTINEW2: classRef _: dim1 _: dim2 _: dim3
vranyj1
parents: 926
diff changeset
 17638
vranyj1
parents: 926
diff changeset
 17639
    | arrCls arr |
vranyj1
parents: 926
diff changeset
 17640
1151
vranyj1
parents: 1150
diff changeset
 17641
    dim1 <  0 ifTrue:[
vranyj1
parents: 1150
diff changeset
 17642
        self throwExceptionClassName:'java.lang.NegativeArraySizeException'
vranyj1
parents: 1150
diff changeset
 17643
                         withMessage:'negative array size not allowed'.
vranyj1
parents: 1150
diff changeset
 17644
        ^nil
vranyj1
parents: 1150
diff changeset
 17645
    ].
vranyj1
parents: 1150
diff changeset
 17646
    dim2 <  0 ifTrue:[
vranyj1
parents: 1150
diff changeset
 17647
        self throwExceptionClassName:'java.lang.NegativeArraySizeException'
vranyj1
parents: 1150
diff changeset
 17648
                         withMessage:'negative array size not allowed'.
vranyj1
parents: 1150
diff changeset
 17649
        ^nil
vranyj1
parents: 1150
diff changeset
 17650
    ].
vranyj1
parents: 1150
diff changeset
 17651
    dim3 <  0 ifTrue:[
vranyj1
parents: 1150
diff changeset
 17652
        self throwExceptionClassName:'java.lang.NegativeArraySizeException'
vranyj1
parents: 1150
diff changeset
 17653
                         withMessage:'negative array size not allowed'.
vranyj1
parents: 1150
diff changeset
 17654
        ^nil
vranyj1
parents: 1150
diff changeset
 17655
    ].
vranyj1
parents: 1150
diff changeset
 17656
vranyj1
parents: 1150
diff changeset
 17657
927
vranyj1
parents: 926
diff changeset
 17658
    self assert: classRef isJavaClassRef.
vranyj1
parents: 926
diff changeset
 17659
    arrCls := classRef resolve.
928
c999ae3593e3 JavaVM: fixes in MULTINEWARRAY
vranyj1
parents: 927
diff changeset
 17660
    arr := arrCls new: dim3.
c999ae3593e3 JavaVM: fixes in MULTINEWARRAY
vranyj1
parents: 927
diff changeset
 17661
    1 to: dim3 do:[:i|
927
vranyj1
parents: 926
diff changeset
 17662
        | arr2 |
vranyj1
parents: 926
diff changeset
 17663
        arr2 := arrCls javaComponentClass new: dim2.
vranyj1
parents: 926
diff changeset
 17664
        1 to: dim2 do:[:j|
928
c999ae3593e3 JavaVM: fixes in MULTINEWARRAY
vranyj1
parents: 927
diff changeset
 17665
            arr2 at: j put: (arrCls javaComponentClass javaComponentClass new: dim1).
927
vranyj1
parents: 926
diff changeset
 17666
        ].
vranyj1
parents: 926
diff changeset
 17667
        arr at: i put: arr2.
vranyj1
parents: 926
diff changeset
 17668
    ].
804
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17669
    ^ arr.
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17670
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17671
    "Created: / 19-05-2011 / 10:47:50 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1151
vranyj1
parents: 1150
diff changeset
 17672
    "Modified: / 22-11-2011 / 09:45:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
804
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17673
!
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17674
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17675
_MULTINEW:typeRef _:dim1 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17676
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17677
    |arr|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17678
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17679
    arr := typeRef new:dim1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17680
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17681
    ^ arr
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17682
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17683
    "Created: / 08-01-1999 / 14:15:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17684
    "Modified: / 08-01-1999 / 18:03:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17685
    "Modified: / 16-03-2011 / 16:20:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17686
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17687
804
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17688
_MULTINEW: typeRef _: dim1 _: dim2 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17689
    | arr |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17690
804
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17691
    arr := typeRef new: dim2.
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17692
    1 to: dim2
c125b8449315 JavaVM class>>_MULTINEW2
hlopkmar
parents: 802
diff changeset
 17693
        do: [:idx | arr at: idx put: (self _MULTINEW: typeRef javaComponentClass _: dim1) ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17694
    ^ arr
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17695
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17696
    "Created: / 08-01-1999 / 14:15:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17697
    "Modified: / 08-01-1999 / 17:58:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17698
    "Modified: / 16-03-2011 / 16:19:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17699
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17700
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17701
_MULTINEW:typeRef _:dim1 _:dim2 _:dim3 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17702
    |clsRef cls arr elType elSizes|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17703
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17704
    clsRef := typeRef asClassPointerRef.
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17705
    cls := clsRef javaArrayClass.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17706
    arr := cls new:dim3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17707
    elType := typeRef deref.
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17708
    1 to:dim3
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17709
        do:
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17710
            [:idx | 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17711
            arr at:idx
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17712
                put:(self 
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17713
                        _MULTINEW:elType
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17714
                        _:dim1
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17715
                        _:dim2) ].
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17716
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17717
"/ self halt.
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 17718
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17719
    ^ arr
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17720
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17721
    "Modified: / 6.1.1998 / 23:34:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17722
    "Created: / 8.1.1999 / 14:15:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17723
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17724
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17725
!JavaVM class methodsFor:'windows - events'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17726
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17727
awtEventsForEvent: anEvent javaWindow: jWin 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17728
    "given an ST/X event, create corresponding AWT event(s) for it"
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17729
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17730
    | jEv  jEv1  jEv2  modifiers  key  keyChar  untranslatedKey  id  type  x  y  w  h  view  menu  resized  moved  eventArgs  clickCount  jRect  jKeyEventClass  jInputEventClass  jMouseEventClass  jWindowEventClass  jPaintEventClass  jComponentEventClass |
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17731
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17732
    type := anEvent type.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17733
    eventArgs := anEvent arguments.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17734
    key := 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17735
    modifiers := 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17736
    x := 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17737
    y := 0.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17738
    ((type == #exposeX:y:width:height:) 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17739
        or: [ (type == #graphicExposeX:y:width:height:) or: [ (type == #damage) ] ]) 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17740
            ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17741
                "/        jWindowEventClass := Java classForName:'java.awt.event.WindowEvent'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17742
                "/        id := (jPaintEventClass instVarNamed:'PAINT').
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17743
                jPaintEventClass := self classForName: 'java.awt.event.PaintEvent'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17744
                id := (jPaintEventClass instVarNamed: 'UPDATE').
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17745
                ((type == #exposeX:y:width:height:) 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17746
                    or: [ (type == #graphicExposeX:y:width:height:) ]) 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17747
                        ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17748
                            x := eventArgs at: 1.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17749
                            y := eventArgs at: 2.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17750
                            w := eventArgs at: 3.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17751
                            h := eventArgs at: 4.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17752
                        ]
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17753
                        ifFalse: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17754
                            x := eventArgs left.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17755
                            y := eventArgs top.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17756
                            w := eventArgs width.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17757
                            h := eventArgs height.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17758
                        ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17759
                jRect := (Java classForName: 'java.awt.Rectangle') basicNew.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17760
                jRect instVarNamed: 'x' put: x.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17761
                jRect instVarNamed: 'y' put: y.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17762
                jRect instVarNamed: 'width' put: w.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17763
                jRect instVarNamed: 'height' put: h.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17764
                jEv := jPaintEventClass newCleared.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17765
                jEv instVarNamed: 'id' put: id.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17766
                jEv instVarNamed: 'updateRect' put: jRect.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17767
                
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17768
"/        jEv instVarNamed:'g'         put:jWin.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17769
                
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17770
                ^ Array with: jEv.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17771
            ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17772
    (anEvent isKeyEvent 
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17773
        or: [ anEvent isButtonEvent or: [ anEvent isPointerEnterLeaveEvent ] ]) 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17774
            ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17775
                jInputEventClass := Java classForName: 'java.awt.event.InputEvent'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17776
                anEvent hasAlt ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17777
                    modifiers := modifiers bitOr: (jInputEventClass instVarNamed: 'ALT_MASK')
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17778
                ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17779
                anEvent hasCtrl ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17780
                    modifiers := modifiers bitOr: (jInputEventClass instVarNamed: 'CTRL_MASK')
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17781
                ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17782
                anEvent hasMeta ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17783
                    modifiers := modifiers bitOr: (jInputEventClass instVarNamed: 'META_MASK')
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17784
                ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17785
                anEvent hasShift ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17786
                    modifiers := modifiers 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17787
                                bitOr: (jInputEventClass instVarNamed: 'SHIFT_MASK')
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17788
                ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17789
                anEvent hasButton1 ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17790
                    modifiers := modifiers 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17791
                                bitOr: (jInputEventClass instVarNamed: 'BUTTON1_MASK')
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17792
                ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17793
                anEvent hasButton2 ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17794
                    modifiers := modifiers 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17795
                                bitOr: (jInputEventClass instVarNamed: 'BUTTON2_MASK')
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17796
                ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17797
                anEvent hasButton3 ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17798
                    modifiers := modifiers 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17799
                                bitOr: (jInputEventClass instVarNamed: 'BUTTON3_MASK')
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17800
                ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17801
                anEvent isPointerEnterLeaveEvent ifFalse: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17802
                    "/ ST/X does not (yet) record this information
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17803
                    "/ with pointerLeave events.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17804
                    x := anEvent x.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17805
                    y := anEvent y.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17806
                ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17807
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17808
    anEvent isKeyEvent ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17809
        jKeyEventClass := Java classForName: 'java.awt.event.KeyEvent'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17810
        key := 0.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17811
        keyChar := 0.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17812
        key := anEvent key.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17813
        key isCharacter ifTrue: [ key := keyChar := key asciiValue ] ifFalse: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17814
            untranslatedKey := anEvent view device keyboardMap keyAtValue: key
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17815
                        ifAbsent: key.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17816
            untranslatedKey == #Insert ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17817
                key := jKeyEventClass instVarNamed: 'VK_INSERT'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17818
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17819
            untranslatedKey == #Delete ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17820
                key := jKeyEventClass instVarNamed: 'VK_DELETE'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17821
                "/ 127
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17822
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17823
            untranslatedKey == #BackSpace ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17824
                key := jKeyEventClass instVarNamed: 'VK_BACK_SPACE'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17825
                "/ 8
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17826
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17827
            untranslatedKey == #Return ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17828
                key := jKeyEventClass instVarNamed: 'VK_ENTER'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17829
                "/ 13
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17830
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17831
            untranslatedKey == #Tab ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17832
                key := jKeyEventClass instVarNamed: 'VK_TAB'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17833
                "/ 9
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17834
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17835
            untranslatedKey == #Home ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17836
                key := jKeyEventClass instVarNamed: 'VK_HOME'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17837
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17838
            untranslatedKey == #End ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17839
                key := jKeyEventClass instVarNamed: 'VK_END'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17840
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17841
            (key == #PreviousPage or: [ untranslatedKey == #Prior ]) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17842
                key := jKeyEventClass instVarNamed: 'VK_PAGE_UP'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17843
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17844
            (key == #NextPage or: [ key == #EndOfText ]) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17845
                key := jKeyEventClass instVarNamed: 'VK_PAGE_DOWN'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17846
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17847
            untranslatedKey == #CursorUp ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17848
                key := jKeyEventClass instVarNamed: 'VK_UP'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17849
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17850
            untranslatedKey == #CursorDown ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17851
                key := jKeyEventClass instVarNamed: 'VK_DOWN'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17852
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17853
            untranslatedKey == #CursorLeft ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17854
                key := jKeyEventClass instVarNamed: 'VK_LEFT'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17855
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17856
            untranslatedKey == #CursorRight ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17857
                key := jKeyEventClass instVarNamed: 'VK_RIGHT'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17858
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17859
            (#( #F1 #F2 #F3 #F4 #F5 #F6 #F7 #F8 #F9 #F10 #F11 #F12 ) 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17860
                includes: untranslatedKey) 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17861
                    ifTrue: [ key := jKeyEventClass instVarNamed: ('VK_' , untranslatedKey) ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17862
        ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17863
        (type == #keyPress:x:y:) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17864
            id := jKeyEventClass instVarNamed: 'KEY_PRESSED'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17865
        ] ifFalse: [ id := jKeyEventClass instVarNamed: 'KEY_RELEASED' ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17866
        jEv := jKeyEventClass newCleared.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17867
        jEv instVarNamed: 'modifiers' put: modifiers.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17868
        jEv instVarNamed: 'keyCode' put: key.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17869
        jEv instVarNamed: 'keyChar' put: keyChar.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17870
        jEv instVarNamed: 'id' put: id.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17871
        
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17872
"/        jEv instVarNamed:'x'         put:x.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17873
"/        jEv instVarNamed:'y'         put:y.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17874
        
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17875
        jEv instVarNamed: 'when' put: (OperatingSystem getMillisecondTime).
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17876
        ^ Array with: jEv
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17877
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17878
    (anEvent isButtonEvent or: [ anEvent isPointerEnterLeaveEvent ]) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17879
        jMouseEventClass := Java classForName: 'java.awt.event.MouseEvent'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17880
        clickCount := 1.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17881
        (type == #buttonPress:x:y:) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17882
            id := jMouseEventClass instVarNamed: 'MOUSE_PRESSED'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17883
        ] ifFalse: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17884
            (type == #buttonRelease:x:y:) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17885
                id := jMouseEventClass instVarNamed: 'MOUSE_RELEASED'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17886
            ] ifFalse: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17887
                (type == #buttonMotion:x:y:) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17888
                    (anEvent state bitAnd: (anEvent view device anyButtonMotionMask)) == 0 ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17889
                        id := jMouseEventClass instVarNamed: 'MOUSE_MOVED'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17890
                    ] ifFalse: [ id := jMouseEventClass instVarNamed: 'MOUSE_DRAGGED'. ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17891
                ] ifFalse: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17892
                    "/                    (type == #'pointerMotion:x:y:') ifTrue:[
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17893
                    "/                        id := jMouseEventClass instVarNamed:'MOUSE_MOVED'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17894
                    "/                    ] ifFalse:[
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17895
                    (type == #pointerEnter:x:y:) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17896
                        id := jMouseEventClass instVarNamed: 'MOUSE_ENTERED'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17897
                    ] ifFalse: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17898
                        (type == #pointerLeave:) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17899
                            id := jMouseEventClass instVarNamed: 'MOUSE_EXITED'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17900
                        ] ifFalse: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17901
                            (type == #buttonMultiPress:x:y:) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17902
                                id := jMouseEventClass instVarNamed: 'MOUSE_PRESSED'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17903
                                clickCount := 2.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17904
                            ] ifFalse: [ self halt. ]
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17905
                            
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17906
"/                        ]
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17907
                        ]
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17908
                    ]
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17909
                ]
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17910
            ]
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17911
        ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17912
        jEv := jMouseEventClass newCleared.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17913
        jEv instVarNamed: 'modifiers' put: modifiers.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17914
        jEv instVarNamed: 'id' put: id.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17915
        jEv instVarNamed: 'x' put: x.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17916
        jEv instVarNamed: 'y' put: y.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17917
        jEv instVarNamed: 'when' put: (OperatingSystem getMillisecondTime).
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17918
        ^ Array with: jEv
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17919
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17920
    (type == #configureX:y:width:height:) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17921
        view := anEvent view.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17922
        x := eventArgs at: 1.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17923
        y := eventArgs at: 2.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17924
        w := eventArgs at: 3.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17925
        h := eventArgs at: 4.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17926
        resized := (w ~~ view width or: [ h ~~ view height ]).
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17927
        moved := (x ~~ view left or: [ y ~~ view top ]).
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17928
        
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17929
"/        (view isTopView or:[view isPopUpView]) ifTrue:[
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17930
        "/ view must update its origin/extent.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17931
        
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17932
        view dispatchEvent: anEvent.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17933
        
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17934
"/        ].
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17935
        "/
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17936
        "/ must change the components extent
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17937
        "/ is there no cleaner way to do this ?
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17938
        "/
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17939
        
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17940
        view isTopView ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17941
            view isPopUpView ifFalse: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17942
                "/
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17943
                "/ sigh - don't include the menu.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17944
                "/
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17945
                menu := self topViewsMenu: view.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17946
                menu notNil ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17947
                    "/ must add the menus height
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17948
                    h := h - menu height
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17949
                ]
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17950
            ]
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17951
        ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17952
        jWin instVarNamed: 'width' put: w.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17953
        jWin instVarNamed: 'height' put: h.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17954
        jWin instVarNamed: 'x' put: x.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17955
        jWin instVarNamed: 'y' put: y.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17956
        jComponentEventClass := Java classForName: 'java.awt.event.ComponentEvent'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17957
        moved ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17958
            id := (jComponentEventClass instVarNamed: 'COMPONENT_MOVED').
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17959
            jEv1 := jComponentEventClass newCleared.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17960
            jEv1 instVarNamed: 'id' put: id.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17961
        ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17962
        resized ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17963
            id := (jComponentEventClass instVarNamed: 'COMPONENT_RESIZED').
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17964
            jEv2 := jComponentEventClass newCleared.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17965
            jEv2 instVarNamed: 'id' put: id.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17966
        ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17967
        jEv1 isNil ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17968
            jEv2 isNil ifTrue: [ ^ nil ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17969
            ^ Array with: jEv2
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17970
        ] ifFalse: [ jEv2 isNil ifTrue: [ ^ Array with: jEv1 ] ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17971
        ^ Array with: jEv1 with: jEv2.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17972
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17973
    (type == #focusIn) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17974
        "/ 'focusIn' printCR.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17975
        jComponentEventClass := Java classForName: 'java.awt.event.FocusEvent'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17976
        id := (jComponentEventClass instVarNamed: 'FOCUS_GAINED').
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17977
        jEv := jComponentEventClass newCleared.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17978
        jEv instVarNamed: 'id' put: id.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17979
        ^ Array with: jEv.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17980
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17981
    (type == #focusOut) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17982
        "/ 'focusOut' printCR.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17983
        jComponentEventClass := Java classForName: 'java.awt.event.FocusEvent'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17984
        id := (jComponentEventClass instVarNamed: 'FOCUS_LOST').
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17985
        jEv := jComponentEventClass newCleared.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17986
        jEv instVarNamed: 'id' put: id.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17987
        ^ Array with: jEv.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17988
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17989
    (type == #mapped) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17990
        "/ 'mapped' printCR.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17991
        jComponentEventClass := Java classForName: 'java.awt.event.ComponentEvent'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17992
        id := (jComponentEventClass instVarNamed: 'COMPONENT_SHOWN').
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17993
        
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17994
"/        x := eventArgs at:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 17995
"/        y := eventArgs at:2.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17996
        
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17997
        jEv := jComponentEventClass newCleared.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17998
        jEv instVarNamed: 'id' put: id.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 17999
        ^ Array with: jEv.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18000
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18001
    (type == #unmapped) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18002
        "/ 'unmapped' printCR.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18003
        jComponentEventClass := Java classForName: 'java.awt.event.ComponentEvent'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18004
        id := (jComponentEventClass instVarNamed: 'COMPONENT_HIDDEN').
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18005
        
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18006
"/        x := eventArgs at:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18007
"/        y := eventArgs at:2.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18008
        
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18009
        jEv := jComponentEventClass newCleared.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18010
        jEv instVarNamed: 'id' put: id.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18011
        ^ Array with: jEv.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18012
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18013
    (type == #terminate) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18014
        jWindowEventClass := Java classForName: 'java.awt.event.WindowEvent'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18015
         "NEW
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18016
         id := (jWindowEventClass instVarNamed:'WINDOW_CLOSING').
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18017
        " "OLD "
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18018
        id := (jWindowEventClass instVarNamed: 'WINDOW_CLOSED').
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18019
         
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18020
        jEv := jWindowEventClass newCleared.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18021
        jEv instVarNamed: 'id' put: id.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18022
        ^ Array with: jEv.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18023
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18024
    EventTrace == true ifTrue: [ ('JAVA: unhandled event:' , type) infoPrintCR. ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18025
    ^ nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18026
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18027
    "Created: / 6.1.1998 / 20:38:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18028
    "Modified: / 9.1.1999 / 09:29:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18029
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18030
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18031
delegatesTo:someOne
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18032
    ^ false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18033
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18034
    "Created: / 25.9.1999 / 16:11:48 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18035
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18036
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18037
doWindowsEventThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18038
    "invoked in an endless loop by the WToolkit-eventLoop
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18039
     native method."
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18040
    
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18041
    | sensor  event  more |
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18042
    (JavaWindowGroup isNil or: [ KnownWindows isNil ]) ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18043
        "/ '*** eventThread: no windowGroup / views ...' printCR.        
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18044
        self halt: 'monitors are reimplemented, change me if you know how and why'.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18045
        "self 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18046
            waitFor: FirstWindowCreationSemaphore
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18047
            state: #eventWait
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18048
            timeOut: nil."
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18049
        
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18050
        "/ Delay waitForSeconds:0.1.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18051
        
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18052
        ^ self
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18053
    ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18054
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18055
    "/ wait for an event to arrive ...
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18056
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18057
    sensor := JavaWindowGroup sensor.
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18058
    [ sensor hasEvents or: [ sensor damageCount ~~ 0 ] ] whileFalse: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18059
        EventTrace ifTrue: [ '*** eventThread waiting ...' printCR. ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18060
        Processor activeProcess state: #eventWait.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18061
        self 
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18062
            waitFor: sensor eventSemaphore
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18063
            state: #eventWait
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18064
            timeOut: nil.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18065
    ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18066
    EventTrace ifTrue: [ '*** eventThread event arrived ...' printCR. ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18067
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18068
    "/ EventTrace := true
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18069
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18070
    more := true.
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18071
    [ more ] whileTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18072
        sensor hasDamage ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18073
            EventTrace ifTrue: [ '*** eventThread: damage arrived ...' printCR. ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18074
            event := sensor nextDamage.
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18075
        ] ifFalse: [ event := sensor nextEvent. ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18076
        event isNil ifTrue: [
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18077
            EventTrace == true ifTrue: [ '*** eventThread: nil event ignored' printCR. ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18078
            ^ self
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18079
        ].
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18080
        more := self processEvent: event
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18081
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18082
1147
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18083
    "Created: / 06-01-1998 / 21:02:40 / cg"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18084
    "Modified: / 30-12-1998 / 19:21:36 / cg"
9431cebfd873 java monitors totally integrated.. maybe too ambitious.. we'll see
hlopkmar
parents: 1145
diff changeset
 18085
    "Modified: / 22-11-2011 / 13:22:32 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18086
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18087
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18088
processEvent: event 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18089
    | evQ  jEvents  jWToolKitClass  jWToolKit  jWinPeer  jWin  v  eventConsumed |
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18090
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18091
    KnownWindows isNil ifTrue: [ ^ false ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18092
    v := event view.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18093
    jWinPeer := self jPeerForView: v.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18094
    jWinPeer isNil ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18095
        v isJavaView ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18096
            "/ mhmh - an event for a JavaView,
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18097
            "/ which has no peer (anyMore ?)
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18098
            "/ should not happen.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18099
        ] ifFalse: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18100
            "/ mhmh - an event for a subcomponent of an ST widget.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18101
            "/ let it be handled normally.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18102
            EventTrace ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18103
                ('*** eventThread: ' , event type 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18104
                    , '-event for unknown java-view - passed to view.') printCR.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18105
            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18106
            event view dispatchEvent: event.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18107
        ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18108
        ^ true
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18109
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18110
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18111
    "/ change:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18112
    "/ in the previous version, events for ST/X widgets (i.e. buttons etc)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18113
    "/ where not passed to java, but instead forwarded directly to the widget
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18114
    "/ by the code below.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18115
    "/ This has changed, to pass it to Java, which eventually passes it to the
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18116
    "/ peer via the handleEvent native method (unless the event got consumed).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18117
    "/ This is req'd to let java keep track of keyboard/mouse input for widgets.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18118
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18119
    (event isDamage and: [ v isJavaView ]) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18120
        "/    "/ most views handle their events themself (being ST/X views) ...
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18121
        "/
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18122
        "/    v class ~~ JavaView ifTrue:[
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18123
        "/"/        v class ~~ StandardSystemView ifTrue:[
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18124
        "/"/            EventTrace ifTrue:[
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18125
        "/"/                    ('*** eventThread: event handled by view itself (' , v class name , ')') printCR.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18126
        "/"/            ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18127
        "/"/            event sendEventWithFocusOn:nil.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18128
        "/"/            ^ self.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18129
        "/"/        ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18130
        "/        (event type == #'exposeX:y:width:height'
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18131
        "/        or:[event type == #'graphicsExposeX:y:width:height']) ifTrue:[
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18132
        "/            "/ send to view, but also handle in JAVA
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18133
        "/            event sendEventWithFocusOn:nil.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18134
        "/        ]
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18135
        "/    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18136
        (#( #mapped
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18137
         #unmapped
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18138
         #configureX:y:width:height:
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18139
         #exposeX:y:width:height:
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18140
         #graphicsExposeX:y:width:height: ) includes: event type) ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18141
            event sendEventWithFocusOn: nil.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18142
        ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18143
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18144
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18145
    "/ what a kludge - some events are passed back to
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18146
    "/ ST via the WComponent-handleEvent native method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18147
    "/ However, repaints are not.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18148
    "/ In order to let ST widgets do the drawing,
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18149
    "/ selectively filter exposeEvents from Java ...
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18150
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18151
    eventConsumed := false.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18152
    v isJavaView ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18153
        "/ all events handled by Java ...
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18154
    ] ifFalse: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18155
        eventConsumed := true.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18156
        
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18157
        "/ let widget handle it.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18158
        
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18159
        event view dispatchEvent: event.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18160
        
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18161
        "/ some are not passed to Java ...
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18162
        
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18163
        event isDamage ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18164
            (v isKindOf: Button) ifTrue: [ ^ true ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18165
            (v isKindOf: TextView) ifTrue: [ ^ true ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18166
            (v isKindOf: Label) ifTrue: [ ^ true ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18167
            (v isKindOf: ComboBoxView) ifTrue: [ ^ true ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18168
            (v isKindOf: ScrollBar) ifTrue: [ ^ true ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18169
            (v isKindOf: Scroller) ifTrue: [ ^ true ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18170
            (v isKindOf: MenuPanel) ifTrue: [ ^ true ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18171
        ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18172
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18173
    jWin := jWinPeer instVarNamed: 'target'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18174
    EventTrace ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18175
        ('*** eventThread: event (' , event type , ') handled by JAVA: ') 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18176
            infoPrint.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18177
        jWinPeer class name infoPrint.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18178
        ' (' infoPrint.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18179
        jWin class name infoPrint.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18180
        ')' infoPrintCR.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18181
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18182
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18183
    "/ create an event
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18184
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18185
    jEvents := self awtEventsForEvent: event javaWindow: jWin.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18186
    jEvents isNil ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18187
        EventTrace ifTrue: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18188
            ('*** eventThread: event ignored: ' , event type) printCR.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18189
        ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18190
        ^ true
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18191
    ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18192
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18193
"/    v superView isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18194
"/        ('*** eventThread: event ignored for topView: ' , event type) printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18195
"/        ^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18196
"/    ].
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18197
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18198
    jWToolKitClass := self classForName: 'java.awt.Toolkit'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18199
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18200
    "/ jWToolKit := jWToolKitClass perform:#getDefaultToolkit.
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18201
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18202
    jWToolKit := jWToolKitClass 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18203
                performStatic: #'getDefaultToolkit()Ljava/awt/Toolkit;'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18204
    jEvents do: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18205
        :jEv | 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18206
        jEv instVarNamed: 'source' put: jWin.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18207
        jEv instVarNamed: 'consumed' put: 0.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18208
        eventConsumed ifFalse: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18209
            "/ the first gets the original event as data
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18210
            jEv instVarNamed: 'data' put: event.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18211
            eventConsumed := true
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18212
        ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18213
        
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18214
        "/ post it (them) to the event queue
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18215
        
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18216
        EventTrace == true ifTrue: [ 'postEvent to Java ...' printCR. ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18217
        jWToolKit "class" perform: #'postEvent(Ljava/awt/AWTEvent;)V' with: jEv.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18218
    ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18219
    ^ false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18220
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18221
    "Created: / 6.1.1998 / 20:36:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18222
    "Modified: / 10.12.1998 / 19:36:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18223
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18224
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18225
!JavaVM::Reflection class methodsFor:'instance creation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18226
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18227
for: aJavaVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18228
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18229
    ^self new setVM: aJavaVM.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18230
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18231
    "Created: / 21-12-2010 / 19:42:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18232
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18233
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18234
new
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18235
    "return an initialized instance"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18236
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18237
    ^ self basicNew initialize.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18238
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18239
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18240
!JavaVM::Reflection methodsFor:'debugging'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18241
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18242
returnNilIfMissing
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18243
    ^ returnNilIfMissing.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18244
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18245
    "Created: / 28-01-2011 / 15:14:37 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18246
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18247
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18248
returnNilIfMissing:aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18249
    returnNilIfMissing:= aBoolean.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18250
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18251
    "Created: / 28-01-2011 / 15:25:35 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18252
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18253
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18254
!JavaVM::Reflection methodsFor:'initialization'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18255
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18256
initialize
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18257
    constantPoolMapping := IdentityDictionary new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18258
    javaClasses := Dictionary new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18259
    javaArrayClasses := IdentityDictionary new.
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18260
    realMethods := OrderedCollection new.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18261
    javaMethodsPerMethod := Dictionary new
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18262
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18263
    "Created: / 21-12-2010 / 19:46:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18264
    "Modified: / 09-02-2011 / 00:24:28 / Marcel Hlopko <hlopik@gmail.com>"
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18265
    "Modified: / 05-12-2011 / 09:56:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18266
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18267
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18268
setVM: aJavaVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18269
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18270
    "Now, aJavaVM == JavaVM (i.e, the class JavaVM 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18271
    itself, not its instance)"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18272
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18273
    vm := aJavaVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18274
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18275
    "Created: / 21-12-2010 / 19:44:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18276
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18277
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18278
!JavaVM::Reflection methodsFor:'reflection - classes'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18279
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18280
classForJavaClassObject: aJavaClassObject 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18281
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18282
        Given an instance of java.lang.Class, answers
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18283
        real (Java) class associated with it. The instance
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18284
        of java.lang.Class should be first created by myself
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18285
        (by sending #javaClassObjectForClass:)"
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18286
    
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18287
    (javaClasses at: aJavaClassObject ifAbsent: [ 123 ]) 
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
 18288
        == (JavaVM classNamed: 'stx/libjava/tests/junir/JUnit3Tests') 
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18289
            ifTrue: [ self breakPoint: #jv ].
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18290
    ^ javaClasses at: aJavaClassObject
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18291
        ifAbsent: [
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18292
            vm internalError: 'No class associated with given java.lang.Class!!'.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18293
            
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18294
            "/Please, no nils
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18295
            
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18296
            self returnNilIfMissing ifTrue: nil
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18297
        ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18298
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18299
    "Created: / 28-01-2011 / 15:22:39 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18300
    "Modified: / 05-02-2011 / 20:26:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1036
4ff03464c3b3 refactored registry..
hlopkmar
parents: 1035
diff changeset
 18301
    "Modified: / 21-10-2011 / 13:41:12 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18302
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18303
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18304
javaArrayClassObjectForClass:aClass 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18305
    ^ javaArrayClasses at:aClass ifAbsent:[self returnNilIfMissing ifTrue:nil].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18306
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18307
    "Created: / 28-01-2011 / 14:56:19 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18308
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18309
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18310
javaArrayClassObjectForClass:aClass ifAbsentPut:classOfaClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18311
    ^ javaArrayClasses at:aClass ifAbsentPut: classOfaClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18312
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18313
    "Created: / 28-01-2011 / 14:59:21 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18314
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18315
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18316
javaClassObjectArrayForClasses: classes 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18317
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18318
        Answers an instance of java.lang.Class[] for given
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 18319
        real (Java) classes."
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 18320
    
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18321
    | array |
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18322
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18323
    array := (vm classForName: 'java.lang.Class') javaArrayClass 
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18324
                new: classes size.
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18325
    classes isNilOrEmptyCollection ifTrue: [ ^ array ].
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 18326
    classes 
1033
a31de6a4cfa4 refactoringl, moved registry to JavaVM
hlopkmar
parents: 1030
diff changeset
 18327
        withIndexDo: [:cls :idx | array at: idx put: (self javaClassObjectForClass: cls) ].
851
fc38cc6ed478 Small refactoring
vranyj1
parents: 850
diff changeset
 18328
    ^ array
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18329
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18330
    "Modified: / 28-01-2011 / 15:15:44 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18331
    "Created: / 04-02-2011 / 22:08:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18332
    "Modified: / 11-02-2011 / 10:21:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18333
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18334
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18335
javaClassObjectForClass:aClass 
911
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
 18336
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
 18337
    ^self javaClassObjectForClass:aClass init: true.
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
 18338
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
 18339
    "Modified: / 28-01-2011 / 15:15:44 / Marcel Hlopko <hlopik@gmail.com>"
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
 18340
    "Modified: / 12-08-2011 / 19:07:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
 18341
!
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
 18342
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
 18343
javaClassObjectForClass: aClass init: init 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18344
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18345
        Answers an instance of java.lang.Class for given
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
 18346
        real (Java) class."
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
 18347
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18348
    | javaClassObj |
1030
9f87a1830611 fixed bug in java registry and we BOOT :)
hlopkmar
parents: 1029
diff changeset
 18349
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18350
    self assert: aClass isBehavior message: 'aClass is not behavior'.
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
 18351
    self assert: aClass ~~ Array
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
 18352
        message: 'aClass should not be Array (old impl)'.
1028
d30cabc12354 fixed problem with classInit cycle.. still not booting :)
hlopkmar
parents: 1027
diff changeset
 18353
    javaClasses at: aClass ifPresent: [:javaClassObj | ^ javaClassObj ].
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
 18354
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18355
    "/ class must be initialized (with all of its superclasses ?).
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
 18356
    
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
 18357
    false ifTrue: [ aClass isJavaClass ifTrue: [ aClass classInit ]. ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18358
    javaClassObj := (vm classForName: 'java.lang.Class') new.
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18359
    self rememberJavaClassObject: javaClassObj for: aClass.
1021
8ae6c261878a changed class loaders order, loading of primitive arrays, refactoring coming soon..
hlopkmar
parents: 1017
diff changeset
 18360
    ^ javaClassObj
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18361
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18362
    "Modified: / 28-01-2011 / 15:15:44 / Marcel Hlopko <hlopik@gmail.com>"
911
efa922d67283 Few more natives + JavaInflater
vranyj1
parents: 910
diff changeset
 18363
    "Created: / 12-08-2011 / 19:07:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18364
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18365
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
 18366
javaClassObjectForClassNamed: className 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18367
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18368
        Answers an instance of java.lang.Class for given
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18369
        (java) class name. The className may be name of primitive
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
 18370
        type, i.e. 'int', 'double'."
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
 18371
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18372
    | cls |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18373
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
 18374
    cls := JavaDescriptor baseTypesByTypeName at: className
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
 18375
                ifAbsent: [ vm classForName: className ].
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
 18376
    ^ self javaClassObjectForClass: cls.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18377
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18378
    "Created: / 03-02-2011 / 21:12:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
 18379
    "Modified: / 08-04-2011 / 14:45:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18380
!
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18381
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18382
rememberJavaClassObject: jclass for: class
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18383
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18384
    javaClasses at: class put: jclass.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18385
    javaClasses at: jclass put: class.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18386
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18387
    "Created: / 05-12-2011 / 09:57:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18388
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18389
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18390
!JavaVM::Reflection methodsFor:'reflection - constant pool'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18391
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18392
constantPoolFor:javaConstantPoolObject 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18393
    ^ constantPoolMapping at:javaConstantPoolObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18394
        ifAbsent:[self error:'Given ConstantPool was not created by JVM']
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18395
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18396
    "Created: / 21-12-2010 / 19:56:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18397
    "Modified: / 28-01-2011 / 14:56:54 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18398
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18399
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18400
javaConstantPoolObjectFor: aConstantPool
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18401
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18402
    ^constantPoolMapping at: aConstantPool ifAbsent:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18403
        [| javaConstantPoolObject |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18404
        javaConstantPoolObject := (vm classForName:'sun.reflect.ConstantPool') new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18405
        constantPoolMapping at: aConstantPool put: javaConstantPoolObject.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18406
        constantPoolMapping at: javaConstantPoolObject put: aConstantPool.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18407
        javaConstantPoolObject]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18408
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18409
    "Created: / 21-12-2010 / 19:54:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18410
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18411
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18412
!JavaVM::Reflection methodsFor:'reflection - methods & ctors'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18413
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18414
javaConstructorObjectForMethod:method 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18415
     "given a real method, return the corresponding java.lang.reflect.Constructor
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18416
      instance for it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18417
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18418
    | jCtor |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18419
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18420
    javaMethodsPerMethod at:method ifPresent:[:existingCtor|^existingCtor].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18421
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18422
    jCtor := (Java classForName:'java.lang.reflect.Constructor') new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18423
    self javaMethodObjectLikeSlotsInto: jCtor forMethod: method.
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18424
    self rememberJavaMethodObject: jCtor for: method.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18425
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18426
    ^ jCtor
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18427
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18428
    "Created: / 09-02-2011 / 10:28:12 / Marcel Hlopko <hlopik@gmail.com>"
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18429
    "Modified: / 05-12-2011 / 10:02:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18430
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18431
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18432
javaMethodObjectForMethod:method 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18433
     "given a real method, return the corresponding java.lang.reflect.Constructor
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18434
      instance for it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18435
     | jMethod |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18436
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18437
    javaMethodsPerMethod at:method ifPresent:[:existingCtor|^existingCtor].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18438
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18439
    jMethod := (Java classForName:'java.lang.reflect.Method') new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18440
    self javaMethodObjectLikeSlotsInto: jMethod forMethod: method.
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18441
    self rememberJavaMethodObject: jMethod for: method.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18442
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18443
    jMethod 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18444
        instVarNamed: #name       put: (self javaStringObjectForString: (method selector upTo:$() interned: true);
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18445
        instVarNamed: #returnType put: (method descriptor returnClassObject);
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18446
        instVarNamed: #annotationDefault put: (method annotations default bytes);
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18447
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18448
        yourself.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18449
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18450
    ^jMethod
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18451
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18452
    "Created: / 09-02-2011 / 10:29:46 / Marcel Hlopko <hlopik@gmail.com>"
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18453
    "Modified: / 05-12-2011 / 10:02:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18454
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18455
837
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
 18456
javaMethodObjectLikeSlotsInto: jMethod forMethod: method 
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
 18457
    "
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
 18458
       Fill in slots of given instance of java.lang.Method or
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
 18459
       java.lang.Constructor"
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
 18460
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18461
    | desc |
837
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
 18462
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18463
    desc := method descriptor.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18464
    jMethod
837
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
 18465
        instVarNamed: #clazz put: (self javaClassObjectForClass: method javaClass);
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
 18466
        instVarNamed: #slot put: 0;
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
 18467
        instVarNamed: #modifiers put: method accessFlags;
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
 18468
        instVarNamed: #parameterTypes
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
 18469
            put: (self javaClassObjectArrayForClasses: desc parameterClasses);
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
 18470
        instVarNamed: #exceptionTypes
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
 18471
            put: (self javaClassObjectArrayForClasses: method javaExceptionTable);
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
 18472
        instVarNamed: #annotations put: (method annotations runtimeVisible bytes);
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18473
        yourself.
1213
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 18474
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 18475
    method signature notNil ifTrue:[
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 18476
        jMethod                 
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 18477
            instVarNamed: #signature
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 18478
            put: (self javaStringObjectForString: method signature interned: true)
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 18479
    ].
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 18480
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18481
    ^ jMethod
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18482
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18483
    "Created: / 11-02-2011 / 06:44:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
837
8f42226d82c0 slightly refactored exceptionTable methods and their callers.. no typechanging side effects
hlopkmar
parents: 827
diff changeset
 18484
    "Modified: / 04-06-2011 / 17:17:04 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
1213
fc90769151e8 - fix in reflection over methods (signature is nil for non-generic methods)
vranyj1
parents: 1209
diff changeset
 18485
    "Modified: / 04-12-2011 / 19:40:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18486
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18487
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18488
methodForJavaConstructorObject:constructor 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18489
     "given a java.lang.reflect.Constructor, return the corresponding method
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18490
      it."
1216
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18491
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18492
    | slot |
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18493
    slot := constructor instVarNamed: #slot.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18494
    ^realMethods at: slot ifAbsent:[self error: 'No ctor found for java ctor object'].
1216
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18495
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18496
"/    |class signature|
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18497
"/    class := self classForJavaClassObject:(constructor instVarNamed:#clazz).
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18498
"/    signature := Java as_ST_String:(constructor instVarNamed:#signature).
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18499
"/    class methodsDo:[:mthd|
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18500
"/        mthd signature = signature ifTrue:[
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18501
"/            ^mthd
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18502
"/        ].
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18503
"/    ].
913
1781f130b005 signature instvars renamed to descriptor
vranyj1
parents: 912
diff changeset
 18504
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18505
    "Created: / 09-02-2011 / 10:36:07 / Marcel Hlopko <hlopik@gmail.com>"
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18506
    "Modified: / 05-12-2011 / 10:04:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18507
!
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18508
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18509
methodForJavaMethodObject:jmethod 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18510
     "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18511
         Given an instance of java.lang.reflect.Method, answers
913
1781f130b005 signature instvars renamed to descriptor
vranyj1
parents: 912
diff changeset
 18512
         real method associated with it. 
1781f130b005 signature instvars renamed to descriptor
vranyj1
parents: 912
diff changeset
 18513
    "
1216
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18514
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18515
    | slot |
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18516
    slot := jmethod instVarNamed: #slot.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18517
    ^realMethods at: slot ifAbsent:[self error: 'No method found for java method object'].
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18518
1216
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18519
"/    |class name signature |
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18520
"/
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18521
"/    class := self classForJavaClassObject:(aJavaMethodObject instVarNamed:#clazz).
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18522
"/    name := Java as_ST_String:(aJavaMethodObject instVarNamed:#name).
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18523
"/    signature := Java as_ST_String:(aJavaMethodObject instVarNamed:#signature).
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18524
"/    class methodsDo:[:mthd|
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18525
"/        (mthd name = name and:[mthd signature = signature]) ifTrue:[
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18526
"/            ^mthd
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18527
"/        ]
782cf167a96c few more natives (CRC32)
vranyj1
parents: 1213
diff changeset
 18528
"/    ].
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18529
"/    self assert: false description: 'No such method, malformed java.lang.reflect.Method object?'.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18530
"/    ^nil.
913
1781f130b005 signature instvars renamed to descriptor
vranyj1
parents: 912
diff changeset
 18531
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18532
    "Created: / 09-02-2011 / 10:32:14 / Marcel Hlopko <hlopik@gmail.com>"
1217
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18533
    "Modified: / 05-12-2011 / 10:05:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18534
!
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18535
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18536
rememberJavaMethodObject: jmethod for: method
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18537
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18538
    javaMethodsPerMethod at: method put: jmethod.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18539
    realMethods add: method.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18540
    jmethod instVarNamed: #slot put: realMethods size.
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18541
a7d011bc112b - bugfixes in (reflection, finalization)
vranyj1
parents: 1216
diff changeset
 18542
    "Created: / 05-12-2011 / 10:00:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18543
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18544
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18545
!JavaVM::Reflection methodsFor:'reflection - other'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18546
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18547
javaStringObjectForString:string 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18548
    ^ self javaStringObjectForString: string interned: false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18549
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18550
    "Created: / 09-02-2011 / 10:34:57 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18551
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18552
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18553
javaStringObjectForString:string interned:intern  
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18554
    | s |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18555
    s := Java as_String: string.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18556
    ^intern ifTrue:[Java intern: s] ifFalse:[s]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18557
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18558
    "Modified: / 22-11-2010 / 17:57:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18559
    "Created: / 09-02-2011 / 10:34:29 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18560
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18561
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18562
!JavaVM class methodsFor:'documentation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18563
923
b922537eea2a Merged with CVS version
vranyj1
parents: 921
diff changeset
 18564
version
1022
38b710d7dfbc svn properties fixed
vranyj1
parents: 1021
diff changeset
 18565
    ^ '$Id$'
923
b922537eea2a Merged with CVS version
vranyj1
parents: 921
diff changeset
 18566
!
b922537eea2a Merged with CVS version
vranyj1
parents: 921
diff changeset
 18567
b922537eea2a Merged with CVS version
vranyj1
parents: 921
diff changeset
 18568
version_CVS
964
097cdede29f1 Fixes for Windows
vranyj1
parents: 961
diff changeset
 18569
    ^ '§Header: /cvs/stx/stx/libjava/JavaVM.st,v 1.186 2011/08/22 14:49:28 vrany Exp §'
923
b922537eea2a Merged with CVS version
vranyj1
parents: 921
diff changeset
 18570
!
b922537eea2a Merged with CVS version
vranyj1
parents: 921
diff changeset
 18571
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18572
version_SVN
1022
38b710d7dfbc svn properties fixed
vranyj1
parents: 1021
diff changeset
 18573
    ^ '$Id$'
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18574
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 18575
924
7e66564a2302 fix for native sun.reflect.NativeMethodAccessorImpl.invoke0()
vranyj1
parents: 923
diff changeset
 18576
JavaVM initialize!