summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common
Commit message (Collapse)AuthorAgeFilesLines
* Bug 681: Add Elf Parsing for other OS than Linux, if ARM and !ANDROID using ↵Sven Gothel2013-02-091-14/+40
| | | | | | | | /proc/self/exe (Linux) or a found java/jvm native lib. - PlatformPropsImpl.queryABITypeImpl: Check Elf Header for ARM + !ANDROID (i.e. add other OS than Linux, use native java/jmv lib) - NativeLibrary.enumerateLibraryPaths: Add 'sun.boot.library.path' to enumeration! - TestElfReader01: Add test for finding java/jvm native lib and parse it
* IOUtil.copyStream2ByteBuffer: Turns out on Android, no -1 (EOS) is returned ↵Sven Gothel2013-02-011-2/+2
| | | | - relax loop-condition (hope thats ok)
* IOUtil.copyStream2ByteBuffer: read while numRead > -1 ; add variant w/ ↵Sven Gothel2013-02-011-4/+19
| | | | initialCapcity
* GlueGen: NativeLibrary Fix, JNILibLoaderBase EnhancementSven Gothel2013-01-302-81/+135
| | | | | | | | | | | | | | | | | | | - NativeLibrary Fix - enumerateLibraryPaths(..): - Properly iterate through all prefix _and_ suffix. - Make public for JNILibLoaderBase.loadLibraryInternal(..) - isValidNativeLibraryName(..): - Stop iterating through prefix, if previously found but suffix doesn't match. - JNILibLoaderBase.loadLibraryInternal(..) Enhancement - Mark customLibLoader FIXME: remove (we will get rid of jnlp.launcher.class) - If System.load(TempJarCache) and System.loadLibrary(plainLibName) fails, use NativeLibrary.enumerateLibraryPaths() w/ System.load(..) as last resort. Tested on Linux x86_64 Java6 and OSX Java7 manually, no regressions expected.
* Modified Java 1.5 Buffers patch 2b7d1b1d25cb2cd73311ec9159b465f0391bf5e0 - ↵Sven Gothel2013-01-193-21/+43
| | | | | | | | | | | | | | May break GCJ/ECJ .. needs to be revised. - Adding JAVA_6 in PlatformPropsImpl - Buffers.isDirect() chooses fast-path iff JAVA_6, otherwise using reflection (GCJ/ECJ) - Adding JAVA_6 info in VersionUtil - API doc: Refine JAVA_SE and JAVA_6 spec. TODO: In case GCJ etc is unable to compile the JAVA_6 code even though it uses a static condition (probably not), We have to wrap isStatic in an own class, one for JAVA_6 and one for <= 1.5. This will be a good exercise for further issues we may have w/ Java <= 1.5.
* Merge remote-tracking branch 'xranby/gcj-gij'Sven Gothel2013-01-181-3/+17
|\
| * Buffer.isDirect() operation is undefined w/ Eclipse ecj and GCJ gij JRE.Xerxes Rånby2013-01-181-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for the runtime error using GCJ gij JRE: java.lang.NoSuchMethodError: method java.nio.Buffer.isDirect with signature ()Z was not found. at com.jogamp.common.nio.Buffers.isDirect(Buffers.java:363) Also Eclipse ecj refuses to compile code using java.nio.Buffer.isDirect(). ---------- 1. ERROR ... return ((Buffer) buf).isDirect(); ^^^^^^^^ The method isDirect() is undefined for the type Buffer Signed-off-by: Xerxes Rånby <[email protected]>
* | RecursiveLock.getHoldCount(): Fix API doc formattingSven Gothel2013-01-181-4/+7
| |
* | Buffers: Fix typoSven Gothel2013-01-181-2/+2
|/
* PrimitiveStack: Add 'void position(int)' to set new position. Add test case ↵Sven Gothel2012-12-312-6/+22
| | | | w/ initialSizeElem:=0.
* Add com.jogamp.common.util.PrimitiveStack (FloatStack and IntegerStack), a ↵Sven Gothel2012-12-302-0/+229
| | | | | | | | | | | | simple primitive stack implementation. Currently only FILO put/get operations are implemented using either primitive arrays as I/O itself or <Type>Buffer. Unit tests are included.. Note: Only FloatStack is implemented in a manual, where others (IntegerStack) is derived (generated) from it. Same goes w/ unit tests.
* Fix Bug625: StructAccessor missing setShortsAt() and getShortsAt() methods ↵Sven Gothel2012-12-301-0/+13
| | | | | | | | | | for short[] For short[] Java code gets emitted for an StructAccessor object that uses: void setShortsAt(int i, short[] shorts) short[] getShortsAt(int i, short[] shorts) Problem was that StructAccessor.java had no such methods - added.
* IntIntHashMap: Add privileged for 'getDeclaredMethod(..)'; Add StringBuilder ↵v2.0-rc11Sven Gothel2012-10-311-42/+75
| | | | toString(..); Add more generics coding.
* IntBitfield: Add API doc; Enhance put() method, return previous value to be ↵Sven Gothel2012-10-271-7/+27
| | | | used more versatile and write only if value changed.
* Adding com.jogamp.common.util.IntBitfield: Simple bitfield holder class ↵Sven Gothel2012-10-271-0/+71
| | | | | | | using an int[] storage. IntBitfield comes in handy to store bit states of a wide value range w/o being a memory hog an O(1) access, e.g. keyCode -> isPressed maps etc.
* Fix Bug 608: Push down TempJarCache.findLibrary(..) from ↵Sven Gothel2012-10-252-16/+15
| | | | | | | JNILibLoaderBase.loadLibraryInternal() to NativeLibrary.findLibrary(..) This allows using TempJarCache (if used/initialized) for native 'tool' libraries as well. This is the case of JOAL's attempt to load the provided 'libopenal.so'
* VersionNumber: API doc fixSven Gothel2012-10-241-1/+1
|
* VersionNumber: Add API doc for string parsingSven Gothel2012-10-241-0/+7
|
* VersionNumber: Remove printing Exception (was added for debugging purposes)Sven Gothel2012-10-241-1/+1
|
* Fix VersionNumber: Non digits cut off pattern was '\D.*' and cut off digits ↵Sven Gothel2012-10-241-43/+41
| | | | | | | | | | | | | | | | | | | in case leading non digits appear. '\D.*' matches a leading non-digit and then any character. First the string is tokenized by delim: "OpenGL ES GLSL ES 1.0.16" -> "OpenGL ES GLSL ES 1", "0", "16" Enhance pattern as follows and access collected group if matching: // group1: \D* == leading non digits, optional // group2: \d* == digits // group3: .* == any pending chars, optional final java.util.regex.Pattern nonDigitsCutOff = java.util.regex.Pattern.compile("(\\D*)(\\d*)(.*)"); Reorganized storage from atomic values to int[3] array, allowing simple pattern matching loop. Added unit test.
* Fix Buffers.copy<Type>Buffer[asByteBuffer](..): Reset position of the passed ↵Sven Gothel2012-10-181-14/+15
| | | | | | | | | buffer (was missing). This is an API regression as introduced in commit 25cc744f6bd5ca97e0ae58fa7e1c35f7b0f3046d where JOGL's BufferUtil and GlueGen's were merged and API doc elaborated. The latter states the desired fact that the source passed buffer's position shall remain unchanged, however no code was added to take care of this detail.
* Merge remote-tracking branch 'hharrison/RFC'Sven Gothel2012-10-171-1/+1
|\
| * gluegen: generics annotations for various ArrayList/List useHarvey Harrison2012-10-151-1/+1
| | | | | | | | | | | | | | - Use the copy constructor rather than ArrayList.clone() - constrain listsEqual so the compiler will warn about comparing lists of different types Signed-off-by: Harvey Harrison <[email protected]>
* | Buffers: Add normalized put methods, i.e. incl. value range conversion; New ↵Sven Gothel2012-10-172-2/+269
|/ | | | util. ValueConv for primitive type value conversion
* Buffers.toString(): Add optional format string for single elementSven Gothel2012-10-101-8/+39
|
* Buffers: Add convenient "public static StringBuilder toString(StringBuilder ↵Sven Gothel2012-10-101-1/+63
| | | | | | sb, Buffer buffer)" Sometimes we need to see details of a Buffer w/ it's content, e.g. for debugging purposes.
* Fix NPE in Buffers.slice2Float(), regression of commit ↵Sven Gothel2012-10-091-3/+12
| | | | 86e8c3a8d9f430700e07c485127130da68618e9d
* Buffers.slice2Float(): Reset position and limit of host bufferSven Gothel2012-10-091-22/+25
|
* Refine API doc of Buffers, fix API doc Platform.NEWLINE.Sven Gothel2012-10-032-1/+9
|
* SingletonInstanceServerSocket: Add unit tests; Create new server Thread @ ↵Sven Gothel2012-09-211-5/+8
| | | | start, otherwise we may collide w/ a failed start. Misc: Cleanup / reuse strings.
* Platform: Slight reorder of initialization reducing one PrivilegedAction block.Sven Gothel2012-09-071-42/+41
|
* JNILibLoaderBase: Fix NPE in DEBUG mode if null == stripBasenameSuffixes (JOCL)Sven Gothel2012-08-261-1/+1
|
* IOUtil: Better resource location debug info; RunnableTask adds 'flush()' ↵Sven Gothel2012-07-052-18/+49
| | | | method to flush a pending task (lock that is).
* Lock Cleanup (API Change)Sven Gothel2012-06-275-8/+16
| | | | | | | | - LockExt -> ThreadLock - clarifying semantics (API Change) - ThreadLock: Remove isOwner(), use isOwner(Thread.currentThread) - adding @Override
* Implement Bug #598 - JOGL ALL JAR File Change incl. it's Native Jar URL ↵Sven Gothel2012-06-265-240/+458
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Derivation +++ JNILibLoaderBase.addNativeJarLibs(..): Add API doc JNILibLoaderBase: "addNativeJarLibs(Class<?> classFromJavaJar, String allNativeJarBaseName, String[] atomicNativeJarBaseNames)" -> "addNativeJarLibs(Class<?>[] classesFromJavaJars, String singleJarMarker, String[] stripBasenameSuffixes)" Derive the 'all' (1st choice) native JAR URL solely on the given class's JAR URL. Examples: JOCL: // only: jocl.jar -> jocl-natives-'os.and.arch'.jar addNativeJarLibs(new Class<?>[] { JOCLJNILibLoader.class }, null, null ); JOGL: final ClassLoader cl = GLProfile.class.getClassLoader(); // either: [jogl-all.jar, jogl-all-noawt.jar, jogl-all-mobile.jar] -> jogl-all-natives-<os.and.arch>.jar // or: nativewindow-core.jar -> nativewindow-natives-<os.and.arch>.jar, // jogl-core.jar -> jogl-natives-<os.and.arch>.jar, // (newt-core.jar -> newt-natives-<os.and.arch>.jar)? (if available) final String newtFactoryClassName = "com.jogamp.newt.NewtFactory"; final Class<?>[] classesFromJavaJars = new Class<?>[] { NWJNILibLoader.class, GLProfile.class, null }; if( ReflectionUtil.isClassAvailable(newtFactoryClassName, cl) ) { classesFromJavaJars[2] = ReflectionUtil.getClass(newtFactoryClassName, false, cl); } JNILibLoaderBase.addNativeJarLibs(classesFromJavaJars, "-all", new String[] { "-noawt", "-mobile", "-core" } ); Efficiency / Performance: - Reduced JAR URL lookup calls JarUtil.getJarURL(..) - JNILibLoaderBase, Platform, JarUtil - Attempt loading Jar files (native, class, ..) only once - TempJarCache Code Cleanup (IOUtil, JarUtil, : - IOException if not found - IllegalArgumentException if null argument +++ jogamp.android-launcher.jar -> jogamp-android-launcher.jar +++
* Fix Bug 591: Fix 'jnlp.' aliasing of PropertyAccess.getProperty(..):Sven Gothel2012-06-211-17/+30
| | | | | | | | | | | | | | | | | | | Usually you set a property like jogamp.debug.IOUtil jogamp.debug=all to enable either IOUtil debugging or all debugging. In case you use Applets or JNLP you cannot use above property namespace, since it's considered insecure. GlueGen would allow you to use an 'jnlp.' alias, e.g.: jnlp.jogamp.debug.IOUtil jnlp.jogamp.debug=all The latter are secure properties and will be passed to the invoked JVM. All properties requested by PropertyAccess.getProperty(..) shall be aliased w/ 'jnlp.' (prepend 'jnlp.'), if no value could be found with the given key.
* Fix IOUtil: Query FileOutputStream constructor for each use (don't cache), ↵Sven Gothel2012-06-211-9/+28
| | | | utilizing default SecurityManager validation.
* Fix TempFileCache/LauncherTempFileCache (regression commit: ↵v2.0-rc9Sven Gothel2012-06-204-35/+47
| | | | | | | | | | | | | | | | | | | | 1468286bf569a493e4fdb887d5f3732f88c8cec3) 'update' scenario in same JVM instance. TempFileCache/LauncherTempFileCache were using the system property 'jnlp.jogamp.tmp.cache.root', if set. However, in case one JVM launched an old GlueGen (Applet) and then launching a new GlueGen (Applet) w/ a new tmpDir location, the property is still set but the tmpRootDir location does not exist. This patch tolerates this situation and cont. setting a new tmpRootDir. Example: JVM1.GlueGen1 tmpDir: /tmp/, tmpRootDir: /tmp/jogamp.tmp.cache_000000/ JVM1.GlueGen2 tmpDir: /tmp/jogamp_0000/, tmpRootDir: /tmp/jogamp_0000/file_cache/ Misc: - IOUtil: Always use 'jogamp_xxxx' as the sys-temp subfolder for tmpDir - JNILibLoaderBase: Remove unised import - TempJarCache.validateCertificates(): Add OK DEBUG output.
* Fix Platform static initialization interdependencies w/ GlueGen native ↵Sven Gothel2012-06-187-308/+73
| | | | | | | | | | | | library loading Some Platform field declarations and it's static initialization has been delegated to it's new abstract super class PlatformPropsImpl to solve static initialization interdependencies w/ the GlueGen native library loading and it's derived information {@link #getMachineDescription()}, {@link #is32Bit()}, ..<br> This mechanism is preferred in this case to avoid synchronization and locking and allow better performance accessing the mentioned fields/methods.
* Fix Bug 587: Use alternative storage location if platform's temp directory ↵Sven Gothel2012-06-162-93/+333
| | | | | | | | | | | | | | | | | | | | | is mounted w/ noexec ; IOUtil API change! Test whether executable files can be launched in temporary folder by trying to run an empty executable file - if !( WINDOWS | OPENKODE ) TempDir: 1) ${java.io.tmpdir}/jogamp 2) $XDG_CACHE_HOME/jogamp - if !( ANDROID | MACOS | WINDOWS | OPENKODE ) 3) $HOME/.jogamp $XDG_CACHE_HOME defaults to $HOME/.cache - TempFileCache: ${TempDir}/file_cache -> ${java.io.tmpdir}/jogamp/file_cache - LauncherTempFileCache: ${TempDir}/file_cache -> ${java.io.tmpdir}/jogamp/file_cache +++ AndroidUtils*.getTempRoot(): Remove unused AccessControlContext param
* Fix Bug 583: Remove Android compile-time dependencies and exclude Android ↵Sven Gothel2012-06-043-38/+48
| | | | | | | | | | | | | specific classes for non Android platforms. Android specifics are delegated via class AndroidUtils, which uses reflection to call AndroidUtilsImpl if platform is Android. Android code is confined to the packages: jogamp.common.os.android.* jogamp.android.launcher.* and only included when compiled for the Android platform.
* DynamicLibraryBundle: API doc refinement, mention the ClassLoader role.Sven Gothel2012-05-042-5/+16
|
* Fix commit cc76889a6fe96cffb91c9a3aa7934878c0ecd97e: ↵Sven Gothel2012-05-041-1/+1
| | | | System.loadLibrary(libraryPath) -> System.load(libraryPath)
* Use ClassLoader to find JNI native libraries. ClassLoader was only used for ↵Sven Gothel2012-05-044-40/+75
| | | | | | | | | | | tool native libraries. NativeLibrary: Expose 'String findLibrary(String libName, ClassLoader loader)', allowing utilization of System.load(loader.findLibrary(libName)). JNILibLoaderBase.loadLibrary(): Add optional ClassLoader argument, used to locate the library DynamicLibraryBundle: Use DynamicLibraryInfo's ClassLoader to find native libraries (tool + jni)
* PropertyAccess: Cleanup code, adding comment.v2.0-rc8v2.0-rc7Sven Gothel2012-04-251-7/+6
|
* Platform: Need priviledge read access for property 'java.awt.headless'Sven Gothel2012-04-251-9/+13
|
* StringBuffer -> StringBuilder (Local objects, no concurrency)Sven Gothel2012-04-162-2/+2
|
* Buffers: Add generic slice2Float(..) method from JOGL's ProjectFloat/FloatUtilSven Gothel2012-04-092-5/+46
|
* IOUtil: Add fail-safe getFileOutputStream(..) (inspired by pngj helper class)Sven Gothel2012-04-071-0/+36
|
* Fix IOUtil: Handle all '../' and './' cases by reducing the path.Sven Gothel2012-04-022-26/+46
|