本文整理汇总了C++中as_object类的典型用法代码示例。如果您正苦于以下问题:C++ as_object类的具体用法?C++ as_object怎么用?C++ as_object使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了as_object类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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));
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:7,代码来源:Number_as.cpp
示例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));
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:9,代码来源:dejagnu.cpp
示例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);
}
开发者ID:diocles,项目名称:gnash,代码行数:9,代码来源:FileReferenceList_as.cpp
示例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);
}
开发者ID:adamh,项目名称:gnash-fork,代码行数:12,代码来源:LoadableObject.cpp
示例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));
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:7,代码来源:dbus_ext.cpp
示例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);
}
开发者ID:jlopez,项目名称:gnash,代码行数:30,代码来源:Object.cpp
示例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);
}
开发者ID:diocles,项目名称:gnash,代码行数:33,代码来源:BitmapFilter_as.cpp
示例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);
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:7,代码来源:filters_pkg.cpp
示例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);
}
开发者ID:diocles,项目名称:gnash,代码行数:7,代码来源:BitmapFilter_as.cpp
示例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);
}
开发者ID:jlopez,项目名称:gnash,代码行数:8,代码来源:Point_as.cpp
示例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);
}
开发者ID:adamh,项目名称:gnash-fork,代码行数:17,代码来源:FileReference_as.cpp
示例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);
}
开发者ID:BrandRegard,项目名称:gnash,代码行数:10,代码来源:dbus_ext.cpp
示例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);
}
开发者ID:jlopez,项目名称:gnash,代码行数:12,代码来源:Video_as.cpp
示例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);
}
开发者ID:sunarto,项目名称:gnash,代码行数:13,代码来源:Video_as.cpp
示例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);
}
开发者ID:adamh,项目名称:gnash-fork,代码行数:21,代码来源:AsBroadcaster.cpp
示例16: displayobject_class_init
// 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
示例17: sound_class_init
// 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
示例18: textfield_class_init
/// This provides the prototype and static methods for TextField.
//
/// For SWF5 there is initially no prototype, for SWF6+ there is a
/// limited prototype. This is changed later on instantiation of a
/// TextField.
void
textfield_class_init(as_object& where, const ObjectURI& uri)
{
Global_as& gl = getGlobal(where);
as_object* proto = createObject(gl);
as_object* cl = gl.createClass(&textfield_ctor, proto);
attachTextFieldInterface(*proto);
attachTextFieldStaticMembers(*cl);
where.init_member(uri, cl, as_object::DefaultFlags);
// ASSetPropFlags is called on the TextField class.
as_object* null = nullptr;
callMethod(&gl, NSV::PROP_AS_SET_PROP_FLAGS, cl, null, 131);
}
开发者ID:aopui,项目名称:gnash,代码行数:22,代码来源:TextField_as.cpp
示例19: boolean_class_init
// extern (used by Global.cpp)
void
boolean_class_init(as_object& where, const ObjectURI& uri)
{
VM& vm = getVM(where);
Global_as& gl = getGlobal(where);
as_object* proto = gl.createObject();
as_object* cl = vm.getNative(107, 2);
cl->init_member(NSV::PROP_PROTOTYPE, proto);
proto->init_member(NSV::PROP_CONSTRUCTOR, cl);
attachBooleanInterface(*proto);
// Register _global.Boolean
where.init_member(uri, cl, as_object::DefaultFlags);
}
开发者ID:adamh,项目名称:gnash-fork,代码行数:18,代码来源:Boolean_as.cpp
示例20: launcher_class_init
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类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论