John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1 | // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
Lei Zhang | a6d9f0e | 2015-06-13 00:48:38 -0700 | [diff] [blame] | 4 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 7 | #include "../../include/javascript/IJavaScript.h" |
| 8 | #include "../../include/javascript/JS_Define.h" |
| 9 | #include "../../include/javascript/JS_Object.h" |
| 10 | #include "../../include/javascript/JS_Value.h" |
| 11 | #include "../../include/javascript/console.h" |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 12 | #include "../../include/javascript/JS_EventHandler.h" |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 13 | #include "../../include/javascript/JS_Context.h" |
| 14 | |
| 15 | /* ------------------------ console ------------------------ */ |
| 16 | |
| 17 | BEGIN_JS_STATIC_CONST(CJS_Console) |
| 18 | END_JS_STATIC_CONST() |
| 19 | |
| 20 | BEGIN_JS_STATIC_PROP(CJS_Console) |
| 21 | END_JS_STATIC_PROP() |
| 22 | |
| 23 | BEGIN_JS_STATIC_METHOD(CJS_Console) |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 24 | JS_STATIC_METHOD_ENTRY(clear) |
| 25 | JS_STATIC_METHOD_ENTRY(hide) |
| 26 | JS_STATIC_METHOD_ENTRY(println) |
| 27 | JS_STATIC_METHOD_ENTRY(show) |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 28 | END_JS_STATIC_METHOD() |
| 29 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 30 | IMPLEMENT_JS_CLASS(CJS_Console, console) |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 31 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 32 | console::console(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject) {} |
| 33 | |
| 34 | console::~console() {} |
| 35 | |
| 36 | FX_BOOL console::clear(IFXJS_Context* cc, |
| 37 | const CJS_Parameters& params, |
| 38 | CJS_Value& vRet, |
| 39 | CFX_WideString& sError) { |
| 40 | return TRUE; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 41 | } |
| 42 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 43 | FX_BOOL console::hide(IFXJS_Context* cc, |
| 44 | const CJS_Parameters& params, |
| 45 | CJS_Value& vRet, |
| 46 | CFX_WideString& sError) { |
| 47 | return TRUE; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 48 | } |
| 49 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 50 | FX_BOOL console::println(IFXJS_Context* cc, |
| 51 | const CJS_Parameters& params, |
| 52 | CJS_Value& vRet, |
| 53 | CFX_WideString& sError) { |
| 54 | if (params.size() < 1) { |
| 55 | return FALSE; |
| 56 | } |
| 57 | return TRUE; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 58 | } |
| 59 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 60 | FX_BOOL console::show(IFXJS_Context* cc, |
| 61 | const CJS_Parameters& params, |
| 62 | CJS_Value& vRet, |
| 63 | CFX_WideString& sError) { |
| 64 | return TRUE; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 65 | } |