<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>1258</bug_id>
          
          <creation_ts>2015-10-23 14:47:32 +0200</creation_ts>
          <short_desc>Add Multiple JNI/Native to Java Callback Generation Techniques</short_desc>
          <delta_ts>2019-03-30 01:38:31 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Gluegen</product>
          <component>core</component>
          <version>tbd</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>CONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>FEATURE</cf_type>
          <cf_scm_refs></cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>5458</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2015-10-23 14:47:32 +0200</bug_when>
    <thetext>As it is for now, we used manual injected code to implement 
a callback from native code back to Java.

Use Case A)
  - Register a java callback method (Class instance or static) [T1]
    to be issued by a native toolkit callback method [T2].
    
  - The native toolkit callback method [T2] has to be registered
    to a toolkit register function [T3]
    
  - User has to mark (configure) the toolkit register function [T3]
    as well as the native toolkit callback method [T2]
    to be used for java callback.

  - User further needs to define the identity of
    the native toolkit callback method [T2]. I.e. multiple such 
    instances may need to exist for different callbacks and their
    respective registries.
    Since only callback where a caller instance is being passed
    would allow using a callback dispatch table.

  Note: This use case is currently manually utilized by JOGL&apos;s 
  OpenGL debug callbacks, see GLDebugMessageHandler

Use Case B)
  - Register a java callback method (Class instance or static) [T1]
    to be issued by another JNI API method [T4] as a 
    pre- or post-call.

    This allows an implementation to properly track events
    and/or trigger certain resource functionality.

  Note: This use case is currently manually utilized by JOGL&apos;s
  GPU side memory [re-]allocation / mapping, 
  see GLBufferObjectTracker/GLBufferStorage.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>