title: How can I FireEvent in callback from Firebreath
body: <p>I am a new to Firebreath. I have a task force to use a upload-file DLL through web page through Firebreath.
  Now I have a callback problem.
  There is a API in my dll.</p>
  
  <pre><code>int idu_initialize(transfer_callback pf); 
  </code></pre>
  
  <p>callback funciton pointer define like this: </p>
  
  <pre><code>typedef void (*transfer_callback)(const char*)
  </code></pre>
  
  <p>transfer_callback is a upload process callback function.
  I want html page can use transfer_callback to refresh html UI.
  I do the following step:
  method 1
  define a PluginJsAPI function</p>
  
  <pre><code>registerMethod("fire_idum_initialize", make_method(this, &amp;IDUMPluginAPI::fire_idum_initialize));
  int fire_idum_initialize();
  callback function like this:
  void print_transfer_info(const char *s)
  {
  }
  int IDUMPluginAPI::fire_idum_initialize()
  {
      int result = idu_initialize(print_transfer_info);
      return result;
  }
  </code></pre>
  
  <p>During  the file uploading process, the debug pointer can step into print_transfer_info callback
  I define a js function in debug html</p>
  
  <pre><code>function load()
  {
      addEvent(plugin(), 'upcb', function(msg){
            document.getElementById('callbackDiv').innerHTML=msg;});
  }
  </code></pre>
  
  <p>i want to call fire_upcb(s) macro in print_transfer_info, but print_transfer_info is not IDUMPluginAPI member function, can not call fire_upcb(s)
  how can i walk around it?
  method 2:
  define a js function callback, but how can i comsume the print_transfer_info callback?
  how fire event to js from dll callback function print_transfer_info.
  the print_transfer_info not a class member function;even if define print_transfer_info as a static class member function, cannot call fire_event,neither.
  Any advises are very appreciated, thank you.</p>