#include <dpl/singleton_safe_impl.h>
#include <js_function_manager.h>
-#include <js_iframe_support.h>
#include <js_overlay_functions.h>
-#include <js_overlay_addEventListener.h>
#include <wrt_plugin_export.h>
-using namespace WrtPlugins::W3C;
-
IMPLEMENT_SAFE_SINGLETON(JsFunctionManager)
namespace {
const char* JSPRINT_NAME = "jsPrint";
const char* JSGLOBAL_OBJECT = "GLOBAL_OBJECT";
const char* JSHOOK_NAME = "jsHook";
-const char* ADD_EVENT_LISTENER_NAME = "addEventListener";
}
namespace JavaScriptFunctions {
reinterpret_cast<js_function_impl>(JSCFunctions::JavaScriptPrintProc)
};
-class_definition_options_t addEventListenerOptions = {
- JS_FUNCTION,
- CREATE_INSTANCE,
- ALWAYS_NOTICE,
- OVERLAYED_BEFORE_ORIGINAL,
- IFrameSupport::RegisterAddEventListener,
- NULL,
- reinterpret_cast<js_function_impl>(AddEventListenerSupport::
- AddEventListener)
-};
-
js_entity_definition_t jsPrint = {
JSGLOBAL_OBJECT,
JSPRINT_NAME,
&jsHookfunctionsOptions
};
-js_entity_definition_t addEventListener = {
- JSGLOBAL_OBJECT,
- ADD_EVENT_LISTENER_NAME,
- "",
- NULL,
- NULL,
- &addEventListenerOptions
-};
const js_entity_definition_ptr_t jsPrintPtr = &jsPrint;
const js_entity_definition_ptr_t jsHookPtr = &jsHook;
-const js_entity_definition_ptr_t addEventListenerPtr = &addEventListener;
}
bool JsFunctionManager::initialize()
JSObjectDeclarationPtr jsHookObj(
new JSObjectDeclaration(JavaScriptFunctions::jsHookPtr));
- JSObjectDeclarationPtr addEventListenerObj(
- new JSObjectDeclaration(JavaScriptFunctions::addEventListenerPtr));
-
m_functions.push_back(jsPrintObj);
m_functions.push_back(jsHookObj);
- m_functions.push_back(addEventListenerObj);
return true;
}