Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Side by Side Diff: fpdfsdk/src/javascript/Consts.cpp

Issue 1256283005: Remove stringify macro (#) from JS_STATIC_CONST_ENTRY_*. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/include/javascript/JS_Define.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../include/javascript/JavaScript.h" 7 #include "../../include/javascript/JavaScript.h"
8 #include "../../include/javascript/IJavaScript.h" 8 #include "../../include/javascript/IJavaScript.h"
9 #include "../../include/javascript/JS_Define.h" 9 #include "../../include/javascript/JS_Define.h"
10 #include "../../include/javascript/JS_Object.h" 10 #include "../../include/javascript/JS_Object.h"
11 #include "../../include/javascript/JS_Value.h" 11 #include "../../include/javascript/JS_Value.h"
12 #include "../../include/javascript/Consts.h" 12 #include "../../include/javascript/Consts.h"
13 13
14 /* ------------------------------ border ------------------------------ */ 14 /* ------------------------------ border ------------------------------ */
15 15
16 BEGIN_JS_STATIC_CONST(CJS_Border) 16 BEGIN_JS_STATIC_CONST(CJS_Border)
17 JS_STATIC_CONST_ENTRY_STRING(s, solid) 17 JS_STATIC_CONST_ENTRY_STRING(L"s", L"solid")
18 JS_STATIC_CONST_ENTRY_STRING(b, beveled) 18 JS_STATIC_CONST_ENTRY_STRING(L"b", L"beveled")
19 JS_STATIC_CONST_ENTRY_STRING(d, dashed) 19 JS_STATIC_CONST_ENTRY_STRING(L"d", L"dashed")
20 JS_STATIC_CONST_ENTRY_STRING(i, inset) 20 JS_STATIC_CONST_ENTRY_STRING(L"i", L"inset")
21 JS_STATIC_CONST_ENTRY_STRING(u, underline) 21 JS_STATIC_CONST_ENTRY_STRING(L"u", L"underline")
22 END_JS_STATIC_CONST() 22 END_JS_STATIC_CONST()
23 23
24 IMPLEMENT_JS_CLASS_CONST(CJS_Border, border) 24 IMPLEMENT_JS_CLASS_CONST(CJS_Border, border)
25 25
26 /* ------------------------------ display ------------------------------ */ 26 /* ------------------------------ display ------------------------------ */
27 27
28 BEGIN_JS_STATIC_CONST(CJS_Display) 28 BEGIN_JS_STATIC_CONST(CJS_Display)
29 JS_STATIC_CONST_ENTRY_NUMBER(visible, 0) 29 JS_STATIC_CONST_ENTRY_NUMBER(L"visible", 0)
30 JS_STATIC_CONST_ENTRY_NUMBER(hidden, 1) 30 JS_STATIC_CONST_ENTRY_NUMBER(L"hidden", 1)
31 JS_STATIC_CONST_ENTRY_NUMBER(noPrint, 2) 31 JS_STATIC_CONST_ENTRY_NUMBER(L"noPrint", 2)
32 JS_STATIC_CONST_ENTRY_NUMBER(noView, 3) 32 JS_STATIC_CONST_ENTRY_NUMBER(L"noView", 3)
33 END_JS_STATIC_CONST() 33 END_JS_STATIC_CONST()
34 34
35 IMPLEMENT_JS_CLASS_CONST(CJS_Display, display) 35 IMPLEMENT_JS_CLASS_CONST(CJS_Display, display)
36 36
37 /* ------------------------------ font ------------------------------ */ 37 /* ------------------------------ font ------------------------------ */
38 38
39 BEGIN_JS_STATIC_CONST(CJS_Font) 39 BEGIN_JS_STATIC_CONST(CJS_Font)
40 JS_STATIC_CONST_ENTRY_STRING(Times, Times-Roman) 40 JS_STATIC_CONST_ENTRY_STRING(L"Times", L"Times-Roman")
41 JS_STATIC_CONST_ENTRY_STRING(TimesB, Times-Bold) 41 JS_STATIC_CONST_ENTRY_STRING(L"TimesB", L"Times-Bold")
42 JS_STATIC_CONST_ENTRY_STRING(TimesI, Times-Italic) 42 JS_STATIC_CONST_ENTRY_STRING(L"TimesI", L"Times-Italic")
43 JS_STATIC_CONST_ENTRY_STRING(TimesBI, Times-BoldItalic) 43 JS_STATIC_CONST_ENTRY_STRING(L"TimesBI", L"Times-BoldItalic")
44 JS_STATIC_CONST_ENTRY_STRING(Helv, Helvetica) 44 JS_STATIC_CONST_ENTRY_STRING(L"Helv", L"Helvetica")
45 JS_STATIC_CONST_ENTRY_STRING(HelvB, Helvetica-Bold) 45 JS_STATIC_CONST_ENTRY_STRING(L"HelvB", L"Helvetica-Bold")
46 JS_STATIC_CONST_ENTRY_STRING(HelvI, Helvetica-Oblique) 46 JS_STATIC_CONST_ENTRY_STRING(L"HelvI", L"Helvetica-Oblique")
47 JS_STATIC_CONST_ENTRY_STRING(HelvBI, Helvetica-BoldOblique) 47 JS_STATIC_CONST_ENTRY_STRING(L"HelvBI", L"Helvetica-BoldOblique")
48 JS_STATIC_CONST_ENTRY_STRING(Cour, Courier) 48 JS_STATIC_CONST_ENTRY_STRING(L"Cour", L"Courier")
49 JS_STATIC_CONST_ENTRY_STRING(CourB, Courier-Bold) 49 JS_STATIC_CONST_ENTRY_STRING(L"CourB", L"Courier-Bold")
50 JS_STATIC_CONST_ENTRY_STRING(CourI, Courier-Oblique) 50 JS_STATIC_CONST_ENTRY_STRING(L"CourI", L"Courier-Oblique")
51 JS_STATIC_CONST_ENTRY_STRING(CourBI, Courier-BoldOblique) 51 JS_STATIC_CONST_ENTRY_STRING(L"CourBI", L"Courier-BoldOblique")
52 JS_STATIC_CONST_ENTRY_STRING(Symbol, Symbol) 52 JS_STATIC_CONST_ENTRY_STRING(L"Symbol", L"Symbol")
53 JS_STATIC_CONST_ENTRY_STRING(ZapfD, ZapfDingbats) 53 JS_STATIC_CONST_ENTRY_STRING(L"ZapfD", L"ZapfDingbats")
54 END_JS_STATIC_CONST() 54 END_JS_STATIC_CONST()
55 55
56 IMPLEMENT_JS_CLASS_CONST(CJS_Font, font) 56 IMPLEMENT_JS_CLASS_CONST(CJS_Font, font)
57 57
58 /* ------------------------------ highlight ------------------------------ */ 58 /* ------------------------------ highlight ------------------------------ */
59 59
60 BEGIN_JS_STATIC_CONST(CJS_Highlight) 60 BEGIN_JS_STATIC_CONST(CJS_Highlight)
61 JS_STATIC_CONST_ENTRY_STRING(n, none) 61 JS_STATIC_CONST_ENTRY_STRING(L"n", L"none")
62 JS_STATIC_CONST_ENTRY_STRING(i, invert) 62 JS_STATIC_CONST_ENTRY_STRING(L"i", L"invert")
63 JS_STATIC_CONST_ENTRY_STRING(p, push) 63 JS_STATIC_CONST_ENTRY_STRING(L"p", L"push")
64 JS_STATIC_CONST_ENTRY_STRING(o, outline) 64 JS_STATIC_CONST_ENTRY_STRING(L"o", L"outline")
65 END_JS_STATIC_CONST() 65 END_JS_STATIC_CONST()
66 66
67 IMPLEMENT_JS_CLASS_CONST(CJS_Highlight, highlight) 67 IMPLEMENT_JS_CLASS_CONST(CJS_Highlight, highlight)
68 68
69 /* ------------------------------ position ------------------------------ */ 69 /* ------------------------------ position ------------------------------ */
70 70
71 BEGIN_JS_STATIC_CONST(CJS_Position) 71 BEGIN_JS_STATIC_CONST(CJS_Position)
72 JS_STATIC_CONST_ENTRY_NUMBER(textOnly, 0) 72 JS_STATIC_CONST_ENTRY_NUMBER(L"textOnly", 0)
73 JS_STATIC_CONST_ENTRY_NUMBER(iconOnly, 1) 73 JS_STATIC_CONST_ENTRY_NUMBER(L"iconOnly", 1)
74 JS_STATIC_CONST_ENTRY_NUMBER(iconTextV, 2) 74 JS_STATIC_CONST_ENTRY_NUMBER(L"iconTextV", 2)
75 JS_STATIC_CONST_ENTRY_NUMBER(textIconV, 3) 75 JS_STATIC_CONST_ENTRY_NUMBER(L"textIconV", 3)
76 JS_STATIC_CONST_ENTRY_NUMBER(iconTextH, 4) 76 JS_STATIC_CONST_ENTRY_NUMBER(L"iconTextH", 4)
77 JS_STATIC_CONST_ENTRY_NUMBER(textIconH, 5) 77 JS_STATIC_CONST_ENTRY_NUMBER(L"textIconH", 5)
78 JS_STATIC_CONST_ENTRY_NUMBER(overlay, 6) 78 JS_STATIC_CONST_ENTRY_NUMBER(L"overlay", 6)
79 END_JS_STATIC_CONST() 79 END_JS_STATIC_CONST()
80 80
81 IMPLEMENT_JS_CLASS_CONST(CJS_Position, position) 81 IMPLEMENT_JS_CLASS_CONST(CJS_Position, position)
82 82
83 /* ------------------------------ scaleHow ------------------------------ */ 83 /* ------------------------------ scaleHow ------------------------------ */
84 84
85 BEGIN_JS_STATIC_CONST(CJS_ScaleHow) 85 BEGIN_JS_STATIC_CONST(CJS_ScaleHow)
86 JS_STATIC_CONST_ENTRY_NUMBER(proportional, 0) 86 JS_STATIC_CONST_ENTRY_NUMBER(L"proportional", 0)
87 JS_STATIC_CONST_ENTRY_NUMBER(anamorphic, 1) 87 JS_STATIC_CONST_ENTRY_NUMBER(L"anamorphic", 1)
88 END_JS_STATIC_CONST() 88 END_JS_STATIC_CONST()
89 89
90 IMPLEMENT_JS_CLASS_CONST(CJS_ScaleHow, scaleHow) 90 IMPLEMENT_JS_CLASS_CONST(CJS_ScaleHow, scaleHow)
91 91
92 /* ------------------------------ scaleWhen ------------------------------ */ 92 /* ------------------------------ scaleWhen ------------------------------ */
93 93
94 BEGIN_JS_STATIC_CONST(CJS_ScaleWhen) 94 BEGIN_JS_STATIC_CONST(CJS_ScaleWhen)
95 JS_STATIC_CONST_ENTRY_NUMBER(always, 0) 95 JS_STATIC_CONST_ENTRY_NUMBER(L"always", 0)
96 JS_STATIC_CONST_ENTRY_NUMBER(never, 1) 96 JS_STATIC_CONST_ENTRY_NUMBER(L"never", 1)
97 JS_STATIC_CONST_ENTRY_NUMBER(tooBig, 2) 97 JS_STATIC_CONST_ENTRY_NUMBER(L"tooBig", 2)
98 JS_STATIC_CONST_ENTRY_NUMBER(tooSmall, 3) 98 JS_STATIC_CONST_ENTRY_NUMBER(L"tooSmall", 3)
99 END_JS_STATIC_CONST() 99 END_JS_STATIC_CONST()
100 100
101 IMPLEMENT_JS_CLASS_CONST(CJS_ScaleWhen, scaleWhen) 101 IMPLEMENT_JS_CLASS_CONST(CJS_ScaleWhen, scaleWhen)
102 102
103 /* ------------------------------ style ------------------------------ */ 103 /* ------------------------------ style ------------------------------ */
104 104
105 BEGIN_JS_STATIC_CONST(CJS_Style) 105 BEGIN_JS_STATIC_CONST(CJS_Style)
106 JS_STATIC_CONST_ENTRY_STRING(ch, check) 106 JS_STATIC_CONST_ENTRY_STRING(L"ch", L"check")
107 JS_STATIC_CONST_ENTRY_STRING(cr, cross) 107 JS_STATIC_CONST_ENTRY_STRING(L"cr", L"cross")
108 JS_STATIC_CONST_ENTRY_STRING(di, diamond) 108 JS_STATIC_CONST_ENTRY_STRING(L"di", L"diamond")
109 JS_STATIC_CONST_ENTRY_STRING(ci, circle) 109 JS_STATIC_CONST_ENTRY_STRING(L"ci", L"circle")
110 JS_STATIC_CONST_ENTRY_STRING(st, star) 110 JS_STATIC_CONST_ENTRY_STRING(L"st", L"star")
111 JS_STATIC_CONST_ENTRY_STRING(sq, square) 111 JS_STATIC_CONST_ENTRY_STRING(L"sq", L"square")
112 END_JS_STATIC_CONST() 112 END_JS_STATIC_CONST()
113 113
114 IMPLEMENT_JS_CLASS_CONST(CJS_Style, style) 114 IMPLEMENT_JS_CLASS_CONST(CJS_Style, style)
115 115
116 /* ------------------------------ zoomtype ------------------------------ */ 116 /* ------------------------------ zoomtype ------------------------------ */
117 117
118 BEGIN_JS_STATIC_CONST(CJS_Zoomtype) 118 BEGIN_JS_STATIC_CONST(CJS_Zoomtype)
119 JS_STATIC_CONST_ENTRY_STRING(none, NoVary) 119 JS_STATIC_CONST_ENTRY_STRING(L"none", L"NoVary")
120 JS_STATIC_CONST_ENTRY_STRING(fitP, FitPage) 120 JS_STATIC_CONST_ENTRY_STRING(L"fitP", L"FitPage")
121 JS_STATIC_CONST_ENTRY_STRING(fitW, FitWidth) 121 JS_STATIC_CONST_ENTRY_STRING(L"fitW", L"FitWidth")
122 JS_STATIC_CONST_ENTRY_STRING(fitH, FitHeight) 122 JS_STATIC_CONST_ENTRY_STRING(L"fitH", L"FitHeight")
123 JS_STATIC_CONST_ENTRY_STRING(fitV, FitVisibleWidth) 123 JS_STATIC_CONST_ENTRY_STRING(L"fitV", L"FitVisibleWidth")
124 JS_STATIC_CONST_ENTRY_STRING(pref, Preferred) 124 JS_STATIC_CONST_ENTRY_STRING(L"pref", L"Preferred")
125 JS_STATIC_CONST_ENTRY_STRING(refW, ReflowWidth) 125 JS_STATIC_CONST_ENTRY_STRING(L"refW", L"ReflowWidth")
126 END_JS_STATIC_CONST() 126 END_JS_STATIC_CONST()
127 127
128 IMPLEMENT_JS_CLASS_CONST(CJS_Zoomtype, zoomtype) 128 IMPLEMENT_JS_CLASS_CONST(CJS_Zoomtype, zoomtype)
129 129
130 /* ------------------------------ CJS_GlobalConsts 130 /* ------------------------------ CJS_GlobalConsts
131 * ------------------------------ */ 131 * ------------------------------ */
132 132
133 int CJS_GlobalConsts::Init(IJS_Runtime* pRuntime) { 133 int CJS_GlobalConsts::Init(IJS_Runtime* pRuntime) {
134 DEFINE_GLOBAL_CONST(pRuntime, IDS_GREATER_THAN, Invalid value 134 DEFINE_GLOBAL_CONST(pRuntime, IDS_GREATER_THAN, Invalid value
135 : must be greater than or equal to % s.); 135 : must be greater than or equal to % s.);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 255
256 { 256 {
257 const FX_WCHAR* ArrayName = L"RE_SSN_COMMIT"; 257 const FX_WCHAR* ArrayName = L"RE_SSN_COMMIT";
258 const FX_WCHAR* ArrayContent[] = { 258 const FX_WCHAR* ArrayContent[] = {
259 L"\\d{3}(\\.|[- ])?\\d{2}(\\.|[- ])?\\d{4}"}; 259 L"\\d{3}(\\.|[- ])?\\d{2}(\\.|[- ])?\\d{4}"};
260 DEFINE_GLOBAL_ARRAY(pRuntime); 260 DEFINE_GLOBAL_ARRAY(pRuntime);
261 } 261 }
262 262
263 return 0; 263 return 0;
264 } 264 }
OLDNEW
« no previous file with comments | « fpdfsdk/include/javascript/JS_Define.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698