winapi - Firebreath C++ some pointer understanding -


i asked 1 question here get mouse screen coordinates on click , got answer (confirmed one), thx gaurav raj this. , in sample:

bool mirrarornaments::onmousedown(fb::mousedownevent *evt, fb::pluginwindow *)  {   if(evt->m_btn == fb::mousebuttonevent::mousebutton_left)    {     /**       * apiptr pointer fb::jsapiptr       * mousepositioncallback jsapi function takes variant list of mouse       * co-ordinates argument       */      apiptr->invoke("mousepositioncallback", fb::variant_list_of(evt->m_x)(evt->m_y));    } } 

as get, last string must run mousepositioncallback function in javascript argument of fb::variant_list; cant understand purpose of apiptr pointer, can , how pointer fb::jsapiptr must in code.

the fb::jsapiptr type in firebreath convenience alias boost::shared_ptr (shared auto pointer not have call delete on object, nor have worry vanishing)...

try add getrootjsapi() call, should return apiptr you.

bool mirrarornaments::onmousedown(fb::mousedownevent *evt, fb::pluginwindow *)  {   if(evt->m_btn == fb::mousebuttonevent::mousebutton_left)    {     /**       * apiptr pointer fb::jsapiptr       * mousepositioncallback jsapi function takes variant list of mouse       * co-ordinates argument       */      // if want access api part     // fb::jsapiptr apiptr(boost::make_shared<fbyourpluginapi>(m_plugin));     //add next line:     fb::jsapiptr apiptr = m_plugin.lock()->getrootjsapi();     apiptr->invoke("mousepositioncallback", fb::variant_list_of(evt->m_x)(evt->m_y));    } } 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -