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_object.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_object.h"
8
9
#
include
"fxjs/cfxjs_engine.h"
10
11
// static
12
void
CJS_Object
::
DefineConsts
(
CFXJS_Engine
* pEngine,
13
uint32_t nObjDefnID,
14
pdfium::span<
const
JSConstSpec
> consts) {
15
for
(
const
auto
& item : consts) {
16
pEngine->DefineObjConst(
17
nObjDefnID, item.pName,
18
item.eType == JSConstSpec::Number
19
? pEngine->NewNumber(item.number).As<v8::Value>()
20
: pEngine->NewString(item.pStr).As<v8::Value>());
21
}
22
}
23
24
// static
25
void
CJS_Object
::
DefineProps
(
CFXJS_Engine
* pEngine,
26
uint32_t nObjDefnID,
27
pdfium::span<
const
JSPropertySpec
> props) {
28
for
(
const
auto
& item : props)
29
pEngine->DefineObjProperty(nObjDefnID, item.pName, item.pPropGet,
30
item.pPropPut);
31
}
32
33
// static
34
void
CJS_Object
::
DefineMethods
(
CFXJS_Engine
* pEngine,
35
uint32_t nObjDefnID,
36
pdfium::span<
const
JSMethodSpec
> methods) {
37
for
(
const
auto
& item : methods)
38
pEngine->DefineObjMethod(nObjDefnID, item.pName, item.pMethodCall);
39
}
40
41
CJS_Object
::
CJS_Object
(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime)
42
:
m_pV8Object
(
pObject
->
GetIsolate
(),
pObject
),
m_pRuntime
(
pRuntime
) {}
43
44
CJS_Object
::~
CJS_Object
() =
default
;
CFXJS_Engine
Definition
cfxjs_engine.h:83
CJS_Object
Definition
cjs_object.h:36
CJS_Object::DefineProps
static void DefineProps(CFXJS_Engine *pEngine, uint32_t nObjDefnID, pdfium::span< const JSPropertySpec > consts)
Definition
cjs_object.cpp:25
CJS_Object::DefineConsts
static void DefineConsts(CFXJS_Engine *pEngine, uint32_t nObjDefnID, pdfium::span< const JSConstSpec > consts)
Definition
cjs_object.cpp:12
CJS_Object::~CJS_Object
virtual ~CJS_Object()
CJS_Object::CJS_Object
CJS_Object(v8::Local< v8::Object > pObject, CJS_Runtime *pRuntime)
Definition
cjs_object.cpp:41
CJS_Object::DefineMethods
static void DefineMethods(CFXJS_Engine *pEngine, uint32_t nObjDefnID, pdfium::span< const JSMethodSpec > consts)
Definition
cjs_object.cpp:34
JSConstSpec
Definition
cjs_object.h:16
JSMethodSpec
Definition
cjs_object.h:31
JSPropertySpec
Definition
cjs_object.h:25
qtwebengine
src
3rdparty
chromium
third_party
pdfium
fxjs
cjs_object.cpp
Generated on Wed Nov 13 2024 01:02:31 for Qt by
1.12.0