Fix incorrect CPDFSDK_PageView::CountAnnots().
[pdfium.git] / pdfium.gyp
index 7cfb298..e98a4ee 100644 (file)
@@ -1,6 +1,7 @@
 {
   'variables': {
     'pdf_use_skia%': 0,
+    'pdf_enable_v8%': 1,
     'conditions': [
       ['OS=="linux"', {
         'bundle_freetype%': 0,
@@ -23,6 +24,9 @@
       ['pdf_use_skia==1', {
         'defines': ['_SKIA_SUPPORT_'],
       }],
+      ['pdf_enable_v8==1', {
+        'defines': ['PDF_ENABLE_V8'],
+      }],
       ['OS=="linux"', {
         'conditions': [
           ['target_arch=="x64"', {
@@ -56,7 +60,6 @@
         'fxedit',
         'fxge',
         'javascript',
-        'jsapi',
         'pdfwindow',
       ],
       'ldflags': [ '-L<(PRODUCT_DIR)',],
@@ -86,8 +89,6 @@
         'fpdfsdk/src/fsdk_baseform.cpp',
         'fpdfsdk/src/fsdk_mgr.cpp',
         'fpdfsdk/src/fsdk_rendercontext.cpp',
-        'fpdfsdk/src/fpdfsdkdll.rc',
-        'fpdfsdk/src/resource.h',
         'public/fpdf_dataavail.h',
         'public/fpdf_doc.h',
         'public/fpdf_edit.h',
         'public/fpdfview.h',
       ],
       'conditions': [
-        ['OS!="win"', {
-          'sources!': [
-            'fpdfsdk/src/fpdfsdkdll.rc',
-          ],
-        }],
         ['bundle_freetype==1', {
           'dependencies': [
-            'third_party/third_party.gyp:freetype',
+            'third_party/third_party.gyp:fx_freetype',
           ],
         }, {
           'link_settings': {
         'core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp',
         'core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-H_4.cpp',
         'core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-V_4.cpp',
-        'core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-H_5.cpp',
-        'core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-V_5.cpp',
         'core/src/fpdfapi/fpdf_cmaps/Japan1/V_1.cpp',
         'core/src/fpdfapi/fpdf_cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp',
         'core/src/fpdfapi/fpdf_cmaps/Korea1/cmaps_korea1.cpp',
         'core/src/fpdfapi/fpdf_page/fpdf_page_path.cpp',
         'core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp',
         'core/src/fpdfapi/fpdf_page/pageint.h',
-        'core/src/fpdfapi/fpdf_parser/filters_int.h',
         'core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp',
         'core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp',
         'core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp',
         'core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp',
-        'core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp',
         'core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp',
         'core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp',
         'core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp',
         'core/src/fpdftext/txtproc.h',
         'core/src/fpdftext/unicodenormalization.cpp',
         'core/src/fpdftext/unicodenormalizationdata.cpp',
+        'core/src/fpdftext/unicodenormalizationdata.h',
       ],
     },
     {
       'sources': [
         'core/include/fxcodec/fx_codec.h',
         'core/include/fxcodec/fx_codec_def.h',
+        'core/include/fxcodec/fx_codec_flate.h',
         'core/include/fxcodec/fx_codec_provider.h',
         'core/src/fxcodec/codec/codec_int.h',
         'core/src/fxcodec/codec/fx_codec.cpp',
         'core/src/fxcodec/codec/fx_codec_jbig_enc.cpp',
         'core/src/fxcodec/codec/fx_codec_jpeg.cpp',
         'core/src/fxcodec/codec/fx_codec_jpx_opj.cpp',
-        'core/src/fxcodec/fx_zlib/include/fx_zlib.h',
+        'core/src/fxcodec/jbig2/JBig2_ArithDecoder.cpp',
         'core/src/fxcodec/jbig2/JBig2_ArithDecoder.h',
         'core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp',
         'core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.h',
-        'core/src/fxcodec/jbig2/JBig2_ArithQe.h',
+        'core/src/fxcodec/jbig2/JBig2_BitStream.cpp',
         'core/src/fxcodec/jbig2/JBig2_BitStream.h',
         'core/src/fxcodec/jbig2/JBig2_Context.cpp',
         'core/src/fxcodec/jbig2/JBig2_Context.h',
         'core/src/fxcodec/jbig2/JBig2_Define.h',
-        'core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp',
-        'core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h',
+        'core/src/fxcodec/jbig2/JBig2_GrdProc.cpp',
+        'core/src/fxcodec/jbig2/JBig2_GrdProc.h',
+        'core/src/fxcodec/jbig2/JBig2_GrrdProc.cpp',
+        'core/src/fxcodec/jbig2/JBig2_GrrdProc.h',
+        'core/src/fxcodec/jbig2/JBig2_GsidProc.cpp',
+        'core/src/fxcodec/jbig2/JBig2_GsidProc.h',
+        'core/src/fxcodec/jbig2/JBig2_HtrdProc.cpp',
+        'core/src/fxcodec/jbig2/JBig2_HtrdProc.h',
         'core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp',
         'core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.h',
         'core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp',
         'core/src/fxcodec/jbig2/JBig2_Image.cpp',
         'core/src/fxcodec/jbig2/JBig2_Image.h',
         'core/src/fxcodec/jbig2/JBig2_List.h',
-        'core/src/fxcodec/jbig2/JBig2_Module.h',
-        'core/src/fxcodec/jbig2/JBig2_Object.cpp',
-        'core/src/fxcodec/jbig2/JBig2_Object.h',
         'core/src/fxcodec/jbig2/JBig2_Page.h',
         'core/src/fxcodec/jbig2/JBig2_PatternDict.cpp',
         'core/src/fxcodec/jbig2/JBig2_PatternDict.h',
+        'core/src/fxcodec/jbig2/JBig2_PddProc.cpp',
+        'core/src/fxcodec/jbig2/JBig2_PddProc.h',
+        'core/src/fxcodec/jbig2/JBig2_SddProc.cpp',
+        'core/src/fxcodec/jbig2/JBig2_SddProc.h',
         'core/src/fxcodec/jbig2/JBig2_Segment.cpp',
         'core/src/fxcodec/jbig2/JBig2_Segment.h',
         'core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp',
         'core/src/fxcodec/jbig2/JBig2_SymbolDict.h',
-        'core/src/fxcodec/lcms2/fx_lcms2.h',
-        'core/src/fxcodec/lcms2/fx_lcms2_plugin.h',
-        'core/src/fxcodec/libjpeg/fx_libjpeg.h',
+        'core/src/fxcodec/jbig2/JBig2_TrdProc.cpp',
+        'core/src/fxcodec/jbig2/JBig2_TrdProc.h',
       ],
       'msvs_settings': {
         'VCCLCompilerTool': {
       'type': 'static_library',
       'ldflags': [ '-L<(PRODUCT_DIR)',],
       'sources': [
-        'core/include/fxcrt/fx_arb.h',
         'core/include/fxcrt/fx_basic.h',
+        'core/include/fxcrt/fx_bidi.h',
         'core/include/fxcrt/fx_coordinates.h',
         'core/include/fxcrt/fx_ext.h',
         'core/include/fxcrt/fx_memory.h',
         'core/src/fxcrt/fxcrt_posix.h',
         'core/src/fxcrt/fxcrt_windows.cpp',
         'core/src/fxcrt/fxcrt_windows.h',
-        'core/src/fxcrt/fx_arabic.cpp',
-        'core/src/fxcrt/fx_arabic.h',
         'core/src/fxcrt/fx_basic_array.cpp',
         'core/src/fxcrt/fx_basic_bstring.cpp',
         'core/src/fxcrt/fx_basic_buffer.cpp',
         'core/src/fxcrt/fx_basic_utf.cpp',
         'core/src/fxcrt/fx_basic_util.cpp',
         'core/src/fxcrt/fx_basic_wstring.cpp',
+        'core/src/fxcrt/fx_bidi.cpp',
         'core/src/fxcrt/fx_extension.cpp',
         'core/src/fxcrt/fx_ucddata.cpp',
         'core/src/fxcrt/fx_unicode.cpp',
         'core/src/fxge/dib/fx_dib_engine.cpp',
         'core/src/fxge/dib/fx_dib_main.cpp',
         'core/src/fxge/dib/fx_dib_transform.cpp',
+        'core/src/fxge/fontdata/chromefontdata/chromefontdata.h',
         'core/src/fxge/fontdata/chromefontdata/FoxitDingbats.c',
         'core/src/fxge/fontdata/chromefontdata/FoxitFixed.c',
         'core/src/fxge/fontdata/chromefontdata/FoxitFixedBold.c',
         'core/src/fxge/ge/fx_ge_text.cpp',
         'core/src/fxge/ge/text_int.h',
       ],
+      'variables': {
+        'clang_warning_flags': [
+          # http://code.google.com/p/pdfium/issues/detail?id=188
+          '-Wno-switch',
+        ],
+      },
       'conditions': [
         ['pdf_use_skia==1', {
           'sources': [
     {
       'target_name': 'javascript',
       'type': 'static_library',
-      'include_dirs': [
-        '<(DEPTH)/v8',
-        '<(DEPTH)/v8/include',
-      ],
-      'dependencies': [
-        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
-      ],
-      'export_dependent_settings': [
-        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
-      ],
       'ldflags': [ '-L<(PRODUCT_DIR)',],
       'sources': [
-        'fpdfsdk/include/javascript/app.h',
-        'fpdfsdk/include/javascript/color.h',
-        'fpdfsdk/include/javascript/console.h',
-        'fpdfsdk/include/javascript/Consts.h',
-        'fpdfsdk/include/javascript/Document.h',
-        'fpdfsdk/include/javascript/event.h',
-        'fpdfsdk/include/javascript/Field.h',
-        'fpdfsdk/include/javascript/global.h',
-        'fpdfsdk/include/javascript/Icon.h',
         'fpdfsdk/include/javascript/IJavaScript.h',
-        'fpdfsdk/include/javascript/JavaScript.h',
-        'fpdfsdk/include/javascript/JS_Context.h',
-        'fpdfsdk/include/javascript/JS_Define.h',
-        'fpdfsdk/include/javascript/JS_EventHandler.h',
-        'fpdfsdk/include/javascript/JS_GlobalData.h',
-        'fpdfsdk/include/javascript/JS_Object.h',
-        'fpdfsdk/include/javascript/JS_Runtime.h',
-        'fpdfsdk/include/javascript/JS_Value.h',
-        'fpdfsdk/include/javascript/PublicMethods.h',
-        'fpdfsdk/include/javascript/report.h',
-        'fpdfsdk/include/javascript/resource.h',
-        'fpdfsdk/include/javascript/util.h',
-        'fpdfsdk/src/javascript/app.cpp',
-        'fpdfsdk/src/javascript/color.cpp',
-        'fpdfsdk/src/javascript/console.cpp',
-        'fpdfsdk/src/javascript/Consts.cpp',
-        'fpdfsdk/src/javascript/Document.cpp',
-        'fpdfsdk/src/javascript/event.cpp',
-        'fpdfsdk/src/javascript/Field.cpp',
-        'fpdfsdk/src/javascript/global.cpp',
-        'fpdfsdk/src/javascript/Icon.cpp',
-        'fpdfsdk/src/javascript/JS_Context.cpp',
-        'fpdfsdk/src/javascript/JS_EventHandler.cpp',
-        'fpdfsdk/src/javascript/JS_GlobalData.cpp',
-        'fpdfsdk/src/javascript/JS_Object.cpp',
-        'fpdfsdk/src/javascript/JS_Runtime.cpp',
-        'fpdfsdk/src/javascript/JS_Value.cpp',
-        'fpdfsdk/src/javascript/PublicMethods.cpp',
-        'fpdfsdk/src/javascript/report.cpp',
-        'fpdfsdk/src/javascript/resource.cpp',
-        'fpdfsdk/src/javascript/util.cpp',
-      ],
-    },
-    {
-      'target_name': 'jsapi',
-      'type': 'static_library',
-      'dependencies': [
-        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
-      ],
-      'export_dependent_settings': [
-        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
-      ],
-      'include_dirs': [
-        '<(DEPTH)/v8',
-        '<(DEPTH)/v8/include',
+        'fpdfsdk/src/javascript/JS_Runtime_Stub.cpp',
       ],
-      'ldflags': [ '-L<(PRODUCT_DIR)',],
-      'sources': [
-        'fpdfsdk/include/jsapi/fxjs_v8.h',
-        'fpdfsdk/src/jsapi/fxjs_v8.cpp',
+      'conditions': [
+        ['pdf_enable_v8==1', {
+          'include_dirs': [
+            '<(DEPTH)/v8',
+            '<(DEPTH)/v8/include',
+          ],
+          'dependencies': [
+            '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
+          ],
+          'export_dependent_settings': [
+            '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
+          ],
+          'sources!': [
+            'fpdfsdk/src/javascript/JS_Runtime_Stub.cpp',
+          ],
+          'sources': [
+            'fpdfsdk/src/javascript/Consts.cpp',
+            'fpdfsdk/src/javascript/Consts.h',
+            'fpdfsdk/src/javascript/Document.cpp',
+            'fpdfsdk/src/javascript/Document.h',
+            'fpdfsdk/src/javascript/Field.cpp',
+            'fpdfsdk/src/javascript/Field.h',
+            'fpdfsdk/src/javascript/Icon.cpp',
+            'fpdfsdk/src/javascript/Icon.h',
+            'fpdfsdk/src/javascript/JS_Context.cpp',
+            'fpdfsdk/src/javascript/JS_Context.h',
+            'fpdfsdk/src/javascript/JS_Define.h',
+            'fpdfsdk/src/javascript/JS_EventHandler.cpp',
+            'fpdfsdk/src/javascript/JS_EventHandler.h',
+            'fpdfsdk/src/javascript/JS_GlobalData.cpp',
+            'fpdfsdk/src/javascript/JS_GlobalData.h',
+            'fpdfsdk/src/javascript/JS_Object.cpp',
+            'fpdfsdk/src/javascript/JS_Object.h',
+            'fpdfsdk/src/javascript/JS_Runtime.cpp',
+            'fpdfsdk/src/javascript/JS_Runtime.h',
+            'fpdfsdk/src/javascript/JS_Value.cpp',
+            'fpdfsdk/src/javascript/JS_Value.h',
+            'fpdfsdk/src/javascript/PublicMethods.cpp',
+            'fpdfsdk/src/javascript/PublicMethods.h',
+            'fpdfsdk/src/javascript/app.cpp',
+            'fpdfsdk/src/javascript/app.cpp',
+            'fpdfsdk/src/javascript/app.h',
+            'fpdfsdk/src/javascript/color.cpp',
+            'fpdfsdk/src/javascript/color.cpp',
+            'fpdfsdk/src/javascript/color.h',
+            'fpdfsdk/src/javascript/console.cpp',
+            'fpdfsdk/src/javascript/console.cpp',
+            'fpdfsdk/src/javascript/console.h',
+            'fpdfsdk/src/javascript/event.cpp',
+            'fpdfsdk/src/javascript/event.h',
+            'fpdfsdk/src/javascript/global.cpp',
+            'fpdfsdk/src/javascript/global.h',
+            'fpdfsdk/src/javascript/report.cpp',
+            'fpdfsdk/src/javascript/report.h',
+            'fpdfsdk/src/javascript/resource.cpp',
+            'fpdfsdk/src/javascript/resource.h',
+            'fpdfsdk/src/javascript/util.cpp',
+            'fpdfsdk/src/javascript/util.h',
+            'fpdfsdk/include/jsapi/fxjs_v8.h',
+            'fpdfsdk/src/jsapi/fxjs_v8.cpp',
+          ],
+        }],
       ],
     },
     {
         'fpdfsdk/include/formfiller/FFL_FormFiller.h',
         'fpdfsdk/include/formfiller/FFL_IFormFiller.h',
         'fpdfsdk/include/formfiller/FFL_ListBox.h',
-        'fpdfsdk/include/formfiller/FFL_Notify.h',
         'fpdfsdk/include/formfiller/FFL_PushButton.h',
         'fpdfsdk/include/formfiller/FFL_RadioButton.h',
         'fpdfsdk/include/formfiller/FFL_TextField.h',
-        'fpdfsdk/include/formfiller/FFL_Utils.h',
         'fpdfsdk/include/formfiller/FormFiller.h',
         'fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp',
         'fpdfsdk/src/formfiller/FFL_CheckBox.cpp',
         'fpdfsdk/src/formfiller/FFL_FormFiller.cpp',
         'fpdfsdk/src/formfiller/FFL_IFormFiller.cpp',
         'fpdfsdk/src/formfiller/FFL_ListBox.cpp',
-        'fpdfsdk/src/formfiller/FFL_Notify.cpp',
         'fpdfsdk/src/formfiller/FFL_PushButton.cpp',
         'fpdfsdk/src/formfiller/FFL_RadioButton.cpp',
         'fpdfsdk/src/formfiller/FFL_TextField.cpp',
-        'fpdfsdk/src/formfiller/FFL_Utils.cpp',
       ],
     },
     {
         '<(DEPTH)/testing/gtest.gyp:gtest_main',
         '<(DEPTH)/testing/gtest.gyp:gtest',
         'pdfium',
+        'test_support',
       ],
       'include_dirs': [
         '<(DEPTH)'
         'core/src/fxcrt/fx_basic_bstring_unittest.cpp',
         'core/src/fxcrt/fx_basic_memmgr_unittest.cpp',
         'core/src/fxcrt/fx_basic_wstring_unittest.cpp',
+        'core/src/fxcrt/fx_bidi_unittest.cpp',
+        'core/src/fxcrt/fx_system_unittest.cpp',
         'testing/fx_string_testhelpers.h',
         'testing/fx_string_testhelpers.cpp',
+        'third_party/base/nonstd_unique_ptr_unittest.cpp',
       ],
     },
     {
       'dependencies': [
         '<(DEPTH)/testing/gmock.gyp:gmock',
         '<(DEPTH)/testing/gtest.gyp:gtest',
-        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8_libplatform',
         'pdfium',
+        'test_support',
       ],
       'include_dirs': [
         '<(DEPTH)',
-        '<(DEPTH)/v8',
       ],
       'sources': [
         'core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_embeddertest.cpp',
         'core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp',
+        'core/src/fpdfapi/fpdf_render/fpdf_render_pattern_embeddertest.cpp',
         'fpdfsdk/src/fpdf_dataavail_embeddertest.cpp',
         'fpdfsdk/src/fpdfdoc_embeddertest.cpp',
         'fpdfsdk/src/fpdfformfill_embeddertest.cpp',
         'testing/embedder_test.h',
         'testing/embedder_test_mock_delegate.h',
         'testing/embedder_test_timer_handling_delegate.h',
+      ],
+      'conditions': [
+        ['pdf_enable_v8==1', {
+          'include_dirs': [
+            '<(DEPTH)/v8',
+            '<(DEPTH)/v8/include',
+          ],
+          'dependencies': [
+            '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
+            '<(DEPTH)/v8/tools/gyp/v8.gyp:v8_libplatform',
+          ],
+          'sources': [
+            'fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp',
+          ],
+        }],
+      ],
+    },
+    {
+      'target_name': 'test_support',
+      'type': 'static_library',
+      'dependencies': [
+        '<(DEPTH)/testing/gmock.gyp:gmock',
+        '<(DEPTH)/testing/gtest.gyp:gtest',
+      ],
+      'include_dirs': [
+        '<(DEPTH)',
+      ],
+      'sources': [
         'testing/fx_string_testhelpers.cpp',
         'testing/fx_string_testhelpers.h',
+        'testing/test_support.cpp',
+        'testing/test_support.h',
+      ],
+      'conditions': [
+        ['pdf_enable_v8==1', {
+          'include_dirs': [
+            '<(DEPTH)/v8',
+            '<(DEPTH)/v8/include',
+          ],
+          'dependencies': [
+            '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
+            '<(DEPTH)/v8/tools/gyp/v8.gyp:v8_libplatform',
+          ],
+        }],
       ],
     },
   ],