OLD | NEW |
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 "app.h" | 7 #include "app.h" |
8 | 8 |
9 #include "Document.h" | 9 #include "Document.h" |
10 #include "JS_Context.h" | 10 #include "JS_Context.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 CJS_Timer* TimerObj::GetTimer() const { | 41 CJS_Timer* TimerObj::GetTimer() const { |
42 return m_pTimer; | 42 return m_pTimer; |
43 } | 43 } |
44 | 44 |
45 #define JS_STR_VIEWERTYPE L"pdfium" | 45 #define JS_STR_VIEWERTYPE L"pdfium" |
46 #define JS_STR_VIEWERVARIATION L"Full" | 46 #define JS_STR_VIEWERVARIATION L"Full" |
47 #define JS_STR_PLATFORM L"WIN" | 47 #define JS_STR_PLATFORM L"WIN" |
48 #define JS_STR_LANGUANGE L"ENU" | 48 #define JS_STR_LANGUANGE L"ENU" |
49 #define JS_NUM_VIEWERVERSION 8 | 49 #define JS_NUM_VIEWERVERSION 8 |
| 50 #ifdef PDF_ENABLE_XFA |
50 #define JS_NUM_VIEWERVERSION_XFA 11 | 51 #define JS_NUM_VIEWERVERSION_XFA 11 |
| 52 #endif |
51 #define JS_NUM_FORMSVERSION 7 | 53 #define JS_NUM_FORMSVERSION 7 |
52 | 54 |
53 BEGIN_JS_STATIC_CONST(CJS_App) | 55 BEGIN_JS_STATIC_CONST(CJS_App) |
54 END_JS_STATIC_CONST() | 56 END_JS_STATIC_CONST() |
55 | 57 |
56 BEGIN_JS_STATIC_PROP(CJS_App) | 58 BEGIN_JS_STATIC_PROP(CJS_App) |
57 JS_STATIC_PROP_ENTRY(activeDocs) | 59 JS_STATIC_PROP_ENTRY(activeDocs) |
58 JS_STATIC_PROP_ENTRY(calculate) | 60 JS_STATIC_PROP_ENTRY(calculate) |
59 JS_STATIC_PROP_ENTRY(formsVersion) | 61 JS_STATIC_PROP_ENTRY(formsVersion) |
60 JS_STATIC_PROP_ENTRY(fs) | 62 JS_STATIC_PROP_ENTRY(fs) |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 193 |
192 return FALSE; | 194 return FALSE; |
193 } | 195 } |
194 | 196 |
195 FX_BOOL app::viewerVersion(IJS_Context* cc, | 197 FX_BOOL app::viewerVersion(IJS_Context* cc, |
196 CJS_PropValue& vp, | 198 CJS_PropValue& vp, |
197 CFX_WideString& sError) { | 199 CFX_WideString& sError) { |
198 if (!vp.IsGetting()) | 200 if (!vp.IsGetting()) |
199 return FALSE; | 201 return FALSE; |
200 | 202 |
| 203 #ifdef PDF_ENABLE_XFA |
201 CJS_Context* pContext = (CJS_Context*)cc; | 204 CJS_Context* pContext = (CJS_Context*)cc; |
202 CPDFSDK_Document* pCurDoc = pContext->GetReaderDocument(); | 205 CPDFSDK_Document* pCurDoc = pContext->GetReaderDocument(); |
203 CPDFXFA_Document* pDoc = pCurDoc->GetXFADocument(); | 206 CPDFXFA_Document* pDoc = pCurDoc->GetXFADocument(); |
204 if (pDoc->GetDocType() == 1 || pDoc->GetDocType() == 2) { | 207 if (pDoc->GetDocType() == 1 || pDoc->GetDocType() == 2) { |
205 vp << JS_NUM_VIEWERVERSION_XFA; | 208 vp << JS_NUM_VIEWERVERSION_XFA; |
206 return TRUE; | 209 return TRUE; |
207 } | 210 } |
208 | 211 |
| 212 #endif |
209 vp << JS_NUM_VIEWERVERSION; | 213 vp << JS_NUM_VIEWERVERSION; |
210 return TRUE; | 214 return TRUE; |
211 } | 215 } |
212 | 216 |
213 FX_BOOL app::platform(IJS_Context* cc, | 217 FX_BOOL app::platform(IJS_Context* cc, |
214 CJS_PropValue& vp, | 218 CJS_PropValue& vp, |
215 CFX_WideString& sError) { | 219 CFX_WideString& sError) { |
216 if (vp.IsGetting()) { | 220 if (vp.IsGetting()) { |
217 vp << JS_STR_PLATFORM; | 221 vp << JS_STR_PLATFORM; |
218 return TRUE; | 222 return TRUE; |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 FX_BOOL app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { | 814 FX_BOOL app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { |
811 return FALSE; | 815 return FALSE; |
812 } | 816 } |
813 | 817 |
814 FX_BOOL app::execDialog(IJS_Context* cc, | 818 FX_BOOL app::execDialog(IJS_Context* cc, |
815 const std::vector<CJS_Value>& params, | 819 const std::vector<CJS_Value>& params, |
816 CJS_Value& vRet, | 820 CJS_Value& vRet, |
817 CFX_WideString& sError) { | 821 CFX_WideString& sError) { |
818 return TRUE; | 822 return TRUE; |
819 } | 823 } |
OLD | NEW |