aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Test4JavaCallback: Just rename myUserParam -> myUserParam01 for future tests..Sven Gothel2023-06-291-22/+22
|
* GlueGen JavaCallback: Set-Callback: Ensure a previously mapped 'userParam' ↵Sven Gothel2023-06-292-12/+42
| | | | instance is released before binding new one; Add test changing callback function.
* README.md: Fix linksSven Gothel2023-06-291-2/+2
|
* Doc intro: Fix LibraryOnLoad using generic LibraryBasenameSven Gothel2023-06-294-4/+4
|
* Doc: www/index.html: Fix JOGL UML linkSven Gothel2023-06-291-1/+1
|
* Doc: Align GlueGen_Mapping.md intro w/ README.md and www/index.htmlSven Gothel2023-06-294-23/+41
|
* GlueGen JavaCallback: 1st Working Draft: Changed 'JavaCallbackDef' config, ↵Sven Gothel2023-06-2912-217/+863
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | added code generation incl. native to Java dispatch and resource management Tested via Test4JavaCallback.java (using test2.[hc]). Please read the GlueGen_Mapping.md as well as Test4JavaCallback.java . +++ Some implementation details: JavaConfiguration maps JavaCallbackDef to JavaCallback set-function and maintains a list. JavaCallbackDef itself holds all configured details. JavaConfiguration also maps JavaCallbackInfo to JavaCallback set-function. JavaCallbackInfo itself holds all compile time information, as produced by JavaEmitter.beginFunctions(..). This extends JavaCallbackDef and avoid repetetive computation for the callback-function-type and its MethodBinding, parameter indices for the callback interface and userParam, etc. CMethodBindingEmitter: Native callback to Java dispatch - The JavaCallback setter function creates a native 'UserParam' struct instance, which holds the callback-interface-jobject, its callback-jmethodID and the userParam-jobject for invocation of the actual JavaCallback interface method. - To produce the C-Type -> JNI-Type conversion, An internal CMethodBindingEmitter instance for the native-callback function binding is created inside the CMethodBindingEmitter of the callback setter method. It is being used to map the types to JNI within the generated native callback function, passed to the actual JavaCallback method. JavaMethodBindingEmitter: Native callback to Java dispatch - The JavaCallbacl setter passes the callback-interface-object, the userParam-object and the callback-method-signature (to have the native method retrieve the jmethodID). - It receives the native pointer of the native `UserParam` struct instance, which gets mapped to the userParam-object. (*TODO: Refine ownership + release*).
* GlueGen ProcAddressCMethodBindingEmitter.jniMangle() override: Only add ↵Sven Gothel2023-06-291-1/+1
| | | | additional params if produced name containes '__', i.e. JNI mangled parameter
* GlueGen FunctionType: Factor out getParameterList(..) from toString(..) and ↵Sven Gothel2023-06-293-22/+113
| | | | drop 'void' and use typedef-name; MethodBinding: Add getCParameterList(..) and getJavaParameterList(..) for general usage similar to FunctionType.getParameterList()
* GlueGen CMethodBindingEmitter: Refactor emitBodyReturnResult() -> ↵Sven Gothel2023-06-291-98/+148
| | | | emitBodyMapCToJNIType(): Reuse to converting any C-type argument to java JNI type (i.e. native callback to JavaCallback)
* GlueGen: Move [de]captializeString(..) JavaEmitter -> static in CodeGenUtilsSven Gothel2023-06-292-7/+21
|
* GlueGen LibraryOnLoad Config: Generate `JNI_OnLoad(..)` for dynamic and ↵Sven Gothel2023-06-294-5/+141
| | | | `JNI_OnLoad_<LibraryBasename>(..)` for static libraries and `JVMUtil_GetJNIEnv(..)` to resolve the `JNIEnv*` as used by JavaCallback
* GlueGen doc/GlueGen_Mapping.md: Mentiond OO-Style API mapping and add ↵Sven Gothel2023-06-291-3/+74
| | | | section for it
* GlueGen Struct [17]: Handle void pointers, i.e. `void*`, within a struct as ↵Sven Gothel2023-06-294-43/+80
| | | | | | `Opaque` configured pointer-types .. includes cross-ref'ed doc and unit test
* GlueGen JavaCallback: Add JavaCallback.methodSignature to JNI arg-list and ↵Sven Gothel2023-06-261-0/+16
| | | | pass value at invocation, allowing to find the jmethodID of callback
* GlueGen JavaCallback: Move JavaCallback into JavaConfiguration, accessible ↵Sven Gothel2023-06-262-52/+82
| | | | across *Emitter (needed for CMethodEmitter as well); Add JavaCallback.methodSignature to be passed to native function later on to find the callback jmethodID
* GlueGen JavaCallback: Expose getJNIMethodDescriptor() for JNI mangled method ↵Sven Gothel2023-06-263-14/+49
| | | | names, used in CMethodBindingEmitter; Use JavaCallback's function-pointer-type capital-name as simple-class-name and its FQN for JNI resolution.
* GlueGen JavaCallback: Use new JavaType nature 'named-class', denoting the ↵Sven Gothel2023-06-262-1/+5
| | | | | | | | | | | | generated callback interface mapping the callback function. This passes the jobject for the callback function/interface and the userParam (from 'void*') down to the native implementation. TODO: Add specific native implementation for JavaCallback, wrapping the jobject's into a native struct as user-param and a universal C-function as the native callback to dispatch the call to the java method with known arguments.
* GlueGen JavaType: Add new nature 'String clazzName': Future (not yet ↵Sven Gothel2023-06-261-35/+97
| | | | | | | | | | generated or existing) Class objects (existing at runtime) New nature can be queried via isNamedClass(). Cleaned up equals() and completed hashValue() etc. Ctor validation ensures exactly one nature is set!
* GlueGen JavaCallback: Add more related documentationSven Gothel2023-06-252-4/+62
|
* GlueGen JavaCallback: Add preliminary implementation (WIP): Produces proper ↵Sven Gothel2023-06-253-9/+146
| | | | | | interfaces, TODO implementation Note: JavaCallbackDef is commented out on test2.cfg example, since implementation is missing.
* GlueGen JavaConfiguration: Add List<Integer> stringArguments(final ↵Sven Gothel2023-06-251-0/+18
| | | | AliasedSymbol symbol)
* GlueGen JavaConfiguration: Add 'JavaCallbackDef ↵Sven Gothel2023-06-251-1/+47
| | | | | | | | | <funcion-pointer-typedef-name> [user-param-idx]' Define a JavaCallback, enacted on a function-pointer argument `T2_CallbackFunc` and a user-param `void*` for Java Object mapping Example: JavaCallbackDef T2_CallbackFunc 2
* GlueGen FunctionSymbol: Simplify ctor reusing main-ctor; Be always reachable ↵Sven Gothel2023-06-251-3/+2
| | | | via type(def)name, ctor: addAliasedName( type.getCName() )
* GlueGen Add JavaType.forObjectClass()Sven Gothel2023-06-251-0/+8
|
* GlueGen FunctionType: Expose toString(..) w/ 'isPointer' argumentSven Gothel2023-06-251-0/+3
|
* GlueGen: Fix Type.getSignature(..): Test for isFunctionPointer() to ↵Sven Gothel2023-06-251-6/+9
| | | | elaborate on FunctionType as getTargetType() only retruns a function-ptr and no more a function-type.
* JavaEmitter.generateArrayGetterSetterCode(): Place elemCountExpr null check ↵Sven Gothel2023-06-251-8/+7
| | | | where it could occur -> non-opaque, non-primitive array case
* GlueGen: Add JavaEmitter(JavaConfiguration) ctorSven Gothel2023-06-251-0/+5
|
* GlueGen Fix ProcAddressCMethodBindingEmitter.jniMangle(..) override: Use ↵Sven Gothel2023-06-251-1/+1
| | | | renamed {jniMangle->getJNIMangledArg}(..)
* GlueGen: Rename GlueEmitter.getConfig{uration->}() and drop ↵Sven Gothel2023-06-255-14/+7
| | | | JavaEmitter.getConfig(), cleaning up API usage
* GlueGen: Expose CMethodBindingEmitter.getJNIMangledArgs() as a public static ↵Sven Gothel2023-06-251-14/+24
| | | | to be reusable
* GlueGen Struct [16]: Add support for pointer-pointer and function-pointer valuesSven Gothel2023-06-239-203/+592
| | | | See documentation and unit test test2.h, Test2FuncPtr.java and Test3PtrStorage.java
* GlueGen: JavaConfiguration.promoteTypeInfo(): Fix primitive pointerDepth, ↵Sven Gothel2023-06-231-1/+1
| | | | i.e. only pass numPointersStripped w/o adding info.pointerDepth()
* GlueGen: JavaConfiguration.typeInfo(..): Clarify DEBUG_TYPE_INFO outputSven Gothel2023-06-231-12/+14
|
* GlueGen: Type: Have get{Base,Target}Type() stop at isFunctionPointer(), ↵Sven Gothel2023-06-237-38/+76
| | | | | | | | | | enhance API doc; Add getArrayBaseOrPointerTargetType() and getTargetFunction() Added getArrayBaseOrPointerTargetType() returns getBaseType() for arrays or getTargetType() for pointer, i.e. stops traversing if an elementType is a pointer and returns the elementType as target-type. This resolves 'int* intPtrArray[10]', but also simplifies all cases of 'int** intPtrPtr' and 'int intPtr[10]' etc. Since get{Base,Target}Type() returns the functionPointer, getTargetFunction() allows to retrieve the actual target function type.
* GlueGen: Type, JavaType: Align getSignature(..) outputSven Gothel2023-06-232-41/+48
|
* NIO NativeBuffer, {Element,Pointer}Buffer: Add limit, clear and flip; ↵Sven Gothel2023-06-234-94/+385
| | | | | | | | Arrange wrap/deref arguments equal; Add equal set of absolute get/set methods Completing API to simplify usage by generated code. All absolute get/set method check arguments itself and against limit(), allow to drop checks in generated code (size).
* GlueGen Test: Test2 -> Test2FuncPtrSven Gothel2023-06-232-4/+4
|
* JavaEmitter.typeToJavaTypeImpl(): Add targetType in GlueGenException and ↵Sven Gothel2023-06-211-13/+15
| | | | remove '"' in message
* GlueGen junit test2.h: Add an anonymous struct pointer w/ opaque long configSven Gothel2023-06-202-5/+4
|
* GlueGen Struct [15b]: FunctionPointer: Drop is<FuncName>Null() -> use ↵Sven Gothel2023-06-206-116/+47
| | | | get<FuncName>()
* GlueGen Struct [15]: Add FunctionPointer getter and setter support w/ ↵Sven Gothel2023-06-2010-167/+631
| | | | documentation
* doc/GlueGen_Mapping.md: Place `Struct Setter Pseudo-Code` above 'Signature ↵Sven Gothel2023-06-201-29/+50
| | | | Table' and add a brief signature to mapping description to the former
* GlueGen Type: Use virt getTargetType() for ArrayType dropping ↵Sven Gothel2023-06-197-26/+30
| | | | getElementType(); Rename getBase{Elem ->}Type() to align with getTargetType()
* Doc: Manual: Adding disclaimer being slightly outdated and hint to ↵Sven Gothel2023-06-181-0/+5
| | | | GlueGen_Mapping document
* www/index.html: Copy Documentation section into main text for visibilitySven Gothel2023-06-181-0/+11
|
* GlueGen Struct [14]: Update doc/GlueGen_Mapping.mdSven Gothel2023-06-182-24/+151
| | | | Completing a few cases and fix some signatures in table
* CPP Enable Pragma Once: Remove cli '--enablePragmaOnce' option as it is ↵Sven Gothel2023-06-181-4/+1
| | | | enabled by default
* Merge remote-tracking branch ↵Sven Gothel2023-06-182-6/+9
|\ | | | | | | 'Mathieu_Fery/feature/add_preserveGeneratedCPP_option'