X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fjs-overlay%2Fjs_function_manager.cpp;h=dfa55b2a768d1300c2a5bdd38ab68d5cc0eea208;hb=fde81536bf4177b0ca88091eddf7afbf23ffb4bf;hp=d1be598bf3608af7229bbab95d42a42fef4d8beb;hpb=9922aaf128e9e5ecee4f80fe7bd717bd903ec688;p=platform%2Fframework%2Fweb%2Fwrt-plugins-common.git diff --git a/src/js-overlay/js_function_manager.cpp b/src/js-overlay/js_function_manager.cpp index d1be598..dfa55b2 100644 --- a/src/js-overlay/js_function_manager.cpp +++ b/src/js-overlay/js_function_manager.cpp @@ -39,77 +39,70 @@ const char* JSHOOK_NAME = "jsHook"; const char* ADD_EVENT_LISTENER_NAME = "addEventListener"; } -namespace JavaScriptFunctions -{ +namespace JavaScriptFunctions { //options - class_definition_options_t jsHookfunctionsOptions = - { - JS_FUNCTION, - CREATE_INSTANCE, - NONE_NOTICE, - USE_OVERLAYED, //ignored - NULL, - NULL, - reinterpret_cast(JSCFunctions::JavaScriptHookProc) - }; - - class_definition_options_t jsPrintfunctionsOptions = - { - JS_FUNCTION, - CREATE_INSTANCE, - NONE_NOTICE, - USE_OVERLAYED, //ignored - NULL, - NULL, - reinterpret_cast(JSCFunctions::JavaScriptPrintProc) - }; - - class_definition_options_t addEventListenerOptions = - { - JS_FUNCTION, - CREATE_INSTANCE, - ALWAYS_NOTICE, - OVERLAYED_BEFORE_ORIGINAL, - IFrameSupport::RegisterAddEventListener, - NULL, - reinterpret_cast(AddEventListenerSupport::AddEventListener) - }; - - js_entity_definition_t jsPrint = - { - JSGLOBAL_OBJECT, - JSPRINT_NAME, - "", - NULL, - NULL, - &jsPrintfunctionsOptions - }; - - js_entity_definition_t jsHook = - { - JSGLOBAL_OBJECT, - JSHOOK_NAME, - "", - NULL, - NULL, - &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; +class_definition_options_t jsHookfunctionsOptions = { + JS_FUNCTION, + CREATE_INSTANCE, + NONE_NOTICE, + USE_OVERLAYED, //ignored + NULL, + NULL, + reinterpret_cast(JSCFunctions::JavaScriptHookProc) +}; + +class_definition_options_t jsPrintfunctionsOptions = { + JS_FUNCTION, + CREATE_INSTANCE, + NONE_NOTICE, + USE_OVERLAYED, //ignored + NULL, + NULL, + reinterpret_cast(JSCFunctions::JavaScriptPrintProc) +}; + +class_definition_options_t addEventListenerOptions = { + JS_FUNCTION, + CREATE_INSTANCE, + ALWAYS_NOTICE, + OVERLAYED_BEFORE_ORIGINAL, + IFrameSupport::RegisterAddEventListener, + NULL, + reinterpret_cast(AddEventListenerSupport:: + AddEventListener) +}; + +js_entity_definition_t jsPrint = { + JSGLOBAL_OBJECT, + JSPRINT_NAME, + "", + NULL, + NULL, + &jsPrintfunctionsOptions +}; + +js_entity_definition_t jsHook = { + JSGLOBAL_OBJECT, + JSHOOK_NAME, + "", + NULL, + NULL, + &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() { LogInfo("JSObjectDeclaration for js functions are intialized");