src/JavaVM.st
author vranyj1
Sat, 07 May 2011 16:18:07 +0000
branchjk_new_structure
changeset 762 d995915ebc0b
parent 761 43e017ec7958
child 772 0f92c23b80ee
permissions -rw-r--r--
Merged with /branches/jk
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     1
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     3
	      All Rights Reserved
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     4
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     5
 This software is furnished under a license and may be used
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    10
 hereby transferred.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    11
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    12
"{ Package: 'stx:libjava' }"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    13
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    14
Object subclass:#JavaVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    15
	instanceVariableNames:''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    16
	classVariableNames:'UnhandledJavaExceptionSignal JavaExceptionSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    17
		UnimplementedInstructionSignal UnimplementedNativeMethodSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    18
		BadMessageSignal InternalErrorSignal CallHandlerSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    19
		FullExceptionTrace StackTrace TraceHistory LockTable
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    20
		LockTableAccess LibPath SimulatedLibs LoadedLibs
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    21
		SimulatedNativeLibs LoadedNativeLibs WaitTable WaitTableAccess
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    22
		JavaWindowGroup KnownWindows DrawOPTrace WindowOPTrace
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    23
		WindowCreationTrace EventTrace ThreadTrace MonitorTrace
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    24
		ExceptionTrace InsnCount InsnCounts FileOpenTrace FileAccessTrace
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    25
		FileOpenConfirmation SocketConnectConfirmation FileIOTrace
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    26
		OpenFileTable CachedNativeMethodTable ExceptionDebug ExitDebug
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    27
		JavaConsoleStream StandardThreadGroup EnteredMonitorsPerProcess
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    28
		JavaMethods DUMMY_LONG_HIGHWORD DUMMY_DOUBLE_HIGHWORD NoAudio
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    29
		FirstWindowCreationSemaphore PermittedDirectories
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    30
		PermittedHostConnects SimulatedOS O_WGgraphics_originX
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    31
		O_WGgraphics_originY O_WGgraphics_pData O_FramePeer_pNativeWidget
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    32
		O_FramePeer_pData ImageStretchCache LastGraphics LastGC
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    33
		EnteredMonitorObject EnteredMonitorObjectCount
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    34
		EnteredMonitorProcess LeftMonitorObject JavaEventThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    35
		JavaScreenUpdaterThread JavaEventQueueThread SystemProperties
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    36
		ExceptionDebugPatterns NullPointerExceptionDebug
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    37
		DivisionByZeroExceptionDebug IOExceptionDebug
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    38
		StdinReplacementFileQuerySignal AssertionsEnabled
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    39
		SimulatedNativeMemory Reflection ZipCache ZipEntryCache
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
    40
		ZipLastModTimesCache ZipInflaters'
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    41
	poolDictionaries:''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    42
	category:'Languages-Java-Support'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    43
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    44
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    45
Object subclass:#Reflection
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
    46
	instanceVariableNames:'vm constantPoolMapping javaClasses javaArrayClasses javaMethods
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
    47
		returnNilIfMissing'
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    48
	classVariableNames:''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    49
	poolDictionaries:''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    50
	privateIn:JavaVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    51
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    52
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    53
!JavaVM class methodsFor:'documentation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    54
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    55
copyright
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    56
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    57
 COPYRIGHT (c) 1997 by eXept Software AG
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    58
	      All Rights Reserved
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    59
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    60
 This software is furnished under a license and may be used
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    61
 only in accordance with the terms of that license and with the
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    62
 inclusion of the above copyright notice.   This software may not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    63
 be provided or otherwise made available to, or used by, any
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    64
 other person.  No title to or ownership of the software is
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    65
 hereby transferred.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    66
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    67
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    68
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    69
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    70
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    71
documentation
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    72
"Runtime support and environment for Java. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    73
You shouldn't communicate with JavaVM directly, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    74
use Java class instead. JavaVM is layer between
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    75
the native interpret and the rest of the system.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    76
JavaVM implements native java virtual machine 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    77
methods called by interpret, hides java primitive 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    78
types handling, and gives the ST world ways to 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    79
control class loading and reflection"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    80
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    81
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    82
nativeMethods
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    83
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    84
    all native methods:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    85
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    86
        JavaMethod allSubInstances select:[:m |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    87
            m isNative 
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
    implemented methods:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    91
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    92
        JavaMethod allSubInstances select:[:m |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    93
            |sel|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    94
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    95
            m isNative ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    96
                sel := ('_' , m javaClass lastName , '_' , m name , ':') asSymbol.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    97
                JavaVM class implements:sel.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    98
            ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
    99
                false
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
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   103
    unimplemented methods:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   104
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   105
        JavaMethod allSubInstances select:[:m |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   106
            |sel|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   107
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   108
            m isNative ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   109
                sel := ('_' , m javaClass lastName , '_' , m name , ':') asSymbol.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   110
                (JavaVM class implements:sel) not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   111
            ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   112
                false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   113
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   114
        ]    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   115
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   116
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   117
    list of all native methods as in jdk1.1.3:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   118
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   119
      X - implemented
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   120
      * - implemented to be validated
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   121
      x - implemented with limited functionality
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   122
      o - implemented as dummy (no functionality)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   123
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   124
    X (Math::double sin (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   125
    X (Math::double cos (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   126
    X (Math::double tan (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   127
    X (Math::double asin (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   128
    X (Math::double acos (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   129
    X (Math::double atan (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   130
    X (Math::double exp (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   131
    X (Math::double log (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   132
    X (Math::double sqrt (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   133
      (Math::double IEEEremainder (double double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   134
    X (Math::double ceil (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   135
    X (Math::double floor (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   136
      (Math::double rint (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   137
      (Math::double atan2 (double double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   138
    X (Math::double pow (double double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   139
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   140
    X (Class::java.lang.Class forName (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   141
    X (Class::java.lang.Object newInstance ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   142
    * (Class::boolean isInstance (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   143
    X (Class::boolean isAssignableFrom (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   144
    X (Class::boolean isInterface ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   145
      (Class::boolean isArray ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   146
    X (Class::boolean isPrimitive ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   147
    X (Class::java.lang.String getName ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   148
    X (Class::java.lang.ClassLoader getClassLoader ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   149
    X (Class::java.lang.Class getSuperclass ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   150
      (Class::java.lang.Class[] getInterfaces ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   151
      (Class::java.lang.Class getComponentType ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   152
      (Class::int getModifiers ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   153
      (Class::java.lang.Object[] getSigners ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   154
      (Class::void setSigners (java.lang.Object[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   155
    X (Class::java.lang.Class getPrimitiveClass (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   156
      (Class::java.lang.reflect.Field getField0 (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   157
      (Class::java.lang.reflect.Field[] getFields0 (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   158
    X (Class::java.lang.reflect.Method getMethod0 (java.lang.String java.lang.Class[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   159
    X (Class::java.lang.reflect.Method[] getMethods0 (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   160
      (Class::java.lang.reflect.Constructor[] getConstructors0 (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   161
      (Class::java.lang.reflect.Constructor getConstructor0 (java.lang.Class[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   162
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   163
    X (InetAddressImpl::java.lang.String getLocalHostName ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   164
    X (InetAddressImpl::void makeAnyLocalAddress (java.net.InetAddress))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   165
    X (InetAddressImpl::byte[][] lookupAllHostAddr (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   166
      (InetAddressImpl::java.lang.String getHostByAddr (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   167
    X (InetAddressImpl::int getInetFamily ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   168
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   169
    X (ResourceBundle::java.lang.Class[] getClassContext ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   170
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   171
    X (System::void setIn0 (java.io.InputStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   172
    X (System::void setOut0 (java.io.PrintStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   173
    X (System::void setErr0 (java.io.PrintStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   174
    X (System::long currentTimeMillis ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   175
    X (System::void arraycopy (java.lang.Object int java.lang.Object int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   176
    X (System::int identityHashCode (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   177
    X (System::java.util.Properties initProperties (java.util.Properties))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   178
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   179
    X (Thread::java.lang.Thread currentThread ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   180
    X (Thread::void yield ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   181
    X (Thread::void sleep (long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   182
    X (Thread::void start ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   183
    X (Thread::boolean isInterrupted (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   184
    X (Thread::boolean isAlive ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   185
      (Thread::int countStackFrames ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   186
    X (Thread::void setPriority0 (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   187
    X (Thread::void stop0 (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   188
    X (Thread::void suspend0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   189
    X (Thread::void resume0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   190
    * (Thread::void interrupt0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   191
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   192
      (String::java.lang.String intern ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   193
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   194
    X (Float::int floatToIntBits (float))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   195
    X (Float::float intBitsToFloat (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   196
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   197
      (ObjectStreamClass::int getClassAccess (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   198
      (ObjectStreamClass::java.lang.String[] getMethodSignatures (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   199
      (ObjectStreamClass::int getMethodAccess (java.lang.Class java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   200
      (ObjectStreamClass::java.lang.String[] getFieldSignatures (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   201
      (ObjectStreamClass::int getFieldAccess (java.lang.Class java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   202
      (ObjectStreamClass::java.io.ObjectStreamField[] getFields0 (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   203
      (ObjectStreamClass::long getSerialVersionUID (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   204
      (ObjectStreamClass::boolean hasWriteObject (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   205
      (ObjectInputStream::java.lang.Class loadClass0 (java.lang.Class java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   206
      (ObjectInputStream::void inputClassFields (java.lang.Object java.lang.Class int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   207
      (ObjectInputStream::java.lang.Object allocateNewObject (java.lang.Class java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   208
      (ObjectInputStream::java.lang.Object allocateNewArray (java.lang.Class int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   209
      (ObjectInputStream::boolean invokeObjectReader (java.lang.Object java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   210
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   211
      (SecurityManager::java.lang.Class[] getClassContext ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   212
    X (SecurityManager::java.lang.ClassLoader currentClassLoader ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   213
      (SecurityManager::int classDepth (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   214
    X (SecurityManager::int classLoaderDepth ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   215
      (SecurityManager::java.lang.Class currentLoadedClass0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   216
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   217
    X (ClassLoader::void init ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   218
    X (ClassLoader::java.lang.Class defineClass0 (java.lang.String byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   219
    X (ClassLoader::void resolveClass0 (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   220
    X (ClassLoader::java.lang.Class findSystemClass0 (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   221
    X (ClassLoader::java.io.InputStream getSystemResourceAsStream0 (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   222
      (ClassLoader::java.lang.String getSystemResourceAsName0 (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   223
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   224
    X (FileDescriptor::boolean valid ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   225
      (FileDescriptor::void sync ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   226
    X (FileDescriptor::java.io.FileDescriptor initSystemFD (java.io.FileDescriptor int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   227
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   228
    X (Object::java.lang.Class getClass ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   229
    X (Object::int hashCode ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   230
    X (Object::java.lang.Object clone ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   231
    X (Object::void notify ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   232
    X (Object::void notifyAll ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   233
    X (Object::void wait (long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   234
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   235
    X (FileOutputStream::void open (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   236
    X (FileOutputStream::void openAppend (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   237
    X (FileOutputStream::void write (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   238
    X (FileOutputStream::void writeBytes (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   239
    X (FileOutputStream::void close ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   240
    X (FileInputStream::void open (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   241
    X (FileInputStream::int read ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   242
    X (FileInputStream::int readBytes (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   243
      (FileInputStream::long skip (long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   244
    X (FileInputStream::int available ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   245
    X (FileInputStream::void close ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   246
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   247
      (VM::int getState ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   248
      (VM::boolean threadsSuspended ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   249
      (VM::void unsuspendThreads ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   250
      (VM::void unsuspendSomeThreads ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   251
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   252
    X (File::boolean exists0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   253
    X (File::boolean canWrite0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   254
    X (File::boolean canRead0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   255
    X (File::boolean isFile0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   256
    X (File::boolean isDirectory0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   257
    X (File::long lastModified0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   258
    X (File::long length0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   259
    X (File::boolean mkdir0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   260
    X (File::boolean renameTo0 (java.io.File))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   261
    X (File::boolean delete0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   262
      (File::boolean rmdir0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   263
    X (File::java.lang.String[] list0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   264
      (File::java.lang.String canonPath (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   265
    X (File::boolean isAbsolute ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   266
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   267
      (ObjectOutputStream::void outputClassFields (java.lang.Object java.lang.Class int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   268
      (ObjectOutputStream::boolean invokeObjectWriter (java.lang.Object java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   269
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   270
    X (Throwable::void printStackTrace0 (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   271
    X (Throwable::java.lang.Throwable fillInStackTrace ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   272
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   273
    X (Double::long doubleToLongBits (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   274
    X (Double::double longBitsToDouble (long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   275
    X (Double::double valueOf0 (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   276
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   277
    X (Runtime::void exitInternal (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   278
    o (Runtime::void runFinalizersOnExit0 (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   279
    o (Runtime::java.lang.Process execInternal (java.lang.String[] java.lang.String[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   280
    X (Runtime::long freeMemory ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   281
    X (Runtime::long totalMemory ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   282
    X (Runtime::void gc ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   283
      (Runtime::void runFinalization ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   284
      (Runtime::void traceInstructions (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   285
      (Runtime::void traceMethodCalls (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   286
    X (Runtime::java.lang.String initializeLinkerInternal ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   287
    X (Runtime::java.lang.String buildLibName (java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   288
    X (Runtime::int loadFileInternal (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   289
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   290
      (WDrawingSurfaceInfo::int lock ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   291
      (WDrawingSurfaceInfo::void unlock ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   292
      (WDrawingSurfaceInfo::int getHWnd ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   293
      (WDrawingSurfaceInfo::int getHBitmap ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   294
      (WDrawingSurfaceInfo::int getPBits ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   295
      (WDrawingSurfaceInfo::int getHDC ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   296
      (WDrawingSurfaceInfo::int getDepth ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   297
      (WDrawingSurfaceInfo::int getHPalette ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   298
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   299
    X (WDefaultFontCharset::boolean canConvert (char))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   300
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   301
      (ColorModel::void deletepData ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   302
    X (WToolkit::void init (java.lang.Thread))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   303
    X (WToolkit::void eventLoop ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   304
      (WToolkit::java.awt.image.ColorModel makeColorModel ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   305
    X (WToolkit::int getScreenResolution ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   306
    X (WToolkit::int getScreenWidth ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   307
    X (WToolkit::int getScreenHeight ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   308
      (WToolkit::void sync ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   309
    * (WToolkit::void beep ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   310
    X (WToolkit::void loadSystemColors (int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   311
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   312
      (WPrintJob::void end ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   313
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   314
    X (WDialogPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   315
    X (WDialogPeer::void _show ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   316
    X (WDialogPeer::void _hide ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   317
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   318
    X (WWindowPeer::void toFront ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   319
    X (WWindowPeer::void toBack ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   320
    X (WWindowPeer::void _setTitle (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   321
    X (WWindowPeer::void _setResizable (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   322
    X (WWindowPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   323
    o (WWindowPeer::void updateInsets (java.awt.Insets))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   324
      (WWindowPeer::java.awt.Component getContainerElement (java.awt.Container int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   325
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   326
    X (WCanvasPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   327
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   328
    X (WTextAreaPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   329
    X (WTextAreaPeer::void insertText (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   330
      (WTextAreaPeer::void replaceText (java.lang.String int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   331
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   332
    X (WTextComponentPeer::java.lang.String getText ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   333
    X (WTextComponentPeer::void setText (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   334
    X (WTextComponentPeer::int getSelectionStart ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   335
    X (WTextComponentPeer::int getSelectionEnd ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   336
    X (WTextComponentPeer::void select (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   337
    X (WTextComponentPeer::void enableEditing (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   338
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   339
    X (WComponentPeer::void show ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   340
    X (WComponentPeer::void hide ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   341
    X (WComponentPeer::void enable ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   342
    X (WComponentPeer::void disable ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   343
    X (WComponentPeer::java.awt.Point getLocationOnScreen ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   344
    X (WComponentPeer::void reshape (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   345
    o (WComponentPeer::void handleEvent (java.awt.AWTEvent))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   346
    o (WComponentPeer::void _dispose ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   347
    X (WComponentPeer::void _setForeground (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   348
    X (WComponentPeer::void _setBackground (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   349
    o (WComponentPeer::void setFont (java.awt.Font))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   350
    o (WComponentPeer::void requestFocus ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   351
    o (WComponentPeer::void setCursor (java.awt.Cursor))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   352
    o (WComponentPeer::void start ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   353
      (WComponentPeer::void _beginValidate ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   354
      (WComponentPeer::void endValidate ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   355
    o (WComponentPeer::void setZOrderPosition (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   356
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   357
    X (WFramePeer::void setMenuBar0 (sun.awt.windows.WMenuBarPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   358
    X (WFramePeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   359
    X (WFramePeer::void _setIconImage (sun.awt.image.ImageRepresentation))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   360
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   361
    o (WFontMetrics::boolean needsConversion (java.awt.Font sun.awt.FontDescriptor))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   362
    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
   363
      (WFontMetrics::int bytesWidth (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   364
      (WFontMetrics::void init ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   365
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   366
    o (WChoicePeer::void select (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   367
    o (WChoicePeer::void remove (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   368
    o (WChoicePeer::void addItem (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   369
    X (WChoicePeer::void reshape (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   370
    X (WChoicePeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   371
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   372
    X (WLabelPeer::void setText (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   373
    o (WLabelPeer::void setAlignment (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   374
    X (WLabelPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   375
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   376
    X (WMenuItemPeer::void _setLabel (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   377
    X (WMenuItemPeer::void create (sun.awt.windows.WMenuPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   378
    X (WMenuItemPeer::void enable (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   379
    o (WMenuItemPeer::void _dispose ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   380
      (WMenuPeer::void addSeparator ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   381
      (WMenuPeer::void delItem (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   382
    X (WMenuPeer::void createMenu (sun.awt.windows.WMenuBarPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   383
      (WMenuPeer::void createSubMenu (sun.awt.windows.WMenuPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   384
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   385
      (WPopupMenuPeer::void createMenu (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   386
      (WPopupMenuPeer::void _show (java.awt.Event))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   387
      (WMenuBarPeer::void addMenu (java.awt.Menu))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   388
      (WMenuBarPeer::void delMenu (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   389
    X (WMenuBarPeer::void create (sun.awt.windows.WFramePeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   390
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   391
      (WCheckboxMenuItemPeer::void setState (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   392
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   393
    X (WFileDialogPeer::void show ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   394
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   395
    X (WCheckboxPeer::void setState (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   396
    X (WCheckboxPeer::void setCheckboxGroup (java.awt.CheckboxGroup))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   397
      (WCheckboxPeer::void setLabel (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   398
    X (WCheckboxPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   399
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   400
    X (WClipboard::void init ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   401
      (WClipboard::void setClipboardText (java.awt.datatransfer.StringSelection))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   402
      (WClipboard::java.lang.String getClipboardText ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   403
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   404
    X (WListPeer::void addItem (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   405
    X (WListPeer::void delItems (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   406
    X (WListPeer::void select (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   407
      (WListPeer::void deselect (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   408
      (WListPeer::void makeVisible (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   409
    X (WListPeer::void setMultipleSelections (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   410
    X (WListPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   411
    X (WListPeer::boolean isSelected (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   412
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   413
    x (WScrollbarPeer::void _setValues (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   414
    x (WScrollbarPeer::void setLineIncrement (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   415
    x (WScrollbarPeer::void setPageIncrement (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   416
    x (WScrollbarPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   417
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   418
    x (ImageRepresentation::void offscreenInit (java.awt.Color))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   419
    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
   420
    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
   421
    x (ImageRepresentation::boolean finish (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   422
    X (ImageRepresentation::void imageDraw (java.awt.Graphics int int java.awt.Color))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   423
    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
   424
    x (ImageRepresentation::void disposeImage ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   425
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   426
    X (WTextFieldPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   427
    X (WTextFieldPeer::void setEchoCharacter (char))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   428
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   429
    X (WScrollPanePeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   430
    o (WScrollPanePeer::int getOffset (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   431
      (WScrollPanePeer::void setInsets ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   432
      (WScrollPanePeer::void setScrollPosition (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   433
    x (WScrollPanePeer::int _getHScrollbarHeight ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   434
    x (WScrollPanePeer::int _getVScrollbarWidth ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   435
    o (WScrollPanePeer::void setSpans (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   436
      (WScrollPanePeer::java.awt.Component getScrollChild ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   437
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   438
      (WEmbeddedFramePeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   439
    X (WButtonPeer::void setLabel (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   440
    X (WButtonPeer::void create (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   441
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   442
    x (WColor::java.awt.Color getDefaultColor (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   443
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   444
    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
   445
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   446
    x (WGraphics::void createFromComponent (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   447
    x (WGraphics::void createFromGraphics (sun.awt.windows.WGraphics))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   448
      (WGraphics::void createFromPrintJob (sun.awt.windows.WPrintJob))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   449
      (WGraphics::void createFromHDC (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   450
    x (WGraphics::void imageCreate (sun.awt.image.ImageRepresentation))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   451
    x (WGraphics::void pSetFont (java.awt.Font))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   452
    X (WGraphics::void pSetForeground (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   453
      (WGraphics::void _dispose ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   454
    x (WGraphics::void dispose ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   455
    x (WGraphics::void setPaintMode ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   456
    x (WGraphics::void setXORMode (java.awt.Color))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   457
    o (WGraphics::java.awt.Rectangle getClipBounds ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   458
    o (WGraphics::void changeClip (int int int int boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   459
      (WGraphics::void removeClip ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   460
    X (WGraphics::void clearRect (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   461
    X (WGraphics::void fillRect (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   462
    X (WGraphics::void drawRect (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   463
      (WGraphics::void drawSFChars (char[] int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   464
    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
   465
      (WGraphics::int drawMFCharsConvertedSegment (java.awt.Font sun.awt.FontDescriptor byte[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   466
      (WGraphics::void drawBytes (byte[] int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   467
    X (WGraphics::void drawLine (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   468
    X (WGraphics::void copyArea (int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   469
    o (WGraphics::void drawRoundRect (int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   470
    o (WGraphics::void fillRoundRect (int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   471
    X (WGraphics::void drawPolygon (int[] int[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   472
      (WGraphics::void drawPolyline (int[] int[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   473
    X (WGraphics::void fillPolygon (int[] int[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   474
    x (WGraphics::void drawOval (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   475
    x (WGraphics::void fillOval (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   476
    x (WGraphics::void drawArc (int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   477
    x (WGraphics::void fillArc (int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   478
      (WGraphics::void print (sun.awt.windows.WComponentPeer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   479
      (WGraphics::void close (sun.awt.windows.WPrintJob))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   480
      (JPEGImageDecoder::void readImage (java.io.InputStream byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   481
    o (OffScreenImageSource::void sendPixels ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   482
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   483
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   484
    additional native methods added by microsoft (sigh):
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   485
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   486
    X (java.lang.String::boolean equals (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   487
    X (java.lang.String::int length (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   488
    o (java.lang.Runtime::void setInputStreamLocalised (java.io.DataInputStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   489
    o (java.lang.Runtime::void setOutputStreamLocalised (java.io.DataOutputStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   490
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   491
      (java.lang.String::int compareTo (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   492
      (java.lang.String::boolean equalsIgnoreCase (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   493
      (java.lang.String::int indexOf (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   494
      (java.lang.String::boolean startsWith (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   495
      (java.lang.String::boolean regionMatches (int java.lang.String int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   496
      (java.lang.String::boolean regionMatches (boolean int java.lang.String int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   497
      (java.lang.String::int lastIndexOf (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   498
      (java.lang.ClassLoader::void resolveClass (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   499
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   500
      (java.lang.ClassLoader::java.lang.Class createArrayClass (java.lang.String java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   501
      (java.io.PrintStream::boolean isOutputStreamLocalised (java.io.DataOutputStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   502
      (java.lang.Runtime::boolean isOutputStreamLocalised (java.io.DataOutputStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   503
      (java.lang.Runtime::boolean isInputStreamLocalised (java.io.DataInputStream))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   504
      (java.lang.ThreadGroup::void initMainThreadGroup0 (java.lang.ThreadGroup))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   505
      (java.lang.System::void validateSecurityManager (java.lang.SecurityManager))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   506
      (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
   507
      (java.io.ObjectOutputStream::void invokeDefaultWriteObject (java.lang.Object java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   508
      (java.io.ObjectOutputStream::void invokeWriteObject (java.lang.Object java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   509
      (java.io.ObjectInputStream::void invokeDefaultReadObject (java.lang.Object java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   510
      (java.io.ObjectInputStream::void invokeReadObject (java.lang.Object java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   511
      (java.util.TimeZone::java.util.TimeZone getWin32TimeZone ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   512
      (java.net.InetAddress::java.lang.Object[] lookupHostByName (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   513
      (java.net.InetAddress::java.lang.Object[] lookupHostByAddr (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   514
      (java.io.ObjectStreamClass::void doMismatchedRead (java.io.ObjectInputStream java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   515
      (java.io.ObjectStreamClass::long getClassDefinedUID (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   516
      (java.io.ObjectStreamClass::boolean findObjectMethod0 (java.lang.Class int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   517
      (java.lang.reflect.Method::java.lang.String getDescriptor ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   518
      (java.lang.reflect.Array::void setShort (java.lang.Object int unsigned short))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   519
      (java.lang.reflect.Array::char getChar (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   520
      (java.lang.reflect.Array::void setChar (java.lang.Object int char))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   521
      (java.lang.reflect.Array::void setDouble (java.lang.Object int double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   522
      (java.lang.reflect.Array::java.lang.Object get (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   523
      (java.lang.reflect.Array::void set (java.lang.Object int java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   524
      (java.lang.reflect.Array::int getInt (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   525
      (java.lang.reflect.Array::void setInt (java.lang.Object int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   526
      (java.lang.reflect.Array::java.lang.Object multiNewArray (java.lang.Class int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   527
      (java.lang.reflect.Array::boolean getBoolean (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   528
      (java.lang.reflect.Array::byte getByte (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   529
      (java.lang.reflect.Array::float getFloat (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   530
      (java.lang.reflect.Array::void setBoolean (java.lang.Object int boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   531
      (java.lang.reflect.Array::long getLong (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   532
      (java.lang.reflect.Array::void setByte (java.lang.Object int byte))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   533
      (java.lang.reflect.Array::void setLong (java.lang.Object int long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   534
      (java.lang.reflect.Array::void setFloat (java.lang.Object int float))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   535
      (java.lang.reflect.Array::java.lang.Object newArray (java.lang.Class int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   536
      (java.lang.reflect.Array::int getLength (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   537
      (java.lang.reflect.Array::unsigned short getShort (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   538
      (java.lang.reflect.Array::double getDouble (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   539
      (java.lang.reflect.Field::void setShort (java.lang.Object unsigned short))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   540
      (java.lang.reflect.Field::char getChar (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   541
      (java.lang.reflect.Field::void setChar (java.lang.Object char))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   542
      (java.lang.reflect.Field::void setDouble (java.lang.Object double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   543
      (java.lang.reflect.Field::java.lang.Object get (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   544
      (java.lang.reflect.Field::void set (java.lang.Object java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   545
      (java.lang.reflect.Field::int getInt (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   546
      (java.lang.reflect.Field::void setInt (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   547
      (java.lang.reflect.Field::boolean getBoolean (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   548
      (java.lang.reflect.Field::byte getByte (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   549
      (java.lang.reflect.Field::float getFloat (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   550
      (java.lang.reflect.Field::long getLong (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   551
      (java.lang.reflect.Field::void setBoolean (java.lang.Object boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   552
      (java.lang.reflect.Field::void setByte (java.lang.Object byte))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   553
      (java.lang.reflect.Field::void setLong (java.lang.Object long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   554
      (java.lang.reflect.Field::void setFloat (java.lang.Object float))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   555
      (java.lang.reflect.Field::int getModifiers ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   556
      (java.lang.reflect.Field::unsigned short getShort (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   557
      (java.lang.reflect.Field::double getDouble (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   558
      (java.lang.reflect.Constructor::java.lang.Object newInstance (java.lang.Object[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   559
      (java.lang.reflect.Constructor::int getModifiers ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   560
      (java.util.zip.Inflater::void setDictionary0 (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   561
      (java.util.zip.Inflater::int getTotalIn0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   562
      (java.util.zip.Inflater::void reset0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   563
      (java.util.zip.Inflater::void end0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   564
      (java.util.zip.Inflater::int inflate0 (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   565
      (java.util.zip.Inflater::int getTotalOut0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   566
      (java.util.zip.Inflater::int getAdler0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   567
      (java.util.zip.CRC32::void update1 (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   568
      (java.util.zip.CRC32::void update (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   569
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   570
      (com.ms.security.PolicyEngine::boolean isSystemClass (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   571
      (com.ms.security.PolicyEngine::void denyPermission (com.ms.security.PermissionID))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   572
      (com.ms.security.PolicyEngine::void revertPermission (com.ms.security.PermissionID))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   573
      (com.ms.security.PolicyEngine::void initPolicyEngine ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   574
      (com.ms.security.PolicyEngine::java.lang.Class _getClassOfCaller (java.lang.Class[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   575
      (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
   576
      (com.ms.security.PolicyEngine::com.ms.security.PermissionDataSet getPermissionsOfClass (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   577
      (com.ms.security.PolicyEngine::void assertPermission (com.ms.security.PermissionID))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   578
      (com.ms.security.PolicyEngine::void deepCheck (com.ms.security.PermissionID java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   579
      (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
   580
      (com.ms.security.PolicyEngine::java.security.Principal getPrincipalOfClass (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   581
      (com.ms.security.permissions.ThreadPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   582
      (com.ms.security.permissions.ThreadPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   583
      (com.ms.security.permissions.RegistryPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   584
      (com.ms.security.permissions.RegistryPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   585
      (com.ms.security.management.ZonePermissions::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   586
      (com.ms.security.management.ZonePermissions::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   587
      (com.ms.security.permissions.UIPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   588
      (com.ms.security.permissions.UIPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   589
      (com.ms.security.permissions.NetIOPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   590
      (com.ms.security.permissions.NetIOPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   591
      (com.ms.security.permissions.ReflectionPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   592
      (com.ms.security.permissions.ReflectionPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   593
      (com.ms.vm.WeakReference::void storeRef (int java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   594
      (com.ms.vm.WeakReference::int allocRef (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   595
      (com.ms.vm.WeakReference::void freeRef (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   596
      (com.ms.vm.WeakReference::java.lang.Object fetchRef (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   597
      (com.ms.dll.DllLib::void CoTaskMemFree (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   598
      (com.ms.dll.DllLib::void CopyWithDstOffset (int float[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   599
      (com.ms.dll.DllLib::void CopyWithDstOffset (int double[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   600
      (com.ms.dll.DllLib::int numParamBytes0 (java.lang.reflect.Method))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   601
      (com.ms.dll.DllLib::void CopyWithDstOffset (int java.lang.Object int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   602
      (com.ms.dll.DllLib::void write2 (java.lang.Object int unsigned short))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   603
      (com.ms.dll.DllLib::void write2 (int int unsigned short))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   604
      (com.ms.dll.DllLib::void write2 (java.lang.Object int char))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   605
      (com.ms.dll.DllLib::void write2 (int int char))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   606
      (com.ms.dll.DllLib::int GlobalAlloc (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   607
      (com.ms.dll.DllLib::void resize (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   608
      (com.ms.dll.DllLib::long read8 (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   609
      (com.ms.dll.DllLib::long read8 (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   610
      (com.ms.dll.DllLib::int lstrcpy (java.lang.StringBuffer int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   611
      (com.ms.dll.DllLib::int lstrlenA (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   612
      (com.ms.dll.DllLib::int read4 (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   613
      (com.ms.dll.DllLib::int CoTaskMemAlloc (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   614
      (com.ms.dll.DllLib::void write8 (java.lang.Object int long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   615
      (com.ms.dll.DllLib::int sizeOf0 (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   616
      (com.ms.dll.DllLib::int getSystemDefaultCharSize ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   617
      (com.ms.dll.DllLib::void write8 (int int long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   618
      (com.ms.dll.DllLib::int read4 (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   619
      (com.ms.dll.DllLib::byte read1 (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   620
      (com.ms.dll.DllLib::byte read1 (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   621
      (com.ms.dll.DllLib::int lstrlen (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   622
      (com.ms.dll.DllLib::void CopyMemoryAnsi (int java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   623
      (com.ms.dll.DllLib::void CopyMemoryAnsi (java.lang.StringBuffer int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   624
      (com.ms.dll.DllLib::boolean isStruct (java.lang.reflect.Field))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   625
      (com.ms.dll.DllLib::boolean GlobalFree (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   626
      (com.ms.dll.DllLib::void internalAttemptCopyPtrToStruct (int java.lang.Object int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   627
      (com.ms.dll.DllLib::int getLastError ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   628
      (com.ms.dll.DllLib::void write4 (java.lang.Object int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   629
      (com.ms.dll.DllLib::void write4 (int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   630
      (com.ms.dll.DllLib::unsigned short read2 (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   631
      (com.ms.dll.DllLib::unsigned short read2 (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   632
      (com.ms.dll.DllLib::void release (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   633
      (com.ms.dll.DllLib::void write1 (java.lang.Object int byte))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   634
      (com.ms.dll.DllLib::void write1 (int int byte))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   635
      (com.ms.dll.DllLib::boolean isStructCls (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   636
      (com.ms.dll.DllLib::void prelink (java.lang.reflect.Method))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   637
      (com.ms.dll.DllLib::void CopyMemoryUni (int java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   638
      (com.ms.dll.DllLib::void CopyMemoryUni (java.lang.StringBuffer int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   639
      (com.ms.dll.DllLib::void internalAttemptCopyStructToPtr (java.lang.Object int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   640
      (com.ms.dll.DllLib::void CopyWithSrcOffset (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   641
      (com.ms.dll.DllLib::void CopyWithSrcOffset (byte[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   642
      (com.ms.dll.DllLib::void CopyWithSrcOffset (char[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   643
      (com.ms.dll.DllLib::void CopyWithSrcOffset (unsigned short[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   644
      (com.ms.dll.DllLib::void CopyWithSrcOffset (int[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   645
      (com.ms.dll.DllLib::void CopyWithSrcOffset (long[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   646
      (com.ms.dll.DllLib::void CopyWithSrcOffset (float[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   647
      (com.ms.dll.DllLib::void CopyWithSrcOffset (double[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   648
      (com.ms.dll.DllLib::void CopyWithSrcOffset (java.lang.Object int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   649
      (com.ms.dll.DllLib::void CopyWithDstOffset (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   650
      (com.ms.dll.DllLib::int lstrlenW (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   651
      (com.ms.dll.DllLib::void CopyWithDstOffset (int byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   652
      (com.ms.dll.DllLib::void CopyWithDstOffset (int char[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   653
      (com.ms.dll.DllLib::void CopyWithDstOffset (int unsigned short[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   654
      (com.ms.dll.DllLib::void CopyWithDstOffset (int int[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   655
      (com.ms.dll.DllLib::void CopyWithDstOffset (int long[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   656
      (com.ms.dll.DllLib::int internalGetStructAddr (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   657
      (com.ms.dll.DllLib::int offsetOf (java.lang.reflect.Field))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   658
      (com.ms.dll.DllLib::int lstrcpy (int java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   659
      (com.ms.dll.DllLib::int sizeOf (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   660
      (com.ms.lang.RegKey::com.ms.lang.RegKeyEnumValue pRegEnumValue (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   661
      (com.ms.lang.RegKey::java.lang.String pRegQueryStringValue (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   662
      (com.ms.lang.RegKey::byte[] pRegQueryBinaryValue (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   663
      (com.ms.lang.RegKey::int pRegQueryIntValue (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   664
      (com.ms.lang.RegKey::void pRegSetStringValue (java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   665
      (com.ms.lang.RegKey::void pRegSetIntValue (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   666
      (com.ms.lang.RegKey::void pRegSetBinaryValue (java.lang.String byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   667
      (com.ms.lang.RegKey::void pRegDeleteValue (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   668
      (com.ms.lang.RegKey::void pRegFlushKey ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   669
      (com.ms.lang.RegKey::void pRegDeleteKey (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   670
      (com.ms.lang.RegKey::void pRegOpenBaseKey (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   671
      (com.ms.lang.RegKey::void pRegOpenKey (com.ms.lang.RegKey java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   672
      (com.ms.lang.RegKey::int pRegQueryInfoKey (com.ms.lang.RegQueryInfo))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   673
      (com.ms.lang.RegKey::void pRegUnLoadKey (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   674
      (com.ms.lang.RegKey::void pRegCreateKey (com.ms.lang.RegKey java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   675
      (com.ms.lang.RegKey::void pRegRestoreKey (java.lang.String boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   676
      (com.ms.lang.RegKey::void pRegLoadKey (java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   677
      (com.ms.lang.RegKey::void pRegCloseKey ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   678
      (com.ms.lang.RegKey::java.lang.String pRegEnumKey (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   679
      (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
   680
      (com.ms.awt.peer.NativeServices::int pGetKeyboardLayouts (int[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   681
      (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
   682
      (com.ms.awt.peer.NativeServices::int getColourDataDepth ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   683
      (com.ms.awt.peer.NativeServices::java.lang.String pGetFontEnumeratedFamily (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   684
      (com.ms.awt.peer.NativeServices::int pNewFontEnumeration ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   685
      (com.ms.awt.peer.NativeServices::int getScreenClipRgn (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   686
      (com.ms.awt.peer.NativeServices::int pSetKeyboardLayout (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   687
      (com.ms.awt.peer.NativeServices::void ClipboardInit (com.ms.awt.peer.IToolkit))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   688
      (com.ms.awt.peer.NativeServices::void getDeviceCaps (int int[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   689
      (com.ms.awt.peer.NativeServices::void getAfcMetrics (int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   690
      (com.ms.awt.peer.NativeServices::void setUserLocale (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   691
      (com.ms.awt.peer.NativeServices::void getDCDI (com.ms.awt.peer.DirectColourDataInfo))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   692
      (com.ms.awt.peer.NativeServices::int pGetNumKeyboardLayouts ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   693
      (com.ms.awt.peer.NativeServices::void getIndexedColours (byte[] byte[] byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   694
      (com.ms.awt.peer.NativeServices::int getNativeFont (java.lang.String int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   695
      (com.ms.awt.peer.NativeServices::int pGetKeyboardLayout ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   696
      (com.ms.awt.peer.NativeServices::int getSystemLCID ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   697
      (com.ms.awt.peer.NativeServices::void caretSetPos (int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   698
      (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
   699
      (com.ms.awt.peer.NativeServices::java.lang.String ClipboardGetText ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   700
      (com.ms.awt.peer.NativeServices::int systemMetric (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   701
      (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
   702
      (com.ms.awt.peer.NativeServices::void caretHide (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   703
      (com.ms.awt.peer.NativeServices::int chooseColor (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   704
      (com.ms.awt.peer.NativeServices::java.lang.String pGetKeyboardLayoutName (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   705
      (com.ms.awt.peer.NativeServices::int matchFontAndLanguage (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   706
      (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
   707
      (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
   708
      (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
   709
      (com.ms.awt.peer.NativeServices::void caretDispose (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   710
      (com.ms.awt.peer.NativeServices::void caretShow (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   711
      (com.ms.awt.peer.NativeServices::void deleteObject (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   712
      (com.ms.awt.peer.NativeServices::void setDebugOutput (com.ms.awt.peer.COMPrintCallback))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   713
      (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
   714
      (com.ms.awt.peer.NativeServices::int getSystemColourValue (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   715
      (com.ms.awt.peer.NativeServices::void caretCreate (int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   716
      (com.ms.awt.peer.NativeServices::void ClipboardSetText (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   717
      (com.ms.awt.peer.NativeServices::void println (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   718
      (com.ms.security.SecurityClassLoader::boolean getSecureState ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   719
      (com.ms.security.SecurityClassLoader::void setSecureState (java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   720
      (com.ms.security.SecurityClassLoader::java.lang.Class internalDefineClass (java.lang.String byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   721
      (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
   722
      (com.ms.security.SecurityClassLoader::java.util.Hashtable getHashTable ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   723
      (com.ms.security.auditing.SecurityAuditor::boolean isThreadAuditingEnabled ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   724
      (com.ms.security.auditing.SecurityAuditor::void disableThreadAuditing ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   725
      (com.ms.security.auditing.SecurityAuditor::void enableThreadAuditing ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   726
      (com.ms.security.auditing.SecurityAuditor::void initSecurityAuditor ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   727
      (com.ms.security.PermissionDataSet::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   728
      (com.ms.security.PermissionDataSet::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   729
      (com.ms.lang.SystemX::int pAnsiToUnicode (byte[] char[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   730
      (com.ms.lang.SystemX::int pQueryUnicodeToAnsi (char[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   731
      (com.ms.lang.SystemX::void gc ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   732
      (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
   733
      (com.ms.lang.SystemX::int pUnicodeToAnsi (char[] byte[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   734
      (com.ms.lang.SystemX::boolean isLocalCharDBCSLeadByte (byte))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   735
      (com.ms.lang.SystemX::int pQueryAnsiToUnicode (byte[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   736
      (com.ms.lang.SystemX::boolean isBaseDBCS ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   737
      (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
   738
      (com.ms.packagemanager.JavaPackage::byte[] nativeGetSigner (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   739
      (com.ms.packagemanager.JavaPackage::byte[] nativeGetCapabilities (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   740
      (com.ms.com._Guid::void IIDFromString (java.lang.String com.ms.com._Guid))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   741
      (com.ms.com._Guid::java.lang.String StringFromIID (com.ms.com._Guid))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   742
      (com.ms.security.auditing.PrintStreamAuditor::int GetModuleHandle (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   743
      (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
   744
      (com.ms.security.permissions.CustomPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   745
      (com.ms.security.permissions.CustomPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   746
      (com.ms.security.permissions.X509Signer::boolean pLoad (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   747
      (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
   748
      (com.ms.packagemanager.PackageManager::java.lang.Object nativeGetPackage (java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   749
      (com.ms.packagemanager.PackageManager::java.lang.String[] nativeGetBeansList ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   750
      (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
   751
      (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
   752
      (com.ms.security.permissions.UserFileIOPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   753
      (com.ms.security.permissions.UserFileIOPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   754
      (com.ms.security.permissions.PropertyPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   755
      (com.ms.security.permissions.PropertyPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   756
      (com.ms.security.permissions.ClientStoragePermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   757
      (com.ms.security.permissions.ClientStoragePermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   758
      (com.ms.security.permissions.ExecutionPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   759
      (com.ms.security.permissions.ExecutionPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   760
      (com.ms.util.EventLog::boolean DeregisterEventSource (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   761
      (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
   762
      (com.ms.util.EventLog::int RegisterEventSource (java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   763
      (com.ms.applet.BrowserAppletFrame::void signalViewChange (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   764
      (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
   765
      (com.ms.applet.BrowserAppletFrame::void showSystemStatus (int int boolean java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   766
      (com.ms.applet.BrowserAppletFrame::com.ms.security.management.SecurityPolicy getSecurityPolicy0 (int java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   767
      (com.ms.applet.BrowserAppletFrame::void setDownloadState (int boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   768
      (com.ms.applet.BrowserAppletFrame::int GetSystemDefaultLCID ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   769
      (com.ms.applet.BrowserAppletFrame::void requestResize (int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   770
      (com.ms.applet.BrowserAppletFrame::void signalObjectLoadDone (int boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   771
      (com.ms.applet.BrowserAppletFrame::com.ms.applet.BrowserAppletFrame findOfflineContext ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   772
      (com.ms.applet.BrowserAppletFrame::void showStatus0 (int java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   773
      (com.ms.applet.BrowserAppletFrame::boolean checkGlobalOfflineMode0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   774
      (com.ms.applet.BrowserAppletFrame::void showDocument0 (int java.lang.String java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   775
      (com.ms.security.permissions.SystemStreamsPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   776
      (com.ms.security.permissions.SystemStreamsPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   777
      (com.ms.security.permissions.FileIOPermission::byte[] pEncodeAsn ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   778
      (com.ms.security.permissions.FileIOPermission::boolean pDecodeAsn (byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   779
      (com.ms.com.ComLib::int newGCHandle (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   780
      (com.ms.com.ComLib::java.lang.Object derefGCHandle (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   781
      (com.ms.com.ComLib::void dprinthelper (char[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   782
      (com.ms.com.ComLib::void release (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   783
      (com.ms.com.ComLib::int jcdwClassSizeOf (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   784
      (com.ms.com.ComLib::int jcdwOffsetOf (java.lang.Object java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   785
      (com.ms.com.ComLib::int jcdwClassOffsetOf (java.lang.Class java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   786
      (com.ms.com.ComLib::boolean isJavaOwned (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   787
      (com.ms.com.ComLib::void brk (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   788
      (com.ms.com.ComLib::void setDataWrapperSize (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   789
      (com.ms.com.ComLib::void brk (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   790
      (com.ms.com.ComLib::void setJCDWHomeThread (java.lang.Object java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   791
      (com.ms.com.ComLib::void propagateOwnership (java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   792
      (com.ms.com.ComLib::void threadStartMTA (java.lang.Thread))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   793
      (com.ms.com.ComLib::void IENVNextMarshalerJ2C (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   794
      (com.ms.com.ComLib::boolean supportsInterface (java.lang.Object com.ms.com._Guid))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   795
      (com.ms.com.ComLib::java.lang.Object ptrToStruct (java.lang.Class int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   796
      (com.ms.com.ComLib::int jcdwSizeOf (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   797
      (com.ms.com.ComLib::void declareMessagePumpThread ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   798
      (com.ms.com.ComLib::void IENVNextMarshalerC2J (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   799
      (com.ms.com.ComLib::void freeGCHandle (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   800
      (com.ms.com.ComLib::boolean isEqualUnknown (java.lang.Object java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   801
      (com.ms.com.Dispatch::boolean NIsArray (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   802
      (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
   803
      (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
   804
      (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
   805
      (com.ms.com.Variant::int toInt ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   806
      (com.ms.com.Variant::double toDate ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   807
      (com.ms.com.Variant::boolean toBoolean ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   808
      (com.ms.com.Variant::double toDouble ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   809
      (com.ms.com.Variant::long toCurrency ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   810
      (com.ms.com.Variant::void putVariantArray (com.ms.com.Variant[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   811
      (com.ms.com.Variant::com.ms.com.Variant[] getVariantArray ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   812
      (com.ms.com.Variant::void putByteArray (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   813
      (com.ms.com.Variant::void putShortRef (unsigned short))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   814
      (com.ms.com.Variant::void putIntRef (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   815
      (com.ms.com.Variant::void putDoubleRef (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   816
      (com.ms.com.Variant::void putDateRef (double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   817
      (com.ms.com.Variant::void putStringRef (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   818
      (com.ms.com.Variant::unsigned short getShortRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   819
      (com.ms.com.Variant::int getIntRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   820
      (com.ms.com.Variant::double getDoubleRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   821
      (com.ms.com.Variant::double getDateRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   822
      (com.ms.com.Variant::java.lang.String getStringRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   823
      (com.ms.com.Variant::java.lang.String internalToString ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   824
      (com.ms.com.Variant::void initSafeArrayByRef (com.ms.com.SafeArray int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   825
      (com.ms.com.Variant::java.lang.Object toCharArray ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   826
      (com.ms.com.Variant::java.lang.Object toDispatch ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   827
      (com.ms.com.Variant::byte toByte ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   828
      (com.ms.com.Variant::java.lang.Object getDispatch ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   829
      (com.ms.com.Variant::void putDispatch (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   830
      (com.ms.com.Variant::boolean getBoolean ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   831
      (com.ms.com.Variant::int toError ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   832
      (com.ms.com.Variant::java.lang.Object toObject ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   833
      (com.ms.com.Variant::void initSafeArrayByVal (com.ms.com.SafeArray int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   834
      (com.ms.com.Variant::java.lang.Object getObject ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   835
      (com.ms.com.Variant::void putObject (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   836
      (com.ms.com.Variant::com.ms.com.SafeArray toSafeArrayHelper (java.lang.Class))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   837
      (com.ms.com.Variant::void putFloatRef (float))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   838
      (com.ms.com.Variant::void putCurrencyRef (long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   839
      (com.ms.com.Variant::void putErrorRef (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   840
      (com.ms.com.Variant::void putBooleanRef (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   841
      (com.ms.com.Variant::void putObjectRef (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   842
      (com.ms.com.Variant::void putByteRef (byte))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   843
      (com.ms.com.Variant::java.lang.String getString ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   844
      (com.ms.com.Variant::void putString (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   845
      (com.ms.com.Variant::float getFloatRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   846
      (com.ms.com.Variant::long getCurrencyRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   847
      (com.ms.com.Variant::int getErrorRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   848
      (com.ms.com.Variant::boolean getBooleanRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   849
      (com.ms.com.Variant::java.lang.Object getObjectRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   850
      (com.ms.com.Variant::byte getByteRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   851
      (com.ms.com.Variant::float toFloat ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   852
      (com.ms.com.Variant::void putCharArray (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   853
      (com.ms.com.Variant::void putDispatchRef (java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   854
      (com.ms.com.Variant::java.lang.Object getDispatchRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   855
      (com.ms.com.Variant::void putVariantArrayRef (com.ms.com.Variant[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   856
      (com.ms.com.Variant::com.ms.com.Variant[] getVariantArrayRef ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   857
      (com.ms.com.Variant::void changeType (unsigned short))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   858
      (com.ms.com.Variant::void ncloneIndirect (com.ms.com.Variant))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   859
      (com.ms.com.Variant::void nFinalize (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   860
      (com.ms.com.Variant::void nclone (com.ms.com.Variant))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   861
      (com.ms.com.Variant::unsigned short toShort ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   862
      (com.ms.com.Variant::void putSafeArrayRefHelper (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   863
      (com.ms.com.Variant::com.ms.com.Variant[] toVariantArray ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   864
      (com.ms.com.Variant::java.lang.Object toByteArray ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   865
      (com.ms.com.Variant::void TrueVariantClear ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   866
      (com.ms.awt.WToolkit::boolean MessageBeep (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   867
      (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
   868
      (com.ms.applet.AppletPanel::void securedCall0 (int java.lang.Object))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   869
      (com.ms.applet.AppletPanel::com.ms.security.PermissionSet getDefaultPermissionsFromLoader (com.ms.vm.loader.URLClassLoader))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   870
      (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
   871
      (com.ms.awt.WGuiCallback::boolean SetEvent (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   872
      (com.ms.awt.WGuiCallback::int CreateSemaphore (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   873
      (com.ms.awt.WGuiCallback::int ReleaseSemaphore (int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   874
      (com.ms.awt.WGuiCallback::void userYield (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   875
      (com.ms.awt.WGuiCallback::int MsgWaitForMultipleObjects (int int[] boolean int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   876
      (com.ms.awt.WGuiCallback::int CreateEvent (int boolean boolean int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   877
      (com.ms.activeX.ActiveXToolkit::int GetSysColor (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   878
      (com.ms.awt.peer.NativeGraphics::void setPageDimension (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   879
      (com.ms.awt.peer.NativeGraphics::void setBkColour (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   880
      (com.ms.awt.peer.NativeGraphics::void getClipBounds (com.ms.awt.peer.NativeRect int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   881
      (com.ms.awt.peer.NativeGraphics::void pGetCharOutline (int byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   882
      (com.ms.awt.peer.NativeGraphics::void drawLine (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   883
      (com.ms.awt.peer.NativeGraphics::void setXORMode (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   884
      (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
   885
      (com.ms.awt.peer.NativeGraphics::int getCoClass ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   886
      (com.ms.awt.peer.NativeGraphics::void drawArc (int int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   887
      (com.ms.awt.peer.NativeGraphics::void getInitialPageDimension (com.ms.awt.peer.NativeRect))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   888
      (com.ms.awt.peer.NativeGraphics::void setVisRgn (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   889
      (com.ms.awt.peer.NativeGraphics::void pSetForeground (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   890
      (com.ms.awt.peer.NativeGraphics::int pGetDC ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   891
      (com.ms.awt.peer.NativeGraphics::void drawPixels (int[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   892
      (com.ms.awt.peer.NativeGraphics::void drawPolygon (int[] int[] int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   893
      (com.ms.awt.peer.NativeGraphics::void createFromImage (com.ms.awt.peer.INativeImage))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   894
      (com.ms.awt.peer.NativeGraphics::void endPage ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   895
      (com.ms.awt.peer.NativeGraphics::int pGetCharOutlineSize (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   896
      (com.ms.awt.peer.NativeGraphics::void pDrawBezier (int int int[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   897
      (com.ms.awt.peer.NativeGraphics::int drawBytes (byte[] int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   898
      (com.ms.awt.peer.NativeGraphics::void changeClip (int int int int boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   899
      (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
   900
      (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
   901
      (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
   902
      (com.ms.awt.peer.NativeGraphics::void endPrintJob ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   903
      (com.ms.awt.peer.NativeGraphics::void pSetOrigin (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   904
      (com.ms.awt.peer.NativeGraphics::void createFromHDC (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   905
      (com.ms.awt.peer.NativeGraphics::void drawOval (int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   906
      (com.ms.awt.peer.NativeGraphics::int pSetFont (java.lang.String int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   907
      (com.ms.awt.peer.NativeGraphics::void setPaintMode (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   908
      (com.ms.awt.peer.NativeGraphics::void startPage ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   909
      (com.ms.awt.peer.NativeGraphics::void clearClip ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   910
      (com.ms.awt.peer.NativeGraphics::void createFromCopy (com.ms.awt.peer.INativeGraphics))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   911
      (com.ms.awt.peer.NativeGraphics::void scanLines (int int[] int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   912
      (com.ms.awt.peer.NativeGraphics::void drawRoundRect (int int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   913
      (com.ms.awt.peer.NativeGraphics::void dispose ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   914
      (com.ms.awt.peer.NativeGraphics::void clearRect (int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   915
      (com.ms.awt.peer.NativeGraphics::void copyArea (int int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   916
      (com.ms.awt.peer.NativeGraphics::void createFromWindow (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   917
      (com.ms.awt.peer.NativeGraphics::void drawPolyline (int[] int[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   918
      (com.ms.awt.peer.NativeGraphics::void drawRect (int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   919
      (com.ms.awt.peer.CToolkit::void callbackEventLoop (com.ms.awt.peer.IToolkitCallback))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   920
      (com.ms.awt.peer.CToolkit::int getToolkitHwnd ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   921
      (com.ms.awt.peer.CToolkit::int createCompHwnd (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   922
      (com.ms.awt.peer.CNativeSystemIME::void setCompositionFont (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   923
      (com.ms.awt.peer.CNativeSystemIME::void setCompositionPos (int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   924
      (com.ms.awt.peer.CNativeSystemIME::void setOpenStatus (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   925
      (com.ms.awt.peer.CNativeSystemIME::int getOpenStatus (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   926
      (com.ms.awt.peer.CNativeSystemIME::java.lang.String getCompositionString (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   927
      (com.ms.awt.peer.CNativeSystemIME::java.lang.String getCompositionResultString (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   928
      (com.ms.net.wininet.WininetStreamHandlerFactory::int initNative (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   929
      (com.ms.com.SafeArray::void rawGetVariantAs (int com.ms.com.Variant))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   930
      (com.ms.com.SafeArray::void NSafeArrayInit (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   931
      (com.ms.com.SafeArray::float rawGetDouble (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   932
      (com.ms.com.SafeArray::void NRawBoolCopyToJavaArray (int int boolean[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   933
      (com.ms.com.SafeArray::void validateArray (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   934
      (com.ms.com.SafeArray::void NSafeArrayCreateFromString (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   935
      (com.ms.com.SafeArray::void rawSetString (int java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   936
      (com.ms.com.SafeArray::int getInt (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   937
      (com.ms.com.SafeArray::void setInt (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   938
      (com.ms.com.SafeArray::boolean getBoolean (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   939
      (com.ms.com.SafeArray::void setBoolean (int boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   940
      (com.ms.com.SafeArray::int computeOffset (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   941
      (com.ms.com.SafeArray::void NSafeArrayNullInit ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   942
      (com.ms.com.SafeArray::void rawSetVariant (int com.ms.com.Variant))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   943
      (com.ms.com.SafeArray::float rawGetFloat (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   944
      (com.ms.com.SafeArray::float getFloat (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   945
      (com.ms.com.SafeArray::void setFloat (int float))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   946
      (com.ms.com.SafeArray::int computeOffset2 (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   947
      (com.ms.com.SafeArray::void rawSetDouble (int double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   948
      (com.ms.com.SafeArray::java.lang.String asString ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   949
      (com.ms.com.SafeArray::void NRawCopyToJavaArray (int int java.lang.Object int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   950
      (com.ms.com.SafeArray::void NSafeArrayCreate (int int int[] int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   951
      (com.ms.com.SafeArray::void NRawBoolCopyFromJavaArray (boolean[] int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   952
      (com.ms.com.SafeArray::void NSafeArrayDestroy (boolean boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   953
      (com.ms.com.SafeArray::int NSafeArrayCopy ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   954
      (com.ms.com.SafeArray::int rawGetInt (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   955
      (com.ms.com.SafeArray::boolean rawGetBoolean (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   956
      (com.ms.com.SafeArray::void rawSetFloat (int float))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   957
      (com.ms.com.SafeArray::java.lang.String rawGetString (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   958
      (com.ms.com.SafeArray::int NTotalNumElems ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   959
      (com.ms.com.SafeArray::double getDouble (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   960
      (com.ms.com.SafeArray::void setDouble (int double))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   961
      (com.ms.com.SafeArray::void Nreinit (com.ms.com.SafeArray))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   962
      (com.ms.com.SafeArray::int getPhysicalSafeArray ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   963
      (com.ms.com.SafeArray::int NgetdwordAt (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   964
      (com.ms.com.SafeArray::void NRawCopyFromJavaArray (java.lang.Object int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   965
      (com.ms.com.SafeArray::void rawSetBoolean (int boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   966
      (com.ms.com.SafeArray::void rawSetInt (int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   967
      (com.ms.awt.peer.CNativeComponent::void invalidate (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   968
      (com.ms.awt.peer.CNativeComponent::void hideModal ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   969
      (com.ms.awt.peer.CNativeComponent::void hide ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   970
      (com.ms.awt.peer.CNativeComponent::void setOnTop (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   971
      (com.ms.awt.peer.CNativeComponent::void registerDragDrop ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   972
      (com.ms.awt.peer.CNativeComponent::void endValidate ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   973
      (com.ms.awt.peer.CNativeComponent::void enable ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   974
      (com.ms.awt.peer.CNativeComponent::void disable ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   975
      (com.ms.awt.peer.CNativeComponent::void setTitle (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   976
      (com.ms.awt.peer.CNativeComponent::void getBounds (com.ms.awt.peer.NativeRect))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   977
      (com.ms.awt.peer.CNativeComponent::int gethwnd ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   978
      (com.ms.awt.peer.CNativeComponent::void showModal ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   979
      (com.ms.awt.peer.CNativeComponent::void setCursor (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   980
      (com.ms.awt.peer.CNativeComponent::void reshape (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   981
      (com.ms.awt.peer.CNativeComponent::void requestFocus ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   982
      (com.ms.awt.peer.CNativeComponent::void callDefWindowProc (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   983
      (com.ms.awt.peer.CNativeComponent::void registerCustomDropTarget (com.ms.com.IUnknown))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   984
      (com.ms.awt.peer.CNativeComponent::void setNoActivate (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   985
      (com.ms.awt.peer.CNativeComponent::void getPlaceOnScreen (com.ms.awt.peer.NativeRect))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   986
      (com.ms.awt.peer.CNativeComponent::void beginValidate ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   987
      (com.ms.awt.peer.CNativeComponent::void clippedReshape (int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   988
      (com.ms.awt.peer.CNativeComponent::void setResizable (boolean))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   989
      (com.ms.awt.peer.CNativeComponent::void setIcon (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   990
      (com.ms.awt.peer.CNativeComponent::void toBack ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   991
      (com.ms.awt.peer.CNativeComponent::void setFrameHost (com.ms.awt.peer.IBrowserAppletFrameCallback))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   992
      (com.ms.awt.peer.CNativeComponent::void toFront ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   993
      (com.ms.awt.peer.CNativeComponent::void show ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   994
      (com.ms.awt.peer.CNativeComponent::void updateInsets (com.ms.awt.peer.NativeInsets))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   995
      (com.ms.awt.peer.CNativeComponent::void dispose ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   996
      (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
   997
      (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
   998
      (com.ms.awt.peer.CNativeComponent::void beginDrag (com.ms.awt.peer.INativeDragCallback))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
   999
      (com.ms.fx.RegionConverter::int computeNativeRegion (int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1000
      (com.ms.fx.RegionConverter::int[] computeJavaRegion (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1001
      (com.ms.net.wininet.URLUtils::java.lang.String canonicalizeURL (java.lang.String int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1002
      (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
  1003
      (com.ms.awt.peer.NativeFontMetrics::int bytesWidth (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1004
      (com.ms.awt.peer.NativeFontMetrics::int stringWidth (java.lang.String int int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1005
      (com.ms.awt.peer.NativeFontMetrics::int charsWidth (char[] int int int int[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1006
      (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
  1007
      (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
  1008
      (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
  1009
      (com.ms.security.management.SecurityZone::byte[] pLoadCustomPermissions (int int java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1010
      (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
  1011
      (com.ms.awt.peer.NativeImage::void create (int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1012
      (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
  1013
      (com.ms.awt.peer.NativeImage::int getCoClass ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1014
      (com.ms.awt.peer.NativeImage::int getIcon (int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1015
      (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
  1016
      (com.ms.awt.peer.NativeImage::void sendPixels (com.ms.awt.peer.SPData))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1017
      (com.ms.awt.peer.NativeImage::void fillPixels (com.ms.awt.peer.SPData byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1018
      (com.ms.awt.peer.NativeImage::void dispose ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1019
      (com.ms.awt.peer.NativeImage::void init (int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1020
      (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
  1021
      (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
  1022
      (com.ms.awt.peer.NativeImage::int finish (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1023
      (com.ms.awt.peer.NativeImage::void imageDraw (int int int int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1024
      (com.ms.awt.peer.NativeResource::java.lang.String loadString (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1025
      (com.ms.awt.peer.NativeResource::int openDialogFromID (int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1026
      (com.ms.awt.peer.NativeResource::boolean attach (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1027
      (com.ms.awt.peer.NativeResource::void loadBytes (int int java.lang.String byte[] int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1028
      (com.ms.awt.peer.NativeResource::int getSize (int int java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1029
      (com.ms.awt.peer.NativeResource::void detach ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1030
      (com.ms.awt.peer.NativeResource::int openDialogFromName (java.lang.String))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1031
      (com.ms.net.wininet.WininetURLConnection::com.ms.applet.BrowserAppletFrame findOfflineContext ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1032
      (com.ms.com.DispatchProxy::void finalize ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1033
      (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
  1034
      (com.ms.net.wininet.WininetInputStream::void close ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1035
      (com.ms.net.wininet.WininetInputStream::int read (byte[] int int))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1036
      (com.ms.net.wininet.WininetInputStream::int available ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1037
      (com.ms.net.wininet.WininetInputStream::long skip (long))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1038
      (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
  1039
      (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
  1040
      (com.ms.net.wininet.http.HttpInputStream::byte[] getResponseHeaders ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1041
      (com.ms.net.wininet.http.HttpInputStream::void close0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1042
      (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
  1043
      (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
  1044
      (com.ms.vm.loader.CabCracker::void getBytes0 (int int byte[]))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1045
      (com.ms.vm.loader.CabCracker::void cleanup ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1046
      (com.ms.vm.loader.CabCracker::int GetTempPath (int java.lang.StringBuffer))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1047
      (com.ms.vm.loader.CabCracker::void load0 ())
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1048
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1049
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1050
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1051
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1052
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1053
performance
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1054
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1055
     JAVA::BenchMark new loopmark        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1056
     JAVA::BenchMark new logicmark  
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1057
     JAVA::BenchMark new sievemark       
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1058
     JAVA::BenchMark new methodmark      
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1059
     JAVA::BenchMark new stringmark  
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1060
     JAVA::BenchMark new newstringmark                
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1061
     JAVA::BenchMark new neweststringmark               
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1062
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1063
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1064
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1065
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1066
		    caffmark  loopmark  logicmark  sievemark  methodmark  stringmark  float  image  graphic dialog newstringmark  neweststringmark
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1067
 linux:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1068
   P6/233 No JIT                 84         87        90          40          22                                       17              10
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1069
		      103       133        142       137          28          73       109    167     18    140
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1070
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1071
   P6/233 JIT                   479       2459       393         649          28                                       21              12
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1072
   P6/233 JIT         473      1805       3046       439         986          28                                       21              12
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1073
		      533      1808       3382       613        1003          25       105    143      1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1074
		      668      3330       3644       740
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1075
		      793      4116       3731      1243        1365         120       103     79      2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1076
		      914      4480       4061                  2290          68       106    158     19     34
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1077
		      941      4607       4149      1238        2434          75       101    152     18     32
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1078
									     591              164
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1079
		     1087                           1836                     800       110                   35
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1080
		     1102      4592       4270      1844        2381         841       109    169     21     35
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1081
		     1177      4608       4309      1810        2432         895       532    182     20     35
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
 w95
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1085
   P5/200 JIT          90        95         90        95         686          18        60     54      7
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1086
		      428      1657       2385       684         957          21        61     62      9
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1087
		      541      2886       2589       823         976          18        62     55      7
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1088
		      583      3062       2635       842         861         223        65     57      8
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1089
		      616      3075       2438      1081        1324         218        64     54      8
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1090
		      718      3138       2755      1085        1200         816        63     48      9      7
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1091
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1092
		    caffmark  loopmark  logicmark  sievemark  methodmark  stringmark  float  image  graphic dialog newstringmark  neweststringmark
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1093
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1094
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1095
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1096
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1097
performance2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1098
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1099
     symantec benchmarks
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1100
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1101
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
		BubbleSort    BidirBubbleSort  QuickSort  Sieve   Hanoi   Dhry   Fib   Array   Tree   Total
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1105
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1106
   ST/X+J Linux         
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1107
   233Mhz P6
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1108
   No JIT          352767         354597         69585    43048  101638  28961 108839  48815
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1109
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1110
   ST/X+J Linux                  
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1111
   233Mhz P6
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1112
   JIT             128724         116810         20259    39733   83160  27613  52093  33166  43996  545554
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1113
		   124744         101428         17239    10052    8264  14004  38821  23252  33709  374660
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1114
   +IINC           120324                                  7265
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1115
   +IADD op2       100173          90737         18128     6996    7423  17093  48559  44209  57056  390374
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1116
   +ISUB op2                       90460         17547             5921                       57056  390461
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1117
   +ICMPEQ/NE       99785          90147                           5792                43482  56486  388255
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1118
   +ICMP            87398          78214         15784     7574    5628  12812  38481  24654  32252  302797
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1119
   +IFICMPLE        84198          74928         13814     5650          11674         23241         293118
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1120
   +IFICMPxx        76867          69738         12208                          37505  21973  32104  273569
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1121
   +IFICMPEQ/NE                                                    5580  11202         21723
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1122
   const IFICMPxx                                11856             5463  11032  37372                272726
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1123
   +lea for add/sub
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1124
   +BALOAD                                       11700     4600    5015   9431
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1125
   +BASTORE                                                3279
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1126
   +CALOAD/CASTORE                                                        8907
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1127
   regSave change   66119          60365          9997             4917  15386  37851  38202  50027  286497
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1128
		    64858          58360          9476             4889  15001  37211  36288  48313  278478
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1129
		    63146          55949          9302                   14899
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1130
		    62970          56085          9352     3226    4837   8779  37573  22815  33899  241297
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1131
   -O               43662          40292          7181     2530    4696   8170  34555  22116  32337  195539
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1132
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1133
   +IALOAD          39162          36347
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1134
   +IASTORE         32461          30663          4299             3667                19556  30563  166868
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1135
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1136
   -IALOAD/IASTORE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1137
										34167  19347
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1138
										       19232  29726  
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1139
										       18821
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1140
   +AALOAD/BALOAD
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1141
		    41490          39527          6776     3315    4077   8443  33895  19152  28018  184693
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1142
		    41291          37034          6593                          32682
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1143
   +ATHROW                                                                6449                       180079
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1144
   +IASTORE         38848          35601          6219             3796   6122         17869  30085  175106
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1145
   IINC delayed code
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1146
   +ANEWARRAY                                              3263
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1147
   +LADD/LSUB const 38719          35256                                  6062  27071                172859
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1148
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1149
							   2837                 22835
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1150
   +ISTORE into arg
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1151
									  3080
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1152
   quick L2I for ints                                                     2774  21184
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1153
   +*ASTORE / *ALOAD
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1154
    again                                                  1621    3654   1525
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1155
   +CHECKCAST                                                      3574                       25810
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1156
                                                                
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1157
------------------------------------------------------------------------------------------------------------
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1158
		BubbleSort    BidirBubbleSort  QuickSort  Sieve   Hanoi   Dhry   Fib   Array   Tree   Total
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1159
   ST/X+J Win95         
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1160
   200Mhz P5
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1161
   JIT              78490          77060         15220     4840    6370   9180  73160  36080         351700
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1162
				   76900         13560             5500   9010         35200         348600
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1163
										66080         69920  370750
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1164
   +IADD non consts 76620          73210         13180     3790                 63550         58880  356900
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1165
											      51740
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1166
		    77390          72450         12520     3900    6040   8950  62450  34330  57780  335810    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1167
		    77220          71950                           5270   8840                       338650
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1168
		    72390          70690                                                      48010  327370
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1169
		    74910          66740         11420                    8620  61730  33340  47350  313940
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1170
   +xALOAD/JMP_ZERO
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1171
		    71740                                  2800             
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1172
		    71460          65250         11540     2750                 62180  33840  50750  311660
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1173
   +LCMP                                                                        59100
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1174
   better abs(I)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1175
   +xALOAD/IF_ICMPx 66130          61520         12080     3300    5280   8190  56510  33830  50310  297150
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1176
   elim dummy static                                               5210                       48270
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1177
   methods                                                                                    44160
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1178
		   119020         112440         19330     3070    4560   2640  56960  37730  52790  408540
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1179
------------------------------------------------------------------------------------------------------------
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1180
		BubbleSort    BidirBubbleSort  QuickSort  Sieve   Hanoi   Dhry   Fib   Array   Tree   Total
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1181
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1182
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1183
   Sun JDK         274625         244461         52676    50653   65183  26668  78133  28572  61608  882583
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1184
   (90Mhz P5)   
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1185
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1186
   Microsoft J++     9684           8452          2874     1733    3535   3665   3836   4746  25717   64242
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1187
   (90Mhz P5)   
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1188
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1189
   Symantec Cafe    14541          12198          3686     1922    4527   3325   3425  12969  26829   83422
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1190
   JIT 1.02
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1191
   (90Mhz P5)   
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1192
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1193
   Symantec Cafe     8292           6970          2714     1613    3345   3235   2013   4516  13180   45878
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1194
   JIT 1.2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1195
   (90Mhz P5)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1196
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1197
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1198
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1199
   |b|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1200
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1201
   b := JAVA::BubbleSortAlgorithm new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1202
   b perform:#'setData(JJ)V' with:10000 with:0 with:0 with:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1203
   Time millisecondsToRun:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1204
       b performTest.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1205
   ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1206
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1207
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1208
   |b|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1209
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1210
   b := JAVA::QSortAlgorithm new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1211
   b perform:#'setData(JJ)V' with:500000 with:0 with:0 with:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1212
   Time millisecondsToRun:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1213
       b performTest.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1214
   ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1215
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1216
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1217
   |t|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1218
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1219
   t := JAVA::Tree new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1220
   t perform:#'setData(JJ)V' with:1000000 with:0 with:0 with:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1221
   Time millisecondsToRun:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1222
       t performTest.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1223
   ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1224
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1225
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1226
   |t|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1227
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1228
   t := JAVA::Array new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1229
   t perform:#'setData(JJ)V' with:1000000 with:0 with:0 with:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1230
   Time millisecondsToRun:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1231
       t performTest.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1232
   ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1233
"
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
!JavaVM class methodsFor:'initialization'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1238
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1239
compile:source selector:smalltalkSelector asJavaMethod:javaSelector fakedSource:fakedSource in:aClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1240
    "install additional java protocol in smalltalk classes, req'd for java programs"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1241
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1242
    |cloneCode|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1243
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1244
    (aClass implements:javaSelector) ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1245
        Class packageQuerySignal answer:'__temporary__'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1246
        do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1247
            aClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1248
                compile:source
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1249
                classified:'java support'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1250
                logged:false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1251
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1252
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1253
        cloneCode := aClass compiledMethodAt:smalltalkSelector.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1254
        cloneCode source:fakedSource.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1255
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1256
        Class withoutUpdatingChangesDo:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1257
            aClass removeSelector:smalltalkSelector.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1258
            aClass addSelector:javaSelector withMethod:cloneCode.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1259
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1260
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1261
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1262
    "Created: / 5.11.1998 / 19:30:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1263
    "Modified: / 5.11.1998 / 19:37:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1264
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1265
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1266
deinitialize
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1267
    |table|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1268
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1269
    StandardThreadGroup := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1270
    self releaseAllMonitors.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1271
    KnownWindows notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1272
        KnownWindows do:[:v | 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1273
            v isTopView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1274
                v destroy
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1275
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1276
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1277
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1278
    JavaWindowGroup := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1279
    KnownWindows := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1280
    OpenFileTable := nil.          
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1281
    JavaMethods := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1282
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1283
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1284
     JavaVM deinitialize"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1285
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1286
    "Created: / 03-01-1998 / 21:28:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1287
    "Modified: / 03-12-1998 / 20:33:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1288
    "Modified: / 28-01-2011 / 14:11:35 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1289
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1290
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1291
deinitializeAdditionalJavaProtocol
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1292
    "deinstall additional java protocol in smalltalk classes, req'd for java programs"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1293
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1294
    #(
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1295
        #'clone()Ljava/lang/Object;'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1296
        #'equals(Ljava/lang/Object;)Z'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1297
        #'toString()Ljava/lang/String;'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1298
        #'getClass()Ljava/lang/Class;'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1299
     ) do:[:sel |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1300
        (Object implements:sel) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1301
            Class withoutUpdatingChangesDo:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1302
                Object removeSelector:sel.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1303
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1304
        ].
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
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1308
     self deinitializeAdditionalJavaProtocol
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
    "Created: / 4.2.1998 / 21:37:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1312
    "Modified: / 5.12.1998 / 15:27:39 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1313
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1314
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1315
initialize
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1316
    DUMMY_LONG_HIGHWORD := 1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1317
    DUMMY_DOUBLE_HIGHWORD := 2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1318
    StandardThreadGroup := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1319
    NoAudio := true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1320
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1321
    "/ NoAudio := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1322
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1323
    JavaConsoleStream := Transcript.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1324
    FullExceptionTrace := StackTrace := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1325
    WindowOPTrace := DrawOPTrace := EventTrace := ThreadTrace := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1326
    MonitorTrace := ExceptionTrace := FileOpenTrace := FileIOTrace := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1327
    ExceptionDebug := ExitDebug := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1328
    ExceptionDebugPatterns := Set new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1329
    WindowCreationTrace := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1330
    FileOpenConfirmation := true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1331
    SocketConnectConfirmation := true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1332
    WindowOPTrace := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1333
    MonitorTrace := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1334
    ThreadTrace := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1335
    UnhandledJavaExceptionSignal := (Signal new) mayProceed: true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1336
    UnhandledJavaExceptionSignal nameClass: self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1337
        message: #unhandledJavaExceptionSignal.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1338
    UnhandledJavaExceptionSignal notifierString: 'unhandled java exception'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1339
    JavaExceptionSignal := (Signal new) mayProceed: false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1340
    JavaExceptionSignal nameClass: self message: #javaExceptionSignal.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1341
    JavaExceptionSignal notifierString: 'java exception'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1342
    UnimplementedInstructionSignal := (Signal new) mayProceed: false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1343
    UnimplementedInstructionSignal nameClass: self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1344
        message: #unimplementedInstructionSignal.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1345
    UnimplementedInstructionSignal notifierString: 'unimplemented instruction'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1346
    UnimplementedNativeMethodSignal := (Signal new) mayProceed: false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1347
    UnimplementedNativeMethodSignal nameClass: self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1348
        message: #unimplementedNativeMethodSignal.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1349
    UnimplementedNativeMethodSignal 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1350
        notifierString: 'unimplemented native method'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1351
    BadMessageSignal := (Signal new) mayProceed: false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1352
    BadMessageSignal nameClass: self message: #badMessageSignal.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1353
    BadMessageSignal notifierString: 'invalid message to JAVA object'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1354
    InternalErrorSignal := (Signal new) mayProceed: false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1355
    InternalErrorSignal nameClass: self message: #internalErrorSignal.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1356
    InternalErrorSignal notifierString: 'internal error'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1357
    CallHandlerSignal := (Signal new) mayProceed: false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1358
    CallHandlerSignal nameClass: self message: #callHandlerSignal.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1359
    CallHandlerSignal notifierString: 'internal signal'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1360
    StdinReplacementFileQuerySignal := QuerySignal new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1361
    StdinReplacementFileQuerySignal nameClass: self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1362
        message: #stdinReplacementFileQuerySignal.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1363
    StdinReplacementFileQuerySignal notifierString: 'asking for stdin stream'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1364
    AssertionsEnabled := true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1365
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1366
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1367
     JavaVM initialize"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1368
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1369
    "Created: / 02-01-1998 / 18:02:34 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1370
    "Modified: / 02-12-1998 / 23:02:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1371
    "Modified: / 25-02-2011 / 08:05:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1372
    "Modified: / 01-04-2011 / 12:33:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1373
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1374
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1375
initializeAdditionalJavaProtocol
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1376
    "install additional java protocol in smalltalk classes, req'd for java programs"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1377
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1378
    "/ since we use smalltalk Arrays for JavaArray, some
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1379
    "/ additional (java-) protocol is required.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1380
    "/ This is also useful, when Smalltalk objects are passed to
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1381
    "/ java ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1382
    "/ We should implement all of the java.lang.Object protocol in
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1383
    "/ Object, to be on the bright side of life; more of this later ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1384
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1385
    self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1386
        compile:'__clone
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1387
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1388
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1389
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1390
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1391
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1392
    ^ self shallowCopy'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1393
        selector:#'__clone' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1394
        asJavaMethod:#'clone()Ljava/lang/Object;' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1395
        fakedSource:'#''clone()Ljava/lang/Object;''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1396
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1397
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1398
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1399
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1400
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1401
    ^ self shallowCopy'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1402
        in:Object.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1403
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1404
    "/ ------------------------------------------------------------
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1405
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1406
    self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1407
        compile:'__equals:arg
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1408
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1409
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1410
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1411
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1412
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1413
    ^ (arg = self) ifTrue:[1] ifFalse:[0]'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1414
        selector:#'__equals:' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1415
        asJavaMethod:#'equals(Ljava/lang/Object;)Z' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1416
        fakedSource:'#''equals(Ljava/lang/Object;)Z''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1417
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1418
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1419
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1420
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1421
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1422
    ^ (arg = self) ifTrue:[1] ifFalse:[0]'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1423
        in:Object.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1424
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1425
    "/ ------------------------------------------------------------
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1426
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1427
    self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1428
        compile:'__toString
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1429
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1430
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1431
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1432
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1433
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1434
    ^ Java as_String:(self displayString)'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1435
        selector:#'__toString' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1436
        asJavaMethod:#'toString()Ljava/lang/String;' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1437
        fakedSource:'#''toString()Ljava/lang/String;''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1438
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1439
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1440
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1441
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1442
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1443
    ^ Java as_String:(self displayString)'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1444
        in:Object.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1445
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1446
    "/ ------------------------------------------------------------
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1447
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1448
    self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1449
        compile:'__getClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1450
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1451
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1452
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1453
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1454
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1455
    ^ JavaVM javaClassObjectForClass:self class'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1456
        selector:#'__getClass' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1457
        asJavaMethod:#'getClass()Ljava/lang/Class;' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1458
        fakedSource:'#''getClass()Ljava/lang/Class;''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1459
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1460
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1461
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1462
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1463
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1464
    ^ JavaVM javaClassObjectForClass:self class'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1465
        in:Object.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1466
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1467
    "/ ------------------------------------------------------------
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1468
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1469
    self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1470
        compile:'__hashCode
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1471
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1472
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1473
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1474
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1475
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1476
    ^ self identityHash'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1477
        selector:#'__hashCode' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1478
        asJavaMethod:#'hashCode()I' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1479
        fakedSource:'#''hashCode()I''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1480
    "this is smalltalk code with a java selector ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1481
     (This source cannot be accepted in the browser, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1482
      since it has a funny selector.)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1483
     Has been added by JavaVM>>initializeAdditionalJavaProtocol"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1484
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1485
    ^ self identityHash'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1486
        in:Object.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1487
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1488
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1489
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1490
     self initializeAdditionalJavaProtocol
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1491
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1492
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1493
    "Modified: / 28-01-1997 / 19:38:58 / stefan"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1494
    "Modified: / 22-01-1998 / 21:23:40 / av"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1495
    "Created: / 04-02-1998 / 21:35:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1496
    "Modified: / 30-12-1998 / 21:07:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1497
    "Modified: / 25-10-2010 / 16:26:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
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
initializeBaseClasses
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1501
    "load req'd base classes"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1502
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1503
    #(
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1504
        'java.lang.Object'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1505
        'java.lang.Class'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1506
        'java.lang.String'      
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1507
        'java.lang.System'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1508
    ) do:[:cName |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1509
        (Java classForName:cName) isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1510
            self warn:('JavaVM: could not find required class: ' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1511
                        , cName asText allBold
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1512
                        , '\\Please check the Java settings (javaHome)') withCRs.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1513
            AbortSignal raise.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1514
            ^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1515
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1516
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1517
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1518
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1519
     self initializeBaseClasses
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
    "Created: / 3.1.1998 / 21:13:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1523
    "Modified: / 23.12.1999 / 19:27:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1524
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1525
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1526
initializeOpenFileTable
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1527
    OpenFileTable := OrderedCollection 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1528
			with:Stdin 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1529
			with:(JavaConsoleStream ? Stdout)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1530
			with:(JavaConsoleStream ? Stderr).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1531
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1532
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1533
     JavaVM initializeOpenFileTable
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1534
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1535
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1536
    "Modified: / 6.8.1997 / 00:40:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1537
    "Created: / 2.1.1998 / 18:04:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1538
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1539
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1540
initializePrimitiveClasses
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1541
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1542
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1543
    "/    #(
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1544
    "/        (#byte    'B' 1)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1545
    "/        (#short   'S' 2)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1546
    "/        (#int     'I' 4)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1547
    "/        (#long    'J' 8)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1548
    "/        (#boolean 'Z' 1)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1549
    "/        (#char    'C' 2)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1550
    "/        (#float   'F' 4)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1551
    "/        (#double  'D' 8)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1552
    "/        (#void    'V' 0)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1553
    "/    ) triplesDo:[:nm :sig :len |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1554
    "/        |jClass classInst|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1555
    "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1556
    "/        "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1557
    "/        "/ create a javaClass for it.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1558
    "/        "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1559
    "/        jClass := Java at:'java.lang.Class'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1560
    "/        jClass notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1561
    "/            classInst := jClass new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1562
    "/            JavaClasses at:nm put:classInst.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1563
    "/            JavaClasses at:classInst put:nm.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1564
    "/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1565
    "/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1566
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1567
     self initializePrimitiveClasses"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1568
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1569
    "Modified: / 22-10-1998 / 01:56:02 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1570
    "Modified: / 20-12-2010 / 23:39:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1571
    "Modified: / 28-01-2011 / 14:57:38 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1572
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1573
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1574
initializeReflection
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1575
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1576
    Reflection := JavaVM::Reflection for: self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1577
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1578
    "Created: / 21-12-2010 / 19:48:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1579
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1580
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1581
initializeSimulatedLibs
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1582
    "return a collection of native libs which are considered 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1583
     being already loaded. (used with jdk < 1.2)"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1584
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1585
    LibPath := #(
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1586
                        '__builtIn__' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1587
                        '/usr/local/lib' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1588
                        '/usr/local/lib/java'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1589
                ).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1590
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1591
    SimulatedLibs := #(
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1592
                        '__builtIn__/net' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1593
                        '__builtIn__/awt' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1594
                        '__builtIn__/tawt' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1595
                        '__builtIn__/winawt' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1596
                        '__builtIn__/jpeg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1597
                        '__builtIn__/mmedia'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1598
                        '__builtIn__/zip'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1599
                        '__builtIn__/math'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1600
                        '__builtIn__/sysresource'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1601
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1602
                        "/ KAVA ... 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1603
                        '__builtIn__/agent'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1604
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1605
                        "/ MS-java ... 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1606
                        '__builtIn__/msawt'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1607
                        '__builtIn__/javart'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1608
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1609
                        "/ 1.1.8
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1610
                        '__builtIn__/jpeg_sun' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1611
                      ).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1612
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1613
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1614
     self initializeSimulatedLibs
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1615
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1616
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1617
    "Created: / 4.1.1998 / 19:05:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1618
    "Modified: / 17.11.1998 / 23:53:02 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1619
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1620
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1621
initializeSimulatedNativeLibs
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1622
    "return a collection of native libs which are considered 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1623
     being already loaded (used with jdk >= 1.2)"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1624
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1625
    OperatingSystem isUNIXlike ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1626
        SimulatedNativeLibs := #(
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1627
                                 'libawt.so' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1628
                                 'libnet.so' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1629
                                 'libcmm.so' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1630
                                 'libzip.so'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1631
                                ).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1632
        ^self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1633
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1634
    OperatingSystem isMSWINDOWSlike ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1635
        SimulatedNativeLibs := #(
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1636
                                 'awt.dll' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1637
                                 'net.dll' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1638
                                 'cmm.dll' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1639
                                 'zip.dll'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1640
                                ).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1641
        ^self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1642
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1643
    SimulatedNativeLibs := #().
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1644
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1645
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1646
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1647
     self initializeSimulatedNativeLibs
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
    "Modified: / 27-01-1998 / 18:43:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1651
    "Modified: / 01-04-2011 / 23:02:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1652
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1653
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1654
initializeSimulatedNativeMemory
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1655
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1656
    SimulatedNativeMemory := JavaNativeMemory new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1657
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1658
    "Created: / 07-12-2010 / 21:07:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1659
    "Modified: / 07-12-2010 / 23:45:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1660
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1661
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1662
initializeSystemPropertiesInto:props
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1663
    |cpu os jHome|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1664
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1665
    "/ use JAVA compatible cpu-name
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1666
    cpu := OperatingSystem getCPUType.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1667
    cpu = 'i386' ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1668
        cpu := 'ix86'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1669
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1670
    SimulatedOS notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1671
        os := SimulatedOS
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1672
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1673
        os := OperatingSystem getOSType.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1674
        os := os asUppercaseFirst.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1675
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1676
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1677
    props at:'java.version'       put:'1'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1678
    props at:'java.vendor'        put:'eXept Software AG'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1679
    props at:'java.vendor.url'    put:'http://www.exept.de'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1680
    (jHome := self defaultJAVAHome) notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1681
        props at:'java.home'          put:(jHome asFilename pathName).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1682
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1683
    props at:'java.class.version' put:'1'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1684
    props at:'java.class.path'    put:(self defaultCLASSPATH).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1685
    props at:'os.name'            put:os.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1686
    props at:'os.arch'            put:cpu.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1687
    props at:'os.version'         put:'1'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1688
    props at:'file.separator'     put:(Filename separator asString).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1689
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1690
    props at:'path.separator'     put: OperatingSystem pathSeparator asString. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1691
    props at:'line.separator'     put:(Character cr asString).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1692
    props at:'user.name'          put:(OperatingSystem getLoginName).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1693
    props at:'user.home'          put:(OperatingSystem getHomeDirectory ? Filename currentDirectory name).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1694
    props at:'user.dir'          put:(OperatingSystem getHomeDirectory ? Filename currentDirectory name).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1695
    "/ props at:'user.dir'           put:(Filename currentDirectory pathName).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1696
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1697
    "/props at:'awt.toolkit'        put:(self defaultWindowingToolKit).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1698
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1699
    props at: 'user.country'    put: 'US'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1700
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1701
    props at:'hotjava.home'       put:(self defaultHotJavaHome).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1702
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1703
    "/ new with jdk 1.1.8
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1704
    "/ undocumented ?
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1705
    props at:'file.encoding.pkg'    put:'sun.io'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1706
    props at:'file.encoding'        put:'8859_1'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1707
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1708
    "/ suppress copyright view in appletViewer ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1709
    props at:'appletviewer.version' put:'1.1'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1710
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1711
    "/ new with jdk 1.2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1712
    props at:'java.awt.graphicsenv' put:'sun.awt.X11GraphicsEnvironment'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1713
    props at:'java.awt.fonts'       put:'/usr/lib/X11/fonts'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1714
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1715
    "/ jws
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1716
    "/props at:'jws.home'             put:(self defaultJWSHome).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1717
    "/ new with jws 2.0 ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1718
    "/props at:'jws.startcmd'         put:'jws.showwin.mainide'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1719
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1720
    props at: 'java.library.path'   put: self defaultJavaLibraryPath.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1721
    props at: 'sun.boot.library.path' put: self defaultSunBootLibraryPath. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1722
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1723
    ^ props
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1724
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1725
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1726
     self initializeSystemPropertiesInto:(Dictionary new)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1727
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1728
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1729
    "Created: / 03-01-1998 / 14:26:39 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1730
    "Modified: / 27-01-2000 / 02:20:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1731
    "Modified: / 01-04-2011 / 18:33:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1732
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1733
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1734
initializeVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1735
    "Force off JIT compiler for Java code - it hasn't been
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1736
     updated to reflect changes in jinterpret.c.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1737
     Following >>make it working, make it fast<< rule"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1738
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1739
    ObjectMemory
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1740
        javaJustInTimeCompilation: false;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1741
        javaNativeCodeOptimization: false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1742
    JavaObject autoload.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1743
    JavaContext autoload.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1744
    MonitorTrace ifNil: [ self initialize ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1745
    self initializeAdditionalJavaProtocol.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1746
    self releaseAllJavaResources.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1747
    JavaConsoleStream := Transcript.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1748
    Java initAllStaticFields.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1749
    Java markAllClassesUninitialized.
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  1750
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  1751
    ZipCache := OrderedCollection new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  1752
    ZipEntryCache := OrderedCollection new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  1753
    ZipInflaters := OrderedCollection new.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1754
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1755
    "/ force re-resolving;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1756
    "/ otherwise, class-inits would not be called
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1757
    "/ by resolver ... (sigh)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1758
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1759
    JavaNativeMethod flushAllCachedNativeMethods.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1760
    JavaMethod allSubInstancesDo: 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1761
            [:m | 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1762
            m checked: false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1763
            m code: nil. ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1764
    ObjectMemory flushCaches.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1765
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1766
    "/ sigh - must flush inline caches.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1767
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1768
    JavaClass startRememberingOrderOfClassInits.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1769
    self initializeSimulatedLibs.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1770
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1771
    "/ < jdk 1.2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1772
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1773
    self initializeSimulatedNativeLibs.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1774
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1775
    "/ >= jdk 1.2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1776
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1777
    self initializeSimulatedNativeMemory.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1778
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1779
    "/>  jdk 6
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1780
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1781
    self initializeOpenFileTable.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1782
    self initializeBaseClasses.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1783
    self initializePrimitiveClasses.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1784
    self initializeReflection.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1785
    Java initSystemClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1786
    ObjectMemory addDependent: self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1787
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1788
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1789
     JavaVM initialize.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1790
     JavaVM initializeVM."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1791
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1792
    "Created: / 03-01-1998 / 21:29:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1793
    "Modified: / 14-12-1999 / 18:58:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1794
    "Modified: / 15-10-2010 / 15:27:45 / Jan Kurs <kurs.jan@post.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1795
    "Modified: / 01-04-2011 / 15:33:39 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  1796
    "Modified: / 30-04-2011 / 22:59:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1797
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1798
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1799
initializeVMIfNoEventThreadRunning
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1800
    |uClass updater p|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1801
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1802
    uClass := JAVA::sun::awt::ScreenUpdater.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1803
    uClass notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1804
        updater := uClass instVarNamed:'updater'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1805
        updater notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1806
            p := self stProcessForJavaThread:updater
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1807
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1808
        (updater isNil or:[p isNil or:[p isDead]]) isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1809
            self initializeVM.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1810
            ^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1811
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1812
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1813
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1814
    (JavaEventThread isNil or:[JavaEventThread isDead]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1815
        self initializeVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1816
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1817
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1818
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1819
     JavaVM initializeVMIfNoEventThreadRunning
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1820
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1821
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1822
    "Created: / 15.1.1998 / 17:32:27 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1823
    "Modified: / 24.12.1999 / 02:18:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1824
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1825
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1826
reinitializeVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1827
    |classesToInit|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1828
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1829
    self releaseAllJavaResources.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1830
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1831
    JavaConsoleStream := Transcript.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1832
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1833
    Java initAllStaticFields.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1834
    Java markAllClassesUninitialized.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1835
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1836
    self initializeOpenFileTable.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1837
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1838
    classesToInit := JavaClass orderOfClassInits.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1839
    JavaClass startRememberingOrderOfClassInits.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1840
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1841
    self initializePrimitiveClasses.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1842
"/    Java initSystemClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1843
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1844
    classesToInit do:[:jClass |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1845
Transcript showCR:'classInit: ' , jClass name.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1846
	jClass classInit
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1847
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1848
    Java initSystemClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1849
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1850
    "Created: / 12.11.1998 / 15:37:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1851
    "Modified: / 17.11.1998 / 16:10:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1852
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1853
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1854
reinitializeVMIfNoEventThreadRunning
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1855
    (JavaEventThread isNil or:[JavaEventThread isDead]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1856
        ^ self reinitializeVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1857
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1858
    (JavaEventQueueThread isNil or:[JavaEventQueueThread isDead]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1859
        ^ self reinitializeVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1860
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1861
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1862
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1863
     JavaVM reinitializeVMIfNoEventThreadRunning
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1864
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1865
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1866
    "Created: / 24.11.1998 / 15:45:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1867
    "Modified: / 24.12.1999 / 02:36:41 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1868
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1869
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1870
releaseAllJavaResources
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1871
    self deinitialize.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1872
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1873
    FirstWindowCreationSemaphore := Semaphore new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1874
    JavaScreenUpdaterThread := JavaEventQueueThread := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1875
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1876
    LoadedLibs := nil.             "/ gc will reclaim them ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1877
    LoadedNativeLibs := nil.       "/ gc will reclaim them ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1878
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1879
    ImageStretchCache := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1880
    LastGraphics := LastGC := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1881
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1882
    SimulatedNativeMemory := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1883
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1884
    self initializePrimitiveClasses.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1885
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1886
    self terminateAllThreads.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1887
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1888
    self releaseAllWindows.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1889
    self releaseAllStreams.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1890
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1891
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1892
     JavaVM releaseAllJavaResources
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1893
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1894
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1895
    "Created: / 07-01-1998 / 22:49:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1896
    "Modified: / 24-12-1999 / 02:33:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1897
    "Modified: / 17-12-2010 / 17:51:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1898
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1899
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1900
releaseAllMonitors
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1901
    LockTable := WeakIdentityDictionary new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1902
    LockTableAccess := Semaphore"RecursionLock" forMutualExclusion.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1903
    LockTableAccess name: 'JavaVM lock table access mutex'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1904
    WaitTable := IdentityDictionary new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1905
    WaitTableAccess := Semaphore"RecursionLock" forMutualExclusion.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1906
    WaitTableAccess name: 'JavaVM wait table access mutex'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1907
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1908
    EnteredMonitorsPerProcess := IdentityDictionary new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1909
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1910
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1911
     JavaVM releaseAllMonitors
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1912
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1913
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1914
    "Created: / 02-01-1998 / 18:04:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1915
    "Modified: / 07-01-1998 / 22:58:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1916
    "Modified: / 25-10-2010 / 19:14:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1917
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1918
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1919
releaseAllStreams
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1920
    OpenFileTable notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1921
	OpenFileTable do:[:aStream |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1922
	    aStream notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1923
		aStream ~~ Stdin ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1924
		    aStream ~~ Stdout ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1925
			aStream ~~ Stderr ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1926
			    aStream ~~ JavaConsoleStream ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1927
				aStream isExternalStream ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1928
				    aStream shutDown
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1929
				]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1930
			    ]
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
		]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1934
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1935
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1936
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1937
    self initializeOpenFileTable.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1938
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1939
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1940
     JavaVM releaseAllStreams
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1941
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1942
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1943
    "Created: / 7.1.1998 / 22:57:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1944
    "Modified: / 4.2.1998 / 19:53:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1945
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1946
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1947
releaseAllWindows
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1948
    KnownWindows notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1949
	KnownWindows do:[:aView |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1950
	    aView destroy
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1951
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1952
	KnownWindows := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1953
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1954
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1955
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1956
     self releaseAllWindows
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1957
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1958
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1959
    "Created: / 7.1.1998 / 22:58:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1960
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1961
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1962
releaseLeftOverMonitors
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1963
    "release monitors held by dead processes"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1964
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1965
    |deadProcesses|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1966
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1967
    deadProcesses := IdentitySet new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1968
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1969
    EnteredMonitorsPerProcess keysAndValuesDo:[:p :monitors |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1970
	p isDead ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1971
	    monitors do:[:mon |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1972
		Transcript showCR:'release leftover monitor ...'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1973
		mon release
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1974
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1975
	    deadProcesses add:p.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1976
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1977
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1978
    deadProcesses do:[:p |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1979
	EnteredMonitorsPerProcess removeKey:p
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1980
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1981
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1982
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1983
     JavaVM releaseLeftOverMonitors
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1984
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1985
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1986
    "Created: / 8.1.1998 / 17:29:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1987
    "Modified: / 8.1.1998 / 17:38:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1988
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1989
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1990
systemProperties
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1991
    |props|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1992
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1993
    props := Dictionary new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1994
    self initializeSystemPropertiesInto:props.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1995
    ^ props
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1996
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1997
    "Created: / 3.1.1998 / 14:25:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  1998
    "Modified: / 3.1.1998 / 14:32:38 / cg"
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
terminateAllThreads
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2002
    Java terminateAllThreads.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2003
    JavaEventThread := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2004
    JavaScreenUpdaterThread := JavaEventQueueThread := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2005
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2006
    "Created: / 8.1.1998 / 17:43:54 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2007
    "Modified: / 24.12.1999 / 02:33:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2008
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2009
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2010
update:something with:aParameter from:changedObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2011
    something == #returnFromSnapshot ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2012
"/         self initializeVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2013
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2014
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2015
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2016
     JavaVM initializeVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2017
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2018
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2019
    "Created: / 9.1.1998 / 10:30:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2020
    "Modified: / 6.11.1998 / 00:40:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2021
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2022
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2023
!JavaVM class methodsFor:'Signal constants'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2024
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2025
badMessageSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2026
    ^ BadMessageSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2027
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2028
    "Created: / 2.1.1998 / 18:06:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2029
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2030
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2031
callHandlerSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2032
    ^ CallHandlerSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2033
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2034
    "Created: / 2.1.1998 / 18:07:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2035
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2036
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2037
internalErrorSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2038
    ^ InternalErrorSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2039
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2040
    "Created: / 2.1.1998 / 18:07:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2041
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2042
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2043
javaExceptionSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2044
    "^ JavaExceptionSignal"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2045
    ^JavaError
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2046
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2047
    "Created: / 02-01-1998 / 18:05:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2048
    "Modified: / 01-03-2011 / 21:50:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
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
stdinReplacementFileQuerySignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2052
    ^ StdinReplacementFileQuerySignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2053
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2054
    "Created: / 2.1.1998 / 18:06:52 / cg"
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
unhandledJavaExceptionSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2058
    ^ UnhandledJavaExceptionSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2059
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2060
    "Created: / 2.1.1998 / 18:05:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2061
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2062
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2063
unimplementedInstructionSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2064
    ^ UnimplementedInstructionSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2065
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2066
    "Created: / 2.1.1998 / 18:06:15 / cg"
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
unimplementedNativeMethodSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2070
    ^ UnimplementedNativeMethodSignal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2071
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2072
    "Created: / 2.1.1998 / 18:06:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2073
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2074
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2075
!JavaVM class methodsFor:'accessing'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2076
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2077
addSelector:newSelector withMethod:newMethod 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2078
    super addSelector:newSelector withMethod:newMethod.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2079
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2080
    "/JavaNativeMethod may not be loaded..."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2081
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2082
    (Smalltalk at:#JavaNativeMethod) 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2083
        ifNotNil:[JavaNativeMethod flushAllCachedNativeMethods].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2084
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2085
    "Created: / 24-12-1999 / 03:12:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2086
    "Modified: / 02-02-2011 / 04:38:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2087
    "Modified: / 02-02-2011 / 23:38:08 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2088
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2089
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2090
assertionsEnabled: aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2091
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2092
    AssertionsEnabled := aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2093
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2094
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2095
        JavaVM assertionsEnabled: true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2096
        JavaVM assertionsEnabled: false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2097
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2098
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2099
    "Created: / 24-11-2010 / 09:02:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2100
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2101
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2102
classForName:aString 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2103
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2104
    ^ Java classForName:aString.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2105
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2106
    "Created: / 21-12-2010 / 19:50:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2107
    "Modified: / 02-02-2011 / 23:48:57 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2108
    "Modified: / 03-02-2011 / 21:45:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2109
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2110
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2111
javaEventQueueThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2112
     ^ JavaEventQueueThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2113
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2114
    "Created: / 24.12.1999 / 02:34:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2115
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2116
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2117
javaEventThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2118
     ^ JavaEventThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2119
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2120
    "Created: / 8.1.1999 / 17:05:02 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2121
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2122
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2123
javaScreenUpdaterThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2124
     ^ JavaScreenUpdaterThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2125
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2126
    "Created: / 8.1.1999 / 17:06:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2127
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2128
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2129
reflection
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2130
    ^ Reflection.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2131
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2132
    "Created: / 28-01-2011 / 15:09:19 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2133
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2134
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2135
useSmalltalkInterpreter
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2136
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2137
    JavaMethod makeMetaMethod
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2138
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2139
    "Created: / 23-02-2011 / 12:59:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2140
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2141
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2142
useVMInterpreter
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2143
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2144
    JavaMethod makeJavaMethod
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2145
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2146
    "Created: / 23-02-2011 / 12:59:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
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
!JavaVM class methodsFor:'debugging support'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2150
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2151
exceptionDebug
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2152
    ^ ExceptionDebug
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2153
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2154
    "Created: / 27.1.1999 / 20:14:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2155
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2156
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2157
exceptionDebug:aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2158
    ExceptionDebug := aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2159
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2160
    "Created: / 27.1.1999 / 20:15:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2161
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2162
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2163
exceptionDebugPatterns
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2164
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2165
    ^ ExceptionDebugPatterns
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2166
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2167
    "Created: / 25-02-2011 / 08:08:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2168
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2169
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2170
!JavaVM class methodsFor:'defaults'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2171
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2172
audioEnabled
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2173
    ^ NoAudio not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2174
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2175
    "Created: / 18.7.1998 / 22:31:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2176
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2177
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2178
audioEnabled:aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2179
    NoAudio := aBoolean not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2180
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2181
    "Created: / 18.7.1998 / 22:31:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2182
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2183
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2184
defaultCLASSPATH
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2185
    |s|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2186
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2187
    s := '' writeStream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2188
    Java effectiveClassPath do:[:p |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2189
        s size == 0 ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2190
            s nextPut:$:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2191
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2192
        s nextPutAll:p.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2193
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2194
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2195
    ^ s contents
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
     self defaultCLASSPATH  
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2199
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2200
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2201
    "Created: / 03-01-1998 / 14:27:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2202
    "Modified: / 22-11-2010 / 13:44:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2203
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2204
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2205
defaultHotJavaHome
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2206
    ^ '/usr/local/java/hotjava'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2207
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2208
    "Modified: / 5.8.1997 / 04:13:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2209
    "Created: / 3.1.1998 / 14:27:34 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2210
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2211
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2212
defaultJAVAHome
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2213
    ^ Java javaHome
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2214
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2215
    "Modified: / 6.8.1997 / 00:54:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2216
    "Created: / 3.1.1998 / 14:27:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2217
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2218
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2219
defaultJWSHome
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2220
    '/phys/idefix/home2/java/JWS2_0/Java-WorkShop2.0/JWS' asFilename exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2221
	^ '/phys/idefix/home2/java/JWS2_0/Java-WorkShop2.0/JWS'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2222
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2223
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2224
    ^ '/usr/local/java/JWS'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2225
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2226
    "Created: / 3.1.1998 / 14:27:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2227
    "Modified: / 3.12.1998 / 14:54:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2228
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2229
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2230
defaultJavaLibraryPath
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2231
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2232
    | dirs |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2233
    dirs := OrderedCollection new
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2234
            add: Java release javaHome asFilename / 'lib';
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2235
            add: Java release javaHome asFilename / 'lib' / 'amd64';
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2236
            add: Java release javaHome asFilename / 'lib' / 'i386';
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2237
            add: Java release javaHome asFilename / 'jre' / 'lib' ;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2238
            add: Java release javaHome asFilename / 'jre' / 'lib' / 'amd64'  ;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2239
            add: Java release javaHome asFilename / 'jre' / 'lib' / 'i386' ;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2240
            add: Java release javaHome asFilename / 'jre' / 'bin' ;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2241
            yourself.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2242
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2243
    ^String streamContents:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2244
        [:path|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2245
        (dirs select:[:d|d exists])
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2246
            do:[:d|path nextPutAll:d pathName]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2247
            separatedBy:[path nextPut: OperatingSystem pathSeparator]]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2248
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2249
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2250
        JavaVM defaultJavaLibraryPath
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2251
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2252
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2253
    "Created: / 10-12-2010 / 14:09:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2254
    "Modified: / 01-04-2011 / 18:21:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2255
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2256
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2257
defaultSunBootLibraryPath
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2258
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2259
    | dirs |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2260
    dirs := OrderedCollection new
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2261
            add: Java release javaHome asFilename / 'lib';
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2262
            add: Java release javaHome asFilename / 'lib' / 'amd64';
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2263
            add: Java release javaHome asFilename / 'lib' / 'i386';
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2264
            add: Java release javaHome asFilename / 'jre' / 'lib' ;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2265
            add: Java release javaHome asFilename / 'jre' / 'lib' / 'amd64'  ;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2266
            add: Java release javaHome asFilename / 'jre' / 'lib' / 'i386' ;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2267
            yourself.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2268
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2269
    ^String streamContents:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2270
        [:path|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2271
        (dirs select:[:d|d exists])
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2272
            do:[:d|path nextPutAll:d pathName]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2273
            separatedBy:[path nextPut: OperatingSystem pathSeparator]]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2274
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2275
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2276
        JavaVM defaultJavaLibraryPath
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2277
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2278
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2279
    "Created: / 10-12-2010 / 14:37:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2280
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2281
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2282
defaultWindowingToolKit
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2283
    "/ prefer the windows toolkit ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2284
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2285
    (Java classForName:'sun.awt.windows.WToolkit') notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2286
        ^ 'sun.awt.windows.WToolkit'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2287
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2288
    (Java classForName:'sun.awt.motif.MToolkit') notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2289
        self halt:'MotifToolKit: this is untested code'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2290
        ^ 'sun.awt.motif.MToolkit'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2291
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2292
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2293
    self halt:'TinyToolKit: this is untested code'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2294
    ^ 'sun.awt.tiny.TinyToolkit'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2295
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2296
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2297
"/    ^ 'sun.awt.win32.MToolkit'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2298
"/    ^ 'sun.awt.motif.MToolkit'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2299
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2300
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2301
     self defaultWindowingToolKit
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2302
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2303
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2304
    "Created: / 3.1.1998 / 14:27:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2305
    "Modified: / 27.1.1998 / 21:52:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2306
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2307
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2308
fileAccessTrace
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2309
    ^ FileAccessTrace
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2310
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2311
    "Created: / 27.1.1999 / 18:55:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2312
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2313
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2314
fileAccessTrace:aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2315
    FileAccessTrace := aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2316
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2317
    "Created: / 19.10.1998 / 16:01:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2318
    "Modified: / 27.1.1999 / 18:55:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2319
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2320
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2321
fileOpenConfirmation
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2322
    ^ FileOpenConfirmation
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2323
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2324
    "Created: / 19.10.1998 / 16:01:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2325
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2326
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2327
fileOpenConfirmation:aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2328
    FileOpenConfirmation := aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2329
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2330
    "Created: / 19.10.1998 / 16:01:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2331
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2332
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2333
javaConsole:aStream
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2334
    JavaConsoleStream := aStream
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2335
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2336
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2337
     JavaVM javaConsole:Transcript
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2338
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2339
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2340
    "Modified: / 6.8.1997 / 00:34:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2341
    "Created: / 3.1.1998 / 14:27:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2342
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2343
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2344
javaConsoleStream
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2345
    ^ JavaConsoleStream
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2346
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2347
    "Created: / 3.1.1998 / 14:32:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2348
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2349
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2350
nullPointerExceptionDebug
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2351
    ^ NullPointerExceptionDebug
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2352
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2353
    "Created: / 27.1.1999 / 20:14:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2354
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2355
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2356
nullPointerExceptionDebug:aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2357
    NullPointerExceptionDebug := aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2358
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2359
    "Created: / 27.1.1999 / 20:15:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2360
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2361
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2362
socketConnectConfirmation
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2363
    ^ SocketConnectConfirmation
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2364
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2365
    "Created: / 19.10.1998 / 16:02:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2366
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2367
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2368
socketConnectConfirmation:aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2369
    SocketConnectConfirmation := aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2370
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2371
    "Created: / 19.10.1998 / 16:02:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2372
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2373
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2374
!JavaVM class methodsFor:'fileIO'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2375
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2376
addOpenFile:aStream
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2377
    OpenFileTable add:aStream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2378
    ^ OpenFileTable size - 1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2379
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2380
    "Created: / 2.1.1998 / 18:32:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2381
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2382
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2383
getOpenFileAt:idx
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2384
    ^ OpenFileTable at:idx+1 ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2385
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2386
    "Created: / 2.1.1998 / 18:28:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2387
    "Modified: / 2.1.1998 / 18:33:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2388
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2389
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2390
setOpenFile:aStream at:idx
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2391
    OpenFileTable size < (idx+1) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2392
	OpenFileTable grow:idx+1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2393
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2394
    OpenFileTable at:idx+1 put:aStream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2395
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2396
    "Modified: / 2.1.1998 / 18:33:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2397
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2398
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2399
!JavaVM class methodsFor:'helpers'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2400
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2401
canCast: s to: t
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2402
    "Helper for _CHECKCAST:_:"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2403
    | sc tc |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2404
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2405
    Java VM Spec, 3rd edition, p 280:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2406
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2407
    The following rules are used to determine whether an objectref that is not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2408
    null can be cast to the resolved type: if S is the class of the object
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2409
    referred to by objectref and T is the resolved class, array, or interface type,
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2410
    checkcast determines whether objectref can be cast to type T as follows:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2411
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2412
    - If S is an ordinary (nonarray) class, then:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2413
      - If T is a class type, then S must be the same class as T, or a subclass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2414
        of T.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2415
      - If T is an interface type, then S must implement interface T.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2416
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2417
    (s isJavaArrayClass not and:[s isInterface not]) ifTrue:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2418
        [^s includesBehavior: t].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2419
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2420
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2421
    - If S is an interface type, then:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2422
      - If T is a class type, then T must be Object.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2423
      - If T is an interface type, then T must be the same interface as S or a
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2424
        superinterface of S.    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2425
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2426
    s isInterface ifTrue:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2427
        [^t isInterface not 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2428
            ifTrue: [t == (self classForName:'java.lang.Object')]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2429
            ifFalse:[s includesBehavior: t]].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2430
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2431
    - If S is a class representing the array type SC[], that is, an array of com-
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2432
      ponents of type SC , then:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2433
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2434
    self assert: s isJavaArrayClass description: 'S should be array type'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2435
    sc := s javaComponentClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2436
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2437
      - If T is a class type, then T must be Object.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2438
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2439
      t isJavaClassType ifTrue:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2440
        [^t == (self classForName: 'java.lang.Class')].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2441
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2442
      - If T is an array type TC[], that is, an array of components of type TC ,
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2443
        then one of the following must be true:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2444
        - TC and SC are the same primitive type.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2445
        - TC and SC are reference types, and type SC can be cast to TC by
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2446
          recursive application of these rules.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2447
    "        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2448
      t isJavaArrayClass ifTrue:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2449
        [tc := t javaComponentClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2450
        ^tc isJavaPrimitiveType
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2451
            ifTrue:[tc == sc]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2452
            ifFalse:[self canCast: sc to: tc]].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2453
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2454
      - If T is an interface type, T must be one of the interfaces implemented
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2455
        by arrays (JLS3 4.10.3).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2456
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2457
    self halt: 'Not yet implemented'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2458
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2459
    ^false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2460
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2461
    "Modified: / 09-01-1999 / 00:45:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2462
    "Created: / 11-02-2011 / 08:21:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2463
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2464
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2465
javaArrayClassFor:aClass 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2466
    ^ self reflection javaArrayClassObjectForClass:aClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2467
        ifAbsentPut:[JavaArray javaArrayClassFor:aClass]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2468
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2469
    "Created: / 17-12-2010 / 13:46:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2470
    "Modified: / 28-01-2011 / 14:59:16 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2471
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2472
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2473
javaStringObjectForString:string 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2474
    self breakPoint:#mh info:'refactor my sender to use reflection directly'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2475
    ^ self reflection javaStringObjectForString:string interned:false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2476
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2477
    "Created: / 22-11-2010 / 16:31:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2478
    "Modified: / 09-02-2011 / 00:47:49 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2479
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2480
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2481
javaStringObjectForString:string interned:intern 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2482
    self breakPoint:#mh info:'refactor my sender to use reflection directly'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2483
    ^self reflection javaStringObjectForString:string interned:intern.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2484
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2485
    "Created: / 22-11-2010 / 16:28:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2486
    "Modified: / 22-11-2010 / 17:57:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2487
    "Modified: / 09-02-2011 / 01:04:21 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2488
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2489
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2490
javaThreadForSTProcess:stProcess
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2491
    |t|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2492
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2493
    t := Java threads keyAtValue:stProcess ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2494
    t == 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2495
	^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2496
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2497
    ^ t
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2498
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2499
    "Modified: / 26.8.1997 / 19:56:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2500
    "Created: / 3.1.1998 / 01:53:41 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2501
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2502
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2503
newThread:name
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2504
    |thread threadClass i|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2505
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2506
    threadClass := Java at:'java.lang.Thread'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2507
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2508
    thread := (Java at:'java.lang.Thread') basicNew.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2509
    thread instVarNamed:'name'        put:(Java as_String:name).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2510
    thread instVarNamed:'priority'    put:(threadClass instVarNamed:'NORM_PRIORITY').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2511
    thread instVarNamed:'single_step' put:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2512
    thread instVarNamed:'daemon'      put:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2513
    thread instVarNamed:'stillborn'   put:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2514
    thread instVarNamed:'target'      put:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2515
    "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2516
    "/ that on was only temporarily present in JDK1.1.3 (sigh)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2517
    "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2518
    (i := thread class instVarOffsetOf:'initial_stack_memory') notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2519
	thread instVarAt:i put:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2520
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2521
    thread instVarNamed:'group'       put:(self standardThreadGroup).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2522
    ^ thread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2523
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2524
    "Created: / 3.1.1998 / 01:47:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2525
    "Modified: / 27.1.1998 / 00:54:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2526
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2527
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2528
stProcessForJavaThread:jThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2529
    |p|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2530
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2531
    p := Java threads at:jThread ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2532
    p == 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2533
	^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2534
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2535
    ^ p
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2536
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2537
    "Created: / 2.1.1998 / 21:48:27 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2538
    "Modified: / 3.1.1998 / 01:53:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2539
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2540
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2541
standardThreadGroup
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2542
    |standardGroup threadClass|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2543
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2544
    StandardThreadGroup isNil ifTrue:[
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2545
        threadClass := Java at:'java.lang.Thread'.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2546
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2547
        standardGroup := (self classForName:'java.lang.ThreadGroup') new.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2548
        standardGroup instVarNamed:'parent'      put:nil.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2549
        standardGroup instVarNamed:'name'        put:(Java as_String:'main').
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2550
        standardGroup instVarNamed:'maxPriority' put:(threadClass instVarNamed:'MAX_PRIORITY').
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2551
        standardGroup instVarNamed:'destroyed'   put:0.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2552
        standardGroup instVarNamed:'daemon'      put:nil.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2553
        (standardGroup class instVarOffsetOf:'vmAllowSuspension') notNil ifTrue:[
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2554
            standardGroup instVarNamed:'vmAllowSuspension' put:0.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2555
        ].
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2556
        standardGroup instVarNamed:'nthreads'    put:0.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2557
        standardGroup instVarNamed:'ngroups'     put:0.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2558
        standardGroup instVarNamed:'groups'      put:nil.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2559
        StandardThreadGroup := standardGroup.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2560
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2561
    ^ StandardThreadGroup
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2562
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2563
    "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
  2564
    "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
  2565
    "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
  2566
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2567
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2568
threadStart:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2569
    "start the thread"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2570
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2571
    |jThread jName name stProcess helper |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2572
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2573
    jThread := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2574
    (jThread instVarNamed:'priority') < 1 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2575
        self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2576
        jThread instVarNamed:'priority' put:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2577
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2578
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2579
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2580
    stProcess := JavaProcess 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2581
                    for: (helper := JavaProcess newHelper)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2582
                    priority:(Processor activePriority).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2583
    helper javaThreadObject: jThread.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2584
    helper javaProcess: stProcess.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2585
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2586
    jName := jThread instVarNamed:'name'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2587
    jName isString ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2588
        name := Java as_ST_String:jName.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2589
    ] ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2590
        name := jName
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2591
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2592
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2593
    "/ kludge - remember the ScreenUpdater ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2594
    name = 'Screen Updater' ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2595
        JavaScreenUpdaterThread := stProcess.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2596
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2597
        name = 'AWT-Windows' ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2598
            JavaEventThread := stProcess.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2599
        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2600
            (name startsWith:'AWT-EventQueue') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2601
                JavaEventQueueThread := stProcess.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2602
            ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2603
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2604
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2605
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2606
"/name = 'UserDialogShowThread' ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2607
"/self halt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2608
"/].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2609
    "/ when that process terminates, wakup any waiters
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2610
    "/stProcess addExitAction:[self wakeup:jThread].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2611
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2612
    stProcess name:'JAVA-' , name.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2613
    stProcess restartable:true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2614
    stProcess resume.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2615
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2616
    Java threads at:jThread put:stProcess.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2617
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2618
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2619
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2620
    "Modified: / 24-12-1999 / 03:14:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2621
    "Created: / 14-12-2010 / 21:31:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2622
    "Modified: / 15-12-2010 / 11:19:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2623
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2624
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2625
wakeup:anObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2626
    JavaVM releaseAndSignalSemaphoreFor:anObject.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2627
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2628
    "Created: / 3.1.1998 / 02:29:27 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2629
    "Modified: / 3.1.1998 / 03:08:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2630
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2631
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2632
wakeupAll:anObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2633
    JavaVM releaseAndSignalForAllSemaphoreFor:anObject.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2634
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2635
    "Created: / 3.1.1998 / 03:07:48 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2636
    "Modified: / 3.1.1998 / 03:08:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2637
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2638
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2639
!JavaVM class methodsFor:'helpers - awt'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2640
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2641
commonReshapeComponent:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2642
    |view x y width height ext menu|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2643
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2644
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2645
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2646
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2647
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2648
    width := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2649
    height := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2650
    ext := width@height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2651
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2652
"/    'pReshape ' print. view print. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2653
"/    ' ' print. x print. '/' print. y print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2654
"/    ' extent: ' print. ext printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2655
    view isPopUpView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2656
	view origin:x@y extent:ext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2657
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2658
	(view isTopView 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2659
	or:[view isMemberOf:JavaEmbeddedFrameView]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2660
	    "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2661
	    "/ dont allow setting the origin
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2662
	    "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2663
	    menu := self topViewsMenu:view.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2664
	    menu notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2665
		"/ must add the menus height
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2666
		height := height + menu height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2667
		ext := width@height.
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
	    "/ to prevent a view from not being visible/closable
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2671
	    "/ in case Java goes mad ..
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2672
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2673
	    (width < 30
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2674
	    or:[height < 10]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2675
		"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2676
		width := 30.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2677
		height := 20.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2678
		ext := width@height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2679
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2680
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2681
	    view extent:ext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2682
	    (view isKindOf:ModalBox) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2683
		view preferredExtent:ext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2684
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2685
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2686
	    "/ adjust non-resizable views min/max
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2687
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2688
	    view isTopView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2689
		view minExtent notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2690
		    view minExtent:ext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2691
		    view maxExtent:ext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2692
		].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2693
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2694
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2695
	    (view superView notNil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2696
	    and:[view superView isTopView]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2697
		menu := self topViewsMenu:view superView.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2698
		menu notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2699
		    "/ must add menus height to yPos
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2700
		    y := y + menu height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2701
		]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2702
	    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2703
		"/ post a configuration event
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2704
		EventTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2705
		    'JAVA: configure: need event' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2706
		]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2707
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2708
	    (x isNil or:[y isNil]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2709
		Transcript showCR:'bad args to reshape'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2710
	    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2711
		view origin:x@y extent:ext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2712
	    ]
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
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2716
    view isJavaView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2717
	view invalidate.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2718
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2719
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2720
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2721
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2722
    "Created: / 4.1.1998 / 18:00:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2723
    "Modified: / 5.12.1998 / 13:34:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2724
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2725
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2726
createdWindowsView:aView for:aJavaPeer
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2727
    "this is only sent with the sun.awt.windows toolkit"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2728
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2729
    aJavaPeer instVarNamed:'pData' put:aView.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2730
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2731
    JavaWindowGroup isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2732
	JavaWindowGroup := WindowGroup new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2733
	JavaWindowGroup isForModalSubview:true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2734
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2735
    aView windowGroup:JavaWindowGroup.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2736
    JavaWindowGroup addView:aView.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2737
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2738
    KnownWindows isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2739
	KnownWindows := IdentityDictionary new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2740
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2741
    KnownWindows at:aJavaPeer put:aView.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2742
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2743
    FirstWindowCreationSemaphore signalIf.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2744
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2745
"/'*** ' print. aJavaPeer print. ' -> ' print. aView printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2746
"/(aView isKindOf:ModalBox) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2747
"/    self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2748
"/].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2749
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2750
    "Created: / 4.1.1998 / 17:57:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2751
    "Modified: / 28.1.1998 / 22:40:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2752
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2753
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2754
gcForWGraphics:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2755
    |jGraphics gc orgX orgY trans tX tY|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2756
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2757
    jGraphics := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2758
    O_WGgraphics_pData isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2759
	O_WGgraphics_pData := (jGraphics class instVarOffsetOf:'pData').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2760
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2761
    O_WGgraphics_originX isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2762
	O_WGgraphics_originX := (jGraphics class instVarOffsetOf:'originX').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2763
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2764
    O_WGgraphics_originY isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2765
	O_WGgraphics_originY := (jGraphics class instVarOffsetOf:'originY').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2766
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2767
    gc := jGraphics instVarAt:O_WGgraphics_pData.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2768
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2769
    trans := gc translation.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2770
    tX := trans x.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2771
    tY := trans y.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2772
"/    tX := gc translationX.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2773
"/    tY := gc translationY.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2774
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2775
    orgX := jGraphics instVarAt:O_WGgraphics_originX.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2776
    orgY := jGraphics instVarAt:O_WGgraphics_originY.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2777
    ((orgX ~~ tX) or:[orgY ~~ tY]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2778
	gc translation:orgX@orgY
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2779
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2780
    ^ gc
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2781
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2782
    "Created: / 8.1.1998 / 00:16:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2783
    "Modified: / 23.12.1998 / 20:27:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2784
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2785
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2786
jPeerForView:aView
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2787
    ^ KnownWindows keyAtValue:aView ifAbsent:nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2788
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2789
    "Created: / 15.1.1998 / 13:48:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2790
    "Modified: / 15.1.1998 / 13:48:43 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2791
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2792
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2793
pReshape:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2794
    |jFramePeer view x y width height menu|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2795
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2796
    jFramePeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2797
    view := jFramePeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2798
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2799
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2800
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2801
    width := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2802
    height := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2803
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2804
"/    'pReshape ' print. view print. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2805
"/    ' ' print. x print. '/' print. y print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2806
"/    ' extent: ' print. width print. '/' print. height printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2807
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2808
    view isPopUpView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2809
	self halt.
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
    (view isTopView 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2813
    or:[view isMemberOf:JavaEmbeddedFrameView]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2814
	"/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2815
	"/ dont allow setting the origin
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2816
	"/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2817
	menu := self topViewsMenu:view.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2818
	menu notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2819
	    "/ must add the menus height
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2820
	    height := height + menu height
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2821
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2822
	view extent:width@height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2823
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2824
	(view superView notNil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2825
	and:[view superView isTopView]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2826
	    menu := self topViewsMenu:view superView.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2827
	    menu notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2828
		"/ must add menus height to yPos
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2829
		y := y + menu height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2830
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2831
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2832
	view origin:x@y extent:width@height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2833
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2834
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2835
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2836
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2837
    "Created: / 7.1.1998 / 21:47:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2838
    "Modified: / 5.12.1998 / 13:47:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2839
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2840
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2841
replacementFontFor:name style:styleNr size:size
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2842
    |font family style|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2843
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2844
    style := 'roman'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2845
    styleNr = 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2846
        style := 'roman'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2847
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2848
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2849
    font := Font family:name style:style size:size.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2850
    font notNil ifTrue:[^ font].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2851
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2852
    name = 'Dialog' ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2853
        family := 'helvetica'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2854
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2855
        family := 'courier'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2856
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2857
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2858
    ^ Font family:name style:style size:size.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2859
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2860
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2861
topViewsMenu:view
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2862
    |idx|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2863
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2864
    view isTopView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2865
	view subViews size > 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2866
	    (idx := view subViews findFirst:[:v | v isMemberOf:MenuPanel]) ~~ 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2867
		"/ must add the menus height
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2868
		^ view subViews at:idx
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2869
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2870
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2871
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2872
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2873
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2874
    "Modified: / 4.8.1997 / 01:23:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2875
    "Created: / 4.1.1998 / 18:01:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2876
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2877
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2878
viewForWPeer:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2879
    |jPeer|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2880
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2881
    jPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2882
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2883
    "/ sigh; pData was renamed to pNativeWidget in jdk1.2 ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2884
    O_FramePeer_pNativeWidget isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2885
	O_FramePeer_pNativeWidget := (jPeer class instVarOffsetOf:'pNativeWidget').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2886
	O_FramePeer_pNativeWidget isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2887
	    O_FramePeer_pNativeWidget := 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2888
	    O_FramePeer_pData isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2889
		O_FramePeer_pData := (jPeer class instVarOffsetOf:'pData').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2890
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2891
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2892
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2893
    O_FramePeer_pNativeWidget > 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2894
	"/ ok, we are < 1.2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2895
	^ jPeer instVarAt:O_FramePeer_pNativeWidget.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2896
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2897
    ^ jPeer instVarAt:O_FramePeer_pData.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2898
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2899
    "Modified: / 19.11.1998 / 01:43:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2900
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2901
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2902
!JavaVM class methodsFor:'helpers - exceptions'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2903
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2904
throwAbstractMethodError
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2905
    ^ 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
  2906
        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
  2907
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2908
    "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
  2909
!
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  2910
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2911
throwArrayIndexOutOfBoundsException:badIndex
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2912
    |exClass ex|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2913
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2914
    exClass := Java classForName:'java.lang.ArrayIndexOutOfBoundsException'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2915
    ex := exClass newWith_int:badIndex.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2916
    ^ self throwException:ex
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2917
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2918
    "Created: / 14.1.1998 / 21:36:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2919
    "Modified: / 20.11.1998 / 13:27:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2920
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2921
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2922
throwArrayIndexOutOfBoundsException:theArray _:badIndex
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2923
    |exClass ex|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2924
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2925
    exClass := Java classForName:'java.lang.ArrayIndexOutOfBoundsException'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2926
    ex := exClass newWith_int:badIndex.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2927
    ^ self throwException:ex
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2928
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2929
    "Modified: / 20.11.1998 / 13:27:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2930
    "Created: / 8.1.1999 / 15:03:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2931
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2932
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2933
throwArrayStoreException:badArray
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2934
    ^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2935
	throwExceptionClassName:'java.lang.ArrayStoreException'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2936
	 withMessage:('bad array store: ' , badArray printString)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2937
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2938
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2939
throwClassCastException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2940
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2941
	throwExceptionClassName:'java.lang.ClassCastException' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2942
	withMessage:'cast failed'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2943
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2944
    "Modified: / 7.1.1998 / 15:25:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2945
    "Created: / 8.1.1999 / 18:55:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2946
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2947
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2948
throwClassNotFoundException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2949
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2950
	throwExceptionClassName:'java.lang.ClassNotFoundException' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2951
	withMessage:'no such class'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2952
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2953
    "Created: / 4.1.1998 / 22:25:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2954
    "Modified: / 7.1.1998 / 15:25:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2955
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2956
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2957
throwClassNotFoundException:className
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2958
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2959
	throwExceptionClassName:'java.lang.ClassNotFoundException' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2960
	withMessage:'no such class: ' , className
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2961
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2962
    "Created: / 4.1.1998 / 22:26:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2963
    "Modified: / 10.11.1998 / 13:20:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2964
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2965
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2966
throwDivisionByZeroException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2967
    DivisionByZeroExceptionDebug == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2968
	self halt:'division by zero'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2969
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2970
    ^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2971
	throwExceptionClassName:'java.lang.ArithmeticException'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2972
	withMessage:'division by zero'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2973
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2974
    "Created: / 8.1.1999 / 14:28:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2975
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2976
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2977
throwException:aJavaException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2978
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2979
    <resource: #skipInDebuggersWalkBack>
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2980
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2981
    |con jMsg msg exClass srchCon handlerContext handlerPC method pc hPC
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2982
     monitorObject|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2983
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2984
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2985
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2986
    ExceptionTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2987
        'JAVA: exception: ' print. aJavaException class fullName print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2988
        msg := aJavaException instVarNamed:'detailMessage'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2989
        msg notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2990
            ' (' print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2991
            (Java as_ST_String:msg) print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2992
            ')' print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2993
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2994
        '' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2995
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2996
    ExceptionDebug ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2997
"/        self internalError:('JAVA: exception: ' , aJavaException class fullName).        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2998
        (ExceptionDebugPatterns isNilOrEmptyCollection or:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  2999
            [ExceptionDebugPatterns anySatisfy: [:pattern|pattern match:aJavaException class fullName]])
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3000
            ifTrue:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3001
                [self halt:('JAVA: exceptionDebug: ' , aJavaException class fullName)]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3002
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3003
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3004
    "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3005
    "/ search stack for a javaContext which handles that exception
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3006
    "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3007
    srchCon := thisContext sender.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3008
    [handlerContext isNil and:[srchCon notNil]] whileTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3009
        (srchCon isJavaContext) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3010
            method := srchCon method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3011
            pc := srchCon pc.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3012
            (hPC := method handlerFor:aJavaException at:pc) notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3013
                "JV@2011-02-25: Another crap in JVM and Java VM Spec?
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3014
                 Or theri proxu generator? Assume that if athrow's pc
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3015
                 is same as the handler's pc it means rethrow to
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3016
                 handling context - so DO NOT HANDLE IT!!"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3017
                "Hack disabled for now"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3018
                "pc ~~ hPC"true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3019
                    handlerPC := hPC.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3020
                    handlerContext := srchCon
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3021
                ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3022
            ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3023
                "/ on the fly, release any monitor
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3024
                method isSynchronized ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3025
                    method isStatic ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3026
                        monitorObject := method javaClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3027
                    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3028
                        monitorObject := srchCon receiver
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3029
                    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3030
                    self _MONITOREXIT:monitorObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3031
                ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3032
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3033
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3034
        srchCon := srchCon sender.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3035
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3036
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3037
    handlerContext isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3038
        "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3039
        "/ no JavaHandler ... let smalltalk handle it
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3040
        "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3041
        exClass := aJavaException class.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3042
        msg := 'Java ' , exClass name.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3043
        jMsg := aJavaException instVarNamed:'detailMessage'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3044
        jMsg notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3045
            msg := msg , ': ' , (Java as_ST_String:jMsg).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3046
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3047
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3048
        "/ for our convenience: skip ST contexts 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3049
        "/ (i.e. the handler or debugger will see the javaContext first )
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3050
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3051
        con := thisContext sender.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3052
        [con isNil or:[con isJavaContext]] whileFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3053
            con := con sender
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3054
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3055
        con isNil ifTrue:[con := thisContext sender].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3056
        JavaUnhandledExceptionError
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3057
                raiseWith:aJavaException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3058
                errorString:msg
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3059
                in:con.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3060
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3061
        "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3062
        "/ found a java exceptionHandler
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3063
        "/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3064
        handlerContext setPC:handlerPC.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3065
        handlerContext exceptionArg:aJavaException pc:handlerPC.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3066
        handlerContext markForException.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3067
        handlerContext unwindAndRestart.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3068
        self halt:'should not be reached'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3069
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3070
Processor activeProcess == JavaScreenUpdaterThread ifTrue:[self halt].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3071
Processor activeProcess == JavaEventQueueThread ifTrue:[self halt].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3072
    Processor activeProcess terminate.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3073
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3074
    "Created: / 07-01-1998 / 15:28:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3075
    "Modified: / 24-12-1999 / 02:33:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3076
    "Modified: / 04-03-2011 / 00:07:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3077
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3078
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3079
throwExceptionClassName:aJavaExceptionClassName withMessage:someMessage
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3080
    |exClass ex|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3081
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3082
    exClass := Java classForName:aJavaExceptionClassName.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3083
    ex := exClass newWith_String:someMessage.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3084
    ^ self throwException:ex
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3085
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3086
    "Created: / 7.1.1998 / 15:25:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3087
    "Modified: / 14.1.1998 / 23:38:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3088
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3089
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3090
throwExceptionInInitializerError:className
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3091
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3092
        throwExceptionClassName:'java.lang.ExceptionInInitializerError' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3093
        withMessage:'error when initializing class: ' , className
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3094
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3095
    "Created: / 24-11-2010 / 09:23:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3096
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3097
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3098
throwIOExceptionWithMessage:message
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3099
    IOExceptionDebug == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3100
	self halt:'IO Exception'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3101
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3102
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3103
	throwExceptionClassName:'java.io.IOException' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3104
	withMessage:message
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3105
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3106
    "Created: / 7.1.1998 / 10:34:24 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3107
    "Modified: / 7.1.1998 / 15:26:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3108
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3109
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3110
throwIllegalAccessError
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3111
    ^ 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
  3112
        withMessage: 'illegal access'
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3113
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3114
    "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
  3115
!
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3116
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3117
throwIllegalAccessException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3118
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3119
	throwExceptionClassName:'java.lang.IllegalAccessException' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3120
	withMessage:'illegal access'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3121
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3122
    "Modified: / 7.1.1998 / 15:25:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3123
    "Created: / 14.1.1998 / 23:13:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3124
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3125
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3126
throwIncompatibleClassChangeError
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3127
        ^ 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
  3128
                withMessage: 'illegal change'.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3129
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3130
    "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
  3131
!
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3132
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3133
throwInstantiationException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3134
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3135
	throwExceptionClassName:'java.lang.InstantiationException' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3136
	withMessage:'cannot instantiate'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3137
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3138
    "Modified: / 7.1.1998 / 15:25:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3139
    "Created: / 14.1.1998 / 23:15:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3140
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3141
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3142
throwInstantiationExceptionFor:aJavaClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3143
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3144
        throwExceptionClassName:'java.lang.InstantiationException' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3145
        withMessage:('cannot instantiate: ' , aJavaClass javaName)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3146
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3147
    "Modified: / 7.1.1998 / 15:25:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3148
    "Created: / 14.1.1998 / 23:17:02 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3149
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3150
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3151
throwLinkageError: message
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3152
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3153
        throwExceptionClassName:'java.lang.LinkageError' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3154
        withMessage: message
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3155
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3156
    "Modified: / 10-11-1998 / 13:20:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3157
    "Created: / 26-11-2010 / 11:26:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3158
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3159
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3160
throwNoSuchFieldException
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3161
  ^ 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
  3162
        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
  3163
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3164
    "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
  3165
!
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3166
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3167
throwNoSuchMethodError
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3168
      ^ 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
  3169
              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
  3170
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3171
    "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
  3172
!
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3173
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3174
throwNullPointerException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3175
    NullPointerExceptionDebug == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3176
	self halt:'Null Pointer exception'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3177
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3178
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3179
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3180
	throwExceptionClassName:'java.lang.NullPointerException' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3181
	withMessage:'null pointer'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3182
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3183
    "Created: / 9.1.1998 / 02:26:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3184
    "Modified: / 28.1.1998 / 02:30:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3185
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3186
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3187
throwNumberFormatException 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3188
    ^ self 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3189
	throwExceptionClassName:'java.lang.NumberFormatException' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3190
	withMessage:'bad number format'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3191
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3192
    "Modified: / 7.1.1998 / 15:25:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3193
    "Created: / 11.1.1998 / 16:08:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3194
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3195
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3196
throwZipException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3197
    ^ self throwExceptionClassName: 'java.util.zip.ZipException'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3198
        withMessage: 'error in opening zip file'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3199
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3200
    "Created: / 27-03-2011 / 16:25:43 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3201
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3202
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3203
!JavaVM class methodsFor:'helpers - io'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3204
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3205
anyStream_close:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3206
    |jStream fileNo file|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3207
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3208
    jStream := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3209
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3210
    fileNo := self validateFileNo:jStream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3211
    fileNo == 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3212
	'JAVA: file is already closed' errorPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3213
	^ self    "/ already closed
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3214
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3215
    file := self getOpenFileAt:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3216
    file isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3217
	self halt:'invalid fileNo in close'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3218
	self internalError:'invalid fileNo in close'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3219
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3220
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3221
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3222
    file == Stdin ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3223
	file := StdinReplacementFileQuerySignal raiseRequest.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3224
	file isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3225
	    file := Stdin
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3226
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3227
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3228
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3229
    "/ should always be bytes
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3230
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3231
    (file ~~ Stdin
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3232
    and:[file ~~ Stdout
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3233
    and:[file ~~ Stderr
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3234
    and:[file ~~ Transcript]]]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3235
	file close.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3236
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3237
    self setOpenFile:nil at:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3238
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3239
    fileNo := jStream instVarNamed:'fd'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3240
    fileNo isInteger ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3241
	"/ JDK 1.1.3
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3242
	fileNo instVarNamed:'fd' put:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3243
    ] ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3244
	"/ JDK 1.0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3245
	jStream instVarNamed:'fd' put:0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3246
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3247
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3248
    "Created: / 4.2.1998 / 15:22:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3249
    "Modified: / 14.10.1998 / 15:10:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3250
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3251
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3252
anyStream_readBytes:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3253
    |bytes offset count stream nRead|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3254
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3255
    bytes := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3256
    offset := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3257
    count := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3258
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3259
    stream := self validateFile:(nativeContext receiver).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3260
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3261
    "/ should always be bytes
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3262
    bytes class isBytes ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3263
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3264
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3265
    stream == Stdin ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3266
	stream := StdinReplacementFileQuerySignal raiseRequest.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3267
	stream isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3268
	    ^ -1 "/ 0  EOF
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3269
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3270
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3271
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3272
    FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3273
	('JAVA: read ' , count printString , ' bytes from ' , stream pathName) infoPrintCR.
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
    stream isPositionable ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3277
	"/ mhmh - some kind of socket or pipe
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3278
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3279
	stream readWait.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3280
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3281
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3282
    Stream readErrorSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3283
	nRead := -1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3284
    ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3285
	nRead := stream nextAvailableBytes:count into:bytes startingAt:offset+1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3286
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3287
    nRead == 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3288
	stream atEnd ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3289
	    FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3290
		('JAVA: at EOF ' , nRead printString) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3291
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3292
	    ^ -1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3293
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3294
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3295
    count ~~ nRead ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3296
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3297
	    ('JAVA: only got ' , nRead printString) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3298
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3299
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3300
    ^ nRead
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3301
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3302
    "Created: / 4.2.1998 / 15:20:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3303
    "Modified: / 10.11.1998 / 19:56:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3304
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3305
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3306
anyStream_writeBytes:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3307
    |bytes offset count stream|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3308
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3309
    bytes := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3310
    offset := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3311
    count := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3312
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3313
    stream := self validateFile:(nativeContext receiver).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3314
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3315
    FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3316
        stream isFileStream ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3317
            ('JAVA: write ' , count printString , ' bytes to ' , stream pathName) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3318
        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3319
            stream ~~ Stdout ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3320
                stream ~~ Stderr ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3321
                    ('JAVA: write ' , count printString , ' bytes to ' , stream displayString) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3322
                ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3323
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3324
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3325
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3326
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3327
    "/ should always be bytes
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3328
    Stream writeErrorSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3329
        ex return
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3330
    ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3331
        Socket brokenConnectionSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3332
            ex return
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3333
        ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3334
            stream isBinary ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3335
                stream nextPutBytes:count from:bytes startingAt:offset+1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3336
            ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3337
                stream nextPutAll: (bytes asString copyFrom: offset + 1 to: offset + count).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3338
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3339
            
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3340
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3341
        stream == Transcript ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3342
            Transcript endEntry
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3343
        ]
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
    "Created: / 04-02-1998 / 15:23:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3347
    "Modified: / 16-02-1999 / 11:32:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3348
    "Modified: / 11-12-2010 / 20:02:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3349
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3350
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3351
checkWritePermissionOfDirectory:dir message:msg
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3352
    |answer|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3353
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3354
    (PermittedDirectories notNil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3355
    and:[PermittedDirectories includes:dir]) ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3356
	FileOpenConfirmation ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3357
	    answer := Dialog 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3358
		    confirmWithCancel:msg withCRs
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3359
			       labels:#('no' 'grant')
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3360
			       values:#(false true)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3361
			      default:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3362
	    answer == false ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3363
		^ false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3364
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3365
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3366
	    (self confirm:('JAVA Security check\\Always permit writes in this directory (''' , dir pathName , ''') ?') withCRs)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3367
	    ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3368
		PermittedDirectories isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3369
		    PermittedDirectories := Set new
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3370
		].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3371
		PermittedDirectories add:dir.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3372
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3373
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3374
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3375
    ^ true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3376
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3377
    "Created: / 3.12.1998 / 15:07:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3378
    "Modified: / 3.12.1998 / 15:16:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3379
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3380
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3381
commonOpen:nativeContext forAppend:forAppend
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3382
    |fs fd fn name dir stream fileNo answer readonly|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3383
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3384
    fs := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3385
    fd := fs instVarNamed:'fd'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3386
    (fd instVarNamed:'fd') ~~ 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3387
	self halt:'file already open'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3388
	self internalError:'file already open'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3389
	^ self.
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
    name := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3393
    name := Java as_ST_String:name.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3394
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3395
    FileOpenTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3396
	('JAVA: opening ' , name) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3397
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3398
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3399
    fn := name asFilename.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3400
    dir := fn directory pathName.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3401
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3402
    readonly := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3403
    (PermittedDirectories notNil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3404
    and:[PermittedDirectories includes:dir]) ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3405
	FileOpenConfirmation ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3406
	    answer := Dialog 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3407
		    confirmWithCancel:('JAVA Security check\\Opening ''' , name , ''' for read/write.\Grant permission ?') withCRs
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3408
			       labels:#('no' 'grant' 'readonly')
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3409
			       values:#(false true #readonly)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3410
			      default:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3411
	    answer == false ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3412
		self throwIOExceptionWithMessage:('no permission to open ' , name , ' for writing').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3413
		^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3414
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3415
	    readonly := (answer == #readonly).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3416
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3417
	    readonly ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3418
		(self confirm:('JAVA Security check\\Always permit writes in this directory (''' , dir , ''') ?') withCRs)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3419
		ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3420
		    PermittedDirectories isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3421
			PermittedDirectories := Set new
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3422
		    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3423
		    PermittedDirectories add:dir.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3424
		]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3425
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3426
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3427
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3428
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3429
    readonly ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3430
	stream := fn readStream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3431
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3432
	forAppend ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3433
	    stream := fn appendingWriteStream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3434
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3435
	    stream := fn writeStream.
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
    stream isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3439
	self throwIOExceptionWithMessage:('cannot open ' , name , ' for writing').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3440
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3441
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3442
    fileNo := self addOpenFile:stream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3443
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3444
    FileOpenTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3445
	('JAVA: opened ' , name , ' as FD ' , fileNo printString , ' for writing') infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3446
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3447
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3448
    fd instVarNamed:'fd' put:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3449
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3450
    "Created: / 7.4.1998 / 19:14:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3451
    "Modified: / 4.1.1999 / 14:34:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3452
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3453
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3454
fileStreamForReading:name
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3455
    |fn stream tryAlongClassPath|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3456
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3457
    FileOpenTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3458
        ('JAVA: opening for read:' , name) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3459
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3460
    fn := name asFilename.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3461
    stream := fn readStream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3462
    stream notNil ifTrue:[^ stream].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3463
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3464
    fn isAbsolute ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3465
        "/ if not absolute, try along classPath
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3466
        "/ This allows classes to open local files (JEdit)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3467
        "/ even if they have NOT been loaded by a Java classLoader.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3468
        "/ Only do this for image files 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3469
        "/ (and maybe some other config files in the future),
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3470
        "/ to avoid security holes.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3471
        tryAlongClassPath := true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3472
"/        tryAlongClassPath := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3473
"/        (fn hasSuffix:'gif') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3474
"/            tryAlongClassPath := true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3475
"/        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3476
"/        (fn hasSuffix:'jpg') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3477
"/            tryAlongClassPath := true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3478
"/        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3479
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3480
        tryAlongClassPath ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3481
            Java effectiveClassPath do:[:dirName |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3482
                |fn|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3483
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3484
                (fn := dirName asFilename construct:name) exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3485
                    stream := fn readStream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3486
                    stream notNil ifTrue:[^ stream].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3487
                ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3488
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3489
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3490
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3491
    ^ nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3492
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3493
    "Modified: / 27-01-1999 / 18:54:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3494
    "Modified: / 22-11-2010 / 13:44:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3495
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3496
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3497
fixFilename:path
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3498
    OperatingSystem isMSDOSlike ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3499
	(#($/ $\) includes:(path at:1)) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3500
	    (path at:3) == $: ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3501
		^ path copyFrom:2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3502
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3503
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3504
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3505
    ^ path
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3506
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3507
    "Created: / 20.10.1998 / 20:58:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3508
    "Modified: / 20.10.1998 / 21:06:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3509
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3510
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3511
validateFile:javaStream
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3512
    |fileNo file descriptor|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3513
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3514
    fileNo := self validateFileNo:javaStream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3515
    fileNo isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3516
"/        self halt:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3517
"/        self internalError:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3518
	self throwIOExceptionWithMessage:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3519
	^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3520
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3521
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3522
    file := self getOpenFileAt:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3523
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3524
    file isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3525
"/        self halt:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3526
"/        self internalError:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3527
	self throwIOExceptionWithMessage:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3528
	^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3529
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3530
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3531
    ^ file
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3532
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3533
    "Created: / 4.1.1998 / 16:50:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3534
    "Modified: / 4.1.1998 / 17:50:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3535
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3536
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3537
validateFileNo:javaStream
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3538
    |fileNo file descriptor|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3539
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3540
    "/ JDK 1.1.3 has fileDescriptor wrapped
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3541
    "/ JDK 1.0 has it directly as integer
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3542
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3543
    fileNo := javaStream instVarNamed:'fd'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3544
    fileNo isInteger ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3545
	descriptor := fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3546
	descriptor notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3547
	    fileNo := descriptor instVarNamed:'fd'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3548
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3549
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3550
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3551
    fileNo isInteger ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3552
"/        self halt:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3553
"/        self internalError:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3554
	self throwIOExceptionWithMessage:'invalid fileNo in read'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3555
	^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3556
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3557
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3558
    ^ fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3559
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3560
    "Created: / 4.1.1998 / 17:49:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3561
    "Modified: / 13.1.1998 / 14:07:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3562
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3563
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3564
!JavaVM class methodsFor:'helpers - reflection'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3565
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3566
classForJavaClassObject:aJavaClassObject 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3567
    "given java.lang.class instance, return the real class for it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3568
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3569
    ^ self reflection classForJavaClassObject:aJavaClassObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3570
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3571
    "Created: / 23-01-1998 / 17:44:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3572
    "Modified: / 03-02-2011 / 21:33:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3573
    "Modified: / 09-02-2011 / 01:02:17 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3574
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3575
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3576
javaClassObjectForClass:aClass 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3577
    "given a real class, return the corresponding java.lang.class
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3578
     instance for it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3579
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3580
    |class|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3581
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3582
    "find reflection of StClass in the Java World"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3583
    (JavaObjectDictionary new hasReflection:aClass name) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3584
        class := JavaObjectDictionary new reflectionOf:aClass name
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3585
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3586
        class := aClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3587
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3588
    ^self reflection javaClassObjectForClass:class.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3589
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3590
    "Created: / 23-01-1998 / 17:43:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3591
    "Modified: / 05-12-1998 / 15:29:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3592
    "Modified: / 17-01-2011 / 19:24:22 / kursjan <kursjan@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3593
    "Modified: / 28-01-2011 / 14:31:25 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3594
    "Modified: / 03-02-2011 / 21:31:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3595
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3596
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3597
javaConstructorObjectForMethod:method 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3598
    "given a real method, return the corresponding java.lang.reflect.Constructor
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3599
     instance for it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3600
    self breakPoint:#mh info:'refactor my sender to call reflection directly'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3601
    ^ self reflection javaConstructorObjectForMethod: method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3602
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3603
    "Modified: / 09-02-2011 / 00:58:09 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3604
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3605
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3606
javaFieldObjectForField: aJavaField in: aJavaLangClass 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3607
    "given a java field, return the corresponding java.lang.Field
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3608
     instance for it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3609
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3610
        See OpenJDK7 source:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3611
        jdk7/hotspot/src/share/vm/runtime/reflection.cpp,
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3612
        oop Reflection::new_field"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3613
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3614
    | field  clazz  name  slot  type  modifiers |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3615
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3616
    clazz := aJavaLangClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3617
    name := self reflection javaStringObjectForString: aJavaField name
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3618
                interned: true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3619
    slot := aJavaField index.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3620
    type := self javaClassObjectForClass: aJavaField typeClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3621
    modifiers := aJavaField accessFlags.
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
  3622
    field := (Java classForName: 'java.lang.reflect.Field') new.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3623
    field
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3624
        instVarNamed: #clazz put: clazz;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3625
        instVarNamed: #name put: name;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3626
        instVarNamed: #slot put: slot;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3627
        instVarNamed: #type put: type;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3628
        instVarNamed: #modifiers put: modifiers;        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3629
        yourself.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3630
    aJavaField annotations ifNotNil: [field instVarNamed: #annotations
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3631
            put: aJavaField annotations runtimeVisible rawAnnotations].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3632
    ^ field.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3633
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3634
    "Modified: / 05-12-1998 / 15:29:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3635
    "Created: / 22-11-2010 / 17:01:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3636
    "Modified: / 09-02-2011 / 01:06:20 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3637
    "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
  3638
    "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
  3639
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3640
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3641
javaMethodObjectForMethod:method 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3642
    "given a real method, return the corresponding java.lang.reflect.Constructor
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3643
     instance for it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3644
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3645
    ^ self reflection javaMethodObjectForMethod:method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3646
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3647
    "Modified: / 28-02-2011 / 17:08:36 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3648
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3649
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3650
methodForJavaConstructorObject:constructor 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3651
    "given a java.lang.reflect.Constructor, return the corresponding method
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3652
     it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3653
    self breakPoint:#mh info: 'refactor my sender to call reflection directly'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3654
    ^ self reflection methodForJavaConstructorObject: constructor.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3655
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3656
    "Modified: / 09-02-2011 / 00:59:43 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3657
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3658
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3659
methodForJavaMethodObject:aJavaMethodObject 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3660
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3661
        Given an instance of java.lang.reflect.Method, answers
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3662
        real method associated with it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3663
   ^ self reflection methodForJavaMethodObject:aJavaMethodObject.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3664
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3665
    "Modified: / 07-02-2011 / 09:50:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3666
    "Modified: / 28-02-2011 / 16:58:05 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3667
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3668
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3669
!JavaVM class methodsFor:'native - java.io'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3670
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3671
_java_io_FileDescriptor_initIDs: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3672
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3673
    <javanative: 'java/io/FileDescriptor' name: 'initIDs'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3674
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3675
        "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3676
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3677
    "Created: / 27.1.1998 / 18:16:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3678
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3679
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3680
_java_io_FileInputStream_initIDs: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3681
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3682
    <javanative: 'java/io/FileInputStream' name: 'initIDs'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3683
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3684
        "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3685
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3686
    "Created: / 27.1.1998 / 18:15:51 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3687
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3688
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3689
_java_io_FileOutputStream_initIDs: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3690
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3691
    <javanative: 'java/io/FileOutputStream' name: 'initIDs'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3692
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3693
        "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3694
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3695
    "Created: / 27.1.1998 / 18:16:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3696
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3697
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3698
_java_io_FileOutputStream_writeBytes: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3699
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3700
    <javanative: 'java/io/FileOutputStream' name: 'writeBytes'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3701
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3702
        ^ self anyStream_writeBytes:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3703
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3704
    "Modified: / 4.2.1998 / 15:24:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3705
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3706
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3707
_java_io_FileSystem_getFileSystem: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3708
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3709
    <javanative: 'java/io/FileSystem' name: 'getFileSystem'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3710
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3711
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3712
    OperatingSystem isUNIXlike ifTrue:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3713
        [^(Java classForName:'java.io.UnixFileSystem') new].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3714
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3715
    OperatingSystem isMSWINDOWSlike ifTrue:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3716
        [^(Java classForName:'java.io.WinNTFileSystem') new].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3717
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3718
    self error:'Unknown/Unsupported platform'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3719
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3720
    "Created: / 09-12-2010 / 17:58:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3721
    "Modified: / 01-04-2011 / 18:09:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3722
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3723
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3724
_java_io_ObjectStreamClass_initNative: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3725
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3726
    <javanative: 'java/io/ObjectStreamClass' name: 'initNative'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3727
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3728
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3729
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3730
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3731
     * Initializes native code.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3732
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3733
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3734
    "Nothing to do"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3735
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3736
    "Created: / 20-12-2010 / 17:43:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3737
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3738
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3739
_java_io_UnixFileSystem_canonicalize0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3740
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3741
    <javanative: 'java/io/UnixFileSystem' name: 'canonicalize0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3742
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3743
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3744
    |  path |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3745
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3746
    path := Java as_ST_String: (aJavaContext argAt: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3747
    ^(Java as_String: path asFilename asAbsoluteFilename pathName)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3748
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3749
    "Created: / 10-12-2010 / 14:40:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3750
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3751
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3752
_java_io_UnixFileSystem_getBooleanAttributes0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3753
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3754
    <javanative: 'java/io/UnixFileSystem' name: 'getBooleanAttributes0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3755
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3756
        |file path retval fileSystemClass|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3757
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3758
    retval := 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3759
    file := aJavaContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3760
    path := Java as_ST_String:(file instVarNamed:#path).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3761
    fileSystemClass := (Java classForName:'java.io.FileSystem').
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3762
    path asFilename exists ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3763
        retval := retval bitOr:(fileSystemClass instVarNamed:#'BA_EXISTS')
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3764
    ] ifFalse:[ ^ 0. ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3765
    path asFilename isDirectory ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3766
        retval := retval bitOr:(fileSystemClass instVarNamed:#'BA_DIRECTORY')
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3767
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3768
    path asFilename isRegularFile ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3769
        retval := retval bitOr:(fileSystemClass instVarNamed:#'BA_REGULAR')
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3770
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3771
    path asFilename isHidden ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3772
        retval := retval bitOr:(fileSystemClass instVarNamed:#'BA_HIDDEN')
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3773
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3774
    ^ retval
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3775
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3776
    "Modified: / 10-12-2010 / 14:43:31 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3777
    "Created: / 10-12-2010 / 14:46:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3778
    "Modified: / 11-12-2010 / 19:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3779
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3780
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3781
_java_io_UnixFileSystem_getLastModifiedTime: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3782
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3783
    <javanative: 'java/io/UnixFileSystem' name: 'getLastModifiedTime'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3784
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3785
        | file  path  retval |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3786
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3787
    retval := 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3788
    file := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3789
    path := Java as_ST_String: (file instVarNamed: #path).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3790
    retval := path asFilename modificationTime asMilliseconds.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3791
    ^ retval
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3792
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3793
    "Modified: / 10-12-2010 / 14:43:31 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3794
    "Modified: / 11-12-2010 / 19:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3795
    "Created: / 27-03-2011 / 15:32:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3796
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3797
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3798
_java_io_UnixFileSystem_initIDs: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3799
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3800
    <javanative: 'java/io/UnixFileSystem' name: 'initIDs'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3801
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3802
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3803
    self breakPoint: #libjava
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3804
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3805
    "Created: / 10-12-2010 / 14:47:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3806
    "Modified: / 10-12-2010 / 20:58:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3807
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  3808
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3809
!JavaVM class methodsFor:'native - java.lang'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3810
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3811
_java_lang_ClassLoader_NativeLibrary_load: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3812
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3813
    <javanative: 'java/lang/ClassLoader$NativeLibrary' name: 'load'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3814
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3815
        "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3816
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3817
    |nativeLoader jLibName libName libHandle index|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3818
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3819
    nativeLoader := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3820
    jLibName := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3821
    libName := (Java as_ST_String:jLibName) asFilename baseName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3822
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3823
    (index := SimulatedNativeLibs indexOf:libName) ~~ 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3824
"/        ('JAVA: builtIn nativeLibLoad simulated: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3825
        nativeLoader instVarNamed:'handle' put:index.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3826
        ^ self "/ void
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3827
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3828
    (LoadedNativeLibs notNil 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3829
    and:[LoadedNativeLibs includesKey:libName]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3830
"/        ('JAVA: native library already loaded: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3831
        nativeLoader instVarNamed:'handle' put:(LoadedNativeLibs at:libName).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3832
        ^ self "/ void
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3833
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3834
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3835
    (self confirm:'permission to load native library: ' , libName , ' ?') ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3836
        ^ self
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3837
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3838
self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3839
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3840
    libName asFilename exists ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3841
        ('JAVA: no file to load nativeLib: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3842
        ^ self "/ void
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3843
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3844
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3845
    libHandle := ObjectFileLoader loadLibrary:libName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3846
    libHandle isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3847
        ('JAVA: failed to load nativeLib: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3848
        ^ self "/ void
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3849
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3850
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3851
    LoadedNativeLibs isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3852
        LoadedNativeLibs := Dictionary new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3853
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3854
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3855
    LoadedNativeLibs at:libName put:libHandle.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3856
    nativeLoader instVarNamed:'handle' put:(LoadedNativeLibs at:libName).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3857
    ^ self "/ void
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3858
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3859
    "Modified: / 06-02-1998 / 03:12:17 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3860
    "Created: / 10-12-2010 / 15:11:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3861
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3862
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3863
_java_lang_ClassLoader_registerNatives: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3864
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3865
    <javanative: 'java/lang/ClassLoader' name: 'registerNatives'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3866
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3867
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3868
    "Nothing to do"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3869
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3870
    "Created: / 09-11-2010 / 20:55:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3871
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3872
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3873
_java_lang_Class_desiredAssertionStatus0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3874
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3875
    <javanative: 'java/lang/Class' name: 'desiredAssertionStatus0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3876
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3877
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3878
    ^AssertionsEnabled == true
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3879
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3880
    "Created: / 24-11-2010 / 08:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3881
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3882
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3883
_java_lang_Class_forName0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3884
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3885
    <javanative: 'java/lang/Class' name: 'forName0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3886
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3887
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3888
    | name initialize loader class |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3889
    name := Java as_ST_String: (aJavaContext argAt: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3890
    initialize := aJavaContext argAt: 2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3891
    loader := aJavaContext argAt: 3.   
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3892
    JavaClassReader classLoaderQuerySignal answer: loader do:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3893
        [class := Java classForName: name].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3894
    class isNil ifTrue:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3895
        [^self throwClassNotFoundException: name].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3896
    initialize ~~ 0 ifTrue:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3897
        [[class classInit] on: Error do:[self throwExceptionInInitializerError:name]].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3898
    ^JavaVM javaClassObjectForClass: class.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3899
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3900
    "Created: / 24-11-2010 / 09:03:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3901
    "Modified: / 01-05-2011 / 13:27:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3902
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3903
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3904
_java_lang_Class_getClassLoader0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3905
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3906
    <javanative: 'java/lang/Class' name: 'getClassLoader0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3907
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3908
        "get a classes loader"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3909
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3910
    |jClass cls loader|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3911
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3912
    jClass := aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3913
    cls := self reflection classForJavaClassObject:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3914
    loader := cls classLoader.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3915
    cls isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3916
        loader := (Java classForName:'java/lang/ClassLoader') 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3917
                    perform:#'getSystemClassLoader()Ljava/lang/ClassLoader;'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3918
        
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3919
"/    ('JAVA: getClassLoader - ' , loader printString) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3920
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3921
    ^ loader
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3922
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3923
    "Created: / 25-10-2010 / 22:49:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3924
    "Modified: / 09-11-2010 / 23:37:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3925
    "Modified: / 28-01-2011 / 15:18:54 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3926
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3927
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3928
_java_lang_Class_getComponentType: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3929
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3930
    <javanative: 'java/lang/Class' name: 'getComponentType'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3931
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3932
        |cls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3933
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3934
    cls := self reflection classForJavaClassObject:(nativeContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3935
    cls isJavaPrimitiveType ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3936
        self breakPoint:#jv.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3937
        ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3938
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3939
    ^ self javaClassObjectForClass:cls javaComponentClass
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3940
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3941
    "Created: / 12-11-1998 / 18:54:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3942
    "Modified: / 20-12-2010 / 22:56:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3943
    "Modified: / 28-01-2011 / 15:18:59 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3944
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3945
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3946
_java_lang_Class_getConstantPool: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3947
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3948
    <javanative: 'java/lang/Class' name: 'getConstantPool'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3949
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3950
        | class |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3951
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3952
    class := self reflection classForJavaClassObject:aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3953
    ^ self reflection javaConstantPoolObjectFor:class constantPool.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3954
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3955
    "Created: / 21-12-2010 / 20:00:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3956
    "Modified: / 28-02-2011 / 18:05:13 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3957
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3958
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3959
_java_lang_Class_getDeclaredConstructors0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3960
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3961
    <javanative: 'java/lang/Class' name: 'getDeclaredConstructors0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3962
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3963
        |class publicOnly constructors|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3964
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3965
    class := self reflection classForJavaClassObject:(aJavaContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3966
    publicOnly := (aJavaContext argAt:1) == 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3967
    constructors := OrderedCollection new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3968
    class 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3969
        selectorsAndMethodsDo:[:selector :method | 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3970
            (method isJavaMethod 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3971
                and:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3972
                    (selector at:1) == $< 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3973
                        and:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3974
                            (selector startsWith:'<init>(') and:[publicOnly not or:[method isPublic]]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3975
                        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3976
                ]) 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3977
                    ifTrue:[constructors add:(self reflection javaConstructorObjectForMethod:method)]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3978
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3979
    ^ (self classForName: 'java.lang.reflect.Constructor')
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3980
        arrayClass withAll: constructors
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3981
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3982
    "Created: / 24-11-2010 / 09:25:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3983
    "Modified: / 09-02-2011 / 01:24:03 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3984
    "Modified: / 11-02-2011 / 08:55:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3985
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3986
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3987
_java_lang_Class_getDeclaredFields0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3988
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3989
    <javanative: 'java/lang/Class' name: 'getDeclaredFields0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3990
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3991
        |javaClassObject class fields publicOnly|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3992
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3993
    class := self reflection classForJavaClassObject:(javaClassObject := aJavaContext argAt:0).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3994
    publicOnly := (aJavaContext argAt:1) == 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3995
    fields := class fields.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3996
    publicOnly ifTrue:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3997
        [fields := fields select:[:f|f isPublic]].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3998
    fields := fields collect:[:f | self javaFieldObjectForField:f in:javaClassObject].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  3999
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4000
    ^ (self classForName: 'java.lang.reflect.Field') arrayClass 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4001
            withAll:fields
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4002
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4003
    "Created: / 10-11-2010 / 16:22:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4004
    "Modified: / 28-01-2011 / 15:19:06 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4005
    "Modified: / 16-03-2011 / 15:43:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4006
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4007
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4008
_java_lang_Class_getDeclaredMethods0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4009
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4010
    <javanative: 'java/lang/Class' name: 'getDeclaredMethods0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4011
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4012
        |class publicOnly methods|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4013
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4014
    class := self reflection classForJavaClassObject:(aJavaContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4015
    publicOnly := (aJavaContext argAt:1) == 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4016
    methods := OrderedCollection new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4017
    class 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4018
        selectorsAndMethodsDo:[:selector :method | 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4019
            (method isJavaMethod 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4020
                and:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4021
                    (selector at:1) ~~ $< 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4022
                        and:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4023
                            (selector startsWith:'<init>(') not 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4024
                                and:[publicOnly not or:[method isPublic]]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4025
                        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4026
                ]) 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4027
                    ifTrue:[methods add:(self javaMethodObjectForMethod:method)]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4028
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4029
    ^ (self classForName: 'java.lang.reflect.Method')
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4030
        arrayClass withAll: methods asArray
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4031
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4032
    "Created: / 21-12-2010 / 22:39:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4033
    "Modified: / 28-01-2011 / 15:19:09 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4034
    "Modified: / 11-02-2011 / 08:35:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4035
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4036
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4037
_java_lang_Class_getInterfaces: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4038
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4039
    <javanative: 'java/lang/Class' name: 'getInterfaces'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4040
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4041
        |jClass cls interfaces jInterfaces|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4042
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4043
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4044
    cls := self reflection classForJavaClassObject:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4045
    cls isJavaPrimitiveType ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4046
        ^ (self classForName:'java.lang.Class') arrayClass new
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4047
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4048
    interfaces := cls interfaces.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4049
    interfaces ifNil:[^ (self classForName:'java.lang.Class') arrayClass new].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4050
    jInterfaces := (self classForName:'java.lang.Class') arrayClass new:interfaces size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4051
    interfaces withIndexDo:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4052
        [:iface :idx | jInterfaces at:idx put:(self javaClassObjectForClass:iface)].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4053
    ^ jInterfaces
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4054
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4055
    "Modified: / 28-01-2011 / 15:19:11 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4056
    "Modified: / 04-02-2011 / 09:43:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4057
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4058
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4059
_java_lang_Class_getModifiers: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4060
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4061
    <javanative: 'java/lang/Class' name: 'getModifiers'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4062
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4063
        ^ (self reflection classForJavaClassObject:aJavaContext receiver) accessFlags
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4064
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4065
    "Created: / 12-11-1998 / 18:54:53 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4066
    "Modified: / 26-11-2010 / 10:25:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4067
    "Modified: / 28-01-2011 / 15:19:14 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4068
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4069
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4070
_java_lang_Class_getName0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4071
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4072
    <javanative: 'java/lang/Class' name: 'getName0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4073
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4074
        |class|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4075
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4076
    class := aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4077
    class := self reflection classForJavaClassObject:aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4078
    ^ self reflection 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4079
        javaStringObjectForString:class javaName
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4080
        interned:true.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4081
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4082
    "Created: / 22-11-2010 / 17:50:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4083
    "Modified: / 09-02-2011 / 01:06:53 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4084
    "Modified: / 25-02-2011 / 19:00:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4085
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4086
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4087
_java_lang_Class_getPrimitiveClass: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4088
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4089
    <javanative: 'java/lang/Class' name: 'getPrimitiveClass'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4090
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4091
        "get a primitive class by name"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4092
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4093
    |jClassName className|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4094
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4095
    jClassName := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4096
    className := Java as_ST_String:jClassName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4097
    (JavaDescriptor baseTypesByTypeName keys includes: className)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4098
        ifFalse:[self throwClassNotFoundException:className].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4099
    ^self reflection javaClassObjectForClassNamed: className
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4100
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4101
    "Created: / 04-01-1998 / 00:46:03 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4102
    "Modified: / 28-01-2011 / 15:30:45 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4103
    "Modified: / 03-02-2011 / 21:43:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4104
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4105
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4106
_java_lang_Class_getRawAnnotations: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4107
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4108
    <javanative: 'java/lang/Class' name: 'getRawAnnotations'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4109
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4110
        |class |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4111
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4112
    class := self reflection classForJavaClassObject:aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4113
    ^ class runtimeVisibleAnnotationsAsBytesOrNil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4114
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4115
    "Created: / 21-12-2010 / 19:35:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4116
    "Modified: / 28-01-2011 / 15:19:20 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4117
    "Modified: / 25-02-2011 / 16:48:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4118
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4119
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4120
_java_lang_Class_getSuperclass: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4121
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4122
    <javanative: 'java/lang/Class' name: 'getSuperclass'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4123
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4124
        "return a classes superclass"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4125
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4126
    |jClass cls superCls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4127
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4128
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4129
    cls := self reflection classForJavaClassObject:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4130
    superCls := cls superclass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4131
    superCls == JavaObject ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4132
        ^ nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4133
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4134
    ^ self javaClassObjectForClass:superCls
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4135
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4136
    "Created: / 12-01-1998 / 12:38:36 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4137
    "Modified: / 04-02-1998 / 14:51:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4138
    "Modified: / 28-01-2011 / 14:12:47 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4139
    "Modified: / 03-02-2011 / 22:53:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4140
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4141
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4142
_java_lang_Class_isArray: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4143
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4144
    <javanative: 'java/lang/Class' name: 'isArray'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4145
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4146
        ^ (self reflection classForJavaClassObject:nativeContext receiver) isJavaArrayClass 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4147
        ifTrue:[1]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4148
        ifFalse:[0]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4149
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4150
    "Created: / 12-11-1998 / 18:54:24 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4151
    "Modified: / 20-12-2010 / 23:20:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4152
    "Modified: / 28-01-2011 / 15:19:24 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4153
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4154
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4155
_java_lang_Class_isAssignableFrom: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4156
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4157
    <javanative: 'java/lang/Class' name: 'isAssignableFrom'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4158
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4159
        "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4160
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4161
     * Determines if the class or interface represented by this
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4162
     * {@code Class} object is either the same as, or is a superclass or
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4163
     * superinterface of, the class or interface represented by the specified
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4164
     * {@code Class} parameter. It returns {@code true} if so;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4165
     * otherwise it returns {@code false}. If this {@code Class}
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4166
     * object represents a primitive type, this method returns
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4167
     * {@code true} if the specified {@code Class} parameter is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4168
     * exactly this {@code Class} object; otherwise it returns
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4169
     * {@code false}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4170
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4171
     * <p> Specifically, this method tests whether the type represented by the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4172
     * specified {@code Class} parameter can be converted to the type
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4173
     * represented by this {@code Class} object via an identity conversion
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4174
     * or via a widening reference conversion. See <em>The Java Language
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4175
     * Specification</em>, sections 5.1.1 and 5.1.4 , for details.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4176
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4177
     * @param cls the {@code Class} object to be checked
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4178
     * @return the {@code boolean} value indicating whether objects of the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4179
     * type {@code cls} can be assigned to objects of this class
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4180
     * @exception NullPointerException if the specified Class parameter is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4181
     *            null.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4182
     * @since JDK1.1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4183
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4184
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4185
    | clsObj me other |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4186
    clsObj := nativeContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4187
    clsObj ifNil:[^self throwNullPointerException].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4188
    me := self reflection classForJavaClassObject: nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4189
    other := self reflection classForJavaClassObject: clsObj.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4190
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4191
    "/    Determines if the class or interface represented by this
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4192
    "/    @code Class} object is either the same as, or is a superclass or
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4193
    "/    superinterface of, the class or interface represented by the specified
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4194
    "/    {@code Class} parameter.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4195
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4196
    ^(other includesBehavior: me)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4197
        ifTrue:[1]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4198
        ifFalse:[0]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4199
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4200
    "Created: / 12-11-1998 / 18:54:16 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4201
    "Modified: / 05-02-2011 / 23:38:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4202
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4203
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4204
_java_lang_Class_isInterface: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4205
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4206
    <javanative: 'java/lang/Class' name: 'isInterface'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4207
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4208
        "return true, if this class is an interface"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4209
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4210
    |jClass cls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4211
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4212
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4213
    cls := self reflection classForJavaClassObject:jClass. 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4214
    cls isJavaClass ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4215
        ^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4216
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4217
    cls isInterface ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4218
        ^ 1 "TRUE"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4219
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4220
    ^ 0 "FALSE"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4221
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4222
    "Created: / 12-01-1998 / 12:37:02 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4223
    "Modified: / 28-01-2011 / 14:12:35 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4224
    "Modified: / 03-02-2011 / 21:50:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4225
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4226
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4227
_java_lang_Class_isPrimitive: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4228
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4229
    <javanative: 'java/lang/Class' name: 'isPrimitive'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4230
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4231
        "return true, if this class is builtin primitive class
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4232
     (i.e. byteArray, array, string etc."
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4233
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4234
    |jClass cls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4235
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4236
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4237
    cls := self reflection classForJavaClassObject:jClass. 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4238
    ^cls isJavaPrimitiveType 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4239
        ifTrue:[1"true"]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4240
        ifFalse:[0"false"].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4241
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4242
    "Created: / 09-02-1998 / 14:46:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4243
    "Modified: / 28-01-2011 / 14:12:30 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4244
    "Modified: / 04-02-2011 / 11:56:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4245
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4246
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4247
_java_lang_Class_registerNatives: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4248
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4249
    <javanative: 'java/lang/Class' name: 'registerNatives'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4250
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4251
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4252
     "Nothing to do, native method are bound lazily"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4253
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4254
    "Created: / 20-10-2010 / 11:13:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4255
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4256
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4257
_java_lang_Double_doubleToRawLongBits: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4258
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4259
    <javanative: 'java/lang/Double' name: 'doubleToRawLongBits'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4260
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4261
        "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4262
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4263
     * Returns a representation of the specified floating-point value
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4264
     * according to the IEEE 754 floating-point 'double
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4265
     * format' bit layout, preserving Not-a-Number (NaN) values.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4266
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4267
     * <p>Bit 63 (the bit that is selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4268
     * {@code 0x8000000000000000L}) represents the sign of the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4269
     * floating-point number. Bits
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4270
     * 62-52 (the bits that are selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4271
     * {@code 0x7ff0000000000000L}) represent the exponent. Bits 51-0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4272
     * (the bits that are selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4273
     * {@code 0x000fffffffffffffL}) represent the significand
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4274
     * (sometimes called the mantissa) of the floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4275
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4276
     * <p>If the argument is positive infinity, the result is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4277
     * {@code 0x7ff0000000000000L}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4278
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4279
     * <p>If the argument is negative infinity, the result is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4280
     * {@code 0xfff0000000000000L}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4281
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4282
     * <p>If the argument is NaN, the result is the {@code long}
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4283
     * integer representing the actual NaN value.  Unlike the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4284
     * {@code doubleToLongBits} method,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4285
     * {@code doubleToRawLongBits} does not collapse all the bit
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4286
     * patterns encoding a NaN to a single 'canonical' NaN
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4287
     * value.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4288
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4289
     * <p>In all cases, the result is a {@code long} integer that,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4290
     * when given to the {@link #longBitsToDouble(long)} method, will
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4291
     * produce a floating-point value the same as the argument to
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4292
     * {@code doubleToRawLongBits}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4293
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4294
     * @param   value   a {@code double} precision floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4295
     * @return the bits that represent the floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4296
     * @since 1.3
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4297
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4298
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4299
    | f |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4300
    f := aJavaContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4301
    (f =  0.0) ifTrue:[^0].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4302
    (f = -0.0) ifTrue:[^(1 bitShift: 63)].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4303
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4304
    self halt:'Not yet implemented'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4305
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4306
    "Created: / 10-11-2010 / 14:48:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4307
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4308
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4309
_java_lang_Float_floatToRawIntBits: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4310
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4311
    <javanative: 'java/lang/Float' name: 'floatToRawIntBits'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4312
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4313
        "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4314
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4315
     * Returns a representation of the specified floating-point value
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4316
     * according to the IEEE 754 floating-point 'single format' bit
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4317
     * layout, preserving Not-a-Number (NaN) values.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4318
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4319
     * <p>Bit 31 (the bit that is selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4320
     * {@code 0x80000000}) represents the sign of the floating-point
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4321
     * number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4322
     * Bits 30-23 (the bits that are selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4323
     * {@code 0x7f800000}) represent the exponent.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4324
     * Bits 22-0 (the bits that are selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4325
     * {@code 0x007fffff}) represent the significand (sometimes called
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4326
     * the mantissa) of the floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4327
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4328
     * <p>If the argument is positive infinity, the result is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4329
     * {@code 0x7f800000}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4330
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4331
     * <p>If the argument is negative infinity, the result is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4332
     * {@code 0xff800000}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4333
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4334
     * <p>If the argument is NaN, the result is the integer representing
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4335
     * the actual NaN value.  Unlike the {@code floatToIntBits}
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4336
     * method, {@code floatToRawIntBits} does not collapse all the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4337
     * bit patterns encoding a NaN to a single 'canonical'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4338
     * NaN value.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4339
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4340
     * <p>In all cases, the result is an integer that, when given to the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4341
     * {@link #intBitsToFloat(int)} method, will produce a
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4342
     * floating-point value the same as the argument to
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4343
     * {@code floatToRawIntBits}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4344
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4345
     * @param   value   a floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4346
     * @return the bits that represent the floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4347
     * @since 1.3
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4348
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4349
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4350
    | f exponent mantissa |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4351
    f := aJavaContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4352
    (f =  0.0) ifTrue:[^0].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4353
    (f = -0.0) ifTrue:[^(1 bitShift: 31) ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4354
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4355
    self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4356
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4357
    "Created: / 09-11-2010 / 20:59:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4358
    "Modified: / 10-11-2010 / 14:47:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4359
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4360
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4361
_java_lang_Object_clone: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4362
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4363
    <javanative: 'java/lang/Object' name: 'clone'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4364
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4365
        "clone an object"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4366
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4367
    |o rslt|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4368
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4369
    o := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4370
    rslt := o shallowCopy.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4371
    ^ rslt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4372
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4373
    "Created: / 4.1.1998 / 19:39:26 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4374
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4375
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4376
_java_lang_Object_getClass: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4377
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4378
    <javanative: 'java/lang/Object' name: 'getClass'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4379
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4380
        "return an objects class"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4381
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4382
    |o cls jClass|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4383
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4384
    o := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4385
    cls := o class.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4386
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4387
    jClass := self javaClassObjectForClass:cls.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4388
    ^ jClass
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4389
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4390
    "Created: / 6.1.1998 / 18:28:27 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4391
    "Modified: / 23.1.1998 / 17:48:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4392
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4393
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4394
_java_lang_Object_hashCode: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4395
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4396
    <javanative: 'java/lang/Object' name: 'hashCode'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4397
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4398
        "identityHash"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4399
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4400
    |o rslt|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4401
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4402
    o := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4403
    rslt := o identityHash.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4404
    ^ rslt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4405
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4406
    "Created: / 4.1.1998 / 19:40:26 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4407
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4408
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4409
_java_lang_Object_registerNatives: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4410
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4411
    <javanative: 'java/lang/Object' name: 'registerNatives'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4412
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4413
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4414
    "Nothing to do, native method are bound lazily"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4415
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4416
    "Created: / 19-10-2010 / 12:42:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4417
    "Modified: / 20-10-2010 / 10:57:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4418
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4419
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4420
_java_lang_Object_wait: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4421
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4422
    <javanative: 'java/lang/Object' name: 'wait'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4423
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4424
    |tmo handle sema|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4425
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4426
    handle := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4427
    tmo := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4428
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4429
    sema := JavaVM semaphoreFor:handle.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4430
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4431
    [
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4432
        self waitFor:sema state:#javaWait timeOut:tmo.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4433
    ] valueOnUnwindDo:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4434
        JavaVM releaseSemaphoreFor:handle.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4435
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4436
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4437
    ThreadTrace ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4438
        '====> thread continues ...' printCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4439
    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4440
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4441
    "Modified: / 30-12-1998 / 19:20:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4442
    "Modified: / 01-05-2011 / 13:26:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4443
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4444
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4445
_java_lang_String_intern: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4446
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4447
    <javanative: 'java/lang/String' name: 'intern'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4448
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4449
        |jString|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4450
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4451
    jString := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4452
    ^ Java intern:jString
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4453
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4454
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4455
_java_lang_System_arraycopy: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4456
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4457
    <javanative: 'java/lang/System' name: 'arraycopy'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4458
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4459
        |srcArray srcIdx dstArray dstIdx count dstEndIdx|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4460
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4461
    srcArray := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4462
    srcArray isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4463
        ^ self throwNullPointerException
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4464
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4465
    srcIdx := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4466
    dstArray := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4467
    dstArray isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4468
        ^ self throwNullPointerException
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4469
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4470
    dstIdx := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4471
    count := nativeContext argAt:5.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4472
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4473
    ((srcIdx < 0) or:[srcIdx + count > srcArray size]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4474
        srcArray size == 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4475
            srcArray isVariable ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4476
                ^ self throwArrayStoreException:srcArray
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4477
            ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4478
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4479
        ^ self throwArrayIndexOutOfBoundsException:(srcIdx + count - 1)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4480
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4481
    ((dstIdx < 0) or:[dstIdx + count > dstArray size]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4482
        dstArray size == 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4483
            dstArray isVariable ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4484
                ^ self throwArrayStoreException:dstArray
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4485
            ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4486
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4487
        ^ self throwArrayIndexOutOfBoundsException:(dstIdx + count - 1)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4488
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4489
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4490
    dstEndIdx := dstIdx + count.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4491
    dstIdx := dstIdx + 1.       "/ ST uses 1-based indexing
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4492
    srcIdx := srcIdx + 1.       "/ ST uses 1-based indexing
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4493
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4494
    (srcArray class isBytes and:[dstArray class isBytes]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4495
        dstArray replaceBytesFrom:dstIdx to:dstEndIdx with:srcArray startingAt:srcIdx.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4496
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4497
        dstArray replaceFrom:dstIdx to:dstEndIdx with:srcArray startingAt:srcIdx.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4498
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4499
    ^ nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4500
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4501
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4502
_java_lang_System_currentTimeMillis: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4503
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4504
    <javanative: 'java/lang/System' name: 'currentTimeMillis'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4505
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4506
        "return the milliseconds since 1.jan.1970"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4507
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4508
    |delta|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4509
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4510
    "/ workaround win32 bug (use 01:01:01 as base)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4511
    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
  4512
    delta := delta - 3600 - 60 - 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4513
"/    "/ make certain, it fits 64 signed bits
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4514
"/    delta := delta bitAnd:16r7FFFFFFFFFFFFFFF.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4515
"/    ^ delta max:0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4516
    ^ delta
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4517
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4518
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4519
     JavaVM _System_currentTimeMillis:nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4520
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4521
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4522
    "Modified: / 23.12.1998 / 21:54:50 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4523
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4524
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4525
_java_lang_System_initProperties: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4526
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4527
    <javanative: 'java/lang/System' name: 'initProperties'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4528
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4529
        |props stProps|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4530
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4531
    props := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4532
    stProps := self systemProperties.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4533
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4534
    "/ recursively invoke myself on the Java HashTable.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4535
    "/ calling 'put' to stuff in the values ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4536
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4537
    stProps keysAndValuesDo:[:key :value |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4538
	|keyObj valueObj|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4539
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4540
	keyObj := Java as_String:key.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4541
	valueObj := Java as_String:value.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4542
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4543
	props 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4544
	    perform:#'put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4545
	    with:keyObj 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4546
	    with:valueObj.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4547
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4548
    ^ props
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4549
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4550
    "Created: / 3.1.1998 / 14:25:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4551
    "Modified: / 4.1.1998 / 14:23:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4552
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4553
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4554
_java_lang_System_mapLibraryName: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4555
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4556
    <javanative: 'java/lang/System' name: 'mapLibraryName'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4557
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4558
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4559
    | name |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4560
    name := Java as_ST_String: (aJavaContext argAt: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4561
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4562
    OperatingSystem isUNIXlike ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4563
        ^Java as_String: ('lib' , name , '.so').
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4564
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4565
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4566
    OperatingSystem isMSWINDOWSlike ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4567
        ^Java as_String: ( name , '.dll').
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4568
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4569
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4570
    self error:'Unknown/Unsupported platform'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4571
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4572
    "Created: / 09-12-2010 / 18:16:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4573
    "Modified: / 01-04-2011 / 18:14:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4574
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4575
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4576
_java_lang_System_registerNatives: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4577
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4578
    <javanative: 'java/lang/System' name: 'registerNatives'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4579
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4580
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4581
    "Nothing to do, native method are bound lazily"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4582
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4583
    "Created: / 20-10-2010 / 10:56:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4584
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4585
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4586
_java_lang_System_setErr0: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4587
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4588
    <javanative: 'java/lang/System' name: 'setErr0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4589
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4590
        |stream|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4591
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4592
    stream := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4593
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4594
    self setOpenFile:(self javaConsoleStream ? Stderr) at:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4595
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4596
    nativeContext receiver instVarNamed:'err' put:stream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4597
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4598
    "Created: / 18.3.1997 / 15:02:05 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4599
    "Modified: / 4.1.1998 / 16:21:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4600
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4601
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4602
_java_lang_System_setIn0: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4603
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4604
    <javanative: 'java/lang/System' name: 'setIn0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4605
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4606
        |stream|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4607
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4608
    stream := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4609
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4610
    self setOpenFile:Stdin at:0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4611
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4612
    nativeContext receiver instVarNamed:'in' put:stream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4613
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4614
    "Created: / 4.1.1998 / 16:16:38 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4615
    "Modified: / 4.1.1998 / 16:20:44 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4616
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4617
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4618
_java_lang_System_setOut0: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4619
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4620
    <javanative: 'java/lang/System' name: 'setOut0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4621
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4622
        |stream|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4623
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4624
    stream := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4625
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4626
    self setOpenFile:(self javaConsoleStream ? Stdout) at:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4627
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4628
    nativeContext receiver instVarNamed:'out' put:stream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4629
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4630
    "Created: / 4.1.1998 / 16:18:26 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4631
    "Modified: / 4.1.1998 / 16:20:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4632
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4633
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4634
_java_lang_Thread_currentThread: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4635
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4636
    <javanative: 'java/lang/Thread' name: 'currentThread'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4637
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4638
    |t p|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4639
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4640
    p := Processor activeProcess.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4641
    t := self javaThreadForSTProcess:p.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4642
    t notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4643
        ^ t
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4644
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4645
    t := self newThread:'main'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4646
    Java threads at:t put:p.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4647
    ^ t
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4648
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4649
    "Modified: / 01-05-2011 / 13:24:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4650
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4651
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4652
_java_lang_Thread_holdsLock: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4653
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4654
    <javanative: 'java/lang/Thread' name: 'holdsLock'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4655
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4656
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4657
    | obj |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4658
    obj := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4659
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4660
    ^(self enteredMonitorsOfProcess:Processor activeProcess)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4661
        includes: obj.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4662
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4663
    "Created: / 30-04-2011 / 22:06:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4664
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4665
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4666
_java_lang_Thread_isAlive: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4667
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4668
    <javanative: 'java/lang/Thread' name: 'isAlive'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4669
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4670
        "is it alive ?"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4671
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4672
    |jThread stProcess|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4673
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4674
    jThread := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4675
    stProcess := JavaVM stProcessForJavaThread:jThread.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4676
    stProcess isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4677
	ThreadTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4678
	    ('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4679
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4680
	^ 0 "FALSE"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4681
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4682
    stProcess isDead ifTrue:[^ 0 "FALSE"].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4683
    ^ 1 "TRUE"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4684
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4685
    "Created: / 5.1.1998 / 02:03:51 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4686
    "Modified: / 6.2.1998 / 02:15:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4687
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4688
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4689
_java_lang_Thread_registerNatives: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4690
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4691
    <javanative: 'java/lang/Thread' name: 'registerNatives'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4692
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4693
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4694
    "Nothing to do, native method are bound lazily"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4695
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4696
    "Created: / 20-10-2010 / 11:12:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4697
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4698
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4699
_java_lang_Thread_setPriority0: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4700
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4701
    <javanative: 'java/lang/Thread' name: 'setPriority0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4702
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4703
   |t p prio|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4704
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4705
    t := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4706
    p := JavaVM stProcessForJavaThread:t.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4707
    prio := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4708
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4709
    p isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4710
        ThreadTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4711
            'JAVA [info]: no process yet (in setPriority)' infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4712
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4713
        ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4714
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4715
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4716
    "Modified: / 01-05-2011 / 13:25:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4717
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4718
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4719
_java_lang_Thread_start0: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4720
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4721
    <javanative: 'java/lang/Thread' name: 'start0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4722
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4723
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4724
    ^self threadStart: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4725
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4726
    "Modified: / 24-12-1999 / 03:14:33 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4727
    "Created: / 22-11-2010 / 17:48:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4728
    "Modified: / 14-12-2010 / 21:31:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4729
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4730
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4731
_java_lang_Throwable_fillInStackTrace: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4732
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4733
    <javanative: 'java/lang/Throwable' name: 'fillInStackTrace'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4734
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4735
        |exClass exceptionObject list con|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4736
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4737
    exClass := Java classNamed:'java.lang.Throwable'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4738
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4739
    exceptionObject := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4740
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4741
    "/
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4742
    "/ debugging only
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4743
    "/
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4744
    (exceptionObject isKindOf:(Java classNamed:'java.lang.Throwable')) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4745
	self halt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4746
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4747
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4748
    con := thisContext sender.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4749
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4750
    "/
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4751
    "/ we are not interrested in all intermediate Exception frames ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4752
    "/
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4753
    FullExceptionTrace ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4754
	"/ first, skip any JavaVM contexts
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4755
	[con receiver == exceptionObject] whileFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4756
	    con := con sender
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4757
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4758
	"/ then, all exception-init contexts
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4759
	[con receiver == exceptionObject] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4760
	    con := con sender
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4761
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4762
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4763
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4764
    list := OrderedCollection new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4765
    [con notNil] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4766
	(con isJavaContext) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4767
	    "/ add a copy, in case the context continues with some
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4768
	    "/ cleanup ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4769
	    list add:con shallowCopy
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4770
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4771
	con := con sender
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4772
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4773
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4774
    exceptionObject instVarNamed:'backtrace' put:(list asArray).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4775
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4776
    ^ nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4777
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4778
    "Created: / 4.1.1998 / 14:27:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4779
    "Modified: / 8.5.1998 / 21:29:53 / cg"
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4780
!
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4781
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4782
_java_lang_Throwable_getStackTraceDepth: nativeContext
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4783
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4784
    <javanative: 'java/lang/Throwable' name: 'getStackTraceDepth'>
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4785
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4786
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4787
    ^(nativeContext receiver instVarNamed: #backtrace) size
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4788
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4789
    "Modified: / 01-05-2011 / 20:25:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4790
!
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4791
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4792
_java_lang_Throwable_getStackTraceElement: nativeContext
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4793
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4794
    <javanative: 'java/lang/Throwable' name: 'getStackTraceElement'>
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4795
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4796
    | throwable index backtraceCtx stackTraceElement |
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4797
    throwable := nativeContext receiver.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4798
    index :=  nativeContext argAt: 1.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4799
    backtraceCtx := (throwable instVarNamed:#backtrace) at: index + 1.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4800
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4801
    stackTraceElement := (self classForName: 'java.lang.StackTraceElement') new.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4802
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4803
    self halt:'Unfinished'
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4804
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4805
    "Modified: / 01-05-2011 / 20:31:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4806
! !
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4807
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4808
!JavaVM class methodsFor:'native - java.lang.reflect'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4809
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4810
_java_lang_reflect_Array_newArray: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4811
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4812
    <javanative: 'java/lang/reflect/Array' name: 'newArray'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4813
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4814
        |componentClass size|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4815
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4816
    componentClass := self reflection 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4817
                classForJavaClassObject:(aJavaContext argAt:1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4818
    size := aJavaContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4819
    ^ componentClass arrayClass new:size
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4820
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4821
    "Created: / 17-12-2010 / 14:49:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4822
    "Modified: / 19-12-2010 / 17:54:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4823
    "Modified: / 28-01-2011 / 15:18:50 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4824
! !
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4825
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4826
!JavaVM class methodsFor:'native - java.security'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4827
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4828
_java_security_AccessController_doPrivileged: 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/security/AccessController' name: 'doPrivileged'>
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
    "Don't care about permissions :-)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4834
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4835
    ^(aJavaContext argAt:1) perform: #'run()Ljava/lang/Object;'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4836
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4837
    "Created: / 20-10-2010 / 12:31:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4838
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4839
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4840
_java_security_AccessController_getStackAccessControlContext: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4841
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4842
    <javanative: 'java/security/AccessController' name: 'getStackAccessControlContext'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4843
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4844
        "/ introduced with jdk1.2
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4845
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4846
    "/ supposed to do more here ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4847
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4848
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4849
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4850
    "Created: / 27.1.1998 / 18:22:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4851
! !
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4852
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4853
!JavaVM class methodsFor:'native - java.util.zip'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4854
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4855
_java_util_zip_Inflater_inflateBytes: nativeContext
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4856
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4857
    <javanative: 'java/util/zip/Inflater' name: 'inflateBytes'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4858
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4859
    | inflater inputBuf outputBuf b off len|
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4860
    inflater := nativeContext receiver.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4861
    inputBuf := inflater instVarNamed: #buf.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4862
    inputBuf size == 0 ifTrue:[^0].
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4863
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4864
    b := nativeContext argAt: 3.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4865
    off := nativeContext argAt: 4.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4866
    len := nativeContext argAt: 5.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4867
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4868
    outputBuf := ByteArray new: (len + 1000"save").
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4869
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4870
    ZipArchive basicNew inflate:inputBuf to:outputBuf.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4871
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4872
    b replaceFrom:off + 1 to: off + len with: outputBuf startingAt:1.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4873
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4874
    ^len
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4875
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4876
    "Created: / 30-04-2011 / 23:02:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4877
    "Modified: / 01-05-2011 / 16:37:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4878
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4879
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4880
_java_util_zip_Inflater_init: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4881
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4882
    <javanative: 'java/util/zip/Inflater' name: 'init'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4883
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4884
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4885
    | index |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4886
    index := ZipInflaters indexOf: nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4887
    index == 0 ifTrue:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4888
        [ZipInflaters add: nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4889
        index := ZipInflaters size].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4890
    ^index
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4891
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4892
    "Created: / 01-02-1998 / 20:14:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4893
    "Modified: / 30-04-2011 / 23:01:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4894
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4895
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4896
_java_util_zip_Inflater_initIDs: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4897
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4898
    <javanative: 'java/util/zip/Inflater' name: 'initIDs'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4899
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4900
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4901
    "Nothing to do, used only to register natives"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4902
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4903
    "Created: / 30-04-2011 / 21:55:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4904
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4905
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4906
_java_util_zip_ZipEntry_initFields: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4907
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4908
    <javanative: 'java/util/zip/ZipEntry' name: 'initFields'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4909
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4910
        | entry jzentry zmember |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4911
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4912
    entry := aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4913
    jzentry := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4914
    zmember := ZipEntryCache at: jzentry.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4915
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4916
    entry 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4917
        instVarNamed: #time     put: zmember lastModFileTime;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4918
        instVarNamed: #crc      put: zmember crc32;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4919
        instVarNamed: #size     put: zmember uncompressedSize;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4920
        instVarNamed: #csize    put: zmember compressedSize;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4921
        instVarNamed: #method   put: zmember compressionMethod;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4922
        instVarNamed: #extra    put: zmember extraField;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4923
        instVarNamed: #comment  put: (zmember fileComment ifNotNil:[Java as_String: zmember fileComment]).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4924
        
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4925
        
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4926
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4927
    "Created: / 01-04-2011 / 13:04:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4928
    "Modified: / 29-04-2011 / 20:01:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4929
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4930
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4931
_java_util_zip_ZipEntry_initIDs: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4932
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4933
    <javanative: 'java/util/zip/ZipEntry' name: 'initIDs'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4934
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4935
        "hopefully nothing to do"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4936
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4937
    "Created: / 01-04-2011 / 13:02:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4938
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4939
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4940
_java_util_zip_ZipFile_freeEntry: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4941
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4942
    <javanative: 'java/util/zip/ZipFile' name: 'freeEntry'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4943
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4944
    | zipArchiveIndex  zipEntryIndex |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4945
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4946
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4947
    zipArchiveIndex := nativeContext at: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4948
    zipEntryIndex := nativeContext at: 3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4949
    zipEntryIndex = 0 ifFalse: [ ZipEntryCache at: zipEntryIndex put: nil ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4950
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4951
    "Modified: / 01-05-2011 / 13:33:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4952
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4953
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4954
_java_util_zip_ZipFile_getCSize: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4955
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4956
    <javanative: 'java/util/zip/ZipFile' name: 'getCSize'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4957
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4958
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4959
    | jzentry zmember |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4960
    jzentry := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4961
    zmember := ZipEntryCache at: jzentry.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4962
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4963
    ^zmember compressedSize
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4964
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4965
    "Created: / 30-04-2011 / 21:50:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4966
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4967
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4968
_java_util_zip_ZipFile_getEntry: nativeContext
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4969
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4970
    <javanative: 'java/util/zip/ZipFile' name: 'getEntry'>
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4971
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4972
    | zipArchive  filename  result |
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4973
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4974
    zipArchive := ZipCache at: (nativeContext at: 1).
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4975
    filename := Java as_ST_String: (nativeContext at: 3).
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4976
    result := (zipArchive membersMatching: filename).
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4977
    result size = 0 
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4978
        ifTrue: [ ^ 0 ]
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4979
        ifFalse: [ ^ ZipEntryCache indexOf: (ZipEntryCache add: result first) ].
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4980
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4981
    "Created: / 27-03-2011 / 16:59:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4982
    "Modified: / 01-04-2011 / 16:03:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4983
    "Modified: / 01-05-2011 / 15:12:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4984
!
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  4985
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4986
_java_util_zip_ZipFile_getMethod: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4987
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4988
    <javanative: 'java/util/zip/ZipFile' name: 'getMethod'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4989
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4990
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4991
    | jzentry zmember |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4992
    jzentry := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4993
    zmember := ZipEntryCache at: jzentry.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4994
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4995
    ^zmember compressionMethod
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4996
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4997
    "Created: / 30-04-2011 / 21:53:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4998
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  4999
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5000
_java_util_zip_ZipFile_getSize: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5001
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5002
    <javanative: 'java/util/zip/ZipFile' name: 'getSize'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5003
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5004
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5005
    | jzentry zmember |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5006
    jzentry := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5007
    zmember := ZipEntryCache at: jzentry.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5008
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5009
    ^zmember uncompressedSize
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5010
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5011
    "Created: / 30-04-2011 / 21:53:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5012
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5013
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5014
_java_util_zip_ZipFile_getTotal: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5015
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5016
    <javanative: 'java/util/zip/ZipFile' name: 'getTotal'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5017
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5018
    | zar |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5019
    zar := ZipCache at: (nativeContext at: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5020
    ^ zar entries size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5021
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5022
    "Modified: / 01-05-2011 / 13:31:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5023
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5024
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5025
_java_util_zip_ZipFile_initIDs: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5026
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5027
    <javanative: 'java/util/zip/ZipFile' name: 'initIDs'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5028
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5029
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5030
    "Nothing to do"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5031
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5032
    "Created: / 23-03-2011 / 19:37:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5033
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5034
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5035
_java_util_zip_ZipFile_open: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5036
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5037
    <javanative: 'java/util/zip/ZipFile' name: 'open'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5038
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5039
    | path  mode  lastModTime  result |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5040
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5041
    path := Java as_ST_String: (nativeContext at: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5042
    mode := nativeContext at: 2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5043
    lastModTime := nativeContext at: 3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5044
    result := path asFilename.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5045
    result ifNil: [ JavaVM throwZipException ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5046
    ^ ZipCache 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5047
        indexOf: ( ZipCache add: (ZipArchive readingFrom: result readStream) ).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5048
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5049
    "Modified: / 01-04-2011 / 15:35:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5050
    "Modified: / 01-05-2011 / 13:29:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5051
!
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5052
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5053
_java_util_zip_ZipFile_read: aJavaContext
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5054
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5055
    <javanative: 'java/util/zip/ZipFile' name: 'read'>
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5056
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5057
    
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5058
    | jzfile jzentry pos b off len zar zmember bytesToRead |
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5059
    jzfile := aJavaContext argAt: 1.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5060
    jzentry := aJavaContext argAt: 3. "first arg is long!!!!!!"
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5061
    pos := aJavaContext argAt: 5. "jzentry arg is long!!!!!!"
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5062
    b := aJavaContext argAt: 7.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5063
    off := aJavaContext argAt: 8.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5064
    len := aJavaContext argAt: 9.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5065
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5066
    zar := ZipCache at: jzfile.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5067
    zmember := ZipEntryCache at: jzentry.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5068
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5069
    bytesToRead := len min: (zmember compressedSize - pos).
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5070
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5071
    ^zar nextBytes: bytesToRead of: zmember startingAt: pos into: b startingAt: off + 1.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5072
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5073
    "Created: / 30-04-2011 / 22:15:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
  5074
    "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
  5075
! !
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5076
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5077
!JavaVM class methodsFor:'native - old-style'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5078
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5079
_AccessController_beginPrivileged:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5080
    "/ introduced with jdk1.2
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5081
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5082
    "Created: / 27.1.1998 / 18:18:11 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5083
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5084
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5085
_AccessController_endPrivileged:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5086
    "/ introduced with jdk1.2
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5087
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5088
    "Created: / 27.1.1998 / 18:18:32 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5089
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5090
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5091
_AudioDevice_audioClose:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5092
    |device fd stream|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5093
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5094
    device := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5095
    device notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5096
	fd := device instVarNamed:'dev'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5097
	(fd notNil and:[fd > 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5098
	    stream := self getOpenFileAt:fd.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5099
	    stream notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5100
		stream close.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5101
		device instVarNamed:'dev' put:0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5102
	    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5103
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5104
    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5105
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5106
    "Created: / 10.1.1998 / 15:45:16 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5107
    "Modified: / 13.1.1998 / 18:08:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5108
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5109
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5110
_AudioDevice_audioOpen:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5111
    |f stream fileNo|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5112
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5113
    NoAudio ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5114
	Transcript showCR:'JAVA: audio disabled'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5115
	^ -1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5116
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5117
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5118
    Stream streamErrorSignal handle:[:ex |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5119
	Stream streamErrorSignal handle:[:ex |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5120
	    stream := nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5121
	    ex return.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5122
	] do:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5123
	    stream := SoundStream writing.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5124
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5125
    ] do:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5126
	stream := SoundStream writing.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5127
	stream notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5128
	    stream setSampleRate:8000.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5129
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5130
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5131
    stream isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5132
"/        ^ -1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5133
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5134
	f := '/dev/audio' asFilename.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5135
	f exists ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5136
	    Transcript showCR:'JAVA: neither SoundStream nor /dev/audio available'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5137
	    ^ -1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5138
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5139
	stream := f readWriteStream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5140
	stream isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5141
	    Transcript showCR:'JAVA: /dev/audio exists, but cannot be opened'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5142
	    ^ -1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5143
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5144
	fileNo := self addOpenFile:stream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5145
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5146
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5147
    fileNo := self addOpenFile:stream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5148
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5149
    FileOpenTrace ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5150
	('JAVA: opened audioDevice as FD ' , fileNo printString) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5151
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5152
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5153
    ^ fileNo
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5154
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5155
    "Created: / 10.1.1998 / 15:45:30 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5156
    "Modified: / 14.10.1998 / 15:20:52 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5157
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5158
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5159
_AudioDevice_audioWrite:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5160
    |device fd stream bytes count|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5161
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5162
    device := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5163
    device notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5164
	fd := device instVarNamed:'dev'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5165
	(fd notNil and:[fd > 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5166
	    stream := self getOpenFileAt:fd.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5167
	    stream notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5168
		bytes := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5169
		count := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5170
		stream nextPutBytes:count from:bytes startingAt:1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5171
	    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5172
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5173
    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5174
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5175
    "Created: / 10.1.1998 / 15:45:16 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5176
    "Modified: / 13.1.1998 / 18:07:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5177
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5178
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5179
_BigInteger_plumbInit:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5180
    UnimplementedNativeMethodSignal raiseRequest
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5181
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5182
    "Modified: / 12.11.1998 / 19:23:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5183
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5184
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5185
_CMM_cmmGetTagSize:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5186
    "/ public static native synchronized int cmmGetTagSize (long arg1, int arg2, int[] arg3)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5187
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5188
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5189
    UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5190
    ^ -1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5191
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5192
    "Created: / 27.1.1998 / 21:43:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5193
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5194
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5195
_CMM_cmmInit:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5196
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5197
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5198
    "Created: / 27.1.1998 / 21:43:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5199
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5200
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5201
_CMM_cmmLoadProfile:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5202
    "/ public static native synchronized int cmmLoadProfile (byte[] arg1, long[] arg2)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5203
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5204
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5205
    UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5206
    ^ -1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5207
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5208
    "Created: / 27.1.1998 / 21:43:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5209
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5210
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5211
_CRC32_update1:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5212
    "/ void update1 (int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5213
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5214
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5215
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5216
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5217
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5218
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5219
_CRC32_update:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5220
    "/ void update (byte[] int int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5221
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5222
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5223
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5224
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5225
    "Created: / 27.1.2000 / 03:09:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5226
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5227
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5228
_ClassLoader_createArrayClass:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5229
    "java.lang.Class createArrayClass (java.lang.String java.lang.Class)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5230
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5231
    "resolve a new class as previously created by defineClass0"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5232
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5233
    |jClassLoader name elCls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5234
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5235
    jClassLoader := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5236
    name := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5237
    elCls := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5238
    elCls isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5239
        self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5240
        ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5241
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5242
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5243
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5244
    "Modified: / 27.1.2000 / 02:36:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5245
    "Created: / 27.1.2000 / 02:56:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5246
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5247
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5248
_ClassLoader_defineClass0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5249
    "create a new class from a given byteArray.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5250
     Here, construct a stream on it and pass the work to the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5251
     JavaClassReader."
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5252
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5253
    |jClassLoader jName name data offset length inStream newClass
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5254
     loaderStub jClass|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5255
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5256
    jClassLoader := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5257
    jName := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5258
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5259
    "/ className is now optional ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5260
"/    jName isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5261
"/        self internalError:'nil name in defineClass'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5262
"/        ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5263
"/    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5264
"/        name := Java as_ST_String:jName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5265
"/    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5266
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5267
    data := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5268
    offset := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5269
    length := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5270
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5271
    inStream := data readStream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5272
    inStream position:offset + 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5273
    inStream readLimit:(offset + length).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5274
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5275
"/    loaderStub := Plug new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5276
"/    loaderStub respondTo:#loadClass: with:[:clsName |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5277
"/                                                |jName|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5278
"/
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5279
"/self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5280
"/                                                jName := Java as_String:clsName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5281
"/                                                "/ jClassLoader loadClass:jName
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5282
"/                                                jClassLoader 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5283
"/                                                    perform:#'loadClass(Ljava/lang/String;)Ljava/lang/Class;'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5284
"/                                                    with:jName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5285
"/                                          ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5286
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5287
"/    ('JAVA [info]: defining class ...') infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5288
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5289
"/    self internalError:'break'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5290
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5291
    newClass := JavaClassReader 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5292
                    readStream:inStream 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5293
                    loader:jClassLoader "loaderStub"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5294
                    loadUnresolved:false.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5295
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5296
    newClass isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5297
        ('JAVA [info]: defineClass failed') infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5298
        ^ nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5299
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5300
"/    Transcript showCR:('defined class ' , newClass fullName , '.').
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5301
    newClass classLoader:jClassLoader.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5302
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5303
"/    ('Java [info]: defined new class: ' , newClass fullName) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5304
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5305
    jClass := self javaClassObjectForClass:newClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5306
    ^ jClass
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5307
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5308
    "Created: / 7.1.1998 / 12:35:10 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5309
    "Modified: / 24.1.1998 / 15:26:21 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5310
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5311
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5312
_ClassLoader_findSystemClass0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5313
    |loader name class jClass|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5314
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5315
    loader := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5316
    name := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5317
    name := Java as_ST_String:name.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5318
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5319
    class := Java at:name.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5320
    class isNil ifTrue:[ 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5321
"/    ('JAVA: findSystemClass0 for ' , name , ' loader is ' , loader displayString) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5322
	loader class == (Java classForName:'java.util.SystemClassLoader') ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5323
"/            Java classForName:name.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5324
"/            class := Java at:name.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5325
	    class := JavaClassReader loadSystemClass:name.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5326
	] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5327
	    "/ load using default (ST/X) loader
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5328
	    class := JavaClassReader loadSystemClass:name.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5329
"/            JavaClassReader classLoaderQuerySignal answer:nil do:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5330
"/                Java classForName:name.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5331
"/            ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5332
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5333
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5334
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5335
"/    JavaClassReader classLoaderQuerySignal answer:nil "loader"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5336
"/    do:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5337
"/        class := Java classForName:name.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5338
"/        JavaClassReader postLoadActions:true.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5339
"/    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5340
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5341
    (class isNil 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5342
    "or:[class classLoader notNil]") ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5343
"/        self halt:'class: ' , name , ' not found.'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5344
"/        self internalError:'class: ' , name , ' not found.'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5345
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5346
	self 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5347
	    throwExceptionClassName:'java.lang.ClassNotFoundException'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5348
	    withMessage:('class: ' , name , ' not found.').
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5349
	^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5350
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5351
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5352
"/    'JAVA: findSystemClass0 - loaded: ' infoPrint. class fullName infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5353
    jClass := self javaClassObjectForClass:class.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5354
    ^ jClass
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5355
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5356
    "Created: / 5.1.1998 / 02:53:04 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5357
    "Modified: / 20.10.1998 / 17:28:34 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5358
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5359
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5360
_ClassLoader_findSystemClass:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5361
    ^ self _ClassLoader_findSystemClass0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5362
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5363
    "Created: / 18.11.1998 / 00:00:14 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5364
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5365
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5366
_ClassLoader_getSystemResource:nativeContext asStream0:returnAsStream
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5367
    "common code for
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5368
        getSystemResourceAsStream0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5369
        getSystemResourceAsName0"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5370
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5371
    |jString rString dir file text inStream url|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5372
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5373
    jString := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5374
    rString := Java as_ST_String:jString.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5375
    Java effectiveClassPath keysAndValuesDo:[:classPathIndex :aPath |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5376
        |f zipFile zar data |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5377
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5378
        f := aPath asFilename.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5379
        ((zipFile := f withSuffix:'jar') exists 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5380
        or:[(zipFile := f withSuffix:'zip') exists]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5381
            zar := ZipArchive oldFileNamed:zipFile.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5382
            (Array 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5383
                with:rString
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5384
                with:rString asLowercase
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5385
                with:rString asUppercase) 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5386
            do:[:tryName |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5387
                |entry|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5388
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5389
                entry := zar findMember:tryName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5390
                entry notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5391
                    returnAsStream ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5392
                        data := zar extract:tryName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5393
                        inStream := (Java classForName:'java.io.ByteArrayInputStream') newCleared.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5394
                        inStream perform:#'<init>([B)V' with:data.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5395
                        ^ inStream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5396
                    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5397
                    url := 'systemResource:/ZIP' , (classPathIndex-1) printString , '/+/' , tryName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5398
                    ^ Java as_String:url.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5399
                ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5400
            ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5401
        ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5402
            f exists ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5403
                (file := f construct:rString) exists ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5404
                    (Java isExcludedFromClassPath:file) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5405
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5406
                        "/ Copy data from returned buffer into Java byte array. 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5407
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5408
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5409
                        returnAsStream ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5410
                            text := file contents asString.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5411
                            data := text asByteArray.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5412
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5413
                            "/ Create input stream using byte array 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5414
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5415
                            inStream := (Java classForName:'java.io.ByteArrayInputStream') newCleared.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5416
                            inStream perform:#'<init>([B)V' with:data.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5417
                            ^ inStream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5418
                        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5419
                        url := 'systemResource:/FILE/' , file pathName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5420
self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5421
                        ^ Java as_String:url
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5422
                    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5423
                ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5424
            ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5425
        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5426
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5427
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5428
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5429
    "Created: / 08-01-1998 / 16:06:56 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5430
    "Modified: / 26-12-1998 / 17:14:52 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5431
    "Modified: / 22-11-2010 / 13:44:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5432
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5433
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5434
_ClassLoader_getSystemResourceAsName0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5435
    "/ java.lang.String getSystemResourceAsName0 (java.lang.String)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5436
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5437
    ^ self
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5438
	_ClassLoader_getSystemResource:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5439
	asStream0:false.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5440
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5441
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5442
_ClassLoader_getSystemResourceAsStream0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5443
    "/ java.lang.InputStream getSystemResourceAsStream0 (java.lang.String)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5444
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5445
    ^ self
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5446
	_ClassLoader_getSystemResource:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5447
	asStream0:true.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5448
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5449
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5450
_ClassLoader_init:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5451
     ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5452
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5453
    "Created: / 5.1.1998 / 02:04:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5454
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5455
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5456
_ClassLoader_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5457
    "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5458
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5459
    "Created: / 27.1.1998 / 18:37:08 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5460
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5461
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5462
_ClassLoader_resolveClass0:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5463
    "resolve a new class as previously created by defineClass0"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5464
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5465
    |jClassLoader jCls cls loaderStub anyUnresolved|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5466
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5467
    jClassLoader := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5468
    jCls := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5469
    jCls isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5470
        self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5471
        ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5472
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5473
    cls := self reflection javaClassObjectForClass:jCls.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5474
    cls isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5475
        self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5476
        ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5477
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5478
    ('JavaVM [info]: resolving class ' , cls fullName , ' ...') infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5479
    JavaClassReader classLoaderQuerySignal answer:jClassLoader
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5480
        do:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5481
            JavaClassReader resolveClass:cls.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5482
            
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5483
"/        JavaClassReader postLoadActions:true.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5484
            
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5485
            anyUnresolved := false.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5486
            cls constantPool do:[:entry | 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5487
                (entry isMemberOf:JavaUnresolvedClassConstant) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5488
                    self halt:'debugHalt'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5489
                    entry preResolve.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5490
                    self halt:'debugHalt'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5491
                    anyUnresolved := true.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5492
                ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5493
            ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5494
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5495
    anyUnresolved ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5496
        jClassLoader notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5497
            "/ any unresolved left -> try resolving with standard loader
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5498
            JavaClassReader classLoaderQuerySignal answer:nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5499
                do:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5500
                    JavaClassReader postLoadActions:true.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5501
                    cls constantPool do:[:entry | 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5502
                        (entry isMemberOf:JavaUnresolvedClassConstant) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5503
                            self halt:'debugHalt'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5504
                            entry preResolve.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5505
                            self halt:'debugHalt'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5506
                        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5507
                    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5508
                ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5509
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5510
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5511
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5512
    "Created: / 07-01-1998 / 13:12:27 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5513
    "Modified: / 20-10-1998 / 19:01:57 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5514
    "Modified: / 28-01-2011 / 15:28:18 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5515
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5516
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5517
_ClassLoader_resolveClass:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5518
    "void resolveClass (java.lang.Class)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5519
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5520
    "resolve a new class as previously created by defineClass0"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5521
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5522
    |jClassLoader jCls cls loaderStub anyUnresolved|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5523
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5524
    jClassLoader := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5525
    jCls := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5526
    jCls isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5527
        self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5528
        ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5529
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5530
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5531
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5532
    "Modified: / 27.1.2000 / 02:36:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5533
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5534
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5535
_Class_forName:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5536
    "get a java.lang.Class by name"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5537
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5538
    |jClassName className cls jClass s m c loader|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5539
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5540
    jClassName := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5541
    className := Java as_ST_String:jClassName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5542
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5543
    (s := nativeContext sender) notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5544
	(s isJavaContext) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5545
	    c := s method javaClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5546
	    loader := c classLoader.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5547
	    loader isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5548
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5549
	    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5550
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5551
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5552
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5553
    JavaClassReader classLoaderQuerySignal answer:loader
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5554
    do:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5555
	cls := Java classForName:className.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5556
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5557
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5558
"/(className startsWith:'sun.awt') ifTrue:[self halt].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5559
"/('classForName: ' , className , ' -> ') print.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5560
"/cls notNil ifTrue:[cls fullName printCR] ifFalse:['nil' printCR].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5561
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5562
    cls isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5563
	ExceptionTrace ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5564
	    ('throwing exception: no such class:' , className) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5565
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5566
	ExceptionDebug ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5567
	    self halt:'no such class:' , className.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5568
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5569
	self throwClassNotFoundException:className.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5570
	"/ not proceedable
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5571
	AbortSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5572
	"/ not reached
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5573
	^ self
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5574
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5575
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5576
    ^ self javaClassObjectForClass:cls.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5577
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5578
    "Modified: / 30.12.1998 / 20:12:53 / cg"
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
_Class_getClassLoader:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5582
    "get a classes loader"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5583
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5584
    |jClass cls loader|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5585
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5586
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5587
    cls := self reflection classForJavaClassObject:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5588
    loader := cls classLoader.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5589
    cls isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5590
        loader := JavaClassReader classLoaderQuerySignal query.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5591
        
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5592
"/    ('JAVA: getClassLoader - ' , loader printString) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5593
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5594
    ^ loader
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5595
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5596
    "Created: / 05-01-1998 / 02:51:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5597
    "Modified: / 04-01-1999 / 17:50:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5598
    "Modified: / 28-01-2011 / 15:18:57 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5599
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5600
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5601
_Class_getConstructor0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5602
    UnimplementedNativeMethodSignal raiseRequest
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5603
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5604
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5605
    "Created: / 12.11.1998 / 18:55:42 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5606
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5607
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5608
_Class_getConstructors0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5609
    UnimplementedNativeMethodSignal raiseRequest
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5610
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5611
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5612
    "Created: / 12.11.1998 / 18:55:26 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5613
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5614
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5615
_Class_getField0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5616
    UnimplementedNativeMethodSignal raiseRequest
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5617
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5618
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5619
    "Created: / 12.11.1998 / 18:55:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5620
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5621
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5622
_Class_getFields0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5623
    UnimplementedNativeMethodSignal raiseRequest
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5624
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5625
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5626
    "Created: / 12.11.1998 / 18:55:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5627
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5628
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5629
_Class_getMethod0:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5630
    "get a method, given a name and type spec"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5631
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5632
    |jClass cls jmName mName mTypes whichAccess argSig sel|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5633
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5634
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5635
    cls := self reflection javaClassObjectForClass:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5636
    jmName := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5637
    mName := Java as_ST_String:jmName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5638
    mTypes := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5639
    whichAccess := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5640
    argSig := JavaMethod argSignatureFromArgTypeArray:mTypes.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5641
    cls methodDictionary 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5642
        keysAndValuesDo:[:sel :mthd | 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5643
            |i1 i2 jMethod retTypeClass argTypes|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5644
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5645
            JavaMethods notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5646
                (jMethod := JavaMethods at:mthd ifAbsent:nil) notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5647
                    ^ jMethod
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5648
                ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5649
            ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5650
            mthd name printCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5651
            mName printCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5652
            mthd name = mName ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5653
                i1 := mthd signature indexOf:$(.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5654
                i2 := mthd signature indexOf:$) startingAt:(i1 + 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5655
                (mthd signature copyFrom:i1 + 1 to:i2 - 1) = argSig ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5656
                    "/ found it - create a java.lang.reflect.Method for it.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5657
                    jMethod := (Java at:'java.lang.reflect.Method') new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5658
                    jMethod instVarNamed:'clazz' put:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5659
                    jMethod instVarNamed:'slot' put:sel.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5660
                    jMethod instVarNamed:'name' put:jmName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5661
                    retTypeClass := mthd returnTypeClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5662
                    retTypeClass isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5663
                        retTypeClass := #void
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5664
                    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5665
                    argTypes := mthd argSignature.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5666
                    argTypes := argTypes 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5667
                                collect:[:s | 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5668
                                    |c|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5669
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5670
                                    c := Java at:s.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5671
                                    self javaClassObjectForClass:(c ? s asSymbol)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5672
                                ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5673
                    jMethod instVarNamed:'returnType'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5674
                        put:(self javaClassObjectForClass:retTypeClass).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5675
                    jMethod instVarNamed:'parameterTypes' put:argTypes.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5676
                    JavaMethods isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5677
                        JavaMethods := IdentityDictionary new
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5678
                    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5679
                    JavaMethods at:jMethod put:mthd.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5680
                    JavaMethods at:mthd put:jMethod.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5681
                    ^ jMethod.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5682
                ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5683
            ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5684
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5685
    self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5686
    self throwExceptionClassName:'java.lang.NoSuchMethodException'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5687
        withMessage:'not yet implemented'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5688
    ^ nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5689
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5690
    "Modified: / 22-10-1998 / 01:54:38 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5691
    "Modified: / 28-01-2011 / 14:36:26 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5692
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5693
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5694
_Class_getMethods0:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5695
    "get a method, given a name and type spec"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5696
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5697
    |jClass cls jmName mTypes whichAccess argSig sel methods|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5698
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5699
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5700
    cls := self reflection javaClassObjectForClass:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5701
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5702
    "/ 0 = PUBLIC (i.e. includes inherited) / 1 = DECLARED here
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5703
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5704
    whichAccess := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5705
    methods := OrderedCollection new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5706
    [cls isJavaClass] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5707
        cls methodDictionary 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5708
            keysAndValuesDo:[:sel :mthd | 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5709
                |i1 i2 jMethod argTypes retTypeClass|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5710
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5711
                mthd name printCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5712
                i1 := mthd signature indexOf:$(.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5713
                i2 := mthd signature indexOf:$) startingAt:(i1 + 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5714
                
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5715
                "/ create a java.lang.reflect.Method for it.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5716
                
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5717
                jMethod := (Java at:'java.lang.reflect.Method') new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5718
                jMethod instVarNamed:'clazz' put:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5719
                jMethod instVarNamed:'slot' put:sel.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5720
                jMethod instVarNamed:'name' put:(Java as_String:mthd name).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5721
                retTypeClass := mthd returnTypeClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5722
                retTypeClass isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5723
                    retTypeClass := #void
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5724
                ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5725
                argTypes := mthd argSignature.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5726
                argTypes := argTypes 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5727
                            collect:[:s | 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5728
                                |c|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5729
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5730
                                c := Java at:s.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5731
                                self javaClassObjectForClass:(c ? s asSymbol)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5732
                            ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5733
                jMethod instVarNamed:'returnType'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5734
                    put:(self javaClassObjectForClass:retTypeClass).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5735
                jMethod instVarNamed:'parameterTypes' put:argTypes.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5736
                
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5737
"/ (mthd name includesString:'setName') ifTrue:[self halt].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5738
                
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5739
                JavaMethods isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5740
                    JavaMethods := IdentityDictionary new
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5741
                ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5742
                JavaMethods at:jMethod put:mthd.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5743
                JavaMethods at:mthd put:jMethod.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5744
                methods add:jMethod.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5745
            ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5746
        whichAccess == 1 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5747
            "/ local methods only
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5748
            cls := nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5749
        ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5750
            cls := cls superclass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5751
        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5752
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5753
    methods := methods asArray.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5754
    ^ methods.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5755
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5756
    "Modified: / 22-10-1998 / 01:53:58 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5757
    "Modified: / 28-01-2011 / 14:36:58 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5758
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5759
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5760
_Class_getName:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5761
    "get a classes name"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5762
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5763
    |jClass cls nm|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5764
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5765
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5766
    cls := self reflection javaClassObjectForClass:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5767
    cls isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5768
        self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5769
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5770
    cls isJavaClass ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5771
        nm := (cls fullName copyReplaceAll:$/ with:$.)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5772
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5773
        cls isSymbol ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5774
            nm := cls
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5775
        ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5776
            nm := cls name
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5777
        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5778
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5779
    ^ Java as_String:nm.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5780
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5781
    "Modified: / 30-12-1998 / 21:13:50 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5782
    "Modified: / 28-01-2011 / 15:30:34 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5783
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5784
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5785
_Class_getSigners:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5786
    UnimplementedNativeMethodSignal raiseRequest
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5787
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5788
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5789
    "Created: / 12.11.1998 / 18:55:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5790
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5791
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5792
_Class_isInstance:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5793
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5794
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5795
     * Determines if the specified {@code Object} is assignment-compatible
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5796
     * with the object represented by this {@code Class}.  This method is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5797
     * the dynamic equivalent of the Java language {@code instanceof}
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5798
     * operator. The method returns {@code true} if the specified
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5799
     * {@code Object} argument is non-null and can be cast to the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5800
     * reference type represented by this {@code Class} object without
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5801
     * raising a {@code ClassCastException.} It returns {@code false}
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5802
     * otherwise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5803
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5804
     * <p> Specifically, if this {@code Class} object represents a
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5805
     * declared class, this method returns {@code true} if the specified
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5806
     * {@code Object} argument is an instance of the represented class (or
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5807
     * of any of its subclasses); it returns {@code false} otherwise. If
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5808
     * this {@code Class} object represents an array class, this method
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5809
     * returns {@code true} if the specified {@code Object} argument
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5810
     * can be converted to an object of the array class by an identity
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5811
     * conversion or by a widening reference conversion; it returns
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5812
     * {@code false} otherwise. If this {@code Class} object
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5813
     * represents an interface, this method returns {@code true} if the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5814
     * class or any superclass of the specified {@code Object} argument
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5815
     * implements this interface; it returns {@code false} otherwise. If
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5816
     * this {@code Class} object represents a primitive type, this method
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5817
     * returns {@code false}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5818
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5819
     * @param   obj the object to check
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5820
     * @return  true if {@code obj} is an instance of this class
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5821
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5822
     * @since JDK1.1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5823
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5824
    public native boolean isInstance(Object obj);
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5825
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5826
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5827
    |jClass cls obj|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5828
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5829
    obj := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5830
    obj isNil ifTrue:[^ 0].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5831
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5832
    cls := self reflection classForJavaClassObject:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5833
    ^self _INSTANCEOF:obj _:cls
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5834
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5835
    "Modified: / 09-02-1998 / 14:56:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5836
    "Modified: / 28-01-2011 / 14:12:42 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5837
    "Modified: / 25-02-2011 / 18:37:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5838
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5839
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5840
_Class_newInstance:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5841
    "get an instance for a java.lang.Class"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5842
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5843
    |jClass cls newInst|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5844
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5845
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5846
    cls := self reflection javaClassObjectForClass:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5847
    cls classInit.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5848
    newInst := cls newCleared.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5849
    newInst perform:#'<init>()V'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5850
    ^ newInst
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5851
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5852
    "Created: / 02-01-1998 / 22:41:38 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5853
    "Modified: / 15-01-1998 / 00:57:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5854
    "Modified: / 28-01-2011 / 14:12:25 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5855
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5856
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5857
_Class_setSigners:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5858
    UnimplementedNativeMethodSignal raiseRequest
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5859
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5860
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5861
    "Created: / 12.11.1998 / 18:55:08 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5862
!
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  5863
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  5864
_ColorModel_deletepData:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  5865
    "/ void deletepData ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  5866
    UnimplementedNativeMethodSignal raiseRequest
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  5867
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  5868
    "Created: / 12.11.1998 / 19:22:05 / cg"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5869
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5870
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5871
_ColorModel_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5872
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5873
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5874
    "Created: / 28.1.1998 / 22:19:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5875
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5876
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5877
_Color_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5878
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5879
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5880
    "Created: / 28.1.1998 / 22:19:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5881
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5882
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5883
_Component_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5884
    "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5885
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5886
    "Created: / 27.1.1998 / 19:53:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5887
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5888
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5889
_ConstantPool_getDoubleAt0:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5890
    | cpool  index  double |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5891
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5892
    cpool := self reflection constantPoolFor:(nativeContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5893
    self breakPoint:#mh.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5894
    index := nativeContext at:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5895
     "TODO: why 3?"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5896
    double := cpool at:index.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5897
    self assert:double isFloat description:'Not a float constant!!'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5898
    ^ double
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5899
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5900
    "Modified: / 25-02-2011 / 18:40:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5901
    "Created: / 28-02-2011 / 17:24:17 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5902
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5903
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5904
_ConstantPool_getIntAt0:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5905
    | cpool  index  int |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5906
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5907
    cpool := self reflection constantPoolFor:(nativeContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5908
    index := nativeContext at:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5909
     "TODO: why 3?"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5910
    int := cpool at:index.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5911
    self assert:int isInteger description:'Not an integer constant!!'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5912
    ^ int
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5913
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5914
    "Modified: / 25-02-2011 / 18:40:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5915
    "Created: / 28-02-2011 / 17:28:10 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5916
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5917
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5918
_ConstantPool_getLongAt0:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5919
    | cpool  index  long |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5920
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5921
    cpool := self reflection constantPoolFor:(nativeContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5922
    index := nativeContext at:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5923
     "TODO: why 3?"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5924
    long := cpool at:index.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5925
    self assert:long isInteger description:'Not a float constant!!'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5926
    ^ long
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5927
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5928
    "Modified: / 28-02-2011 / 17:40:02 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5929
    "Modified: / 28-02-2011 / 18:54:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5930
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5931
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5932
_ConstantPool_getUTF8At0: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5933
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5934
    | cpool index string |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5935
    cpool := self reflection constantPoolFor: (nativeContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5936
    index := nativeContext at: 3. 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5937
    "TODO: why 3?"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5938
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5939
    string := cpool at: index.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5940
    self assert: string isString description: 'Not an UTF8 constant!!'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5941
    ^Java as_String: string
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5942
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5943
    "Created: / 06-02-2011 / 12:56:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5944
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5945
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5946
_Constructor_getModifiers:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5947
    "/ int getModifiers ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5948
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5949
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5950
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5951
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5952
    "Created: / 27.1.2000 / 02:54:38 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5953
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5954
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5955
_Constructor_newInstance:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5956
    "/ java.lang.Object newInstance (java.lang.Object[])
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5957
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5958
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5959
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5960
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5961
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5962
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5963
_Double_doubleToLongBits:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5964
    |f i|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5965
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5966
    f := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5967
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5968
    UninterpretedBytes isBigEndian ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5969
	i := f basicAt:8. 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5970
	i := i bitOr:((f basicAt:7) bitShift:8).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5971
	i := i bitOr:((f basicAt:6) bitShift:16).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5972
	i := i bitOr:((f basicAt:5) bitShift:24).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5973
	i := i bitOr:((f basicAt:4) bitShift:32).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5974
	i := i bitOr:((f basicAt:3) bitShift:40).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5975
	i := i bitOr:((f basicAt:2) bitShift:48).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5976
	i := i bitOr:((f basicAt:1) bitShift:56).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5977
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5978
	i := f basicAt:1. 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5979
	i := i bitOr:((f basicAt:2) bitShift:8).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5980
	i := i bitOr:((f basicAt:3) bitShift:16).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5981
	i := i bitOr:((f basicAt:4) bitShift:24).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5982
	i := i bitOr:((f basicAt:5) bitShift:32).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5983
	i := i bitOr:((f basicAt:6) bitShift:40).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5984
	i := i bitOr:((f basicAt:7) bitShift:48).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5985
	i := i bitOr:((f basicAt:8) bitShift:56).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5986
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5987
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5988
    ^ i.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5989
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5990
    "Created: / 4.1.1998 / 01:39:12 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5991
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5992
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5993
_Double_longBitsToDouble:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5994
    |i aFloat|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5995
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5996
    i := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5997
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5998
    aFloat := Float new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  5999
    UninterpretedBytes isBigEndian ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6000
	aFloat basicAt:1 put:((i bitShift:-56) bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6001
	aFloat basicAt:2 put:((i bitShift:-48) bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6002
	aFloat basicAt:3 put:((i bitShift:-40) bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6003
	aFloat basicAt:4 put:((i bitShift:-32) bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6004
	aFloat basicAt:5 put:((i bitShift:-24) bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6005
	aFloat basicAt:6 put:((i bitShift:-16) bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6006
	aFloat basicAt:7 put:((i bitShift:-8) bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6007
	aFloat basicAt:8 put:(i bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6008
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6009
	aFloat basicAt:1 put:(i bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6010
	aFloat basicAt:2 put:((i bitShift:-8) bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6011
	aFloat basicAt:3 put:((i bitShift:-16) bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6012
	aFloat basicAt:4 put:((i bitShift:-24) bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6013
	aFloat basicAt:5 put:((i bitShift:-32) bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6014
	aFloat basicAt:6 put:((i bitShift:-40) bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6015
	aFloat basicAt:7 put:((i bitShift:-48) bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6016
	aFloat basicAt:8 put:((i bitShift:-56) bitAnd:16rFF).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6017
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6018
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6019
    ^ aFloat.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6020
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6021
    "Created: / 4.1.1998 / 01:45:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6022
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6023
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6024
_Double_valueOf0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6025
    |s d|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6026
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6027
    s := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6028
    s notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6029
	s := Java as_ST_String:s.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6030
	d := Float readFrom:s onError:nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6031
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6032
    d isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6033
	self throwNumberFormatException.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6034
	"/ not reached
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6035
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6036
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6037
    ^ d
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6038
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6039
    "Modified: / 8.8.1997 / 12:03:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6040
    "Created: / 7.1.1998 / 11:09:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6041
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6042
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6043
_Field_get:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6044
    "/ java.lang.Object get (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6045
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6046
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6047
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6048
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6049
    "Created: / 27.1.2000 / 03:04:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6050
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6051
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6052
_Field_getBoolean:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6053
    "/ boolean getBoolean (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6054
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6055
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6056
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6057
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6058
    "Created: / 27.1.2000 / 03:05:16 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6059
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6060
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6061
_Field_getByte:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6062
    "/ byte getByte (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6063
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6064
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6065
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6066
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6067
    "Created: / 27.1.2000 / 03:05:30 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6068
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6069
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6070
_Field_getChar:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6071
    "/ char getChar (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6072
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6073
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6074
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6075
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6076
    "Created: / 27.1.2000 / 03:03:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6077
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6078
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6079
_Field_getDouble:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6080
    "/ double getDouble (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6081
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6082
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6083
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6084
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6085
    "Created: / 27.1.2000 / 03:07:49 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6086
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6087
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6088
_Field_getFloat:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6089
    "/ float getFloat (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6090
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6091
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6092
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6093
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6094
    "Created: / 27.1.2000 / 03:05:41 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6095
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6096
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6097
_Field_getInt:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6098
    "/ int getInt (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6099
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6100
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6101
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6102
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6103
    "Created: / 27.1.2000 / 03:04:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6104
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6105
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6106
_Field_getLong:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6107
    "/ long getLong (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6108
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6109
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6110
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6111
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6112
    "Created: / 27.1.2000 / 03:05:54 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6113
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6114
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6115
_Field_getModifiers:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6116
    "/ int getModifiers ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6117
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6118
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6119
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6120
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6121
    "Created: / 27.1.2000 / 03:07:03 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6122
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6123
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6124
_Field_getShort:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6125
    "/ unsigned short getShort (java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6126
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6127
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6128
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6129
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6130
    "Created: / 27.1.2000 / 03:07:35 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6131
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6132
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6133
_Field_set:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6134
    "/ void set (java.lang.Object java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6135
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6136
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6137
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6138
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6139
    "Created: / 27.1.2000 / 03:04:33 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6140
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6141
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6142
_Field_setBoolean:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6143
    "/ void setBoolean (java.lang.Object boolean)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6144
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6145
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6146
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6147
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6148
    "Created: / 27.1.2000 / 03:06:06 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6149
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6150
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6151
_Field_setByte:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6152
    "/ void setByte (java.lang.Object byte)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6153
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6154
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6155
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6156
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6157
    "Created: / 27.1.2000 / 03:06:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6158
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6159
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6160
_Field_setChar:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6161
    "/ void setChar (java.lang.Object char)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6162
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6163
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6164
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6165
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6166
    "Created: / 27.1.2000 / 03:03:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6167
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6168
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6169
_Field_setDouble:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6170
    "/ void setDouble (java.lang.Object double)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6171
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6172
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6173
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6174
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6175
    "Created: / 27.1.2000 / 03:04:02 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6176
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6177
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6178
_Field_setFloat:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6179
    "/ void setFloat (java.lang.Object float)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6180
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6181
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6182
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6183
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6184
    "Created: / 27.1.2000 / 03:06:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6185
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6186
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6187
_Field_setInt:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6188
    "/ void setInt (java.lang.Object int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6189
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6190
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6191
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6192
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6193
    "Created: / 27.1.2000 / 03:05:04 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6194
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6195
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6196
_Field_setLong:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6197
    "/ void setLong (java.lang.Object long)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6198
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6199
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6200
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6201
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6202
    "Created: / 27.1.2000 / 03:06:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6203
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6204
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6205
_Field_setShort:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6206
    "/ void setShort (java.lang.Object unsigned short)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6207
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6208
UnimplementedNativeMethodSignal raiseRequest.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6209
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6210
    "Modified: / 27.1.2000 / 02:53:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6211
    "Created: / 27.1.2000 / 03:03:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6212
!
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6213
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6214
_FileDescriptor_initSystemFD:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6215
    |descriptor fileNo idx myStream|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6216
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6217
    descriptor := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6218
    fileNo := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6219
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6220
    fileNo == 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6221
	myStream := Stdin
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6222
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6223
	fileNo == 1 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6224
	   myStream := JavaConsoleStream ? Stdout
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6225
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6226
	    fileNo == 2 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6227
		myStream := JavaConsoleStream ? Stderr
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6228
	    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6229
		self halt:'invalid fileNo given'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6230
		self internalError:'invalid fileNo given'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6231
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6232
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6233
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6234
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6235
    self setOpenFile:myStream at:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6236
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6237
    descriptor instVarNamed:'fd' put:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6238
    ^ descriptor
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6239
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6240
    "Modified: / 27.1.1998 / 18:15:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6241
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6242
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6243
_FileDescriptor_sync:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6244
    "/ void sync ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6245
    UnimplementedNativeMethodSignal raiseRequest
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6246
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6247
    "Modified: / 12.11.1998 / 18:57:39 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6248
    "Created: / 12.11.1998 / 19:26:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6249
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6250
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6251
_FileDescriptor_valid:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6252
    "/ boolean valid ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6253
    |descriptor fileNo stream|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6254
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6255
    descriptor := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6256
    fileNo := descriptor instVarNamed:'fd'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6257
    stream := self getOpenFileAt:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6258
    stream isNil ifTrue:[^ 0]. "/ FALSE 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6259
    stream isOpen ifFalse:[^ 0].  "/ FALSE 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6260
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6261
    ^ 1 "/ TRUE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6262
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6263
    "Modified: / 11.12.1998 / 13:02:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6264
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6265
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6266
_FileInputStream_available:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6267
    |file|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6268
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6269
    file := self validateFile:(nativeContext receiver).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6270
    file isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6271
	self throwIOExceptionWithMessage:'invalid fileNo in available'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6272
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6273
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6274
    file == Stdin ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6275
	file := StdinReplacementFileQuerySignal raiseRequest.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6276
	file isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6277
	    ^ 1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6278
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6279
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6280
    file isFileStream ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6281
	^ file size - file position + 1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6282
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6283
    file atEnd ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6284
	^ 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6285
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6286
    self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6287
    ^ 1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6288
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6289
    "Modified: / 14.1.1998 / 15:12:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6290
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6291
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6292
_FileInputStream_close:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6293
    ^ self anyStream_close:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6294
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6295
    "Created: / 4.1.1998 / 17:45:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6296
    "Modified: / 4.2.1998 / 15:20:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6297
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6298
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6299
_FileInputStream_open:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6300
    |fs fd fn name stream fileNo|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6301
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6302
    fs := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6303
    fd := fs instVarNamed:'fd'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6304
    (fileNo := fd instVarNamed:'fd') ~~ 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6305
	fileNo ~~ -1 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6306
	    self halt:'file already open'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6307
	    self internalError:'file already open'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6308
	    ^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6309
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6310
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6311
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6312
    name := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6313
    name := Java as_ST_String:name.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6314
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6315
    name := self fixFilename:name.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6316
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6317
    FileOpenTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6318
	('JAVA: opening ' , name) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6319
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6320
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6321
    stream := self fileStreamForReading:name.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6322
    stream isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6323
	FileOpenTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6324
	    ('JAVA: failed to open ''' , name , ''' for reading.') infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6325
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6326
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6327
	self throwIOExceptionWithMessage:('cannot open ' , name , ' for reading').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6328
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6329
	^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6330
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6331
    stream buffered:false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6332
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6333
"/    FileOpenConfirmation ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6334
"/        (self confirm:('JAVA Security check\\Opening ''' , name , ''' for reading.\Grant permission ?') withCRs)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6335
"/        ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6336
"/            self throwIOExceptionWithMessage:('no permission to open ' , name , ' for reading').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6337
"/            ^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6338
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6339
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6340
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6341
    fileNo := self addOpenFile:stream.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6342
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6343
    FileOpenTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6344
	('JAVA: opened ' , name , ' as FD ' , fileNo printString) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6345
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6346
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6347
    fd instVarNamed:'fd' put:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6348
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6349
    "Created: / 4.1.1998 / 16:47:12 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6350
    "Modified: / 28.1.1999 / 17:24:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6351
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6352
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6353
_FileInputStream_read:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6354
    |file byte|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6355
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6356
    file := self validateFile:(nativeContext receiver).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6357
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6358
    file == Stdin ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6359
	file := StdinReplacementFileQuerySignal raiseRequest.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6360
	file isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6361
	    ^ -1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6362
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6363
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6364
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6365
    FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6366
	('JAVA: read 1 byte from ' , file pathName) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6367
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6368
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6369
    byte := file nextByte.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6370
    byte isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6371
	^ -1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6372
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6373
    ^ byte
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6374
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6375
    "Created: / 5.1.1998 / 02:17:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6376
    "Modified: / 5.1.1998 / 02:17:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6377
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6378
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6379
_FileInputStream_readBytes:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6380
    ^ self anyStream_readBytes:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6381
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6382
    "Modified: / 4.2.1998 / 15:23:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6383
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6384
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6385
_FileInputStream_skip:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6386
    "/ long skip (long)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6387
    |file nSkip nSkipped|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6388
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6389
    file := self validateFile:(nativeContext receiver).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6390
    nSkip := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6391
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6392
    file == Stdin ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6393
	file := StdinReplacementFileQuerySignal raiseRequest.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6394
	file isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6395
	    ^ -1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6396
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6397
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6398
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6399
    FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6400
	(('JAVA: skip %1 byte(s) from ' bindWith:nSkip printString) , file pathName) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6401
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6402
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6403
    file skip:nSkip.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6404
    ^ nSkip
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6405
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6406
    "Modified: / 27.1.1999 / 20:36:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6407
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6408
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6409
_FileOutputStream_close:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6410
    ^ self anyStream_close:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6411
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6412
    "Created: / 13.1.1998 / 09:33:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6413
    "Modified: / 4.2.1998 / 15:20:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6414
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6415
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6416
_FileOutputStream_open:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6417
    ^ self commonOpen:nativeContext forAppend:false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6418
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6419
    "Modified: / 7.4.1998 / 19:14:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6420
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6421
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6422
_FileOutputStream_openAppend:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6423
    ^ self commonOpen:nativeContext forAppend:true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6424
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6425
    "Modified: / 7.4.1998 / 19:13:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6426
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6427
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6428
_File_canRead0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6429
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6430
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6431
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6432
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6433
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6434
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6435
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6436
	FileAccessTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6437
	    path storeString print. ' ' print. thisContext printCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6438
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6439
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6440
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6441
	(f := path asFilename) isReadable ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6442
	    ^ 1 "/ TRUE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6443
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6444
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6445
    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6446
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6447
    "Created: / 4.1.1998 / 18:09:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6448
    "Modified: / 27.1.1999 / 18:57:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6449
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6450
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6451
_File_canWrite0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6452
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6453
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6454
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6455
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6456
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6457
	FileAccessTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6458
	    path storeString print. ' ' print. thisContext printCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6459
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6460
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6461
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6462
	(f := path asFilename) isWritable ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6463
	    ^ 1 "/ TRUE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6464
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6465
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6466
    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6467
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6468
    "Created: / 4.2.1998 / 00:19:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6469
    "Modified: / 27.1.1999 / 18:57:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6470
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6471
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6472
_File_canonPath:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6473
    "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6474
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6475
    |jPath path realPath|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6476
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6477
    jPath := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6478
    jPath isNil ifTrue:[^ jPath].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6479
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6480
    path := Java as_ST_String:jPath.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6481
    realPath := path asFilename pathName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6482
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6483
    ^ Java as_String:realPath
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6484
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6485
    "Created: / 27.1.1998 / 18:35:58 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6486
    "Modified: / 27.1.1998 / 21:36:03 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6487
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6488
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6489
_File_delete0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6490
    "/ boolean delete0 ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6491
    |oldFile oldPath oldF|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6492
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6493
    oldFile := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6494
    oldPath := oldFile instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6495
    oldPath isNil ifTrue:[^ 0].    "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6496
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6497
    oldPath := Java as_ST_String:oldPath.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6498
    oldF := oldPath asFilename.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6499
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6500
    oldF exists ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6501
	^ 1 "/ TRUE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6502
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6503
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6504
    (self checkWritePermissionOfDirectory:oldF directory message:('JAVA Security check\\Delete of ''' , oldPath , '''.\Grant permission ?'))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6505
    ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6506
	^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6507
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6508
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6509
    OperatingSystem accessDeniedErrorSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6510
	^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6511
    ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6512
	oldF delete.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6513
	^ 1 "/ TRUE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6514
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6515
    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6516
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6517
    "Modified: / 30.12.1998 / 20:15:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6518
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6519
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6520
_File_exists0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6521
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6522
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6523
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6524
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6525
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6526
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6527
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6528
	FileAccessTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6529
	    path storeString print. ' ' print. thisContext printCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6530
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6531
	(f := path asFilename) exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6532
	    ^ 1 "TRUE"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6533
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6534
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6535
    ^ 0 "FALSE"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6536
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6537
    "Created: / 5.1.1998 / 02:07:48 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6538
    "Modified: / 27.1.1999 / 18:57:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6539
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6540
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6541
_File_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6542
    "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6543
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6544
    "Created: / 27.1.1998 / 18:25:19 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6545
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6546
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6547
_File_isAbsolute:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6548
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6549
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6550
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6551
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6552
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6553
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6554
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6555
	(f := path asFilename) isAbsolute ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6556
	    ^ 1 "/ TRUE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6557
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6558
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6559
    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6560
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6561
    "Created: / 11.1.1998 / 09:54:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6562
    "Modified: / 20.10.1998 / 20:59:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6563
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6564
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6565
_File_isDirectory0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6566
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6567
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6568
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6569
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6570
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6571
	FileAccessTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6572
	    path storeString print. ' ' print. thisContext printCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6573
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6574
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6575
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6576
	(f := path asFilename) exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6577
	    f isDirectory ifTrue:[^ 1 "TRUE"]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6578
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6579
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6580
    ^ 0 "FALSE"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6581
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6582
    "Created: / 7.1.1998 / 10:31:37 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6583
    "Modified: / 27.1.1999 / 18:58:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6584
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6585
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6586
_File_isFile0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6587
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6588
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6589
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6590
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6591
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6592
	FileAccessTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6593
	    path storeString print. ' ' print. thisContext printCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6594
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6595
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6596
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6597
	(f := path asFilename) exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6598
	    f isDirectory ifFalse:[^ 1 "TRUE"]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6599
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6600
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6601
    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6602
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6603
    "Created: / 11.1.1998 / 11:40:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6604
    "Modified: / 27.1.1999 / 18:58:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6605
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6606
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6607
_File_lastModified0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6608
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6609
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6610
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6611
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6612
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6613
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6614
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6615
	(f := path asFilename) exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6616
	    ^ f modificationTime getMilliseconds.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6617
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6618
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6619
    ^ 0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6620
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6621
    "Created: / 4.2.1998 / 16:50:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6622
    "Modified: / 20.10.1998 / 21:00:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6623
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6624
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6625
_File_length0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6626
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6627
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6628
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6629
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6630
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6631
	FileAccessTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6632
	    thisContext printCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6633
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6634
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6635
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6636
	(f := path asFilename) exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6637
	    ^ f fileSize
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6638
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6639
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6640
    ^ -1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6641
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6642
    "Created: / 7.1.1998 / 12:18:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6643
    "Modified: / 27.1.1999 / 18:57:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6644
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6645
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6646
_File_list0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6647
    |file path f files|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6648
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6649
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6650
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6651
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6652
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6653
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6654
	(f := path asFilename) exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6655
	    f isDirectory ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6656
		files := f directoryContents asArray.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6657
		files := files collect:[:nm | Java as_String:nm].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6658
		^ files
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6659
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6660
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6661
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6662
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6663
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6664
    "Created: / 14.1.1998 / 21:30:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6665
    "Modified: / 20.10.1998 / 21:00:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6666
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6667
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6668
_File_mkdir0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6669
    |file path f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6670
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6671
    file := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6672
    path := file instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6673
    path notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6674
	path := Java as_ST_String:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6675
	path := self fixFilename:path.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6676
	f := path asFilename.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6677
	(f exists and:[f isDirectory]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6678
	    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6679
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6680
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6681
	FileOpenConfirmation ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6682
	    (self confirm:('JAVA Security check\\Create directory ''' , path , '''.\Grant permission ?') withCRs)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6683
	    ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6684
		^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6685
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6686
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6687
	OperatingSystem accessDeniedErrorSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6688
	    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6689
	] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6690
	    f makeDirectory.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6691
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6692
	f  exists ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6693
	    f isDirectory ifTrue:[^ 1 "TRUE"]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6694
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6695
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6696
    ^ 0 "FALSE"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6697
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6698
    "Created: / 4.2.1998 / 00:19:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6699
    "Modified: / 4.12.1998 / 14:04:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6700
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6701
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6702
_File_renameTo0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6703
    "/ void renameTo0 (java.io.File)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6704
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6705
    |oldFile newFile oldPath newPath oldF newF|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6706
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6707
    oldFile := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6708
    oldPath := oldFile instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6709
    oldPath isNil ifTrue:[^ 0].    "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6710
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6711
    oldPath := Java as_ST_String:oldPath.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6712
    oldF := oldPath asFilename.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6713
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6714
    newFile := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6715
    newPath := newFile instVarNamed:'path'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6716
    newPath isNil ifTrue:[^ 0].    "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6717
    newPath := Java as_ST_String:newPath.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6718
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6719
    newF := newPath asFilename.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6720
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6721
    (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
  6722
    ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6723
	^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6724
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6725
    oldF directory pathName ~= newF directory pathName ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6726
	(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
  6727
	ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6728
	    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6729
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6730
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6731
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6732
    OperatingSystem accessDeniedErrorSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6733
	^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6734
    ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6735
	oldF renameTo:newF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6736
	^ 1 "/ TRUE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6737
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6738
    ^ 0 "/ FALSE
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6739
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6740
    "Modified: / 3.12.1998 / 21:01:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6741
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6742
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6743
_File_rmdir0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6744
    "/ boolean rmdir0 ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6745
    UnimplementedNativeMethodSignal raiseRequest
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6746
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6747
    "Modified: / 12.11.1998 / 19:01:48 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6748
    "Created: / 12.11.1998 / 19:03:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6749
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6750
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6751
_Float_floatToIntBits:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6752
    |f i|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6753
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6754
    f := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6755
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6756
    UninterpretedBytes isBigEndian ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6757
	i := f basicAt:4. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6758
	i := i bitOr:((f basicAt:3) bitShift:8).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6759
	i := i bitOr:((f basicAt:2) bitShift:16).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6760
	i := i bitOr:((f basicAt:1) bitShift:24).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6761
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6762
	i := f basicAt:1. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6763
	i := i bitOr:((f basicAt:2) bitShift:8).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6764
	i := i bitOr:((f basicAt:3) bitShift:16).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6765
	i := i bitOr:((f basicAt:4) bitShift:24).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6766
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6767
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6768
    ^ i.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6769
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6770
    "Created: / 4.1.1998 / 01:25:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6771
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6772
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6773
_Float_intBitsToFloat:nativeContet
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6774
    |i aFloat|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6775
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6776
    i := nativeContet argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6777
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6778
    aFloat := ShortFloat basicNew.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6779
    UninterpretedBytes isBigEndian ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6780
	aFloat basicAt:1 put:((i bitShift:-24) bitAnd:16rFF).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6781
	aFloat basicAt:2 put:((i bitShift:-16) bitAnd:16rFF).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6782
	aFloat basicAt:3 put:((i bitShift:-8) bitAnd:16rFF).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6783
	aFloat basicAt:4 put:(i bitAnd:16rFF).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6784
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6785
	aFloat basicAt:1 put:(i bitAnd:16rFF).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6786
	aFloat basicAt:2 put:((i bitShift:-8) bitAnd:16rFF).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6787
	aFloat basicAt:3 put:((i bitShift:-16) bitAnd:16rFF).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6788
	aFloat basicAt:4 put:((i bitShift:-24) bitAnd:16rFF).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6789
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6790
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6791
    ^ aFloat.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6792
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6793
    "Created: / 13.1.1998 / 23:03:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6794
    "Modified: / 13.1.1998 / 23:05:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6795
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  6796
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6797
_FontDescriptor_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6798
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6799
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6800
    "Created: / 28.1.1998 / 22:30:52 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6801
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6802
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6803
_Font_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6804
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6805
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6806
    "Created: / 27.1.1998 / 21:43:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6807
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6808
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6809
_GifImageDecoder_parseImage:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6810
    |decoder width height bool1 depth subHdrBytes dstBytes i1 i2 colorModel
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6811
     stream byte compressedData compressedSize index count data 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6812
     leftOffs topOffs codeLen flags pixelStore clrModel t buffSize 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6813
     countGot countGot2|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6814
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6815
    decoder := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6816
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6817
    i1 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6818
    i2 := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6819
    width := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6820
    height := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6821
    bool1 := nativeContext argAt:5.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6822
    depth := nativeContext argAt:6.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6823
    subHdrBytes := nativeContext argAt:7.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6824
    dstBytes := nativeContext argAt:8.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6825
    colorModel := nativeContext argAt:9.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6826
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6827
    leftOffs := subHdrBytes wordAt:1 MSB:false.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6828
    topOffs := subHdrBytes wordAt:3 MSB:false.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6829
    width := subHdrBytes wordAt:5 MSB:false.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6830
    height := subHdrBytes wordAt:7 MSB:false.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6831
    flags := subHdrBytes at:9.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6832
    codeLen := subHdrBytes at:10.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6833
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6834
    stream := decoder instVarNamed:'input'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6835
    pixelStore := decoder instVarNamed:'store'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6836
    pixelStore isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6837
	^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6838
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6839
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6840
    buffSize := (width * height // 2) max:4096.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6841
    compressedData := ByteArray uninitializedNew:buffSize.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6842
    "get compressed data"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6843
    index := 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6844
    count := stream perform:#'read()I'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6845
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6846
    [count notNil and:[count > 0]] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6847
	(index + count) > buffSize ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6848
	    t := ByteArray uninitializedNew:(buffSize * 2).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6849
	    t replaceFrom:1 to:buffSize with:compressedData startingAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6850
	    compressedData := t.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6851
	    buffSize := buffSize * 2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6852
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6853
	[count ~~ 0] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6854
	    countGot := stream 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6855
			perform:#'read([BII)I' 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6856
			with:compressedData
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6857
			with:index-1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6858
			with:count.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6859
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6860
	    countGot > 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6861
		count := count - countGot.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6862
		index := index + countGot.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6863
	    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6864
		count := -1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6865
	    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6866
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6867
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6868
	count >= 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6869
	    count := stream perform:#read.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6870
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6871
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6872
    compressedSize := index - 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6873
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6874
    data := pixelStore perform:#'allocateLines(I)Ljava/lang/Object;' with:height.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6875
    (data isMemberOf:ByteArray) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6876
	self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6877
	^ 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6878
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6879
"/    'GIFReader: decompressing ...' infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6880
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6881
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6882
    GIFReader 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6883
	decompressGIFFrom:compressedData
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6884
	count:compressedSize
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6885
	into:data
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6886
	startingAt:1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6887
	codeLen:(codeLen + 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6888
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6889
    clrModel := pixelStore instVarNamed:'colormodel'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6890
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6891
    pixelStore 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6892
	perform:#'setPixels(IIII[BII)Z'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6893
	withArguments:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6894
	    (Array 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6895
		with:0        "/ x
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6896
		with:0        "/ y
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6897
		with:width    "/ w
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6898
		with:height   "/ h
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6899
		with:data
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6900
		with:0        "/ offs
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6901
		with:width).   "/ scanSize
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6902
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6903
    pixelStore  perform:#'imageComplete()V'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6904
"/        perform:#'imageComplete(I)V' 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6905
"/        with:((Java at:'java.awt.image.ImageConsumer') instVarNamed:'STATICIMAGEDONE').
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6906
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6907
"/ self internalError:'breakPoint'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6908
    ^ 1 "/ true
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6909
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6910
    "Modified: / 10.4.1998 / 14:31:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6911
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6912
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6913
_ImageRepresentation_disposeImage:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6914
    |imgRep img|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6915
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6916
    imgRep := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6917
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6918
    img := imgRep instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6919
    (img notNil and:[img ~~ 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6920
	ImageStretchCache notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6921
	    ImageStretchCache removeKey:img ifAbsent:nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6922
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6923
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6924
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6925
    imgRep instVarNamed:'pData' put:0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6926
"/    self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6927
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6928
    "Created: / 7.1.1998 / 22:31:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6929
    "Modified: / 17.1.1998 / 13:26:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6930
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6931
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6932
_ImageRepresentation_finish:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6933
    |imgRep bool|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6934
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6935
    imgRep := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6936
    bool := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6937
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6938
"/    'JAVA: ImageRepresentation_finish ignored for now' infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6939
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6940
    ^ 1 "/ true
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6941
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6942
    "Created: / 8.1.1998 / 00:11:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6943
    "Modified: / 6.2.1998 / 02:12:54 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6944
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6945
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6946
_ImageRepresentation_imageDraw:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6947
    |imgRep x y img deviceImage jGraphics gc clr|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6948
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6949
    imgRep := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6950
    img := imgRep instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6951
    (img isNil or:[img == 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6952
	"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6953
	^ self.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6954
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6955
    jGraphics := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6956
    gc := jGraphics instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6957
    gc realized ifFalse:[^ self].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6958
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6959
    x := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6960
    y := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6961
    clr := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6962
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6963
    deviceImage := img onDevice:gc device.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6964
    deviceImage ~~ img ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6965
	imgRep instVarNamed:'pData' put:deviceImage.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6966
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6967
    gc realized ifFalse:[^ self].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6968
    deviceImage displayOn:gc x:x y:y.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6969
    ^ 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6970
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6971
    "Created: / 13.1.1998 / 13:32:28 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6972
    "Modified: / 25.11.1998 / 15:36:38 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6973
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6974
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6975
_ImageRepresentation_imageStretch:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6976
    |imgRep x1 y1 x2 y2 srcX1 srcY1 w h 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6977
     img deviceImage jGraphics gc clr stretchWidth stretchHeight|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6978
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6979
    imgRep := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6980
    img := imgRep instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6981
    (img isNil or:[img == 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6982
	"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6983
	^ self.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6984
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6985
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6986
    jGraphics := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6987
    gc := jGraphics instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6988
    gc realized ifFalse:[^ self].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6989
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6990
    x1 := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6991
    y1 := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6992
    x2 := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6993
    y2:= nativeContext argAt:5.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6994
    srcX1 := nativeContext argAt:6.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6995
    srcY1 := nativeContext argAt:7.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6996
    w := nativeContext argAt:8.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6997
    h := nativeContext argAt:9.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6998
    clr := nativeContext argAt:10.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  6999
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7000
    (srcX1 ~~ 0 or:[srcY1 ~~ 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7001
	self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7002
	^ self.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7003
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7004
    (w ~~ img width or:[h ~~ img height]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7005
	self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7006
	^ self
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7007
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7008
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7009
    "/ TODO: remember magnified images somewhere for a while,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7010
    "/ to avoid repeated action ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7011
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7012
    stretchWidth := (x2-x1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7013
    stretchHeight := (y2-y1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7014
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7015
    (stretchWidth == img width
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7016
    and:[stretchHeight == img height]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7017
	deviceImage := img onDevice:gc device.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7018
	deviceImage ~~ img ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7019
	    imgRep instVarNamed:'pData' put:deviceImage.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7020
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7021
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7022
	ImageStretchCache notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7023
	    deviceImage := ImageStretchCache at:img ifAbsent:nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7024
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7025
	(deviceImage isNil 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7026
	or:[deviceImage width ~~ stretchWidth
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7027
	or:[deviceImage height ~~ stretchHeight]]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7028
	    deviceImage := (img magnifiedTo:stretchWidth@stretchHeight) onDevice:gc device.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7029
	    ImageStretchCache isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7030
		ImageStretchCache := WeakIdentityDictionary new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7031
	    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7032
	    ImageStretchCache at:img put:deviceImage
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7033
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7034
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7035
    deviceImage displayOn:gc x:x1 y:y1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7036
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7037
    "Created: / 13.1.1998 / 13:32:28 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7038
    "Modified: / 15.1.1998 / 13:14:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7039
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7040
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7041
_ImageRepresentation_offscreenInit:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7042
    |imgRep jclr w h form screenDevice|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7043
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7044
    imgRep := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7045
    jclr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7046
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7047
    w := imgRep instVarNamed:'width'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7048
    h := imgRep instVarNamed:'height'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7049
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7050
    screenDevice := Screen current.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7051
    form := Form width:w height:h depth:(screenDevice depth) on:screenDevice.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7052
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7053
    imgRep instVarNamed:'pData' put:form.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7054
    "/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7055
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7056
    "Created: / 7.1.1998 / 22:31:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7057
    "Modified: / 17.1.1998 / 12:36:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7058
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7059
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7060
_ImageRepresentation_setBytePixels:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7061
    |imgRep x y w h clrModel bytes offs i2
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7062
     img depth cmap rgbMap opaque transparentColorIndex
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7063
     scanLineWidth nBytes srcIdx dstIdx|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7064
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7065
    imgRep := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7066
    x := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7067
    y := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7068
    w := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7069
    h := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7070
    clrModel := nativeContext argAt:5.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7071
    bytes := nativeContext argAt:6.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7072
    offs := nativeContext argAt:7.  "/ offset ??
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7073
    scanLineWidth := nativeContext argAt:8.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7074
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7075
    depth := clrModel instVarNamed:'pixel_bits'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7076
    (clrModel instVarNamed:'map_size') ~~ 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7077
	rgbMap := clrModel instVarNamed:'rgb'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7078
	cmap := Array new:rgbMap size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7079
	rgbMap 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7080
	    keysAndValuesDo:[:idx :rgb |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7081
		cmap at:idx put:(Color rgbValue:(rgb bitAnd:16rFFFFFF))
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7082
	    ].        
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7083
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7084
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7085
    opaque := (clrModel instVarNamed:'opaque') ~~ 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7086
    opaque ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7087
	transparentColorIndex := clrModel instVarNamed:'transparent_index'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7088
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7089
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7090
    img := imgRep instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7091
    (img isNil or:[img == 0]) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7092
"/        self halt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7093
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7094
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7095
    (offs ~~ 0 or:[scanLineWidth ~~ w]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7096
	nBytes := ByteArray new:w*h.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7097
	srcIdx := offs+1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7098
	dstIdx := 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7099
	1 to:h do:[:y |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7100
	    nBytes replaceFrom:dstIdx to:(dstIdx+w-1) with:bytes startingAt:srcIdx.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7101
	    srcIdx := srcIdx + scanLineWidth.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7102
	    dstIdx := dstIdx + w.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7103
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7104
	bytes := nBytes.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7105
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7106
    img := Image width:w height:h depth:depth fromArray:bytes.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7107
    cmap notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7108
	img colorMap:cmap.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7109
	img photometric:#palette
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7110
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7111
    opaque ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7112
	img mask:(ImageReader 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7113
		    buildMaskFromColor:transparentColorIndex 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7114
		    for:bytes
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7115
		    width:w
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7116
		    height:h)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7117
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7118
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7119
    imgRep instVarNamed:'pData' put:img.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7120
    ^ 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7121
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7122
    "Created: / 7.1.1998 / 22:31:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7123
    "Modified: / 21.10.1998 / 00:35:45 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7124
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7125
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7126
_ImageRepresentation_setIntPixels:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7127
    |imgRep x y w h clrModel ints offs scanLineWidth
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7128
     img depth cmap rgbMap opaque transparentColorIndex
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7129
     bytes srcIdx dstIdx val red green blue
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7130
     redMask greenMask blueMask redShift greenShift blueShift|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7131
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7132
    imgRep := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7133
    x := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7134
    y := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7135
    w := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7136
    h := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7137
    clrModel := nativeContext argAt:5.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7138
    ints := nativeContext argAt:6.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7139
    offs := nativeContext argAt:7.  "/ offset ??
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7140
    scanLineWidth := nativeContext argAt:8.  "/ scanLineWidth ??
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7141
    opaque := false.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7142
offs ~~ 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7143
 self halt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7144
].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7145
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7146
    depth := clrModel instVarNamed:'pixel_bits'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7147
    clrModel class == (Java at:'java.awt.image.DirectColorModel') ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7148
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7149
	(clrModel instVarNamed:'map_size') ~~ 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7150
	    rgbMap := clrModel instVarNamed:'rgb'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7151
	    cmap := Array new:rgbMap size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7152
	    rgbMap 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7153
		keysAndValuesDo:[:idx :rgb |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7154
		    cmap at:idx put:(Color rgbValue:(rgb bitAnd:16rFFFFFF))
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7155
		].        
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7156
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7157
	opaque := (clrModel instVarNamed:'opaque') ~~ 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7158
	opaque ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7159
	    transparentColorIndex := clrModel instVarNamed:'transparent_index'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7160
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7161
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7162
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7163
    img := imgRep instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7164
    (img isNil or:[img == 0]) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7165
"/        self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7166
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7167
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7168
    depth == 32 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7169
	"/ temporary kludge - ony use 24 bits/pixel
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7170
	bytes := ByteArray new:w*h*3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7171
	srcIdx := 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7172
	dstIdx := 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7173
	redMask := clrModel instVarNamed:'red_mask'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7174
	greenMask := clrModel instVarNamed:'green_mask'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7175
	blueMask := clrModel instVarNamed:'blue_mask'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7176
	redShift := (clrModel instVarNamed:'red_offset') negated.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7177
	greenShift := (clrModel instVarNamed:'green_offset') negated.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7178
	blueShift := (clrModel instVarNamed:'blue_offset') negated.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7179
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7180
	1 to:h do:[:y |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7181
	    1 to:w do:[:x |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7182
		val := ints at:srcIdx.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7183
		red := (val bitAnd:redMask) bitShift:redShift.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7184
		green := (val bitAnd:greenMask) bitShift:greenShift.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7185
		blue := (val bitAnd:blueMask) bitShift:blueShift.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7186
		bytes at:dstIdx put:red.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7187
		bytes at:dstIdx+1 put:green.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7188
		bytes at:dstIdx+2 put:blue.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7189
		dstIdx := dstIdx + 3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7190
		srcIdx := srcIdx + 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7191
	    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7192
	    srcIdx := srcIdx + (scanLineWidth - w).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7193
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7194
	img := Depth24Image width:w height:h depth:24 fromArray:bytes.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7195
	img photometric:#rgb.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7196
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7197
	scanLineWidth ~~ w ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7198
	    self halt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7199
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7200
	img := Image width:w height:h depth:depth fromArray:ints.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7201
	cmap notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7202
	    img colorMap:cmap.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7203
	    img photometric:#palette
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7204
	] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7205
	    img photometric:#rgb
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7206
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7207
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7208
    opaque ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7209
	img mask:(ImageReader 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7210
		    buildMaskFromColor:transparentColorIndex 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7211
		    for:ints
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7212
		    width:w
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7213
		    height:h)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7214
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7215
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7216
    imgRep instVarNamed:'pData' put:img.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7217
    ^ 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7218
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7219
    "Created: / 1.2.1998 / 17:38:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7220
    "Modified: / 21.10.1998 / 00:35:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7221
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7222
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7223
_InetAddressImpl_getHostByAddr:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7224
    "/ java.lang.String getHostByAddr (int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7225
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7226
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7227
    "Created: / 12.11.1998 / 19:08:04 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7228
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7229
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7230
_InetAddressImpl_getInetFamily:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7231
    "/ self unimplementedNativeMethod.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7232
    ^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7233
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7234
    "Modified: / 15.8.1997 / 17:04:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7235
    "Created: / 5.1.1998 / 02:05:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7236
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7237
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7238
_InetAddressImpl_getLocalHostName:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7239
    ""
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7240
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7241
    |hostName|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7242
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7243
    hostName := OperatingSystem getHostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7244
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7245
    ^ (Java as_String:hostName).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7246
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7247
    "Modified: / 7.8.1997 / 21:16:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7248
    "Created: / 5.1.1998 / 02:07:03 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7249
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7250
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7251
_InetAddressImpl_lookupAllHostAddr:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7252
    ""
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7253
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7254
    |jAddrImpl jHostName hostName addrBytes|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7255
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7256
    jAddrImpl := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7257
    jHostName := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7258
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7259
    hostName := Java as_ST_String:jHostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7260
    addrBytes := Socket ipAddressOfHost:hostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7261
    addrBytes isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7262
	addrBytes := #[0 0 0 0] copy
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7263
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7264
    ^ Array with:addrBytes
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7265
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7266
    "Modified: / 8.8.1997 / 12:04:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7267
    "Created: / 7.1.1998 / 18:51:31 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7268
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7269
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7270
_InetAddressImpl_makeAnyLocalAddress:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7271
    ""
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7272
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7273
    |jAddrImpl jAddr hostName addrBytes address|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7274
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7275
    jAddrImpl := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7276
    jAddr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7277
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7278
    hostName := OperatingSystem getHostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7279
    addrBytes := Socket ipAddressOfHost:hostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7280
    addrBytes isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7281
	addrBytes := #[127 0 0 0].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7282
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7283
    "/ MSB first into an integer.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7284
    address := (addrBytes at:1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7285
    address := (address bitShift:8) bitOr:(addrBytes at:2).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7286
    address := (address bitShift:8) bitOr:(addrBytes at:3).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7287
    address := (address bitShift:8) bitOr:(addrBytes at:4).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7288
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7289
    jAddr instVarNamed:'hostName' put:(Java as_String:hostName).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7290
    jAddr instVarNamed:'address' put:address.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7291
    jAddr instVarNamed:'family' put:0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7292
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7293
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7294
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7295
    "Created: / 5.1.1998 / 02:06:27 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7296
    "Modified: / 21.10.1998 / 03:30:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7297
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7298
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7299
_InetAddress_getInetFamily:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7300
    "/ self unimplementedNativeMethod.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7301
    ^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7302
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7303
    "Modified: / 15.8.1997 / 17:04:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7304
    "Created: / 17.11.1998 / 23:54:38 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7305
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7306
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7307
_InetAddress_getLocalHostName:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7308
    ""
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7309
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7310
    |hostName|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7311
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7312
    hostName := OperatingSystem getHostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7313
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7314
    ^ Java as_String:hostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7315
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7316
    "Modified: / 7.8.1997 / 21:16:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7317
    "Created: / 17.11.1998 / 23:54:54 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7318
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7319
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7320
_InetAddress_init:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7321
    "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7322
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7323
    "Created: / 27.1.1998 / 18:16:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7324
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7325
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7326
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7327
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7328
_InetAddress_lookupAllHostAddr:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7329
    ""
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7330
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7331
    |jAddrImpl jHostName hostName addrBytes|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7332
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7333
    jAddrImpl := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7334
    jHostName := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7335
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7336
    hostName := Java as_ST_String:jHostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7337
    addrBytes := Socket ipAddressOfHost:hostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7338
    addrBytes isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7339
	addrBytes := #[0 0 0 0] copy
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7340
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7341
    ^ Array with:addrBytes
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7342
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7343
    "Modified: / 8.8.1997 / 12:04:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7344
    "Created: / 17.11.1998 / 23:56:10 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7345
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7346
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7347
_InetAddress_lookupHostByAddr:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7348
    "java.lang.Object[] lookupHostByAddr (int)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7349
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7350
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7351
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7352
    "Created: / 27.1.2000 / 02:59:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7353
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7354
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7355
_InetAddress_lookupHostByName:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7356
    "java.lang.Object[] lookupHostByName (java.lang.String)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7357
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7358
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7359
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7360
    "Modified: / 27.1.2000 / 02:58:53 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7361
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7362
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7363
_InetAddress_makeAnyLocalAddress:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7364
    ""
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7365
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7366
    |jAddrImpl jAddr hostName addrBytes address|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7367
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7368
    jAddrImpl := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7369
    jAddr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7370
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7371
    hostName := OperatingSystem getHostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7372
    addrBytes := Socket ipAddressOfHost:hostName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7373
    addrBytes isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7374
	addrBytes := #[127 0 0 0].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7375
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7376
    "/ MSB first into an integer.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7377
    address := (addrBytes at:1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7378
    address := (address bitShift:8) bitOr:(addrBytes at:2).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7379
    address := (address bitShift:8) bitOr:(addrBytes at:3).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7380
    address := (address bitShift:8) bitOr:(addrBytes at:4).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7381
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7382
    jAddr instVarNamed:'hostName' put:(Java as_String:hostName).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7383
    jAddr instVarNamed:'address' put:address.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7384
    jAddr instVarNamed:'family' put:0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7385
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7386
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7387
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7388
    "Modified: / 21.10.1998 / 03:30:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7389
    "Created: / 17.11.1998 / 23:54:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7390
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7391
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7392
_Inflater_end0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7393
    "/ void end0 ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7394
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7395
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7396
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7397
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7398
    "Created: / 27.1.2000 / 03:11:21 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7399
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7400
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7401
_Inflater_getAdler0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7402
    "/ int getAdler0 ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7403
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7404
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7405
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7406
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7407
    "Created: / 27.1.2000 / 03:12:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7408
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7409
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7410
_Inflater_getTotalIn0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7411
    "/ int getTotalIn0 ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7412
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7413
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7414
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7415
    "Created: / 27.1.2000 / 03:10:50 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7416
    "Modified: / 27.1.2000 / 03:11:08 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7417
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7418
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7419
_Inflater_getTotalOut0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7420
    "/ int getTotalOut0 ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7421
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7422
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7423
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7424
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7425
    "Created: / 27.1.2000 / 03:12:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7426
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7427
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7428
_Inflater_inflate0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7429
    "/ int inflate0 (byte[] int int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7430
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7431
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7432
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7433
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7434
    "Created: / 27.1.2000 / 03:11:39 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7435
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7436
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7437
_Inflater_reset0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7438
    "/ void reset0 ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7439
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7440
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7441
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7442
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7443
    "Created: / 27.1.2000 / 03:11:02 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7444
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7445
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7446
_Inflater_reset:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7447
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7448
    UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7449
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7450
    "Created: / 01-02-1998 / 20:14:13 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7451
    "Modified: / 30-04-2011 / 22:56:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7452
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7453
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7454
_Inflater_setDictionary0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7455
    "/ void setDictionary0 (byte[] int int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7456
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7457
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7458
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7459
    "Modified: / 27.1.2000 / 03:08:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7460
    "Created: / 27.1.2000 / 03:10:33 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7461
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7462
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7463
_InputThread_run:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7464
    self _WToolkit_eventLoop:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7465
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7466
    "Created: / 28.1.1998 / 22:34:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7467
    "Modified: / 28.1.1998 / 22:35:16 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7468
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7469
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7470
_Introspector_getMethodDescriptor:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7471
    "java.lang.String getMethodDescriptor (java.lang.reflect.Method)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7472
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7473
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7474
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7475
    "Created: / 27.1.2000 / 02:47:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7476
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7477
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7478
_Introspector_getMethodParameterCount:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7479
    "int getMethodParameterCount (java.lang.reflect.Method)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7480
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7481
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7482
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7483
    "Created: / 27.1.2000 / 02:49:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7484
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7485
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7486
_Introspector_getPublicDeclaredMethods0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7487
    "java.lang.reflect.Method[] getPublicDeclaredMethods0 (java.lang.Class)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7488
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7489
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7490
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7491
    "Created: / 27.1.2000 / 02:48:49 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7492
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7493
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7494
_JPEGImageDecoder_readImage:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7495
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7496
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7497
    "Created: / 12.11.1998 / 18:53:30 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7498
    "Modified: / 12.11.1998 / 18:53:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7499
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7500
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7501
_MButtonPeer_create:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7502
    ^ self _WButtonPeer_create:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7503
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7504
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7505
_MCanvasPeer_create:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7506
    |jCanvasPeer jFrame frame subView|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7507
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7508
    jCanvasPeer := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7509
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7510
    jFrame := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7511
    jFrame isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7512
	self halt:'no frame in canvasPeer create'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7513
	self internalError:'no frame in canvasPeer create'.     
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7514
	^ self.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7515
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7516
    frame := jFrame instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7517
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7518
    subView := JavaView in:frame.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7519
    subView delegate:self.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7520
    subView javaPeer:jCanvasPeer.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7521
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7522
    self createdWindowsView:subView for:jCanvasPeer.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7523
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7524
    WindowCreationTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7525
	'WCanvasPeer_create: ' print. frame print. ' -> ' print. subView printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7526
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7527
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7528
    "Modified: / 16.1.1998 / 13:40:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7529
    "Created: / 18.11.1998 / 00:14:44 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7530
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7531
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7532
_MComponentPeer_cacheInit:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7533
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7534
    "Created: / 28.1.1998 / 22:22:30 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7535
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7536
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7537
_MComponentPeer_handleEvent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7538
    ^ self _WComponentPeer_handleEvent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7539
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7540
    "Created: / 18.11.1998 / 00:21:17 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7541
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7542
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7543
_MComponentPeer_nativeHandleEvent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7544
    ^ self _WComponentPeer_nativeHandleEvent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7545
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7546
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7547
_MComponentPeer_pHide:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7548
    ^ self _WComponentPeer_hide:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7549
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7550
    "Created: / 18.11.1998 / 00:15:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7551
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7552
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7553
_MComponentPeer_pInitialize:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7554
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7555
    "Created: / 28.1.1998 / 22:27:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7556
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7557
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7558
_MComponentPeer_pReshape:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7559
    self commonReshapeComponent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7560
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7561
    "Created: / 18.11.1998 / 00:18:17 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7562
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7563
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7564
_MComponentPeer_pSetBackground:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7565
    |view jClr rgb clr|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7566
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7567
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7568
    jClr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7569
    rgb := jClr instVarNamed:'value'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7570
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7571
    clr := Color rgbValue:rgb.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7572
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7573
    clr := clr on:(view device).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7574
    (view isKindOf:ScrollableView) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7575
        view := view scrolledView
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7576
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7577
    view viewBackground:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7578
    view backgroundPaint:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7579
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7580
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7581
_MComponentPeer_pSetFont:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7582
    |view jFont stFont name style size|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7583
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7584
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7585
    jFont := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7586
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7587
    stFont := jFont instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7588
    (stFont isNil or:[stFont == 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7589
        name := jFont instVarNamed:'name'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7590
        style := jFont instVarNamed:'style'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7591
        size := jFont instVarNamed:'size'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7592
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7593
        stFont := self replacementFontFor:(Java as_ST_String:name) style:style size:size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7594
        jFont instVarNamed:'pData' put:stFont.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7595
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7596
    view font:stFont.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7597
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7598
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7599
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7600
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7601
_MComponentPeer_pSetForeground:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7602
    |view jClr rgb clr|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7603
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7604
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7605
    jClr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7606
    rgb := jClr instVarNamed:'value'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7607
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7608
    clr := Color rgbValue:rgb.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7609
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7610
    clr := clr on:(view device).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7611
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7612
    (view isKindOf:ScrollableView) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7613
        view := view scrolledView
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7614
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7615
    view foregroundColor:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7616
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7617
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7618
_MComponentPeer_pShow:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7619
    |view|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7620
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7621
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7622
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7623
    "/ frame views are under my browsers own control
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7624
    (view isMemberOf:JavaEmbeddedFrameView) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7625
	view beVisible.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7626
	view realize.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7627
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7628
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7629
"/    view windowGroup notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7630
"/        windowServer addGroup:(view windowGroup)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7631
"/    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7632
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7633
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7634
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7635
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7636
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7637
    "Modified: / 25.1.1998 / 09:54:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7638
    "Created: / 18.11.1998 / 00:21:51 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7639
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7640
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7641
_MComponentPeer_setBackground:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7642
    |jClr rgb clr view|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7643
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7644
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7645
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7646
    jClr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7647
    rgb := jClr instVarNamed:'value'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7648
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7649
    clr := Color rgbValue:rgb.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7650
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7651
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7652
    clr := clr on:(view device).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7653
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7654
    (view isKindOf:ScrollableView) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7655
	view := view scrolledView
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7656
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7657
    view viewBackground:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7658
    view backgroundPaint:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7659
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7660
    "Created: / 17.11.1998 / 23:49:41 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7661
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7662
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7663
_MComponentPeer_setCursor:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7664
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7665
    "Created: / 28.1.1998 / 22:27:35 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7666
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7667
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7668
_MComponentPeer_setFont:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7669
    |view|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7670
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7671
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7672
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7673
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7674
    "Modified: / 25.1.1998 / 01:22:19 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7675
    "Created: / 17.11.1998 / 23:43:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7676
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7677
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7678
_MComponentPeer_setForeground:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7679
    |jClr rgb clr view|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7680
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7681
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7682
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7683
    jClr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7684
    rgb := jClr instVarNamed:'value'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7685
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7686
    clr := Color rgbValue:rgb.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7687
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7688
    clr := clr on:(view device).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7689
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7690
    view paint:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7691
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7692
    "Created: / 17.11.1998 / 23:50:31 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7693
    "Modified: / 17.11.1998 / 23:57:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7694
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7695
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7696
_MFramePeer_create:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7697
    ^ self _WFramePeer_create:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7698
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7699
    "Created: / 28.1.1998 / 22:25:44 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7700
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7701
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7702
_MFramePeer_getWindowBackgroundColor:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7703
    ^ View defaultViewBackgroundColor rgbValue.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7704
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7705
    "Created: / 17.11.1998 / 23:55:42 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7706
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7707
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7708
_MFramePeer_pHide:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7709
    ^ self _WComponentPeer_hide:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7710
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7711
    "Created: / 28.1.1998 / 22:27:04 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7712
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7713
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7714
_MFramePeer_pReshape:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7715
    self commonReshapeComponent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7716
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7717
    "Created: / 28.1.1998 / 22:28:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7718
    "Modified: / 28.1.1998 / 22:29:34 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7719
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7720
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7721
_MFramePeer_pSetTitle:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7722
    self _WWindowPeer__setTitle:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7723
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7724
    "Created: / 28.1.1998 / 22:30:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7725
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7726
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7727
_MFramePeer_pShow:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7728
    |view|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7729
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7730
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7731
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7732
    "/ frame views are under my browsers own control
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7733
    (view isMemberOf:JavaEmbeddedFrameView) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7734
	view beVisible.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7735
	view realize.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7736
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7737
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7738
"/    view windowGroup notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7739
"/        windowServer addGroup:(view windowGroup)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7740
"/    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7741
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7742
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7743
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7744
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7745
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7746
    "Modified: / 25.1.1998 / 09:54:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7747
    "Created: / 18.11.1998 / 00:19:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7748
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7749
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7750
_MFramePeer_setInsets:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7751
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7752
    "Created: / 17.11.1998 / 23:55:32 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7753
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7754
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7755
_MFramePeer_setResizable:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7756
    |view onOff|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7757
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7758
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7759
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7760
    onOff := (nativeContext argAt:1) == 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7761
    view isTopView ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7762
	onOff ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7763
	    view minExtent:10@10.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7764
	    view maxExtent:(Screen current extent).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7765
	] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7766
	    view minExtent:view extent.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7767
	    view maxExtent:view extent.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7768
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7769
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7770
	(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7771
	    self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7772
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7773
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7774
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7775
"/ 'JAVA: WWindowPeer_setResizable: ' print. view print. ' yes/no: ' print. onOff printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7776
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7777
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7778
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7779
    "Modified: / 16.1.1998 / 18:08:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7780
    "Created: / 17.11.1998 / 23:51:45 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7781
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7782
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7783
_MToolkit_callbackLoop:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7784
    |toolKit|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7785
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7786
    toolKit := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7787
^ self.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7788
self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7789
    self wakeup:toolKit.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7790
self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7791
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7792
    (JavaEventThread notNil and:[JavaEventThread isDead not]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7793
	'JavaVM [warning]: oops - two threads executing eventLoop' errorPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7794
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7795
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7796
    JavaEventThread := Processor activeProcess.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7797
    [
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7798
	[true] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7799
	    AbortSignal handle:[:ex |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7800
		ex return
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7801
	    ] do:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7802
		self doWindowsEventThread.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7803
	    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7804
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7805
    ] valueNowOrOnUnwindDo:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7806
	JavaEventThread := nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7807
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7808
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7809
    "Created: / 17.11.1998 / 23:58:33 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7810
    "Modified: / 8.1.1999 / 17:08:35 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7811
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7812
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7813
_MToolkit_eventLoop:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7814
    |toolKit|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7815
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7816
    (JavaEventThread notNil and:[JavaEventThread isDead not]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7817
	'JavaVM [warning]: oops - two threads executing eventLoop' errorPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7818
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7819
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7820
    toolKit := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7821
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7822
    self wakeup:toolKit.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7823
self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7824
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7825
    JavaEventThread := Processor activeProcess.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7826
    [
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7827
	[true] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7828
	    AbortSignal handle:[:ex |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7829
		ex return
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7830
	    ] do:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7831
		self doWindowsEventThread.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7832
	    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7833
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7834
    ] valueNowOrOnUnwindDo:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7835
	JavaEventThread := nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7836
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7837
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7838
    "Created: / 17.11.1998 / 23:04:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7839
    "Modified: / 8.1.1999 / 17:08:21 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7840
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7841
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7842
_MToolkit_init:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7843
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7844
    "Created: / 28.1.1998 / 22:21:54 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7845
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7846
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7847
_MToolkit_loadSystemColors:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7848
    ^ self _WToolkit_loadSystemColors:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7849
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7850
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7851
_MToolkit_run:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7852
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7853
    "Created: / 28.1.1998 / 22:22:10 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7854
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  7855
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7856
_Math_IEEEremainder:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7857
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7858
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7859
    "Created: / 12.11.1998 / 18:52:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7860
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7861
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7862
_Math_acos:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7863
    "arc cosine"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7864
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7865
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7866
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7867
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7868
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7869
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7870
"/            'JAVAVM [info]: missing double flag in Math>>acos' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7871
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7872
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7873
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7874
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7875
    ^ dVal arcCos
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7876
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7877
    "Created: / 7.5.1998 / 00:34:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7878
    "Modified: / 11.11.1998 / 15:08:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7879
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7880
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7881
_Math_asin:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7882
    "arc sine"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7883
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7884
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7885
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7886
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7887
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7888
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7889
"/            'JAVAVM [info]: missing double flag in Math>>asin' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7890
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7891
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7892
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7893
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7894
    ^ dVal arcSin
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7895
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7896
    "Created: / 7.5.1998 / 00:34:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7897
    "Modified: / 11.11.1998 / 15:08:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7898
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7899
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7900
_Math_atan2:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7901
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7902
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7903
    "Created: / 12.11.1998 / 18:52:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7904
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7905
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7906
_Math_atan:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7907
    "arc tangens"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7908
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7909
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7910
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7911
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7912
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7913
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7914
"/            'JAVAVM [info]: missing double flag in Math>>atan' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7915
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7916
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7917
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7918
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7919
    ^ dVal arcTan
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7920
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7921
    "Created: / 6.2.1998 / 01:24:12 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7922
    "Modified: / 11.11.1998 / 15:08:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7923
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7924
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7925
_Math_ceil:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7926
    "ceiling"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7927
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7928
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7929
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7930
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7931
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7932
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7933
"/            'JAVAVM [info]: missing double flag in Math>>ceil' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7934
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7935
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7936
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7937
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7938
    ^ dVal ceilingAsFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7939
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7940
    "Created: / 7.1.1998 / 15:43:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7941
    "Modified: / 11.11.1998 / 15:08:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7942
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7943
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7944
_Math_cos:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7945
    "cosine"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7946
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7947
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7948
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7949
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7950
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7951
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7952
"/            'JAVAVM [info]: missing double flag in Math>>cos' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7953
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7954
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7955
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7956
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7957
    ^ dVal cos
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7958
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7959
    "Created: / 7.1.1998 / 15:41:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7960
    "Modified: / 11.11.1998 / 15:07:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7961
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7962
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7963
_Math_exp:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7964
    "exponential"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7965
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7966
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7967
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7968
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7969
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7970
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7971
"/            'JAVAVM [info]: missing double flag in Math>>exp' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7972
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7973
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7974
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7975
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7976
    ^ dVal exp
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7977
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7978
    "Created: / 7.5.1998 / 00:36:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7979
    "Modified: / 11.11.1998 / 15:07:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7980
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7981
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7982
_Math_floor:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7983
    "floor"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7984
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7985
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7986
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7987
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7988
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7989
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7990
"/            'JAVAVM [info]: missing double flag in Math>>floor' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7991
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7992
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7993
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7994
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7995
    ^ dVal floorAsFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7996
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7997
    "Created: / 7.1.1998 / 19:09:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7998
    "Modified: / 11.11.1998 / 15:07:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  7999
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8000
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8001
_Math_log:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8002
    "natural logarithm"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8003
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8004
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8005
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8006
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8007
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8008
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8009
"/            'JAVAVM [info]: missing double flag in Math>>log' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8010
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8011
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8012
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8013
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8014
    ^ dVal ln
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8015
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8016
    "Created: / 7.1.1998 / 15:42:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8017
    "Modified: / 30.12.1998 / 17:41:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8018
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8019
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8020
_Math_pow:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8021
    "power"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8022
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8023
    |dVal1 dVal2|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8024
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8025
    dVal1 := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8026
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8027
"/        dVal1 isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8028
"/            'JAVAVM [info]: missing double flag in Math>>pow' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8029
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8030
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8031
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8032
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8033
    dVal2 := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8034
"/    (nativeContext argAt:4) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8035
"/        dVal2 isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8036
"/            'JAVAVM [info]: missing double flag in Math>>pow' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8037
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8038
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8039
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8040
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8041
    ^ dVal1 raisedTo:dVal2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8042
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8043
    "Created: / 7.1.1998 / 15:44:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8044
    "Modified: / 11.11.1998 / 15:07:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8045
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8046
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8047
_Math_rint:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8048
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8049
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8050
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8051
    ^ dVal rounded asFloat.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8052
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8053
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8054
_Math_sin:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8055
    "sine"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8056
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8057
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8058
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8059
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8060
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8061
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8062
"/            'JAVAVM [info]: missing double flag in Math>>sin' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8063
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8064
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8065
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8066
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8067
    ^ dVal sin
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8068
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8069
    "Created: / 7.1.1998 / 15:41:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8070
    "Modified: / 11.11.1998 / 15:07:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8071
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8072
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8073
_Math_sqrt:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8074
    "square root"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8075
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8076
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8077
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8078
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8079
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8080
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8081
"/            'JAVAVM [info]: missing double flag in Math>>sqrt' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8082
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8083
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8084
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8085
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8086
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8087
    "/ how about domain errors ?
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8088
    dVal < 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8089
	^ 0.0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8090
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8091
    ^ dVal sqrt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8092
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8093
    "Created: / 7.1.1998 / 15:42:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8094
    "Modified: / 29.12.1998 / 13:22:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8095
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8096
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8097
_Math_tan:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8098
    "tangent"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8099
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8100
    |dVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8101
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8102
    dVal := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8103
"/    (nativeContext argAt:2) ~~ DUMMY_DOUBLE_HIGHWORD ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8104
"/        dVal isReal ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8105
"/            'JAVAVM [info]: missing double flag in Math>>tan' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8106
"/        ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8107
"/            self halt:'expected double arg'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8108
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8109
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8110
    ^ dVal tan
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8111
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8112
    "Created: / 7.5.1998 / 00:34:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8113
    "Modified: / 11.11.1998 / 15:07:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8114
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8115
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8116
_MemoryAdvice_register0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8117
    "private native void register0()"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8118
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8119
    "/ UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8120
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8121
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8122
_Method_getModifiers:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8123
    |jMethod mthd retVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8124
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8125
    jMethod := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8126
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8127
    mthd := JavaMethods at:jMethod ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8128
    mthd isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8129
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8130
	^ 0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8131
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8132
    ^ mthd accessFlags
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8133
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8134
    "Modified: / 9.4.1998 / 17:50:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8135
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8136
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8137
_Method_invoke:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8138
    "invoke a javaMethod"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8139
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8140
    |jMethod mthd rec args retVal|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8141
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8142
    jMethod := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8143
    rec := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8144
    args := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8145
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8146
    mthd := JavaMethods at:jMethod ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8147
    mthd isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8148
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8149
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8150
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8151
    "/ check for arguments to match the expected types ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8152
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8153
    mthd argSignature keysAndValuesDo:[:index :argSig |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8154
	|cls arg|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8155
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8156
	cls := Java at:argSig.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8157
	arg := args at:index.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8158
	(arg isKindOf:cls) ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8159
	    self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8160
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8161
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8162
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8163
    mthd isStatic ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8164
	retVal := mthd valueWithReceiver:(mthd javaClass) arguments:args selector:mthd selector.        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8165
	^ retVal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8166
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8167
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8168
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8169
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8170
    self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8171
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8172
    "Created: / 13.2.1998 / 15:15:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8173
    "Modified: / 13.2.1998 / 15:35:54 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8174
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8175
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8176
_MozillaAppletContext_pMochaOnLoad:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8177
    |id|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8178
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8179
    id := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8180
"/ 'JAVA: MozillaAppletContext_pMochaOnLoad: ' print. id printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8181
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8182
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8183
    "Created: / 6.1.1998 / 20:37:13 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8184
    "Modified: / 6.2.1998 / 02:13:09 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8185
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8186
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8187
_MozillaAppletContext_pShowDocument:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8188
    |jAppletContext s1 s2 s3 js|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8189
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8190
    jAppletContext := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8191
    js := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8192
    s1 := Java as_ST_String:js.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8193
    js := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8194
    s2 := Java as_ST_String:js.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8195
    js := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8196
    s2 := Java as_ST_String:js.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8197
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8198
    "/ somehow pass it to the html browser ....
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8199
Transcript show:'pShowDocument: '; show:s1; show:' / '; 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8200
	   show:s2; show:' / '; showCR:s3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8201
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8202
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8203
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8204
    "Created: / 29.3.1998 / 15:53:17 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8205
    "Modified: / 29.12.1998 / 13:32:41 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8206
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8207
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8208
_MozillaAppletContext_pShowStatus:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8209
    |s js|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8210
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8211
    js := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8212
    js isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8213
	s := ''
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8214
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8215
	s := Java as_ST_String:js.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8216
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8217
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8218
    self activityNotification:s.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8219
"/ Transcript showCR:s.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8220
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8221
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8222
    "Created: / 6.1.1998 / 18:31:34 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8223
    "Modified: / 22.10.1998 / 01:17:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8224
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8225
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8226
_MozillaAppletContext_setConsoleState0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8227
    "/ void setConsoleState0 (int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8228
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8229
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8230
    "Created: / 12.11.1998 / 19:23:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8231
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8232
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8233
_ObjectInputStream_allocateNewArray:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8234
    "/ java.lang.Object allocateNewArray (java.lang.Class int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8235
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8236
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8237
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8238
    "Created: / 12.11.1998 / 19:02:52 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8239
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8240
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8241
_ObjectInputStream_allocateNewObject:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8242
    "/ java.lang.Object allocateNewObject (java.lang.Class java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8243
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8244
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8245
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8246
    "Created: / 12.11.1998 / 19:02:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8247
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8248
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8249
_ObjectInputStream_inputClassFields:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8250
    "/ void inputClassFields (java.lang.Object java.lang.Class int[])
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8251
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8252
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8253
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8254
    "Created: / 12.11.1998 / 19:02:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8255
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8256
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8257
_ObjectInputStream_invokeDefaultReadObject:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8258
    "/ void invokeDefaultReadObject (java.lang.Object java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8259
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8260
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8261
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8262
    "Created: / 27.1.2000 / 03:00:47 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8263
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8264
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8265
_ObjectInputStream_invokeObjectReader:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8266
    "/ boolean invokeObjectReader (java.lang.Object java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8267
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8268
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8269
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8270
    "Created: / 12.11.1998 / 19:03:06 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8271
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8272
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8273
_ObjectInputStream_invokeReadObject:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8274
    "/ void invokeReadObject (java.lang.Object java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8275
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8276
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8277
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8278
    "Created: / 27.1.2000 / 03:01:02 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8279
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8280
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8281
_ObjectInputStream_loadClass0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8282
    "/ java.lang.Class loadClass0 (java.lang.Class java.lang.String)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8283
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8284
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8285
    "Created: / 12.11.1998 / 19:01:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8286
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8287
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8288
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8289
_ObjectOutputStream_invokeDefaultWriteObject:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8290
    "/ void invokeDefaultWriteObject (java.lang.Object java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8291
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8292
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8293
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8294
    "Created: / 27.1.2000 / 03:01:36 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8295
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8296
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8297
_ObjectOutputStream_invokeObjectWriter:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8298
    "/ boolean invokeObjectWriter (java.lang.Object java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8299
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8300
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8301
    "Created: / 12.11.1998 / 19:00:36 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8302
    "Modified: / 12.11.1998 / 19:01:45 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8303
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8304
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8305
_ObjectOutputStream_invokeWriteObject:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8306
    "/ void invokeWriteObject (java.lang.Object java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8307
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8308
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8309
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8310
    "Created: / 27.1.2000 / 03:01:52 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8311
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8312
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8313
_ObjectOutputStream_outputClassFields:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8314
    "/ void outputClassFields (java.lang.Object java.lang.Class int[])
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8315
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8316
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8317
    "Created: / 12.11.1998 / 19:00:09 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8318
    "Modified: / 12.11.1998 / 19:01:42 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8319
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8320
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8321
_ObjectStreamClass_doMismatchedRead:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8322
    "/ void doMismatchedRead (java.io.ObjectInputStream java.lang.Object)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8323
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8324
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8325
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8326
    "Created: / 27.1.2000 / 02:50:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8327
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8328
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8329
_ObjectStreamClass_findObjectMethod0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8330
    "/ boolean findObjectMethod0 (java.lang.Class int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8331
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8332
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8333
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8334
    "Created: / 27.1.2000 / 02:51:50 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8335
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8336
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8337
_ObjectStreamClass_getClassAccess:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8338
    "/ int getClassAccess (java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8339
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8340
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8341
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8342
    "Created: / 12.11.1998 / 19:04:19 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8343
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8344
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8345
_ObjectStreamClass_getClassDefinedUID:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8346
    "/ long getClassDefinedUID (java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8347
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8348
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8349
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8350
    "Created: / 27.1.2000 / 02:51:33 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8351
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8352
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8353
_ObjectStreamClass_getFieldAccess:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8354
    "/ int getFieldAccess (java.lang.Class java.lang.String)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8355
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8356
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8357
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8358
    "Created: / 12.11.1998 / 19:05:19 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8359
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8360
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8361
_ObjectStreamClass_getFieldSignatures:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8362
    "/ java.lang.String[] getFieldSignatures (java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8363
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8364
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8365
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8366
    "Created: / 12.11.1998 / 19:05:04 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8367
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8368
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8369
_ObjectStreamClass_getFields0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8370
    "/ java.io.ObjectStreamField[] getFields0 (java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8371
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8372
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8373
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8374
    "Created: / 12.11.1998 / 19:05:32 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8375
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8376
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8377
_ObjectStreamClass_getMethodAccess:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8378
    "/ int getMethodAccess (java.lang.Class java.lang.String)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8379
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8380
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8381
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8382
    "Created: / 12.11.1998 / 19:04:51 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8383
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8384
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8385
_ObjectStreamClass_getMethodSignatures:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8386
    "/ java.lang.String[] getMethodSignatures (java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8387
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8388
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8389
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8390
    "Created: / 12.11.1998 / 19:04:34 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8391
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8392
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8393
_ObjectStreamClass_getSerialVersionUID:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8394
    "/ long getSerialVersionUID (java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8395
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8396
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8397
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8398
    "Created: / 12.11.1998 / 19:05:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8399
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8400
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8401
_ObjectStreamClass_hasWriteObject:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8402
    "/ boolean hasWriteObject (java.lang.Class)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8403
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8404
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8405
    "Modified: / 12.11.1998 / 19:01:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8406
    "Created: / 12.11.1998 / 19:05:53 / cg"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8407
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8408
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8409
_Object_notify:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8410
    "wakeup"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8411
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8412
    self wakeup:(nativeContext receiver).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8413
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8414
    "Created: / 6.1.1998 / 21:09:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8415
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8416
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8417
_Object_notifyAll:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8418
    self wakeupAll:(nativeContext receiver).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8419
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8420
    "Created: / 3.1.1998 / 03:06:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8421
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8422
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8423
_OffScreenImageSource_sendPixels:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8424
    "/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8425
    "/ UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8426
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8427
    "Modified: / 16.1.1998 / 18:22:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8428
    "Created: / 17.1.1998 / 12:36:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8429
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8430
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8431
_PackedColorModel_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8432
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8433
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8434
    "Created: / 28.1.1998 / 22:19:35 / cg"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8435
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8436
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8437
_PlainDatagramSocketImpl_bind:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8438
    |jsock jaddr port sock hostName ok err|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8439
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8440
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8441
    port := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8442
    jaddr := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8443
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8444
    hostName := jaddr instVarNamed:'hostName'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8445
    hostName isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8446
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8447
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8448
	hostName := Java as_ST_String:hostName
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8449
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8450
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8451
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8452
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8453
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8454
	    ('JAVA: socket bind to ' , hostName printString, ' port ' , port printString) infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8455
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8456
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8457
	ok := sock bindTo:port address:nil "hostName".
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8458
	ok ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8459
	    err := OperatingSystem lastErrorString.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8460
	    Transcript showCR:'sock err: ' , err printString.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8461
	    self throwIOExceptionWithMessage:'bind failed'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8462
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8463
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8464
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8465
    "Created: / 4.2.1998 / 15:06:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8466
    "Modified: / 30.12.1998 / 20:10:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8467
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8468
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8469
_PlainDatagramSocketImpl_datagramSocketClose:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8470
    |jsock sock|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8471
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8472
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8473
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8474
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8475
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8476
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8477
	    'JAVA: datagram close socket' infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8478
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8479
	sock close.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8480
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8481
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8482
    "Modified: / 21.8.1997 / 17:09:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8483
    "Created: / 25.1.1998 / 20:04:24 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8484
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8485
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8486
_PlainDatagramSocketImpl_datagramSocketCreate:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8487
    |jsock fd sock fileNo|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8488
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8489
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8490
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8491
    fd := jsock instVarNamed:'fd'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8492
    (fd instVarNamed:'fd') ~~ 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8493
	self halt:'file already open'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8494
	self internalError:'file already open'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8495
	self throwIOExceptionWithMessage:'file already open in socketCreate'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8496
	^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8497
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8498
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8499
    FileOpenTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8500
	('JAVA: create datagram socket') infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8501
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8502
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8503
    sock := Socket newUDP.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8504
    sock isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8505
	self throwIOExceptionWithMessage:'socketCreate failed'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8506
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8507
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8508
    fileNo := self addOpenFile:sock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8509
    fd instVarNamed:'fd' put:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8510
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8511
    "Created: / 25.1.1998 / 19:59:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8512
    "Modified: / 30.12.1998 / 20:10:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8513
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8514
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8515
_PlainDatagramSocketImpl_join:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8516
    "/ native void join (InetAddress arg1)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8517
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8518
    |jsock addr sock ok err|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8519
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8520
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8521
    addr := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8522
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8523
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8524
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8525
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8526
	    ('JAVA: socket join ' , addr printString) infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8527
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8528
	self throwIOExceptionWithMessage:'unimplemented: join'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8529
self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8530
	^ nil.  "/ void
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8531
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8532
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8533
    "Created: / 4.2.1998 / 15:06:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8534
    "Modified: / 30.12.1998 / 20:10:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8535
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8536
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8537
_PlainDatagramSocketImpl_receive:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8538
    |jsock jdatagramPacket sock ok|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8539
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8540
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8541
    jdatagramPacket := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8542
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8543
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8544
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8545
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8546
	    ('JAVA: socket receive') infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8547
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8548
	^ -1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8549
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8550
    ^ -1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8551
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8552
    "Created: / 4.2.1998 / 15:06:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8553
    "Modified: / 30.12.1998 / 20:10:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8554
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8555
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8556
_PlainDatagramSocketImpl_send:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8557
    |jsock jdatagramPacket sock ok|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8558
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8559
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8560
    jdatagramPacket := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8561
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8562
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8563
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8564
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8565
	    ('JAVA: socket send') infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8566
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8567
	^ -1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8568
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8569
    ^ -1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8570
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8571
    "Created: / 4.2.1998 / 15:06:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8572
    "Modified: / 30.12.1998 / 20:10:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8573
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8574
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8575
_PlainDatagramSocketImpl_socketGetOption:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8576
    |jsock opt port sock hostName ok err|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8577
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8578
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8579
    opt := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8580
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8581
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8582
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8583
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8584
	    ('JAVA: socket getOption ' , opt printString) infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8585
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8586
	self throwIOExceptionWithMessage:'unimplemented: getOption'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8587
self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8588
	^ -1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8589
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8590
    ^ -1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8591
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8592
    "Created: / 4.2.1998 / 15:06:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8593
    "Modified: / 30.12.1998 / 20:10:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8594
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8595
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8596
_PlainDatagramSocketImpl_socketSetOption:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8597
    "/ native void socketSetOption (int arg1, java.lang.Object arg2)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8598
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8599
    |jsock opt optVal sock ok err jSocketOptions|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8600
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8601
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8602
    opt := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8603
    optVal := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8604
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8605
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8606
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8607
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8608
	    ('JAVA: socket setOption ' , opt printString) infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8609
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8610
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8611
	jSocketOptions := Java at:'java.net.SocketOptions'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8612
	(opt == (jSocketOptions instVarNamed:'TCP_NODELAY')) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8613
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8614
	    (opt == (jSocketOptions instVarNamed:'SO_BINDADDR')) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8615
	    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8616
		(opt == (jSocketOptions instVarNamed:'SO_REUSEADDR')) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8617
		] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8618
		    (opt == (jSocketOptions instVarNamed:'IP_MULTICAST_IF')) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8619
		    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8620
			(opt == (jSocketOptions instVarNamed:'SO_LINGER')) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8621
			] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8622
			    (opt == (jSocketOptions instVarNamed:'SO_TIMEOUT')) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8623
			    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8624
				self throwIOExceptionWithMessage:'bad arg to setOption'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8625
			    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8626
			]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8627
		    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8628
		]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8629
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8630
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8631
	self throwIOExceptionWithMessage:'unimplemented: setOption'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8632
self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8633
	^ nil.  "/ void
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8634
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8635
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8636
    "Created: / 4.2.1998 / 15:06:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8637
    "Modified: / 30.12.1998 / 20:10:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8638
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8639
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8640
_PlainSocketImpl_initProto:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8641
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8642
    "Created: / 12.1.1998 / 12:56:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8643
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8644
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8645
_PlainSocketImpl_socketAccept:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8646
    |jsock fd newJSock sock newSock fileNo|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8647
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8648
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8649
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8650
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8651
    sock isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8652
	self throwIOExceptionWithMessage:'nil socket in accept'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8653
	^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8654
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8655
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8656
    newJSock := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8657
    fd := newJSock instVarNamed:'fd'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8658
    (fd instVarNamed:'fd') ~~ 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8659
	self halt:'file already open'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8660
	self internalError:'file already open'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8661
	self throwIOExceptionWithMessage:'socket already open in socketAccept'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8662
	^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8663
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8664
    FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8665
	'JAVA: socket accept' infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8666
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8667
    newSock := sock accept.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8668
    newSock isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8669
	self throwIOExceptionWithMessage:'accept failed'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8670
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8671
    fileNo := self addOpenFile:newSock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8672
    fd instVarNamed:'fd' put:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8673
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8674
    "Created: / 4.2.1998 / 15:26:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8675
    "Modified: / 30.12.1998 / 20:10:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8676
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8677
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8678
_PlainSocketImpl_socketAvailable:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8679
    |jSock sock n|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8680
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8681
    jSock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8682
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8683
    sock := self validateFile:jSock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8684
    sock isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8685
	self throwIOExceptionWithMessage:'socketAvailable on closed socket'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8686
	^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8687
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8688
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8689
    n := sock numAvailable.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8690
    ^ n
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8691
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8692
    "Created: / 4.2.1998 / 16:58:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8693
    "Modified: / 30.12.1998 / 20:10:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8694
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8695
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8696
_PlainSocketImpl_socketBind:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8697
    |jsock jaddr port sock hostName ok err|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8698
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8699
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8700
    jaddr := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8701
    port := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8702
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8703
    hostName := jaddr instVarNamed:'hostName'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8704
    hostName isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8705
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8706
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8707
	hostName := Java as_ST_String:hostName
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8708
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8709
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8710
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8711
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8712
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8713
	    ('JAVA: socket bind to ' , hostName printString, ' port ' , port printString) infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8714
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8715
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8716
	ok := sock bindTo:port address:nil "hostName".
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8717
	ok ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8718
	    err := OperatingSystem lastErrorString.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8719
	    Transcript showCR:'sock err: ' , err printString.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8720
	    self throwIOExceptionWithMessage:'bind failed'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8721
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8722
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8723
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8724
    "Created: / 4.2.1998 / 15:06:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8725
    "Modified: / 30.12.1998 / 20:10:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8726
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8727
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8728
_PlainSocketImpl_socketClose:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8729
    |jsock sock|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8730
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8731
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8732
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8733
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8734
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8735
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8736
	    'JAVA: close socket' infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8737
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8738
	sock close.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8739
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8740
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8741
    "Modified: / 21.8.1997 / 17:09:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8742
    "Created: / 25.1.1998 / 20:04:24 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8743
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8744
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8745
_PlainSocketImpl_socketConnect:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8746
    |jsock jaddr port sock addr hostName ok|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8747
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8748
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8749
    jaddr := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8750
    port := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8751
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8752
    hostName := jaddr instVarNamed:'hostName'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8753
    hostName notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8754
        hostName := Java as_ST_String:hostName
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8755
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8756
        addr := jaddr instVarNamed:'address'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8757
        addr notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8758
            hostName := ByteArray new:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8759
            hostName at:4 put:(addr bitAnd:16rFF).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8760
            addr := addr bitShift:-8.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8761
            hostName at:3 put:(addr bitAnd:16rFF).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8762
            addr := addr bitShift:-8.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8763
            hostName at:2 put:(addr bitAnd:16rFF).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8764
            addr := addr bitShift:-8.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8765
            hostName at:1 put:(addr bitAnd:16rFF).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8766
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8767
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8768
    hostName isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8769
        self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8770
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8771
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8772
    sock := self validateFile:jsock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8773
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8774
        FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8775
            ('JAVA: socket connect to ' , hostName printString , ' port ' , port printString) infoPrintCR
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8776
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8777
        SocketConnectConfirmation ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8778
            (PermittedHostConnects isNil 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8779
            or:[(PermittedHostConnects includes:hostName) not]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8780
                (self confirm:'connect to host: ' , hostName printString , ' - ok ?')
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8781
                ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8782
                    self throwIOExceptionWithMessage:'connect permission denied'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8783
                ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8784
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8785
                (self confirm:('JAVA Security check\\Always permit connects to this host (''' , hostName printString , ''') ?') withCRs)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8786
                ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8787
                    PermittedHostConnects isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8788
                        PermittedHostConnects := Set new
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8789
                    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8790
                    PermittedHostConnects add:hostName.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8791
                ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8792
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8793
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8794
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8795
        ok := sock connectTo:hostName port:port.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8796
        ok ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8797
            self throwIOExceptionWithMessage:'connect failed'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8798
        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8799
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8800
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8801
    "Created: / 25.1.1998 / 20:02:27 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8802
    "Modified: / 30.12.1998 / 20:10:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8803
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8804
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8805
_PlainSocketImpl_socketCreate:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8806
    |jsock isStream fd sock fileNo|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8807
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8808
    jsock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8809
    isStream := (nativeContext argAt:1) == 1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8810
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8811
    fd := jsock instVarNamed:'fd'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8812
    (fd instVarNamed:'fd') ~~ 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8813
	self halt:'file already open'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8814
	self internalError:'file already open'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8815
	self throwIOExceptionWithMessage:'file already open in socketCreate'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8816
	^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8817
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8818
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8819
    FileOpenTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8820
	('JAVA: create socket') infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8821
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8822
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8823
    isStream ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8824
	sock := Socket newTCP
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8825
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8826
	sock := Socket newUDP
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8827
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8828
    sock isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8829
	self throwIOExceptionWithMessage:'socketCreate failed'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8830
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8831
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8832
    fileNo := self addOpenFile:sock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8833
    fd instVarNamed:'fd' put:fileNo.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8834
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8835
    "Created: / 25.1.1998 / 19:59:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8836
    "Modified: / 30.12.1998 / 20:10:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8837
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8838
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8839
_PlainSocketImpl_socketListen:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8840
    |jSock time sock ok|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8841
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8842
    jSock := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8843
    time := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8844
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8845
    sock := self validateFile:jSock.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8846
    sock notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8847
	FileIOTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8848
	    ('JAVA: socket listen with timeout ' , time printString) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8849
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8850
	ok := sock listenWithBacklog:5.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8851
	ok ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8852
	    self throwIOExceptionWithMessage:'listen failed'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8853
	    ^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8854
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8855
	time ~~ 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8856
	    sock readWaitWithTimeoutMs:time
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8857
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8858
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8859
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8860
    "Created: / 4.2.1998 / 15:17:48 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8861
    "Modified: / 30.12.1998 / 20:10:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8862
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  8863
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8864
_PlatformFont_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8865
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8866
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8867
    "Created: / 28.1.1998 / 22:30:41 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8868
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8869
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8870
_PrintStream_isOutputStreamLocalised:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8871
    "/ boolean isOutputStreamLocalised (java.io.DataOutputStream)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8872
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8873
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8874
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8875
    "Created: / 27.1.2000 / 03:00:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8876
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8877
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8878
_Proxy_defineClass0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8879
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8880
    private static native Class defineClass0(ClassLoader loader, String name,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8881
                                             byte[] b, int off, int len);
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8882
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8883
    | loader name b off len  bs cls |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8884
    loader := nativeContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8885
    name := nativeContext argAt: 2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8886
    b := nativeContext argAt: 3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8887
    off := nativeContext argAt: 4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8888
    len := nativeContext argAt: 5.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8889
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8890
    bs := (off = 0 and: [len = b size]) 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8891
            ifTrue:[b readStream]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8892
            ifFalse:[(b copyFrom: off + 1 to: off + len) readStream].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8893
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8894
    cls := JavaClassReader readStream: bs.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8895
    cls classLoader: loader.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8896
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8897
    ^self reflection javaClassObjectForClass: cls.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8898
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8899
    "Created: / 06-02-2011 / 16:55:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8900
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8901
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8902
_RandomAccessFile_close:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8903
    ^ self anyStream_close:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8904
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8905
    "Created: / 4.2.1998 / 13:26:53 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8906
    "Modified: / 4.2.1998 / 15:21:08 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8907
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8908
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8909
_RandomAccessFile_length:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8910
    |file sz|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8911
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8912
    file := self validateFile:(nativeContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8913
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8914
    FileIOTrace ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8915
	('JAVA: length of ' , file pathName) infoPrintCR.
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
    sz := file size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8919
    ^ sz.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8920
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8921
    "Created: / 4.2.1998 / 13:27:58 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8922
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8923
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8924
_RandomAccessFile_open:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8925
    |fs fd name dir stream fileNo answer readonly|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8926
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8927
    readonly := false.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8928
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8929
    fs := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8930
    fd := fs instVarNamed:'fd'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8931
    (fd instVarNamed:'fd') ~~ 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8932
	self halt:'file already open'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8933
	self internalError:'file already open'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8934
	^ self.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8935
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8936
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8937
    name := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8938
    name := Java as_ST_String:name.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8939
    name := self fixFilename:name.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8940
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8941
    FileOpenTrace ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8942
	('JAVA: opening ' , name) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8943
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8944
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8945
    dir := name asFilename directory pathName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8946
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8947
    (PermittedDirectories notNil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8948
    and:[PermittedDirectories includes:dir]) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8949
	FileOpenConfirmation ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8950
	    answer := Dialog 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8951
		    confirmWithCancel:('JAVA Security check\\Opening ''' , name , ''' for read/write.\Grant permission ?') withCRs
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8952
			       labels:#('no' 'grant' 'readonly')
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8953
			       values:#(false true #readonly)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8954
			      default:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8955
	    answer == false ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8956
		self throwIOExceptionWithMessage:('no permission to open ' , name , ' for writing').
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8957
		^ self
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8958
	    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8959
	    readonly := (answer == #readonly).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8960
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8961
	    readonly ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8962
		(self confirm:('JAVA Security check\\Always permit writes in this directory (''' , dir , ''') ?') withCRs)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8963
		ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8964
		    PermittedDirectories isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8965
			PermittedDirectories := Set new
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8966
		    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8967
		    PermittedDirectories add:dir.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8968
		]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8969
	    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8970
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8971
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8972
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8973
    readonly ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8974
	stream := name asFilename readStream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8975
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8976
	stream := name asFilename readWriteStream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8977
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8978
    stream isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8979
	self throwIOExceptionWithMessage:('cannot open ' , name , ' for writing').
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8980
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8981
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8982
    fileNo := self addOpenFile:stream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8983
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8984
    FileOpenTrace ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8985
	('JAVA: opened ' , name , ' as FD ' , fileNo printString , ' for writing') infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8986
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8987
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8988
    fd instVarNamed:'fd' put:fileNo.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8989
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8990
    "Created: / 4.2.1998 / 00:14:48 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8991
    "Modified: / 12.11.1998 / 21:29:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8992
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8993
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8994
_RandomAccessFile_read:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8995
    |file byte|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8996
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8997
    file := self validateFile:(nativeContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8998
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  8999
    FileIOTrace ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9000
	('JAVA: read 1 byte from ' , file pathName) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9001
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9002
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9003
    byte := file nextByte.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9004
    byte isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9005
	^ -1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9006
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9007
    ^ byte
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9008
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9009
    "Modified: / 5.1.1998 / 02:17:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9010
    "Created: / 27.1.1999 / 19:01:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9011
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9012
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9013
_RandomAccessFile_readBytes:nativeContext
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9014
    ^ self anyStream_readBytes:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9015
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9016
    "Modified: / 4.2.1998 / 15:23:27 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9017
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9018
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9019
_RandomAccessFile_seek:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9020
    |file pos|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9021
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9022
    file := self validateFile:(nativeContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9023
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9024
    FileIOTrace ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9025
	('JAVA: seek on ' , file pathName) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9026
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9027
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9028
    pos := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9029
    file position:pos+1 "/ ST/X position starts at 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9030
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9031
    "Created: / 4.2.1998 / 13:25:38 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9032
    "Modified: / 4.2.1998 / 13:28:12 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9033
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9034
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9035
_RandomAccessFile_writeBytes:nativeContext
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9036
    ^ self anyStream_writeBytes:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9037
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9038
    "Modified: / 4.2.1998 / 15:24:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9039
    "Created: / 4.2.1998 / 15:24:35 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9040
!
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9041
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9042
_ResourceBundle_getClassContext:nativeContext 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9043
    "returns an array filled with the contextChain receivers classes.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9044
     What an ugly, messy interface."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9045
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9046
    |chain con cls jClass|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9047
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9048
    chain := OrderedCollection new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9049
    con := thisContext sender.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9050
    [
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9051
        con notNil 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9052
            and:[con receiver isMethod not or:[con receiver isJavaMethod not]]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9053
    ] whileTrue:[con := con sender.].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9054
    con := con sender.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9055
    [con notNil] whileTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9056
        (true) "con isJavaContext" ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9057
            cls := con receiver class.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9058
            cls isMeta ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9059
                "/ t'was a static method
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9060
                cls := cls soleInstance
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9061
            ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9062
            cls isJavaClass ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9063
                jClass := self reflection javaClassObjectForClass:cls.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9064
                chain add:jClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9065
            ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9066
        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9067
        con := con sender.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9068
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9069
    ^ chain asArray
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9070
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9071
    "Created: / 05-01-1998 / 02:47:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9072
    "Modified: / 24-12-1998 / 00:34:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9073
    "Modified: / 28-01-2011 / 15:31:28 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9074
    "Modified: / 03-02-2011 / 21:31:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9075
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9076
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9077
_Runtime_buildLibName:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9078
    |jPath jFileName path fileName libName|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9079
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9080
    jPath := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9081
    jFileName := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9082
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9083
    path := Java as_ST_String:jPath.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9084
    fileName := Java as_ST_String:jFileName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9085
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9086
    path = '__builtIn__' ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9087
	libName := path , '/' , fileName
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9088
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9089
	libName := path , '/lib' , fileName , '.so'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9090
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9091
    ^ Java as_String:libName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9092
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9093
    "Modified: / 8.8.1997 / 12:05:05 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9094
    "Created: / 4.1.1998 / 19:07:14 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9095
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9096
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9097
_Runtime_execInternal:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9098
    "Run a unix-command; return a process object."
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9099
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9100
    |cmdAndArgArray envArray cmd jProcessClass jProcess|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9101
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9102
    cmdAndArgArray := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9103
    envArray := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9104
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9105
    cmd := cmdAndArgArray at:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9106
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9107
    OperatingSystem isUNIXlike ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9108
	jProcessClass := Java classForName:'java.lang.UNIXProcess'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9109
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9110
	jProcessClass := Java classForName:'java.lang.Win32Process'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9111
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9112
"/
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9113
    jProcessClass notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9114
self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9115
	jProcess := jProcessClass newCleared.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9116
	jProcess
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9117
	    perform:#'<init>([Ljava/lang/String;[Ljava/lang/String;)V'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9118
	    with:cmdAndArgArray
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9119
	    with:envArray.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9120
	^ jProcess
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9121
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9122
self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9123
    self throwIOExceptionWithMessage:'Process execution disabled/unimplemented'.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9124
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9125
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9126
    "Created: / 15.1.1998 / 01:50:31 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9127
    "Modified: / 11.12.1998 / 13:09:36 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9128
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9129
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9130
_Runtime_exitInternal:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9131
    "exit - here, we only shut down java threads"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9132
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9133
    |enteredMonitors|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9134
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9135
    ExitDebug == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9136
	self halt:'Java code called exit'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9137
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9138
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9139
    self syncMonitorCache.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9140
    (enteredMonitors := self enteredMonitors) size > 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9141
	enteredMonitors do:[:handle | 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9142
	    | mon |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9143
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9144
	    mon := LockTable at:handle ifAbsent:nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9145
	    mon isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9146
		self halt:'no monitor in exitInternal'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9147
	    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9148
		mon exit.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9149
('====> terminateThread - exit monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9150
	    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9151
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9152
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9153
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9154
    "/ TODO: shut down all threads created by this one ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9155
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9156
    AbortSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9157
    self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9158
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9159
    "Created: / 7.1.1998 / 22:48:51 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9160
    "Modified: / 8.1.1999 / 14:09:36 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9161
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9162
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9163
_Runtime_freeMemory:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9164
    "free memory - Returns the number of free bytes"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9165
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9166
    ^ ObjectMemory freeListSpace + ObjectMemory freeSpace
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9167
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9168
    "Created: / 12.1.1998 / 12:59:53 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9169
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9170
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9171
_Runtime_gc:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9172
    "Runs the garbage collector.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9173
     Ignored, since the ST-gc runs all the time."
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9174
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9175
    ^ self
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9176
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9177
    "Modified: / 12.1.1998 / 12:58:32 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9178
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9179
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9180
_Runtime_initializeLinkerInternal:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9181
    "init sharedLib linker, return searchPath as javaString"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9182
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9183
    |path|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9184
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9185
    "/ mhmh - what is done here ?
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9186
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9187
    path := ''.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9188
    LibPath do:[:comp | path size == 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9189
			    path := path , comp
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9190
			] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9191
			    path := path , ':' , comp
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9192
			]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9193
	       ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9194
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9195
    ^ Java as_String:path
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9196
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9197
    "Modified: / 7.8.1997 / 21:17:03 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9198
    "Created: / 4.1.1998 / 17:53:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9199
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9200
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9201
_Runtime_isInputStreamLocalised:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9202
    "/ boolean isInputStreamLocalised (java.io.DataInputStream)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9203
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9204
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9205
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9206
    "Created: / 27.1.2000 / 03:03:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9207
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9208
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9209
_Runtime_isOutputStreamLocalised:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9210
    "/ boolean isOutputStreamLocalised (java.io.DataOutputStream)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9211
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9212
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9213
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9214
    "Created: / 27.1.2000 / 03:02:49 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9215
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9216
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9217
_Runtime_loadFileInternal:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9218
    "load a sharedLib, return boolean 0 (false) if fail; 1 (true) if ok"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9219
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9220
    |ret|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9221
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9222
    ret := self _Runtime_loadFileInternalI:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9223
    ret < 0 ifTrue:[ ret := 0 ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9224
    ^ ret
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9225
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9226
    "Created: / 4.1.1998 / 19:10:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9227
    "Modified: / 4.1.1998 / 19:11:04 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9228
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9229
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9230
_Runtime_loadFileInternalI:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9231
    "1.1b3 change; load a sharedLib like 'loadFileInternal',
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9232
     but return integer:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9233
	-1   outOfMemory error
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9234
	0    failed to load
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9235
	1    loaded or already loaded (i.e. ok)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9236
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9237
    |jLibName libName libHandle|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9238
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9239
    jLibName := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9240
    libName := Java as_ST_String:jLibName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9241
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9242
    (SimulatedLibs includes:libName) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9243
"/        ('JAVA: builtIn libLoad simulated: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9244
	^ 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9245
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9246
    (LoadedLibs notNil and:[LoadedLibs includesKey:libName]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9247
"/        ('JAVA: already loaded: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9248
	^ 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9249
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9250
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9251
    libName asFilename exists ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9252
	('JAVA: no file to load: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9253
	^ 0
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
    (self confirm:'permission to load native library: ' , libName , ' ?') ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9257
	^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9258
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9259
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9260
    libHandle := ObjectFileLoader loadLibrary:libName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9261
    libHandle isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9262
	('JAVA: failed to load: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9263
	^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9264
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9265
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9266
    LoadedLibs isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9267
	LoadedLibs := Dictionary new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9268
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9269
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9270
    LoadedLibs at:libName put:libHandle.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9271
    ^ 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9272
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9273
    "Created: / 4.1.1998 / 19:10:54 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9274
    "Modified: / 6.2.1998 / 03:11:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9275
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9276
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9277
_Runtime_runFinalization:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9278
    "/ void runFinalization ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9279
"/    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9280
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9281
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9282
    "Created: / 12.11.1998 / 18:59:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9283
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9284
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9285
_Runtime_runFinalizersOnExit0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9286
    ""
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9287
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9288
    |onOff|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9289
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9290
    onOff := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9291
    ^ 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9292
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9293
    "Modified: / 6.2.1998 / 03:11:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9294
    "Created: / 15.10.1998 / 23:34:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9295
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9296
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9297
_Runtime_setInputStreamLocalised:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9298
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9299
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9300
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9301
    "Modified: / 27.1.2000 / 03:02:27 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9302
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9303
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9304
_Runtime_setOutputStreamLocalised:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9305
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9306
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9307
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9308
    "Modified: / 27.1.2000 / 03:02:32 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9309
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9310
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9311
_Runtime_totalMemory:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9312
    "free memory - Returns the total number of bytes"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9313
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9314
    ^ ObjectMemory oldSpaceSize + ObjectMemory newSpaceSize
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9315
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9316
    "Created: / 12.1.1998 / 12:59:23 / 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
_Runtime_traceInstructions:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9320
    "/ void traceInstructions (boolean)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9321
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9322
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9323
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9324
    "Created: / 12.11.1998 / 18:59:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9325
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9326
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9327
_Runtime_traceMethodCalls:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9328
    "/ void traceMethodCalls (boolean)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9329
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9330
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9331
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9332
    "Created: / 12.11.1998 / 18:59:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9333
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9334
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9335
_ScrollPane_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9336
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9337
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9338
    "Created: / 28.1.1998 / 22:19:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9339
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9340
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9341
_SecurityManager_classDepth:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9342
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9343
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9344
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9345
    "Created: / 12.11.1998 / 18:56:27 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9346
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9347
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9348
_SecurityManager_classLoaderDepth:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9349
    |con depth|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9350
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9351
    con := thisContext sender.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9352
    depth := 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9353
    [con notNil] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9354
	con receiver == JavaClassReader classLoaderQuerySignal ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9355
	    con selector == #handle:do: ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9356
		depth := depth + 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9357
	    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9358
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9359
	con := con sender.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9360
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9361
'JAVA: classLoaderDepth -> ' infoPrint. depth infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9362
    ^ depth.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9363
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9364
    "Created: / 13.1.1998 / 09:21:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9365
    "Modified: / 13.1.1998 / 09:33:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9366
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9367
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9368
_SecurityManager_currentClassLoader:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9369
    |loader|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9370
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9371
    loader := JavaClassReader classLoaderQuerySignal query.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9372
"/ 'JAVA: currentClassLoader -> ' infoPrint. loader displayString infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9373
    ^ loader.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9374
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9375
    "Created: / 13.1.1998 / 09:23:28 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9376
    "Modified: / 11.12.1998 / 12:39:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9377
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9378
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9379
_SecurityManager_currentLoadedClass0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9380
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9381
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9382
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9383
    "Created: / 12.11.1998 / 18:56:41 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9384
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9385
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9386
_SecurityManager_getClassContext:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9387
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9388
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9389
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9390
    "Created: / 12.11.1998 / 18:56:06 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9391
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9392
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9393
_SocketInputStream_socketRead:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9394
    ^ self anyStream_readBytes:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9395
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9396
    "Created: / 25.1.1998 / 20:56:53 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9397
    "Modified: / 4.2.1998 / 15:52:31 / 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
_SocketOutputStream_socketWrite:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9401
    ^ self anyStream_writeBytes:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9402
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9403
    "Created: / 25.1.1998 / 21:06:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9404
    "Modified: / 4.2.1998 / 15:52:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9405
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9406
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9407
_String_compareTo:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9408
    "int compareTo (java.lang.String)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9409
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9410
    |jString1 jString2|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9411
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9412
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9413
    jString2 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9414
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9415
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9416
    "Created: / 27.1.2000 / 02:28:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9417
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9418
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9419
_String_equals:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9420
    |jString1 jString2|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9421
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9422
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9423
    jString2 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9424
    ^ (jString1 instVarAt:1) = (jString2 instVarAt:1)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9425
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9426
    "Created: / 18.11.1998 / 00:52:03 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9427
    "Modified: / 18.11.1998 / 00:53:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9428
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9429
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9430
_String_equalsIgnoreCase:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9431
    "boolean equalsIgnoreCase (java.lang.String)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9432
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9433
    |jString1 jString2|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9434
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9435
self halt:'untested'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9436
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9437
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9438
    jString2 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9439
    ^ (jString1 instVarAt:1) sameAs: (jString2 instVarAt:1)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9440
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9441
    "Modified: / 18.11.1998 / 00:53:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9442
    "Created: / 27.1.2000 / 02:27:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9443
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9444
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9445
_String_indexOf:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9446
    "int indexOf (java.lang.String int)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9447
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9448
    |jString1 jString2 idx|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9449
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9450
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9451
    jString2 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9452
    idx := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9453
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9454
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9455
    "Created: / 27.1.2000 / 02:30:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9456
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9457
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9458
_String_lastIndexOf:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9459
    "int lastIndexOf (java.lang.String int)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9460
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9461
    |jString1 jString2 idx|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9462
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9463
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9464
    jString2 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9465
    idx := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9466
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9467
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9468
    "Created: / 27.1.2000 / 02:33:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9469
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9470
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9471
_String_length:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9472
    |jString|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9473
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9474
    jString := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9475
    ^ (jString instVarAt:3)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9476
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9477
    "Created: / 18.11.1998 / 00:53:50 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9478
    "Modified: / 18.11.1998 / 00:54:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9479
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9480
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9481
_String_regionMatches2:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9482
    "boolean regionMatches (boolean int java.lang.String int int)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9483
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9484
    |jString1 bool jString2 idx1 idx2|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9485
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9486
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9487
    bool := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9488
    jString2 := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9489
    idx1 := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9490
    idx2 := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9491
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9492
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9493
    "Created: / 27.1.2000 / 02:33:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9494
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9495
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9496
_String_regionMatches:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9497
    "boolean regionMatches (int java.lang.String int int)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9498
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9499
    |jString1 jString2 idx1 idx2|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9500
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9501
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9502
    jString2 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9503
    idx1 := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9504
    idx2 := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9505
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9506
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9507
    "Created: / 27.1.2000 / 02:32:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9508
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9509
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9510
_String_startsWith:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9511
    "boolean startsWith (java.lang.String int)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9512
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9513
    |jString1 jString2 idx|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9514
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9515
    jString1 := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9516
    jString2 := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9517
    idx := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9518
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9519
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9520
    "Created: / 27.1.2000 / 02:31:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9521
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9522
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9523
_SystemColor_GetSysColor:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9524
    "/ int GetSysColor (int)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9525
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9526
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9527
    "Created: / 27.1.2000 / 02:44:41 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9528
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9529
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9530
_SystemResourceManager_getEntryFromKey:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9531
    "get a resource by name"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9532
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9533
    |key s|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9534
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9535
    key := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9536
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9537
    s := Java effectiveClassPath at:(key+1) ifAbsent:nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9538
    s isNil ifTrue:[^ nil].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9539
    ^ Java as_String:s
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9540
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9541
    "Modified: / 22-11-2010 / 13:44:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9542
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9543
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9544
_SystemResourceManager_validateSystemResource:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9545
    "check a resource"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9546
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9547
    |bool str1 str2|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9548
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9549
    bool := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9550
    str1 := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9551
    str2 := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9552
    ^ 1 "/ true
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9553
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9554
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9555
_System_getCallerClass:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9556
    "/ introduced with jdk1.2
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9557
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9558
    |senderContext cls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9559
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9560
    senderContext := nativeContext sender.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9561
    [senderContext receiver == (Java at:'java.lang.System')] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9562
	senderContext := senderContext sender.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9563
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9564
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9565
    senderContext method isStatic ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9566
	cls := senderContext receiver
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9567
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9568
	cls := senderContext receiver class
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9569
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9570
    cls isJavaClass ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9571
	^ self javaClassObjectForClass:cls
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9572
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9573
    (cls isMemberOf:(Java at:'java.lang.Class')) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9574
	^ Java at:'java.lang.Class'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9575
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9576
    self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9577
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9578
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9579
    "Modified: / 27.1.1998 / 18:33:13 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9580
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9581
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9582
_System_identityHashCode:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9583
    |obj|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9584
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9585
    obj := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9586
    ^ obj identityHash
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9587
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9588
    "Modified: / 12.11.1998 / 18:52:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9589
    "Created: / 12.11.1998 / 18:54:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9590
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9591
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9592
_System_validateSecurityManager:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9593
    "void validateSecurityManager (java.lang.SecurityManager)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9594
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9595
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9596
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9597
    "Created: / 27.1.2000 / 02:43:25 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9598
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9599
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9600
_ThreadGroup_initMainThreadGroup0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9601
    "void initMainThreadGroup0 (java.lang.ThreadGroup)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9602
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9603
UnimplementedNativeMethodSignal raise.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9604
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9605
    "Created: / 27.1.2000 / 02:45:52 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9606
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9607
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9608
_Thread_countStackFrames:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9609
    "/ int countStackFrames ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9610
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9611
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9612
    "Created: / 12.11.1998 / 19:06:21 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9613
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9614
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9615
_Thread_interrupt0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9616
    "ask if a thread is interrupted (clear interruptState if arg is true)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9617
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9618
    |jThread stProcess|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9619
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9620
    jThread := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9621
    stProcess := self stProcessForJavaThread:jThread.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9622
    stProcess isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9623
	self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9624
	^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9625
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9626
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9627
    stProcess markInterrupted
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9628
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9629
    "Modified: / 2.1.1998 / 21:49:06 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9630
    "Created: / 10.4.1998 / 15:21:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9631
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9632
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9633
_Thread_isInterrupted:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9634
    "ask if a thread is interrupted (clear interruptState if arg is true)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9635
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9636
    |jThread stProcess clearInterrupt rslt|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9637
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9638
    jThread := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9639
    stProcess := self stProcessForJavaThread:jThread.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9640
    stProcess isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9641
	self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9642
	^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9643
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9644
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9645
    clearInterrupt := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9646
    rslt := stProcess isInterrupted ifTrue:[1] ifFalse:[0].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9647
    clearInterrupt ~~ 0 ifTrue:[stProcess clearInterruptActions].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9648
    ^ rslt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9649
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9650
    "Modified: / 2.1.1998 / 21:49:06 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9651
    "Created: / 7.1.1998 / 18:50:26 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9652
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9653
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9654
_Thread_resume0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9655
    "yield"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9656
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9657
    |jThread stProcess|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9658
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9659
    jThread := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9660
    stProcess := JavaVM stProcessForJavaThread:jThread.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9661
    stProcess isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9662
	ThreadTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9663
	    ('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9664
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9665
	^ nil "void"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9666
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9667
    stProcess resume
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9668
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9669
    "Created: / 8.1.1998 / 01:06:27 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9670
    "Modified: / 6.2.1998 / 02:15:08 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9671
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9672
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9673
_Thread_sleep:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9674
    "sleep for some milliseconds "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9675
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9676
    |millis|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9677
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9678
    millis := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9679
    self waitFor:nil state:nil timeOut:(millis max:50)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9680
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9681
    "Modified: / 8.1.1999 / 16:42:52 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9682
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9683
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9684
_Thread_start:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9685
    "start the thread"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9686
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9687
    |jThread jName name stProcess|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9688
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9689
    jThread := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9690
    (jThread instVarNamed:'priority') < 1 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9691
        self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9692
        jThread instVarNamed:'priority' put:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9693
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9694
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9695
    stProcess := JavaProcess 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9696
                    for:[   
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9697
                          |procName|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9698
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9699
                          Object abortSignal handle:[:ex |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9700
                            procName := stProcess name.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9701
                            (procName startsWith:'JAVA-AWT-EventQueue') ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9702
                                ('JAVA [info]: thread ' , procName , ' aborted - restarting process.') infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9703
                                ex restart.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9704
                            ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9705
                                (stProcess == JavaScreenUpdaterThread 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9706
                                or:[stProcess == JavaEventQueueThread]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9707
                                    ('JAVA [info]: thread ' , procName , ' aborted - restarting process.') infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9708
                                    ex restart
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9709
                                ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9710
                                    ('JAVA [info]: thread ' , procName , ' aborted.') infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9711
                                ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9712
                            ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9713
                          ] do:[ 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9714
                            [
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9715
                                JavaVM javaExceptionSignal handle:[:ex |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9716
                                    |exClass|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9717
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9718
                                    procName := stProcess name.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9719
                                    exClass := ex parameter class.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9720
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9721
                                    exClass == (Java at:'java.lang.ThreadDeath') ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9722
                                        ('JAVA: thread ' , procName , ' terminated') infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9723
                                    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9724
                                        Transcript 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9725
                                            showCR:('JAVA: thread ''' 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9726
                                                    , procName 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9727
                                                    , ''' terminated with exception: ' 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9728
                                                    , exClass name).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9729
                                    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9730
                                    ex return.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9731
                                ] do:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9732
                                    Object messageNotUnderstoodSignal handle:[:ex |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9733
                                        "/ remap doesNotUnderstand with nil-receiver to
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9734
                                        "/ a nullPointerException ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9735
                                        |con m|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9736
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9737
                                        con := ex suspendedContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9738
                                        con receiver isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9739
                                            ((m := con sender method) notNil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9740
                                            and:[m isJavaMethod]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9741
                                                self throwNullPointerException.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9742
                                                AbortSignal raise. "/ ex proceed.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9743
                                            ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9744
                                        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9745
                                        ex reject.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9746
                                    ] do:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9747
"/ Transcript showCR:(Timestamp now printString , 'start thread: ', stProcess name).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9748
                                        jThread perform:#'run()V'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9749
                                        ThreadTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9750
                                            ('JAVA: thread ' , stProcess name , ' terminated') infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9751
                                        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9752
                                        jThread perform:#'exit()V'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9753
                                        ThreadTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9754
                                            ('JAVA: after exit of thread ' , stProcess name) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9755
                                        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9756
                                    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9757
                                ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9758
                            ] ensure:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9759
                                |monitors|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9760
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9761
                                monitors := EnteredMonitorsPerProcess at:stProcess ifAbsent:nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9762
                                monitors notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9763
                                    monitors do:[:obj |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9764
                                        | mon |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9765
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9766
                                        mon := self monitorFor:obj.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9767
                                        mon notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9768
                                            mon owningProcess == stProcess ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9769
                                                ('JAVA: release monitor owned by dying thread: ' , stProcess name) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9770
                                                mon exit
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9771
                                            ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9772
                                        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9773
                                    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9774
                                    EnteredMonitorsPerProcess removeKey:stProcess.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9775
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9776
                                    stProcess == JavaScreenUpdaterThread ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9777
                                        JavaScreenUpdaterThread := nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9778
                                    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9779
                                    stProcess == JavaEventQueueThread ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9780
                                        JavaEventQueueThread := nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9781
                                    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9782
"/                                    screenUpdaterClass := Java at:'sun.awt.ScreenUpdater'.    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9783
"/                                    screenUpdaterClass notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9784
"/                                        screenUpdaterClass instVarNamed:'updater' put:nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9785
"/                                    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9786
                                ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9787
                                Java threads removeKey:jThread ifAbsent:[].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9788
                            ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9789
                          ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9790
                        ] 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9791
                    priority:(Processor activePriority).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9792
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9793
    jName := jThread instVarNamed:'name'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9794
    jName isString ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9795
        name := Java as_ST_String:jName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9796
    ] ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9797
        name := jName
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9798
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9799
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9800
    "/ kludge - remember the ScreenUpdater ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9801
    name = 'Screen Updater' ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9802
        JavaScreenUpdaterThread := stProcess.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9803
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9804
        name = 'AWT-Windows' ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9805
            JavaEventThread := stProcess.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9806
        ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9807
            (name startsWith:'AWT-EventQueue') ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9808
                JavaEventQueueThread := stProcess.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9809
            ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9810
        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9811
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9812
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9813
"/name = 'UserDialogShowThread' ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9814
"/self halt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9815
"/].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9816
    "/ when that process terminates, wakup any waiters
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9817
    stProcess addExitAction:[self wakeup:jThread].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9818
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9819
    stProcess name:'JAVA-' , name.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9820
    stProcess restartable:true.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9821
    stProcess resume.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9822
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9823
    Java threads at:jThread put:stProcess.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9824
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9825
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9826
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9827
    "Created: / 3.1.1998 / 02:05:52 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9828
    "Modified: / 24.12.1999 / 03:14:33 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9829
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9830
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9831
_Thread_stop0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9832
    "terminate a thread"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9833
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9834
    |jThread stProcess death|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9835
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9836
    jThread := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9837
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9838
    stProcess := JavaVM stProcessForJavaThread:jThread.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9839
    stProcess isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9840
        ThreadTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9841
            ('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9842
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9843
        ^ nil "void"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9844
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9845
stProcess == JavaScreenUpdaterThread ifTrue:[self halt].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9846
stProcess == JavaEventQueueThread ifTrue:[self halt].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9847
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9848
    death := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9849
    stProcess 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9850
        interruptWith:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9851
                        JavaVM javaExceptionSignal handle:[:ex |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9852
Processor activeProcess == JavaScreenUpdaterThread ifTrue:[self halt].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9853
Processor activeProcess == JavaEventQueueThread ifTrue:[self halt].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9854
                            Processor activeProcess terminate
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9855
                        ] do:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9856
                            ThreadTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9857
                                ('JAVA: thread exit: ' , jThread displayString) infoPrintNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9858
                            ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9859
                            jThread perform:#'exit()V'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9860
                            self throwException:death.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9861
                        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9862
                      ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9863
    stProcess resume.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9864
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9865
    [stProcess isDead] whileFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9866
        stProcess resume.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9867
        'JavaVM: wait for death' infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9868
        Delay waitForSeconds:0.1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9869
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9870
    stProcess terminate
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9871
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9872
    "Created: / 8.1.1998 / 13:11:17 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9873
    "Modified: / 24.12.1999 / 02:32:45 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9874
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9875
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9876
_Thread_suspend0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9877
    "yield"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9878
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9879
    |jThread stProcess|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9880
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9881
    jThread := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9882
    stProcess := JavaVM stProcessForJavaThread:jThread.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9883
    stProcess isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9884
	ThreadTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9885
	    ('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9886
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9887
	^ nil "void"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9888
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9889
    stProcess suspend
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9890
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9891
    "Created: / 8.1.1998 / 01:05:49 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9892
    "Modified: / 6.2.1998 / 02:15:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9893
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9894
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9895
_Thread_yield:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9896
    "yield"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9897
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9898
    |jThread stProcess|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9899
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9900
    Processor yield.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9901
"/    jThread := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9902
"/    stProcess := JavaVM stProcessForJavaThread:jThread.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9903
"/    stProcess isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9904
"/        ThreadTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9905
"/            ('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9906
"/        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9907
"/        ^ nil "void"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9908
"/    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9909
"/    stProcess == Processor activeProcess ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9910
"/        Processor yield.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9911
"/    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9912
"/        self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9913
"/    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9914
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9915
    "Created: / 5.1.1998 / 02:03:51 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9916
    "Modified: / 23.12.1998 / 19:19:17 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9917
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9918
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9919
_Throwable_printStackTrace0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9920
    |out outStream exceptionObject contextList|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9921
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9922
    outStream := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9923
    exceptionObject := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9924
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9925
    contextList := exceptionObject instVarNamed:'backtrace'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9926
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9927
    out := self javaConsoleStream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9928
    out cr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9929
    out nextPutLine:'JAVA: stackTrace:'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9930
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9931
    contextList do:[:con |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9932
	out 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9933
	    nextPutAll:'  '; 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9934
	    nextPutAll:(con method javaClass fullName);
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9935
	    nextPutAll:'.';
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9936
	    nextPutAll:(con method selector);
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9937
	    nextPutAll:' ['; 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9938
	    nextPutAll:(con method javaClass sourceFile); 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9939
	    nextPutAll:' '; 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9940
	    nextPutAll:(con quickLineNumber displayString); 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9941
	    nextPutAll:']'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9942
	out cr
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9943
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9944
    out nextPutLine:'----------------------------------------------------'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9945
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9946
    "Created: / 4.1.1998 / 14:27:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9947
    "Modified: / 10.11.1998 / 14:19:32 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9948
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9949
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9950
_Toolkit_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9951
    "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9952
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
  9953
    "Created: / 27.1.1998 / 19:53:50 / cg"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9954
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9955
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9956
_URLConnection_close:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9957
    "/ void close ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9958
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9959
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9960
    "Created: / 12.11.1998 / 19:26:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9961
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9962
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9963
_URLConnection_finalize:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9964
    "/ void finalize ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9965
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9966
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9967
    "Created: / 12.11.1998 / 19:25:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9968
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9969
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9970
_URLConnection_getContentLength0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9971
    "/ int getContentLength0 ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9972
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9973
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9974
    "Created: / 12.11.1998 / 19:25:34 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9975
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9976
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9977
_URLConnection_getContentType0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9978
    "/ java.lang.String getContentType0 ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9979
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9980
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9981
    "Created: / 12.11.1998 / 19:25:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9982
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9983
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9984
_URLConnection_getHeaderField0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9985
    "/ java.lang.String getHeaderField0 (java.lang.String)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9986
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9987
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9988
    "Created: / 12.11.1998 / 19:25:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9989
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9990
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9991
_URLConnection_pCreate:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9992
    "/ void pCreate (java.lang.String java.lang.String)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9993
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9994
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9995
    "Created: / 12.11.1998 / 19:25:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9996
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9997
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9998
_URLInputStream_available:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
  9999
    "/ int available ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10000
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10001
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10002
    "Created: / 12.11.1998 / 19:24:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10003
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10004
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10005
_URLInputStream_open:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10006
    "/ void open ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10007
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10008
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10009
    "Created: / 12.11.1998 / 19:24:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10010
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10011
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10012
_URLInputStream_read:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10013
    "/ int read (byte[] int int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10014
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10015
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10016
    "Created: / 12.11.1998 / 19:24:12 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10017
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10018
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10019
_URLOutputStream_open:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10020
    "/ void open ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10021
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10022
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10023
    "Created: / 12.11.1998 / 19:24:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10024
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10025
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10026
_URLOutputStream_pClose:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10027
    "/ void pClose ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10028
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10029
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10030
    "Created: / 12.11.1998 / 19:25:02 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10031
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10032
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10033
_URLOutputStream_write:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10034
    "/ void write (int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10035
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10036
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10037
    "Created: / 12.11.1998 / 19:24:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10038
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10039
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10040
_URLOutputStream_writeBytes:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10041
    "/ void writeBytes (byte[] int int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10042
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10043
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10044
    "Created: / 12.11.1998 / 19:24:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10045
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10046
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10047
_URLStreamHandlerFactory_pInit:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10048
    "/ self unimplementedNativeMethod.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10049
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10050
    "Created: / 10.1.1998 / 15:47:24 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10051
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10052
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10053
_URLStreamHandlerFactory_pSupportsProtocol:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10054
    "/ boolean pSupportsProtocol (java.lang.String)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10055
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10056
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10057
    "Created: / 12.11.1998 / 19:23:43 / cg"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10058
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10059
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10060
_Unsafe_allocateInstance:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10061
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10062
    /** Allocate an instance but do not run any constructor.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10063
        Initializes the class if it has not yet been. */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10064
    public native Object allocateInstance(Class cls)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10065
        throws InstantiationException;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10066
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10067
    | cls |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10068
    cls := self reflection classForJavaClassObject: (nativeContext argAt:1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10069
    cls classInit.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10070
    ^cls newCleared
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10071
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10072
    "Created: / 05-02-2011 / 23:10:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10073
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10074
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10075
_Unsafe_defineClass: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10076
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10077
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10078
     * Tell the VM to define a class, without security checks.  By default, the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10079
     * class loader and protection domain come from the caller's class.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10080
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10081
    public native Class defineClass(String name, byte[] b, int off, int len,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10082
                                    ClassLoader loader,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10083
                                    ProtectionDomain protectionDomain);
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10084
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10085
    | name b off len loader protectionDomain bs cls |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10086
    name := nativeContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10087
    b := nativeContext argAt: 2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10088
    off := nativeContext argAt: 3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10089
    len := nativeContext argAt: 4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10090
    loader := nativeContext argAt: 5.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10091
    protectionDomain := nativeContext argAt: 6.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10092
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10093
    bs := (off = 0 and: [len = b size]) 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10094
            ifTrue:[b readStream]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10095
            ifFalse:[(b copyFrom: off + 1 to: off + len) readStream].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10096
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10097
    cls := JavaClassReader readStream: bs.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10098
    cls classLoader: loader.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10099
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10100
    ^self reflection javaClassObjectForClass: cls.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10101
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10102
    "Created: / 05-02-2011 / 22:57:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10103
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10104
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10105
_VM_getState:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10106
    "/ int getState ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10107
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10108
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10109
    "Created: / 12.11.1998 / 19:06:44 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10110
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10111
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10112
_VM_resetJavaMonitor:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10113
    "/ void resetJavaMonitor ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10114
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10115
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10116
    "Created: / 14.11.1998 / 10:43:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10117
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10118
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10119
_VM_resumeJavaMonitor:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10120
    "/ void resumeJavaMonitor ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10121
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10122
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10123
    "Created: / 14.11.1998 / 10:42:49 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10124
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10125
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10126
_VM_suspendJavaMonitor:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10127
    "/ void suspendJavaMonitor ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10128
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10129
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10130
    "Created: / 14.11.1998 / 10:43:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10131
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10132
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10133
_VM_threadsSuspended:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10134
    "/ boolean threadsSuspended ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10135
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10136
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10137
    "Created: / 12.11.1998 / 19:07:10 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10138
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10139
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10140
_VM_unsuspendSomeThreads:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10141
    "/ void unsuspendSomeThreads ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10142
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10143
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10144
    "Created: / 12.11.1998 / 19:07:29 / cg"
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
_VM_unsuspendThreads:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10148
    "/ void unsuspendThreads ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10149
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10150
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10151
    "Created: / 12.11.1998 / 19:07:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10152
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10153
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10154
_VM_writeJavaMonitorReport:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10155
    "/ void writeJavaMonitorReport ()
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10156
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10157
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10158
    "Created: / 14.11.1998 / 10:43:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10159
!
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10160
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10161
_WButtonPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10162
    |jButtonPeer jButton jFrame frame button
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10163
     lbl|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10164
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10165
    jButtonPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10166
    jButton := jButtonPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10167
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10168
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10169
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10170
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10171
    button := Button in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10172
    button sizeFixed:true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10173
    button action:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10174
			jButtonPeer perform:#'handleAction()V'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10175
		  ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10176
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10177
    lbl := jButton instVarNamed:'label'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10178
    lbl notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10179
	lbl := Java as_ST_String:lbl.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10180
	button label:lbl
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10181
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10182
    self createdWindowsView:button for:jButtonPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10183
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10184
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10185
	'WButtonPeer_create: ' print. frame print. ' -> ' print. button printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10186
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10187
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10188
    "Created: / 5.1.1998 / 01:53:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10189
    "Modified: / 11.12.1998 / 00:19:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10190
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10191
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10192
_WButtonPeer_setLabel:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10193
    |label jString|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10194
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10195
    jString := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10196
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10197
    label := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10198
    label label:(Java as_ST_String:jString)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10199
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10200
    "Modified: / 8.1.1998 / 17:35:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10201
    "Created: / 1.2.1998 / 17:05:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10202
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10203
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10204
_WCanvasPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10205
    |jCanvasPeer jFrame frame subView|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10206
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10207
    jCanvasPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10208
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10209
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10210
    jFrame isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10211
	self halt:'no frame in canvasPeer create'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10212
	subView := JavaView new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10213
"/        self internalError:'no frame in canvasPeer create'.     
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10214
"/        ^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10215
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10216
	frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10217
	subView := JavaView in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10218
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10219
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10220
    subView delegate:self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10221
    subView javaPeer:jCanvasPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10222
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10223
    self createdWindowsView:subView for:jCanvasPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10224
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10225
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10226
	'WCanvasPeer_create: ' print. frame print. ' -> ' print. subView printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10227
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10228
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10229
    "Created: / 5.1.1998 / 00:59:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10230
    "Modified: / 16.1.1998 / 13:40:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10231
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10232
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10233
_WCheckboxMenuItemPeer_setState:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10234
    "/ void setState (boolean)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10235
"/    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10236
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10237
    "Created: / 12.11.1998 / 19:14:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10238
    "Modified: / 3.12.1998 / 21:41:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10239
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10240
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10241
_WCheckboxPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10242
    |jCheckboxPeer jCheckbox jFrame frame checkBox lbl|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10243
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10244
    jCheckboxPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10245
    jCheckbox := jCheckboxPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10246
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10247
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10248
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10249
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10250
    checkBox := CheckBox in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10251
    checkBox action:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10252
			jCheckboxPeer 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10253
			    perform:#'handleAction(Z)V' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10254
			    with:(checkBox isOn ifTrue:[1] ifFalse:[0])
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10255
		    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10256
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10257
    lbl := jCheckbox instVarNamed:'label'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10258
    lbl notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10259
	lbl := Java as_ST_String:lbl.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10260
	checkBox label:lbl
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10261
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10262
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10263
    self createdWindowsView:checkBox for:jCheckboxPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10264
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10265
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10266
	'WCheckboxPeer_create: ' print. frame print. ' -> ' print. checkBox printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10267
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10268
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10269
    "Created: / 7.1.1998 / 21:48:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10270
    "Modified: / 15.1.1998 / 12:27:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10271
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10272
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10273
_WCheckboxPeer_setCheckboxGroup:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10274
    |checkBox jGroup|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10275
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10276
    checkBox := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10277
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10278
    jGroup := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10279
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10280
    "Created: / 7.1.1998 / 21:48:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10281
    "Modified: / 25.1.1998 / 01:20:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10282
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10283
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10284
_WCheckboxPeer_setLabel:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10285
    "/ void setLabel (java.lang.String)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10286
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10287
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10288
    "Created: / 12.11.1998 / 19:14:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10289
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10290
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10291
_WCheckboxPeer_setState:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10292
    |checkBox state|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10293
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10294
    checkBox := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10295
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10296
    state := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10297
    state ~~ 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10298
	checkBox turnOn
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10299
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10300
	checkBox turnOff
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10301
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10302
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10303
    "Created: / 7.1.1998 / 21:49:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10304
    "Modified: / 25.1.1998 / 01:26:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10305
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10306
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10307
_WChoicePeer_addItem:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10308
    |jString index comboBox|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10309
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10310
    comboBox := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10311
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10312
    jString := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10313
    index := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10314
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10315
    comboBox model list addLast:(Java as_ST_String:jString).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10316
    comboBox model changed:#list.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10317
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10318
    "Created: / 7.1.1998 / 21:45:12 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10319
    "Modified: / 24.1.1998 / 18:51:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10320
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10321
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10322
_WChoicePeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10323
    |jChoicePeer jChoice jFrame frame comboBox|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10324
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10325
    jChoicePeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10326
    jChoice := jChoicePeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10327
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10328
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10329
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10330
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10331
    comboBox := ComboListView in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10332
    comboBox model:(SelectionInList new list:(OrderedCollection new)).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10333
    comboBox action:[:index | 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10334
			jChoicePeer 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10335
			    perform:#'handleAction(I)V' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10336
			    with:(comboBox model selectionIndex - 1)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10337
		    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10338
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10339
    self createdWindowsView:comboBox for:jChoicePeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10340
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10341
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10342
	'WChoicePeer_create: ' print. frame print. ' -> ' print. comboBox printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10343
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10344
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10345
    "Created: / 7.1.1998 / 21:44:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10346
    "Modified: / 28.1.1998 / 23:19:17 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10347
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10348
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10349
_WChoicePeer_remove:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10350
    "/ void remove (int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10351
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10352
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10353
    "Created: / 12.11.1998 / 19:12:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10354
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10355
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10356
_WChoicePeer_reshape:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10357
    self commonReshapeComponent:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10358
"/    self pReshape:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10359
    ^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10360
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10361
    "Created: / 7.1.1998 / 21:46:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10362
    "Modified: / 23.12.1998 / 19:08:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10363
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10364
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10365
_WChoicePeer_select:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10366
    |comboBox index|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10367
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10368
    comboBox := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10369
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10370
    index := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10371
    comboBox model selectionIndex:(index + 1).  "/ JAVA indexing starts at 0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10372
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10373
    "Created: / 7.1.1998 / 21:45:43 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10374
    "Modified: / 25.1.1998 / 09:55:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10375
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10376
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10377
_WClipboard_getClipboardText:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10378
    "/ java.lang.String getClipboardText ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10379
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10380
    |str|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10381
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10382
    str := Screen current rootView getTextSelection.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10383
    str isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10384
	str := ''.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10385
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10386
    ^ Java as_String:''.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10387
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10388
    "Modified: / 10.12.1998 / 21:28:29 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10389
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10390
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10391
_WClipboard_init:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10392
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10393
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10394
    "Modified: / 18.3.1997 / 18:43:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10395
    "Created: / 4.1.1998 / 19:03:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10396
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10397
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10398
_WClipboard_setClipboardText:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10399
    "/ void setClipboardText (java.awt.datatransfer.StringSelection)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10400
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10401
    |strSel data|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10402
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10403
    strSel := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10404
    data := strSel instVarNamed:'data'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10405
    data class == (Java at:'java.lang.String') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10406
	Screen current rootView setTextSelection:(Java as_ST_String:data)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10407
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10408
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10409
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10410
    "Created: / 12.11.1998 / 19:15:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10411
    "Modified: / 10.12.1998 / 21:25:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10412
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10413
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10414
_WColor_getDefaultColor:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10415
    |clrIndex jClr clr |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10416
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10417
    clrIndex := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10418
    "/ windows defaults:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10419
    "/  1: view background
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10420
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10421
    clrIndex == 1 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10422
	clr := View defaultViewBackgroundColor.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10423
	clr isColor ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10424
	    clr := Color gray:50.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10425
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10426
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10427
    clrIndex == 2 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10428
	clr := Color black.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10429
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10430
    clr isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10431
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10432
	self internalError:'breakpoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10433
	^ nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10434
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10435
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10436
    clr := clr on:(Screen current).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10437
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10438
    jClr := (Java classForName:'java.awt.Color') new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10439
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10440
    jClr instVarNamed:'pData' put:clr.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10441
    jClr instVarNamed:'value' put:(clr rgbValue).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10442
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10443
    ^ jClr.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10444
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10445
    "Created: / 15.8.1997 / 15:38:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10446
    "Modified: / 4.1.1998 / 18:06:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10447
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10448
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10449
_WComponentPeer__beginValidate:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10450
    "/ void _beginValidate ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10451
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10452
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10453
    "Created: / 12.11.1998 / 19:10:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10454
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10455
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10456
_WComponentPeer__dispose:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10457
    |view jPeer|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10458
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10459
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10460
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10461
    Object errorSignal catch:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10462
	view destroy.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10463
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10464
    JavaWindowGroup removeView:view.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10465
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10466
    jPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10467
    jPeer instVarNamed:'pData' put:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10468
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10469
    "Created: / 7.1.1998 / 22:36:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10470
    "Modified: / 25.1.1998 / 16:43:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10471
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10472
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10473
_WComponentPeer__setBackground:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10474
    |rgb clr view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10475
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10476
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10477
    view isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10478
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10479
    rgb := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10480
    clr := Color rgbValue:rgb.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10481
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10482
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10483
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10484
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10485
    clr := clr on:(view device).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10486
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10487
"/    (view superView isMemberOf:JavaEmbeddedFrameView) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10488
"/        view viewBackground:(view superView viewBackground).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10489
"/        view backgroundPaint:(view superView viewBackground).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10490
"/    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10491
"/        (view isMemberOf:JavaView) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10492
"/            view viewBackground:clr.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10493
"/            view backgroundPaint:clr.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10494
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10495
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10496
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10497
    (view isKindOf:ScrollableView) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10498
	view := view scrolledView
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10499
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10500
    view viewBackground:clr.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10501
    view backgroundPaint:clr.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10502
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10503
    "Created: / 4.1.1998 / 18:07:39 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10504
    "Modified: / 4.12.1998 / 17:26:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10505
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10506
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10507
_WComponentPeer__setForeground:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10508
    |rgb clr view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10509
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10510
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10511
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10512
    rgb := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10513
    clr := Color rgbValue:rgb.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10514
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10515
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10516
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10517
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10518
    clr := clr on:(view device).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10519
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10520
    view paint:clr.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10521
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10522
    "Created: / 4.1.1998 / 18:08:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10523
    "Modified: / 8.1.1998 / 17:32:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10524
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10525
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10526
_WComponentPeer_disable:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10527
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10528
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10529
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10530
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10531
    Object errorSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10532
    ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10533
	view disable
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10534
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10535
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10536
    "Created: / 6.1.1998 / 18:26:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10537
    "Modified: / 8.1.1998 / 17:32:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10538
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10539
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10540
_WComponentPeer_enable:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10541
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10542
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10543
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10544
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10545
    Object errorSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10546
    ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10547
	view enable
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10548
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10549
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10550
    "Modified: / 8.1.1998 / 17:32:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10551
    "Created: / 13.1.1998 / 23:08:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10552
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10553
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10554
_WComponentPeer_endValidate:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10555
    "/ void endValidate ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10556
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10557
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10558
    "Created: / 12.11.1998 / 19:10:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10559
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10560
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10561
_WComponentPeer_getLocationOnScreen:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10562
    "/ java.awt.Point getLocationOnScreen ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10563
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10564
    |view p jP|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10565
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10566
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10567
    view isNil ifTrue:[^ nil].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10568
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10569
    p := view originRelativeTo:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10570
    jP := (Java classForName:'java.awt.Point') basicNew.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10571
    jP instVarNamed:'x' put:p x.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10572
    jP instVarNamed:'y' put:p y.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10573
    ^ jP
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10574
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10575
    "Modified: / 5.12.1998 / 14:44:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10576
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10577
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10578
_WComponentPeer_handleEvent:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10579
    "this is invoked by java, to let a widget handle any event which
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10580
     was not consumed (eaten) by java.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10581
     If the view in question is some ST-widget, forward it.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10582
     Ignore for JavaViews."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10583
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10584
    |view jEv stEv ignore|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10585
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10586
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10587
    view notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10588
	jEv := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10589
	stEv := jEv instVarNamed:'data'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10590
	(stEv notNil and:[stEv ~~ 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10591
	    ignore := true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10592
	    view isJavaView ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10593
		ignore := false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10594
	    ] ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10595
		view isTopView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10596
		    stEv type == #terminate ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10597
			ignore := false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10598
		    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10599
		]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10600
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10601
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10602
	    ignore ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10603
		EventTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10604
		    ('JAVA: WComponent - handleEvent: ' , stEv type , ' for ' , view printString) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10605
		].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10606
		view dispatchEvent:stEv. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10607
		^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10608
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10609
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10610
	    EventTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10611
		('JAVA: WComponent - handleEvent ignored:' , stEv type) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10612
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10613
	    ^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10614
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10615
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10616
    EventTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10617
	('JAVA: WComponent - handleEvent ignored') infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10618
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10619
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10620
    "Created: / 6.1.1998 / 21:10:17 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10621
    "Modified: / 11.12.1998 / 01:04:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10622
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10623
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10624
_WComponentPeer_hide:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10625
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10626
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10627
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10628
"/ view isPopUpView ifTrue:[self halt].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10629
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10630
    Object errorSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10631
    ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10632
	view beInvisible
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10633
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10634
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10635
    "Created: / 7.1.1998 / 22:35:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10636
    "Modified: / 4.12.1998 / 17:53:41 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10637
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10638
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10639
_WComponentPeer_nativeHandleEvent:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10640
    "this is invoked by java, to let a widget handle any event which
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10641
     was not consumed (eaten) by java.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10642
     If the view in question is some ST-widget, forward it.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10643
     Ignore for JavaViews."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10644
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10645
    |view jEv stEv|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10646
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10647
^self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10648
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10649
    view notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10650
	(view isKindOf:JavaView) ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10651
	    jEv := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10652
	    stEv := jEv instVarNamed:'data'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10653
	    (stEv notNil and:[stEv ~~ 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10654
		EventTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10655
		    ('JAVA: WComponent - handleEvent: ' , stEv type , ' for ' , view printString) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10656
		].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10657
		stEv sendEventWithFocusOn:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10658
		^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10659
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10660
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10661
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10662
    EventTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10663
	('JAVA: WComponent - handleEvent ignored') infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10664
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10665
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10666
    "Created: / 19.10.1998 / 21:26:16 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10667
    "Modified: / 19.10.1998 / 23:26:37 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10668
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10669
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10670
_WComponentPeer_requestFocus:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10671
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10672
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10673
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10674
"/ 'getFocus - ' print. view displayString printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10675
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10676
"/    view getKeyboardFocus
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10677
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10678
    "Created: / 7.1.1998 / 22:30:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10679
    "Modified: / 4.12.1998 / 19:42:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10680
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10681
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10682
_WComponentPeer_reshape:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10683
    self commonReshapeComponent:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10684
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10685
    "Modified: / 18.3.1997 / 19:30:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10686
    "Created: / 4.1.1998 / 18:01:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10687
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10688
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10689
_WComponentPeer_setBackground:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10690
    |jClr rgb clr view|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10691
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10692
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10693
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10694
    jClr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10695
    rgb := jClr instVarNamed:'value'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10696
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10697
    clr := Color rgbValue:rgb.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10698
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10699
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10700
    clr := clr on:(view device).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10701
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10702
"/    (view superView isMemberOf:JavaEmbeddedFrameView) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10703
"/        view viewBackground:(view superView viewBackground).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10704
"/        view backgroundPaint:(view superView viewBackground).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10705
"/    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10706
"/        (view isMemberOf:JavaView) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10707
"/            view viewBackground:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10708
"/            view backgroundPaint:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10709
"/        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10710
"/    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10711
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10712
    (view isKindOf:ScrollableView) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10713
	view := view scrolledView
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10714
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10715
    view viewBackground:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10716
    view backgroundPaint:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10717
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10718
    "Created: / 16.10.1998 / 02:16:31 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10719
    "Modified: / 16.10.1998 / 02:26:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10720
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10721
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10722
_WComponentPeer_setCursor:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10723
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10724
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10725
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10726
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10727
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10728
    "Created: / 5.1.1998 / 01:52:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10729
    "Modified: / 25.1.1998 / 01:21:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10730
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10731
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10732
_WComponentPeer_setFont:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10733
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10734
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10735
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10736
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10737
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10738
    "Created: / 5.1.1998 / 00:55:17 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10739
    "Modified: / 25.1.1998 / 01:22:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10740
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10741
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10742
_WComponentPeer_setForeground:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10743
    |jClr rgb clr view|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10744
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10745
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10746
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10747
    jClr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10748
    rgb := jClr instVarNamed:'value'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10749
"/ self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10750
    clr := Color rgbValue:rgb.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10751
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10752
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10753
    clr := clr on:(view device).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10754
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10755
    (view isKindOf:ScrollableView) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10756
	view := view scrolledView
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10757
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10758
    view paint:clr.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10759
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10760
    "Created: / 16.10.1998 / 02:18:58 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10761
    "Modified: / 16.10.1998 / 02:26:37 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10762
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10763
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10764
_WComponentPeer_setZOrderPosition:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10765
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10766
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10767
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10768
"/    self unimplementedNativeMethod.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10769
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10770
"/ self internalError:'breakPoint'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10771
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10772
    "Created: / 4.1.1998 / 17:59:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10773
    "Modified: / 25.1.1998 / 01:22:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10774
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10775
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10776
_WComponentPeer_show:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10777
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10778
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10779
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10780
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10781
    "/ frame views are under my browsers own control
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10782
    (view isMemberOf:JavaEmbeddedFrameView) ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10783
	view beVisible.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10784
	view realize.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10785
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10786
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10787
"/    view windowGroup notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10788
"/        windowServer addGroup:(view windowGroup)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10789
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10790
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10791
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10792
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10793
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10794
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10795
    "Created: / 5.1.1998 / 01:26:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10796
    "Modified: / 4.12.1998 / 17:43:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10797
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10798
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10799
_WComponentPeer_start:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10800
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10801
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10802
    "Modified: / 18.3.1997 / 18:43:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10803
    "Created: / 5.1.1998 / 00:58:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10804
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10805
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10806
_WContainerPeer_calculateInsets:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10807
    "/ new with ns4.0 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10808
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10809
    "Created: / 16.10.1998 / 02:12:59 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10810
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 10811
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10812
_WDefaultFontCharset_canConvert:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10813
    ^ 1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10814
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10815
    "Modified: / 21.8.1997 / 15:56:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10816
    "Created: / 5.1.1998 / 01:55:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10817
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10818
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10819
_WDialogPeer__hide:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10820
    |dialog|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10821
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10822
    dialog := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10823
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10824
    dialog hide.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10825
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10826
    "Created: / 7.1.1998 / 22:34:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10827
    "Modified: / 8.1.1998 / 17:34:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10828
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10829
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10830
_WDialogPeer__show:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10831
    |dialog|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10832
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10833
    dialog := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10834
"/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10835
"/ show does not work (yet); must setup windowgroup
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10836
"/ for it to get events ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10837
"/    dialog realize.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10838
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10839
dialog show.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10840
"/dialog fixSize.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10841
"/dialog makeFullyVisible.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10842
"/dialog openModal:[true] inGroup:JavaWindowGroup
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10843
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10844
    "Created: / 7.1.1998 / 21:52:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10845
    "Modified: / 11.12.1998 / 14:43:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10846
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10847
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10848
_WDialogPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10849
    |jDialogPeer dialog|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10850
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10851
    jDialogPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10852
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10853
    dialog := ModalBox new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10854
    jDialogPeer instVarNamed:'pData' put:dialog.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10855
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10856
    self createdWindowsView:dialog for:jDialogPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10857
    dialog windowGroup:JavaWindowGroup.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10858
    JavaWindowGroup addTopView:dialog.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10859
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10860
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10861
	'WDialogPeer_create: ' print. dialog printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10862
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10863
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10864
    "Created: / 7.1.1998 / 21:51:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10865
    "Modified: / 15.1.1998 / 16:12:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10866
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10867
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10868
_WDrawingSurfaceInfo_getDepth:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10869
    "/ int getDepth ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10870
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10871
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10872
    "Created: / 12.11.1998 / 19:21:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10873
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10874
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10875
_WDrawingSurfaceInfo_getHBitmap:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10876
    "/ int getHBitmap ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10877
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10878
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10879
    "Created: / 12.11.1998 / 19:20:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10880
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10881
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10882
_WDrawingSurfaceInfo_getHDC:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10883
    "/ int getHDC ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10884
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10885
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10886
    "Created: / 12.11.1998 / 19:20:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10887
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10888
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10889
_WDrawingSurfaceInfo_getHPalette:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10890
    "/ int getHPalette ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10891
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10892
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10893
    "Created: / 12.11.1998 / 19:21:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10894
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10895
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10896
_WDrawingSurfaceInfo_getHWnd:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10897
    "/ int getHWnd ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10898
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10899
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10900
    "Created: / 12.11.1998 / 19:20:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10901
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10902
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10903
_WDrawingSurfaceInfo_getPBits:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10904
    "/ int getPBits ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10905
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10906
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10907
    "Created: / 12.11.1998 / 19:20:41 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10908
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10909
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10910
_WDrawingSurfaceInfo_lock:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10911
    "/ int lock ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10912
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10913
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10914
    "Created: / 12.11.1998 / 19:20:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10915
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10916
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10917
_WDrawingSurfaceInfo_unlock:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10918
    "/ void unlock ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10919
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10920
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10921
    "Created: / 12.11.1998 / 19:20:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10922
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10923
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10924
_WEmbeddedFramePeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10925
    "/ void create (sun.awt.windows.WComponentPeer)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10926
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10927
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10928
    "Created: / 12.11.1998 / 19:16:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10929
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10930
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10931
_WFileDialogPeer_show:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10932
    |jDialogPeer jDialog dialogView stDialog 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10933
     title dir pattern f|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10934
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10935
    jDialogPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10936
    jDialog := jDialogPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10937
    dialogView := jDialogPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10938
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10939
    stDialog := FileSelectionBox new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10940
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10941
    dir := jDialog instVarNamed:'dir'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10942
    dir notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10943
	stDialog directory:(Java as_ST_String:dir).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10944
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10945
    pattern := jDialog instVarNamed:'file'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10946
    pattern notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10947
	stDialog pattern:(Java as_ST_String:pattern).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10948
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10949
    title := jDialog instVarNamed:'title'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10950
    title notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10951
	stDialog title:(Java as_ST_String:title).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10952
	stDialog label:(Java as_ST_String:title).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10953
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10954
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10955
    stDialog show.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10956
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10957
    stDialog accepted ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10958
	f := stDialog pathName.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10959
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10960
	"/ cannot use the one below - it has a builtIn fileSeparator if '\' (sigh)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10961
	"/ jDialogPeer perform:#'handleSelected(Ljava/lang/String;)V' with:(Java as_String:f).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10962
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10963
	jDialog 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10964
	    perform:#'setFile(Ljava/lang/String;)V' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10965
	    with:(Java as_String:(f asFilename baseName)).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10966
	jDialog 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10967
	    perform:#'setDirectory(Ljava/lang/String;)V'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10968
	    with:(Java as_String:(f asFilename directoryName , Filename separator asString)).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10969
	jDialog 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10970
	    perform:#'setVisible(Z)V'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10971
	    with:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10972
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10973
	jDialogPeer 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10974
	    perform:#'handleCancel()V'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10975
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10976
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10977
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10978
    "Created: / 7.1.1998 / 22:38:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10979
    "Modified: / 15.1.1998 / 13:04:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10980
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10981
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10982
_WFontMetrics_bytesWidth:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10983
    "/ int bytesWidth (byte[] int int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10984
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10985
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10986
    "Created: / 12.11.1998 / 19:11:46 / 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
_WFontMetrics_getMFCharSegmentWidth:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10990
    "get multi-font string-segment width.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10991
     Not yet supported - use standard strings width"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10992
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10993
    |jMetrics jFont jFontDescr stFont w
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10994
     bool1 cp offs lenght bp int1|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10995
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10996
    jMetrics := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10997
    jFont := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10998
    jFontDescr := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 10999
    bool1 := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11000
    cp := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11001
    offs := nativeContext argAt:5.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11002
    lenght := nativeContext argAt:6.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11003
    bp := nativeContext argAt:7.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11004
    int1 := nativeContext argAt:8.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11005
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11006
    stFont := jFont instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11007
    (stFont isNil or:[stFont == 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11008
	self halt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11009
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11010
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11011
    stFont device isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11012
	stFont := stFont on:Display.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11013
	jFont instVarNamed:'pData' put:stFont.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11014
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11015
    w := stFont widthOf:cp from:offs+1 to:offs+lenght.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11016
    ^ w.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11017
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11018
    "Created: / 5.1.1998 / 01:57:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11019
    "Modified: / 13.1.1998 / 23:44:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11020
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11021
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11022
_WFontMetrics_init:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11023
    |jMetrics jFont stFont widths family name style size|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11024
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11025
    jMetrics := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11026
    jFont := jMetrics instVarNamed:'font'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11027
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11028
    family := jFont instVarNamed:'family'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11029
    family := Java as_ST_String:family.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11030
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11031
    name := jFont instVarNamed:'name'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11032
    name := Java as_ST_String:name.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11033
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11034
    style := jFont instVarNamed:'style'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11035
    size := jFont instVarNamed:'size'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11036
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11037
    stFont := Font family:family size:size.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11038
    stFont isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11039
        stFont := Font family:'helvetica' size:size.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11040
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11041
    stFont := stFont on:Display.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11042
self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11043
"/    stFont := jFont instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11044
"/    stFont isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11045
"/        self halt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11046
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11047
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11048
    stFont := stFont on:Display.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11049
    jFont instVarNamed:'pData' put:stFont.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11050
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11051
    jMetrics instVarNamed:'ascent'     put:stFont ascent.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11052
    jMetrics instVarNamed:'descent'    put:stFont descent.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11053
    jMetrics instVarNamed:'leading'    put:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11054
    jMetrics instVarNamed:'height'     put:stFont height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11055
    jMetrics instVarNamed:'maxAscent'  put:stFont maxAscent.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11056
    jMetrics instVarNamed:'maxDescent' put:stFont maxDescent.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11057
    jMetrics instVarNamed:'maxHeight'  put:stFont maxHeight.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11058
    jMetrics instVarNamed:'maxAdvance' put:stFont maxWidth.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11059
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11060
    widths := Array new:256.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11061
    0 to:255 do:[:i |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11062
        widths at:(i+1) put:(stFont widthOf:(Character value:i))
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11063
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11064
    jMetrics instVarNamed:'widths' put:widths.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11065
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11066
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11067
    "Modified: / 8.8.1997 / 12:06:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11068
    "Created: / 5.1.1998 / 01:54:29 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11069
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11070
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11071
_WFontMetrics_needsConversion:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11072
    |jFont jFontDescr stFont|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11073
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11074
    jFont := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11075
    jFontDescr := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11076
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11077
    stFont := jFont instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11078
"/    stFont isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11079
"/        self halt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11080
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11081
"/    stFont device isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11082
"/        stFont := stFont on:Display.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11083
"/        jFont instVarNamed:'pData' put:stFont.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11084
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11085
"/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11086
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11087
    ^ 0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11088
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11089
    "Modified: / 17.8.1997 / 17:16:29 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11090
    "Created: / 5.1.1998 / 01:56:42 / cg"
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
_WFramePeer__setIconImage:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11094
    |frame imgRep image|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11095
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11096
    frame := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11097
    imgRep := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11098
    imgRep notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11099
	image := imgRep instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11100
	(image notNil and:[image ~~ 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11101
	    frame icon:image.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11102
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11103
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11104
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11105
    "Created: / 27.4.1998 / 17:15:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11106
    "Modified: / 27.4.1998 / 17:18:24 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11107
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11108
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11109
_WFramePeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11110
    |jFramePeer jFrame top frame pDataIdx|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11111
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11112
    jFramePeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11113
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11114
    "/ for now: a kludge to create an embedded frame for
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11115
    "/ mozillaFrames
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11116
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11117
    jFrame := jFramePeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11118
    (jFrame notNil 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11119
    and:[(pDataIdx := jFrame class instVarOffsetOf:'pData') notNil])
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11120
    ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11121
	((frame := jFrame instVarAt:pDataIdx) notNil 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11122
	and:[frame ~~ 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11123
	    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11124
		'JAVA: targetFrame view already created: ' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11125
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11126
	    "/ sigh; pData was renamed to pNativeWidget in jdk1.2 ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11127
	    pDataIdx := jFramePeer class instVarOffsetOf:'pNativeWidget'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11128
	    pDataIdx isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11129
		"/ ok, we are < 1.2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11130
		pDataIdx := jFramePeer class instVarOffsetOf:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11131
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11132
	    jFramePeer instVarAt:pDataIdx put:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11133
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11134
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11135
	frame := jFramePeer instVarNamed:'pData'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11136
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11137
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11138
    (frame notNil and:[frame ~~ 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11139
	WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11140
	    'JAVA: frame view already created: ' infoPrint.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11141
	    jFramePeer class name infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11142
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11143
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11144
"/ OLD
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11145
"/        frame := StandardSystemView new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11146
"/        self createdWindowsView:frame for:jFramePeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11147
"/        JavaWindowGroup addTopView:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11148
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11149
	frame := JavaTopView new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11150
	frame delegate:self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11151
	frame javaPeer:jFramePeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11152
	self createdWindowsView:frame for:jFramePeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11153
	JavaWindowGroup addTopView:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11154
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11155
"/        top := StandardSystemView new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11156
"/        frame := JavaView origin:0.0@0.0 corner:1.0@1.0 in:top.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11157
"/        frame delegate:self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11158
"/        frame javaPeer:jFramePeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11159
"/        self createdWindowsView:frame for:jFramePeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11160
"/        JavaWindowGroup addTopView:top.
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
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11164
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11165
	'JAVA: WFramePeer_create: ' print. jFramePeer displayString print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11166
	' frame: ' print. frame printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11167
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11168
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11169
    "Created: / 4.1.1998 / 17:56:39 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11170
    "Modified: / 3.12.1998 / 00:10:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11171
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11172
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11173
_WFramePeer_setMenuBar0:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11174
    |frame jMenuBarPeer menuPanel|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11175
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11176
    frame := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11177
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11178
    jMenuBarPeer := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11179
    jMenuBarPeer isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11180
	"/ mhmh - JAVA wants to remove the frames menuPanel.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11181
	"/ but I have no handle on it (for destroy).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11182
	"/ search it in subViews of the frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11183
	frame subViews copy do:[:v |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11184
	    (v isKindOf:MenuPanel) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11185
		v destroy
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
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11189
	menuPanel := jMenuBarPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11190
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11191
	menuPanel origin:0.0@0.0 corner:1.0@(menuPanel preferredExtent y).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11192
	frame addSubView:menuPanel.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11193
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11194
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11195
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11196
    "Created: / 7.1.1998 / 21:41:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11197
    "Modified: / 8.1.1998 / 17:35:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11198
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11199
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11200
_WFramePeer_setResizable:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11201
    |view onOff|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11202
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11203
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11204
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11205
    onOff := (nativeContext argAt:1) == 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11206
    view isTopView ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11207
	onOff ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11208
	    view minExtent:10@10.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11209
	    view maxExtent:(Screen current extent).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11210
	] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11211
	    view minExtent:view extent.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11212
	    view maxExtent:view extent.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11213
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11214
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11215
	(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11216
	    self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11217
	]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11218
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11219
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11220
"/ 'JAVA: WWindowPeer_setResizable: ' print. view print. ' yes/no: ' print. onOff printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11221
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11222
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11223
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11224
    "Modified: / 16.1.1998 / 18:08:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11225
    "Created: / 16.10.1998 / 02:21:34 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11226
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11227
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11228
_WFramePeer_setTitle:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11229
    |view jString string|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11230
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11231
    view := self viewForWPeer:nativeContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11232
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11233
    jString := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11234
    string := Java as_ST_String:jString.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11235
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11236
"/ 'JAVA: WFramePeer_pSetTitle: ' print. string print. ' ' print. view printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11237
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11238
    view label:string.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11239
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11240
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11241
    "Modified: / 8.1.1998 / 17:37:41 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11242
    "Created: / 27.1.1998 / 21:42:57 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11243
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 11244
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11245
_WGraphics__dispose:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11246
    "/ void _dispose()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11247
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11248
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11249
    "Created: / 12.11.1998 / 19:17:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11250
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11251
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11252
_WGraphics_changeClip:nativeContext        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11253
    |gc x y w h r bool|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11254
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11255
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11256
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11257
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11258
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11259
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11260
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11261
    bool := (nativeContext argAt:5) ~~ 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11262
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11263
    r := Rectangle left:x top:y width:w height:h.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11264
"/ 'WGraphics_changeClip: ' infoPrint. r infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11265
    gc clippingRectangle:r.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11266
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11267
    "Created: / 6.1.1998 / 20:57:21 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11268
    "Modified: / 20.10.1998 / 19:40:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11269
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11270
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11271
_WGraphics_clearRect:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11272
    |gc x y w h|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11273
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11274
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11275
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11276
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11277
    gc realized ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11278
	'JAVA: drawing on unrealized gc - ignored' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11279
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11280
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11281
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11282
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11283
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11284
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11285
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11286
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11287
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11288
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11289
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11290
    gc clearRectangleX:x y:y width:w height:h.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11291
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11292
    "Created: / 8.1.1998 / 00:16:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11293
    "Modified: / 8.1.1998 / 00:21:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11294
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11295
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11296
_WGraphics_close:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11297
    "/ void close (sun.awt.windows.WPrintJob)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11298
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11299
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11300
    "Created: / 12.11.1998 / 19:19:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11301
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11302
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11303
_WGraphics_copyArea:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11304
    |gc srcX srcY w h deltaX deltaY|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11305
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11306
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11307
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11308
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11309
    gc realized ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11310
	'JAVA: copyArea on unrealized gc - ignored' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11311
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11312
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11313
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11314
    srcX := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11315
    srcY := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11316
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11317
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11318
    deltaX := nativeContext argAt:5.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11319
    deltaY := nativeContext argAt:6.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11320
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11321
    gc
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11322
	copyFrom:gc
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11323
	x:srcX y:srcY 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11324
	toX:srcX+deltaX y:srcY+deltaY 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11325
	width:w height:h
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11326
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11327
    "Created: / 8.1.1998 / 00:16:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11328
    "Modified: / 9.4.1998 / 22:01:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11329
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11330
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11331
_WGraphics_createFromComponent:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11332
    |jGraphics jWin view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11333
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11334
    jGraphics := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11335
    jWin := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11336
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11337
    view := KnownWindows at:jWin ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11338
    view isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11339
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11340
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11341
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11342
    view clippingRectangle:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11343
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11344
"/    "/ just a consistency check ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11345
"/    (jWin instVarNamed:'xid') ~~ view ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11346
"/        self halt:'consistency check'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11347
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11348
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11349
    jGraphics instVarNamed:'pData' put:view.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11350
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11351
    "Created: / 6.1.1998 / 20:55:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11352
    "Modified: / 20.10.1998 / 19:38:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11353
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11354
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11355
_WGraphics_createFromGraphics:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11356
    |jGraphics graphics gc|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11357
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11358
    jGraphics := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11359
    graphics := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11360
    gc := graphics instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11361
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11362
    jGraphics instVarNamed:'pData' put:gc.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11363
    gc clippingRectangle:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11364
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11365
    "Created: / 8.1.1998 / 00:47:39 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11366
    "Modified: / 20.10.1998 / 19:37:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11367
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11368
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11369
_WGraphics_createFromHDC:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11370
    "/ void createFromHDC (int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11371
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11372
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11373
    "Created: / 12.11.1998 / 19:17:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11374
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11375
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11376
_WGraphics_createFromPrintJob:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11377
    "/ void createFromPrintJob (sun.awt.windows.WPrintJob)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11378
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11379
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11380
    "Created: / 12.11.1998 / 19:17:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11381
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11382
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11383
_WGraphics_dispose:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11384
    |gc|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11385
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11386
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11387
    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11388
    gc clippingRectangle:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11389
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11390
    "Created: / 6.1.1998 / 20:58:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11391
    "Modified: / 20.10.1998 / 19:35:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11392
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11393
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11394
_WGraphics_drawArc:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11395
    |gc x y w h startAngle endAngle|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11396
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11397
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11398
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11399
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11400
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11401
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11402
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11403
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11404
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11405
    startAngle := nativeContext argAt:5.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11406
    endAngle := nativeContext argAt:6.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11407
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11408
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11409
	'drawArc x/y= ' print. x print. '@' print. y print. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11410
	       ' w/h= ' print. w print. '@' print. h print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11411
	       ' startAngle= ' print. startAngle print. ' endAngle= ' print. endAngle printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11412
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11413
    gc 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11414
	displayArcX:x y:y 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11415
	width:w height:h 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11416
	from:startAngle angle:(endAngle - startAngle).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11417
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11418
    "Created: / 6.1.1998 / 21:00:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11419
    "Modified: / 28.1.1999 / 17:38:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11420
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11421
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11422
_WGraphics_drawBytes:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11423
    "/ void drawBytes (byte[] int int int int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11424
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11425
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11426
    "Created: / 12.11.1998 / 19:18:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11427
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11428
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11429
_WGraphics_drawLine:nativeContext        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11430
    |gc x y x2 y2|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11431
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11432
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11433
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11434
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11435
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11436
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11437
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11438
    x2 := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11439
    y2 := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11440
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11441
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11442
	'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
 11443
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11444
    gc displayLineFromX:x y:y toX:x2 y:y2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11445
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11446
    "Created: / 6.1.1998 / 20:59:27 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11447
    "Modified: / 8.1.1998 / 00:34:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11448
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11449
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11450
_WGraphics_drawMFCharsConvertedSegment:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11451
    "/ int drawMFCharsConvertedSegment (java.awt.Font sun.awt.FontDescriptor byte[] int int int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11452
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11453
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11454
    "Created: / 12.11.1998 / 19:18:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11455
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11456
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11457
_WGraphics_drawMFCharsSegment:nativeContext       
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11458
    |jFont jFontDescr s gc x y offs len|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11459
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11460
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11461
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11462
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11463
    jFont := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11464
    jFontDescr := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11465
    s := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11466
    offs := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11467
    len := nativeContext argAt:5.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11468
    x := nativeContext argAt:6.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11469
    y := nativeContext argAt:7.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11470
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11471
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11472
	'drawMFCharsSegment x/y= ' print. x print. '@' print. y print. ' s= ' print. s printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11473
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11474
    gc displayString:s from:offs+1 to:offs+len x:x y:y.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11475
    ^ (gc font onDevice:(gc graphicsDevice)) widthOf:s.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11476
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11477
    "Created: / 6.1.1998 / 21:01:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11478
    "Modified: / 25.1.1998 / 20:45:55 / 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
_WGraphics_drawOval:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11482
    |gc x y w h|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11483
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11484
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11485
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11486
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11487
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11488
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11489
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11490
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11491
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11492
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11493
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11494
	'drawOval x/y= ' print. x print. '@' print. y print. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11495
		' w/h= ' print. w print. '@' print. h printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11496
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11497
    gc displayArcX:x y:y width:w height:h from:0 angle:360.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11498
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11499
    "Created: / 8.1.1998 / 00:44:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11500
    "Modified: / 9.4.1998 / 22:10:23 / 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
_WGraphics_drawPolygon:nativeContext        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11504
    |gc xVector yVector count points|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11505
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11506
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11507
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11508
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11509
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11510
    xVector := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11511
    yVector := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11512
    count := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11513
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11514
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11515
	'drawPolgon' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11516
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11517
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11518
    points := (1 to:count) collect:[:i | (xVector at:i) @ (yVector at:i)].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11519
    gc displayPolygon:points
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11520
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11521
    "Created: / 8.1.1998 / 00:57:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11522
    "Modified: / 8.1.1998 / 00:57:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11523
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11524
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11525
_WGraphics_drawPolyline:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11526
    "/ void drawPolyline (int[] int[] int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11527
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11528
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11529
    "Created: / 12.11.1998 / 19:19:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11530
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11531
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11532
_WGraphics_drawRect:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11533
    |gc x y w h|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11534
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11535
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11536
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11537
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11538
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11539
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11540
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11541
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11542
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11543
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11544
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11545
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11546
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11547
    gc displayRectangleX:x y:y width:w height:h.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11548
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11549
    "Modified: / 8.1.1998 / 00:34:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11550
    "Created: / 8.1.1998 / 00:59:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11551
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11552
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11553
_WGraphics_drawRoundRect:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11554
    |gc x y w h|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11555
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11556
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11557
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11558
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11559
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11560
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11561
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11562
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11563
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11564
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11565
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11566
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11567
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11568
    gc displayRectangleX:x y:y width:w height:h.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11569
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11570
    "Modified: / 8.1.1998 / 00:34:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11571
    "Created: / 8.1.1998 / 00:59:26 / cg"
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
_WGraphics_drawSFChars:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11575
    "/ void drawSFChars (char[]s, int pos1, int len, int x, int y)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11576
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11577
    |gc str x y idx1 nChars|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11578
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11579
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11580
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11581
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11582
    str := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11583
    idx1 := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11584
    nChars := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11585
    x := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11586
    y := nativeContext argAt:5.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11587
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11588
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11589
	'drawSFChars x/y= ' print. x print. '@' print. y print. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11590
	       ' s= ' print. str printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11591
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11592
    gc displayString:str from:idx1+1 to:idx1+nChars x:x y:y
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11593
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11594
    "Created: / 6.1.1998 / 21:11:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11595
    "Modified: / 8.1.1998 / 00:33:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11596
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11597
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11598
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11599
_WGraphics_fillArc:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11600
    |gc x y w h startAngle endAngle|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11601
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11602
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11603
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11604
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11605
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11606
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11607
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11608
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11609
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11610
    startAngle := nativeContext argAt:5.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11611
    endAngle := nativeContext argAt:6.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11612
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11613
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11614
	'fillArc x/y= ' print. x print. '@' print. y print. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11615
	       ' w/h= ' print. w print. '@' print. h print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11616
	       ' startAngle= ' print. startAngle print. ' endAngle= ' print. endAngle printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11617
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11618
    gc fillArcX:x y:y width:w height:h from:startAngle angle:(endAngle - startAngle)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11619
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11620
    "Created: / 6.1.1998 / 21:11:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11621
    "Modified: / 8.1.1998 / 00:33:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11622
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11623
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11624
_WGraphics_fillOval:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11625
    |gc x y w h|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11626
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11627
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11628
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11629
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11630
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11631
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11632
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11633
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11634
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11635
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11636
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11637
	'drawOval x/y= ' print. x print. '@' print. y print. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11638
		' w/h= ' print. w print. '@' print. h printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11639
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11640
    gc fillArcX:x y:y width:w height:h from:0 angle:360
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11641
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11642
    "Created: / 8.1.1998 / 00:46:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11643
    "Modified: / 8.1.1998 / 00:46:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11644
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11645
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11646
_WGraphics_fillPolygon:nativeContext        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11647
    |gc xVector yVector count points|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11648
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11649
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11650
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11651
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11652
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11653
    xVector := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11654
    yVector := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11655
    count := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11656
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11657
    DrawOPTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11658
	'fillPolgon' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11659
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11660
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11661
    points := (1 to:count) collect:[:i | (xVector at:i) @ (yVector at:i)].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11662
    gc fillPolygon:points
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11663
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11664
    "Created: / 8.1.1998 / 00:58:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11665
    "Modified: / 25.1.1998 / 11:03:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11666
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11667
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11668
_WGraphics_fillRect:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11669
    |gc x y w h|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11670
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11671
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11672
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11673
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11674
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11675
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11676
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11677
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11678
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11679
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11680
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11681
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11682
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11683
    gc fillRectangleX:x y:y width:w height:h.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11684
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11685
    "Created: / 15.8.1997 / 15:43:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11686
    "Modified: / 8.1.1998 / 00:34:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11687
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11688
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11689
_WGraphics_fillRoundRect:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11690
    |gc x y w h|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11691
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11692
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11693
"/    gc isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11694
    gc realized ifFalse:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11695
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11696
    x := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11697
    y := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11698
    w := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11699
    h := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11700
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11701
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11702
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11703
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11704
    gc displayRectangleX:x y:y width:w height:h.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11705
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11706
    "Modified: / 8.1.1998 / 00:34:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11707
    "Created: / 8.1.1998 / 00:59:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11708
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11709
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11710
_WGraphics_getClipBounds:nativeContext        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11711
    |gc rect r x y w h|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11712
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11713
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11714
"/    gc isNil ifTrue:[^ nil].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11715
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11716
    rect := (Java classForName:'java.awt.Rectangle') basicNew.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11717
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11718
    (gc isMemberOf:JavaView) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11719
	"/ r := gc clippingRectangleOrNil. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11720
	r := gc getNextUpdateRectangle.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11721
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11722
    r isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11723
	r := gc clippingRectangleOrNil. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11724
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11725
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11726
    r isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11727
	x := y := 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11728
	w := (gc width).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11729
	h := (gc height).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11730
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11731
	x := (r left).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11732
	y := (r top).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11733
	w := (r width).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11734
	h := (r height).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11735
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11736
    rect instVarNamed:'x' put:x.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11737
    rect instVarNamed:'y' put:y.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11738
    rect instVarNamed:'width' put:w.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11739
    rect instVarNamed:'height' put:h.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11740
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11741
"/ 'WGraphics__getClipBounds ' infoPrint. (x@y extent:w@h) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11742
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11743
    ^ rect
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11744
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11745
    "Created: / 6.1.1998 / 20:58:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11746
    "Modified: / 23.12.1998 / 20:14:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11747
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11748
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11749
_WGraphics_imageCreate:nativeContext        
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11750
    |jGraphics imgRep|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11751
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11752
    jGraphics := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11753
    imgRep := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11754
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11755
    jGraphics instVarNamed:'pData' put:(imgRep instVarNamed:'pData').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11756
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11757
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11758
    "Created: / 11.1.1998 / 16:34:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11759
    "Modified: / 17.1.1998 / 12:37:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11760
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11761
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11762
_WGraphics_pSetFont:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11763
    |gc jFont stFont|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11764
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11765
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11766
    jFont := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11767
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11768
    stFont := jFont instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11769
    (stFont isNil or:[stFont == 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11770
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11771
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11772
	gc font:stFont
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11773
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11774
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11775
    "Created: / 6.1.1998 / 20:56:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11776
    "Modified: / 15.1.1998 / 12:31:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11777
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11778
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11779
_WGraphics_pSetForeground:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11780
    |gc rgb clr|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11781
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11782
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11783
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11784
    rgb := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11785
    rgb isInteger ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11786
        "/ its a java.awt.Color
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11787
        rgb := rgb instVarNamed:'value'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11788
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11789
    clr := Color rgbValue:rgb.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11790
    gc paint:(clr nearestOn:gc device).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11791
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11792
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11793
"/ self internalError:'breakPoint'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11794
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11795
    "Created: / 6.1.1998 / 20:56:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11796
    "Modified: / 23.12.1998 / 20:10:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11797
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11798
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11799
_WGraphics_print:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11800
    "/ void print (sun.awt.windows.WComponentPeer)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11801
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11802
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11803
    "Created: / 12.11.1998 / 19:19:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11804
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11805
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11806
_WGraphics_removeClip:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11807
    "/ void removeClip ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11808
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11809
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11810
    "Created: / 12.11.1998 / 19:18:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11811
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11812
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11813
_WGraphics_setPaintMode:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11814
    |gc|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11815
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11816
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11817
    gc function:#copy.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11818
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11819
    true "DrawOPTrace" ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11820
	'copyMode' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11821
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11822
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11823
    "Created: / 8.1.1998 / 00:33:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11824
    "Modified: / 28.1.1998 / 23:25:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11825
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11826
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11827
_WGraphics_setXORMode:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11828
    |gc jColor rgb invColor device|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11829
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11830
    gc := self gcForWGraphics:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11831
    jColor := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11832
    device := gc graphicsDevice.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11833
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11834
"/    "/ on trueColor systems, use the provided
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11835
"/    "/ rgb value for inverting.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11836
"/    "/ on palette systems, use white ^ black
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11837
"/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11838
"/    device visualType == #TrueColor ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11839
"/        rgb := jColor instVarNamed:'value'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11840
"/        rgb := rgb bitAnd:16rFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11841
"/        rgb == 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11842
"/            rgb := 16rFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11843
"/        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11844
"/        invColor := rgb
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11845
"/    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11846
"/        invColor := device blackpixel bitXor:device whitepixel.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11847
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11848
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11849
    invColor := device blackpixel bitXor:device whitepixel.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11850
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11851
"/    gc foreground:(Color colorId:invColor)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11852
"/       background:device blackColor.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11853
    device 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11854
	setForeground:invColor background:0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11855
	in:gc gcId.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11856
    gc function:#xor.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11857
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11858
    true "DrawOPTrace" ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11859
	'xorMode' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11860
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11861
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11862
    "Created: / 8.1.1998 / 00:36:17 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11863
    "Modified: / 28.1.1998 / 23:45:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11864
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11865
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11866
_WLabelPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11867
    |jLabelPeer jLabel jFrame frame label
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11868
     lbl|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11869
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11870
    jLabelPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11871
    jLabel := jLabelPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11872
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11873
    lbl := jLabel instVarNamed:'text'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11874
    lbl notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11875
	lbl := Java as_ST_String:lbl
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11876
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11877
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11878
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11879
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11880
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11881
    label := Label in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11882
    label sizeFixed:true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11883
    lbl notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11884
	label label:lbl
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11885
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11886
    self createdWindowsView:label for:jLabelPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11887
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11888
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11889
	'WLabelPeer_create: ' print. frame print. ' -> ' print. label printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11890
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11891
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11892
    "Created: / 7.1.1998 / 21:42:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11893
    "Modified: / 13.1.1998 / 22:10:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11894
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11895
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11896
_WLabelPeer_setAlignment:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11897
    |label alignNr|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11898
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11899
    alignNr := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11900
    label := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11901
    label notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11902
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11903
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11904
    "Created: / 7.1.1998 / 21:43:12 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11905
    "Modified: / 8.1.1998 / 17:35:29 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11906
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11907
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11908
_WLabelPeer_setText:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11909
    |label jString str|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11910
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11911
    jString := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11912
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11913
    label := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11914
    jString notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11915
	str := Java as_ST_String:jString
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11916
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11917
    label label:str
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11918
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11919
    "Created: / 7.1.1998 / 21:43:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11920
    "Modified: / 3.12.1998 / 14:59:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11921
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11922
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11923
_WListPeer__addItem:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11924
    |jString index1 length selListView m|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11925
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11926
    selListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11927
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11928
    jString := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11929
    index1 := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11930
    length := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11931
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11932
    (m := selListView model) notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11933
	m list addLast:(Java as_ST_String:jString).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11934
	m changed:#list.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11935
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11936
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11937
    "Created: / 26.10.1998 / 20:11:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11938
    "Modified: / 14.11.1998 / 01:21:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11939
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11940
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11941
_WListPeer_addItem:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11942
    |jString index selListView m|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11943
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11944
    selListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11945
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11946
    jString := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11947
    index := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11948
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11949
    m := selListView model.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11950
    m isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11951
	Transcript showCR:'JAVA: access to listModel of closed view'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11952
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11953
	m list addLast:(Java as_ST_String:jString).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11954
	m changed:#list.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11955
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11956
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11957
    "Created: / 24.1.1998 / 21:10:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11958
    "Modified: / 2.11.1998 / 17:12:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11959
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11960
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11961
_WListPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11962
    |jListPeer jFrame frame selectionInListView|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11963
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11964
    jListPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11965
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11966
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11967
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11968
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11969
    selectionInListView := ScrollableView for:SelectionInListView in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11970
    selectionInListView action:[:index | jListPeer perform:#'handleListChanged(I)V' with:(index - 1)].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11971
    selectionInListView doubleClickAction:[:index | jListPeer perform:#'handleAction(I)V' with:(index - 1)].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11972
    selectionInListView model:(SelectionInList new list:(List new)).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11973
    selectionInListView useIndex:true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11974
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11975
    self createdWindowsView:selectionInListView for:jListPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11976
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11977
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11978
	'WTextAreaPeer_create: ' print. frame print. ' -> ' print. selectionInListView printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11979
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11980
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11981
    "Created: / 24.1.1998 / 19:58:54 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11982
    "Modified: / 9.4.1998 / 22:19:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11983
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11984
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11985
_WListPeer_delItems:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11986
    |jString index1 index2 selListView model list|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11987
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11988
    selListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11989
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11990
    index1 := (nativeContext argAt:1) + 1. "/ java indices are 0-based.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11991
    index2 := (nativeContext argAt:2) + 1. "/ st indices are 1-based.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11992
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11993
    model := selListView model.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11994
    model isNil ifTrue:[^ self].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11995
    list := model list.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11996
    list size >= index1 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11997
	list removeFromIndex:index1 toIndex:(index2 min:list size).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11998
	model changed:#list.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 11999
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12000
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12001
    "Created: / 9.4.1998 / 22:19:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12002
    "Modified: / 30.12.1998 / 20:00:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12003
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12004
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12005
_WListPeer_deselect:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12006
    "/ void deselect (int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12007
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12008
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12009
    "Created: / 12.11.1998 / 19:15:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12010
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12011
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12012
_WListPeer_getMaxWidth:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12013
    "/ int getMaxWidth ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12014
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12015
    ^ 1000 "/ a dummy value
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12016
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12017
"/    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12018
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12019
    "Created: / 14.11.1998 / 10:44:29 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12020
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12021
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12022
_WListPeer_isSelected:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12023
    |selectionInListView index model|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12024
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12025
    selectionInListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12026
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12027
    index := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12028
    (model := selectionInListView model) notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12029
	(model selectionIndex == (index + 1))  "/ JAVA indexing starts at 0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12030
	ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12031
	    ^ 1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12032
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12033
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12034
    ^ 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12035
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12036
    "Created: / 24.1.1998 / 22:42:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12037
    "Modified: / 25.1.1998 / 01:35:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12038
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12039
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12040
_WListPeer_makeVisible:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12041
    |selectionInListView lineNr|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12042
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12043
    selectionInListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12044
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12045
    lineNr := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12046
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12047
    selectionInListView makeLineVisible:(lineNr + 1)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12048
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12049
    "Modified: / 24.1.1998 / 20:01:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12050
    "Created: / 20.10.1998 / 14:14:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12051
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12052
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12053
_WListPeer_select:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12054
    |selectionInListView index model|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12055
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12056
    selectionInListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12057
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12058
    index := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12059
    (model := selectionInListView model) notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12060
	model selectionIndex:(index + 1).  "/ JAVA indexing starts at 0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12061
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12062
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12063
    "Created: / 24.1.1998 / 22:32:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12064
    "Modified: / 25.1.1998 / 01:28:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12065
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12066
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12067
_WListPeer_setMultipleSelections:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12068
    |selectionInListView onOff|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12069
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12070
    selectionInListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12071
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12072
    onOff := (nativeContext argAt:1) ~~ 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12073
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12074
    selectionInListView multipleSelectOk:onOff.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12075
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12076
    "Modified: / 24.1.1998 / 20:01:06 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12077
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12078
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12079
_WListPeer_updateMaxItemWidth:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12080
    |selectionInListView lineNr|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12081
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12082
    selectionInListView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12083
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12084
    "Created: / 26.10.1998 / 20:09:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12085
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12086
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12087
_WMenuBarPeer_addMenu:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12088
    "/ void addMenu (java.awt.Menu)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12089
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12090
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12091
    "Created: / 12.11.1998 / 19:14:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12092
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12093
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12094
_WMenuBarPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12095
    |jMenuBarPeer jMenuBar jFrame frame menuBar|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12096
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12097
    jMenuBarPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12098
    jMenuBar := jMenuBarPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12099
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12100
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12101
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12102
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12103
    menuBar := MenuPanel in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12104
    menuBar verticalLayout:false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12105
    menuBar realize.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12106
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12107
    self createdWindowsView:menuBar for:jMenuBarPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12108
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12109
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12110
	'WMenuBarPeer_create: ' print. frame print. ' -> ' print. menuBar printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12111
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12112
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12113
    "Created: / 7.1.1998 / 21:38:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12114
    "Modified: / 25.1.1998 / 13:19:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12115
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12116
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12117
_WMenuBarPeer_delMenu:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12118
    "/ void delMenu (int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12119
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12120
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12121
    "Created: / 12.11.1998 / 19:14:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12122
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12123
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12124
_WMenuItemPeer__dispose:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12125
    |jMenuItemPeer item|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12126
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12127
    jMenuItemPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12128
    item := jMenuItemPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12129
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12130
"/ what should be done here ?
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12131
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12132
    "Created: / 29.3.1998 / 17:16:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12133
    "Modified: / 29.3.1998 / 17:16:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12134
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12135
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12136
_WMenuItemPeer__setLabel:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12137
    "/ void _setLabel (java.lang.String)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12138
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12139
    |jMenuItemPeer item label|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12140
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12141
    jMenuItemPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12142
    item := jMenuItemPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12143
    (item isNil or:[item == 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12144
	'JAVA [warning]: NULL menu item in setLabel' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12145
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12146
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12147
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12148
    label := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12149
    label isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12150
	label := ''
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12151
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12152
	label := Java as_ST_String:label
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12153
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12154
    item label:label.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12155
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12156
    "Modified: / 11.12.1998 / 16:40:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12157
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12158
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12159
_WMenuItemPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12160
    |jMenuItemPeer jMenuItem jMenuPeer menu item lbl|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12161
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12162
    jMenuItemPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12163
    jMenuItem := jMenuItemPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12164
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12165
    jMenuPeer := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12166
    menu := jMenuPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12167
    (menu isNil or:[menu == 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12168
	'JAVA: no menu to create item in' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12169
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12170
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12171
    item := menu createAtIndex:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12172
    item value:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12173
		jMenuItemPeer perform:#'handleAction(I)V' with:0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12174
	       ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12175
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12176
    lbl := jMenuItem instVarNamed:'label'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12177
    lbl notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12178
	lbl := Java as_ST_String:lbl.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12179
	item label:lbl
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12180
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12181
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12182
    jMenuItemPeer instVarNamed:'pData' put:item.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12183
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12184
    WindowOPTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12185
	'WMenuItem_create: ' print. menu print. ' -> ' print. item printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12186
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12187
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12188
    "Created: / 7.1.1998 / 21:40:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12189
    "Modified: / 3.12.1998 / 20:43:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12190
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12191
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12192
_WMenuItemPeer_enable:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12193
    |jMenuItemPeer item state|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12194
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12195
    jMenuItemPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12196
    item := jMenuItemPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12197
    (item isNil or:[item == 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12198
	'JAVA [warning]: NULL menu item in enable' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12199
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12200
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12201
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12202
    state := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12203
    item enabled:(state ~~ 0)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12204
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12205
    "Created: / 7.1.1998 / 22:41:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12206
    "Modified: / 11.12.1998 / 16:40:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12207
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12208
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12209
_WMenuPeer_addSeparator:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12210
    "/ void addSeparator ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12211
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12212
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12213
    "Created: / 12.11.1998 / 19:13:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12214
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12215
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12216
_WMenuPeer_createMenu:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12217
    |jMenuPeer jMenu jMenuBarPeer menuPanel menu
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12218
     lbl item|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12219
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12220
    jMenuPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12221
    jMenu := jMenuPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12222
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12223
    jMenuBarPeer := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12224
    menuPanel := jMenuBarPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12225
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12226
    item := menuPanel createAtIndex:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12227
    lbl := jMenu instVarNamed:'label'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12228
    lbl notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12229
	lbl := Java as_ST_String:lbl.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12230
	item label:lbl
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12231
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12232
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12233
    menu := MenuPanel new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12234
    item submenu:menu.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12235
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12236
    jMenuPeer instVarNamed:'pData' put:menu.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12237
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12238
'createMenuPeer: ' print. menuPanel print. ' -> ' print. menu printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12239
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12240
    "Created: / 7.1.1998 / 21:39:50 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12241
    "Modified: / 13.1.1998 / 22:11:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12242
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12243
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12244
_WMenuPeer_createSubMenu:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12245
    "/ void createSubMenu (sun.awt.windows.WMenuPeer)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12246
"/    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12247
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12248
    "Created: / 12.11.1998 / 19:13:43 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12249
    "Modified: / 3.12.1998 / 21:41:07 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12250
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12251
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12252
_WMenuPeer_delItem:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12253
    "/ void delItem (int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12254
    |jMenuPeer jMenu menuPanel itemIndex|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12255
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12256
    jMenuPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12257
    menuPanel := jMenuPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12258
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12259
    itemIndex := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12260
    menuPanel remove:itemIndex.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12261
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12262
"/    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12263
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12264
    "Created: / 12.11.1998 / 19:13:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12265
    "Modified: / 10.12.1998 / 21:12:29 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12266
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12267
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12268
_WPanelPeer_calculateInsets:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12269
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12270
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12271
    "Created: / 27.1.1998 / 21:40:00 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12272
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12273
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12274
_WPopupMenuPeer__show:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12275
    "/ void _show (java.awt.Event)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12276
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12277
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12278
    "Created: / 12.11.1998 / 19:12:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12279
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12280
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12281
_WPopupMenuPeer_createMenu:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12282
    "/ void createMenu (sun.awt.windows.WComponentPeer)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12283
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12284
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12285
    "Created: / 12.11.1998 / 19:12:43 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12286
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12287
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12288
_WPrintJob_end:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12289
    "/ void end ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12290
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12291
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12292
    "Created: / 12.11.1998 / 19:11:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12293
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12294
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12295
_WScrollPanePeer__getHScrollbarHeight:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12296
    |scrollPane|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12297
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12298
    scrollPane := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12299
    ^ HorizontalScrollBar new preferredExtent y.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12300
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12301
    "Created: / 9.4.1998 / 17:30:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12302
    "Modified: / 10.4.1998 / 14:59:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12303
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12304
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12305
_WScrollPanePeer__getVScrollbarWidth:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12306
    |scrollPane|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12307
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12308
    scrollPane := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12309
    ^ ScrollBar new preferredExtent x.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12310
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12311
    "Created: / 9.4.1998 / 17:29:48 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12312
    "Modified: / 10.4.1998 / 15:00:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12313
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12314
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12315
_WScrollPanePeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12316
    |jScrollPanePeer jScrollPane jFrame frame scrollPane
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12317
     lbl|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12318
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12319
    jScrollPanePeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12320
    jScrollPane := jScrollPanePeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12321
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12322
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12323
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12324
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12325
    "/ create with a simple view ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12326
    scrollPane := ScrollableView for:JavaView in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12327
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12328
    self createdWindowsView:scrollPane for:jScrollPanePeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12329
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12330
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12331
	'WScrollPanePeer_create: ' print. frame print. ' -> ' print. scrollPane printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12332
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12333
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12334
    "Created: / 9.4.1998 / 17:25:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12335
    "Modified: / 9.4.1998 / 22:06:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12336
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12337
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12338
_WScrollPanePeer_getOffset:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12339
    "/ int getOffset (int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12340
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12341
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12342
    "Created: / 12.11.1998 / 19:16:29 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12343
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12344
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12345
_WScrollPanePeer_getScrollChild:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12346
    "/ java.awt.Component getScrollChild ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12347
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12348
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12349
    "Created: / 12.11.1998 / 19:17:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12350
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12351
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12352
_WScrollPanePeer_setInsets:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12353
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12354
    "Modified: / 9.4.1998 / 17:26:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12355
    "Created: / 9.4.1998 / 17:29:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12356
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12357
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12358
_WScrollPanePeer_setScrollPosition:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12359
    "/ void setScrollPosition (int int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12360
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12361
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12362
    "Created: / 12.11.1998 / 19:16:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12363
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12364
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12365
_WScrollPanePeer_setSpans:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12366
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12367
    "Created: / 9.4.1998 / 17:31:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12368
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12369
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12370
_WScrollbarPeer__setValues:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12371
    |scrollBar value visibleAmount min max|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12372
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12373
    scrollBar := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12374
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12375
    value := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12376
    visibleAmount := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12377
    min := nativeContext argAt:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12378
    max := nativeContext argAt:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12379
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12380
    (min ~~ 0 or:[max ~~ 100]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12381
	scrollBar thumb start:min stop:max.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12382
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12383
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12384
    scrollBar thumbOrigin:value thumbHeight:visibleAmount.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12385
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12386
    "Created: / 13.1.1998 / 22:13:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12387
    "Modified: / 14.10.1998 / 14:53:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12388
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12389
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12390
_WScrollbarPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12391
    |jScrollbarPeer jScrollbar jFrame frame scrollBar
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12392
     min max|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12393
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12394
    jScrollbarPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12395
    jScrollbar := jScrollbarPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12396
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12397
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12398
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12399
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12400
    (jScrollbar instVarNamed:'orientation') == 0 "HORIZONTAL" ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12401
	scrollBar := HorizontalScrollBar in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12402
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12403
	scrollBar := ScrollBar in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12404
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12405
    min := jScrollbar instVarNamed:'minimum'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12406
    max := jScrollbar instVarNamed:'maximum'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12407
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12408
    scrollBar scrollDownAction:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12409
			scrollBar thumbOrigin:(scrollBar thumbOrigin + ((max-min)/10) min:max).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12410
			jScrollbarPeer perform:#'dragAbsolute(I)V' with:scrollBar thumbOrigin rounded.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12411
		     ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12412
    scrollBar scrollUpAction:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12413
			scrollBar thumbOrigin:(scrollBar thumbOrigin - ((max-min)/10) max:min).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12414
			jScrollbarPeer perform:#'dragAbsolute(I)V' with:scrollBar thumbOrigin rounded.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12415
		     ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12416
    scrollBar scrollAction:[:org |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12417
			jScrollbarPeer perform:#'dragAbsolute(I)V' with:org rounded.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12418
		     ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12419
    self createdWindowsView:scrollBar for:jScrollbarPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12420
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12421
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12422
	'WScrollbarPeer_create: ' print. frame print. ' -> ' print. scrollBar printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12423
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12424
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12425
    "Created: / 5.1.1998 / 01:53:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12426
    "Modified: / 14.10.1998 / 15:36:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12427
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12428
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12429
_WScrollbarPeer_setLineIncrement:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12430
    |scrollBar inc|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12431
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12432
Transcript showCR:'JavaVM: WScrollbarPeer_setLineIncrement unimplemented'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12433
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12434
    scrollBar := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12435
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12436
    inc := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12437
"/    scrollBar thumb lineIncrement:inc.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12438
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12439
    "Created: / 25.1.1998 / 11:52:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12440
    "Modified: / 14.10.1998 / 14:53:56 / 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
_WScrollbarPeer_setPageIncrement:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12444
    |scrollBar inc|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12445
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12446
Transcript showCR:'JavaVM: WScrollbarPeer_setPageIncrement unimplemented'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12447
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12448
    scrollBar := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12449
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12450
    inc := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12451
"/    scrollBar thumb pageIncrement:inc.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12452
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12453
    "Created: / 25.1.1998 / 11:52:01 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12454
    "Modified: / 14.10.1998 / 14:54:04 / 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
_WTextAreaPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12458
    |jTextAreaPeer jFrame frame editTextView|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12459
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12460
    jTextAreaPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12461
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12462
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12463
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12464
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12465
    editTextView := HVScrollableView for:EditTextView in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12466
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12467
    self createdWindowsView:editTextView for:jTextAreaPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12468
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12469
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12470
	'WTextAreaPeer_create: ' print. frame print. ' -> ' print. editTextView printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12471
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12472
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12473
    "Created: / 7.1.1998 / 21:49:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12474
    "Modified: / 15.1.1998 / 12:56:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12475
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12476
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12477
_WTextAreaPeer_insertText:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12478
    |textView pos string jstring|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12479
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12480
    textView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12481
    (textView isKindOf:ScrollableView) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12482
	textView := textView scrolledView
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
    jstring := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12486
    string := Java as_ST_String:jstring.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12487
    pos := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12488
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12489
    textView insert:string at:pos.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12490
    textView cursorToCharacterPosition:pos + string size.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12491
    textView makeCursorVisible.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12492
"/ textView invalidateRepairNow:true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12493
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12494
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12495
    "Created: / 7.1.1998 / 21:50:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12496
    "Modified: / 5.4.1998 / 17:37:24 / 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
_WTextAreaPeer_replaceText:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12500
    "/ void replaceText (java.lang.String int int)
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:11:14 / 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
_WTextComponentPeer_enableEditing:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12507
    |textView enabled|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12508
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12509
    textView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12510
    enabled := (nativeContext argAt:1) ~~ 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12511
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12512
    ^ textView readOnly:enabled not
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12513
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12514
    "Created: / 5.1.1998 / 01:29:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12515
    "Modified: / 25.1.1998 / 16:29:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12516
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12517
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12518
_WTextComponentPeer_getSelectionEnd:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12519
    |textView|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12520
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12521
    textView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12522
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12523
    ^ textView characterPositionOfSelectionEnd
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12524
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12525
    "Created: / 8.1.1998 / 17:41:56 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12526
    "Modified: / 15.1.1998 / 15:47:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12527
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12528
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12529
_WTextComponentPeer_getSelectionStart:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12530
    |textView|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12531
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12532
    textView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12533
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12534
    ^ textView characterPositionOfSelection - 1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12535
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12536
    "Created: / 15.8.1997 / 15:45:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12537
    "Modified: / 15.1.1998 / 15:46:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12538
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12539
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12540
_WTextComponentPeer_getText:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12541
    |textView string jString|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12542
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12543
    textView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12544
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12545
    string := textView contents asString.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12546
    jString := Java as_String:string.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12547
    ^ jString
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12548
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12549
    "Created: / 6.1.1998 / 21:05:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12550
    "Modified: / 8.1.1998 / 17:36:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12551
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12552
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12553
_WTextComponentPeer_select:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12554
    |textView selStart selEnd|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12555
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12556
    textView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12557
    selStart := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12558
    selEnd := nativeContext argAt:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12559
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12560
    selStart == selEnd ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12561
	"/ clear selection
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12562
	textView unselect.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12563
	"/ and set caret
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12564
	textView cursorToCharacterPosition:selStart + 1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12565
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12566
	"/ change selection
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12567
	textView selectFromCharacterPosition:selStart+1 to:selEnd
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12568
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12569
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12570
    "Created: / 15.8.1997 / 15:45:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12571
    "Modified: / 15.1.1998 / 21:55:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12572
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12573
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12574
_WTextComponentPeer_setText:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12575
    |textView string jstring|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12576
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12577
    textView := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12578
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12579
    jstring := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12580
    jstring notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12581
	string := Java as_ST_String:jstring
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12582
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12583
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12584
    textView contents:string.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12585
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12586
    "Created: / 5.1.1998 / 01:28:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12587
    "Modified: / 11.12.1998 / 12:16:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12588
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12589
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12590
_WTextFieldPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12591
    |jTextFieldPeer jFrame frame editField|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12592
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12593
    jTextFieldPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12594
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12595
    jFrame := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12596
    frame := jFrame instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12597
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12598
    editField := EditField in:frame.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12599
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12600
    self createdWindowsView:editField for:jTextFieldPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12601
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12602
    editField crAction:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12603
			jTextFieldPeer perform:#handleAction.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12604
		  ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12605
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12606
	'WTextFieldPeer_create: ' print. frame print. ' -> ' print. editField printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12607
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12608
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12609
    "Created: / 5.1.1998 / 01:27:37 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12610
    "Modified: / 4.11.1998 / 21:07:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12611
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12612
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12613
_WTextFieldPeer_setEchoCharacter:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12614
    |editField char|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12615
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12616
    editField := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12617
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12618
    char := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12619
    editField passwordCharacter:(Character value:char).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12620
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12621
    "Created: / 25.1.1998 / 16:28:30 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12622
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12623
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12624
_WToolkit_beep:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12625
    "/ void beep ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12626
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12627
    Screen current beep
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12628
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12629
    "Created: / 12.11.1998 / 19:09:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12630
    "Modified: / 11.12.1998 / 12:15:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12631
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12632
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12633
_WToolkit_eventLoop:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12634
    (JavaEventThread notNil and:[JavaEventThread isDead not]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12635
	'JavaVM [warning]: oops - two threads executing eventLoop' errorPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12636
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12637
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12638
    JavaEventThread := Processor activeProcess.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12639
    [
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12640
	[true] whileTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12641
	    AbortSignal handle:[:ex |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12642
		ex return
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12643
	    ] do:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12644
		self doWindowsEventThread.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12645
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12646
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12647
    ] valueNowOrOnUnwindDo:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12648
	JavaEventThread := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12649
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12650
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12651
    "Created: / 6.1.1998 / 21:01:44 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12652
    "Modified: / 8.1.1999 / 17:08:00 / cg"
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
_WToolkit_getComboHeightOffset:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12656
    ^ 0
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12657
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12658
    "Modified: / 20.3.1997 / 13:50:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12659
    "Created: / 22.10.1998 / 00:59:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12660
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12661
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12662
_WToolkit_getScreenHeight:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12663
    ^ Screen current height
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12664
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12665
    "Modified: / 20.3.1997 / 13:50:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12666
    "Created: / 13.1.1998 / 09:24:45 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12667
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12668
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12669
_WToolkit_getScreenResolution:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12670
    ^ Screen current resolution x rounded
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12671
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12672
    "Modified: / 20.3.1997 / 13:50:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12673
    "Created: / 17.1.1998 / 21:54:48 / 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
_WToolkit_getScreenWidth:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12677
    ^ Screen current width
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12678
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12679
    "Modified: / 20.3.1997 / 13:50:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12680
    "Created: / 13.1.1998 / 09:24:37 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12681
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12682
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12683
_WToolkit_init:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12684
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12685
    "Created: / 3.1.1998 / 02:30:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12686
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12687
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12688
_WToolkit_loadSystemColors:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12689
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12690
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12691
    "Modified: / 18.3.1997 / 18:43:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12692
    "Created: / 5.1.1998 / 02:19:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12693
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12694
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12695
_WToolkit_makeColorModel:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12696
    "/ java.awt.image.ColorModel makeColorModel ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12697
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12698
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12699
    "Created: / 12.11.1998 / 19:08:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12700
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12701
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12702
_WToolkit_sync:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12703
    "/ void sync ()
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12704
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12705
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12706
    "Created: / 12.11.1998 / 19:09:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12707
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12708
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12709
_WWindowPeer__setResizable:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12710
    |view onOff|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12711
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12712
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12713
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12714
    onOff := (nativeContext argAt:1) == 1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12715
    view isTopView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12716
	onOff ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12717
	    view minExtent:10@10.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12718
	    view maxExtent:(Screen current extent).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12719
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12720
	    view minExtent:view extent.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12721
	    view maxExtent:view extent.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12722
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12723
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12724
	(view isMemberOf:JavaEmbeddedFrameView) ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12725
	    self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12726
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12727
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12728
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12729
"/ 'JAVA: WWindowPeer_setResizable: ' print. view print. ' yes/no: ' print. onOff printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12730
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12731
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12732
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12733
    "Created: / 5.1.1998 / 00:57:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12734
    "Modified: / 16.1.1998 / 18:08:00 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12735
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12736
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12737
_WWindowPeer__setTitle:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12738
    |view jString string|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12739
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12740
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12741
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12742
    jString := nativeContext argAt:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12743
    string := Java as_ST_String:jString.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12744
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12745
"/ 'JAVA: WWindowPeer_pSetTitle: ' print. string print. ' ' print. view printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12746
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12747
    view label:string.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12748
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12749
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12750
    "Created: / 5.1.1998 / 00:57:17 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12751
    "Modified: / 8.1.1998 / 17:37:41 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12752
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12753
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12754
_WWindowPeer_create:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12755
    "/ void create (sun.awt.windows.WComponentPeer)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12756
    |jWindowPeer jWindow top window pDataIdx|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12757
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12758
    jWindowPeer := nativeContext receiver.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12759
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12760
    jWindow := jWindowPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12761
    window := jWindowPeer instVarNamed:'pData'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12762
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12763
    (window notNil and:[window ~~ 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12764
	WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12765
	    'JAVA: window view already created: ' infoPrint.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12766
	    jWindowPeer class name infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12767
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12768
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12769
"/ OLD
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12770
"/        window := StandardSystemView new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12771
"/        self createdWindowsView:window for:jWindowPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12772
"/        JavaWindowGroup addTopView:window.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12773
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12774
	window := JavaPopUpView new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12775
	window borderWidth:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12776
	window level:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12777
	window delegate:self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12778
	window javaPeer:jWindowPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12779
	self createdWindowsView:window for:jWindowPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12780
	JavaWindowGroup addTopView:window.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12781
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12782
"/        top := StandardSystemView new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12783
"/        window := JavaView origin:0.0@0.0 corner:1.0@1.0 in:top.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12784
"/        window delegate:self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12785
"/        window javaPeer:jWindowPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12786
"/        self createdWindowsView:window for:jWindowPeer.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12787
"/        JavaWindowGroup addTopView:top.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12788
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
    WindowCreationTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12792
	'JAVA: WWindowPeer_create: ' print. jWindowPeer displayString print.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12793
	' window: ' print. window printNL.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12794
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12795
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12796
    "Created: / 4.1.1998 / 17:56:39 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12797
    "Modified: / 4.12.1998 / 17:37:59 / 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
_WWindowPeer_getContainerElement:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12801
    "/ java.awt.Component getContainerElement (java.awt.Container int)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12802
    UnimplementedNativeMethodSignal raise
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12803
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12804
    "Created: / 12.11.1998 / 19:10:54 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12805
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12806
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12807
_WWindowPeer_toBack:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12808
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12809
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12810
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12811
    view lower.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12812
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12813
    "Created: / 7.5.1998 / 00:23:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12814
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12815
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12816
_WWindowPeer_toFront:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12817
    |view|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12818
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12819
    view := self viewForWPeer:nativeContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12820
    view raise.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12821
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12822
    "Created: / 9.4.1998 / 22:17:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12823
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12824
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12825
_WWindowPeer_updateInsets:nativeContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12826
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12827
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12828
    "Modified: / 18.3.1997 / 18:43:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12829
    "Created: / 4.1.1998 / 18:09:04 / cg"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12830
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12831
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12832
_Win32Process_create:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12833
    "really create a win32 process"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12834
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12835
    |env cmd jProcess p inPipe outPipe errorPipe|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12836
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12837
    jProcess := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12838
    cmd := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12839
    cmd := Java as_ST_String:cmd.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12840
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12841
    env := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12842
    env notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12843
	self halt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12844
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12845
self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12846
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12847
    p := Win32Process new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12848
    p command:cmd.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12849
    p environment:env.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12850
    p inStream:inPipe.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12851
    p outStream:outPipe.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12852
    p errorStream:errorPipe.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12853
    p directory:nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12854
    p startProcess.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12855
self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12856
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12857
    jProcess instVarNamed:'handle' put:p.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12858
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12859
    "Created: / 10.11.1998 / 19:50:31 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12860
    "Modified: / 10.11.1998 / 21:34:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12861
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12862
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12863
_WinNTFileSystem_canonicalize0:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12864
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12865
    |  path |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12866
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12867
    path := Java as_ST_String: (aJavaContext argAt: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12868
    ^(Java as_String: path asFilename asAbsoluteFilename pathName)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12869
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12870
    "Created: / 01-04-2011 / 23:00:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12871
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12872
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12873
_WinNTFileSystem_getBooleanAttributes:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12874
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12875
    ^ self _UnixFileSystem_getBooleanAttributes0:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12876
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12877
    "Created: / 01-04-2011 / 18:10:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12878
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12879
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12880
_X11FontMetrics_getMFCharSegmentWidth:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12881
    "get multi-font string-segment width.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12882
     Not yet supported - use standard strings width"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12883
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12884
    |jMetrics jFont jFontDescr stFont w
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12885
     bool1 cp offs lenght bp int1|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12886
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12887
    jMetrics := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12888
    jFont := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12889
    jFontDescr := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12890
    cp := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12891
    lenght := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12892
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12893
    stFont := jFont instVarNamed:'pData'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12894
    (stFont isNil or:[stFont == 0]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12895
        self halt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12896
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12897
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12898
    stFont device isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12899
        stFont := stFont on:Display.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12900
        jFont instVarNamed:'pData' put:stFont.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12901
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12902
    w := stFont widthOf:cp from:1 to:lenght.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12903
    ^ w.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12904
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12905
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12906
_X11FontMetrics_init:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12907
    ^ self _WFontMetrics_init:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12908
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12909
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12910
_X11GraphicsDevice_getConfigType:nativeContext
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12911
    "/ new with jdk1.2 ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12912
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12913
    |configNr cls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12914
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12915
    "/ for now, only one config.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12916
    configNr := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12917
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12918
    cls := Java classNamed:'java.awt.GraphicsDevice'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12919
    ^ cls instVarNamed:'TYPE_RASTER_SCREEN'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12920
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12921
    "Created: / 28.1.1998 / 22:19:05 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12922
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12923
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12924
_X11GraphicsDevice_getNumConfigs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12925
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12926
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12927
    ^ 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12928
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12929
    "Created: / 28.1.1998 / 22:13:26 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12930
    "Modified: / 28.1.1998 / 22:14:33 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12931
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12932
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12933
_X11GraphicsEnvironment_getNumScreens:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12934
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12935
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12936
    "/ could return the actual number of screens ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12937
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12938
    ^ 1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12939
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12940
    "Created: / 28.1.1998 / 01:50:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12941
    "Modified: / 28.1.1998 / 22:12:32 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12942
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12943
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12944
_X11GraphicsEnvironment_initDisplay:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12945
    "/ new with jdk1.2 ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12946
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12947
    "Created: / 28.1.1998 / 01:50:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12948
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12949
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12950
_X11Graphics_changeClip:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12951
    ^ self _WGraphics_changeClip:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12952
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12953
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12954
_X11Graphics_createFromComponent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12955
    ^ self _WGraphics_createFromComponent:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12956
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12957
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12958
_X11Graphics_disposeImpl:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12959
    ^ self _WGraphics_dispose:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12960
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12961
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12962
_X11Graphics_drawMFCharsSegment:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12963
    ^ self _WGraphics_drawMFCharsSegment:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12964
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12965
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12966
_X11Graphics_drawRect:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12967
    ^ self _WGraphics_drawRect:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12968
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12969
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12970
_X11Graphics_fillOval:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12971
    ^ self _WGraphics_fillOval:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12972
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12973
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12974
_X11Graphics_fillRect:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12975
    ^ self _WGraphics_fillRect:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12976
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12977
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12978
_X11Graphics_pSetFont:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12979
    ^ self _WGraphics_pSetFont:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12980
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12981
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12982
_X11Graphics_pSetForeground:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12983
    ^ self _WGraphics_pSetForeground:nativeContext
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12984
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 12985
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12986
!JavaVM class methodsFor:'native - old-style (converted)'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12987
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12988
_AccessController_doPrivileged:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12989
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12990
    "Don't care about permissions :-)"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12991
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12992
    ^(aJavaContext argAt:1) perform: #'run()Ljava/lang/Object;'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12993
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12994
    "Created: / 20-10-2010 / 12:31:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12995
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12996
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12997
_AccessController_getStackAccessControlContext:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12998
    "/ introduced with jdk1.2
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 12999
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13000
    "/ supposed to do more here ...
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13001
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13002
    ^ nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13003
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13004
    "Created: / 27.1.1998 / 18:22:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13005
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13006
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13007
_Array_newArray:aJavaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13008
    |componentClass size|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13009
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13010
    componentClass := self reflection 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13011
                classForJavaClassObject:(aJavaContext argAt:1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13012
    size := aJavaContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13013
    ^ componentClass arrayClass new:size
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13014
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13015
    "Created: / 17-12-2010 / 14:49:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13016
    "Modified: / 19-12-2010 / 17:54:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13017
    "Modified: / 28-01-2011 / 15:18:50 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13018
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13019
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13020
_ClassLoader_NativeLibrary_load:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13021
    "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13022
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13023
    |nativeLoader jLibName libName libHandle index|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13024
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13025
    nativeLoader := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13026
    jLibName := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13027
    libName := (Java as_ST_String:jLibName) asFilename baseName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13028
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13029
    (index := SimulatedNativeLibs indexOf:libName) ~~ 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13030
"/        ('JAVA: builtIn nativeLibLoad simulated: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13031
        nativeLoader instVarNamed:'handle' put:index.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13032
        ^ self "/ void
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13033
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13034
    (LoadedNativeLibs notNil 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13035
    and:[LoadedNativeLibs includesKey:libName]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13036
"/        ('JAVA: native library already loaded: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13037
        nativeLoader instVarNamed:'handle' put:(LoadedNativeLibs at:libName).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13038
        ^ self "/ void
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13039
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13040
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13041
    (self confirm:'permission to load native library: ' , libName , ' ?') ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13042
        ^ self
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13043
    ].
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13044
self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13045
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13046
    libName asFilename exists ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13047
        ('JAVA: no file to load nativeLib: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13048
        ^ self "/ void
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13049
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13050
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13051
    libHandle := ObjectFileLoader loadLibrary:libName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13052
    libHandle isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13053
        ('JAVA: failed to load nativeLib: ' , libName) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13054
        ^ self "/ void
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13055
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13056
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13057
    LoadedNativeLibs isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13058
        LoadedNativeLibs := Dictionary new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13059
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13060
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13061
    LoadedNativeLibs at:libName put:libHandle.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13062
    nativeLoader instVarNamed:'handle' put:(LoadedNativeLibs at:libName).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13063
    ^ self "/ void
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13064
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13065
    "Modified: / 06-02-1998 / 03:12:17 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13066
    "Created: / 10-12-2010 / 15:11:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13067
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13068
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13069
_ClassLoader_registerNatives:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13070
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13071
    "Nothing to do"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13072
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13073
    "Created: / 09-11-2010 / 20:55:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13074
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13075
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13076
_Class_desiredAssertionStatus0:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13077
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13078
    ^AssertionsEnabled == true
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13079
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13080
    "Created: / 24-11-2010 / 08:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13081
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13082
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13083
_Class_forName0:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13084
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13085
    | name initialize loader class |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13086
    name := Java as_ST_String: (aJavaContext argAt: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13087
    initialize := aJavaContext argAt: 2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13088
    loader := aJavaContext argAt: 3.   
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13089
    JavaClassReader classLoaderQuerySignal answer: loader do:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13090
        [class := Java classForName: name].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13091
    class isNil ifTrue:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13092
        [^self throwClassNotFoundException: name].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13093
    initialize ifTrue:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13094
        [[class classInit] on: Error do:[self throwExceptionInInitializerError:name]].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13095
    ^JavaVM javaClassObjectForClass: class.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13096
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13097
    "Created: / 24-11-2010 / 09:03:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13098
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13099
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13100
_Class_getClassLoader0:aJavaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13101
    "get a classes loader"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13102
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13103
    |jClass cls loader|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13104
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13105
    jClass := aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13106
    cls := self reflection classForJavaClassObject:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13107
    loader := cls classLoader.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13108
    cls isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13109
        loader := (Java classForName:'java/lang/ClassLoader') 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13110
                    perform:#'getSystemClassLoader()Ljava/lang/ClassLoader;'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13111
        
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13112
"/    ('JAVA: getClassLoader - ' , loader printString) infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13113
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13114
    ^ loader
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13115
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13116
    "Created: / 25-10-2010 / 22:49:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13117
    "Modified: / 09-11-2010 / 23:37:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13118
    "Modified: / 28-01-2011 / 15:18:54 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13119
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13120
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13121
_Class_getComponentType:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13122
    |cls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13123
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13124
    cls := self reflection classForJavaClassObject:(nativeContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13125
    cls isJavaPrimitiveType ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13126
        self breakPoint:#jv.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13127
        ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13128
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13129
    ^ self javaClassObjectForClass:cls javaComponentClass
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13130
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13131
    "Created: / 12-11-1998 / 18:54:46 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13132
    "Modified: / 20-12-2010 / 22:56:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13133
    "Modified: / 28-01-2011 / 15:18:59 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13134
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13135
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13136
_Class_getConstantPool:aJavaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13137
    | class |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13138
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13139
    class := self reflection classForJavaClassObject:aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13140
    ^ self reflection javaConstantPoolObjectFor:class constantPool.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13141
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13142
    "Created: / 21-12-2010 / 20:00:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13143
    "Modified: / 28-02-2011 / 18:05:13 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13144
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13145
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13146
_Class_getDeclaredConstructors0:aJavaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13147
    |class publicOnly constructors|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13148
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13149
    class := self reflection classForJavaClassObject:(aJavaContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13150
    publicOnly := (aJavaContext argAt:1) == 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13151
    constructors := OrderedCollection new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13152
    class 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13153
        selectorsAndMethodsDo:[:selector :method | 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13154
            (method isJavaMethod 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13155
                and:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13156
                    (selector at:1) == $< 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13157
                        and:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13158
                            (selector startsWith:'<init>(') and:[publicOnly not or:[method isPublic]]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13159
                        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13160
                ]) 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13161
                    ifTrue:[constructors add:(self reflection javaConstructorObjectForMethod:method)]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13162
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13163
    ^ (self classForName: 'java.lang.reflect.Constructor')
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13164
        arrayClass withAll: constructors
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13165
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13166
    "Created: / 24-11-2010 / 09:25:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13167
    "Modified: / 09-02-2011 / 01:24:03 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13168
    "Modified: / 11-02-2011 / 08:55:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13169
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13170
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13171
_Class_getDeclaredFields0:aJavaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13172
    |javaClassObject class fields publicOnly|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13173
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13174
    class := self reflection classForJavaClassObject:(javaClassObject := aJavaContext argAt:0).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13175
    publicOnly := (aJavaContext argAt:1) == 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13176
    fields := class fields.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13177
    publicOnly ifTrue:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13178
        [fields := fields select:[:f|f isPublic]].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13179
    fields := fields collect:[:f | self javaFieldObjectForField:f in:javaClassObject].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13180
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13181
    ^ (self classForName: 'java.lang.reflect.Field') arrayClass 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13182
            withAll:fields
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13183
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13184
    "Created: / 10-11-2010 / 16:22:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13185
    "Modified: / 28-01-2011 / 15:19:06 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13186
    "Modified: / 16-03-2011 / 15:43:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13187
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13188
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13189
_Class_getDeclaredMethods0:aJavaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13190
    |class publicOnly methods|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13191
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13192
    class := self reflection classForJavaClassObject:(aJavaContext receiver).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13193
    publicOnly := (aJavaContext argAt:1) == 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13194
    methods := OrderedCollection new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13195
    class 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13196
        selectorsAndMethodsDo:[:selector :method | 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13197
            (method isJavaMethod 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13198
                and:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13199
                    (selector at:1) ~~ $< 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13200
                        and:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13201
                            (selector startsWith:'<init>(') not 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13202
                                and:[publicOnly not or:[method isPublic]]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13203
                        ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13204
                ]) 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13205
                    ifTrue:[methods add:(self javaMethodObjectForMethod:method)]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13206
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13207
    ^ (self classForName: 'java.lang.reflect.Method')
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13208
        arrayClass withAll: methods asArray
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13209
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13210
    "Created: / 21-12-2010 / 22:39:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13211
    "Modified: / 28-01-2011 / 15:19:09 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13212
    "Modified: / 11-02-2011 / 08:35:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13213
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13214
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13215
_Class_getInterfaces:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13216
    |jClass cls interfaces jInterfaces|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13217
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13218
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13219
    cls := self reflection classForJavaClassObject:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13220
    cls isJavaPrimitiveType ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13221
        ^ (self classForName:'java.lang.Class') arrayClass new
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13222
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13223
    interfaces := cls interfaces.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13224
    interfaces ifNil:[^ (self classForName:'java.lang.Class') arrayClass new].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13225
    jInterfaces := (self classForName:'java.lang.Class') arrayClass new:interfaces size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13226
    interfaces withIndexDo:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13227
        [:iface :idx | jInterfaces at:idx put:(self javaClassObjectForClass:iface)].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13228
    ^ jInterfaces
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13229
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13230
    "Modified: / 28-01-2011 / 15:19:11 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13231
    "Modified: / 04-02-2011 / 09:43:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13232
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13233
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13234
_Class_getModifiers:aJavaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13235
    ^ (self reflection classForJavaClassObject:aJavaContext receiver) accessFlags
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13236
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13237
    "Created: / 12-11-1998 / 18:54:53 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13238
    "Modified: / 26-11-2010 / 10:25:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13239
    "Modified: / 28-01-2011 / 15:19:14 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13240
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13241
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13242
_Class_getName0:aJavaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13243
    |class|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13244
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13245
    class := aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13246
    class := self reflection classForJavaClassObject:aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13247
    ^ self reflection 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13248
        javaStringObjectForString:class javaName
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13249
        interned:true.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13250
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13251
    "Created: / 22-11-2010 / 17:50:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13252
    "Modified: / 09-02-2011 / 01:06:53 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13253
    "Modified: / 25-02-2011 / 19:00:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13254
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13255
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13256
_Class_getPrimitiveClass:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13257
    "get a primitive class by name"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13258
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13259
    |jClassName className|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13260
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13261
    jClassName := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13262
    className := Java as_ST_String:jClassName.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13263
    (JavaDescriptor baseTypesByTypeName keys includes: className)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13264
        ifFalse:[self throwClassNotFoundException:className].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13265
    ^self reflection javaClassObjectForClassNamed: className
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13266
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13267
    "Created: / 04-01-1998 / 00:46:03 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13268
    "Modified: / 28-01-2011 / 15:30:45 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13269
    "Modified: / 03-02-2011 / 21:43:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13270
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13271
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13272
_Class_getRawAnnotations:aJavaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13273
    |class |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13274
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13275
    class := self reflection classForJavaClassObject:aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13276
    ^ class runtimeVisibleAnnotationsAsBytesOrNil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13277
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13278
    "Created: / 21-12-2010 / 19:35:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13279
    "Modified: / 28-01-2011 / 15:19:20 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13280
    "Modified: / 25-02-2011 / 16:48:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13281
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13282
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13283
_Class_getSuperclass:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13284
    "return a classes superclass"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13285
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13286
    |jClass cls superCls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13287
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13288
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13289
    cls := self reflection classForJavaClassObject:jClass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13290
    superCls := cls superclass.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13291
    superCls == JavaObject ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13292
        ^ nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13293
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13294
    ^ self javaClassObjectForClass:superCls
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13295
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13296
    "Created: / 12-01-1998 / 12:38:36 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13297
    "Modified: / 04-02-1998 / 14:51:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13298
    "Modified: / 28-01-2011 / 14:12:47 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13299
    "Modified: / 03-02-2011 / 22:53:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13300
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13301
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13302
_Class_isArray:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13303
    ^ (self reflection classForJavaClassObject:nativeContext receiver) isJavaArrayClass 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13304
        ifTrue:[1]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13305
        ifFalse:[0]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13306
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13307
    "Created: / 12-11-1998 / 18:54:24 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13308
    "Modified: / 20-12-2010 / 23:20:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13309
    "Modified: / 28-01-2011 / 15:19:24 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13310
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13311
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13312
_Class_isAssignableFrom:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13313
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13314
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13315
     * Determines if the class or interface represented by this
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13316
     * {@code Class} object is either the same as, or is a superclass or
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13317
     * superinterface of, the class or interface represented by the specified
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13318
     * {@code Class} parameter. It returns {@code true} if so;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13319
     * otherwise it returns {@code false}. If this {@code Class}
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13320
     * object represents a primitive type, this method returns
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13321
     * {@code true} if the specified {@code Class} parameter is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13322
     * exactly this {@code Class} object; otherwise it returns
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13323
     * {@code false}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13324
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13325
     * <p> Specifically, this method tests whether the type represented by the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13326
     * specified {@code Class} parameter can be converted to the type
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13327
     * represented by this {@code Class} object via an identity conversion
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13328
     * or via a widening reference conversion. See <em>The Java Language
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13329
     * Specification</em>, sections 5.1.1 and 5.1.4 , for details.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13330
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13331
     * @param cls the {@code Class} object to be checked
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13332
     * @return the {@code boolean} value indicating whether objects of the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13333
     * type {@code cls} can be assigned to objects of this class
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13334
     * @exception NullPointerException if the specified Class parameter is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13335
     *            null.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13336
     * @since JDK1.1
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13337
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13338
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13339
    | clsObj me other |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13340
    clsObj := nativeContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13341
    clsObj ifNil:[^self throwNullPointerException].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13342
    me := self reflection classForJavaClassObject: nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13343
    other := self reflection classForJavaClassObject: clsObj.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13344
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13345
    "/    Determines if the class or interface represented by this
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13346
    "/    @code Class} object is either the same as, or is a superclass or
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13347
    "/    superinterface of, the class or interface represented by the specified
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13348
    "/    {@code Class} parameter.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13349
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13350
    ^(other includesBehavior: me)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13351
        ifTrue:[1]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13352
        ifFalse:[0]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13353
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13354
    "Created: / 12-11-1998 / 18:54:16 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13355
    "Modified: / 05-02-2011 / 23:38:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13356
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13357
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13358
_Class_isInterface:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13359
    "return true, if this class is an interface"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13360
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13361
    |jClass cls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13362
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13363
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13364
    cls := self reflection classForJavaClassObject:jClass. 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13365
    cls isJavaClass ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13366
        ^ 0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13367
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13368
    cls isInterface ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13369
        ^ 1 "TRUE"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13370
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13371
    ^ 0 "FALSE"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13372
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13373
    "Created: / 12-01-1998 / 12:37:02 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13374
    "Modified: / 28-01-2011 / 14:12:35 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13375
    "Modified: / 03-02-2011 / 21:50:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13376
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13377
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13378
_Class_isPrimitive:nativeContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13379
    "return true, if this class is builtin primitive class
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13380
     (i.e. byteArray, array, string etc."
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13381
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13382
    |jClass cls|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13383
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13384
    jClass := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13385
    cls := self reflection classForJavaClassObject:jClass. 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13386
    ^cls isJavaPrimitiveType 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13387
        ifTrue:[1"true"]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13388
        ifFalse:[0"false"].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13389
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13390
    "Created: / 09-02-1998 / 14:46:07 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13391
    "Modified: / 28-01-2011 / 14:12:30 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13392
    "Modified: / 04-02-2011 / 11:56:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13393
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13394
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13395
_Class_registerNatives:aJavaContext
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13396
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13397
     "Nothing to do, native method are bound lazily"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13398
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13399
    "Created: / 20-10-2010 / 11:13:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13400
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13401
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13402
_Double_doubleToRawLongBits:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13403
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13404
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13405
     * Returns a representation of the specified floating-point value
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13406
     * according to the IEEE 754 floating-point 'double
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13407
     * format' bit layout, preserving Not-a-Number (NaN) values.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13408
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13409
     * <p>Bit 63 (the bit that is selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13410
     * {@code 0x8000000000000000L}) represents the sign of the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13411
     * floating-point number. Bits
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13412
     * 62-52 (the bits that are selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13413
     * {@code 0x7ff0000000000000L}) represent the exponent. Bits 51-0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13414
     * (the bits that are selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13415
     * {@code 0x000fffffffffffffL}) represent the significand
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13416
     * (sometimes called the mantissa) of the floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13417
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13418
     * <p>If the argument is positive infinity, the result is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13419
     * {@code 0x7ff0000000000000L}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13420
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13421
     * <p>If the argument is negative infinity, the result is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13422
     * {@code 0xfff0000000000000L}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13423
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13424
     * <p>If the argument is NaN, the result is the {@code long}
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13425
     * integer representing the actual NaN value.  Unlike the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13426
     * {@code doubleToLongBits} method,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13427
     * {@code doubleToRawLongBits} does not collapse all the bit
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13428
     * patterns encoding a NaN to a single 'canonical' NaN
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13429
     * value.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13430
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13431
     * <p>In all cases, the result is a {@code long} integer that,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13432
     * when given to the {@link #longBitsToDouble(long)} method, will
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13433
     * produce a floating-point value the same as the argument to
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13434
     * {@code doubleToRawLongBits}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13435
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13436
     * @param   value   a {@code double} precision floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13437
     * @return the bits that represent the floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13438
     * @since 1.3
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13439
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13440
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13441
    | f |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13442
    f := aJavaContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13443
    (f =  0.0) ifTrue:[^0].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13444
    (f = -0.0) ifTrue:[^(1 bitShift: 63)].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13445
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13446
    self halt:'Not yet implemented'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13447
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13448
    "Created: / 10-11-2010 / 14:48:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13449
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13450
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13451
_FileDescriptor_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13452
    "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13453
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13454
    "Created: / 27.1.1998 / 18:16:29 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13455
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13456
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13457
_FileInputStream_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13458
    "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13459
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13460
    "Created: / 27.1.1998 / 18:15:51 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13461
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13462
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13463
_FileOutputStream_initIDs:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13464
    "/ introduced with jdk1.2 ... (sigh)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13465
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13466
    "Created: / 27.1.1998 / 18:16:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13467
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13468
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13469
_FileOutputStream_writeBytes:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13470
    ^ self anyStream_writeBytes:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13471
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13472
    "Modified: / 4.2.1998 / 15:24:20 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13473
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13474
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13475
_FileSystem_getFileSystem:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13476
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13477
    OperatingSystem isUNIXlike ifTrue:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13478
        [^(Java classForName:'java.io.UnixFileSystem') new].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13479
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13480
    OperatingSystem isMSWINDOWSlike ifTrue:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13481
        [^(Java classForName:'java.io.WinNTFileSystem') new].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13482
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13483
    self error:'Unknown/Unsupported platform'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13484
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13485
    "Created: / 09-12-2010 / 17:58:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13486
    "Modified: / 01-04-2011 / 18:09:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13487
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13488
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13489
_Float_floatToRawIntBits:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13490
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13491
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13492
     * Returns a representation of the specified floating-point value
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13493
     * according to the IEEE 754 floating-point 'single format' bit
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13494
     * layout, preserving Not-a-Number (NaN) values.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13495
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13496
     * <p>Bit 31 (the bit that is selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13497
     * {@code 0x80000000}) represents the sign of the floating-point
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13498
     * number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13499
     * Bits 30-23 (the bits that are selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13500
     * {@code 0x7f800000}) represent the exponent.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13501
     * Bits 22-0 (the bits that are selected by the mask
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13502
     * {@code 0x007fffff}) represent the significand (sometimes called
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13503
     * the mantissa) of the floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13504
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13505
     * <p>If the argument is positive infinity, the result is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13506
     * {@code 0x7f800000}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13507
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13508
     * <p>If the argument is negative infinity, the result is
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13509
     * {@code 0xff800000}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13510
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13511
     * <p>If the argument is NaN, the result is the integer representing
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13512
     * the actual NaN value.  Unlike the {@code floatToIntBits}
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13513
     * method, {@code floatToRawIntBits} does not collapse all the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13514
     * bit patterns encoding a NaN to a single 'canonical'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13515
     * NaN value.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13516
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13517
     * <p>In all cases, the result is an integer that, when given to the
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13518
     * {@link #intBitsToFloat(int)} method, will produce a
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13519
     * floating-point value the same as the argument to
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13520
     * {@code floatToRawIntBits}.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13521
     *
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13522
     * @param   value   a floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13523
     * @return the bits that represent the floating-point number.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13524
     * @since 1.3
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13525
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13526
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13527
    | f exponent mantissa |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13528
    f := aJavaContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13529
    (f =  0.0) ifTrue:[^0].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13530
    (f = -0.0) ifTrue:[^(1 bitShift: 31) ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13531
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13532
    self halt.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13533
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13534
    "Created: / 09-11-2010 / 20:59:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13535
    "Modified: / 10-11-2010 / 14:47:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13536
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13537
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13538
_Inflater_inflateBytes:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13539
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13540
    UnimplementedNativeMethodSignal raise
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13541
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13542
    "Created: / 30-04-2011 / 23:02:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13543
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13544
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13545
_Inflater_init:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13546
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13547
    | index |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13548
    index := ZipInflaters indexOf: nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13549
    index == 0 ifTrue:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13550
        [ZipInflaters add: nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13551
        index := ZipInflaters size].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13552
    ^index
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13553
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13554
    "Created: / 01-02-1998 / 20:14:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13555
    "Modified: / 30-04-2011 / 23:01:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13556
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13557
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13558
_Inflater_initIDs:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13559
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13560
    "Nothing to do, used only to register natives"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13561
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13562
    "Created: / 30-04-2011 / 21:55:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13563
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13564
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13565
_NativeConstructorAccessorImpl_newInstance0:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13566
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13567
    | ctor args method instance |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13568
    ctor := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13569
    args := aJavaContext argAt: 2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13570
    args ifNil:[args := #()] ifNotNil:[args := args asArray].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13571
    method := self reflection methodForJavaConstructorObject: ctor.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13572
    instance := method javaClass new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13573
    method valueWithReceiver:instance arguments:args.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13574
    ^instance
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13575
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13576
    "Created: / 26-11-2010 / 11:41:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13577
    "Modified: / 04-02-2011 / 18:47:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13578
    "Modified: / 09-02-2011 / 01:12:10 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13579
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13580
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13581
_NativeMethodAccessorImpl_invoke0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13582
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13583
    private static native Object invoke0(Method m, Object obj, Object[] args);
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13584
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13585
    | m obj args |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13586
    m := nativeContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13587
    obj := nativeContext argAt: 2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13588
    args := nativeContext argAt: 3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13589
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13590
    ^(self reflection methodForJavaMethodObject: m) 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13591
        valueWithReceiver: obj
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13592
        arguments: (args ? #()) asArray.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13593
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13594
    "Created: / 06-02-2011 / 00:00:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13595
    "Modified: / 28-02-2011 / 16:57:31 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13596
    "Modified: / 16-03-2011 / 15:31:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13597
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13598
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13599
_ObjectStreamClass_initNative:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13600
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13601
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13602
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13603
     * Initializes native code.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13604
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13605
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13606
    "Nothing to do"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13607
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13608
    "Created: / 20-12-2010 / 17:43:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13609
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13610
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13611
_Object_clone:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13612
    "clone an object"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13613
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13614
    |o rslt|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13615
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13616
    o := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13617
    rslt := o shallowCopy.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13618
    ^ rslt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13619
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13620
    "Created: / 4.1.1998 / 19:39:26 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13621
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13622
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13623
_Object_getClass:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13624
    "return an objects class"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13625
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13626
    |o cls jClass|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13627
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13628
    o := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13629
    cls := o class.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13630
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13631
    jClass := self javaClassObjectForClass:cls.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13632
    ^ jClass
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13633
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13634
    "Created: / 6.1.1998 / 18:28:27 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13635
    "Modified: / 23.1.1998 / 17:48:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13636
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13637
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13638
_Object_hashCode:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13639
    "identityHash"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13640
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13641
    |o rslt|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13642
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13643
    o := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13644
    rslt := o identityHash.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13645
    ^ rslt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13646
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13647
    "Created: / 4.1.1998 / 19:40:26 / cg"
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
_Object_registerNatives:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13651
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13652
    "Nothing to do, native method are bound lazily"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13653
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13654
    "Created: / 19-10-2010 / 12:42:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13655
    "Modified: / 20-10-2010 / 10:57:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
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
_Object_wait:nativeMethodContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13659
    "wait"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13660
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13661
    |tmo handle sema|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13662
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13663
    handle := nativeMethodContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13664
    tmo := nativeMethodContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13665
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13666
    sema := JavaVM semaphoreFor:handle.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13667
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13668
    [
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13669
	self waitFor:sema state:#javaWait timeOut:tmo.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13670
    ] valueOnUnwindDo:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13671
	JavaVM releaseSemaphoreFor:handle.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13672
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13673
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13674
    ThreadTrace ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13675
	'====> thread continues ...' printCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13676
    ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13677
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13678
    "Modified: / 30.12.1998 / 19:20:43 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13679
!
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13680
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13681
_Reflection_getCallerClass:aJavaContext
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13682
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13683
    | framesToSkip framesSkipped frame |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13684
    framesToSkip := aJavaContext argAt: 1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13685
    framesSkipped := 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13686
    frame := aJavaContext.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13687
    [ framesSkipped == framesToSkip ] whileFalse:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13688
        [frame := frame sender.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13689
        framesSkipped := framesSkipped + 1].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13690
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13691
    ^JavaVM javaClassObjectForClass:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13692
        (frame receiver class theNonMetaclass)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13693
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 13694
    "Created: / 25-10-2010 / 16:32:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13695
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13696
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13697
_Reflection_getClassAccessFlags:aJavaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13698
    |class|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13699
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13700
    class := self reflection classForJavaClassObject:(aJavaContext argAt:1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13701
    ^ class accessFlags
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13702
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13703
    "Created: / 26-11-2010 / 10:20:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13704
    "Modified: / 28-01-2011 / 15:19:28 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13705
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13706
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13707
_Signal_findSignal:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13708
    | input signame |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13709
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13710
    input := Java as_ST_String: (aJavaContext argAt: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13711
    signame := 'SIG', (input asUppercase).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13712
    ^ UnixOperatingSystem signalNamed: signame asSymbol.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13713
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13714
    "Created: / 11-12-2010 / 15:22:07 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13715
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13716
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13717
_Signal_handle0:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13718
    self breakPoint: #libjava.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13719
    ^ 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13720
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13721
    "Created: / 11-12-2010 / 16:33:38 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13722
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13723
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13724
_String_intern:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13725
    |jString|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13726
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13727
    jString := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13728
    ^ Java intern:jString
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13729
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13730
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13731
_System_arraycopy:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13732
    |srcArray srcIdx dstArray dstIdx count dstEndIdx|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13733
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13734
    srcArray := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13735
    srcArray isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13736
        ^ self throwNullPointerException
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13737
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13738
    srcIdx := nativeContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13739
    dstArray := nativeContext argAt:3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13740
    dstArray isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13741
        ^ self throwNullPointerException
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13742
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13743
    dstIdx := nativeContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13744
    count := nativeContext argAt:5.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13745
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13746
    ((srcIdx < 0) or:[srcIdx + count > srcArray size]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13747
        srcArray size == 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13748
            srcArray isVariable ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13749
                ^ self throwArrayStoreException:srcArray
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13750
            ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13751
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13752
        ^ self throwArrayIndexOutOfBoundsException:(srcIdx + count - 1)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13753
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13754
    ((dstIdx < 0) or:[dstIdx + count > dstArray size]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13755
        dstArray size == 0 ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13756
            dstArray isVariable ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13757
                ^ self throwArrayStoreException:dstArray
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13758
            ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13759
        ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13760
        ^ self throwArrayIndexOutOfBoundsException:(dstIdx + count - 1)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13761
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13762
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13763
    dstEndIdx := dstIdx + count.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13764
    dstIdx := dstIdx + 1.       "/ ST uses 1-based indexing
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13765
    srcIdx := srcIdx + 1.       "/ ST uses 1-based indexing
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13766
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13767
    (srcArray class isBytes and:[dstArray class isBytes]) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13768
        dstArray replaceBytesFrom:dstIdx to:dstEndIdx with:srcArray startingAt:srcIdx.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13769
    ] ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13770
        dstArray replaceFrom:dstIdx to:dstEndIdx with:srcArray startingAt:srcIdx.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13771
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13772
    ^ nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13773
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13774
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13775
_System_currentTimeMillis:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13776
    "return the milliseconds since 1.jan.1970"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13777
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13778
    |delta|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13779
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13780
    "/ workaround win32 bug (use 01:01:01 as base)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13781
    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
 13782
    delta := delta - 3600 - 60 - 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13783
"/    "/ make certain, it fits 64 signed bits
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13784
"/    delta := delta bitAnd:16r7FFFFFFFFFFFFFFF.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13785
"/    ^ delta max:0
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13786
    ^ delta
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13787
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13788
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13789
     JavaVM _System_currentTimeMillis:nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13790
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13791
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13792
    "Modified: / 23.12.1998 / 21:54:50 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13793
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13794
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13795
_System_initProperties:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13796
    |props stProps|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13797
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13798
    props := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13799
    stProps := self systemProperties.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13800
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13801
    "/ recursively invoke myself on the Java HashTable.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13802
    "/ calling 'put' to stuff in the values ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13803
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13804
    stProps keysAndValuesDo:[:key :value |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13805
	|keyObj valueObj|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13806
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13807
	keyObj := Java as_String:key.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13808
	valueObj := Java as_String:value.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13809
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13810
	props 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13811
	    perform:#'put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13812
	    with:keyObj 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13813
	    with:valueObj.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13814
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13815
    ^ props
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13816
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13817
    "Created: / 3.1.1998 / 14:25:22 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13818
    "Modified: / 4.1.1998 / 14:23:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13819
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13820
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13821
_System_mapLibraryName:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13822
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13823
    | name |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13824
    name := Java as_ST_String: (aJavaContext argAt: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13825
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13826
    OperatingSystem isUNIXlike ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13827
        ^Java as_String: ('lib' , name , '.so').
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13828
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13829
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13830
    OperatingSystem isMSWINDOWSlike ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13831
        ^Java as_String: ( name , '.dll').
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13832
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13833
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13834
    self error:'Unknown/Unsupported platform'
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13835
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13836
    "Created: / 09-12-2010 / 18:16:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13837
    "Modified: / 01-04-2011 / 18:14:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13838
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13839
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13840
_System_registerNatives:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13841
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13842
    "Nothing to do, native method are bound lazily"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13843
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13844
    "Created: / 20-10-2010 / 10:56:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13845
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13846
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13847
_System_setErr0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13848
    |stream|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13849
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13850
    stream := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13851
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13852
    self setOpenFile:(self javaConsoleStream ? Stderr) at:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13853
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13854
    nativeContext receiver instVarNamed:'err' put:stream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13855
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13856
    "Created: / 18.3.1997 / 15:02:05 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13857
    "Modified: / 4.1.1998 / 16:21:15 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13858
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13859
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13860
_System_setIn0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13861
    |stream|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13862
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13863
    stream := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13864
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13865
    self setOpenFile:Stdin at:0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13866
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13867
    nativeContext receiver instVarNamed:'in' put:stream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13868
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13869
    "Created: / 4.1.1998 / 16:16:38 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13870
    "Modified: / 4.1.1998 / 16:20:44 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13871
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13872
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13873
_System_setOut0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13874
    |stream|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13875
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13876
    stream := nativeContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13877
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13878
    self setOpenFile:(self javaConsoleStream ? Stdout) at:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13879
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13880
    nativeContext receiver instVarNamed:'out' put:stream.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13881
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13882
    "Created: / 4.1.1998 / 16:18:26 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13883
    "Modified: / 4.1.1998 / 16:20:23 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13884
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13885
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13886
_Thread_currentThread:nativeMethodContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13887
    |t p prio|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13888
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13889
    p := Processor activeProcess.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13890
    t := self javaThreadForSTProcess:p.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13891
    t notNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13892
	^ t
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13893
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13894
    t := self newThread:'main'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13895
    Java threads at:t put:p.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13896
    ^ t
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13897
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13898
    "Created: / 3.1.1998 / 01:42:28 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13899
    "Modified: / 4.1.1998 / 14:59:13 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13900
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13901
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13902
_Thread_holdsLock:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13903
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13904
    | obj |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13905
    obj := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13906
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13907
    ^(self enteredMonitorsOfProcess:Processor activeProcess)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13908
        includes: obj.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13909
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13910
    "Created: / 30-04-2011 / 22:06:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13911
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13912
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13913
_Thread_isAlive:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13914
    "is it alive ?"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13915
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13916
    |jThread stProcess|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13917
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13918
    jThread := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13919
    stProcess := JavaVM stProcessForJavaThread:jThread.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13920
    stProcess isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13921
	ThreadTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13922
	    ('JAVA: no stProcess for javaThread: ' , jThread displayString) printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13923
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13924
	^ 0 "FALSE"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13925
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13926
    stProcess isDead ifTrue:[^ 0 "FALSE"].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13927
    ^ 1 "TRUE"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13928
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13929
    "Created: / 5.1.1998 / 02:03:51 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13930
    "Modified: / 6.2.1998 / 02:15:01 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13931
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13932
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13933
_Thread_registerNatives:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13934
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13935
    "Nothing to do, native method are bound lazily"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13936
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13937
    "Created: / 20-10-2010 / 11:12:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13938
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13939
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13940
_Thread_setPriority0:nativeMethodContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13941
    |t p prio|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13942
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13943
    t := nativeMethodContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13944
    p := JavaVM stProcessForJavaThread:t.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13945
    prio := nativeMethodContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13946
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13947
    p isNil ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13948
	ThreadTrace == true ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13949
	    'JAVA [info]: no process yet (in setPriority)' infoPrintCR.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13950
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13951
	^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13952
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13953
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13954
    ThreadTrace ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13955
	'JAVA [info]: setPrio: ' print. t print. ' pri= ' print. prio print. ' p= ' print. p printNL.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13956
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13957
    ^ nil
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13958
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13959
    "Created: / 2.1.1998 / 19:05:55 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13960
    "Modified: / 6.2.1998 / 02:28:18 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13961
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13962
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13963
_Thread_start0:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13964
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13965
    ^self threadStart: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13966
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13967
    "Modified: / 24-12-1999 / 03:14:33 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13968
    "Created: / 22-11-2010 / 17:48:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13969
    "Modified: / 14-12-2010 / 21:31:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13970
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13971
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13972
_Throwable_fillInStackTrace:nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13973
    |exClass exceptionObject list con|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13974
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13975
    exClass := Java classNamed:'java.lang.Throwable'.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13976
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13977
    exceptionObject := nativeContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13978
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13979
    "/
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13980
    "/ debugging only
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13981
    "/
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13982
    (exceptionObject isKindOf:(Java classNamed:'java.lang.Throwable')) ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13983
	self halt
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13984
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13985
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13986
    con := thisContext sender.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13987
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13988
    "/
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13989
    "/ we are not interrested in all intermediate Exception frames ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13990
    "/
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13991
    FullExceptionTrace ifFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13992
	"/ first, skip any JavaVM contexts
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13993
	[con receiver == exceptionObject] whileFalse:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13994
	    con := con sender
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13995
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13996
	"/ then, all exception-init contexts
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13997
	[con receiver == exceptionObject] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13998
	    con := con sender
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 13999
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14000
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14001
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14002
    list := OrderedCollection new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14003
    [con notNil] whileTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14004
	(con isJavaContext) ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14005
	    "/ add a copy, in case the context continues with some
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14006
	    "/ cleanup ...
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14007
	    list add:con shallowCopy
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14008
	].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14009
	con := con sender
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14010
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14011
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14012
    exceptionObject instVarNamed:'backtrace' put:(list asArray).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14013
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14014
    ^ nil.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14015
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14016
    "Created: / 4.1.1998 / 14:27:40 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14017
    "Modified: / 8.5.1998 / 21:29:53 / cg"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14018
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14019
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14020
_UnixFileSystem_canonicalize0:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14021
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14022
    |  path |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14023
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14024
    path := Java as_ST_String: (aJavaContext argAt: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14025
    ^(Java as_String: path asFilename asAbsoluteFilename pathName)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14026
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14027
    "Created: / 10-12-2010 / 14:40:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14028
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14029
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14030
_UnixFileSystem_getBooleanAttributes0:aJavaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14031
    |file path retval fileSystemClass|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14032
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14033
    retval := 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14034
    file := aJavaContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14035
    path := Java as_ST_String:(file instVarNamed:#path).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14036
    fileSystemClass := (Java classForName:'java.io.FileSystem').
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14037
    path asFilename exists ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14038
        retval := retval bitOr:(fileSystemClass instVarNamed:#'BA_EXISTS')
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14039
    ] ifFalse:[ ^ 0. ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14040
    path asFilename isDirectory ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14041
        retval := retval bitOr:(fileSystemClass instVarNamed:#'BA_DIRECTORY')
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14042
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14043
    path asFilename isRegularFile ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14044
        retval := retval bitOr:(fileSystemClass instVarNamed:#'BA_REGULAR')
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14045
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14046
    path asFilename isHidden ifTrue:[
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14047
        retval := retval bitOr:(fileSystemClass instVarNamed:#'BA_HIDDEN')
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14048
    ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14049
    ^ retval
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14050
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14051
    "Modified: / 10-12-2010 / 14:43:31 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14052
    "Created: / 10-12-2010 / 14:46:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14053
    "Modified: / 11-12-2010 / 19:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14054
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14055
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14056
_UnixFileSystem_getLastModifiedTime: aJavaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14057
    | file  path  retval |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14058
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14059
    retval := 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14060
    file := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14061
    path := Java as_ST_String: (file instVarNamed: #path).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14062
    retval := path asFilename modificationTime asMilliseconds.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14063
    ^ retval
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14064
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14065
    "Modified: / 10-12-2010 / 14:43:31 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14066
    "Modified: / 11-12-2010 / 19:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14067
    "Created: / 27-03-2011 / 15:32:59 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14068
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14069
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14070
_UnixFileSystem_initIDs:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14071
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14072
    self breakPoint: #libjava
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14073
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14074
    "Created: / 10-12-2010 / 14:47:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14075
    "Modified: / 10-12-2010 / 20:58:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14076
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14077
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14078
_Unsafe_allocateMemory:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14079
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14080
    | size |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14081
    size := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14082
    ^SimulatedNativeMemory malloc: size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14083
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14084
    "Created: / 07-12-2010 / 21:04:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14085
    "Modified: / 07-12-2010 / 23:46:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14086
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14087
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14088
_Unsafe_compareAndSwapInt:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14089
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14090
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14091
     * Atomically update Java variable to <tt>x</tt> if it is currently
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14092
     * holding <tt>expected</tt>.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14093
     * @return <tt>true</tt> if successful
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14094
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14095
    public final native boolean compareAndSwapInt(Object o, long offset,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14096
                                                  int expected,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14097
                                                  int new);
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14098
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14099
    | o offset expected real new ok |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14100
    o := aJavaContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14101
    offset := aJavaContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14102
    "offset is long, so aJavaContext at:3 is dummy nil!!!!!!"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14103
    expected := aJavaContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14104
    new := aJavaContext argAt:5.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14105
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14106
    OperatingSystem blockInterrupts.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14107
    real := o instVarAt: offset.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14108
    (real == expected)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14109
            ifTrue:[o instVarAt: offset put: new. ok := true]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14110
            ifFalse:[ok := false].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14111
    OperatingSystem unblockInterrupts.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14112
    ^ok
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14113
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14114
    "Created: / 22-11-2010 / 18:40:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14115
    "Modified: / 06-02-2011 / 12:10:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14116
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14117
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14118
_Unsafe_ensureClassInitialized:aJavaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14119
    |class|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14120
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14121
    class := self reflection classForJavaClassObject:(aJavaContext argAt:1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14122
     "Sometimes there is a nil. I don't know why, so I did quickfix"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14123
    self breakPoint:#libjava.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14124
    class ifNotNil:[class classInit.].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14125
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14126
    "Created: / 11-12-2010 / 15:01:36 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14127
    "Modified: / 25-12-2010 / 09:43:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14128
    "Modified: / 08-01-2011 / 15:11:21 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14129
    "Modified: / 28-01-2011 / 15:19:31 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14130
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14131
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14132
_Unsafe_freeMemory:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14133
     | address  |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14134
    address := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14135
    ^SimulatedNativeMemory free: address
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14136
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14137
    "Created: / 09-12-2010 / 17:56:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14138
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14139
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14140
_Unsafe_getByte:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14141
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14142
     | address  |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14143
    address := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14144
    ^SimulatedNativeMemory byteAt: address
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14145
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14146
    "Created: / 09-12-2010 / 17:29:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14147
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14148
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14149
_Unsafe_objectFieldOffset:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14150
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14151
    | javaFieldObject |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14152
    javaFieldObject := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14153
    ^javaFieldObject instVarNamed: #slot
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14154
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14155
    "Created: / 22-11-2010 / 17:58:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14156
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14157
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14158
_Unsafe_putLong:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14159
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14160
    | address value |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14161
    address := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14162
    value := aJavaContext argAt: 3. 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14163
        "3!!!!!! since at index 2 there is dummy long high word"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14164
        "Ask JV for more details"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14165
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14166
    SimulatedNativeMemory longAt: address put: value
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14167
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14168
    "Created: / 07-12-2010 / 23:50:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14169
    "Modified: / 09-12-2010 / 17:31:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14170
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14171
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14172
_Unsafe_registerNatives:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14173
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14174
     "Nothing to do, native method are bound lazily"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14175
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14176
    "Created: / 25-10-2010 / 16:14:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14177
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14178
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14179
_VM_initialize:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14180
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14181
    "Nothing to do"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14182
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14183
    "Created: / 26-11-2010 / 18:43:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14184
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14185
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14186
_ZipEntry_initFields: aJavaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14187
    | entry jzentry zmember |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14188
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14189
    entry := aJavaContext receiver.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14190
    jzentry := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14191
    zmember := ZipEntryCache at: jzentry.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14192
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14193
    entry 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14194
        instVarNamed: #time     put: zmember lastModFileTime;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14195
        instVarNamed: #crc      put: zmember crc32;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14196
        instVarNamed: #size     put: zmember uncompressedSize;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14197
        instVarNamed: #csize    put: zmember compressedSize;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14198
        instVarNamed: #method   put: zmember compressionMethod;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14199
        instVarNamed: #extra    put: zmember extraField;
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14200
        instVarNamed: #comment  put: (zmember fileComment ifNotNil:[Java as_String: zmember fileComment]).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14201
        
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14202
        
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14203
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14204
    "Created: / 01-04-2011 / 13:04:24 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14205
    "Modified: / 29-04-2011 / 20:01:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14206
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14207
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14208
_ZipEntry_initIDs: aJavaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14209
    "hopefully nothing to do"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14210
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14211
    "Created: / 01-04-2011 / 13:02:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14212
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14213
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14214
_ZipFile_freeEntry: javaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14215
    | zipArchiveIndex  zipEntryIndex |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14216
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14217
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14218
    zipArchiveIndex := javaContext at: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14219
    zipEntryIndex := javaContext at: 3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14220
    zipEntryIndex = 0 ifFalse: [ ZipEntryCache at: zipEntryIndex put: nil ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14221
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14222
    "Created: / 01-04-2011 / 13:06:19 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14223
    "Modified: / 01-04-2011 / 16:02:56 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14224
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14225
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14226
_ZipFile_getCSize:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14227
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14228
    | jzentry zmember |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14229
    jzentry := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14230
    zmember := ZipEntryCache at: jzentry.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14231
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14232
    ^zmember compressedSize
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14233
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14234
    "Created: / 30-04-2011 / 21:50:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14235
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14236
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14237
_ZipFile_getEntry: javaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14238
    | zipArchive  filename  result |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14239
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14240
    zipArchive := ZipCache at: (javaContext at: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14241
    filename := Java as_ST_String: (javaContext at: 3).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14242
    result := (zipArchive membersMatching: filename).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14243
    result size = 0 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14244
        ifTrue: [ ^ 0 ]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14245
        ifFalse: [ ^ ZipEntryCache indexOf: (ZipEntryCache add: result first) ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14246
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14247
    "Created: / 27-03-2011 / 16:59:03 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14248
    "Modified: / 01-04-2011 / 16:03:01 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14249
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14250
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14251
_ZipFile_getMethod:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14252
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14253
    | jzentry zmember |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14254
    jzentry := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14255
    zmember := ZipEntryCache at: jzentry.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14256
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14257
    ^zmember compressionMethod
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14258
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14259
    "Created: / 30-04-2011 / 21:53:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14260
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14261
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14262
_ZipFile_getSize:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14263
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14264
    | jzentry zmember |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14265
    jzentry := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14266
    zmember := ZipEntryCache at: jzentry.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14267
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14268
    ^zmember uncompressedSize
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14269
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14270
    "Created: / 30-04-2011 / 21:53:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14271
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14272
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14273
_ZipFile_getTotal: javaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14274
    | zipArchive |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14275
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14276
    zipArchive := ZipCache at: (javaContext at: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14277
    ^ zipArchive entries size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14278
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14279
    "Created: / 27-03-2011 / 16:29:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14280
    "Modified: / 01-04-2011 / 15:48:46 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14281
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14282
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14283
_ZipFile_initIDs:aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14284
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14285
    "Nothing to do"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14286
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14287
    "Created: / 23-03-2011 / 19:37:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14288
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14289
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14290
_ZipFile_open: javaContext 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14291
    | path  mode  lastModTime  result |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14292
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14293
    path := Java as_ST_String: (javaContext at: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14294
    mode := javaContext at: 2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14295
    lastModTime := javaContext at: 3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14296
    result := path asFilename.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14297
    result ifNil: [ JavaVM throwZipException ].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14298
    ^ ZipCache 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14299
        indexOf: ( ZipCache add: (ZipArchive readingFrom: result readStream) ).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14300
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14301
    "Modified: / 01-04-2011 / 15:35:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14302
!
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14303
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14304
_ZipFile_read:aJavaContext
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14305
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14306
    | jzfile jzentry pos b off len zar zmember data nread |
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14307
    jzfile := aJavaContext argAt: 1.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14308
    jzentry := aJavaContext argAt: 3. "first arg is long!!!!!!"
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14309
    pos := aJavaContext argAt: 5. "jzentry arg is long!!!!!!"
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14310
    b := aJavaContext argAt: 7.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14311
    off := aJavaContext argAt: 8.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14312
    len := aJavaContext argAt: 9.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14313
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14314
    zar := ZipCache at: jzfile.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14315
    zmember := ZipEntryCache at: jzentry.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14316
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14317
    data := zar extract: zmember fileName.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14318
    nread := len min: (data size - pos).
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14319
    b replaceFrom: off to: off + len with: data startingAt: nread.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14320
    ^nread.
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14321
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 14322
    "Created: / 30-04-2011 / 22:15:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14323
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14324
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14325
!JavaVM class methodsFor:'native - sun.misc'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14326
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14327
_sun_misc_Signal_findSignal: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14328
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14329
    <javanative: 'sun/misc/Signal' name: 'findSignal'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14330
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14331
        | input signame |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14332
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14333
    input := Java as_ST_String: (aJavaContext argAt: 1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14334
    signame := 'SIG', (input asUppercase).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14335
    ^ UnixOperatingSystem signalNamed: signame asSymbol.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14336
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14337
    "Created: / 11-12-2010 / 15:22:07 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14338
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14339
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14340
_sun_misc_Signal_handle0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14341
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14342
    <javanative: 'sun/misc/Signal' name: 'handle0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14343
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14344
        self breakPoint: #libjava.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14345
    ^ 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14346
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14347
    "Created: / 11-12-2010 / 16:33:38 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14348
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14349
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14350
_sun_misc_Unsafe_allocateMemory: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14351
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14352
    <javanative: 'sun/misc/Unsafe' name: 'allocateMemory'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14353
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14354
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14355
    | size |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14356
    size := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14357
    ^SimulatedNativeMemory malloc: size.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14358
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14359
    "Created: / 07-12-2010 / 21:04:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14360
    "Modified: / 07-12-2010 / 23:46:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14361
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14362
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14363
_sun_misc_Unsafe_compareAndSwapInt: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14364
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14365
    <javanative: 'sun/misc/Unsafe' name: 'compareAndSwapInt'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14366
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14367
        "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14368
    /**
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14369
     * Atomically update Java variable to <tt>x</tt> if it is currently
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14370
     * holding <tt>expected</tt>.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14371
     * @return <tt>true</tt> if successful
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14372
     */
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14373
    public final native boolean compareAndSwapInt(Object o, long offset,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14374
                                                  int expected,
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14375
                                                  int new);
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14376
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14377
    | o offset expected real new ok |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14378
    o := aJavaContext argAt:1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14379
    offset := aJavaContext argAt:2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14380
    "offset is long, so aJavaContext at:3 is dummy nil!!!!!!"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14381
    expected := aJavaContext argAt:4.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14382
    new := aJavaContext argAt:5.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14383
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14384
    OperatingSystem blockInterrupts.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14385
    real := o instVarAt: offset.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14386
    (real == expected)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14387
            ifTrue:[o instVarAt: offset put: new. ok := true]
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14388
            ifFalse:[ok := false].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14389
    OperatingSystem unblockInterrupts.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14390
    ^ok
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14391
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14392
    "Created: / 22-11-2010 / 18:40:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14393
    "Modified: / 06-02-2011 / 12:10:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14394
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14395
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14396
_sun_misc_Unsafe_ensureClassInitialized: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14397
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14398
    <javanative: 'sun/misc/Unsafe' name: 'ensureClassInitialized'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14399
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14400
        |class|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14401
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14402
    class := self reflection classForJavaClassObject:(aJavaContext argAt:1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14403
     "Sometimes there is a nil. I don't know why, so I did quickfix"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14404
    self breakPoint:#libjava.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14405
    class ifNotNil:[class classInit.].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14406
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14407
    "Created: / 11-12-2010 / 15:01:36 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14408
    "Modified: / 25-12-2010 / 09:43:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14409
    "Modified: / 08-01-2011 / 15:11:21 / Jan Kurs <kurs.jan@post.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14410
    "Modified: / 28-01-2011 / 15:19:31 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14411
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14412
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14413
_sun_misc_Unsafe_freeMemory: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14414
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14415
    <javanative: 'sun/misc/Unsafe' name: 'freeMemory'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14416
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14417
         | address  |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14418
    address := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14419
    ^SimulatedNativeMemory free: address
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14420
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14421
    "Created: / 09-12-2010 / 17:56:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14422
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14423
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14424
_sun_misc_Unsafe_getByte: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14425
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14426
    <javanative: 'sun/misc/Unsafe' name: 'getByte'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14427
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14428
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14429
     | address  |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14430
    address := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14431
    ^SimulatedNativeMemory byteAt: address
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14432
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14433
    "Created: / 09-12-2010 / 17:29:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14434
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14435
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14436
_sun_misc_Unsafe_objectFieldOffset: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14437
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14438
    <javanative: 'sun/misc/Unsafe' name: 'objectFieldOffset'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14439
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14440
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14441
    | javaFieldObject |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14442
    javaFieldObject := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14443
    ^javaFieldObject instVarNamed: #slot
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14444
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14445
    "Created: / 22-11-2010 / 17:58:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14446
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14447
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14448
_sun_misc_Unsafe_putLong: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14449
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14450
    <javanative: 'sun/misc/Unsafe' name: 'putLong'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14451
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14452
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14453
    | address value |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14454
    address := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14455
    value := aJavaContext argAt: 3. 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14456
        "3!!!!!! since at index 2 there is dummy long high word"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14457
        "Ask JV for more details"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14458
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14459
    SimulatedNativeMemory longAt: address put: value
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14460
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14461
    "Created: / 07-12-2010 / 23:50:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14462
    "Modified: / 09-12-2010 / 17:31:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14463
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14464
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14465
_sun_misc_Unsafe_registerNatives: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14466
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14467
    <javanative: 'sun/misc/Unsafe' name: 'registerNatives'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14468
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14469
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14470
     "Nothing to do, native method are bound lazily"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14471
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14472
    "Created: / 25-10-2010 / 16:14:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14473
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14474
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14475
_sun_misc_VM_initialize: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14476
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14477
    <javanative: 'sun/misc/VM' name: 'initialize'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14478
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14479
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14480
    "Nothing to do"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14481
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14482
    "Created: / 26-11-2010 / 18:43:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14483
! !
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14484
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14485
!JavaVM class methodsFor:'native - sun.reflect'!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14486
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14487
_sun_reflect_NativeConstructorAccessorImpl_newInstance0: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14488
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14489
    <javanative: 'sun/reflect/NativeConstructorAccessorImpl' name: 'newInstance0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14490
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14491
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14492
    | ctor args method instance |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14493
    ctor := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14494
    args := aJavaContext argAt: 2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14495
    args ifNil:[args := #()] ifNotNil:[args := args asArray].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14496
    method := self reflection methodForJavaConstructorObject: ctor.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14497
    instance := method javaClass new.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14498
    method valueWithReceiver:instance arguments:args.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14499
    ^instance
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14500
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14501
    "Created: / 26-11-2010 / 11:41:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14502
    "Modified: / 04-02-2011 / 18:47:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14503
    "Modified: / 09-02-2011 / 01:12:10 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14504
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14505
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14506
_sun_reflect_NativeMethodAccessorImpl_invoke0: nativeContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14507
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14508
    <javanative: 'sun/reflect/NativeMethodAccessorImpl' name: 'invoke0'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14509
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14510
        "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14511
    private static native Object invoke0(Method m, Object obj, Object[] args);
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14512
    "
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14513
    | m obj args |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14514
    m := nativeContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14515
    obj := nativeContext argAt: 2.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14516
    args := nativeContext argAt: 3.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14517
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14518
    ^(self reflection methodForJavaMethodObject: m) 
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14519
        valueWithReceiver: obj
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14520
        arguments: (args ? #()) asArray.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14521
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14522
    "Created: / 06-02-2011 / 00:00:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14523
    "Modified: / 28-02-2011 / 16:57:31 / Marcel Hlopko <hlopik@gmail.com>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14524
    "Modified: / 16-03-2011 / 15:31:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14525
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14526
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14527
_sun_reflect_Reflection_getCallerClass: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14528
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14529
    <javanative: 'sun/reflect/Reflection' name: 'getCallerClass'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14530
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14531
    
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14532
    | framesToSkip framesSkipped frame |
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14533
    framesToSkip := aJavaContext argAt: 1.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14534
    framesSkipped := 0.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14535
    frame := aJavaContext.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14536
    [ framesSkipped == framesToSkip ] whileFalse:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14537
        [frame := frame sender.
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14538
        framesSkipped := framesSkipped + 1].
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14539
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14540
    ^JavaVM javaClassObjectForClass:
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14541
        (frame receiver class theNonMetaclass)
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14542
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14543
    "Created: / 25-10-2010 / 16:32:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14544
!
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14545
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14546
_sun_reflect_Reflection_getClassAccessFlags: aJavaContext
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14547
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14548
    <javanative: 'sun/reflect/Reflection' name: 'getClassAccessFlags'>
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14549
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14550
        |class|
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14551
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14552
    class := self reflection classForJavaClassObject:(aJavaContext argAt:1).
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14553
    ^ class accessFlags
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14554
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14555
    "Created: / 26-11-2010 / 10:20:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 14556
    "Modified: / 28-01-2011 / 15:19:28 / Marcel Hlopko <hlopik@gmail.com>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14557
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14558
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14559
!JavaVM class methodsFor:'semaphores & monitors'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14560
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14561
enteredMonitors
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14562
    ^ self enteredMonitorsOfProcess:(Processor activeProcess)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14563
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14564
    "Modified: / 8.1.1999 / 14:02:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14565
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14566
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14567
enteredMonitorsOfProcess:aProcess
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14568
    |monitors|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14569
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14570
    monitors := EnteredMonitorsPerProcess at:aProcess ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14571
    monitors isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14572
	monitors := OrderedCollection new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14573
	EnteredMonitorsPerProcess at:aProcess put:monitors.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14574
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14575
    ^ monitors
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14576
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14577
    "Created: / 8.1.1999 / 14:02:02 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14578
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14579
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14580
monitorFor:someObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14581
    |mon|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14582
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14583
    LockTableAccess critical:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14584
	mon := LockTable at:someObject ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14585
	mon isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14586
	    LockTable at:someObject put:(mon := Monitor new)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14587
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14588
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14589
    ^ mon
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14590
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14591
    "Created: / 2.1.1998 / 19:01:52 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14592
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14593
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14594
releaseAndSignalForAllSemaphoreFor:someObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14595
    |sema|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14596
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14597
    WaitTableAccess critical:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14598
	sema := WaitTable at:someObject ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14599
"/        sema notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14600
"/            WaitTable removeKey:someObject
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
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14604
    sema notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14605
	sema signalForAll
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14606
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14607
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14608
    "Created: / 2.1.1998 / 18:21:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14609
    "Modified: / 3.2.1998 / 16:11:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14610
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14611
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14612
releaseAndSignalSemaphoreFor:someObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14613
    |sema|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14614
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14615
    WaitTableAccess critical:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14616
	sema := WaitTable at:someObject ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14617
"/        sema notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14618
"/            WaitTable removeKey:someObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14619
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14620
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14621
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14622
    sema notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14623
	sema signal
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14624
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14625
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14626
    "Created: / 2.1.1998 / 18:20:20 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14627
    "Modified: / 3.2.1998 / 16:11:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14628
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14629
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14630
releaseSemaphoreFor:someObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14631
    WaitTableAccess critical:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14632
	WaitTable removeKey:someObject ifAbsent:nil
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14633
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14634
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14635
    "Created: / 2.1.1998 / 18:17:14 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14636
    "Modified: / 2.1.1998 / 21:52:03 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14637
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14638
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14639
semaphoreFor:someObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14640
    |sema|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14641
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14642
    WaitTableAccess critical:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14643
	sema := WaitTable at:someObject ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14644
	sema isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14645
	    WaitTable at:someObject put:(sema := Semaphore new)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14646
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14647
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14648
    ^ sema
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14649
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14650
    "Created: / 2.1.1998 / 18:15:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14651
    "Modified: / 2.1.1998 / 18:20:31 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14652
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14653
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14654
syncMonitorCache
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14655
    |mO mC mP mon wasBlocked enteredMonitors|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14656
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14657
    wasBlocked := OperatingSystem blockInterrupts.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14658
    (mO := EnteredMonitorObject) notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14659
	mC := EnteredMonitorObjectCount.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14660
	mP := EnteredMonitorProcess.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14661
	mon := self monitorFor:mO.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14662
	mon fakeEnter:mP count:mC.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14663
	enteredMonitors := self enteredMonitorsOfProcess:mP.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14664
	mC timesRepeat:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14665
	    enteredMonitors addLast:mO
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14666
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14667
	EnteredMonitorObject := EnteredMonitorProcess := LeftMonitorObject := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14668
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14669
    wasBlocked ifFalse:[ OperatingSystem unblockInterrupts].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14670
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14671
    "Created: / 8.1.1999 / 13:59:17 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14672
    "Modified: / 9.1.1999 / 00:39:55 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14673
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14674
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14675
waitFor:sema state:pState timeOut:tmo
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14676
    "wait"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14677
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14678
    |wasBlocked thisProcess enteredMonitors|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14679
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14680
"/    self syncMonitorCache.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14681
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14682
    thisProcess := Processor activeProcess.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14683
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14684
    "/ temporarily leave all entered monitors.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14685
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14686
    wasBlocked := OperatingSystem blockInterrupts.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14687
    self syncMonitorCache.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14688
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14689
    enteredMonitors := self enteredMonitorsOfProcess:thisProcess.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14690
    enteredMonitors size > 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14691
	MonitorTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14692
	    ('====> wait - exit ' , enteredMonitors size printString , ' monitors in ' , Processor activeProcess name , ' ...') infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14693
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14694
	enteredMonitors do:[:handle | 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14695
	    |mon|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14696
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14697
	    mon := LockTable at:handle ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14698
	    mon isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14699
		self halt:'no monitor in wait'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14700
	    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14701
		MonitorTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14702
		    ('====> wait - exit monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14703
		].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14704
		mon exit.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14705
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14706
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14707
	EnteredMonitorsPerProcess removeKey:thisProcess.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14708
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14709
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14710
    wasBlocked ifFalse:[ OperatingSystem unblockInterrupts].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14711
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14712
    pState notNil ifTrue:[thisProcess state:pState].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14713
    sema isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14714
	Delay waitForMilliseconds:tmo
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14715
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14716
	(tmo isNil or:[tmo = 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14717
	    sema wait.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14718
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14719
	    sema waitWithTimeout:tmo / 1000.
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
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14723
    "/ re-enter monitors.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14724
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14725
    enteredMonitors size > 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14726
	wasBlocked := OperatingSystem blockInterrupts.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14727
	self syncMonitorCache.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14728
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14729
	MonitorTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14730
	    ('====> wait - reenter ' , enteredMonitors size printString , ' monitors in ' , Processor activeProcess name , ' ...') infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14731
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14732
	enteredMonitors do:[:handle | 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14733
	    |mon|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14734
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14735
	    LockTableAccess critical:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14736
		mon := LockTable at:handle ifAbsent:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14737
		mon isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14738
		    LockTable at:handle put:(mon := Monitor new)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14739
		]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14740
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14741
	    MonitorTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14742
		('====> wait - reenter monitor for ' , handle displayString , ' in ' , Processor activeProcess name , ' ...') infoPrintCR. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14743
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14744
	    mon enter.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14745
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14746
	EnteredMonitorsPerProcess at:thisProcess put:enteredMonitors.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14747
	wasBlocked ifFalse:[ OperatingSystem unblockInterrupts].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14748
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14749
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14750
    "Created: / 30.12.1998 / 19:19:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14751
    "Modified: / 8.1.1999 / 17:29:24 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14752
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14753
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14754
!JavaVM class methodsFor:'vm support'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14755
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14756
_ANEWARRAY:classRef _: size
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14757
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14758
    | ref |
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14759
    ref := classRef.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14760
    ref isUnresolved ifTrue:[ref := ref javaClass].
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14761
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14762
    self assert: ref arrayClass isJavaArrayClass.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14763
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14764
    ^ref arrayClass new: size
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14765
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14766
    "Created: / 17-12-2010 / 14:28:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14767
    "Modified: / 25-04-2011 / 20:21:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14768
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14769
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14770
_ARRAYLENGTH:arr
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14771
    arr isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14772
	self halt:'should not happen'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14773
	self throwNullPointerException.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14774
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14775
    ^ arr size
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14776
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14777
    "Created: / 8.1.1999 / 14:38:27 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14778
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14779
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14780
_ATHROW:aJavaException
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14781
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14782
    <resource: #skipInDebuggersWalkBack>
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14783
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14784
    aJavaException isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14785
        self halt:'cannot happen'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14786
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14787
    self throwException:aJavaException.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14788
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14789
    "Created: / 08-01-1999 / 14:15:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14790
    "Modified: / 04-03-2011 / 00:07:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14791
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14792
760
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14793
_CHECKCAST:object _: classOrClassRef
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14794
    "Trampouline for unhandled cases ..."
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14795
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14796
    | class |
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14797
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14798
    class := classOrClassRef javaClass.
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14799
5f55da80009b JavaVM: few fixes in VM callbacks (getting rid of all __jresolveMethod() in jinterpret.c)
vranyj1
parents: 758
diff changeset
 14800
    "
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14801
    Java VM Spec, 3rd edition, p 280:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14802
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14803
    If objectref is null, the checkcast instruction throws a ClassCastException.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14804
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14805
    ("object isNil"false or:[(self canCast: object class to: class) not])
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14806
        ifTrue:[self throwClassCastException. ^false].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14807
    ^true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14808
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14809
    "Created: / 08-01-1999 / 14:53:51 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14810
    "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
 14811
    "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
 14812
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14813
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14814
_D2I:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14815
    |v|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14816
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14817
    v := op1 asInteger.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14818
    v > 16r7FFFFFFF ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14819
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14820
	v := 16r7FFFFFFF
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14821
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14822
	v < 16r80000000 negated ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14823
	    self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14824
	    v := 16r80000000 negated
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14825
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14826
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14827
    ^ v
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14828
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14829
    "Modified: / 17.10.1998 / 21:55:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14830
    "Created: / 8.1.1999 / 14:47:13 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14831
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14832
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14833
_D2L:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14834
    |v|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14835
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14836
    v := op1 asInteger.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14837
    v > 16r7FFFFFFFFFFFFFFF ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14838
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14839
	v := 16r7FFFFFFFFFFFFFFF
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14840
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14841
	v < 16r8000000000000000 negated ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14842
	    self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14843
	    v := 16r8000000000000000 negated
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14844
	]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14845
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14846
    ^ v
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14847
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14848
    "Modified: / 17.10.1998 / 21:55:49 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14849
    "Created: / 8.1.1999 / 14:46:44 / cg"
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
_DADD:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14853
    ^ op1 asFloat + op2 asFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14854
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14855
    "Created: / 8.1.1999 / 15:11:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14856
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14857
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14858
_DDIV:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14859
    ^ op1 asFloat / op2 asFloat.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14860
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14861
    "Created: / 8.1.1999 / 15:09:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14862
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14863
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14864
_DMUL:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14865
    ^ op1 asFloat * op2 asFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14866
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14867
    "Created: / 8.1.1999 / 14:49:52 / 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
_DNEG:op
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14871
    ^ op asFloat negated
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14872
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14873
    "Created: / 8.1.1999 / 15:06:15 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14874
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14875
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14876
_DSUB:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14877
    ^ op1 asFloat - op2 asFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14878
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14879
    "Created: / 8.1.1999 / 15:10:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14880
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14881
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14882
_F2I:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14883
    ^ self _D2I:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14884
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14885
    "Created: / 8.1.1999 / 14:47:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14886
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14887
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14888
_F2L:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14889
    ^ self _D2L:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14890
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14891
    "Created: / 8.1.1999 / 14:47:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14892
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14893
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14894
_FADD:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14895
    ^ op1 asShortFloat + op2 asShortFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14896
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14897
    "Created: / 8.1.1999 / 15:11:36 / cg"
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
_FDIV:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14901
    ^ op1 asShortFloat / op2 asShortFloat.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14902
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14903
    "Created: / 8.1.1999 / 15:09:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14904
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14905
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14906
_FMUL:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14907
    ^ op1 asShortFloat * op2 asShortFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14908
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14909
    "Created: / 8.1.1999 / 14:50:10 / cg"
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
_FNEG:op
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14913
    ^ op asShortFloat negated
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14914
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14915
    "Created: / 8.1.1999 / 15:06:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14916
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14917
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14918
_FSUB:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14919
    ^ op1 asShortFloat - op2 asShortFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14920
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14921
    "Created: / 8.1.1999 / 15:08:17 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14922
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14923
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14924
_INSTANCEOF:object _:class
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14925
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14926
    object ifNil:[^0].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14927
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14928
    ^(self canCast: object class to: class)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14929
        ifTrue:[1]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14930
        ifFalse:[0]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14931
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14932
    "Created: / 08-01-1999 / 14:52:54 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14933
    "Modified: / 27-01-1999 / 20:56:25 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14934
    "Modified: / 25-02-2011 / 18:31:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14935
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14936
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14937
_L2D:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14938
    ^ op1 asFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14939
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14940
    "Created: / 8.1.1999 / 14:46:09 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14941
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14942
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14943
_L2F:op1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14944
    ^ op1 asShortFloat
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14945
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14946
    "Created: / 8.1.1999 / 14:46:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14947
    "Modified: / 8.1.1999 / 14:50:18 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14948
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14949
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14950
_LADD:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14951
    |sum|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14952
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14953
    sum := (op1 + op2) bitAnd:16rFFFFFFFFFFFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14954
    ^ sum
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14955
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14956
    "Created: / 8.1.1999 / 15:07:39 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14957
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14958
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14959
_LAND:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14960
    |rslt|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14961
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14962
    (op1 < 0 or:[op2 < 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14963
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14964
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14965
    rslt := op1 bitAnd: op2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14966
    ^ rslt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14967
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14968
    "Modified: / 7.1.1998 / 21:21:53 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14969
    "Created: / 8.1.1999 / 14:54:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14970
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14971
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14972
_LDIV:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14973
    |quo|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14974
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14975
    quo := op1 quo: op2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14976
    ^ quo
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14977
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14978
    "Created: / 8.1.1999 / 15:04:47 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14979
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14980
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14981
_LMUL:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14982
    |prod o1 o2 sign|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14983
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14984
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14985
    "/ ST's largeIntegers compute a correct result;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14986
    "/ but here, we want the overflow to flow into the
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14987
    "/ sign bit ... (sigh)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14988
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14989
    sign := 1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14990
    (o1 := op1) < 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14991
	sign := -1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14992
	o1 := o1 negated.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14993
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14994
    (o2 := op2) < 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14995
	sign := sign negated.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14996
	o2 := o2 negated.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14997
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14998
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 14999
    prod := (o1 * o2) bitAnd:16rFFFFFFFFFFFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15000
    (prod bitAnd:16r8000000000000000) ~~ 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15001
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15002
    sign == -1 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15003
	prod := prod negated
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15004
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15005
    ^ prod
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15006
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15007
    "Created: / 8.1.1999 / 15:10:04 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15008
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15009
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15010
_LNEG:op
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15011
    ^ op asInteger negated
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15012
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15013
    "Created: / 8.1.1999 / 15:06:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15014
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15015
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15016
_LOR:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15017
    |rslt|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15018
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15019
    (op1 < 0 or:[op2 < 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15020
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15021
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15022
    rslt := op1 bitOr: op2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15023
    ^ rslt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15024
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15025
    "Created: / 8.1.1999 / 15:05:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15026
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15027
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15028
_LREM:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15029
    |rem|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15030
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15031
    rem := op1 rem: op2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15032
    ^ rem
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15033
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15034
    "Modified: / 7.1.1998 / 00:23:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15035
    "Created: / 8.1.1999 / 15:04:23 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15036
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15037
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15038
_LSHL:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15039
    |rslt|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15040
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15041
    (op1 < 0) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15042
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15043
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15044
    rslt := (op1 bitShift:op2) bitAnd:16rFFFFFFFFFFFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15045
    ^ rslt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15046
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15047
    "Created: / 8.1.1999 / 14:51:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15048
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15049
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15050
_LSHR:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15051
    |rslt|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15052
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15053
    op1 < 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15054
	self halt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15055
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15056
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15057
    (op1 < 0) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15058
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15059
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15060
    rslt := (op1 bitShift:op2 negated) bitAnd:16rFFFFFFFFFFFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15061
    ^ rslt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15062
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15063
    "Created: / 8.1.1999 / 14:51:57 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15064
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15065
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15066
_LSUB:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15067
    |diff|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15068
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15069
    diff := (op1 - op2) bitAnd:16rFFFFFFFFFFFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15070
    ^ diff
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15071
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15072
    "Created: / 8.1.1999 / 15:10:33 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15073
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15074
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15075
_LUSHR:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15076
    |rslt|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15077
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15078
    op1 < 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15079
	self halt
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
    (op1 < 0) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15083
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15084
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15085
    rslt := (op1 bitShift:op2 negated) bitAnd:16rFFFFFFFFFFFFFFFF.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15086
    ^ rslt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15087
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15088
    "Modified: / 7.1.1998 / 21:22:17 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15089
    "Created: / 8.1.1999 / 14:51:32 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15090
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15091
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15092
_LXOR:op1 _:op2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15093
    |rslt|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15094
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15095
    (op1 < 0 or:[op2 < 0]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15096
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15097
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15098
    rslt := op1 bitXor: op2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15099
    ^ rslt
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15100
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15101
    "Created: / 8.1.1999 / 15:12:28 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15102
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15103
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15104
_MONITORENTER:someObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15105
    |mon thisProcess|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15106
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15107
    someObject isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15108
	self throwNullPointerException.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15109
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15110
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15111
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15112
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15113
    self syncMonitorCache.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15114
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15115
    LeftMonitorObject := nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15116
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15117
    thisProcess := Processor activeProcess.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15118
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15119
    mon := self monitorFor:someObject.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15120
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15121
    MonitorTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15122
	('====> entering monitor for ' , someObject displayString , ' in ' , thisProcess name , ' ...') printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15123
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15124
    mon enter.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15125
    MonitorTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15126
	('====> entered it in ' , thisProcess name , ' ...') printCR.
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
    (self enteredMonitorsOfProcess:thisProcess) add:someObject.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15130
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15131
    "Created: / 8.1.1999 / 14:23:10 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15132
    "Modified: / 8.1.1999 / 18:47:26 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15133
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15134
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15135
_MONITOREXIT:someObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15136
    |mon thisProcess wasBlocked lastMon|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15137
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15138
    someObject isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15139
	self throwNullPointerException.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15140
	self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15141
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15142
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15143
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15144
    self syncMonitorCache.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15145
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15146
    thisProcess := Processor activeProcess.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15147
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15148
    mon := self monitorFor:someObject.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15149
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15150
    MonitorTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15151
	('====> leaving monitor for ' , someObject displayString , ' in ' , thisProcess name , ' ...') printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15152
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15153
    mon exit.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15154
    MonitorTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15155
	('====> left it in ' , thisProcess name , ' ...') printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15156
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15157
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15158
    lastMon := (self enteredMonitorsOfProcess:thisProcess) removeLast.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15159
    lastMon ~~ someObject ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15160
	self halt:'oops - monitor enter/exit nesting wrong'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15161
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15162
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15163
    wasBlocked := OperatingSystem blockInterrupts.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15164
    mon count == 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15165
	LeftMonitorObject := someObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15166
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15167
    wasBlocked ifFalse:[ OperatingSystem unblockInterrupts ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15168
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15169
    "Created: / 8.1.1999 / 14:23:19 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15170
    "Modified: / 8.1.1999 / 18:47:08 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15171
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15172
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15173
_MULTINEW:typeRef _:dim1 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15174
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15175
    |arr|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15176
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15177
    arr := typeRef new:dim1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15178
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15179
    ^ arr
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15180
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15181
    "Created: / 08-01-1999 / 14:15:42 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15182
    "Modified: / 08-01-1999 / 18:03:05 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15183
    "Modified: / 16-03-2011 / 16:20:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15184
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15185
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15186
_MULTINEW:typeRef _:dim1 _:dim2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15187
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15188
    | arr |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15189
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15190
    arr := typeRef new:dim2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15191
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15192
    1 to:dim2 do:[:idx |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15193
        arr at:idx put:(self _MULTINEW:typeRef javaComponentClass _:dim1)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15194
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15195
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15196
    ^ arr
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15197
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15198
    "Created: / 08-01-1999 / 14:15:46 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15199
    "Modified: / 08-01-1999 / 17:58:11 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15200
    "Modified: / 16-03-2011 / 16:19:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15201
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15202
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15203
_MULTINEW:typeRef _:dim1 _:dim2 _:dim3
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15204
    |clsRef cls arr elType elSizes|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15205
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15206
    clsRef := typeRef asClassPointerRef.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15207
    cls := clsRef arrayClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15208
    arr := cls new:dim3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15209
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15210
    elType := typeRef deref.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15211
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15212
    1 to:dim3 do:[:idx |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15213
	arr at:idx put:(self _MULTINEW:elType _:dim1 _:dim2)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15214
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15215
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15216
"/ self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15217
    ^ arr
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15218
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15219
    "Modified: / 6.1.1998 / 23:34:35 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15220
    "Created: / 8.1.1999 / 14:15:49 / cg"
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
!JavaVM class methodsFor:'windows - events'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15224
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15225
awtEventsForEvent:anEvent javaWindow:jWin
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15226
    "given an ST/X event, create corresponding AWT event(s) for it"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15227
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15228
    |jEv jEv1 jEv2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15229
     modifiers key keyChar untranslatedKey id 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15230
     type x y w h view menu resized moved
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15231
     eventArgs clickCount jRect
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15232
     jKeyEventClass jInputEventClass jMouseEventClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15233
     jWindowEventClass jPaintEventClass jComponentEventClass|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15234
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15235
    type := anEvent type.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15236
    eventArgs := anEvent arguments.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15237
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15238
    key := 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15239
    modifiers := 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15240
    x := 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15241
    y := 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15242
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15243
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15244
    ((type == #'exposeX:y:width:height:') 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15245
    or:[(type == #'graphicExposeX:y:width:height:')
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15246
    or:[(type == #damage)]]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15247
"/        jWindowEventClass := Java classForName:'java.awt.event.WindowEvent'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15248
"/        id := (jPaintEventClass instVarNamed:'PAINT').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15249
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15250
	jPaintEventClass := Java classForName:'java.awt.event.PaintEvent'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15251
	id := (jPaintEventClass instVarNamed:'UPDATE').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15252
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15253
	((type == #'exposeX:y:width:height:') 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15254
	or:[(type == #'graphicExposeX:y:width:height:')]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15255
	    x := eventArgs at:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15256
	    y := eventArgs at:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15257
	    w := eventArgs at:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15258
	    h := eventArgs at:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15259
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15260
	    x := eventArgs left.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15261
	    y := eventArgs top.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15262
	    w := eventArgs width.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15263
	    h := eventArgs height.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15264
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15265
	jRect := (Java classForName:'java.awt.Rectangle') basicNew.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15266
	jRect instVarNamed:'x' put:x.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15267
	jRect instVarNamed:'y' put:y.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15268
	jRect instVarNamed:'width' put:w.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15269
	jRect instVarNamed:'height' put:h.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15270
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15271
	jEv := jPaintEventClass newCleared "basicNew".
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15272
	jEv instVarNamed:'id'        put:id.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15273
	jEv instVarNamed:'updateRect' put:jRect.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15274
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15275
"/        jEv instVarNamed:'g'         put:jWin.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15276
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15277
	^ Array with:jEv.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15278
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15279
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15280
    (anEvent isKeyEvent 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15281
    or:[anEvent isButtonEvent
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15282
    or:[anEvent isPointerEnterLeaveEvent]]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15283
	jInputEventClass := Java classForName:'java.awt.event.InputEvent'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15284
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15285
	anEvent hasAlt ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15286
	    modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'ALT_MASK')
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15287
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15288
	anEvent hasCtrl ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15289
	    modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'CTRL_MASK')
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15290
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15291
	anEvent hasMeta ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15292
	    modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'META_MASK')
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15293
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15294
	anEvent hasShift ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15295
	    modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'SHIFT_MASK')
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15296
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15297
	anEvent hasButton1 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15298
	    modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'BUTTON1_MASK')
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15299
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15300
	anEvent hasButton2 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15301
	    modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'BUTTON2_MASK')
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15302
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15303
	anEvent hasButton3 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15304
	    modifiers := modifiers bitOr:(jInputEventClass instVarNamed:'BUTTON3_MASK')
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15305
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15306
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15307
	anEvent isPointerEnterLeaveEvent ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15308
	    "/ ST/X does not (yet) record this information
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15309
	    "/ with pointerLeave events.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15310
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15311
	    x := anEvent x.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15312
	    y := anEvent y.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15313
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15314
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15315
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15316
    anEvent isKeyEvent ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15317
	jKeyEventClass := Java classForName:'java.awt.event.KeyEvent'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15318
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15319
	key := 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15320
	keyChar := 0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15321
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15322
	key := anEvent key.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15323
	key isCharacter ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15324
	    key := keyChar := key asciiValue
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15325
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15326
	    untranslatedKey := anEvent view device keyboardMap keyAtValue:key ifAbsent:key.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15327
	    untranslatedKey == #Insert ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15328
		key := jKeyEventClass instVarNamed:'VK_INSERT' 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15329
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15330
	    untranslatedKey == #Delete ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15331
		key := jKeyEventClass instVarNamed:'VK_DELETE' "/ 127
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15332
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15333
	    untranslatedKey == #BackSpace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15334
		key := jKeyEventClass instVarNamed:'VK_BACK_SPACE' "/ 8
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15335
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15336
	    untranslatedKey == #Return ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15337
		key := jKeyEventClass instVarNamed:'VK_ENTER' "/ 13
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15338
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15339
	    untranslatedKey == #Tab ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15340
		key := jKeyEventClass instVarNamed:'VK_TAB' "/ 9
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15341
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15342
	    untranslatedKey == #Home ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15343
		key := jKeyEventClass instVarNamed:'VK_HOME'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15344
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15345
	    untranslatedKey == #End ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15346
		key := jKeyEventClass instVarNamed:'VK_END'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15347
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15348
	    (key == #PreviousPage or:[untranslatedKey == #Prior]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15349
		key := jKeyEventClass instVarNamed:'VK_PAGE_UP'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15350
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15351
	    (key == #NextPage or:[key == #EndOfText]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15352
		key := jKeyEventClass instVarNamed:'VK_PAGE_DOWN'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15353
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15354
	    untranslatedKey == #CursorUp ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15355
		key := jKeyEventClass instVarNamed:'VK_UP'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15356
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15357
	    untranslatedKey == #CursorDown ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15358
		key := jKeyEventClass instVarNamed:'VK_DOWN'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15359
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15360
	    untranslatedKey == #CursorLeft ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15361
		key := jKeyEventClass instVarNamed:'VK_LEFT'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15362
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15363
	    untranslatedKey == #CursorRight ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15364
		key := jKeyEventClass instVarNamed:'VK_RIGHT'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15365
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15366
	    (#( F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15367
	    includes:untranslatedKey) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15368
		key := jKeyEventClass instVarNamed:('VK_' , untranslatedKey)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15369
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15370
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15371
	(type == #'keyPress:x:y:') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15372
	    id := jKeyEventClass instVarNamed:'KEY_PRESSED'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15373
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15374
	    id := jKeyEventClass instVarNamed:'KEY_RELEASED'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15375
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15376
	jEv := jKeyEventClass newCleared "basicNew".
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15377
	jEv instVarNamed:'modifiers' put:modifiers.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15378
	jEv instVarNamed:'keyCode'   put:key.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15379
	jEv instVarNamed:'keyChar'   put:keyChar.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15380
	jEv instVarNamed:'id'        put:id.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15381
"/        jEv instVarNamed:'x'         put:x.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15382
"/        jEv instVarNamed:'y'         put:y.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15383
	jEv instVarNamed:'when'      put:(OperatingSystem getMillisecondTime).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15384
	^ Array with:jEv
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15385
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15386
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15387
    (anEvent isButtonEvent 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15388
    or:[anEvent isPointerEnterLeaveEvent]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15389
	jMouseEventClass := Java classForName:'java.awt.event.MouseEvent'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15390
	clickCount := 1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15391
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15392
	(type == #'buttonPress:x:y:') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15393
	    id := jMouseEventClass instVarNamed:'MOUSE_PRESSED'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15394
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15395
	    (type == #'buttonRelease:x:y:') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15396
		id := jMouseEventClass instVarNamed:'MOUSE_RELEASED'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15397
	    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15398
		(type == #'buttonMotion:x:y:') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15399
		    (anEvent state bitAnd:(anEvent view device anyButtonMotionMask)) == 0 ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15400
			id := jMouseEventClass instVarNamed:'MOUSE_MOVED'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15401
		    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15402
			id := jMouseEventClass instVarNamed:'MOUSE_DRAGGED'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15403
		    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15404
		] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15405
"/                    (type == #'pointerMotion:x:y:') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15406
"/                        id := jMouseEventClass instVarNamed:'MOUSE_MOVED'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15407
"/                    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15408
			(type == #'pointerEnter:x:y:') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15409
			    id := jMouseEventClass instVarNamed:'MOUSE_ENTERED'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15410
			] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15411
			    (type == #'pointerLeave:') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15412
				id := jMouseEventClass instVarNamed:'MOUSE_EXITED'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15413
			    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15414
				(type == #'buttonMultiPress:x:y:') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15415
				    id := jMouseEventClass instVarNamed:'MOUSE_PRESSED'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15416
				    clickCount := 2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15417
				] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15418
				    self halt.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15419
				]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15420
			    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15421
"/                        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15422
		    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15423
		]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15424
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15425
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15426
	jEv := jMouseEventClass newCleared "basicNew".
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15427
	jEv instVarNamed:'modifiers' put:modifiers.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15428
	jEv instVarNamed:'id'        put:id.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15429
	jEv instVarNamed:'x'         put:x.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15430
	jEv instVarNamed:'y'         put:y.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15431
	jEv instVarNamed:'when'      put:(OperatingSystem getMillisecondTime).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15432
	^ Array with:jEv
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15433
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15434
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15435
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15436
    (type == #'configureX:y:width:height:') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15437
	view := anEvent view.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15438
	x := eventArgs at:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15439
	y := eventArgs at:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15440
	w := eventArgs at:3.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15441
	h := eventArgs at:4.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15442
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15443
	resized := (w ~~ view width or:[h ~~ view height]).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15444
	moved :=  (x ~~ view left or:[y ~~ view top]).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15445
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15446
"/        (view isTopView or:[view isPopUpView]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15447
	    "/ view must update its origin/extent.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15448
	    view dispatchEvent:anEvent.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15449
"/        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15450
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15451
	"/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15452
	"/ must change the components extent
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15453
	"/ is there no cleaner way to do this ?
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15454
	"/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15455
	view isTopView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15456
	    view isPopUpView ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15457
		"/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15458
		"/ sigh - don't include the menu.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15459
		"/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15460
		menu := self topViewsMenu:view.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15461
		menu notNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15462
		    "/ must add the menus height
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15463
		    h := h - menu height
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15464
		]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15465
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15466
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15467
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15468
	jWin instVarNamed:'width' put:w.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15469
	jWin instVarNamed:'height' put:h.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15470
	jWin instVarNamed:'x' put:x.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15471
	jWin instVarNamed:'y' put:y.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15472
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15473
	jComponentEventClass := Java classForName:'java.awt.event.ComponentEvent'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15474
	moved ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15475
	    id := (jComponentEventClass instVarNamed:'COMPONENT_MOVED').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15476
	    jEv1 := jComponentEventClass newCleared "basicNew".
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15477
	    jEv1 instVarNamed:'id'        put:id.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15478
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15479
	resized ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15480
	    id := (jComponentEventClass instVarNamed:'COMPONENT_RESIZED').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15481
	    jEv2 := jComponentEventClass newCleared "basicNew".
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15482
	    jEv2 instVarNamed:'id'        put:id.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15483
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15484
	jEv1 isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15485
	    jEv2 isNil ifTrue:[^ nil].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15486
	    ^ Array with:jEv2
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15487
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15488
	    jEv2 isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15489
		^ Array with:jEv1
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15490
	    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15491
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15492
	^ Array with:jEv1 with:jEv2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15493
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15494
    (type == #'focusIn') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15495
"/ 'focusIn' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15496
	jComponentEventClass := Java classForName:'java.awt.event.FocusEvent'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15497
	id := (jComponentEventClass instVarNamed:'FOCUS_GAINED').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15498
	jEv := jComponentEventClass newCleared "basicNew".
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15499
	jEv instVarNamed:'id'        put:id.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15500
	^ Array with:jEv.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15501
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15502
    (type == #'focusOut') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15503
"/ 'focusOut' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15504
	jComponentEventClass := Java classForName:'java.awt.event.FocusEvent'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15505
	id := (jComponentEventClass instVarNamed:'FOCUS_LOST').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15506
	jEv := jComponentEventClass newCleared "basicNew".
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15507
	jEv instVarNamed:'id'        put:id.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15508
	^ Array with:jEv.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15509
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15510
    (type == #'mapped') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15511
"/ 'mapped' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15512
	jComponentEventClass := Java classForName:'java.awt.event.ComponentEvent'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15513
	id := (jComponentEventClass instVarNamed:'COMPONENT_SHOWN').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15514
"/        x := eventArgs at:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15515
"/        y := eventArgs at:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15516
	jEv := jComponentEventClass newCleared "basicNew".
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15517
	jEv instVarNamed:'id'        put:id.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15518
	^ Array with:jEv.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15519
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15520
    (type == #'unmapped') ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15521
"/ 'unmapped' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15522
	jComponentEventClass := Java classForName:'java.awt.event.ComponentEvent'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15523
	id := (jComponentEventClass instVarNamed:'COMPONENT_HIDDEN').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15524
"/        x := eventArgs at:1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15525
"/        y := eventArgs at:2.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15526
	jEv := jComponentEventClass newCleared "basicNew".
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15527
	jEv instVarNamed:'id'        put:id.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15528
	^ Array with:jEv.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15529
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15530
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15531
    (type == #terminate) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15532
	jWindowEventClass := Java classForName:'java.awt.event.WindowEvent'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15533
"NEW
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15534
	id := (jWindowEventClass instVarNamed:'WINDOW_CLOSING').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15535
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15536
"OLD "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15537
	id := (jWindowEventClass instVarNamed:'WINDOW_CLOSED').
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15538
"    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15539
	jEv := jWindowEventClass newCleared "basicNew".
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15540
	jEv instVarNamed:'id'        put:id.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15541
	^ Array with:jEv.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15542
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15543
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15544
    EventTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15545
	('JAVA: unhandled event:' , type) infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15546
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15547
    ^ nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15548
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15549
    "Created: / 6.1.1998 / 20:38:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15550
    "Modified: / 9.1.1999 / 09:29:58 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15551
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15552
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15553
delegatesTo:someOne
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15554
    ^ false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15555
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15556
    "Created: / 25.9.1999 / 16:11:48 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15557
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15558
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15559
doWindowsEventThread
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15560
    "invoked in an endless loop by the WToolkit-eventLoop
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15561
     native method."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15562
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15563
    |sensor event more|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15564
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15565
    (JavaWindowGroup isNil or:[KnownWindows isNil]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15566
	"/ '*** eventThread: no windowGroup / views ...' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15567
	self waitFor:FirstWindowCreationSemaphore state:#eventWait timeOut:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15568
	"/ Delay waitForSeconds:0.1.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15569
	^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15570
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15571
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15572
    "/ wait for an event to arrive ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15573
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15574
    sensor := JavaWindowGroup sensor.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15575
    [sensor hasEvents or:[sensor damageCount ~~ 0]] whileFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15576
	EventTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15577
	    '*** eventThread waiting ...' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15578
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15579
	Processor activeProcess state:#eventWait.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15580
	self waitFor:sensor eventSemaphore state:#eventWait timeOut:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15581
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15582
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15583
    EventTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15584
	'*** eventThread event arrived ...' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15585
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15586
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15587
    "/ EventTrace := true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15588
    more := true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15589
    [more] whileTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15590
	sensor hasDamage ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15591
	    EventTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15592
		'*** eventThread: damage arrived ...' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15593
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15594
	    event := sensor nextDamage.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15595
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15596
	    event := sensor nextEvent.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15597
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15598
	event isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15599
	    EventTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15600
		'*** eventThread: nil event ignored' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15601
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15602
	    ^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15603
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15604
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15605
	more := self processEvent:event
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15606
    ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15607
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15608
    "Created: / 6.1.1998 / 21:02:40 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15609
    "Modified: / 30.12.1998 / 19:21:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15610
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15611
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15612
processEvent:event
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15613
    |evQ jEvents jWToolKitClass jWToolKit jWinPeer jWin v eventConsumed|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15614
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15615
    KnownWindows isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15616
	^ false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15617
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15618
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15619
    v := event view.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15620
    jWinPeer := self jPeerForView:v.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15621
    jWinPeer isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15622
	v isJavaView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15623
	    "/ mhmh - an event for a JavaView,
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15624
	    "/ which has no peer (anyMore ?)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15625
	    "/ should not happen.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15626
	] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15627
	    "/ mhmh - an event for a subcomponent of an ST widget.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15628
	    "/ let it be handled normally.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15629
	    EventTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15630
		('*** eventThread: ' , event type , '-event for unknown java-view - passed to view.') printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15631
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15632
	    event view dispatchEvent:event.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15633
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15634
	^ true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15635
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15636
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15637
    "/ change:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15638
    "/ in the previous version, events for ST/X widgets (i.e. buttons etc)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15639
    "/ where not passed to java, but instead forwarded directly to the widget
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15640
    "/ by the code below.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15641
    "/ This has changed, to pass it to Java, which eventually passes it to the
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15642
    "/ peer via the handleEvent native method (unless the event got consumed).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15643
    "/ This is req'd to let java keep track of keyboard/mouse input for widgets.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15644
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15645
(event isDamage and:[v isJavaView]) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15646
"/    "/ most views handle their events themself (being ST/X views) ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15647
"/
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15648
"/    v class ~~ JavaView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15649
"/"/        v class ~~ StandardSystemView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15650
"/"/            EventTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15651
"/"/                    ('*** eventThread: event handled by view itself (' , v class name , ')') printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15652
"/"/            ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15653
"/"/            event sendEventWithFocusOn:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15654
"/"/            ^ self.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15655
"/"/        ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15656
"/        (event type == #'exposeX:y:width:height'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15657
"/        or:[event type == #'graphicsExposeX:y:width:height']) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15658
"/            "/ send to view, but also handle in JAVA
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15659
"/            event sendEventWithFocusOn:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15660
"/        ]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15661
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15662
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15663
    (#(
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15664
	#'mapped'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15665
	#'unmapped'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15666
	#'configureX:y:width:height:'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15667
	#'exposeX:y:width:height:'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15668
	#'graphicsExposeX:y:width:height:'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15669
     ) includes:event type) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15670
	event sendEventWithFocusOn:nil.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15671
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15672
].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15673
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15674
    "/ what a kludge - some events are passed back to
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15675
    "/ ST via the WComponent-handleEvent native method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15676
    "/ However, repaints are not.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15677
    "/ In order to let ST widgets do the drawing,
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15678
    "/ selectively filter exposeEvents from Java ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15679
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15680
    eventConsumed := false.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15681
    v isJavaView ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15682
	"/ all events handled by Java ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15683
    ] ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15684
	eventConsumed := true.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15685
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15686
	"/ let widget handle it.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15687
	event view dispatchEvent:event.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15688
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15689
	"/ some are not passed to Java ...
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15690
	event isDamage ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15691
	    (v isKindOf:Button) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15692
		^ true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15693
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15694
	    (v isKindOf:TextView) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15695
		^ true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15696
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15697
	    (v isKindOf:Label) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15698
		^ true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15699
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15700
	    (v isKindOf:ComboBoxView) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15701
		^ true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15702
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15703
	    (v isKindOf:ScrollBar) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15704
		^ true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15705
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15706
	    (v isKindOf:Scroller) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15707
		^ true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15708
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15709
	    (v isKindOf:MenuPanel) ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15710
		^ true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15711
	    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15712
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15713
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15714
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15715
    jWin := jWinPeer instVarNamed:'target'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15716
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15717
    EventTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15718
	('*** eventThread: event (' , event type , ') handled by JAVA: ') infoPrint.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15719
	jWinPeer class name infoPrint. ' (' infoPrint.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15720
	jWin class name infoPrint. ')' infoPrintCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15721
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15722
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15723
    "/ create an event
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15724
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15725
    jEvents := self awtEventsForEvent:event javaWindow:jWin.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15726
    jEvents isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15727
	EventTrace ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15728
	    ('*** eventThread: event ignored: ' , event type) printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15729
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15730
	^ true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15731
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15732
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15733
"/    v superView isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15734
"/        ('*** eventThread: event ignored for topView: ' , event type) printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15735
"/        ^ self
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15736
"/    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15737
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15738
    jWToolKitClass := Java classForName:'java.awt.Toolkit'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15739
    "/ jWToolKit := jWToolKitClass perform:#getDefaultToolkit.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15740
    jWToolKit := jWToolKitClass performStatic:#'getDefaultToolkit()Ljava/awt/Toolkit;'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15741
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15742
    jEvents do:[:jEv |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15743
	jEv instVarNamed:'source'   put:jWin.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15744
	jEv instVarNamed:'consumed' put:0.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15745
	eventConsumed ifFalse:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15746
	    "/ the first gets the original event as data
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15747
	    jEv instVarNamed:'data' put:event.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15748
	    eventConsumed := true
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15749
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15750
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15751
	"/ post it (them) to the event queue
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15752
	EventTrace == true ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15753
	    'postEvent to Java ...' printCR.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15754
	].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15755
	jWToolKit "class" perform:#'postEvent(Ljava/awt/AWTEvent;)V' with:jEv.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15756
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15757
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15758
    ^ false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15759
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15760
    "Created: / 6.1.1998 / 20:36:36 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15761
    "Modified: / 10.12.1998 / 19:36:59 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15762
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15763
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15764
!JavaVM methodsFor:'initialization'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15765
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15766
systemProperties
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15767
    |props|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15768
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15769
    (props := SystemProperties) isNil ifTrue:[
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15770
	props := SystemProperties := Dictionary new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15771
	self initializeSystemPropertiesInto:props.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15772
    ].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15773
    ^ props
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15774
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15775
    "Modified: / 3.1.1998 / 14:32:38 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15776
    "Created: / 9.1.1999 / 14:48:22 / cg"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15777
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15778
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15779
!JavaVM::Reflection class methodsFor:'documentation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15780
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15781
documentation
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15782
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15783
Reflection class holds information about 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15784
which java classes are loaded, hides workarounds
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15785
allowing java classes to behave like smalltalk ones,
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15786
(remember everything is instance of some class rule?:)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15787
allows you to access java classes by their name, 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15788
transform ST specific objects to java alternatives
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15789
and vice versa (java string and ST string are 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15790
undoubtely very different), manages constant
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15791
pools..
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15792
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15793
Correct me if I'm wrong, but one day this class will
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15794
be able to update constant pool and therefore 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15795
incremental compilation of java classes.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15796
"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15797
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15798
    "Created: / 03-02-2011 / 00:56:27 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15799
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15800
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15801
!JavaVM::Reflection class methodsFor:'instance creation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15802
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15803
for: aJavaVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15804
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15805
    ^self new setVM: aJavaVM.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15806
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15807
    "Created: / 21-12-2010 / 19:42:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15808
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15809
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15810
new
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15811
    "return an initialized instance"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15812
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15813
    ^ self basicNew initialize.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15814
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15815
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15816
!JavaVM::Reflection methodsFor:'debugging'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15817
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15818
returnNilIfMissing
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15819
    ^ returnNilIfMissing.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15820
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15821
    "Created: / 28-01-2011 / 15:14:37 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15822
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15823
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15824
returnNilIfMissing:aBoolean
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15825
    returnNilIfMissing:= aBoolean.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15826
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15827
    "Created: / 28-01-2011 / 15:25:35 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15828
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15829
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15830
!JavaVM::Reflection methodsFor:'initialization'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15831
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15832
initialize
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15833
    constantPoolMapping := IdentityDictionary new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15834
    javaClasses := Dictionary new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15835
    javaArrayClasses := IdentityDictionary new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15836
    javaMethods := IdentityDictionary new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15837
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15838
    "Created: / 21-12-2010 / 19:46:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15839
    "Modified: / 09-02-2011 / 00:24:28 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15840
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15841
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15842
setVM: aJavaVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15843
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15844
    "Now, aJavaVM == JavaVM (i.e, the class JavaVM 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15845
    itself, not its instance)"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15846
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15847
    vm := aJavaVM
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15848
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15849
    "Created: / 21-12-2010 / 19:44:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15850
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15851
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15852
!JavaVM::Reflection methodsFor:'reflection - classes'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15853
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15854
classForJavaClassObject:aJavaClassObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15855
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15856
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15857
        Given an instance of java.lang.Class, answers
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15858
        real (Java) class associated with it. The instance
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15859
        of java.lang.Class should be first created by myself
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15860
        (by sending #javaClassObjectForClass:)
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15861
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15862
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15863
    (javaClasses at: aJavaClassObject ifAbsent:[123]) == (Java at: 'stx.libjava.tests.junir.JUnit3Tests') 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15864
        ifTrue:[self breakPoint: #jv].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15865
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15866
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15867
    ^ javaClasses 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15868
        at:aJavaClassObject 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15869
        ifAbsent:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15870
            [vm internalError:'No class associated with given java.lang.Class!!'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15871
            "/Please, no nils
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15872
            self returnNilIfMissing ifTrue: nil].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15873
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15874
    "Created: / 28-01-2011 / 15:22:39 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15875
    "Modified: / 05-02-2011 / 20:26:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15876
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15877
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15878
javaArrayClassObjectForClass:aClass 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15879
    ^ javaArrayClasses at:aClass ifAbsent:[self returnNilIfMissing ifTrue:nil].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15880
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15881
    "Created: / 28-01-2011 / 14:56:19 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15882
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15883
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15884
javaArrayClassObjectForClass:aClass ifAbsentPut:classOfaClass
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15885
    ^ javaArrayClasses at:aClass ifAbsentPut: classOfaClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15886
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15887
    "Created: / 28-01-2011 / 14:59:21 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15888
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15889
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15890
javaClassObjectArrayForClasses: classes
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15891
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15892
        Answers an instance of java.lang.Class[] for given
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15893
        real (Java) classes.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15894
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15895
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15896
    | array |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15897
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15898
    array := (vm classForName:'java.lang.Class') arrayClass new: classes size.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15899
    classes isNilOrEmptyCollection ifTrue:[^array].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15900
    classes withIndexDo: [:cls :idx|array at: idx put: (self javaClassObjectForClass: cls)].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15901
    ^array
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15902
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15903
    "Modified: / 28-01-2011 / 15:15:44 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15904
    "Created: / 04-02-2011 / 22:08:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15905
    "Modified: / 11-02-2011 / 10:21:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15906
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15907
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15908
javaClassObjectForClass:aClass 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15909
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15910
        Answers an instance of java.lang.Class for given
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15911
        real (Java) class.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15912
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15913
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15914
    | javaClassObj |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15915
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15916
    self assert: aClass isBehavior message: 'aClass is not behavior'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15917
    self assert: aClass ~~ Array message: 'aClass should not be Array (old impl)'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15918
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15919
    javaClasses at: aClass ifPresent:[:javaClassObj|^javaClassObj].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15920
    "/ class must be initialized (with all of its superclasses ?).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15921
    aClass isJavaClass ifTrue:[aClass classInit].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15922
    javaClassObj := (vm classForName: 'java.lang.Class') new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15923
    javaClasses at: aClass put: javaClassObj.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15924
    javaClasses at: javaClassObj put: aClass.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15925
    ^javaClassObj
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15926
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15927
    "Modified: / 28-01-2011 / 15:15:44 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15928
    "Modified: / 05-02-2011 / 22:17:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15929
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15930
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
 15931
javaClassObjectForClassNamed: className 
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15932
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15933
        Answers an instance of java.lang.Class for given
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15934
        (java) class name. The className may be name of primitive
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
 15935
        type, i.e. 'int', 'double'."
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
 15936
    
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15937
    | cls |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15938
758
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
 15939
    cls := JavaDescriptor baseTypesByTypeName at: className
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
 15940
                ifAbsent: [ vm classForName: className ].
be8e84381ce0 Merged with /branches/jk
vranyj1
parents: 752
diff changeset
 15941
    ^ self javaClassObjectForClass: cls.
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15942
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15943
    "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
 15944
    "Modified: / 08-04-2011 / 14:45:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
752
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15945
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15946
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15947
!JavaVM::Reflection methodsFor:'reflection - constant pool'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15948
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15949
constantPoolFor:javaConstantPoolObject 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15950
    ^ constantPoolMapping at:javaConstantPoolObject
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15951
        ifAbsent:[self error:'Given ConstantPool was not created by JVM']
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15952
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15953
    "Created: / 21-12-2010 / 19:56:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15954
    "Modified: / 28-01-2011 / 14:56:54 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15955
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15956
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15957
javaConstantPoolObjectFor: aConstantPool
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15958
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15959
    ^constantPoolMapping at: aConstantPool ifAbsent:
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15960
        [| javaConstantPoolObject |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15961
        javaConstantPoolObject := (vm classForName:'sun.reflect.ConstantPool') new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15962
        constantPoolMapping at: aConstantPool put: javaConstantPoolObject.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15963
        constantPoolMapping at: javaConstantPoolObject put: aConstantPool.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15964
        javaConstantPoolObject]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15965
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15966
    "Created: / 21-12-2010 / 19:54:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15967
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15968
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15969
!JavaVM::Reflection methodsFor:'reflection - methods & ctors'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15970
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15971
javaConstructorObjectForMethod:method 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15972
     "given a real method, return the corresponding java.lang.reflect.Constructor
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15973
      instance for it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15974
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15975
    | jCtor |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15976
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15977
    javaMethods at:method ifPresent:[:existingCtor|^existingCtor].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15978
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15979
    jCtor := (Java classForName:'java.lang.reflect.Constructor') new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15980
    self javaMethodObjectLikeSlotsInto: jCtor forMethod: method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15981
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15982
    javaMethods at:method put: jCtor.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15983
    javaMethods at:jCtor put:method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15984
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15985
    ^ jCtor
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15986
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15987
    "Created: / 09-02-2011 / 10:28:12 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15988
    "Modified: / 11-02-2011 / 06:44:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15989
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15990
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15991
javaMethodObjectForMethod:method 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15992
     "given a real method, return the corresponding java.lang.reflect.Constructor
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15993
      instance for it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15994
     | jMethod |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15995
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15996
    javaMethods at:method ifPresent:[:existingCtor|^existingCtor].
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15997
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15998
    jMethod := (Java classForName:'java.lang.reflect.Method') new.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 15999
    self javaMethodObjectLikeSlotsInto: jMethod forMethod: method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16000
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16001
    javaMethods at:method put: jMethod.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16002
    javaMethods at:jMethod put:method.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16003
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16004
    jMethod 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16005
        instVarNamed: #name       put: (self javaStringObjectForString: (method selector upTo:$() interned: true);
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16006
        instVarNamed: #returnType put: (method descriptor returnClassObject);
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16007
        instVarNamed: #annotationDefault put: (method annotations default bytes);
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16008
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16009
        yourself.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16010
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16011
    ^jMethod
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16012
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16013
    "Created: / 09-02-2011 / 10:29:46 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16014
    "Modified: / 03-03-2011 / 23:50:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16015
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16016
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16017
javaMethodObjectLikeSlotsInto: jMethod forMethod:method 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16018
     "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16019
        Fill in slots of given instance of java.lang.Method or 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16020
        java.lang.Constructor
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16021
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16022
    | desc |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16023
    desc := method descriptor.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16024
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16025
    jMethod
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16026
        instVarNamed: #clazz            put: (self javaClassObjectForClass: method javaClass);
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16027
        instVarNamed: #slot             put: 0"Ignored";
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16028
        instVarNamed: #modifiers        put: method accessFlags;
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16029
        instVarNamed: #signature        put: (self javaStringObjectForString: method signature interned: true);
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16030
        instVarNamed: #parameterTypes   put: (self javaClassObjectArrayForClasses: desc parameterClasses);
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16031
        instVarNamed: #exceptionTypes   put: (self javaClassObjectArrayForClasses: method exceptionTable);
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16032
        instVarNamed: #annotations      put: (method annotations runtimeVisible bytes);
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16033
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16034
        yourself.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16035
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16036
    ^ jMethod
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16037
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16038
    "Created: / 11-02-2011 / 06:44:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16039
    "Modified: / 03-03-2011 / 23:07:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16040
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16041
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16042
methodForJavaConstructorObject:constructor 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16043
     "given a java.lang.reflect.Constructor, return the corresponding method
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16044
      it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16045
    
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16046
    |class signature|
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16047
    class := self classForJavaClassObject:(constructor instVarNamed:#clazz).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16048
    signature := Java as_ST_String:(constructor instVarNamed:#signature).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16049
    ^ class compiledMethodAt:('<init>' , signature) asSymbol.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16050
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16051
    "Modified: / 26-11-2010 / 17:24:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16052
    "Created: / 09-02-2011 / 10:36:07 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16053
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16054
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16055
methodForJavaMethodObject:aJavaMethodObject 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16056
     "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16057
         Given an instance of java.lang.reflect.Method, answers
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16058
        real method associated with it. 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16059
    "
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16060
    |class name signature method |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16061
        "real method associated with it."
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16062
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16063
    class := self classForJavaClassObject:(aJavaMethodObject instVarNamed:#clazz).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16064
    name := Java as_ST_String:(aJavaMethodObject instVarNamed:#name).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16065
    signature := Java as_ST_String:(aJavaMethodObject instVarNamed:#signature).
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16066
    method := class compiledMethodAt:(name , signature) asSymbol.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16067
    self assert: method notNil description: 'No such method, malformed java.lang.reflect.Method object?'.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16068
    ^method
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16069
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16070
    "Modified: / 07-02-2011 / 09:50:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16071
    "Created: / 09-02-2011 / 10:32:14 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16072
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16073
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16074
!JavaVM::Reflection methodsFor:'reflection - other'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16075
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16076
javaStringObjectForString:string 
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16077
    ^ self javaStringObjectForString: string interned: false
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16078
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16079
    "Created: / 09-02-2011 / 10:34:57 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16080
!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16081
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16082
javaStringObjectForString:string interned:intern  
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16083
    | s |
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16084
    s := Java as_String: string.
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16085
    ^intern ifTrue:[Java intern: s] ifFalse:[s]
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16086
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16087
    "Modified: / 22-11-2010 / 17:57:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16088
    "Created: / 09-02-2011 / 10:34:29 / Marcel Hlopko <hlopik@gmail.com>"
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16089
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16090
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16091
!JavaVM class methodsFor:'documentation'!
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16092
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16093
version_SVN
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16094
    ^ '$Id$'
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16095
! !
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16096
ff7bc6428c9c branch jk_new_structure resurrected
vranyj1
parents:
diff changeset
 16097
JavaVM initialize!
761
43e017ec7958 Merged with /branches/jk
vranyj1
parents: 760
diff changeset
 16098
762
d995915ebc0b Merged with /branches/jk
vranyj1
parents: 761
diff changeset
 16099