当前位置: 首页>>代码示例>>C++>>正文


C++ as_object::init_member方法代码示例

本文整理汇总了C++中as_object::init_member方法的典型用法代码示例。如果您正苦于以下问题:C++ as_object::init_member方法的具体用法?C++ as_object::init_member怎么用?C++ as_object::init_member使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在as_object的用法示例。


在下文中一共展示了as_object::init_member方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getVM

void
attachNumberInterface(as_object& o)
{
    VM& vm = getVM(o);
    o.init_member("valueOf", vm.getNative(106, 0));
    o.init_member("toString", vm.getNative(106, 1));
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:7,代码来源:Number_as.cpp

示例2: getGlobal

static void
attachInterface(as_object& obj)
{
    Global_as& gl = getGlobal(obj);
    
    obj.init_member("pass", gl.createFunction(dejagnu_pass));
    obj.init_member("fail", gl.createFunction(dejagnu_fail));
    obj.init_member("totals", gl.createFunction(dejagnu_totals));
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:9,代码来源:dejagnu.cpp

示例3: getGlobal

static void
attachFileReferenceListInterface(as_object& o)
{
    Global_as& gl = getGlobal(o);
    o.init_member("addListener", gl.createFunction(filereferencelist_addListener));
    o.init_member("browse", gl.createFunction(filereferencelist_browse));
    o.init_member("removeListener", gl.createFunction(filereferencelist_removeListener));
    o.init_property("fileList", filereferencelist_fileList_getset, filereferencelist_fileList_getset);
}
开发者ID:diocles,项目名称:gnash,代码行数:9,代码来源:FileReferenceList_as.cpp

示例4: getGlobal

void
attachLoadableInterface(as_object& o, int flags)
{
    Global_as& gl = getGlobal(o);

	o.init_member("addRequestHeader", gl.createFunction(
	            loadableobject_addRequestHeader), flags);
	o.init_member("getBytesLoaded", gl.createFunction(
	            loadableobject_getBytesLoaded),flags);
	o.init_member("getBytesTotal", gl.createFunction(
                loadableobject_getBytesTotal), flags);
}
开发者ID:adamh,项目名称:gnash-fork,代码行数:12,代码来源:LoadableObject.cpp

示例5: getGlobal

static void
attachInterface(as_object& obj)
{
    GNASH_REPORT_FUNCTION;
    Global_as& gl = getGlobal(obj);
    obj.init_member("setSocketName", gl.createFunction(dbus_ext_setsockname));
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:7,代码来源:dbus_ext.cpp

示例6: assert

// extern (used by Global.cpp)
void
initObjectClass(as_object* proto, as_object& where, const ObjectURI& uri)
{

    assert(proto);

    // Object is a native constructor.
    VM& vm = getVM(where);
    as_object* cl = vm.getNative(101, 9);
    cl->init_member(NSV::PROP_PROTOTYPE, proto);
    proto->init_member(NSV::PROP_CONSTRUCTOR, cl);

    attachObjectInterface(*proto);

    // The as_function ctor takes care of initializing these, but they
    // are different for the Object class.
    const int readOnly = PropFlags::readOnly;
    cl->set_member_flags(NSV::PROP_uuPROTOuu, readOnly);
    cl->set_member_flags(NSV::PROP_CONSTRUCTOR, readOnly);
    cl->set_member_flags(NSV::PROP_PROTOTYPE, readOnly);

    const int readOnlyFlags = as_object::DefaultFlags | PropFlags::readOnly;
    cl->init_member("registerClass", vm.getNative(101, 8), readOnlyFlags);
             
    // Register _global.Object (should only be visible in SWF5 up)
    int flags = PropFlags::dontEnum; 
    where.init_member(uri, cl, flags);

}
开发者ID:jlopez,项目名称:gnash,代码行数:30,代码来源:Object.cpp

示例7: getGlobal

void
registerBitmapClass(as_object& where, Global_as::ASFunction ctor,
        Global_as::Properties p, const ObjectURI& uri)
{
    Global_as& gl = getGlobal(where);

    VM& vm = getVM(where);

    // We should be looking for flash.filters.BitmapFilter, but as this
    // triggers a lookup of the flash.filters package while we are creating
    // it, so entering infinite recursion, we'll cheat and assume that
    // the object 'where' is the filters package.
    as_function* constructor =
        getMember(where, getURI(vm, "BitmapFilter")).to_function();
    
    as_object* proto;
    if (constructor) {
        fn_call::Args args;
        VM& vm = getVM(where);
        proto = constructInstance(*constructor, as_environment(vm), args);
    }
    else proto = 0;

    as_object* cl = gl.createClass(ctor, createObject(gl));
    if (proto) p(*proto);

    // The startup script overwrites the prototype assigned by ASconstructor,
    // so the new prototype doesn't have a constructor property. We do the
    // same here.
    cl->set_member(NSV::PROP_PROTOTYPE, proto);
    where.init_member(uri , cl, as_object::DefaultFlags);

}
开发者ID:diocles,项目名称:gnash,代码行数:33,代码来源:BitmapFilter_as.cpp

示例8: getGlobal

static void
attachFileReferenceInterface(as_object& o)
{
    Global_as& gl = getGlobal(o);
    o.init_member("addListener", gl.createFunction(filereference_addListener));
    o.init_member("browse", gl.createFunction(filereference_browse));
    o.init_member("cancel", gl.createFunction(filereference_cancel));
    o.init_member("download", gl.createFunction(filereference_download));
    o.init_member("removeListener", gl.createFunction(filereference_removeListener));
    o.init_member("upload", gl.createFunction(filereference_upload));
    o.init_property("creationDate", filereference_creationDate, filereference_creationDate);
    o.init_property("creator", filereference_creator, filereference_creator);
    o.init_property("modificationDate", filereference_modificationDate, filereference_modificationDate);
    o.init_property("name", filereference_name, filereference_name);
    o.init_property("size", filereference_size, filereference_size);
    o.init_property("type", filereference_type, filereference_type);
}
开发者ID:adamh,项目名称:gnash-fork,代码行数:17,代码来源:FileReference_as.cpp

示例9: getGlobal

// extern (used by Global.cpp)
void
video_class_init(as_object& global, const ObjectURI& uri)
{
    Global_as& gl = getGlobal(global);
    as_object* proto = createObject(gl);
    as_object* cl = gl.createClass(emptyFunction, proto);
    attachVideoInterface(*proto);

    // Register _global.Video
    global.init_member(uri, cl, as_object::DefaultFlags);
}
开发者ID:jlopez,项目名称:gnash,代码行数:12,代码来源:Video_as.cpp

示例10:

void
attachNumberStaticInterface(as_object& o)
{
    // constant flags
    const int cflags = as_object::DefaultFlags | PropFlags::readOnly;

    // Set __proto__ and constructor to constant.
    as_value null; null.set_null();
    o.setPropFlags(null, 0, cflags);

    // Not quite the same as numeric_limits<double>::max()
    o.init_member("MAX_VALUE", 1.79769313486231e+308, cflags);
    // This is generally numeric_limits<double>::denorm_min().
    o.init_member("MIN_VALUE", 4.94065645841247e-324, cflags);
    o.init_member("NaN", as_value(NaN), cflags);
    o.init_member("POSITIVE_INFINITY",
            as_value(std::numeric_limits<double>::infinity()), cflags);
    o.init_member("NEGATIVE_INFINITY",
            as_value(-std::numeric_limits<double>::infinity()), cflags);
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:20,代码来源:Number_as.cpp

示例11: getGlobal

// extern (used by Global.cpp)
void
video_class_init(as_object& global, const ObjectURI& uri)
{
	// This is going to be the global Video "class"/"function"
    Global_as& gl = getGlobal(global);
    as_object* proto = createObject(gl);
    as_object* cl = gl.createClass(&video_ctor, proto);
    attachVideoInterface(*proto);

	// Register _global.Video
	global.init_member(uri, cl, as_object::DefaultFlags);
}
开发者ID:sunarto,项目名称:gnash,代码行数:13,代码来源:Video_as.cpp

示例12: getGlobal

void
attachAsBroadcasterStaticInterface(as_object& o)
{
    const int flags = PropFlags::dontEnum |
                      PropFlags::dontDelete |
                      PropFlags::onlySWF6Up;

    Global_as& gl = getGlobal(o);

    o.init_member("initialize",
            gl.createFunction(asbroadcaster_initialize), flags);
    o.init_member(NSV::PROP_ADD_LISTENER,
            gl.createFunction(asbroadcaster_addListener), flags);
    o.init_member(NSV::PROP_REMOVE_LISTENER,
            gl.createFunction(asbroadcaster_removeListener), flags);

    VM& vm = getVM(o);
    o.init_member(NSV::PROP_BROADCAST_MESSAGE, vm.getNative(101, 12),
            flags);

}
开发者ID:adamh,项目名称:gnash-fork,代码行数:21,代码来源:AsBroadcaster.cpp

示例13: getGlobal

// extern (used by Global.cpp)
void
displayobject_class_init(as_object& where, const ObjectURI& uri)
{
    Global_as& gl = getGlobal(where);
    as_object* proto = gl.createObject();
    attachDisplayObjectInterface(*proto);
    as_object* cl = gl.createClass(&displayobject_ctor, proto);
    attachDisplayObjectStaticInterface(*cl);

    // Register _global.DisplayObject
    where.init_member(uri, cl, as_object::DefaultFlags);
}
开发者ID:adamh,项目名称:gnash-fork,代码行数:13,代码来源:DisplayObject_as.cpp

示例14: getGlobal

// extern (used by Global.cpp)
void
sound_class_init(as_object& where, const ObjectURI& uri)
{

    Global_as& gl = getGlobal(where);
    as_object* proto = createObject(gl);
    as_object* cl = gl.createClass(&sound_new, proto);
    attachSoundInterface(*proto);
    proto->set_member_flags(NSV::PROP_CONSTRUCTOR, PropFlags::readOnly);
    proto->set_member_flags(NSV::PROP_uuPROTOuu, PropFlags::readOnly, 0);

    where.init_member(uri, cl, as_object::DefaultFlags);
}
开发者ID:ascendancy721,项目名称:gnash,代码行数:14,代码来源:Sound_as.cpp

示例15: getGlobal

    void
    launcher_class_init(as_object &obj)
    {
//	GNASH_REPORT_FUNCTION;
	// This is going to be the global "class"/"function"
	static boost::intrusive_ptr<builtin_function> cl;
	if (cl == NULL) {
        Global_as* gl = getGlobal(global);
        as_object* proto = getInterface();
        cl = gl->createClass(&launcher_ctor, proto);
// 	    // replicate all interface to class, to be able to access
// 	    // all methods as static functions
 	    attachInterface(cl.get());
	}
	
	obj.init_member("Launcher", cl.get());
    }
开发者ID:adamh,项目名称:gnash-fork,代码行数:17,代码来源:launcher_ext.cpp


注:本文中的as_object::init_member方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。