Sha256: 4cf76662ce29abba09c16a8dee609039aa96d2de68e460e5de06fba8ec434181

Contents?: true

Size: 1.88 KB

Versions: 17

Compression:

Stored size: 1.88 KB

Contents

#include "../../../shared/generated/cpp/JavascriptVMBase.h"

namespace rho {

using namespace apiGenerator;

class CJavascriptVMImpl: public CJavascriptVMBase
{
public:
    CJavascriptVMImpl(const rho::String& strID): CJavascriptVMBase()
    {
        m_hashProps.put( "display", "LCD");
        m_hashProps.put( "sound", "Dolby");
    }

    virtual void enable( const rho::Hashtable<rho::String, rho::String>& propertyMap, CMethodResult& oResult){}
    virtual void start(CMethodResult& oResult){}
    virtual void stop(CMethodResult& oResult){}
    virtual void disable(CMethodResult& oResult){}
    virtual void take( const rho::Hashtable<rho::String, rho::String>& propertyMap, CMethodResult& oResult){}

};

class CJavascriptVMSingleton: public CJavascriptVMSingletonBase
{
    ~CJavascriptVMSingleton(){}
    virtual rho::String getInitialDefaultID();
    virtual void enumerate(CMethodResult& oResult);
};

class CJavascriptVMFactory: public CJavascriptVMFactoryBase
{
    ~CJavascriptVMFactory(){}
    virtual IJavascriptVMSingleton* createModuleSingleton();
    virtual IJavascriptVM* createModuleByID(const rho::String& strID);
};

extern "C" void Init_JavascriptVM_extension()
{
    CJavascriptVMFactory::setInstance( new CJavascriptVMFactory() );
    Init_JavascriptVM_API();
}

IJavascriptVM* CJavascriptVMFactory::createModuleByID(const rho::String& strID)
{
    return new CJavascriptVMImpl(strID);
}

IJavascriptVMSingleton* CJavascriptVMFactory::createModuleSingleton()
{
    return new CJavascriptVMSingleton();
}

void CJavascriptVMSingleton::enumerate(CMethodResult& oResult)
{
    rho::Vector<rho::String> arIDs;
    arIDs.addElement("SC1");
    arIDs.addElement("SC2");

    oResult.set(arIDs);
}

rho::String CJavascriptVMSingleton::getInitialDefaultID()
{
    CMethodResult oRes;
    enumerate(oRes);

    rho::Vector<rho::String>& arIDs = oRes.getStringArray();
        
    return arIDs[0];
}

}

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
rhodes-7.6.0 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
rhodes-7.5.1 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
rhodes-7.4.1 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
rhodes-7.1.17 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
rhodes-6.2.0 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
rhodes-6.0.11 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
rhodes-5.5.18 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
rhodes-5.5.17 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
rhodes-5.5.15 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
rhodes-5.5.0.22 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
rhodes-5.5.2 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
rhodes-5.5.0.7 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
rhodes-5.5.0.3 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
rhodes-5.5.0 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
tauplatform-1.0.3 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
tauplatform-1.0.2 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp
tauplatform-1.0.1 lib/commonAPI/javascriptvm/ext/platform/wp8/src/Javascriptvm_impl.cpp