diff options
Diffstat (limited to 'fxjs/cjs_event.cpp')
-rw-r--r-- | fxjs/cjs_event.cpp | 174 |
1 files changed, 87 insertions, 87 deletions
diff --git a/fxjs/cjs_event.cpp b/fxjs/cjs_event.cpp index f00f07c3b9..0895d9c009 100644 --- a/fxjs/cjs_event.cpp +++ b/fxjs/cjs_event.cpp @@ -54,14 +54,14 @@ CJS_Event::CJS_Event(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime) CJS_Event::~CJS_Event() = default; -CJS_Return CJS_Event::get_change(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_change(CJS_Runtime* pRuntime) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); - return CJS_Return::Success( + return CJS_Result::Success( pRuntime->NewString(pEvent->Change().AsStringView())); } -CJS_Return CJS_Event::set_change(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_change(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { ASSERT(pRuntime->GetCurrentEventContext()); @@ -72,129 +72,129 @@ CJS_Return CJS_Event::set_change(CJS_Runtime* pRuntime, WideString& wChange = pEvent->Change(); wChange = pRuntime->ToWideString(vp); } - return CJS_Return::Success(); + return CJS_Result::Success(); } -CJS_Return CJS_Event::get_change_ex(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_change_ex(CJS_Runtime* pRuntime) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); - return CJS_Return::Success( + return CJS_Result::Success( pRuntime->NewString(pEvent->ChangeEx().AsStringView())); } -CJS_Return CJS_Event::set_change_ex(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_change_ex(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { - return CJS_Return::Failure(JSMessage::kNotSupportedError); + return CJS_Result::Failure(JSMessage::kNotSupportedError); } -CJS_Return CJS_Event::get_commit_key(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_commit_key(CJS_Runtime* pRuntime) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); - return CJS_Return::Success(pRuntime->NewNumber(pEvent->CommitKey())); + return CJS_Result::Success(pRuntime->NewNumber(pEvent->CommitKey())); } -CJS_Return CJS_Event::set_commit_key(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_commit_key(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { - return CJS_Return::Failure(JSMessage::kNotSupportedError); + return CJS_Result::Failure(JSMessage::kNotSupportedError); } -CJS_Return CJS_Event::get_field_full(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_field_full(CJS_Runtime* pRuntime) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); if (wcscmp((const wchar_t*)pEvent->Name(), L"Keystroke") != 0) - return CJS_Return::Failure(L"unrecognized event"); + return CJS_Result::Failure(L"unrecognized event"); - return CJS_Return::Success(pRuntime->NewBoolean(pEvent->FieldFull())); + return CJS_Result::Success(pRuntime->NewBoolean(pEvent->FieldFull())); } -CJS_Return CJS_Event::set_field_full(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_field_full(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { - return CJS_Return::Failure(JSMessage::kNotSupportedError); + return CJS_Result::Failure(JSMessage::kNotSupportedError); } -CJS_Return CJS_Event::get_key_down(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_key_down(CJS_Runtime* pRuntime) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); - return CJS_Return::Success(pRuntime->NewBoolean(pEvent->KeyDown())); + return CJS_Result::Success(pRuntime->NewBoolean(pEvent->KeyDown())); } -CJS_Return CJS_Event::set_key_down(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_key_down(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { - return CJS_Return::Failure(JSMessage::kNotSupportedError); + return CJS_Result::Failure(JSMessage::kNotSupportedError); } -CJS_Return CJS_Event::get_modifier(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_modifier(CJS_Runtime* pRuntime) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); - return CJS_Return::Success(pRuntime->NewBoolean(pEvent->Modifier())); + return CJS_Result::Success(pRuntime->NewBoolean(pEvent->Modifier())); } -CJS_Return CJS_Event::set_modifier(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_modifier(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { - return CJS_Return::Failure(JSMessage::kNotSupportedError); + return CJS_Result::Failure(JSMessage::kNotSupportedError); } -CJS_Return CJS_Event::get_name(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_name(CJS_Runtime* pRuntime) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); - return CJS_Return::Success(pRuntime->NewString(pEvent->Name())); + return CJS_Result::Success(pRuntime->NewString(pEvent->Name())); } -CJS_Return CJS_Event::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { - return CJS_Return::Failure(JSMessage::kNotSupportedError); +CJS_Result CJS_Event::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { + return CJS_Result::Failure(JSMessage::kNotSupportedError); } -CJS_Return CJS_Event::get_rc(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_rc(CJS_Runtime* pRuntime) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); - return CJS_Return::Success(pRuntime->NewBoolean(pEvent->Rc())); + return CJS_Result::Success(pRuntime->NewBoolean(pEvent->Rc())); } -CJS_Return CJS_Event::set_rc(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { +CJS_Result CJS_Event::set_rc(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); pEvent->Rc() = pRuntime->ToBoolean(vp); - return CJS_Return::Success(); + return CJS_Result::Success(); } -CJS_Return CJS_Event::get_rich_change(CJS_Runtime* pRuntime) { - return CJS_Return::Success(); +CJS_Result CJS_Event::get_rich_change(CJS_Runtime* pRuntime) { + return CJS_Result::Success(); } -CJS_Return CJS_Event::set_rich_change(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_rich_change(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { - return CJS_Return::Success(); + return CJS_Result::Success(); } -CJS_Return CJS_Event::get_rich_change_ex(CJS_Runtime* pRuntime) { - return CJS_Return::Success(); +CJS_Result CJS_Event::get_rich_change_ex(CJS_Runtime* pRuntime) { + return CJS_Result::Success(); } -CJS_Return CJS_Event::set_rich_change_ex(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_rich_change_ex(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { - return CJS_Return::Success(); + return CJS_Result::Success(); } -CJS_Return CJS_Event::get_rich_value(CJS_Runtime* pRuntime) { - return CJS_Return::Success(); +CJS_Result CJS_Event::get_rich_value(CJS_Runtime* pRuntime) { + return CJS_Result::Success(); } -CJS_Return CJS_Event::set_rich_value(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_rich_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { - return CJS_Return::Success(); + return CJS_Result::Success(); } -CJS_Return CJS_Event::get_sel_end(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_sel_end(CJS_Runtime* pRuntime) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); if (wcscmp((const wchar_t*)pEvent->Name(), L"Keystroke") != 0) - return CJS_Return::Success(); + return CJS_Result::Success(); - return CJS_Return::Success(pRuntime->NewNumber(pEvent->SelEnd())); + return CJS_Result::Success(pRuntime->NewNumber(pEvent->SelEnd())); } -CJS_Return CJS_Event::set_sel_end(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_sel_end(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); @@ -202,20 +202,20 @@ CJS_Return CJS_Event::set_sel_end(CJS_Runtime* pRuntime, if (wcscmp((const wchar_t*)pEvent->Name(), L"Keystroke") == 0) pEvent->SetSelEnd(pRuntime->ToInt32(vp)); - return CJS_Return::Success(); + return CJS_Result::Success(); } -CJS_Return CJS_Event::get_sel_start(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_sel_start(CJS_Runtime* pRuntime) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); if (wcscmp((const wchar_t*)pEvent->Name(), L"Keystroke") != 0) - return CJS_Return::Success(); + return CJS_Result::Success(); - return CJS_Return::Success(pRuntime->NewNumber(pEvent->SelStart())); + return CJS_Result::Success(pRuntime->NewNumber(pEvent->SelStart())); } -CJS_Return CJS_Event::set_sel_start(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_sel_start(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); @@ -223,81 +223,81 @@ CJS_Return CJS_Event::set_sel_start(CJS_Runtime* pRuntime, if (wcscmp((const wchar_t*)pEvent->Name(), L"Keystroke") == 0) pEvent->SetSelStart(pRuntime->ToInt32(vp)); - return CJS_Return::Success(); + return CJS_Result::Success(); } -CJS_Return CJS_Event::get_shift(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_shift(CJS_Runtime* pRuntime) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); - return CJS_Return::Success(pRuntime->NewBoolean(pEvent->Shift())); + return CJS_Result::Success(pRuntime->NewBoolean(pEvent->Shift())); } -CJS_Return CJS_Event::set_shift(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_shift(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { - return CJS_Return::Failure(JSMessage::kNotSupportedError); + return CJS_Result::Failure(JSMessage::kNotSupportedError); } -CJS_Return CJS_Event::get_source(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_source(CJS_Runtime* pRuntime) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); - return CJS_Return::Success(pEvent->Source()->ToV8Object()); + return CJS_Result::Success(pEvent->Source()->ToV8Object()); } -CJS_Return CJS_Event::set_source(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_source(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { - return CJS_Return::Failure(JSMessage::kNotSupportedError); + return CJS_Result::Failure(JSMessage::kNotSupportedError); } -CJS_Return CJS_Event::get_target(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_target(CJS_Runtime* pRuntime) { ASSERT(pRuntime->GetCurrentEventContext()); CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); - return CJS_Return::Success(pEvent->Target_Field()->ToV8Object()); + return CJS_Result::Success(pEvent->Target_Field()->ToV8Object()); } -CJS_Return CJS_Event::set_target(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_target(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { - return CJS_Return::Failure(JSMessage::kNotSupportedError); + return CJS_Result::Failure(JSMessage::kNotSupportedError); } -CJS_Return CJS_Event::get_target_name(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_target_name(CJS_Runtime* pRuntime) { ASSERT(pRuntime->GetCurrentEventContext()); CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); - return CJS_Return::Success( + return CJS_Result::Success( pRuntime->NewString(pEvent->TargetName().AsStringView())); } -CJS_Return CJS_Event::set_target_name(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_target_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { - return CJS_Return::Failure(JSMessage::kNotSupportedError); + return CJS_Result::Failure(JSMessage::kNotSupportedError); } -CJS_Return CJS_Event::get_type(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_type(CJS_Runtime* pRuntime) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); - return CJS_Return::Success(pRuntime->NewString(pEvent->Type())); + return CJS_Result::Success(pRuntime->NewString(pEvent->Type())); } -CJS_Return CJS_Event::set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { - return CJS_Return::Failure(JSMessage::kNotSupportedError); +CJS_Result CJS_Event::set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { + return CJS_Result::Failure(JSMessage::kNotSupportedError); } -CJS_Return CJS_Event::get_value(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_value(CJS_Runtime* pRuntime) { CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); if (wcscmp((const wchar_t*)pEvent->Type(), L"Field") != 0) - return CJS_Return::Failure(L"Bad event type."); + return CJS_Result::Failure(L"Bad event type."); if (!pEvent->m_pValue) - return CJS_Return::Failure(JSMessage::kBadObjectError); + return CJS_Result::Failure(JSMessage::kBadObjectError); - return CJS_Return::Success( + return CJS_Result::Success( pRuntime->NewString(pEvent->Value().AsStringView())); } -CJS_Return CJS_Event::set_value(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { ASSERT(pRuntime->GetCurrentEventContext()); @@ -305,24 +305,24 @@ CJS_Return CJS_Event::set_value(CJS_Runtime* pRuntime, pRuntime->GetCurrentEventContext()->GetEventHandler(); if (wcscmp((const wchar_t*)pEvent->Type(), L"Field") != 0) - return CJS_Return::Failure(L"Bad event type."); + return CJS_Result::Failure(L"Bad event type."); if (!pEvent->m_pValue) - return CJS_Return::Failure(JSMessage::kBadObjectError); + return CJS_Result::Failure(JSMessage::kBadObjectError); pEvent->Value() = pRuntime->ToWideString(vp); - return CJS_Return::Success(); + return CJS_Result::Success(); } -CJS_Return CJS_Event::get_will_commit(CJS_Runtime* pRuntime) { +CJS_Result CJS_Event::get_will_commit(CJS_Runtime* pRuntime) { ASSERT(pRuntime->GetCurrentEventContext()); CJS_EventHandler* pEvent = pRuntime->GetCurrentEventContext()->GetEventHandler(); - return CJS_Return::Success(pRuntime->NewBoolean(pEvent->WillCommit())); + return CJS_Result::Success(pRuntime->NewBoolean(pEvent->WillCommit())); } -CJS_Return CJS_Event::set_will_commit(CJS_Runtime* pRuntime, +CJS_Result CJS_Event::set_will_commit(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { - return CJS_Return::Failure(JSMessage::kNotSupportedError); + return CJS_Result::Failure(JSMessage::kNotSupportedError); } |