xref: /aosp_15_r20/external/pdfium/fxjs/cjs_scalewhen.cpp (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2017 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_scalewhen.h"
8 
9 const JSConstSpec CJS_ScaleWhen::ConstSpecs[] = {
10     {"always", JSConstSpec::Number, 0, 0},
11     {"never", JSConstSpec::Number, 1, 0},
12     {"tooBig", JSConstSpec::Number, 2, 0},
13     {"tooSmall", JSConstSpec::Number, 3, 0}};
14 
15 uint32_t CJS_ScaleWhen::ObjDefnID = 0;
16 
17 // static
DefineJSObjects(CFXJS_Engine * pEngine)18 void CJS_ScaleWhen::DefineJSObjects(CFXJS_Engine* pEngine) {
19   ObjDefnID =
20       pEngine->DefineObj("scaleWhen", FXJSOBJTYPE_STATIC, nullptr, nullptr);
21   DefineConsts(pEngine, ObjDefnID, ConstSpecs);
22 }
23