1 // Copyright 2014 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef _COLOR_H_ 8 #define _COLOR_H_ 9 10 class color : public CJS_EmbedObj 11 { 12 public: 13 color(CJS_Object* pJSObject); 14 virtual ~color(void); 15 16 FX_BOOL black(OBJ_PROP_PARAMS); 17 FX_BOOL blue(OBJ_PROP_PARAMS); 18 FX_BOOL cyan(OBJ_PROP_PARAMS); 19 FX_BOOL dkGray(OBJ_PROP_PARAMS); 20 FX_BOOL gray(OBJ_PROP_PARAMS); 21 FX_BOOL green(OBJ_PROP_PARAMS); 22 FX_BOOL ltGray(OBJ_PROP_PARAMS); 23 FX_BOOL magenta(OBJ_PROP_PARAMS); 24 FX_BOOL red(OBJ_PROP_PARAMS); 25 FX_BOOL transparent(OBJ_PROP_PARAMS); 26 FX_BOOL white(OBJ_PROP_PARAMS); 27 FX_BOOL yellow(OBJ_PROP_PARAMS); 28 29 FX_BOOL convert(OBJ_METHOD_PARAMS); 30 FX_BOOL equal(OBJ_METHOD_PARAMS); 31 32 public: 33 static void ConvertPWLColorToArray(const CPWL_Color& color, CJS_Array& array); 34 static void ConvertArrayToPWLColor(CJS_Array& array, CPWL_Color& color); 35 36 private: 37 CPWL_Color m_crTransparent; 38 CPWL_Color m_crBlack; 39 CPWL_Color m_crWhite; 40 CPWL_Color m_crRed; 41 CPWL_Color m_crGreen; 42 CPWL_Color m_crBlue; 43 CPWL_Color m_crCyan; 44 CPWL_Color m_crMagenta; 45 CPWL_Color m_crYellow; 46 CPWL_Color m_crDKGray; 47 CPWL_Color m_crGray; 48 CPWL_Color m_crLTGray; 49 }; 50 51 class CJS_Color : public CJS_Object 52 { 53 public: CJS_Color(JSFXObject pObject)54 CJS_Color(JSFXObject pObject) : CJS_Object(pObject) {}; ~CJS_Color(void)55 virtual ~CJS_Color(void){}; 56 57 DECLARE_JS_CLASS(CJS_Color); 58 59 JS_STATIC_PROP(black, color); 60 JS_STATIC_PROP(blue, color); 61 JS_STATIC_PROP(cyan, color); 62 JS_STATIC_PROP(dkGray, color); 63 JS_STATIC_PROP(gray, color); 64 JS_STATIC_PROP(green, color); 65 JS_STATIC_PROP(ltGray, color); 66 JS_STATIC_PROP(magenta, color); 67 JS_STATIC_PROP(red, color); 68 JS_STATIC_PROP(transparent, color); 69 JS_STATIC_PROP(white, color); 70 JS_STATIC_PROP(yellow, color); 71 72 JS_STATIC_METHOD(convert,color); 73 JS_STATIC_METHOD(equal,color); 74 75 }; 76 77 #endif //_COLOR_H_ 78 79