Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cjs_icon.cpp
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
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
12uint32_t CJS_Icon::ObjDefnID = 0;
13const char CJS_Icon::kName[] = "Icon";
14
15// static
16uint32_t CJS_Icon::GetObjDefnID() {
17 return ObjDefnID;
18}
19
20// static
21void CJS_Icon::DefineJSObjects(CFXJS_Engine* pEngine) {
22 ObjDefnID = pEngine->DefineObj(CJS_Icon::kName, FXJSOBJTYPE_DYNAMIC,
23 JSConstructor<CJS_Icon>, JSDestructor);
24 DefineProps(pEngine, ObjDefnID, PropertySpecs);
25}
26
27CJS_Icon::CJS_Icon(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime)
28 : CJS_Object(pObject, pRuntime) {}
29
30CJS_Icon::~CJS_Icon() = default;
31
32CJS_Result CJS_Icon::get_name(CJS_Runtime* pRuntime) {
33 return CJS_Result::Success(pRuntime->NewString(m_swIconName.AsStringView()));
34}
35
36CJS_Result CJS_Icon::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
38}
@ FXJSOBJTYPE_DYNAMIC
CJS_Icon(v8::Local< v8::Object > pObject, CJS_Runtime *pRuntime)
Definition cjs_icon.cpp:27
~CJS_Icon() override
static uint32_t GetObjDefnID()
Definition cjs_icon.cpp:16
static void DefineJSObjects(CFXJS_Engine *pEngine)
Definition cjs_icon.cpp:21
static void DefineProps(CFXJS_Engine *pEngine, uint32_t nObjDefnID, pdfium::span< const JSPropertySpec > consts)
static CJS_Result Failure(JSMessage id)
Definition cjs_result.h:34
JSMessage