Initial commit.
[pdfium.git] / fpdfsdk / src / javascript / console.cpp
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4  \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #include "../../include/javascript/JavaScript.h"\r
8 #include "../../include/javascript/IJavaScript.h"\r
9 #include "../../include/javascript/JS_Define.h"\r
10 #include "../../include/javascript/JS_Object.h"\r
11 #include "../../include/javascript/JS_Value.h"\r
12 #include "../../include/javascript/console.h"\r
13 //#include "../../include/javascript/JS_Module.h"\r
14 #include "../../include/javascript/JS_EventHandler.h"\r
15 //#include "../../include/javascript/JS_ResMgr.h"\r
16 #include "../../include/javascript/JS_Context.h"\r
17 \r
18 /* ------------------------ console ------------------------ */\r
19 \r
20 BEGIN_JS_STATIC_CONST(CJS_Console)\r
21 END_JS_STATIC_CONST()\r
22 \r
23 BEGIN_JS_STATIC_PROP(CJS_Console)\r
24 END_JS_STATIC_PROP()\r
25 \r
26 BEGIN_JS_STATIC_METHOD(CJS_Console)\r
27         JS_STATIC_METHOD_ENTRY(clear, 0)\r
28         JS_STATIC_METHOD_ENTRY(hide, 0)\r
29         JS_STATIC_METHOD_ENTRY(println, 1)\r
30         JS_STATIC_METHOD_ENTRY(show, 0)\r
31 END_JS_STATIC_METHOD()\r
32 \r
33 IMPLEMENT_JS_CLASS(CJS_Console,console)\r
34 \r
35 #define MAXCONSOLECONTENTS                      10000\r
36 \r
37 console::console(CJS_Object* pJSObject): CJS_EmbedObj(pJSObject)\r
38 {\r
39 }\r
40 \r
41 console::~console()\r
42 {\r
43 }\r
44 \r
45 FX_BOOL console::clear(OBJ_METHOD_PARAMS)\r
46 {\r
47 \r
48 \r
49 \r
50         return TRUE;\r
51 }\r
52 \r
53 FX_BOOL console::hide(OBJ_METHOD_PARAMS)\r
54 {\r
55 \r
56 \r
57         \r
58 \r
59         return TRUE;\r
60 }\r
61 \r
62 FX_BOOL console::println(OBJ_METHOD_PARAMS)\r
63 {\r
64         if (params.size() < 1)\r
65         {\r
66                 return FALSE;\r
67         }\r
68   \r
69         return TRUE;\r
70 }\r
71 \r
72 FX_BOOL console::show(OBJ_METHOD_PARAMS)\r
73 {\r
74         return TRUE;\r
75 }\r
76 \r
77 \r
78 \r