aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com
Commit message (Collapse)AuthorAgeFilesLines
* Clock/Platform: Add currentMillis() analogue to currentNanos(), returning ↵Sven Gothel2023-10-063-3/+129
| | | | | | | | current monotonic milliseconds **since start of this application** Also added TSPrinter, a simple millisecond timestamp prepending `print*()` wrapper for a {@link PrintStream}. Test coverage via TestClock01.
* AudioSink: Just pass a finte buffer size (KISS), add getLastBufferedPTS() to ↵Sven Gothel2023-10-041-42/+36
| | | | access the last buffered audio pts
* WorkerThread.start(paused): Merge RUNNING | ACTIVESven Gothel2023-09-221-1/+1
| | | | Last review editting I hope :)
* Uri: Added `Uri tryUriOrFile(final String uri_s)` for convenience / ↵Sven Gothel2023-09-221-0/+56
| | | | usability, as well as getScheme(String), isValidScheme(String), isFileScheme(String) and isHttpxScheme(String)
* WorkerThread: Enhanced testing, added optional StateCallback for state ↵Sven Gothel2023-09-221-97/+217
| | | | changes, using bitfield state (earmarked to be used within GLMediaPlayerImpl etc)
* WorkerThread: Remove minDelayMS field, have it in Runnable branch onlySven Gothel2023-09-211-3/+2
|
* WorkerThread: Fix minDelayMS assignment using validated field valueSven Gothel2023-09-211-1/+1
|
* WorkerThread: Add optional minDelay to throttle excecutionSven Gothel2023-09-211-15/+36
|
* WorkerThread: Move 'streamErr' Exception to local RunnableSven Gothel2023-09-201-1/+1
|
* Add WorkerThread: A re-start'able, pause'able and interrupt'able worker ↵Sven Gothel2023-09-201-0/+315
| | | | thread with an optional minimum execution duration
* InterruptSource.Thread: Add ctor variant w/ sole Runnable argument (was missing)Sven Gothel2023-08-231-0/+7
|
* GlueGen: 'from expression' -> 'with expression'Sven Gothel2023-08-101-1/+1
|
* Bug 1450: Be more verbose w/ JavaEmitter comment lines for enums and ↵Sven Gothel2023-08-102-4/+9
| | | | defines, include native expression
* Bug 1450: Widen ConstantDefinition.isConstantExpression() to include ↵Sven Gothel2023-08-101-2/+4
| | | | | | 'patternCPPOperand' i.e. all supported operands used for constant-expression of define macros.
* Merge remote-tracking branch ↵Sven Gothel2023-08-081-0/+1
|\ | | | | | | 'Mathieu_Fery/1446-parent-class-directives-issue-with-if-and-impl'
| * feat(generation): Fix CodeGenUtils.emitJavaHeadersMathieu Féry2023-08-081-0/+1
| | | | | | | | When both classExtended and interfaces are specified for given class space missing between classExtended and implements keyword
* | Drop PCPP, GlueGen exclusively uses JCPP; Adopt test case Test{P->J}CPPSven Gothel2023-08-082-1381/+0
|/
* Minor cleanup (includes, spacing)Sven Gothel2023-08-051-1/+1
|
* JavaConfiguration.requiresJavaCallbackCode() shall return true for all ↵Sven Gothel2023-08-051-1/+1
| | | | | | JavaCallback cases no just non-userParam case Additional body code for JavaCallback is required for methods it.
* Merge remote-tracking branch 'Mathieu_Fery/wip/test_case_callback_emission'Sven Gothel2023-08-043-31/+51
|\
| * wip(test_case): Example of test case for issue related of ↵Mathieu Féry2023-08-043-31/+51
| | | | | | | | | | | | 927bbc7160a812bb29c0e7120d4a3009bfb13bbf Almost done
* | Merge remote-tracking branch ↵Sven Gothel2023-08-045-7/+19
|\ \ | | | | | | | | | 'Mathieu_Fery/feature/prevent_callback_generation_if_setter_is_absent'
| * | feat(callbackGenerator): Prevent generation of CallBack interface if setter ↵Mathieu Féry2023-08-045-7/+19
| | | | | | | | | | | | related isn't present
* | | Merge remote-tracking branch ↵Sven Gothel2023-08-041-4/+15
|\ \ \ | | | | | | | | | | | | 'Mathieu_Fery/feat/array_accessor_with_getter_of_field_in_pascal_case'
| * | | feat(arrayAccessor): Allow to use ReturnedArrayLength with getter associated ↵Mathieu Féry2023-08-031-4/+15
| |/ / | | | | | | | | | with field with name in PascalCase or camelCase
* | / Revert "JavaCallback: Remove non-UserParam ↵Sven Gothel2023-08-042-2/+12
| |/ |/| | | | | | | | | JavaConfiguration.requiresJavaCallbackCode()" This reverts commit 927bbc7160a812bb29c0e7120d4a3009bfb13bbf.
* | JavaCallback: Remove non-UserParam JavaConfiguration.requiresJavaCallbackCode()Sven Gothel2023-08-042-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Method was encapsulated in commit d4e8ecc3b4f68b86d95ec951971a0fea20217988 and questioned whether it is required. The non-userParam callback case adds no additional code requirements. Both, callback with and without userParam shares same code path and the respective native static fields. Only that the non-userParam code path adds additional native static fields, but all code sections are produced in both cases. Passed all unit tests.
* | JavaCallbackEmitter.emitJavaKeyClass(): Use directBufferAddress for compound ↵pulledSven Gothel2023-08-041-1/+5
| | | | | | | | | | | | | | | | | | types in equals and hashCode, i.e. use memory identity Use case is having a compound-type as userParam, which also acts as key, see MessageCallback13, Test4JavaCallback.chapter13(). The Java compound instance is re-created using the actual identical native memory (address), which has been stored or passed in the native toolkit.
* | JavaEmitter.bindFunction(): Add JavaCallback userParam non-void case (i.e. ↵Sven Gothel2023-08-041-18/+28
| | | | | | | | | | | | | | | | | | 'String') Use case: String type as userParam, barely tested and not useful. However, let's pass through all cases in our code. Added LOG INFO for mapped types.
* | CMethodBindingEmitter.emitBodyPassCArguments(): Either pass ↵Sven Gothel2023-08-041-2/+4
| | | | | | | | | | | | | | | | STRING_CHARS_PREFIX or javaCallbackEmitter.emitCOptArgumentSuffix(..) We only produce one variant in code. Use case: String type as userParam (barely tested and not useful)
* | JavaEmitter: Encapsulate 'needsJavaCallbackCode' query in JavaConfiguration. ↵Sven Gothel2023-08-042-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | TBD: Is this even required? - needsIntermediateOperation -> needsJavaCallbackCode - Use JavaConfiguration.requiresJavaCallbackCode(..) TBD: Is this even required? As far as I see, the non-userParam callback case adds no additional code requirements. Both, callback with and without userParam shares same code path and the respective native static fields. Only that the non-userParam code path adds additional native static fields, but all code sections are produced in both cases.
* | JavaCallbackEmitter.emitCAdditionalCode(): Use `info.cbFuncBinding` locally ↵Sven Gothel2023-08-041-6/+11
| | | | | | | | | | | | | | | | and passed 'jcbFuncCMethodEmitter' only to invoke CMethodBindingEmitter.emitBodyMapCToJNIType(..) Passed 'jcbFuncCMethodEmitter' only used to access CMethodBindingEmitter.emitBodyMapCToJNIType(int, boolean), a non-ideal hack! (FIXME) General processing shall use the local `info.cbFuncBinding`.
* | JavaCallbackEmitter.emitJavaCallbackBodyPassJavaArguments(): Drop redundant ↵Sven Gothel2023-08-041-5/+5
| | | | | | | | | | | | | | | | | | arg 'MethodBinding jcbFuncCMethodBinding', use local 'info.cbFuncBinding' Since emitJavaCallbackBodyPassJavaArguments() is private now, only use case is to handle info.cbFuncBinding and we can drop the redundant argument. Similar to cleanup commit e9a2294b3f18bb4c4f38347ccf347058cb4642b3
* | JavaCallbackEmitter.emitCSetFuncPreCall(): Drop redundant arg ↵Sven Gothel2023-08-032-5/+5
| | | | | | | | | | | | | | 'CMethodBindingEmitter jcbFuncCMethodEmitter', use local 'info.cbFuncBinding' Was added in commit ad69716fda64b517c33ed847c4b215ea398aac99 'callback without userData', while adding ad-hoc compound conversion.
* | JavaCallbackEmitter.{emitCSetFuncPreCall, emitCAdditionalCode, ↵Sven Gothel2023-08-032-37/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | emitJavaCallbackBodyPassJavaArguments}(): Fix exclusion of ad-hoc compound conversion for userParam Passed CMethodBindingEmitter denotes the callback-function, including the binding. The new iteration to handle the ad-hoc compound conversion, introduced in commit ad69716fda64b517c33ed847c4b215ea398aac99 'callback without userData', iterates over the callback-function argument list. Hence it shall only exclude the ad-hoc compound conversion if index != info.cbFuncUserParamIdx. Dropping the addition exclusion 'i != info.setFuncUserParamIdx'.
* | JavaCallbackEmitter.{emitCSetFuncPreCall, emitCAdditionalCode, ↵Sven Gothel2023-08-031-4/+5
| | | | | | | | emitJavaCallbackBodyPassJavaArguments}(): Use capitalized sub-string 'baseArgName' for (static) callback related entities
* | JavaCallbackEmitter.{emitCSetFuncPreCall, emitCAdditionalCode}(): Group ↵Sven Gothel2023-08-031-6/+17
| | | | | | | | 'userParamDefined' case (cleanup)
* | CMethodBindingEmitter.emitBodyMapCToJNIType(..): Add proper intendation to ↵Sven Gothel2023-08-031-9/+13
| | | | | | | | NIO ByteBuffer generation (isNIOBuffer || isCompoundTypeWrapper)
* | Merge remote-tracking branch ↵Sven Gothel2023-08-025-108/+243
|\ \ | | | | | | | | | 'Mathieu_Fery/feature/java_callback_without_user_data' into pulled
| * | feat(callbackGenerator): Add basic management of callback without userDataMathieu Féry2023-07-315-108/+243
| |/
* / feat(generation): Add setter generation for not constant and not opaque ↵Mathieu Féry2023-07-311-0/+14
|/ | | | compound attribute
* GlueGen JavaCallback: Add optional custom 'Callback-UserParamClass` for ↵Sven Gothel2023-07-103-27/+68
| | | | non-compound `UserParam` types to have more clarity in resulting API
* GlueGen JavaCallback: Add capability to have UserParam as (part of) keySven Gothel2023-07-083-46/+118
| | | | | | | | | Resolves use case where UserParam reflects e.g. a context (AL_SOFT_events) and will be (part of) the key mapping. Implementation required an additional userParamID -> userParam mapping for default Object/ID usage. Added 2 test cases.
* GlueGen JavaCallback: Remove ambiguity: Config ↵Sven Gothel2023-07-063-66/+78
| | | | JavaCallbackDef/JavaCallbackKey: Always define both parameter indices; emitJavaStaticCallback(): Use cbFuncBinding and cbFuncKeyIndices from callback parameter to build key
* GlueGen JavaCallback: Fix `staticCBClazz*` initial setup (only), using a ↵Sven Gothel2023-07-051-18/+22
| | | | | | NewGlobalRef() for jclass (not required for static jmethodID) Also use a longer jclass argument name 'clazz' -> 'staticCBClazz' to avoid potential collisions
* GlueGen: Add 'PascalString' string semantics (length + value-ptr), added ↵Sven Gothel2023-07-054-24/+163
| | | | | | | | | | | | | | | | | | | | | | | | | prelim code for JavaCallback use-case emitBodyMapCToJNIType() It is common in toolkit APIs that a string might not be passed as a 'nul' terminated (EOS) C string, but as a Pascal string with a given length argument. A C string is specied as ArgumentIsString alEventCallbackInject 3 while allowing multiple indices .. A Pascal string can be specified as ArgumentIsPascalString ALEVENTPROCSOFT 3 4 while allowing multiple indice-tuples for length and value .. The tuple consist of the length agrument-index first (usually an int) followed by the value argument-index (usually a 'char*'). +++ CMethodBindingEmitter.emitBodyMapCToJNIType(), where PascalString is implemented, is currently being used for - JNI return statement (no PascalString impact possible) - JavaCallback C type -> JNI type, PascalString impacting
* GlueGen JavaCallback/LibraryOnLoad: Always include the `libraryBasename` ↵Sven Gothel2023-07-053-29/+71
| | | | agnostic 'emitJNIEnvDecl()' (declaration) in JNI code; Detach the thread from the JVM if newly attach in callback!
* GlueGen JavaType.appendDescriptor(..): Fix regression: Must return a vanilla ↵Sven Gothel2023-07-041-3/+1
| | | | descriptor ('/' not '_') i.e. non JNI method-name descriptor to avoid double conversion
* GlueGen JavaCallback: Revised: Static Java callback dispatcher, dropping ↵Sven Gothel2023-07-0410-768/+1016
| | | | | | | | | | | | | | | | | | | | | | | | | native heap, support Struct UserParam ... Implementation now generates a static Java callback dispatcher for each defined SetCallbackFunction, which gets invoked by the generated native static counterpart with all arguments required. The static callback utilizes its own synchronization for thread-safety and fetches the required data set stored at SetCallbackFunction to dispatch the call to the users' CallbackFunction. In case the callback has been removed already, the static callback simply bails out quietly. The native code does not create, release or manage heap memory and therefore is considered safe. +++ Further Struct Type UserParam are now supported including Heterogeneous UserParam mapping (read GlueGen_Mapping.*). +++ Cleaned up code by extracting all JavaCallback emitter code into JavaCallbackEmitter class in one place, leaving JavaMethodbindingEmitter and CMethodbindingEmitter mostly in their original stage (non-convoluted). In this regard, I had to refactor a few function, i.e. moving CMethodbindingEmitter.getJNIMangledArg(..) into JavaType.appendDescriptor(..) and JavaType.appendJNIDescriptor(..) while reusing the toJNIMethodDescriptor(..) conversion. Test4JavaCallback covers and passes all cases.
* GlueGen JavaCallback: Unify native 'T_JavaCallbackGlueData' typedef structcallback_jniuserparamproxySven Gothel2023-07-023-11/+25
|