1 #include <Commons/plugin_initializer_def.h>
2 #include <Commons/WrtAccess/WrtAccess.h>
3 #include <Commons/Exception.h>
4 #include <dpl/log/log.h>
5 #include "VehicleAsyncCallbackManager.h"
6 #include "VehicleListenerManager.h"
9 using namespace WrtDeviceApis;
10 using namespace WrtDeviceApis::Commons;
15 void on_widget_start_callback(int widgetId)
17 LogDebug("[Tizen/Vehicle] on_widget_start_callback (" << widgetId << ")");
19 WrtAccessSingleton::Instance().initialize(widgetId);
21 LogError("WrtAccess initialization failed");
25 void on_widget_stop_callback(int widgetId)
27 LogDebug("[Tizen/Vehicle] on_widget_stop_callback (" << widgetId << ")");
29 WrtAccessSingleton::Instance().deinitialize(widgetId);
31 LogError("WrtAccess deinitialization failed");
35 void on_frame_load_callback(const void * context)
39 void on_frame_unload_callback(const void * context)
41 VehicleAsyncCallbackManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
42 VehicleListenerManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
45 PLUGIN_ON_WIDGET_START(on_widget_start_callback)
46 PLUGIN_ON_WIDGET_STOP(on_widget_stop_callback)
48 PLUGIN_ON_FRAME_LOAD(on_frame_load_callback)
49 PLUGIN_ON_FRAME_UNLOAD(on_frame_unload_callback)
51 PLUGIN_CLASS_MAP_BEGIN
53 PLUGIN_CLASS_MAP_ADD_CLASS(
54 WRT_JS_EXTENSION_OBJECT_TIZEN,
56 (js_class_template_getter)JSVehicle::getClassRef,
62 } //namespace TizenApis