blob: bf09169456d23330f516a830479acea79e21bfff [file] [log] [blame]
K. Moon832a6942022-10-31 20:11:31 +00001// Copyright 2017 The PDFium Authors
Dan Sinclairf4736722017-11-27 18:10:47 +00002// 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 "xfa/fxfa/parser/cxfa_xdp.h"
8
Tom Sepez148c1442019-01-25 18:56:26 +00009#include "fxjs/xfa/cjx_node.h"
Tom Sepez757a6bf2020-09-17 17:22:38 +000010#include "xfa/fxfa/parser/cxfa_document.h"
Tom Sepez148c1442019-01-25 18:56:26 +000011
Dan Sinclairf4736722017-11-27 18:10:47 +000012namespace {
13
Lei Zhangec7d8e22018-02-07 19:57:25 +000014const CXFA_Node::PropertyData kXdpPropertyData[] = {
Tom Sepez3ee72a22021-08-17 02:34:13 +000015 {XFA_Element::Packets, 1, {}},
Tom Sepeza8c86c22019-01-25 22:06:03 +000016};
Tom Sepez7fc43dd2018-12-13 17:54:26 +000017
Lei Zhangec7d8e22018-02-07 19:57:25 +000018const CXFA_Node::AttributeData kXdpAttributeData[] = {
Dan Sinclair21b08272017-11-30 20:22:20 +000019 {XFA_Attribute::Desc, XFA_AttributeType::CData, nullptr},
20 {XFA_Attribute::Lock, XFA_AttributeType::Integer, (void*)0},
Tom Sepeza8c86c22019-01-25 22:06:03 +000021};
Dan Sinclairf4736722017-11-27 18:10:47 +000022
Dan Sinclairf4736722017-11-27 18:10:47 +000023} // namespace
24
Dan Sinclairc40c5aa2017-11-30 21:29:11 +000025CXFA_Xdp::CXFA_Xdp(CXFA_Document* doc, XFA_PacketType packet)
Dan Sinclairf4736722017-11-27 18:10:47 +000026 : CXFA_Node(doc,
27 packet,
Tom Sepez0c057582021-08-17 17:37:23 +000028 XFA_XDPPACKET::kConfig,
Dan Sinclairf4736722017-11-27 18:10:47 +000029 XFA_ObjectType::Node,
30 XFA_Element::Xdp,
Lei Zhangec7d8e22018-02-07 19:57:25 +000031 kXdpPropertyData,
Tom Sepez148c1442019-01-25 18:56:26 +000032 kXdpAttributeData,
Tom Sepez757a6bf2020-09-17 17:22:38 +000033 cppgc::MakeGarbageCollected<CJX_Node>(
34 doc->GetHeap()->GetAllocationHandle(),
35 this)) {}
Dan Sinclairf4736722017-11-27 18:10:47 +000036
Tom Sepez7fc43dd2018-12-13 17:54:26 +000037CXFA_Xdp::~CXFA_Xdp() = default;