Sha256: fcfc82e307a7758de2539e470ca4bacaadc50e385426e0f0e6f3d943018d7ff0

Contents?: true

Size: 1.74 KB

Versions: 8

Compression:

Stored size: 1.74 KB

Contents

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

namespace rho {

using namespace apiGenerator;

class CCrosswalkImpl: public CCrosswalkBase
{
public:
    CCrosswalkImpl(const rho::String& strID): CCrosswalkBase()
    {
    }

    virtual void getPlatformName(rho::apiGenerator::CMethodResult& oResult) {
         oResult.set("Win32");
    }

    virtual void calcSumm( int a,  int b, rho::apiGenerator::CMethodResult& oResult) {
         oResult.set(a+b);
    }
    
    virtual void joinStrings( const rho::String& a,  const rho::String& b, rho::apiGenerator::CMethodResult& oResult) {
         oResult.set(a+b);
    }

};

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

class CCrosswalkFactory: public CCrosswalkFactoryBase
{
    ~CCrosswalkFactory(){}
    virtual ICrosswalkSingleton* createModuleSingleton();
    virtual ICrosswalk* createModuleByID(const rho::String& strID);
};

extern "C" void Init_Crosswalk_extension()
{
    CCrosswalkFactory::setInstance( new CCrosswalkFactory() );
    Init_Crosswalk_API();
}

ICrosswalk* CCrosswalkFactory::createModuleByID(const rho::String& strID)
{
    return new CCrosswalkImpl(strID);
}

ICrosswalkSingleton* CCrosswalkFactory::createModuleSingleton()
{
    return new CCrosswalkSingleton();
}

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

    oResult.set(arIDs);
}

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

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

}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rho-tau-extensions-7.6.0 libs/crosswalk/ext/platform/qt/src/Crosswalk_impl.cpp
rho-tau-extensions-7.4.1 libs/crosswalk/ext/platform/qt/src/Crosswalk_impl.cpp
rho-tau-extensions-7.1.17 libs/crosswalk/ext/platform/qt/src/Crosswalk_impl.cpp
rho-tau-extensions-6.2.0 libs/crosswalk/ext/platform/qt/src/Crosswalk_impl.cpp
rho-tau-extensions-6.0.11 libs/crosswalk/ext/platform/qt/src/Crosswalk_impl.cpp
rho-tau-extensions-6.0.0 libs/crosswalk/ext/platform/qt/src/Crosswalk_impl.cpp
rho-tau-extensions-5.5.18 libs/crosswalk/ext/platform/qt/src/Crosswalk_impl.cpp
rho-tau-extensions-5.5.17 libs/crosswalk/ext/platform/qt/src/Crosswalk_impl.cpp