FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
axPluginObjects.cpp
1 #include "win_targetver.h"
2 #include "APITypes.h"
3 #include "JSAPI.h"
4 #include "global/resource.h"
5 #include "global/COM_config.h"
6 #include "FireBreathWin_i.h"
7 #include "COMJavascriptObject.h"
8 #include "ActiveXBrowserHost.h"
9 #include "global/axplugin_defs.h"
10 #include "FBControl.h"
11 #include "Win/PluginWindowWin.h"
12 #include "Win/PluginWindowlessWin.h"
13 
14 #include "ActiveXFactoryDefinitions.h"
15 #include "precompiled_headers.h" // On windows, everything above this line in PCH
16 
17 typedef FB::ActiveX::COMJavascriptObject<&CLSID_FBComJavascriptObject, IFBComJavascriptObject, &DIID_IFBComEventSource, &FB_LIBID> COMJSObject;
18 
19 // Definitions used for creating the plugins
20 #include "global/axplugin_defs.inc"
21 
22 IDispatchEx* _getCOMJSWrapper( const FB::BrowserHostPtr& host, const FB::JSAPIWeakPtr& api, bool autoRelease /*= false*/ )
23 {
24  return COMJSObject::NewObject(FB::ptr_cast<FB::ActiveX::ActiveXBrowserHost>(host), api, autoRelease);
25 }
26 const FB::WeakIDispatchExRef _getWeakRefFromCOMJSWrapper(IDispatchEx* wrapper)
27 {
28  assert(wrapper != NULL);
29  COMJSObject* ptr(dynamic_cast<COMJSObject*>(wrapper));
30  assert(ptr != NULL); // If this assertion fails, the wrong type of object was passed in!
31  return ptr->getWeakReference();
32 }
33 
34 HRESULT _updateRegistry( bool res ) {
35  return CFBControl0::UpdateRegistry(res);
36 }
37 
boost::weak_ptr< FB::JSAPI > JSAPIWeakPtr
Defines an alias for a JSAPI weak_ptr (you should never use a JSAPI* directly)
Definition: APITypes.h:88
boost::shared_ptr< FB::BrowserHost > BrowserHostPtr
Defines an alias representing a BrowserHost shared_ptr (you should never use a BrowserHost* directly)...
Definition: APITypes.h:117