diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-02-05 22:27:22 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-05 22:27:22 +0000 |
commit | f743552fbdb17f974c9b1675af81210fe0ffcc50 (patch) | |
tree | d0eccefff3c758151428e18eb803e93d8864046a /fxjs/cjs_color.h | |
parent | 998fee395fc8a543968c7db3db9e3cf81dee57fc (diff) | |
download | pdfium-f743552fbdb17f974c9b1675af81210fe0ffcc50.tar.xz |
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 <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjs_color.h')
-rw-r--r-- | fxjs/cjs_color.h | 59 |
1 files changed, 26 insertions, 33 deletions
diff --git a/fxjs/cjs_color.h b/fxjs/cjs_color.h index fab035db21..667a13c21a 100644 --- a/fxjs/cjs_color.h +++ b/fxjs/cjs_color.h @@ -12,15 +12,38 @@ #include "fpdfsdk/pwl/cpwl_wnd.h" #include "fxjs/JS_Define.h" -class color : public CJS_EmbedObj { +class CJS_Color : public CJS_Object { public: + static void DefineJSObjects(CFXJS_Engine* pEngine); static v8::Local<v8::Array> ConvertPWLColorToArray(CJS_Runtime* pRuntime, const CFX_Color& color); static CFX_Color ConvertArrayToPWLColor(CJS_Runtime* pRuntime, v8::Local<v8::Array> array); - explicit color(CJS_Object* pJSObject); - ~color() override; + explicit CJS_Color(v8::Local<v8::Object> pObject); + ~CJS_Color() override; + + JS_STATIC_PROP(black, black, CJS_Color); + JS_STATIC_PROP(blue, blue, CJS_Color); + JS_STATIC_PROP(cyan, cyan, CJS_Color); + JS_STATIC_PROP(dkGray, dark_gray, CJS_Color); + JS_STATIC_PROP(gray, gray, CJS_Color); + JS_STATIC_PROP(green, green, CJS_Color); + JS_STATIC_PROP(ltGray, light_gray, CJS_Color); + JS_STATIC_PROP(magenta, magenta, CJS_Color); + JS_STATIC_PROP(red, red, CJS_Color); + JS_STATIC_PROP(transparent, transparent, CJS_Color); + JS_STATIC_PROP(white, white, CJS_Color); + JS_STATIC_PROP(yellow, yellow, CJS_Color); + + JS_STATIC_METHOD(convert, CJS_Color); + JS_STATIC_METHOD(equal, CJS_Color); + + private: + static int ObjDefnID; + static const char kName[]; + static const JSPropertySpec PropertySpecs[]; + static const JSMethodSpec MethodSpecs[]; CJS_Return get_black(CJS_Runtime* pRuntime); CJS_Return set_black(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); @@ -63,7 +86,6 @@ class color : public CJS_EmbedObj { CJS_Return equal(CJS_Runtime* pRuntime, const std::vector<v8::Local<v8::Value>>& params); - private: CJS_Return GetPropertyHelper(CJS_Runtime* pRuntime, CFX_Color* val); CJS_Return SetPropertyHelper(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp, @@ -83,33 +105,4 @@ class color : public CJS_EmbedObj { CFX_Color m_crLTGray; }; -class CJS_Color : public CJS_Object { - public: - static void DefineJSObjects(CFXJS_Engine* pEngine); - - explicit CJS_Color(v8::Local<v8::Object> pObject); - ~CJS_Color() override = default; - - JS_STATIC_PROP(black, black, color); - JS_STATIC_PROP(blue, blue, color); - JS_STATIC_PROP(cyan, cyan, color); - JS_STATIC_PROP(dkGray, dark_gray, color); - JS_STATIC_PROP(gray, gray, color); - JS_STATIC_PROP(green, green, color); - JS_STATIC_PROP(ltGray, light_gray, color); - JS_STATIC_PROP(magenta, magenta, color); - JS_STATIC_PROP(red, red, color); - JS_STATIC_PROP(transparent, transparent, color); - JS_STATIC_PROP(white, white, color); - JS_STATIC_PROP(yellow, yellow, color); - - JS_STATIC_METHOD(convert, color); - JS_STATIC_METHOD(equal, color); - - private: - static int ObjDefnID; - static const JSPropertySpec PropertySpecs[]; - static const JSMethodSpec MethodSpecs[]; -}; - #endif // FXJS_CJS_COLOR_H_ |