From 0ead5426591630db17a4dbed34e43dfab84379d1 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 30 Oct 2017 15:36:43 +0000 Subject: Rename Icon to cjs_icon This CL renames Icon.{cpp|h} to cjs_icon.{cpp|h}. Change-Id: Ie0554771441cfa7011205e0c4f461bb7526bb068 Reviewed-on: https://pdfium-review.googlesource.com/17034 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- fpdfsdk/javascript/Icon.cpp | 43 ------------------------------------ fpdfsdk/javascript/Icon.h | 44 ------------------------------------- fpdfsdk/javascript/cjs_document.cpp | 2 +- fpdfsdk/javascript/cjs_field.cpp | 2 +- fpdfsdk/javascript/cjs_icon.cpp | 39 ++++++++++++++++++++++++++++++++ fpdfsdk/javascript/cjs_icon.h | 42 +++++++++++++++++++++++++++++++++++ fpdfsdk/javascript/cjs_runtime.cpp | 2 +- 7 files changed, 84 insertions(+), 90 deletions(-) delete mode 100644 fpdfsdk/javascript/Icon.cpp delete mode 100644 fpdfsdk/javascript/Icon.h create mode 100644 fpdfsdk/javascript/cjs_icon.cpp create mode 100644 fpdfsdk/javascript/cjs_icon.h (limited to 'fpdfsdk') diff --git a/fpdfsdk/javascript/Icon.cpp b/fpdfsdk/javascript/Icon.cpp deleted file mode 100644 index df7561ea8b..0000000000 --- a/fpdfsdk/javascript/Icon.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#include "fpdfsdk/javascript/Icon.h" - -#include "fpdfsdk/javascript/JS_Define.h" -#include "fpdfsdk/javascript/JS_Object.h" -#include "fpdfsdk/javascript/JS_Value.h" - -const JSPropertySpec CJS_Icon::PropertySpecs[] = { - {"name", get_name_static, set_name_static}, - {0, 0, 0}}; - -int CJS_Icon::ObjDefnID = -1; - -// static -int CJS_Icon::GetObjDefnID() { - return ObjDefnID; -} - -// static -void CJS_Icon::DefineJSObjects(CFXJS_Engine* pEngine) { - ObjDefnID = - pEngine->DefineObj("Icon", FXJSOBJTYPE_DYNAMIC, - JSConstructor, JSDestructor); - DefineProps(pEngine, ObjDefnID, PropertySpecs); -} - -Icon::Icon(CJS_Object* pJSObject) - : CJS_EmbedObj(pJSObject), m_swIconName(L"") {} - -Icon::~Icon() {} - -CJS_Return Icon::get_name(CJS_Runtime* pRuntime) { - return CJS_Return(pRuntime->NewString(m_swIconName.c_str())); -} - -CJS_Return Icon::set_name(CJS_Runtime* pRuntime, v8::Local vp) { - return CJS_Return(false); -} diff --git a/fpdfsdk/javascript/Icon.h b/fpdfsdk/javascript/Icon.h deleted file mode 100644 index 9f6366178d..0000000000 --- a/fpdfsdk/javascript/Icon.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef FPDFSDK_JAVASCRIPT_ICON_H_ -#define FPDFSDK_JAVASCRIPT_ICON_H_ - -#include "fpdfsdk/javascript/JS_Define.h" - -class CPDF_Stream; - -class Icon : public CJS_EmbedObj { - public: - explicit Icon(CJS_Object* pJSObject); - ~Icon() override; - - CJS_Return get_name(CJS_Runtime* pRuntime); - CJS_Return set_name(CJS_Runtime* pRuntime, v8::Local vp); - - WideString GetIconName() const { return m_swIconName; } - void SetIconName(WideString name) { m_swIconName = name; } - - private: - WideString m_swIconName; -}; - -class CJS_Icon : public CJS_Object { - public: - static int GetObjDefnID(); - static void DefineJSObjects(CFXJS_Engine* pEngine); - - explicit CJS_Icon(v8::Local pObject) : CJS_Object(pObject) {} - ~CJS_Icon() override {} - - JS_STATIC_PROP(name, name, Icon); - - private: - static int ObjDefnID; - static const JSPropertySpec PropertySpecs[]; -}; - -#endif // FPDFSDK_JAVASCRIPT_ICON_H_ diff --git a/fpdfsdk/javascript/cjs_document.cpp b/fpdfsdk/javascript/cjs_document.cpp index abbc61be61..df7001bd8f 100644 --- a/fpdfsdk/javascript/cjs_document.cpp +++ b/fpdfsdk/javascript/cjs_document.cpp @@ -19,11 +19,11 @@ #include "fpdfsdk/cpdfsdk_annotiteration.h" #include "fpdfsdk/cpdfsdk_interform.h" #include "fpdfsdk/cpdfsdk_pageview.h" -#include "fpdfsdk/javascript/Icon.h" #include "fpdfsdk/javascript/app.h" #include "fpdfsdk/javascript/cjs_annot.h" #include "fpdfsdk/javascript/cjs_delaydata.h" #include "fpdfsdk/javascript/cjs_field.h" +#include "fpdfsdk/javascript/cjs_icon.h" #include "fpdfsdk/javascript/cjs_printparamsobj.h" const JSPropertySpec CJS_Document::PropertySpecs[] = { diff --git a/fpdfsdk/javascript/cjs_field.cpp b/fpdfsdk/javascript/cjs_field.cpp index 110c8ee51a..4de5da1747 100644 --- a/fpdfsdk/javascript/cjs_field.cpp +++ b/fpdfsdk/javascript/cjs_field.cpp @@ -15,9 +15,9 @@ #include "fpdfsdk/cpdfsdk_interform.h" #include "fpdfsdk/cpdfsdk_pageview.h" #include "fpdfsdk/cpdfsdk_widget.h" -#include "fpdfsdk/javascript/Icon.h" #include "fpdfsdk/javascript/cjs_delaydata.h" #include "fpdfsdk/javascript/cjs_document.h" +#include "fpdfsdk/javascript/cjs_icon.h" #include "fpdfsdk/javascript/color.h" namespace { diff --git a/fpdfsdk/javascript/cjs_icon.cpp b/fpdfsdk/javascript/cjs_icon.cpp new file mode 100644 index 0000000000..2606b8213d --- /dev/null +++ b/fpdfsdk/javascript/cjs_icon.cpp @@ -0,0 +1,39 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "fpdfsdk/javascript/cjs_icon.h" + +const JSPropertySpec CJS_Icon::PropertySpecs[] = { + {"name", get_name_static, set_name_static}, + {0, 0, 0}}; + +int CJS_Icon::ObjDefnID = -1; + +// static +int CJS_Icon::GetObjDefnID() { + return ObjDefnID; +} + +// static +void CJS_Icon::DefineJSObjects(CFXJS_Engine* pEngine) { + ObjDefnID = + pEngine->DefineObj("Icon", FXJSOBJTYPE_DYNAMIC, + JSConstructor, JSDestructor); + DefineProps(pEngine, ObjDefnID, PropertySpecs); +} + +Icon::Icon(CJS_Object* pJSObject) + : CJS_EmbedObj(pJSObject), m_swIconName(L"") {} + +Icon::~Icon() {} + +CJS_Return Icon::get_name(CJS_Runtime* pRuntime) { + return CJS_Return(pRuntime->NewString(m_swIconName.c_str())); +} + +CJS_Return Icon::set_name(CJS_Runtime* pRuntime, v8::Local vp) { + return CJS_Return(false); +} diff --git a/fpdfsdk/javascript/cjs_icon.h b/fpdfsdk/javascript/cjs_icon.h new file mode 100644 index 0000000000..dd33426bf7 --- /dev/null +++ b/fpdfsdk/javascript/cjs_icon.h @@ -0,0 +1,42 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FPDFSDK_JAVASCRIPT_CJS_ICON_H_ +#define FPDFSDK_JAVASCRIPT_CJS_ICON_H_ + +#include "fpdfsdk/javascript/JS_Define.h" + +class Icon : public CJS_EmbedObj { + public: + explicit Icon(CJS_Object* pJSObject); + ~Icon() override; + + CJS_Return get_name(CJS_Runtime* pRuntime); + CJS_Return set_name(CJS_Runtime* pRuntime, v8::Local vp); + + WideString GetIconName() const { return m_swIconName; } + void SetIconName(WideString name) { m_swIconName = name; } + + private: + WideString m_swIconName; +}; + +class CJS_Icon : public CJS_Object { + public: + static int GetObjDefnID(); + static void DefineJSObjects(CFXJS_Engine* pEngine); + + explicit CJS_Icon(v8::Local pObject) : CJS_Object(pObject) {} + ~CJS_Icon() override {} + + JS_STATIC_PROP(name, name, Icon); + + private: + static int ObjDefnID; + static const JSPropertySpec PropertySpecs[]; +}; + +#endif // FPDFSDK_JAVASCRIPT_CJS_ICON_H_ diff --git a/fpdfsdk/javascript/cjs_runtime.cpp b/fpdfsdk/javascript/cjs_runtime.cpp index 9421d3dee3..177a6f43ac 100644 --- a/fpdfsdk/javascript/cjs_runtime.cpp +++ b/fpdfsdk/javascript/cjs_runtime.cpp @@ -9,7 +9,6 @@ #include #include "fpdfsdk/cpdfsdk_formfillenvironment.h" -#include "fpdfsdk/javascript/Icon.h" #include "fpdfsdk/javascript/JS_Define.h" #include "fpdfsdk/javascript/JS_GlobalData.h" #include "fpdfsdk/javascript/JS_Object.h" @@ -28,6 +27,7 @@ #include "fpdfsdk/javascript/cjs_globalarrays.h" #include "fpdfsdk/javascript/cjs_globalconsts.h" #include "fpdfsdk/javascript/cjs_highlight.h" +#include "fpdfsdk/javascript/cjs_icon.h" #include "fpdfsdk/javascript/cjs_position.h" #include "fpdfsdk/javascript/cjs_printparamsobj.h" #include "fpdfsdk/javascript/cjs_scalehow.h" -- cgit v1.2.3