webpg-npapi 0.6.1
|
00001 /**********************************************************\ 00002 00003 Auto-generated webpgPlugin.cpp 00004 00005 This file contains the auto-generated main plugin object 00006 implementation for the webpg-plugin project 00007 00008 \**********************************************************/ 00009 00010 #include "webpgPluginAPI.h" 00011 00012 #include "webpgPlugin.h" 00013 00021 void webpgPlugin::StaticInitialize() 00022 { 00023 // Place one-time initialization stuff here; As of FireBreath 1.4 this should only 00024 // be called once per process 00025 } 00026 00034 void webpgPlugin::StaticDeinitialize() 00035 { 00036 // Place one-time deinitialization stuff here. As of FireBreath 1.4 this should 00037 // always be called just before the plugin library is unloaded 00038 } 00039 00045 webpgPlugin::webpgPlugin() 00046 { 00047 } 00048 00052 webpgPlugin::~webpgPlugin() 00053 { 00054 // This is optional, but if you reset m_api (the shared_ptr to your JSAPI 00055 // root object) and tell the host to free the retained JSAPI objects then 00056 // unless you are holding another shared_ptr reference to your JSAPI object 00057 // they will be released here. 00058 releaseRootJSAPI(); 00059 m_host->freeRetainedObjects(); 00060 } 00061 00062 void webpgPlugin::onPluginReady() 00063 { 00064 // When this is called, the BrowserHost is attached, the JSAPI object is 00065 // created, and we are ready to interact with the page and such. The 00066 // PluginWindow may or may not have already fire the AttachedEvent at 00067 // this point. 00068 } 00069 00070 void webpgPlugin::shutdown() 00071 { 00072 // This will be called when it is time for the plugin to shut down; 00073 // any threads or anything else that may hold a shared_ptr to this 00074 // object should be released here so that this object can be safely 00075 // destroyed. This is the last point that shared_from_this and weak_ptr 00076 // references to this object will be valid 00077 } 00078 00090 FB::JSAPIPtr webpgPlugin::createJSAPI() 00091 { 00092 // m_host is the BrowserHost 00093 return boost::make_shared<webpgPluginAPI>(FB::ptr_cast<webpgPlugin>(shared_from_this()), m_host); 00094 } 00095 00096 bool webpgPlugin::onMouseDown(FB::MouseDownEvent *evt, FB::PluginWindow *) 00097 { 00098 //printf("Mouse down at: %d, %d\n", evt->m_x, evt->m_y); 00099 return false; 00100 } 00101 00102 bool webpgPlugin::onMouseUp(FB::MouseUpEvent *evt, FB::PluginWindow *) 00103 { 00104 //printf("Mouse up at: %d, %d\n", evt->m_x, evt->m_y); 00105 return false; 00106 } 00107 00108 bool webpgPlugin::onMouseMove(FB::MouseMoveEvent *evt, FB::PluginWindow *) 00109 { 00110 //printf("Mouse move at: %d, %d\n", evt->m_x, evt->m_y); 00111 return false; 00112 } 00113 bool webpgPlugin::onWindowAttached(FB::AttachedEvent *evt, FB::PluginWindow *) 00114 { 00115 // The window is attached; act appropriately 00116 return false; 00117 } 00118 00119 bool webpgPlugin::onWindowDetached(FB::DetachedEvent *evt, FB::PluginWindow *) 00120 { 00121 // The window is about to be detached; act appropriately 00122 return false; 00123 } 00124