diff options
Diffstat (limited to 'doc/GlueGen_Mapping.html')
-rw-r--r-- | doc/GlueGen_Mapping.html | 60 |
1 files changed, 14 insertions, 46 deletions
diff --git a/doc/GlueGen_Mapping.html b/doc/GlueGen_Mapping.html index d3f7aef..69aa11f 100644 --- a/doc/GlueGen_Mapping.html +++ b/doc/GlueGen_Mapping.html @@ -1689,10 +1689,9 @@ IndexOutOfBoundsException is thrown</li> <h3 id="struct-function-pointer-support">Struct Function Pointer Support</h3> <p>GlueGen supports function pointers as struct fields,<br /> -generating function calls as methods as well as -<code>is<FuncName>Null()</code> checks<br /> -and function pointer opaque getter and setter as <code>long</code> -types.</p> +generating function calls as methods as well function-pointer opaque +getter and setter as <code>long</code> types.<br /> +The latter only in case if mutable, i.e. non-const.</p> <h4 id="example">Example</h4> <p>Assume the following C Header file example:</p> <pre><code>typedef struct { @@ -1704,7 +1703,7 @@ typedef int32_t ( * T2_CustomFuncA)(void* aptr); typedef int32_t ( * T2_CustomFuncB)(T2_UserData* pUserData); typedef struct { - T2_CustomFuncA CustomFuncA1; + const T2_CustomFuncA CustomFuncA1; T2_CustomFuncB CustomFuncB1; } T2_InitializeOptions;</code></pre> <p>and the following GlueGen <em>no-magic</em> configuration</p> @@ -1716,52 +1715,19 @@ StructPackage T2_UserData com.jogamp.gluegen.test.junit.generation EmitStruct T2_InitializeOptions StructPackage T2_InitializeOptions com.jogamp.gluegen.test.junit.generation</code></pre> <p>This will lead to the following result for -<code>T2_InitializeOptions.customFuncA1</code></p> -<pre><code> /** Interface to C language function: <br> <code>int32_t CustomFuncA1(void * aptr)</code><br> */ - public final int CustomFuncA1(long aptr) { ... } - - /** - * Returns `true` if native pointer <code>CustomFuncA1</code> is `null`, otherwise `false`. - * <p> - * Corresponds to native field <code>CustomFuncA1</code>, being a <i>struct</i> owned function pointer. - * </p> - * <p> - * Native Field Signature <code>(PointerType) typedef 'T2_CustomFuncA' -> int32_t (*)(void * aptr), size [fixed false, lnx64 8], const[false], pointer*1, funcPointer</code> - * </p> - */ - public final boolean isCustomFuncA1Null() { .. } - - /** - * Setter for native field <code>CustomFuncA1</code>, being a <i>struct</i> owned function pointer. - * <p> - * Native Field Signature <code>(PointerType) typedef 'T2_CustomFuncA' -> int32_t (*)(void * aptr), size [fixed false, lnx64 8], const[false], pointer*1, funcPointer</code> - * </p> - */ - public final T2_InitializeOptions setCustomFuncA1(long src) { .. } - - /** +<code>const T2_CustomFuncA customFuncA1</code></p> +<pre><code> /** * Getter for native field <code>CustomFuncA1</code>, being a <i>struct</i> owned function pointer. * <p> * Native Field Signature <code>(PointerType) typedef 'T2_CustomFuncA' -> int32_t (*)(void * aptr), size [fixed false, lnx64 8], const[false], pointer*1, funcPointer</code> * </p> */ - public final long getCustomFuncA1() { .. } </code></pre> -<p>and similar to <code>T2_InitializeOptions.customFuncB1</code></p> -<pre><code> /** Interface to C language function: <br> <code>int32_t CustomFuncB1(T2_UserData * pUserData)</code><br> */ - public final int CustomFuncB1(T2_UserData pUserData) { .. } + public final long getCustomFuncA1() { .. } - /** - * Returns `true` if native pointer <code>CustomFuncB1</code> is `null`, otherwise `false`. - * <p> - * Corresponds to native field <code>CustomFuncB1</code>, being a <i>struct</i> owned function pointer. - * </p> - * <p> - * Native Field Signature <code>(PointerType) typedef 'T2_CustomFuncB' -> int32_t (*)(T2_UserData * pUserData), size [fixed false, lnx64 8], const[false], pointer*1, funcPointer</code> - * </p> - */ - public final boolean isCustomFuncB1Null() { .. } - - /** + /** Interface to C language function: <br> <code>int32_t CustomFuncA1(void * aptr)</code><br> */ + public final int CustomFuncA1(long aptr) { ... } </code></pre> +<p>and similar to <code>T2_CustomFuncB customFuncB1</code></p> +<pre><code> /** * Setter for native field <code>CustomFuncB1</code>, being a <i>struct</i> owned function pointer. * <p> * Native Field Signature <code>(PointerType) typedef 'T2_CustomFuncB' -> int32_t (*)(T2_UserData * pUserData), size [fixed false, lnx64 8], const[false], pointer*1, funcPointer</code> @@ -1776,7 +1742,9 @@ StructPackage T2_InitializeOptions com.jogamp.gluegen.test.junit.generation</cod * </p> */ public final long getCustomFuncB1() { .. } -</code></pre> + + /** Interface to C language function: <br> <code>int32_t CustomFuncB1(T2_UserData * pUserData)</code><br> */ + public final int CustomFuncB1(T2_UserData pUserData) { .. } </code></pre> <h2 id="platform-header-files">Platform Header Files</h2> <p>GlueGen provides convenient platform headers,<br /> which can be included in your C header files for native compilation and |