summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Field.h
AgeCommit message (Collapse)Author
2017-10-30Rename Field to cjs_fieldDan Sinclair
This CL renames Field.{cpp|h} to cjs_field.{cpp|h}. The CJS_DelayData is split out into cjs_delaydata.{cpp|h} Change-Id: If1e3cbbc0d65cbb5cc69ee9862db3fc78ee652e2 Reviewed-on: https://pdfium-review.googlesource.com/17033 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-26Remove unneeded DefineJSObject paramDan Sinclair
The second parameter to DefineJSObject is always set the same for each object type. Remove and put the value directly into the DefineObj calls. Change-Id: If939c57fe6ea3b985ab2337eb30f472c668cdc42 Reviewed-on: https://pdfium-review.googlesource.com/16911 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-10-26Make spec arrays constDan Sinclair
This CL marks all of the Spec arrays as const. Change-Id: Ie36f670a4230fcac2cba5544b9c6e5179b0c7073 Reviewed-on: https://pdfium-review.googlesource.com/16951 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-10-26Cleanup statics in JS classesDan Sinclair
This CL removes the static object IDs from each of the CJS_Object subclasses and moves them to anonymous namespaces. The Spec arrays are moved to private members of the object classes. Change-Id: I5dcdb87ef57e4b374b5431580fb55cb75023f8fb Reviewed-on: https://pdfium-review.googlesource.com/16950 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-26Remove g_pClassNameDan Sinclair
This CL removes the g_pClassName static member and uses the string directly where needed. Change-Id: I47f61442ced2ee1d6a607fb1a7d9bcaf000b8ee2 Reviewed-on: https://pdfium-review.googlesource.com/16931 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-10-26Cleanup JS define methodsDan Sinclair
This CL moves DefineProps, DefineMethods and DefineConsts to the CJS_Object and removes from the subclasses. The JSConstructor and JSDestructor are moved to be templated static methods in JS_Defines. Change-Id: Ibe5ee063a32ae2332b8affc843d97ee6da21f4ee Reviewed-on: https://pdfium-review.googlesource.com/16930 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-26Remove methods for empty const/method/property arraysDan Sinclair
This CL cleans up the methods and arrays for constants, methods and property definitions which are empty. Change-Id: I4a4d85cc139075de77d84a40182bd00341c31818 Reviewed-on: https://pdfium-review.googlesource.com/16910 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-26Remove JS macrosDan Sinclair
This CL removes the JS macros and inlines the code directly into the requisite classes. Change-Id: I514ca025be42cd46b041b4af271f7b1d1067ab42 Reviewed-on: https://pdfium-review.googlesource.com/16890 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-25Refactor JS method parameters and return values.Dan Sinclair
This CL removes the out parameters from the JS methods and changes the return from a |bool| to a |CJS_Return| value. The return value holds the returned v8 object, error string and a status code. Change-Id: I82488ff0d916475d7e3c8e51ed868639806181c9 Reviewed-on: https://pdfium-review.googlesource.com/16751 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-25Convert JS input params to v8::Local<v8::Value>>sdan sinclair
This CL converts the JS set_* methods and the JSMethod methods to accept v8::Local<v8::Value> objects instead of CJS_Value objects. Change-Id: I6de41305deff458eba515bdc3462522b502f74ad Reviewed-on: https://pdfium-review.googlesource.com/16670 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-10-23Remove CJS_PropValueDan Sinclair
This CL removes the CJS_PropValue class and uses CJS_Value directly. The various Set methods have been moved to CJS_Value and the runtime provided as needed. Change-Id: Ib5d3b9efc9b6cf8182be8f19af98599379c3d7db Reviewed-on: https://pdfium-review.googlesource.com/16431 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-10-19Cleanup not supported Field codedan sinclair
This CL removes the methods in Field which are marked Not Supported. This also removes the setting of the delay flags for those fields as the delay will do nothing. Change-Id: I5b6fd9d48d89e1e9287ed0b1aea0a24abd22f45d Reviewed-on: https://pdfium-review.googlesource.com/16390 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-10-19Cleanup visiblity in Fielddan sinclair
This CL shuffles some methods around in the Field declaration and cleans up the visibility as needed. Change-Id: Icff3bd791d734c3baa69fd092a2f96058eaf62fd Reviewed-on: https://pdfium-review.googlesource.com/16370 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-10-19Refactoring JS Callbacks.dan sinclair
This CL updates the fpdfsdk/javascript callbacks to have explicit get/set methods instead of one method which worked differently depending on the mode. This allows better ownership of the passed in params, (get takes a * and set takes a const&). The Value object was changed to have To* and Set methods to make the code clearer compared to the operator<< and operator>> overloading. Bug: Change-Id: Id6ff20a4e3252adfd0a78b643e50b9f095085018 Reviewed-on: https://pdfium-review.googlesource.com/16330 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-21Move CFX_Observable to ObservableDan Sinclair
This CL renames CFX_Observable to Observable and moves into the fxcrt namespace. The test suite names were updated to ObservedPtr from fxcrt. Bug: pdfium:898 Change-Id: Ia507482bc0a1d6d8bbf12c0c55c4a88f6c8910e2 Reviewed-on: https://pdfium-review.googlesource.com/14615 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-18Convert string class namesRyan Harrison
Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-07-13Rename CPWL_Color to CFX_ColorDan Sinclair
This CL moves fpdfsdk/pdfwindow/cpwl_color to core/fxge/cfx_color. Change-Id: Ia95b7fba2c76a1b9a438014d3598c7aa55bbb2ab Reviewed-on: https://pdfium-review.googlesource.com/7753 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-06-02Rename PWL_FooBar files to cpwl_foo_bar.Lei Zhang
Change-Id: I7ed0ba0acbbee291e285555974ebf50c0073668f Reviewed-on: https://pdfium-review.googlesource.com/6250 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-02-21Pass CJS_Runtime to JS callbacks.Tom Sepez
This is much more convenient, since only a fraction of them need an IJS_EventContext, which can be obtained from the CJS_Runtime. Make GetCurrentEventContext() specific to CJS_Runtime, and return the concrete type. This saves a lot of casting. Change-Id: If79a3bcbf44de513f3caace153099234cc313d47 Reviewed-on: https://pdfium-review.googlesource.com/2793 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-02-16Rename IJS_Context to IJS_EventContext.Tom Sepez
Prevents confusion with v8::Context, which is wrapped by a different IJS_ class. Change-Id: Iff75809e65015c0f810294de1f0d8ecf963150a3 Reviewed-on: https://pdfium-review.googlesource.com/2751 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2016-11-04Revert: Only create widgets if really neededdsinclair
This CL reverts ef523dd36aea991084b8b934df846014a5c09c6f which causes issues with syncing of form fields over pages. The initial bug had follow on fixes which seem to have rendered this fix un-needed. BUG=chromium:632709, chromium:661294 Review-Url: https://codereview.chromium.org/2473103003
2016-11-02Remove FX_BOOL from fpdfsdk.tsepez
Review-Url: https://codereview.chromium.org/2453683011
2016-10-11Convert Field to use CPDFSDK_FormFillEnvironmentdsinclair
This CL changes Field from using a CPDFSDK_Document to using a CPDFSDK_FormFillEnvironment. Review-Url: https://codereview.chromium.org/2400443005
2016-09-29Move fpdfsdk/include to fpdfsdkdsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2384503003
2016-09-29Move core/fxcrt/include to core/fxcrtdsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2382723003
2016-09-13Split fsdk_mgr files apart.dsinclair
This CL separates the CPDFDoc_Environment, CPDFSDK_Document and CPDFSDK_PageView classes into their own h and cpp files. Review-Url: https://codereview.chromium.org/2335243002
2016-09-12Make javascript field observe sdk documenttsepez
Review-Url: https://codereview.chromium.org/2337583002
2016-08-15Push v8::Isolate into CFXJS_Engine classchromium/2831tsepez
Nearly all the "loose" functions in FXJS become methods on the CFJXS_Engine. This is the "missing link" wrt some layering violatons that have been around forever. We can stop passing &m_ variables from CJS_ down into FXJS Initialization as a result. Review-Url: https://codereview.chromium.org/2245863002
2016-08-15Only create widgets if really needed.dsinclair
Currently the GetWidget call will create a backing widget for a control behind the scenes if it doesn't exist. This can cause more work to be done then needed as we may need to create the page and any supporting structures. This created structure will then be torn down as we don't need it anymore once we're done with the widget. For the instances where setting the value on the widget will have no effect (as we'll destroy it anyway) we can tell GetWidget() to not create the widget and return without doing any work. BUG=pdfium:632709 Review-Url: https://codereview.chromium.org/2251453002
2016-07-13Remove RichText support from fpdfsdk/fxedit.dsinclair
This CL removes the support code for RichText from fxedit as it is currently unused. Review-Url: https://codereview.chromium.org/2146503002
2016-06-20Change func(void) to func()weili
Since PDFium is compiled as C++ code, the void keyword is not needed. BUG=pdfium:519 Review-Url: https://codereview.chromium.org/2084603003
2016-06-15Make code compile with clang_use_chrome_plugin (part IV)weili
This change mainly contains files in fpdfsdk/ directory. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. The changes are mainly the following: -- move inline constructor/destructor of complex class/struct out-of-line; -- add constructor/destructor of complex class/struct if not explicitly defined; -- add explicit out-of-line copy constructor when needed; -- move inline virtual functions out-of-line; -- Properly mark virtual functions with 'override'; -- some minor cleanups plus removing an unused file and splitting cxfa_eventparam out from fxfa.h BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2062313002
2016-03-28use std::vector in more places in JavaScript bindings code.tsepez
use unique_ptrs for app:m_Timers. BUG= Review URL: https://codereview.chromium.org/1834203002
2016-03-25Remove FX_DWORD from fpdfsdk/ and testingtsepez
BUG= Review URL: https://codereview.chromium.org/1835693002
2016-03-25Replace CFX_DWordArray with CFX_ArrayTemplate<FX_DWORD>.Tom Sepez
First step to getting rid of FX_DWORD. R=ochang@chromium.org Review URL: https://codereview.chromium.org/1832113003 .
2016-03-23Move the fpdfsdk/include/pdfwindow/ headers into fpdfsdk/pdfwindow.dan sinclair
This CL moves all of the pdfwindow headers to live beside their source files. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1823153002 .
2016-03-14Move fpdfsdk/src up to fpdfsdk/.Dan Sinclair
This CL moves the files in fpdfsdk/src/ up one level to fpdfsdk/ and fixes up the include paths, include guards and build files. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1799773002 .