本文整理汇总了C++中as_object类的典型用法代码示例。如果您正苦于以下问题:C++ as_object类的具体用法?C++ as_object怎么用?C++ as_object使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了as_object类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: attachNumberInterface
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));
}
示例2: attachInterface
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));
}
示例3: attachFileReferenceListInterface
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);
}
示例4: attachLoadableInterface
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);
}
示例5: attachInterface
static void
attachInterface(as_object& obj)
{
GNASH_REPORT_FUNCTION;
Global_as& gl = getGlobal(obj);
obj.init_member("setSocketName", gl.createFunction(dbus_ext_setsockname));
}
示例6: initObjectClass
// 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);
}
示例7: registerBitmapClass
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);
}
示例8: flash_filters_package_init
void
flash_filters_package_init(as_object& where, const ObjectURI& uri)
{
// TODO: this may not be correct, but it should be enumerable.
const int flags = 0;
where.init_destructive_property(uri, get_flash_filters_package, flags);
}
示例9: bitmapfilter_class_init
void
bitmapfilter_class_init(as_object& where, const ObjectURI& uri)
{
// TODO: this may not be correct, but it should be enumerable.
const int flags = 0;
where.init_destructive_property(uri, getBitmapFilterConstructor, flags);
}
示例10: point_class_init
void
point_class_init(as_object& where, const ObjectURI& uri)
{
// TODO: this may not be correct, but it should be enumerable.
const int flags = 0;
where.init_destructive_property(uri, get_flash_geom_point_constructor,
flags);
}
示例11: attachFileReferenceInterface
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);
}
示例12: dbus_class_init
void
dbus_class_init(as_object &obj)
{
Global_as& gl = getGlobal(obj);
as_object* proto = createObject(gl);
attachInterface(*proto);
as_object* cl = gl.createClass(&dbus_ctor, proto);
obj.init_member("Dbus", cl);
}
示例13: video_class_init
// 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);
}
示例14: video_class_init
// 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);
}
示例15: attachAsBroadcasterStaticInterface
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);
}