#include <dpl/log/log.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/Converter.h>
-#include <Commons/WrtWrapper/IWrtWrapper.h>
-#include <Commons/WrtWrapper/WrtWrappersMgr.h>
+#include <Commons/WrtAccess/WrtAccess.h>
#include <API/Filter/FilterTypes.h>
#include <API/Filter/AnyType.h>
#include <CommonsJavaScript/JSDOMExceptionFactory.h>
if (priv) {
delete priv;
}
- IWrtWrapperPtr wrapper;
- Try
- {
- wrapper = WrtWrappersMgr::getInstance().getWrtWrapper(context);
- }
- Catch(WrtDeviceApis::Commons::InvalidArgumentException)
- {
- LogError("Cannot get WRT wrapper.");
- LogError("You should register your wrapper in ON_WIDGET_START");
- return;
- }
+ int widgetId = WrtAccessSingleton::Instance().getWidgetId();
PluginOnDemandPrivPtr privObject(
new PluginOnDemandPriv(
- wrapper,
PluginManagerFactory::getInstance().getPluginManager(
- wrapper->getWidgetId(),
+ widgetId,
PLUGIN_NAME,
+ object,
context)));
priv = new TizenPrivate(context, privObject);
const JSValueRef arguments[], JSValueRef* exception)
{
LogDebug("entered");
- IWrtWrapperPtr wrapper;
TizenPrivate* priv = static_cast<TizenPrivate*>(JSObjectGetPrivate(thisObject));
assert(priv);
/*
* Current Tizen spec assures that tizen is always available
- AccessStatus status = DEVICEAPIS_CHECK_ACCESS(priv->getContext(),
+ AccessStatus status = DEVICEAPIS_CHECK_ACCESS(
DEVICEAPIS_FUNCTION_API_LIST_AVAIL_FEATURES);
SYNC_ACCESS_STATUS_HANDLER(status, context, exception);
if (!priv) {
ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "No private object");
}
-// wrapper = priv->getObject();
PluginOnDemandPrivPtr privObj = priv->getObject();
- wrapper = privObj->getWrtWrapper();
}
catch(const WrtDeviceApis::Commons::Exception &ex)
{
- LogError("couldn't get wrapper, " << ex.GetMessage());
return WrtDeviceApis::CommonsJavaScript::JSDOMExceptionFactory::UnknownException.make(context, exception);
}
JSObjectRef result = JSCreateArrayObject(context, 0, NULL);
+ int widgetId = WrtAccessSingleton::Instance().getWidgetId();
WidgetDB::Api::IWidgetDBPtr widgetDB =
- WidgetDB::Api::getWidgetDB(wrapper->getWidgetId());
+ WidgetDB::Api::getWidgetDB(widgetId);
WidgetDB::Api::Features features = widgetDB->getRegisteredFeatures();
for (size_t i=0; i<features.size(); ++i) {
JSFeaturePrivateObject *priv = new JSFeaturePrivateObject(context, features[i]);
/*
* Current Tizen spec assures that tizen is always available
- AccessStatus status = DEVICEAPIS_CHECK_ACCESS(priv->getContext(),
+ AccessStatus status = DEVICEAPIS_CHECK_ACCESS(
DEVICEAPIS_FUNCTION_API_LIST_ACTIV_FEATURES);
SYNC_ACCESS_STATUS_HANDLER(status, context, exception);*/
- IWrtWrapperPtr wrapper;
try
{
if (!priv) {
ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "No private object");
}
PluginOnDemandPrivPtr privObj = priv->getObject();
- wrapper = privObj->getWrtWrapper();
}
catch(const WrtDeviceApis::Commons::Exception &ex)
{
- LogError("couldn't get wrapper, " << ex.GetMessage());
return WrtDeviceApis::CommonsJavaScript::JSDOMExceptionFactory::UnknownException.make(context, exception);
}
JSObjectRef result = JSCreateArrayObject(context, 0, NULL);
+ int widgetId = WrtAccessSingleton::Instance().getWidgetId();
WidgetDB::Api::IWidgetDBPtr widgetDB =
- WidgetDB::Api::getWidgetDB(wrapper->getWidgetId());
+ WidgetDB::Api::getWidgetDB(widgetId);
WidgetDB::Api::Features features = widgetDB->getWidgetFeatures();
for (size_t i=0; i<features.size(); ++i) {
JSFeaturePrivateObject *priv = new JSFeaturePrivateObject(context, features[i]);