From: Kevron Rees Date: Tue, 23 Jul 2013 21:18:53 +0000 (-0700) Subject: removed unneeded files X-Git-Tag: submit/tizen/20130729.222823~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cde6018dad64fbdf3b4796f6107fc096661a0148;p=profile%2Fivi%2Fwrt-plugins-ivi.git removed unneeded files --- diff --git a/EventVehiclePropertyChanged.h b/EventVehiclePropertyChanged.h deleted file mode 100644 index ea26a0c..0000000 --- a/EventVehiclePropertyChanged.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef TIZENAPIS_API_VEHICLE_EVENT_PROPERTY_CHANGED_H_ -#define TIZENAPIS_API_VEHICLE_EVENT_PROPERTY_CHANGED_H_ - -#include -#include - -namespace DeviceAPI { -namespace Vehicle { - -class EventVehiclePropertyChanged : public WrtDeviceApis::Commons::IEvent -{ -private: - /* parameter */ - std::string m_contextId; - -public: - void setContextId(std::string contextId) - { - m_contextId = contextId; - } - - std::string getContextId() const - { - return m_contextId; - } - - EventVehiclePropertyChanged() - { - } -}; - -typedef DPL::SharedPtr EventVehiclePropertyChangedPtr; - -} // Application -} // DeviceAPI - -#endif \ No newline at end of file diff --git a/JSVehicle.cpp b/JSVehicle.cpp deleted file mode 100644 index 40bf34d..0000000 --- a/JSVehicle.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include "JSVehicle.h" -#include "Vehicle.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace DeviceAPI { -namespace Vehicle { - -using namespace DPL; -using namespace DeviceAPI::Common; -using namespace WrtDeviceApis::Commons; -using namespace WrtDeviceApis::CommonsJavaScript; - -JSClassDefinition JSVehicle::m_classInfo = { - 0, - kJSClassAttributeNone, - "Vehicle", - 0, - NULL, - m_function, - initialize, - finalize, - NULL, //HasProperty, - NULL, //GetProperty, - NULL, //SetProperty, - NULL, //DeleteProperty, - NULL, //GetPropertyNames, - NULL, //CallAsFunction, - NULL, //CallAsConstructor, - hasInstance, - NULL, //ConvertToType -}; - -JSStaticFunction JSVehicle::m_function[] = { - { "get", JSVehicle::get, kJSPropertyAttributeNone }, - { 0, 0, 0 } -}; - -const JSClassRef JSVehicle::getClassRef() -{ - if (!m_jsClassRef) - { - m_jsClassRef = JSClassCreate(&m_classInfo); - } - return m_jsClassRef; -} - -const JSClassDefinition* JSVehicle::getClassInfo() -{ - return &m_classInfo; -} - -JSClassRef JSVehicle::m_jsClassRef = JSClassCreate(JSVehicle::getClassInfo()); - -void JSVehicle::initialize(JSContextRef context, JSObjectRef object) -{ - VehiclePrivObject* priv = static_cast(JSObjectGetPrivate(object)); - if (!priv) - { - VehiclePtr vehicle(new VehicleMaster()); - priv = new VehiclePrivObject( context, vehicle); - if(!JSObjectSetPrivate(object, static_cast(priv))) - { - LoggerE("Object can't store private data."); - delete priv; - } - } - - LoggerD("JSVehicle::initialize "); -} - -void JSVehicle::finalize(JSObjectRef object) -{ - VehiclePrivObject* priv = static_cast(JSObjectGetPrivate(object)); - JSObjectSetPrivate(object, NULL); - LoggerD("Deleting timeutil"); - delete priv; -} - -bool JSVehicle::hasInstance(JSContextRef context, - JSObjectRef constructor, - JSValueRef possibleInstance, - JSValueRef* exception) -{ - return JSValueIsObjectOfClass(context, possibleInstance, getClassRef()); -} - - -JSValueRef JSVehicle::get(JSContextRef context, - JSObjectRef object, - JSObjectRef thisObject, - size_t argumentCount, - const JSValueRef arguments[], - JSValueRef* exception) -{ - LoggerD("Entered "); - //Try { - VehiclePrivObject* privateObject = static_cast(JSObjectGetPrivate(thisObject)); - if (NULL == privateObject) - { - LoggerE("private object is null"); - //return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch"); - } - - ArgumentValidator validator(context, argumentCount, arguments); - std::string property = validator.toString(0); - - VehiclePtr vehicle(privateObject->getObject()); - - std::list properties = vehicle->get(property); - - std::stringstream json; - - - json<<"{"; - - for(auto itr = properties.begin(); itr != properties.end(); itr++) - { - if(json.str() != "{") json<<","; - - AbstractPropertyType* p = *itr; - - json<<"\""<name<<"\" : "<toString(); - - } - - json << "}"; - - Converter converter(context); - - return converter.toJSValueRef(json.str()); - - - /*} Catch (PlatformException) { - LoggerE("Exception: " << _rethrown_exception.GetMessage()); - } Catch(NullPointerException) { - LoggerE("Exception: " << _rethrown_exception.GetMessage()); - return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch"); - } Catch (WrtDeviceApis::Commons::Exception) { - LoggerE("Exception: " << _rethrown_exception.GetMessage()); - }*/ - - //return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error"); -} -} -} diff --git a/JSVehicle.h b/JSVehicle.h deleted file mode 100644 index b2c6127..0000000 --- a/JSVehicle.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef JSVEHICLE_H -#define JSVEHICLE_H - -#include "Vehicle.h" -#include -#include -#include -#include - -namespace DeviceAPI { -namespace Vehicle { - -typedef WrtDeviceApis::CommonsJavaScript::PrivateObject VehiclePrivObject; - -class JSVehicle -{ -public: - static const JSClassDefinition* getClassInfo(); - - static const JSClassRef getClassRef(); - -private: - /** - * The callback invoked when an object is first created. - */ - static void initialize(JSContextRef context, - JSObjectRef object); - - /** - * The callback invoked when an object is finalized. - */ - static void finalize(JSObjectRef object); - - /** - * The callback invoked when an object is used as the target of an 'instanceof' expression. - */ - static bool hasInstance(JSContextRef ctx, - JSObjectRef constructor, - JSValueRef possibleInstance, - JSValueRef* exception); - - static JSValueRef get(JSContextRef context, - JSObjectRef object, - JSObjectRef thisObject, - size_t argumentCount, - const JSValueRef arguments[], - JSValueRef* exception); - - /** - * This structure contains properties and callbacks that define a type of object. - */ - static JSClassDefinition m_classInfo; - - /** - * This structure describes a statically declared function. - */ - static JSStaticFunction m_function[]; - - static JSClassRef m_jsClassRef; -}; - -} -} - -#endif // JSVEHICLE_H diff --git a/Vehicle.cpp b/Vehicle.cpp deleted file mode 100644 index b154bd9..0000000 --- a/Vehicle.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#include "Vehicle.h" -#include -#include -#include - -#include - -#include -#include - - -namespace DeviceAPI -{ -namespace Vehicle -{ - -using namespace WrtDeviceApis::Commons; - -VehicleMaster::VehicleMaster() -:EventRequestReceiver(ThreadEnum::APPLICATION_THREAD) -{ -} - - - -std::list VehicleMaster::get(std::string property) -{ - GError* error = NULL; - GDBusProxy* managerProxy = g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, NULL, - "org.automotive.message.broker", - "/", - "org.automotive.Manager", - NULL, - &error); - - if(error) - { - throw std::runtime_error("could not get automotive message broker Manager interface"); - } - - - GVariant* objectPath = g_dbus_proxy_call_sync(managerProxy, "findProperty", g_variant_new("(s)", property.c_str()), G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error); - - const char* objP = g_variant_get_string(objectPath, NULL); - - if(std::string(objP) == "") - { - throw std::runtime_error("could not find property "+ property); - } - - GDBusProxy* propertiesProxy = g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, NULL, - "org.automotive.message.broker", - objP, - "org.freedesktop.DBus.Properties", - NULL, - &error); - std::string interfaceName = "org.automotive." + property; - - GVariant* propertyMap = g_dbus_proxy_call_sync(propertiesProxy, "GetAll", g_variant_new("(s)", interfaceName.c_str()), G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error); - - if(error) - { - throw std::runtime_error("failed to call GetAll on interface " + interfaceName); - } - - GVariantIter* iter; - char* key; - GVariant *value; - - std::list returnValue; - - g_variant_get(propertyMap,"(a{sv})",&iter); - - while(g_variant_iter_next(iter,"{sv}", &key, &value)) - { - AbstractPropertyType* val = VehicleProperty::getPropertyTypeForPropertyNameValue(key); - val->fromVariant(value); - returnValue.push_back(val); - } - - return returnValue; -} - -void VehicleMaster::addEventListener(std::string property, EventVehiclePropertyChangedPtr& event) -{ - -} - -} -} \ No newline at end of file diff --git a/Vehicle.h b/Vehicle.h deleted file mode 100644 index 5c9376e..0000000 --- a/Vehicle.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef VEHICLE_H -#define VEHICLE_H - -#include -#include -#include -#include - -#include "EventVehiclePropertyChanged.h" - -class AbstractPropertyType; - -namespace DeviceAPI { -namespace Vehicle { - -class VehicleMaster: public WrtDeviceApis::Commons::EventRequestReceiver -{ -public: - - VehicleMaster(); - - std::list get(std::string property); - - void addEventListener(std::string property, EventVehiclePropertyChangedPtr& event); - - - void OnRequestReceived(const EventVehiclePropertyChangedPtr &event) - { - } -}; - -typedef DPL::SharedPtr VehiclePtr; - - -} -} -#endif // VEHICLE_H diff --git a/plugin_config.cpp b/plugin_config.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/plugin_initializer.cpp b/plugin_initializer.cpp deleted file mode 100644 index 923bc9d..0000000 --- a/plugin_initializer.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// -// Tizen Web Device API -// Copyright (c) 2012 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#include -#include -#include "JSVehicle.h" -#include - -namespace DeviceAPI { -namespace Vehicle { - -using namespace WrtDeviceApis; -using namespace WrtDeviceApis::Commons; - -class_definition_options_t ConstructorClassOptions = -{ - JS_INTERFACE, - CREATE_INSTANCE, - NONE_NOTICE, - USE_OVERLAYED, //ignored - NULL, - NULL, - NULL -}; - -void on_widget_start_callback(int widgetId) { - LoggerD("[TIZEN\\Vehicle] on_widget_start_callback ("<