EventObject* ProgressEventObject::Clone(EventObject*pObj) { if (NULL == pObj) { ClassClosure *pClass = toplevel()->getBuiltinExtensionClass(abcclass_flash_events_ProgressEvent); pObj = (EventObject *)pClass->createInstance(pClass->ivtable(), pClass->prototype); } register ProgressEventObject *pEvent = (ProgressEventObject *)pObj; pEvent->m_bytesLoaded = m_bytesLoaded; pEvent->m_bytesToal = m_bytesToal; return EventObject::Clone(pObj); }
EventObject* FocusEventObject::Clone(EventObject*pObj) { if (NULL == pObj) { ClassClosure *pClass = toplevel()->getBuiltinExtensionClass(abcclass_flash_events_FocusEvent); pObj = (EventObject *)pClass->createInstance(pClass->ivtable(), pClass->prototype); } register FocusEventObject *pEvent = (FocusEventObject *)pObj; pEvent->m_pRelatedObject = m_pRelatedObject; pEvent->m_shiftKey = m_shiftKey; pEvent->m_keyCode = m_keyCode; return EventObject::Clone(pObj); }
/** * Object.prototype.toString() */ Stringp ObjectClass::_toString(Atom thisAtom) { AvmCore* core = this->core(); if (core->istype(thisAtom, CLASS_TYPE)) { ClassClosure *cc = (ClassClosure *)AvmCore::atomToScriptObject(thisAtom); Traits* t = cc->ivtable()->traits; Stringp s = core->concatStrings(core->newString("[class "), t->name); return core->concatStrings(s, core->newString("]")); } else { Traits* t = toplevel()->toTraits(thisAtom); Stringp s = core->concatStrings(core->newString("[object "), t->name); return core->concatStrings(s, core->newString("]")); } }
EventObject* KeyboardEventObject::Clone(EventObject*pObj) { if (NULL == pObj) { ClassClosure *pClass = toplevel()->getBuiltinExtensionClass(abcclass_flash_events_KeyboardEvent); pObj = (EventObject *)pClass->createInstance(pClass->ivtable(), pClass->prototype); } register KeyboardEventObject *pEvent = (KeyboardEventObject *)pObj; pEvent->m_charCode = m_charCode; pEvent->m_keyCode = m_keyCode; pEvent->m_keyLocation = m_keyLocation; pEvent->m_ctrlKey = m_ctrlKey; pEvent->m_altKey = m_altKey; pEvent->m_shiftKey = m_shiftKey; return EventObject::Clone(pObj); }