コード例 #1
0
ファイル: ProxyGlue.cpp プロジェクト: bsdf/trx
    Atom ProxyObject::getDescendants(const Multiname*  name) const
    {
        GCRef<Toplevel> toplevel = this->toplevel();
        GCRef<builtinClassManifest> builtinClasses = toplevel->builtinClasses();
        GCRef<QNameObject> q = QNameObject::create(core()->GetGC(), builtinClasses->get_QNameClass(), *name);
        Atom argv[] = { atom(), q->atom() };
        int const argc = 1;

        Binding b = builtinClasses->get_ProxyClass()->m_getDescendants;

        GCRef<MethodEnv> method = vtable->methods[AvmCore::bindingToMethodId(b)];
        return method->coerceEnter(argc, argv);
    }
コード例 #2
0
ファイル: ProxyGlue.cpp プロジェクト: bsdf/trx
    void ProxyObject::setMultinameProperty(const Multiname*  name, Atom value)
    {
        GCRef<Toplevel> toplevel = this->toplevel();
        GCRef<builtinClassManifest> builtinClasses = toplevel->builtinClasses();
        GCRef<QNameObject> q = QNameObject::create(core()->GetGC(), builtinClasses->get_QNameClass(), *name);
        Atom argv[] = { atom(), q->atom(), value };
        int const argc = 2;
        
        Binding b = builtinClasses->get_ProxyClass()->m_setProperty;

        GCRef<MethodEnv> method = vtable->methods[AvmCore::bindingToMethodId(b)];
        method->coerceEnter(argc, argv);
    }
コード例 #3
0
ファイル: ProxyGlue.cpp プロジェクト: bsdf/trx
    bool ProxyObject::deleteMultinameProperty(const Multiname*  name)
    {
        GCRef<Toplevel> toplevel = this->toplevel();
        GCRef<builtinClassManifest> builtinClasses = toplevel->builtinClasses();
        GCRef<QNameObject> q = QNameObject::create(core()->GetGC(), builtinClasses->get_QNameClass(), *name);
        Atom argv[] = { atom(), q->atom() };
        int const argc = 1;
        
        Binding b = builtinClasses->get_ProxyClass()->m_deleteProperty;

        GCRef<MethodEnv> method = vtable->methods[AvmCore::bindingToMethodId(b)];
        return method->coerceEnter(argc, argv) != falseAtom;
    }
コード例 #4
0
Atom ProxyObject::callProperty(const Multiname*  name, int argc, Atom* argv)
{
    GCRef<Toplevel> toplevel = this->toplevel();
    GCRef<builtinClassManifest> builtinClasses = toplevel->builtinClasses();
    int proxy_argc = argc+1;
    MMgc::GC::AllocaAutoPtr proxy_argv_autoptr;
    Atom* proxy_argv = (Atom*) avmStackAllocArray(core(), proxy_argv_autoptr, proxy_argc+1, sizeof(Atom));

    GCRef<QNameObject> q = QNameObject::create(core()->GetGC(), builtinClasses->get_QNameClass(), *name);

    proxy_argv[0] = atom();
    proxy_argv[1] = q->atom();
    for (int i = 1; i <= argc; i++)
    {
        proxy_argv[i+1] = argv[i];
    }
    Binding b = builtinClasses->get_ProxyClass()->m_callProperty;

    GCRef<MethodEnv> method = vtable->methods[AvmCore::bindingToMethodId(b)];
    return method->coerceEnter(proxy_argc, proxy_argv);
}