From f743552fbdb17f974c9b1675af81210fe0ffcc50 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 5 Feb 2018 22:27:22 +0000 Subject: Fold CJS_EmbedObj classes into CJS_Object classes This CL removes the CJS_EmbedObj class and various subclasses and folds the subclasses into their CJS_Object counterparts. Change-Id: If6b882a4995c0b1bf83ac783f5c27ba9216c2d5c Reviewed-on: https://pdfium-review.googlesource.com/25410 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- fxjs/cjs_event.h | 67 ++++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 36 deletions(-) (limited to 'fxjs/cjs_event.h') diff --git a/fxjs/cjs_event.h b/fxjs/cjs_event.h index fa8c40b5ee..291b6eb3cc 100644 --- a/fxjs/cjs_event.h +++ b/fxjs/cjs_event.h @@ -9,10 +9,38 @@ #include "fxjs/JS_Define.h" -class event : public CJS_EmbedObj { +class CJS_Event : public CJS_Object { public: - explicit event(CJS_Object* pJSObject); - ~event() override; + static void DefineJSObjects(CFXJS_Engine* pEngine); + + explicit CJS_Event(v8::Local pObject); + ~CJS_Event() override; + + JS_STATIC_PROP(change, change, CJS_Event); + JS_STATIC_PROP(changeEx, change_ex, CJS_Event); + JS_STATIC_PROP(commitKey, commit_key, CJS_Event); + JS_STATIC_PROP(fieldFull, field_full, CJS_Event); + JS_STATIC_PROP(keyDown, key_down, CJS_Event); + JS_STATIC_PROP(modifier, modifier, CJS_Event); + JS_STATIC_PROP(name, name, CJS_Event); + JS_STATIC_PROP(rc, rc, CJS_Event); + JS_STATIC_PROP(richChange, rich_change, CJS_Event); + JS_STATIC_PROP(richChangeEx, rich_change_ex, CJS_Event); + JS_STATIC_PROP(richValue, rich_value, CJS_Event); + JS_STATIC_PROP(selEnd, sel_end, CJS_Event); + JS_STATIC_PROP(selStart, sel_start, CJS_Event); + JS_STATIC_PROP(shift, shift, CJS_Event); + JS_STATIC_PROP(source, source, CJS_Event); + JS_STATIC_PROP(target, target, CJS_Event); + JS_STATIC_PROP(targetName, target_name, CJS_Event); + JS_STATIC_PROP(type, type, CJS_Event); + JS_STATIC_PROP(value, value, CJS_Event); + JS_STATIC_PROP(willCommit, will_commit, CJS_Event); + + private: + static int ObjDefnID; + static const char kName[]; + static const JSPropertySpec PropertySpecs[]; CJS_Return get_change(CJS_Runtime* pRuntime); CJS_Return set_change(CJS_Runtime* pRuntime, v8::Local vp); @@ -75,37 +103,4 @@ class event : public CJS_EmbedObj { CJS_Return set_will_commit(CJS_Runtime* pRuntime, v8::Local vp); }; -class CJS_Event : public CJS_Object { - public: - static void DefineJSObjects(CFXJS_Engine* pEngine); - - explicit CJS_Event(v8::Local pObject); - ~CJS_Event() override = default; - - JS_STATIC_PROP(change, change, event); - JS_STATIC_PROP(changeEx, change_ex, event); - JS_STATIC_PROP(commitKey, commit_key, event); - JS_STATIC_PROP(fieldFull, field_full, event); - JS_STATIC_PROP(keyDown, key_down, event); - JS_STATIC_PROP(modifier, modifier, event); - JS_STATIC_PROP(name, name, event); - JS_STATIC_PROP(rc, rc, event); - JS_STATIC_PROP(richChange, rich_change, event); - JS_STATIC_PROP(richChangeEx, rich_change_ex, event); - JS_STATIC_PROP(richValue, rich_value, event); - JS_STATIC_PROP(selEnd, sel_end, event); - JS_STATIC_PROP(selStart, sel_start, event); - JS_STATIC_PROP(shift, shift, event); - JS_STATIC_PROP(source, source, event); - JS_STATIC_PROP(target, target, event); - JS_STATIC_PROP(targetName, target_name, event); - JS_STATIC_PROP(type, type, event); - JS_STATIC_PROP(value, value, event); - JS_STATIC_PROP(willCommit, will_commit, event); - - private: - static int ObjDefnID; - static const JSPropertySpec PropertySpecs[]; -}; - #endif // FXJS_CJS_EVENT_H_ -- cgit v1.2.3