blob: 2b56f70cdcc97159bd2e2f921f9cc905e6e7a4a2 [file] [log] [blame]
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -07001// 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
9const JSPropertySpec CJS_Icon::PropertySpecs[] = {
10 {"name", get_name_static, set_name_static}};
11
12int CJS_Icon::ObjDefnID = -1;
13
14// static
15int CJS_Icon::GetObjDefnID() {
16 return ObjDefnID;
17}
18
19// static
20void 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
27Icon::Icon(CJS_Object* pJSObject)
28 : CJS_EmbedObj(pJSObject), m_swIconName(L"") {}
29
30Icon::~Icon() {}
31
32CJS_Return Icon::get_name(CJS_Runtime* pRuntime) {
33 return CJS_Return(pRuntime->NewString(m_swIconName.c_str()));
34}
35
36CJS_Return Icon::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
37 return CJS_Return(false);
38}