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 #include "fxjs/cjs_icon.h" 8 9 const JSPropertySpec CJS_Icon::PropertySpecs[] = { 10 {"name", get_name_static, set_name_static}}; 11 12 int CJS_Icon::ObjDefnID = -1; 13 14 // static 15 int CJS_Icon::GetObjDefnID() { 16 return ObjDefnID; 17 } 18 19 // static 20 void CJS_Icon::DefineJSObjects(CFXJS_Engine* pEngine) { 21 ObjDefnID = 22 pEngine->DefineObj("Icon", FXJSOBJTYPE_DYNAMIC, 23 JSConstructor<CJS_Icon, Icon>, JSDestructor<CJS_Icon>); 24 DefineProps(pEngine, ObjDefnID, PropertySpecs, FX_ArraySize(PropertySpecs)); 25 } 26 27 Icon::Icon(CJS_Object* pJSObject) 28 : CJS_EmbedObj(pJSObject), m_swIconName(L"") {} 29 30 Icon::~Icon() {} 31 32 CJS_Return Icon::get_name(CJS_Runtime* pRuntime) { 33 return CJS_Return(pRuntime->NewString(m_swIconName.c_str())); 34 } 35 36 CJS_Return Icon::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) { 37 return CJS_Return(false); 38 } 39